claude-mux 0.30.2 → 0.30.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CLAUDE.md +3 -3
  2. package/dist/hooks/claude-mux-hook.js +6 -0
  3. package/dist/hooks/claude-mux-hook.js.map +1 -1
  4. package/dist/subagents.d.ts +5 -7
  5. package/dist/subagents.d.ts.map +1 -1
  6. package/dist/subagents.js +5 -9
  7. package/dist/subagents.js.map +1 -1
  8. package/dist/utils/version.d.ts +1 -1
  9. package/dist/utils/version.js +1 -1
  10. package/dist/web/client/_app/immutable/chunks/{DiCsJZkB.js → 0itALT7D.js} +2 -2
  11. package/dist/web/client/_app/immutable/chunks/{DiCsJZkB.js.map → 0itALT7D.js.map} +1 -1
  12. package/{web/.svelte-kit/output/client/_app/immutable/chunks/CmDdyjOR.js → dist/web/client/_app/immutable/chunks/9UhVHDNs.js} +2 -2
  13. package/dist/web/client/_app/immutable/chunks/{CmDdyjOR.js.map → 9UhVHDNs.js.map} +1 -1
  14. package/dist/web/client/_app/immutable/chunks/{BR0j6UP_.js → B5hoOzZI.js} +2 -2
  15. package/dist/web/client/_app/immutable/chunks/{BR0j6UP_.js.map → B5hoOzZI.js.map} +1 -1
  16. package/dist/web/client/_app/immutable/chunks/{BRwgrbZi.js → Bcl2xWM1.js} +2 -2
  17. package/{web/.svelte-kit/output/client/_app/immutable/chunks/BRwgrbZi.js.map → dist/web/client/_app/immutable/chunks/Bcl2xWM1.js.map} +1 -1
  18. package/dist/web/client/_app/immutable/chunks/{Dmt0dCmj.js → CTgykToi.js} +2 -2
  19. package/{web/.svelte-kit/output/client/_app/immutable/chunks/Dmt0dCmj.js.map → dist/web/client/_app/immutable/chunks/CTgykToi.js.map} +1 -1
  20. package/{web/.svelte-kit/output/client/_app/immutable/chunks/juU6kBhv.js → dist/web/client/_app/immutable/chunks/D4VtXq1u.js} +2 -2
  21. package/{web/.svelte-kit/output/client/_app/immutable/chunks/juU6kBhv.js.map → dist/web/client/_app/immutable/chunks/D4VtXq1u.js.map} +1 -1
  22. package/dist/web/client/_app/immutable/chunks/{CJ5X49p2.js → DJPAeXBZ.js} +2 -2
  23. package/dist/web/client/_app/immutable/chunks/{CJ5X49p2.js.map → DJPAeXBZ.js.map} +1 -1
  24. package/dist/web/client/_app/immutable/chunks/{Cb0yiQIh.js → iD86EAaZ.js} +3 -3
  25. package/dist/web/client/_app/immutable/chunks/{Cb0yiQIh.js.map → iD86EAaZ.js.map} +1 -1
  26. package/dist/web/client/_app/immutable/chunks/uNuVvgdW.js +2 -0
  27. package/dist/web/client/_app/immutable/chunks/uNuVvgdW.js.map +1 -0
  28. package/dist/web/client/_app/immutable/entry/{app.BNsXYIeZ.js → app.D_c8YH2_.js} +3 -3
  29. package/dist/web/client/_app/immutable/entry/{app.BNsXYIeZ.js.map → app.D_c8YH2_.js.map} +1 -1
  30. package/dist/web/client/_app/immutable/entry/start.C4kxbL3U.js +2 -0
  31. package/dist/web/client/_app/immutable/entry/start.C4kxbL3U.js.map +1 -0
  32. package/dist/web/client/_app/immutable/nodes/{0.Cga09Vlt.js → 0.DKJz_Waz.js} +2 -2
  33. package/dist/web/client/_app/immutable/nodes/{0.Cga09Vlt.js.map → 0.DKJz_Waz.js.map} +1 -1
  34. package/dist/web/client/_app/immutable/nodes/{1.C5UTjGXy.js → 1.BMuM5b-K.js} +2 -2
  35. package/dist/web/client/_app/immutable/nodes/{1.C5UTjGXy.js.map → 1.BMuM5b-K.js.map} +1 -1
  36. package/dist/web/client/_app/immutable/nodes/{2.C76yPG3X.js → 2.B5-VVL7z.js} +2 -2
  37. package/dist/web/client/_app/immutable/nodes/{2.C76yPG3X.js.map → 2.B5-VVL7z.js.map} +1 -1
  38. package/dist/web/client/_app/immutable/nodes/{3.Tbj29aAW.js → 3.Ch8jV9KV.js} +2 -2
  39. package/{web/.svelte-kit/output/client/_app/immutable/nodes/3.Tbj29aAW.js.map → dist/web/client/_app/immutable/nodes/3.Ch8jV9KV.js.map} +1 -1
  40. package/dist/web/client/_app/immutable/nodes/{4.D0z9Wo_G.js → 4.3R3T2cvf.js} +2 -2
  41. package/{web/.svelte-kit/output/client/_app/immutable/nodes/4.D0z9Wo_G.js.map → dist/web/client/_app/immutable/nodes/4.3R3T2cvf.js.map} +1 -1
  42. package/dist/web/client/_app/version.json +1 -1
  43. package/dist/web/server/chunks/{0-BZ0-GFAV.js → 0-DI9lJoOL.js} +11 -11
  44. package/dist/web/server/chunks/{0-BZ0-GFAV.js.map → 0-DI9lJoOL.js.map} +1 -1
  45. package/dist/web/server/chunks/{1-DoI2jsEL.js → 1-DNXibdVD.js} +3 -3
  46. package/dist/web/server/chunks/{1-DoI2jsEL.js.map → 1-DNXibdVD.js.map} +1 -1
  47. package/dist/web/server/chunks/{2-6BGBaYuT.js → 2-BjADtyO0.js} +8 -8
  48. package/dist/web/server/chunks/{2-6BGBaYuT.js.map → 2-BjADtyO0.js.map} +1 -1
  49. package/dist/web/server/chunks/{3-B9fgRoyO.js → 3-C3xjKapD.js} +9 -9
  50. package/dist/web/server/chunks/{3-B9fgRoyO.js.map → 3-C3xjKapD.js.map} +1 -1
  51. package/dist/web/server/chunks/{4-CIa0l25T.js → 4-x9zcPGad.js} +8 -8
  52. package/dist/web/server/chunks/{4-CIa0l25T.js.map → 4-x9zcPGad.js.map} +1 -1
  53. package/dist/web/server/chunks/{_layout.svelte-C2cdd9CG.js → _layout.svelte-CEcgZvgF.js} +3 -6
  54. package/dist/web/server/chunks/_layout.svelte-CEcgZvgF.js.map +1 -0
  55. package/dist/web/server/index.js +1 -1
  56. package/dist/web/server/index.js.map +1 -1
  57. package/dist/web/server/manifest.js +11 -11
  58. package/dist/web/server/manifest.js.map +1 -1
  59. package/package.json +1 -1
  60. package/src/hooks/claude-mux-hook.ts +6 -0
  61. package/src/subagents.ts +7 -11
  62. package/src/utils/version.ts +1 -1
  63. package/tests/hooks/subagents.test.ts +12 -0
  64. package/tests/subagents.test.ts +7 -7
  65. package/web/.svelte-kit/adapter-bun/chunks/internal2.js +1 -1
  66. package/web/.svelte-kit/adapter-bun/chunks/internal2.js.map +1 -1
  67. package/web/.svelte-kit/adapter-bun/chunks/subagents.js +2 -5
  68. package/web/.svelte-kit/adapter-bun/chunks/subagents.js.map +1 -1
  69. package/web/.svelte-kit/adapter-bun/manifest-full.js +1 -1
  70. package/web/.svelte-kit/adapter-bun/manifest.js +1 -1
  71. package/web/.svelte-kit/adapter-bun/nodes/0.js +1 -1
  72. package/web/.svelte-kit/adapter-bun/nodes/1.js +1 -1
  73. package/web/.svelte-kit/adapter-bun/nodes/2.js +1 -1
  74. package/web/.svelte-kit/adapter-bun/nodes/3.js +1 -1
  75. package/web/.svelte-kit/adapter-bun/nodes/4.js +1 -1
  76. package/web/.svelte-kit/generated/server/internal.js +1 -1
  77. package/web/.svelte-kit/output/client/.vite/manifest.json +126 -126
  78. package/web/.svelte-kit/output/client/_app/immutable/chunks/{DiCsJZkB.js → 0itALT7D.js} +2 -2
  79. package/web/.svelte-kit/output/client/_app/immutable/chunks/{DiCsJZkB.js.map → 0itALT7D.js.map} +1 -1
  80. package/{dist/web/client/_app/immutable/chunks/CmDdyjOR.js → web/.svelte-kit/output/client/_app/immutable/chunks/9UhVHDNs.js} +2 -2
  81. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CmDdyjOR.js.map → 9UhVHDNs.js.map} +1 -1
  82. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BR0j6UP_.js → B5hoOzZI.js} +2 -2
  83. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BR0j6UP_.js.map → B5hoOzZI.js.map} +1 -1
  84. package/web/.svelte-kit/output/client/_app/immutable/chunks/{BRwgrbZi.js → Bcl2xWM1.js} +2 -2
  85. package/{dist/web/client/_app/immutable/chunks/BRwgrbZi.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/Bcl2xWM1.js.map} +1 -1
  86. package/web/.svelte-kit/output/client/_app/immutable/chunks/{Dmt0dCmj.js → CTgykToi.js} +2 -2
  87. package/{dist/web/client/_app/immutable/chunks/Dmt0dCmj.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/CTgykToi.js.map} +1 -1
  88. package/{dist/web/client/_app/immutable/chunks/juU6kBhv.js → web/.svelte-kit/output/client/_app/immutable/chunks/D4VtXq1u.js} +2 -2
  89. package/{dist/web/client/_app/immutable/chunks/juU6kBhv.js.map → web/.svelte-kit/output/client/_app/immutable/chunks/D4VtXq1u.js.map} +1 -1
  90. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CJ5X49p2.js → DJPAeXBZ.js} +2 -2
  91. package/web/.svelte-kit/output/client/_app/immutable/chunks/{CJ5X49p2.js.map → DJPAeXBZ.js.map} +1 -1
  92. package/web/.svelte-kit/output/client/_app/immutable/chunks/{Cb0yiQIh.js → iD86EAaZ.js} +3 -3
  93. package/web/.svelte-kit/output/client/_app/immutable/chunks/{Cb0yiQIh.js.map → iD86EAaZ.js.map} +1 -1
  94. package/web/.svelte-kit/output/client/_app/immutable/chunks/uNuVvgdW.js +2 -0
  95. package/web/.svelte-kit/output/client/_app/immutable/chunks/uNuVvgdW.js.map +1 -0
  96. package/web/.svelte-kit/output/client/_app/immutable/entry/{app.BNsXYIeZ.js → app.D_c8YH2_.js} +3 -3
  97. package/web/.svelte-kit/output/client/_app/immutable/entry/{app.BNsXYIeZ.js.map → app.D_c8YH2_.js.map} +1 -1
  98. package/web/.svelte-kit/output/client/_app/immutable/entry/start.C4kxbL3U.js +2 -0
  99. package/web/.svelte-kit/output/client/_app/immutable/entry/start.C4kxbL3U.js.map +1 -0
  100. package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.Cga09Vlt.js → 0.DKJz_Waz.js} +2 -2
  101. package/web/.svelte-kit/output/client/_app/immutable/nodes/{0.Cga09Vlt.js.map → 0.DKJz_Waz.js.map} +1 -1
  102. package/web/.svelte-kit/output/client/_app/immutable/nodes/{1.C5UTjGXy.js → 1.BMuM5b-K.js} +2 -2
  103. package/web/.svelte-kit/output/client/_app/immutable/nodes/{1.C5UTjGXy.js.map → 1.BMuM5b-K.js.map} +1 -1
  104. package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.C76yPG3X.js → 2.B5-VVL7z.js} +2 -2
  105. package/web/.svelte-kit/output/client/_app/immutable/nodes/{2.C76yPG3X.js.map → 2.B5-VVL7z.js.map} +1 -1
  106. package/web/.svelte-kit/output/client/_app/immutable/nodes/{3.Tbj29aAW.js → 3.Ch8jV9KV.js} +2 -2
  107. package/{dist/web/client/_app/immutable/nodes/3.Tbj29aAW.js.map → web/.svelte-kit/output/client/_app/immutable/nodes/3.Ch8jV9KV.js.map} +1 -1
  108. package/web/.svelte-kit/output/client/_app/immutable/nodes/{4.D0z9Wo_G.js → 4.3R3T2cvf.js} +2 -2
  109. package/{dist/web/client/_app/immutable/nodes/4.D0z9Wo_G.js.map → web/.svelte-kit/output/client/_app/immutable/nodes/4.3R3T2cvf.js.map} +1 -1
  110. package/web/.svelte-kit/output/client/_app/version.json +1 -1
  111. package/web/.svelte-kit/output/server/chunks/internal2.js +1 -1
  112. package/web/.svelte-kit/output/server/chunks/internal2.js.map +1 -1
  113. package/web/.svelte-kit/output/server/chunks/subagents.js +2 -5
  114. package/web/.svelte-kit/output/server/chunks/subagents.js.map +1 -1
  115. package/web/.svelte-kit/output/server/manifest-full.js +1 -1
  116. package/web/.svelte-kit/output/server/manifest.js +1 -1
  117. package/web/.svelte-kit/output/server/nodes/0.js +1 -1
  118. package/web/.svelte-kit/output/server/nodes/1.js +1 -1
  119. package/web/.svelte-kit/output/server/nodes/2.js +1 -1
  120. package/web/.svelte-kit/output/server/nodes/3.js +1 -1
  121. package/web/.svelte-kit/output/server/nodes/4.js +1 -1
  122. package/dist/web/client/_app/immutable/chunks/_om2syd9.js +0 -2
  123. package/dist/web/client/_app/immutable/chunks/_om2syd9.js.map +0 -1
  124. package/dist/web/client/_app/immutable/entry/start.BAAC0OQy.js +0 -2
  125. package/dist/web/client/_app/immutable/entry/start.BAAC0OQy.js.map +0 -1
  126. package/dist/web/server/chunks/_layout.svelte-C2cdd9CG.js.map +0 -1
  127. package/web/.svelte-kit/output/client/_app/immutable/chunks/_om2syd9.js +0 -2
  128. package/web/.svelte-kit/output/client/_app/immutable/chunks/_om2syd9.js.map +0 -1
  129. package/web/.svelte-kit/output/client/_app/immutable/entry/start.BAAC0OQy.js +0 -2
  130. package/web/.svelte-kit/output/client/_app/immutable/entry/start.BAAC0OQy.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"mappings":";+4BAWA,MAAMA,GAAQ,GASP,SAASC,GAASC,EAAOC,EAAe,GAAOC,EAAY,GAAO,CAuBxE,OAAOC,GAAMH,EAAO,IAAI,IAAO,GAAIF,GAAO,KAAMI,CAAS,CAC1D,CAYA,SAASC,GAAMH,EAAOI,EAAQC,EAAMC,EAAOC,EAAW,KAAML,EAAY,GAAO,CAC9E,GAAI,OAAOF,GAAU,UAAYA,IAAU,KAAM,CAChD,IAAIQ,EAAYJ,EAAO,IAAIJ,CAAK,EAChC,GAAIQ,IAAc,OAAW,OAAOA,EAEpC,GAAIR,aAAiB,IAAK,OAAmC,IAAI,IAAIA,CAAK,EAC1E,GAAIA,aAAiB,IAAK,OAAmC,IAAI,IAAIA,CAAK,EAE1E,GAAIS,GAAST,CAAK,EAAG,CACpB,IAAIU,EAAqC,MAAMV,EAAM,MAAM,EAC3DI,EAAO,IAAIJ,EAAOU,CAAI,EAElBH,IAAa,MAChBH,EAAO,IAAIG,EAAUG,CAAI,EAG1B,QAASC,EAAI,EAAGA,EAAIX,EAAM,OAAQW,GAAK,EAAG,CACzC,IAAIC,EAAUZ,EAAMW,CAAC,EACjBA,KAAKX,IACRU,EAAKC,CAAC,EAAIR,GAAMS,EAASR,EAAgCC,EAAMC,EAAO,KAAMJ,CAAS,EAEvF,CAEA,OAAOQ,CACR,CAEA,GAAIG,GAAiBb,CAAK,IAAMc,GAAkB,CAEjDJ,EAAO,GACPN,EAAO,IAAIJ,EAA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5BkF,EAAAC,GAAAN,EAAAO,EAAA,0BAeMq3C,EAAQ,CAAA7kC,EAAAC,IAAA,CAAG,IAAA9X,cAAA,QAASC,cAAA,kBAC5BuF,EAAGvB,GAAA,MAAHuB,CAAG,aAEDm3C,GAAS9kC,EAAA,2BAET+kC,GAAS/kC,EAAA,6BAHN7X,EAAO,OAEFC,KAAaoY,EAAAQ,EAAA,OAHvBrT,CAAG,MAAHA,CAAG,eATEu5B,GACN,+gBAA8gBj6B,EAAA,MAE9gB,sBAND+3C,EAAkBhlC,EAAAI,yDASd9S,OARJ,KAAK,iBAAL,IAAK85B,EAAA,WAML,SAAK,iBAAL,QAAKA,EAAA,WACL,eAAK,iBAAL,cAAKA,EAAA,OAGK,SAAAyd,sCAbH,CCJR,SAASI,GAAUhlD,EAAkB/F,EAA2B,CAC/D,GAAI+F,EAAE,SAAW/F,EAAE,OAAQ,MAAO,GAClC,QAASlE,EAAI,EAAGA,EAAIiK,EAAE,OAAQjK,IAAK,CAClC,MAAM0wB,EAAIzmB,EAAEjK,CAAC,EACP2wB,EAAIzsB,EAAElE,CAAC,EACb,GACC0wB,EAAE,QAAUC,EAAE,OACdD,EAAE,OAASC,EAAE,MACbD,EAAE,SAAWC,EAAE,QACfD,EAAE,UAAYC,EAAE,SAChBD,EAAE,WAAaC,EAAE,SAEjB,MAAO,EAET,CACA,MAAO,EACR,CAEA,MAAMu+B,EAAoB,IACA3sD,KAAO,EAAE,OAAlC,wCAAAlD,EAAA,iBAEA,IAAI8vD,EAA8B,CAC7BF,GAAU,KAAK,QAASE,CAAO,IACnC,KAAK,QAAUA,EAChB,CAEA,OAAc,CACT,KAAK,QAAQ,SAAW,IAC5B,KAAK,QAAU,GAChB,CACD,CAEO,MAAMC,GAAsB,IAAIF","names":["empty","snapshot","value","skip_warning","no_tojson","clone","cloned","path","paths","original","unwrapped","is_array","copy","i","element","get_prototype_of","object_prototype","key","createAttachmentKey","ATTACHMENT_KEY","init","immutable","context","component_context","callbacks","props","deep_read_state","version","prev","d","derived","changed","get","user_pre_effect","observe_all","run_all","user_effect","fns","untrack","run","fn","signal","STORAGE_KEYS","IS_MAC","MOD_LABEL","cache","createPersisted","detectCurrent","host","hostname","url","ServerStore","$.state","$.proxy","cached","res","data","err","serverStore","isFunction","isObject","CLASS_VALUE_PRIMITIVE_TYPES","isClassValue","item","BoxSymbol","isWritableSymbol","boxWith","getter","setter","$.derived","$.get","v","isBox","isWritableBox","boxFrom","simpleBox","boxFlatten","boxes","acc","b","toReadonlyBox","initialValue","current","$.set","composeHandlers","handlers","e","handler","COMMENT_REGEX","NEWLINE_REGEX","WHITESPACE_REGEX","PROPERTY_REGEX","COLON_REGEX","VALUE_REGEX","SEMICOLON_REGEX","TRIM_REGEX","NEWLINE","FORWARD_SLASH","ASTERISK","EMPTY_STRING","TYPE_COMMENT","TYPE_DECLARATION","index","style","options","lineno","column","updatePosition","str","lines","position","start","node","Position","whitespace","error","msg","match","re","comments","rules","c","comment","pos","declaration","prop","val","ret","trim","declarations","decls","decl","StyleToObject","iterator","styleObject","parse","hasIterator","property","NUMBER_CHAR_RE","STR_SPLITTERS","isUppercase","char","splitByCase","parts","buff","previousUpper","previousSplitter","isSplitter","isUpper","lastChar","pascalCase","p","upperFirst","camelCase","lowerFirst","cssToStyleObj","css","styleObj","name","executeCallbacks","args","callback","createParser","matcher","replacer","regex","camelToKebab","styleToCSS","styleToString","EVENT_LIST","EVENT_LIST_SET","isEventHandler","mergeProps","result","a","aIsFunction","bIsFunction","aHandler","bHandler","aIsClassValue","bIsClassValue","clsx","aIsObject","bIsObject","aIsString","bIsString","parsedStyle","parsedStyleA","parsedStyleB","srOnlyStyles","defaultWindow","getActiveElement","document","activeElement","SvelteMap","#sources","#version","state","#size","#update_version","update_version","#source","source","sources","callbackfn","this_arg","#read_all","callbackFn","s","prev_res","set","increment","v_reactions","needs_version_increase","r","ActiveElement","#document","#subscribe","window","createSubscriber","update","cleanupFocusIn","on","cleanupFocusOut","Context","#name","#key","hasContext","getContext","fallback","setContext","runEffect","flush","effect","$.user_effect","$.user_pre_effect","runWatcher","lazy","active","previousValues","values","cleanup","watch","watchPre","ElementSize","#observed","#options","#node","#window","#width","#height","node$","observer","entries","entry","boxSize","boxSizeArr","size","offsetWidth","offsetHeight","paddingWidth","paddingHeight","borderWidth","borderHeight","contentWidth","contentHeight","onDestroyEffect","afterSleep","ms","cb","afterTick","tick","ELEMENT_NODE","DOCUMENT_NODE","DOCUMENT_FRAGMENT_NODE","isHTMLElement","isDocument","isWindow","isNode","isShadowRoot","contains","parent","child","rootNode","next","getDocument","getWindow","el","DOMContext","#root","id","selector","delay","timeoutId","attachRef","ref","onChange","boolToStr","condition","boolToEmptyStrOrUndef","boolToTrueOrUndef","getDataOpenClosed","getDataTransitionAttrs","getAriaChecked","checked","indeterminate","BitsAttrs","#variant","#prefix","config","part","variantOverride","createBitsAttrs","bitsAttrs","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","ARROW_UP","END","ENTER","ESCAPE","HOME","PAGE_DOWN","PAGE_UP","SPACE","TAB","isBrowser","isIOS","getIsIOS","isElement","isElementOrSVGElement","isTouch","isFocusVisible","isNotNull","isSelectableInput","AnimationsComplete","#opts","#currentFrame","#observer","#runId","opts","#cleanup","#executeCallback","runId","executeIfCurrent","waitForAnimations","animations","animation","requestWaitForAnimations","startingStyleAttr","execute","PresenceManager","#enabled","#afterAnimations","#shouldRender","#transitionStatus","#hasMounted","#transitionFrame","#clearTransitionFrame","isOpen","noop","createId","prefixOrUid","uid","dialogAttrs","DialogRootContext","DialogRootState","#sharedProps","DialogCloseState","root","kbd.SPACE","kbd.ENTER","#props","DialogActionState","DialogTitleState","DialogDescriptionState","DialogContentState","#snippetProps","DialogOverlayState","AlertDialogCancelState","open","$.prop","$$props","onOpenChange","onOpenChangeComplete","$.props_id","level","restProps","$.rest_props","rest_excludes","titleState","mergedProps","div","$.attribute_effect","actionState","button","disabled","cancelState","BitsConfigContext","getBitsConfig","BitsConfigState","resolveConfigOption","createConfigResolver","currentOpts","createPropResolver","configOption","getProp","propValue","option","resolvePortalToProp","to","getAllContexts","target","getTarget","localTarget","instance","unmountInstance","unmount","mount","PortalConsumer","debounce","wait","timeout","debounced","isOrContainsTarget","getOwnerDocument","isClickTrulyOutside","event","contentNode","clientX","clientY","rect","CONTEXT_MENU_TRIGGER_ATTR","CONTEXT_MENU_CONTENT_ATTR","DismissibleLayerState","#interactOutsideProp","#behaviorType","#interceptedEvents","#isResponsibleLayer","#capturedPointerDown","#isFocusInsideDOMTree","#documentObj","#onFocusOutside","#unsubClickListener","#destroyed","unsubEvents","registeredNode","#resetState","#handleInteractOutside","enabled","nextNode","#addEventListeners","#handleFocus","#isTargetWithinLayer","onPointerDownCapture","#markInterceptedEvent","#markResponsibleLayer","onPointerDown","#markNonInterceptedEvent","#interactOutside","#handleDismiss","createWrappedEvent","isEventValid","isValidEvent","#isAnyEventIntercepted","backup","unsubClick","dismiss","isResponsibleLayer","eventType","#onfocuscapture","#onblurcapture","getTopMostDismissableLayer","layersArr","_","behaviorType","topMostLayer","firstLayerNode","targetIsContextMenuTrigger","nodeIsContextMenu","capturedCurrentTarget","capturedTarget","newEvent","isPrevented","interactOutsideBehavior","onInteractOutside","onFocusOutside","dismissibleLayerState","$.snippet","$.noop","EscapeLayerState","#addEventListener","#onkeydown","kbd.ESCAPE","isResponsibleEscapeLayer","clonedEvent","escapeKeydownBehavior","onEscapeKeydown","FocusScopeManager","#scopeStack","#focusHistory","#preFocusHistory","scope","candidateSelectors","candidateSelector","NoElement","matches","getRootNode","_element$getRootNode","_isInert","lookUp","_node$getAttribute","inertAtt","inert","isContentEditable","_node$getAttribute2","attValue","getCandidates","includeContainer","filter","candidates","_getCandidatesIteratively","elements","elementsToCheck","assigned","content","nestedCandidates","validCandidate","shadowRoot","validShadowRoot","_nestedCandidates","hasTabIndex","getTabIndex","getSortOrderTabIndex","isScope","tabIndex","sortOrderedTabbables","isInput","isHiddenInput","isDetailsWithSummary","getCheckedRadio","nodes","form","isTabbableRadio","radioScope","queryRadios","radioSet","isRadio","isNonTabbableRadio","isNodeAttached","_nodeRoot","nodeRoot","nodeRootHost","attached","_nodeRootHost","_nodeRootHost$ownerDo","_node$ownerDocument","_nodeRoot2","_nodeRootHost2","_nodeRootHost2$ownerD","isZeroArea","_node$getBoundingClie","width","height","isHidden","_ref","displayCheck","getShadowRoot","visible","_getComputedStyle","visibility","isDirectSummary","nodeUnderDetails","originalNode","parentElement","isDisabledFromFieldset","parentNode","isNodeMatchingSelectorFocusable","isNodeMatchingSelectorTabbable","isShadowRootTabbable","shadowHostNode","_sortByOrder","regularTabbables","orderedTabbables","candidateTabindex","sortable","tabbable","container","focusable","isTabbable","focusableCandidateSelector","isFocusable","FocusScope","#paused","#container","#manager","#cleanupFns","#setupEventListeners","#handleOpenAutoFocus","#handleCloseAutoFocus","firstTabbable","#getFirstTabbable","preFocusedElement","doc","handleFocus","lastFocused","firstFocusable","#getAllFocusables","handleKeydown","tabbables","#getTabbables","first","last","elementToFocus","trapFocus","loop","onCloseAutoFocus","onOpenAutoFocus","focusScopeState","noopPointer","TextSelectionLayerState","#unsubSelectionLock","#enabledSnapshot","#onPointerDownSnapshot","#onPointerUpSnapshot","onPointerUp","#resetSelectionLock","#pointerdown","#pointerup","isHighestLayer","preventTextSelectionOverflow","getUserSelect","body","originalBodyUserSelect","originalNodeUserSelect","setUserSelect","highestLayer","preventOverflowTextSelection","useId","prefix","SharedState","#factory","#subscribers","#state","#scope","factory","#dispose","$.effect_root","lockMap","MANAGED_PROPERTIES","initialProperties","hadInitialStyleAttribute","modifiedProperties","stopTouchMoveListener","cleanupTimeoutId","isInCleanupTransition","setManagedProperty","anyLocked","cleanupScheduledAt","bodyLockStackCount","resetBodyStyle","documentObj","initial","cancelPendingCleanup","scheduleCleanupIfNoNewLocks","currentCleanupId","cleanupFn","isAnyLocked","actualDelay","ensureInitialStyleCaptured","htmlStyle","bodyStyle","hasStableGutter","verticalScrollbarWidth","BodyScrollLock","#id","#initialState","#restoreScrollDelay","#countState","initialState","restoreScrollDelay","map","preventScroll","forceMount","contentState","$$anchor","$$arg0","focusScopeProps","EscapeLayer","$.spread_props","DismissibleLayer","TextSelectionLayer","ScrollLock","$$render","consequent","$0","node_4","$.sibling","consequent_2","overlayState","node_3","consequent_1","descriptionState","checkboxAttrs","CheckboxGroupContext","CheckboxRootContext","CheckboxRootState","group","#trueName","#trueRequired","#trueDisabled","#trueReadonly","$.snapshot","groupValue","#toggle","getCheckboxDataState","CheckboxInputState","#trueChecked","enable_legacy_mode_flag","input","input_1","$.bind_value","$.append","alternate","inputState","HiddenInput","required","type","rootState","node_2","CheckboxInput","FloatingRootContext","FloatingTooltipRootContext","FloatingRootState","tooltip","FloatingAnchorState","valueOrGetValue","getDPR","roundByDPR","dpr","getFloatingContentCSSVars","sides","min","max","round","floor","createCoords","oppositeSideMap","clamp","end","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","firstChar","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","flipAlignment","direction","list","expandPaddingObject","padding","_padding$top","_padding$right","_padding$bottom","_padding$left","getPaddingObject","rectToClientRect","x","y","computeCoordsFromPlacement","reference","floating","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","detectOverflow","_await$platform$isEle","platform","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","clippingClientRect","offsetParent","offsetScale","elementClientRect","MAX_RESET_COUNT","computePosition","middleware","platformWithDetectOverflow","statefulPlacement","resetCount","middlewareData","currentMiddleware","nextX","nextY","reset","arrow","arrowDimensions","isYAxis","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","center","offset","shouldAddOffset","alignmentOffset","flip","_middlewareData$arrow","_middlewareData$flip","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","initialSideAxis","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","placements","overflow","overflows","overflowsData","_middlewareData$flip2","_overflowsData$filter","nextIndex","nextPlacement","resetPlacement","_overflowsData$filter2","currentSideAxis","getSideOffsets","isAnySideFullyClipped","hide","offsets","originSides","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","_middlewareData$offse","diffCoords","shift","limiter","mainAxisCoord","crossAxisCoord","clampCoord","coord","limitedCoords","limitShift","_rawOffset$mainAxis","_rawOffset$crossAxis","rawOffset","computedOffset","len","limitMin","limitMax","_middlewareData$offse2","isOriginSide","apply","heightSide","widthSide","maximumClippingHeight","maximumClippingWidth","overflowAvailableHeight","overflowAvailableWidth","shiftData","noShift","availableHeight","availableWidth","nextDimensions","hasWindow","getNodeName","getDocumentElement","isOverflowElement","overflowX","overflowY","display","getComputedStyle","isTableElement","isTopLayer","willChangeRe","containRe","isNotNone","isWebKitValue","isContainingBlock","elementOrCss","isWebKit","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","getNearestOverflowAncestor","getOverflowAncestors","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","getCssDimensions","getComputedStyle$1","hasOffset","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","left","top","getWindowScrollBarX","leftScroll","getHTMLOffset","documentElement","scroll","htmlRect","convertOffsetParentRelativeRectToViewportRelativeRect","topLayer","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","html","SCROLLBAR_MAX","getViewportRect","isLayoutViewport","visualViewport","layoutRelativeClientCoords","bodyStyles","bodyMarginInline","reservedWidth","gutter","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","getClippingElementAncestors","cachedResult","lastKeptComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","lastPosition","ancestor","getClippingRect","clippingAncestors","firstRect","right","bottom","getDimensions","getRectRelativeToOffsetParent","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","getDimensionsFn","floatingDimensions","isRTL","rectsAreEqual","observeMove","onMove","ancestorResize","io","_io","refresh","skip","threshold","elementRectForRootMargin","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","ratio","handleResize","autoUpdate","ancestorScroll","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset$1","shift$1","flip$1","size$1","hide$1","arrow$1","limitShift$1","mergedOptions","platformWithCache","computePosition$1","useFloating","whileElementsMountedOption","openOption","middlewareOption","transformOption","placementOption","strategyOption","sideOffsetOption","alignOffsetOption","isPositioned","hasWhileMountedPosition","updateRequestId","destroyed","floatingStyles","xVal","yVal","whileElementsMountedCleanup","referenceNode","floatingNode","requestId","isReferenceHidden","maxExpectedOffset","attach","trackWhileMountedDeps","OPPOSITE_SIDE","FloatingContentContext","FloatingContentState","#transformedStyle","#updatePositionStrategy","#arrowSize","#arrowWidth","#arrowHeight","#desiredPlacement","#boundary","#hasExplicitBoundaries","#detectOverflowOptions","#availableWidth","#availableHeight","#anchorWidth","#anchorHeight","anchorWidth","anchorHeight","transformOrigin","#placedSide","getSideFromPlacement","#placedAlign","getAlignFromPlacement","#contentZIndex","#arrowBaseSide","#wrapperProps","customAnchor","rafId","zIndex","FloatingArrowState","isArrowHidden","arrowWidth","arrowHeight","placedSide","placedAlign","getSideAndAlignFromPlacement","noArrowAlign","arrowXCenter","arrowYCenter","align","sideOffset","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","hideWhenDetached","onPlaced","sticky","updatePositionStrategy","dir","wrapperId","onMount","isStatic","FloatingLayerContentStatic","FloatingLayerContent","contentPointerEvents","resolvedPreventScroll","effectiveStrategy","PopperContent","floatingProps","wrapperProps","node_1","dismissibleProps","PopperLayerInner","isPointInPolygon","point","polygon","isInside","j","xi","yi","xj","yj","isInsideRect","triggerRect","contentRect","triggerCenterX","triggerCenterY","contentCenterX","contentCenterY","deltaX","deltaY","SafePolygon","#buffer","#transitIntentTimeout","#exitPoint","#exitTarget","#transitTargets","#trackedTriggerNode","#leaveFallbackRafId","#transitIntentTimeoutId","#cancelLeaveFallback","#scheduleLeaveFallback","#clearTracking","#cancelTransitIntentTimeout","#scheduleTransitIntentTimeout","transitIntentTimeout","triggerNode","handlePointerMove","#onPointerMove","handleTriggerLeave","ignoredTargets","n","handleTriggerEnter","handleContentEnter","handleContentLeave","clientPoint","transitTarget","transitRect","transitSide","transitCorridor","#getCorridorPolygon","corridorPoly","targetRect","safePoly","#getSafePolygon","buffer","exitPoint","exitTarget","#flipSide","popoverAttrs","PopoverRootContext","PopoverRootState","#closeTimeout","#domContext","#clearCloseTimeout","ctx","PopoverTriggerState","#openTimeout","#isHovering","#clearOpenTimeout","#clearAllTimeouts","#getAriaControls","PopoverContentState","closestTrigger","effectiveTrapFocus","handleOpenAutoFocus","PopperLayerForceMount","finalProps","div_1","$.child","$.reset","PopperLayer","div_2","div_3","node_6","consequent_3","openOnHover","openDelay","closeDelay","triggerState","FloatingLayerAnchor","closeState","FloatingLayer","toggleAttrs","ToggleRootState","getToggleDataState","pressed","onPressedChange","toggleState","defaultAttributes","color","strokeWidth","absoluteStrokeWidth","iconNode","svg","$.index","$$item","tag","$$array","attrs","$$element","Icon","info","loading","seq","load","mine","sessionId","cwd","urls","root_9","p_1","root_1","dl","root_8","dt","dd","dd_1","$.template_effect","$.set_text","text_3","span","root_2","span_1","root_3","dd_2","ul","root_5","li","root_4","span_2","text_4","$.only_child","$.set_attribute","span_3","root_6","text_6","pre","$.first_child","fragment_1","consequent_4","consequent_5","alternate_1","text_1","text_2","alternate_2","toggleVariants","tv","variant","cn","TogglePrimitive_Root","$$value","LOADERS","__vitePreload","core","m","highlightLines","language","hljs","line","inRepo","gitMissing","wanted","listing","listError","loadingList","listStamp","listSeq","again","loadList","src","$.update","pulse","turns","turn","t","files","totals","sumCounts","chips","showGenerated","split","generated","kept","f","isGenerated","displayPath","shown","selected","pick","file","setSource","setTurn","NO_PROMPT","revealTurn","diff","diffError","diffSeq","painted","loadDiff","turnId","q","diffKey","shownDiff","shownError","rows","diffRows","hunkCount","SIGN","PAINT_LIMIT","languageFor","stale","onKey","at","root_24","bind_set","Toggle","bind_set_1","node_5","bind_get_2","bind_set_2","$.each","bind_get_3","span_4","text_8","span_5","text_9","node_9","div_4","span_6","text_10","node_10","Button","consequent_6","p_2","root_10","text_13","div_5","root_23","nav","node_12","letter","statusLetter","root_13","span_7","text_14","span_8","bdi","node_13","span_9","root_11","span_10","text_16","consequent_11","span_11","text_17","consequent_12","consequent_10","classes_1","$.set_class","$.delegated","consequent_13","section","div_6","fragment_8","button_1","iconify_icon","span_12","text_19","node_18","span_13","root_14","text_20","consequent_14","node_19","p_3","text_21","p_4","root_15","div_7","root_19","row","div_8","root_16","text_22","div_9","root_17","text_23","div_10","root_18","span_14","text_24","span_15","text_25","span_16","text_26","span_17","node_21","text_27","consequent_19","consequent_18","alternate_3","p_5","root_20","consequent_15","consequent_16","consequent_20","consequent_21","p_6","root_22","consequent_22","alternate_4","consequent_7","consequent_9","alternate_5","consequent_8","classes","toastsCounter","getToastId","ToastState","#pendingRemovals","#findToastIdx","idx","toast","#findHeightIdx","toastId","message","toastIdx","toastToUpdate","rest","dismissible","alreadyExists","promise","shouldDismiss","response","constructPromiseErrorMessage","component","heightIdx","order","toastOrder","insertIdx","toastState","toastFunction","SonnerState","#activeToasts","basicToast","GRAMMARS","THEME","HIGHLIGHT_LIMIT_CHARS","highlighter","createHighlighterCore","createJavaScriptRegexEngine","theme","highlightFile","text","shiki","persisted","FilesPaneStore","patch","filesPaneStore","tree","depth","dirs","styles","$.set_style","fragment_4","iconify_icon_1","$.set_custom_element_data","iconify_icon_2","styles_3","setExpanded","root_7","iconify_icon_3","node_7","iconify_icon_4","classes_2","openPath","styles_4","openFile","api","prefs","showIgnored","expanded","treeEpoch","loadDir","epoch","reloadTree","rootListing","repo","readFor","toggleIgnored","wantedFile","wantedLine","restored","fileSeq","loadFile","read","fileReadFor","revealInTree","missing","closeFile","mdSource","markdown","isMarkdown","rendered","tokens","shikiLanguage","CHUNK","chunks","codeEl","pickLine","copyPath","mentionOpen","abs","formatSize","bytes","query","allFiles","picked","loadAll","results","fuzzyFilter","openResult","onQueryKey","root_27","iconify_icon_5","Input","node_8","text_5","button_2","classes_4","node_14","button_3","root_12","root_26","button_4","iconify_icon_6","bdi_1","node_17","text_11","div_11","bind_get","bind_get_1","node_20","button_5","iconify_icon_7","button_6","iconify_icon_8","button_7","iconify_icon_9","div_12","text_15","classes_5","div_13","img","div_14","$.html","renderMarkdown","root_21","div_15","root_25","div_16","div_17","button_8","node_23","node_24","styles_7","classes_6","styles_6","$.bind_this","styles_5","consequent_17","consequent_23","classes_3","isLoopback","h","choiceUrl","choice","normalizeTyped","hasScheme","u","pointsHere","portOf","resolveEmbed","pageSecure","port","served","remote","card","WebPaneStore","webPaneStore","POLL_MS","infoError","infoSeq","loadInfo","timer","devConfigured","trail","choose","goBack","typed","submitTyped","named","configured","embed","frameSrc","openUrl","check","verdict","blocked","reloads","reload","hostLabel","$1","server","fragment_3","code","text_7","command","h3","fragment_5","fragment_6","code_1","text_12","node_11","p_7","iframe","$.event","PANES","ChangesPane","FilesPane","WebPane","ProjectPane","PANE_KINDS","PANE_PARAMS","paneDef","kind","altShift","paneKeys","def","MAXIMIZE_KEY","MAXIMIZE_KEYS","CLOSE_KEYS","panelKeyAction","POLL_INTERVAL_MS","panesEqual","TmuxPanesStore","tmuxPanesStore","PREVIEW_LEN","SAVE_DEBOUNCE_MS","DraftsStore","cur","flat","draftsStore","NONE","release","chip","AttachmentsStore","localId","changes","attachmentsStore","AlertDialogPrimitive_Root","AlertDialogPrimitive_Portal","AlertDialogPrimitive_Title","buttonVariants","AlertDialogPrimitive_Action","AlertDialogPrimitive_Cancel","AlertDialogPrimitive_Overlay","AlertDialogPortal","AlertDialogOverlay","AlertDialogPrimitive_Content","AlertDialogPrimitive_Description","DialogPrimitive_Root","DialogPrimitive_Portal","DialogPrimitive_Title","DialogPrimitive_Overlay","showCloseButton","DialogPortal","Dialog_Overlay","DialogPrimitive_Content","DialogPrimitive_Close","XIcon","DialogPrimitive_Description","PopoverPrimitive_Root","PopoverPrimitive_Portal","PopoverPortal","PopoverPrimitive_Content","PopoverPrimitive_Trigger","session","sessionStore","inputEl","killArmed","TOP_MARGIN_PX","KEYBOARD_RATIO","positionStyle","vv","sync","commit","kill","onKeydown","Dialog_Root","Dialog_Content","Dialog_Header","Dialog_Title","Dialog_Description","Dialog_Footer","fuzzyMatch","wantPositions","needle","positions","score","ti","qi","ch","found","fuzzyScore","highlightRuns","runs","cut","from","scoreCommand","cmd","nameScore","descIdx","children","CheckIcon","MinusIcon","CheckboxPrimitive_Root","sameShape","SidebarActionsStore","actions","sidebarActionsStore"],"ignoreList":[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,108,109,137,146],"sources":["../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/internal/shared/clone.js","../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/attachments/index.js","../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../../../../../src/lib/constants.ts","../../../../../../src/lib/stores/servers.svelte.ts","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/is.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/box/box-extras.svelte.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/compose-handlers.js","../../../../../../../node_modules/.bun/inline-style-parser@0.2.7/node_modules/inline-style-parser/esm/index.mjs","../../../../../../../node_modules/.bun/style-to-object@1.0.14/node_modules/style-to-object/esm/index.mjs","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/strings.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/css-to-style-obj.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/execute-callbacks.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/style-to-css.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/style.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/event-list.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/merge-props.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/sr-only-styles.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/internal/configurable-globals.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/internal/utils/dom.js","../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/reactivity/map.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/utilities/active-element/active-element.svelte.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/internal/utils/is.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/utilities/context/context.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/utilities/watch/watch.svelte.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/internal/utils/get.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/utilities/element-size/element-size.svelte.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/on-destroy-effect.svelte.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/after-sleep.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/after-tick.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/dom.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/dom-context.svelte.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/attach-ref.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/attrs.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/kbd-constants.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/is.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/animations-complete.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/presence-manager.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/noop.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/create-id.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/dialog.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-title.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-action.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/portal/portal-consumer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/config/bits-config.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/config/prop-resolvers.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/portal/portal.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/debounce.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/elements.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/dom.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/menu/context-menu-attributes.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/escape-layer/use-escape-layer.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/escape-layer/escape-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope-manager.js","../../../../../../../node_modules/.bun/tabbable@6.5.0/node_modules/tabbable/dist/index.esm.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/use-id.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/shared-state.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/body-scroll-lock.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/scroll-lock/scroll-lock.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-overlay.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-description.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/checkbox/checkbox.svelte.js","../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/internal/flags/legacy.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/hidden-input.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/checkbox/components/checkbox-input.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/checkbox/components/checkbox.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/floating-root.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/floating-svelte/floating-utils.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte","../../../../../../../node_modules/.bun/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../../../../../node_modules/.bun/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../../../../../node_modules/.bun/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../../../../../node_modules/.bun/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/floating-svelte/use-floating.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-content-static.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer-inner.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer-force-mount.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/safe-polygon.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/popover/popover.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/popover/components/popover-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/popover/components/popover-trigger.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-close.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/popover/components/popover.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/toggle/toggle.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/toggle/components/toggle.svelte","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/defaultAttributes.js","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/Icon.svelte","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/icons/check.svelte","../../../../../../src/lib/components/side-panel/ProjectPane.svelte","../../../../../../src/lib/components/ui/toggle/toggle.svelte","../../../../../../src/lib/side-panel/highlight.ts","../../../../../../src/lib/components/side-panel/ChangesPane.svelte","../../../../../../../node_modules/.bun/svelte-sonner@1.2.1+fabb43e41e936932/node_modules/svelte-sonner/dist/internal/helpers.js","../../../../../../../node_modules/.bun/svelte-sonner@1.2.1+fabb43e41e936932/node_modules/svelte-sonner/dist/toast-state.svelte.js","../../../../../../src/lib/side-panel/shiki.ts","../../../../../../src/lib/stores/filesPane.svelte.ts","../../../../../../src/lib/components/side-panel/FilesPane.svelte","../../../../../../../src/utils/loopback.ts","../../../../../../src/lib/side-panel/web.ts","../../../../../../src/lib/stores/webPane.svelte.ts","../../../../../../src/lib/components/side-panel/WebPane.svelte","../../../../../../src/lib/side-panel/panes.ts","../../../../../../src/lib/stores/tmuxPanes.svelte.ts","../../../../../../src/lib/stores/drafts.svelte.ts","../../../../../../src/lib/stores/attachments.svelte.ts","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-portal.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-title.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-action.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-header.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-content.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-description.svelte","../../../../../../src/lib/components/ui/dialog/dialog.svelte","../../../../../../src/lib/components/ui/dialog/dialog-portal.svelte","../../../../../../src/lib/components/ui/dialog/dialog-title.svelte","../../../../../../src/lib/components/ui/dialog/dialog-footer.svelte","../../../../../../src/lib/components/ui/dialog/dialog-header.svelte","../../../../../../src/lib/components/ui/dialog/dialog-overlay.svelte","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/icons/x.svelte","../../../../../../src/lib/components/ui/dialog/dialog-content.svelte","../../../../../../src/lib/components/ui/dialog/dialog-description.svelte","../../../../../../src/lib/components/ui/popover/popover.svelte","../../../../../../src/lib/components/ui/popover/popover-portal.svelte","../../../../../../src/lib/components/ui/popover/popover-content.svelte","../../../../../../src/lib/components/ui/popover/popover-trigger.svelte","../../../../../../src/lib/components/RenameSessionDialog.svelte","../../../../../../../src/utils/fuzzy.ts","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/icons/minus.svelte","../../../../../../src/lib/components/ui/checkbox/checkbox.svelte","../../../../../../src/lib/stores/sidebarActions.svelte.ts"],"sourcesContent":["/** @import { Snapshot } from './types' */\nimport { DEV } from 'esm-env';\nimport * as w from './warnings.js';\nimport { get_prototype_of, is_array, object_prototype } from './utils.js';\n\n/**\n * In dev, we keep track of which properties could not be cloned. In prod\n * we don't bother, but we keep a dummy array around so that the\n * signature stays the same\n * @type {string[]}\n */\nconst empty = [];\n\n/**\n * @template T\n * @param {T} value\n * @param {boolean} [skip_warning]\n * @param {boolean} [no_tojson]\n * @returns {Snapshot<T>}\n */\nexport function snapshot(value, skip_warning = false, no_tojson = false) {\n\tif (DEV && !skip_warning) {\n\t\t/** @type {string[]} */\n\t\tconst paths = [];\n\n\t\tconst copy = clone(value, new Map(), '', paths, null, no_tojson);\n\t\tif (paths.length === 1 && paths[0] === '') {\n\t\t\t// value could not be cloned\n\t\t\tw.state_snapshot_uncloneable();\n\t\t} else if (paths.length > 0) {\n\t\t\t// some properties could not be cloned\n\t\t\tconst slice = paths.length > 10 ? paths.slice(0, 7) : paths.slice(0, 10);\n\t\t\tconst excess = paths.length - slice.length;\n\n\t\t\tlet uncloned = slice.map((path) => `- <value>${path}`).join('\\n');\n\t\t\tif (excess > 0) uncloned += `\\n- ...and ${excess} more`;\n\n\t\t\tw.state_snapshot_uncloneable(uncloned);\n\t\t}\n\n\t\treturn copy;\n\t}\n\n\treturn clone(value, new Map(), '', empty, null, no_tojson);\n}\n\n/**\n * @template T\n * @param {T} value\n * @param {Map<T, Snapshot<T>>} cloned\n * @param {string} path\n * @param {string[]} paths\n * @param {null | T} [original] The original value, if `value` was produced from a `toJSON` call\n * @param {boolean} [no_tojson]\n * @returns {Snapshot<T>}\n */\nfunction clone(value, cloned, path, paths, original = null, no_tojson = false) {\n\tif (typeof value === 'object' && value !== null) {\n\t\tvar unwrapped = cloned.get(value);\n\t\tif (unwrapped !== undefined) return unwrapped;\n\n\t\tif (value instanceof Map) return /** @type {Snapshot<T>} */ (new Map(value));\n\t\tif (value instanceof Set) return /** @type {Snapshot<T>} */ (new Set(value));\n\n\t\tif (is_array(value)) {\n\t\t\tvar copy = /** @type {Snapshot<any>} */ (Array(value.length));\n\t\t\tcloned.set(value, copy);\n\n\t\t\tif (original !== null) {\n\t\t\t\tcloned.set(original, copy);\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < value.length; i += 1) {\n\t\t\t\tvar element = value[i];\n\t\t\t\tif (i in value) {\n\t\t\t\t\tcopy[i] = clone(element, cloned, DEV ? `${path}[${i}]` : path, paths, null, no_tojson);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn copy;\n\t\t}\n\n\t\tif (get_prototype_of(value) === object_prototype) {\n\t\t\t/** @type {Snapshot<any>} */\n\t\t\tcopy = {};\n\t\t\tcloned.set(value, copy);\n\n\t\t\tif (original !== null) {\n\t\t\t\tcloned.set(original, copy);\n\t\t\t}\n\n\t\t\tfor (var key of Object.keys(value)) {\n\t\t\t\tcopy[key] = clone(\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\tvalue[key],\n\t\t\t\t\tcloned,\n\t\t\t\t\tDEV ? `${path}.${key}` : path,\n\t\t\t\t\tpaths,\n\t\t\t\t\tnull,\n\t\t\t\t\tno_tojson\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn copy;\n\t\t}\n\n\t\tif (value instanceof Date) {\n\t\t\t// Ensure SvelteDate snapshots are tracked\n\t\t\tvalue.getTime();\n\t\t\treturn /** @type {Snapshot<T>} */ (structuredClone(value));\n\t\t}\n\n\t\tif (typeof (/** @type {T & { toJSON?: any } } */ (value).toJSON) === 'function' && !no_tojson) {\n\t\t\treturn clone(\n\t\t\t\t/** @type {T & { toJSON(): any } } */ (value).toJSON(),\n\t\t\t\tcloned,\n\t\t\t\tDEV ? `${path}.toJSON()` : path,\n\t\t\t\tpaths,\n\t\t\t\t// Associate the instance with the toJSON clone\n\t\t\t\tvalue\n\t\t\t);\n\t\t}\n\t}\n\n\tif (value instanceof EventTarget) {\n\t\t// can't be cloned\n\t\treturn /** @type {Snapshot<T>} */ (value);\n\t}\n\n\ttry {\n\t\treturn /** @type {Snapshot<T>} */ (structuredClone(value));\n\t} catch (e) {\n\t\tif (DEV) {\n\t\t\tpaths.push(path);\n\t\t}\n\n\t\treturn /** @type {Snapshot<T>} */ (value);\n\t}\n}\n","/** @import { Action, ActionReturn } from '../action/public' */\n/** @import { Attachment } from './public' */\nimport { noop, render_effect } from 'svelte/internal/client';\nimport { ATTACHMENT_KEY } from '../constants.js';\nimport { untrack } from '../index-client.js';\nimport { teardown } from '../internal/client/reactivity/effects.js';\n\n/**\n * Creates an object key that will be recognised as an attachment when the object is spread onto an element,\n * as a programmatic alternative to using `{@attach ...}`. This can be useful for library authors, though\n * is generally not needed when building an app.\n *\n * ```svelte\n * <script>\n * \timport { createAttachmentKey } from 'svelte/attachments';\n *\n * \tconst props = {\n * \t\tclass: 'cool',\n * \t\tonclick: () => alert('clicked'),\n * \t\t[createAttachmentKey()]: (node) => {\n * \t\t\tnode.textContent = 'attached!';\n * \t\t}\n * \t};\n * </script>\n *\n * <button {...props}>click me</button>\n * ```\n * @since 5.29\n */\nexport function createAttachmentKey() {\n\treturn Symbol(ATTACHMENT_KEY);\n}\n\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * <!-- with an action -->\n * <div use:foo={bar}>...</div>\n *\n * <!-- with an attachment -->\n * <div {@attach fromAction(foo, () => bar)}>...</div>\n * ```\n * @template {EventTarget} E\n * @template {unknown} T\n * @overload\n * @param {Action<E, T> | ((element: E, arg: T) => void | ActionReturn<T>)} action The action function\n * @param {() => T} fn A function that returns the argument for the action\n * @returns {Attachment<E>}\n */\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * <!-- with an action -->\n * <div use:foo={bar}>...</div>\n *\n * <!-- with an attachment -->\n * <div {@attach fromAction(foo, () => bar)}>...</div>\n * ```\n * @template {EventTarget} E\n * @overload\n * @param {Action<E, void> | ((element: E) => void | ActionReturn<void>)} action The action function\n * @returns {Attachment<E>}\n */\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * <!-- with an action -->\n * <div use:foo={bar}>...</div>\n *\n * <!-- with an attachment -->\n * <div {@attach fromAction(foo, () => bar)}>...</div>\n * ```\n *\n * @template {EventTarget} E\n * @template {unknown} T\n * @param {Action<E, T> | ((element: E, arg: T) => void | ActionReturn<T>)} action The action function\n * @param {() => T} fn A function that returns the argument for the action\n * @returns {Attachment<E>}\n * @since 5.32\n */\nexport function fromAction(action, fn = /** @type {() => T} */ (noop)) {\n\treturn (element) => {\n\t\tconst { update, destroy } = untrack(() => action(element, fn()) ?? {});\n\n\t\tif (update) {\n\t\t\tvar ran = false;\n\t\t\trender_effect(() => {\n\t\t\t\tconst arg = fn();\n\t\t\t\tif (ran) update(arg);\n\t\t\t});\n\t\t\tran = true;\n\t\t}\n\n\t\tif (destroy) {\n\t\t\tteardown(destroy);\n\t\t}\n\t};\n}\n","/** @import { ComponentContextLegacy } from '#client' */\nimport { run, run_all } from '../../../shared/utils.js';\nimport { component_context } from '../../context.js';\nimport { derived } from '../../reactivity/deriveds.js';\nimport { user_pre_effect, user_effect } from '../../reactivity/effects.js';\nimport { deep_read_state, get, untrack } from '../../runtime.js';\n\n/**\n * Legacy-mode only: Call `onMount` callbacks and set up `beforeUpdate`/`afterUpdate` effects\n * @param {boolean} [immutable]\n */\nexport function init(immutable = false) {\n\tconst context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\tconst callbacks = context.l.u;\n\tif (!callbacks) return;\n\n\tlet props = () => deep_read_state(context.s);\n\n\tif (immutable) {\n\t\tlet version = 0;\n\t\tlet prev = /** @type {Record<string, any>} */ ({});\n\n\t\t// In legacy immutable mode, before/afterUpdate only fire if the object identity of a prop changes\n\t\tconst d = derived(() => {\n\t\t\tlet changed = false;\n\t\t\tconst props = context.s;\n\t\t\tfor (const key in props) {\n\t\t\t\tif (props[key] !== prev[key]) {\n\t\t\t\t\tprev[key] = props[key];\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (changed) version++;\n\t\t\treturn version;\n\t\t});\n\n\t\tprops = () => get(d);\n\t}\n\n\t// beforeUpdate\n\tif (callbacks.b.length) {\n\t\tuser_pre_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.b);\n\t\t});\n\t}\n\n\t// onMount (must run before afterUpdate)\n\tuser_effect(() => {\n\t\tconst fns = untrack(() => callbacks.m.map(run));\n\t\treturn () => {\n\t\t\tfor (const fn of fns) {\n\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\tfn();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\n\t// afterUpdate\n\tif (callbacks.a.length) {\n\t\tuser_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.a);\n\t\t});\n\t}\n}\n\n/**\n * Invoke the getter of all signals associated with a component\n * so they can be registered to the effect this function is called in.\n * @param {ComponentContextLegacy} context\n * @param {(() => void)} props\n */\nfunction observe_all(context, props) {\n\tif (context.l.s) {\n\t\tfor (const signal of context.l.s) get(signal);\n\t}\n\n\tprops();\n}\n","export const APP_MARKER = 'claude-mux';\nexport const STORAGE_KEYS = {\n\tlastSession: 'claude-mux-last-session',\n\tservers: 'claude-mux-servers',\n\tsidebarWidth: 'claude-mux-sidebar-width'\n} as const;\n\n/** Apple keyboards say ⌘ where everyone else says Ctrl. */\nexport const IS_MAC = typeof navigator !== 'undefined' && /Mac|iPhone|iPad/.test(navigator.platform);\nexport const MOD_LABEL = IS_MAC ? '\\u2318' : 'Ctrl';\n","import { browser } from '$app/environment';\nimport { createPersisted } from './persisted';\nimport { STORAGE_KEYS } from '$lib/constants';\nimport type { DiscoverResponse, ServerInfo } from '$lib/types/servers';\n\nconst cache = createPersisted<ServerInfo[]>(STORAGE_KEYS.servers, []);\n\nfunction detectCurrent(): ServerInfo {\n\tif (!browser) return { hostname: '', url: '' };\n\tconst host = window.location.host;\n\tconst hostname = host.split(':')[0].split('.')[0];\n\tconst url = `${window.location.protocol}//${host}`;\n\treturn { hostname, url };\n}\n\nclass ServerStore {\n\tcurrent = $state<ServerInfo>({ hostname: '', url: '' });\n\tservers = $state<ServerInfo[]>([]);\n\t/**\n\t * This host's tailnet name, as discovery reports it. The page may have\n\t * been opened as `localhost`, and the server list still names the machine\n\t * by its tailnet name, so this is what tells the two apart.\n\t */\n\tself = $state('');\n\tloading = $state(false);\n\terror = $state<string | null>(null);\n\n\tinit(): void {\n\t\tthis.current = detectCurrent();\n\t\tconst cached = cache.load();\n\t\tthis.servers = cached.length > 0 ? cached : this.current.hostname ? [this.current] : [];\n\t}\n\n\tasync refresh(): Promise<void> {\n\t\tif (this.loading) return;\n\t\tthis.loading = true;\n\t\tthis.error = null;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/servers/discover');\n\t\t\tconst data = (await res.json()) as DiscoverResponse;\n\t\t\tif (!res.ok || data.error) {\n\t\t\t\tthis.error = data.error ?? `HTTP ${res.status}`;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.servers = data.servers;\n\t\t\tthis.self = data.self;\n\t\t\tcache.save(data.servers);\n\t\t} catch (err) {\n\t\t\tthis.error = err instanceof Error ? err.message : 'discover failed';\n\t\t} finally {\n\t\t\tthis.loading = false;\n\t\t}\n\t}\n}\n\nexport const serverStore = new ServerStore();\n","export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nconst CLASS_VALUE_PRIMITIVE_TYPES = [\"string\", \"number\", \"bigint\", \"boolean\"];\nexport function isClassValue(value) {\n // handle primitive types\n if (value === null || value === undefined)\n return true;\n if (CLASS_VALUE_PRIMITIVE_TYPES.includes(typeof value))\n return true;\n // handle arrays (ClassArray)\n if (Array.isArray(value))\n return value.every((item) => isClassValue(item));\n // handle objects (ClassDictionary)\n if (typeof value === \"object\") {\n // ensure it's a plain object and not some other object type\n if (Object.getPrototypeOf(value) !== Object.prototype)\n return false;\n return true;\n }\n return false;\n}\n","import { isFunction, isObject } from \"../utils/is.js\";\nexport const BoxSymbol = Symbol(\"box\");\nexport const isWritableSymbol = Symbol(\"is-writable\");\nfunction boxWith(getter, setter) {\n const derived = $derived.by(getter);\n if (setter) {\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return derived;\n },\n set current(v) {\n setter(v);\n }\n };\n }\n return {\n [BoxSymbol]: true,\n get current() {\n return getter();\n }\n };\n}\n/**\n * @returns Whether the value is a Box\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isBox(value) {\n return isObject(value) && BoxSymbol in value;\n}\n/**\n * @returns Whether the value is a WritableBox\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isWritableBox(value) {\n return isBox(value) && isWritableSymbol in value;\n}\nfunction boxFrom(value) {\n if (isBox(value))\n return value;\n if (isFunction(value))\n return boxWith(value);\n return simpleBox(value);\n}\n/**\n * Function that gets an object of boxes, and returns an object of reactive values\n *\n * @example\n * const count = box(0)\n * const flat = box.flatten({ count, double: box.with(() => count.current) })\n * // type of flat is { count: number, readonly double: number }\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction boxFlatten(boxes) {\n return Object.entries(boxes).reduce((acc, [key, b]) => {\n if (!isBox(b)) {\n return Object.assign(acc, { [key]: b });\n }\n if (isWritableBox(b)) {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(v) {\n b.current = v;\n }\n });\n }\n else {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n }\n });\n }\n return acc;\n }, {});\n}\n/**\n * Function that converts a box to a readonly box.\n *\n * @example\n * const count = box(0) // WritableBox<number>\n * const countReadonly = box.readonly(count) // ReadableBox<number>\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction toReadonlyBox(b) {\n if (!isWritableBox(b))\n return b;\n return {\n [BoxSymbol]: true,\n get current() {\n return b.current;\n }\n };\n}\nfunction simpleBox(initialValue) {\n let current = $state(initialValue);\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return current;\n },\n set current(v) {\n current = v;\n }\n };\n}\nexport { boxWith, isBox, isWritableBox, boxFrom, boxFlatten, toReadonlyBox, simpleBox };\n","/**\n * Composes event handlers into a single function that can be called with an event.\n * If the previous handler cancels the event using `event.preventDefault()`, the handlers\n * that follow will not be called.\n */\nexport function composeHandlers(...handlers) {\n return function (e) {\n for (const handler of handlers) {\n if (!handler)\n continue;\n if (e.defaultPrevented)\n return;\n if (typeof handler === \"function\") {\n handler.call(this, e);\n }\n else {\n handler.current?.call(this, e);\n }\n }\n };\n}\n","// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nfunction index (style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) ; else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n}\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n\nexport { index as default };\n//# sourceMappingURL=index.mjs.map\n","import parse from 'inline-style-parser';\n\n/**\n * Parses inline style to object.\n *\n * @param style - Inline style.\n * @param iterator - Iterator.\n * @returns - Style object or null.\n *\n * @example Parsing inline style to object:\n *\n * ```js\n * import parse from 'style-to-object';\n * parse('line-height: 42;'); // { 'line-height': '42' }\n * ```\n */\nfunction StyleToObject(style, iterator) {\n let styleObject = null;\n if (!style || typeof style !== 'string') {\n return styleObject;\n }\n const declarations = parse(style);\n const hasIterator = typeof iterator === 'function';\n declarations.forEach((declaration) => {\n if (declaration.type !== 'declaration') {\n return;\n }\n const { property, value } = declaration;\n if (hasIterator) {\n iterator(property, value, declaration);\n }\n else if (value) {\n styleObject = styleObject || {};\n styleObject[property] = value;\n }\n });\n return styleObject;\n}\n\nexport { StyleToObject as default };\n//# sourceMappingURL=index.mjs.map\n","const NUMBER_CHAR_RE = /\\d/;\nconst STR_SPLITTERS = [\"-\", \"_\", \"/\", \".\"];\nfunction isUppercase(char = \"\") {\n if (NUMBER_CHAR_RE.test(char))\n return undefined;\n return char !== char.toLowerCase();\n}\nfunction splitByCase(str) {\n const parts = [];\n let buff = \"\";\n let previousUpper;\n let previousSplitter;\n for (const char of str) {\n // Splitter\n const isSplitter = STR_SPLITTERS.includes(char);\n if (isSplitter === true) {\n parts.push(buff);\n buff = \"\";\n previousUpper = undefined;\n continue;\n }\n const isUpper = isUppercase(char);\n if (previousSplitter === false) {\n // Case rising edge\n if (previousUpper === false && isUpper === true) {\n parts.push(buff);\n buff = char;\n previousUpper = isUpper;\n continue;\n }\n // Case falling edge\n if (previousUpper === true && isUpper === false && buff.length > 1) {\n const lastChar = buff.at(-1);\n parts.push(buff.slice(0, Math.max(0, buff.length - 1)));\n buff = lastChar + char;\n previousUpper = isUpper;\n continue;\n }\n }\n // Normal char\n buff += char;\n previousUpper = isUpper;\n previousSplitter = isSplitter;\n }\n parts.push(buff);\n return parts;\n}\nexport function pascalCase(str) {\n if (!str)\n return \"\";\n return splitByCase(str)\n .map((p) => upperFirst(p))\n .join(\"\");\n}\nexport function camelCase(str) {\n return lowerFirst(pascalCase(str || \"\"));\n}\nexport function kebabCase(str) {\n return str\n ? splitByCase(str)\n .map((p) => p.toLowerCase())\n .join(\"-\")\n : \"\";\n}\nfunction upperFirst(str) {\n return str ? str[0].toUpperCase() + str.slice(1) : \"\";\n}\nfunction lowerFirst(str) {\n return str ? str[0].toLowerCase() + str.slice(1) : \"\";\n}\n","import parse from \"style-to-object\";\nimport { camelCase, pascalCase } from \"./strings.js\";\nexport function cssToStyleObj(css) {\n if (!css)\n return {};\n const styleObj = {};\n function iterator(name, value) {\n if (name.startsWith(\"-moz-\") ||\n name.startsWith(\"-webkit-\") ||\n name.startsWith(\"-ms-\") ||\n name.startsWith(\"-o-\")) {\n styleObj[pascalCase(name)] = value;\n return;\n }\n if (name.startsWith(\"--\")) {\n styleObj[name] = value;\n return;\n }\n styleObj[camelCase(name)] = value;\n }\n parse(css, iterator);\n return styleObj;\n}\n","/**\n * Executes an array of callback functions with the same arguments.\n * @template T The types of the arguments that the callback functions take.\n * @param callbacks array of callback functions to execute.\n * @returns A new function that executes all of the original callback functions with the same arguments.\n */\nexport function executeCallbacks(...callbacks) {\n return (...args) => {\n for (const callback of callbacks) {\n if (typeof callback === \"function\") {\n callback(...args);\n }\n }\n };\n}\n","function createParser(matcher, replacer) {\n const regex = RegExp(matcher, \"g\");\n return (str) => {\n // throw an error if not a string\n if (typeof str !== \"string\") {\n throw new TypeError(`expected an argument of type string, but got ${typeof str}`);\n }\n // if no match between string and matcher\n if (!str.match(regex))\n return str;\n // executes the replacer function for each match\n return str.replace(regex, replacer);\n };\n}\nconst camelToKebab = createParser(/[A-Z]/, (match) => `-${match.toLowerCase()}`);\nexport function styleToCSS(styleObj) {\n if (!styleObj || typeof styleObj !== \"object\" || Array.isArray(styleObj)) {\n throw new TypeError(`expected an argument of type object, but got ${typeof styleObj}`);\n }\n return Object.keys(styleObj)\n .map((property) => `${camelToKebab(property)}: ${styleObj[property]};`)\n .join(\"\\n\");\n}\n","import { styleToCSS } from \"./style-to-css.js\";\nexport function styleToString(style = {}) {\n return styleToCSS(style).replace(\"\\n\", \" \");\n}\n","const EVENT_LIST = [\n \"onabort\",\n \"onanimationcancel\",\n \"onanimationend\",\n \"onanimationiteration\",\n \"onanimationstart\",\n \"onauxclick\",\n \"onbeforeinput\",\n \"onbeforetoggle\",\n \"onblur\",\n \"oncancel\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"onchange\",\n \"onclick\",\n \"onclose\",\n \"oncompositionend\",\n \"oncompositionstart\",\n \"oncompositionupdate\",\n \"oncontextlost\",\n \"oncontextmenu\",\n \"oncontextrestored\",\n \"oncopy\",\n \"oncuechange\",\n \"oncut\",\n \"ondblclick\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onended\",\n \"onerror\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onformdata\",\n \"ongotpointercapture\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadstart\",\n \"onlostpointercapture\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onprogress\",\n \"onratechange\",\n \"onreset\",\n \"onresize\",\n \"onscroll\",\n \"onscrollend\",\n \"onsecuritypolicyviolation\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onslotchange\",\n \"onstalled\",\n \"onsubmit\",\n \"onsuspend\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitioncancel\",\n \"ontransitionend\",\n \"ontransitionrun\",\n \"ontransitionstart\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwebkitanimationend\",\n \"onwebkitanimationiteration\",\n \"onwebkitanimationstart\",\n \"onwebkittransitionend\",\n \"onwheel\"\n];\nexport const EVENT_LIST_SET = new Set(EVENT_LIST);\n","/**\n * Modified from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/utils/src/mergeProps.ts (see NOTICE.txt for source)\n */\nimport { clsx } from \"clsx\";\nimport { composeHandlers } from \"./compose-handlers.js\";\nimport { cssToStyleObj } from \"./css-to-style-obj.js\";\nimport { isClassValue } from \"./is.js\";\nimport { executeCallbacks } from \"./execute-callbacks.js\";\nimport { styleToString } from \"./style.js\";\nimport { EVENT_LIST_SET } from \"./event-list.js\";\nfunction isEventHandler(key) {\n return EVENT_LIST_SET.has(key);\n}\n/**\n * Given a list of prop objects, merges them into a single object.\n * - Automatically composes event handlers (e.g. `onclick`, `oninput`, etc.)\n * - Chains regular functions with the same name so they are called in order\n * - Merges class strings with `clsx`\n * - Merges style objects and converts them to strings\n * - Handles a bug with Svelte where setting the `hidden` attribute to `false` doesn't remove it\n * - Overrides other values with the last one\n */\nexport function mergeProps(...args) {\n const result = { ...args[0] };\n for (let i = 1; i < args.length; i++) {\n const props = args[i];\n if (!props)\n continue;\n // Handle string keys\n for (const key of Object.keys(props)) {\n const a = result[key];\n const b = props[key];\n const aIsFunction = typeof a === \"function\";\n const bIsFunction = typeof b === \"function\";\n // compose event handlers\n if (aIsFunction && typeof bIsFunction && isEventHandler(key)) {\n // handle merging of event handlers\n const aHandler = a;\n const bHandler = b;\n result[key] = composeHandlers(aHandler, bHandler);\n }\n else if (aIsFunction && bIsFunction) {\n // chain non-event handler functions\n result[key] = executeCallbacks(a, b);\n }\n else if (key === \"class\") {\n // handle merging acceptable class values from clsx\n const aIsClassValue = isClassValue(a);\n const bIsClassValue = isClassValue(b);\n if (aIsClassValue && bIsClassValue) {\n result[key] = clsx(a, b);\n }\n else if (aIsClassValue) {\n result[key] = clsx(a);\n }\n else if (bIsClassValue) {\n result[key] = clsx(b);\n }\n }\n else if (key === \"style\") {\n const aIsObject = typeof a === \"object\";\n const bIsObject = typeof b === \"object\";\n const aIsString = typeof a === \"string\";\n const bIsString = typeof b === \"string\";\n if (aIsObject && bIsObject) {\n // both are style objects, merge them\n result[key] = { ...a, ...b };\n }\n else if (aIsObject && bIsString) {\n // a is style object, b is string, convert b to style object and merge\n const parsedStyle = cssToStyleObj(b);\n result[key] = { ...a, ...parsedStyle };\n }\n else if (aIsString && bIsObject) {\n // a is string, b is style object, convert a to style object and merge\n const parsedStyle = cssToStyleObj(a);\n result[key] = { ...parsedStyle, ...b };\n }\n else if (aIsString && bIsString) {\n // both are strings, convert both to objects and merge\n const parsedStyleA = cssToStyleObj(a);\n const parsedStyleB = cssToStyleObj(b);\n result[key] = { ...parsedStyleA, ...parsedStyleB };\n }\n else if (aIsObject) {\n result[key] = a;\n }\n else if (bIsObject) {\n result[key] = b;\n }\n else if (aIsString) {\n result[key] = a;\n }\n else if (bIsString) {\n result[key] = b;\n }\n }\n else {\n // override other values\n result[key] = b !== undefined ? b : a;\n }\n }\n // handle symbol keys (mostly for `Attachments`)\n for (const key of Object.getOwnPropertySymbols(props)) {\n const a = result[key];\n const b = props[key];\n // for matching symbols, we just override\n result[key] = b !== undefined ? b : a;\n }\n }\n // convert style object to string\n if (typeof result.style === \"object\") {\n result.style = styleToString(result.style).replaceAll(\"\\n\", \" \");\n }\n // handle weird svelte bug where `hidden` is not removed when set to `false`\n if (result.hidden === false) {\n result.hidden = undefined;\n delete result.hidden;\n }\n // handle weird svelte bug where `disabled` is not removed when set to `false`\n if (result.disabled === false) {\n result.disabled = undefined;\n delete result.disabled;\n }\n return result;\n}\n","import { styleToString } from \"./style.js\";\nexport const srOnlyStyles = {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: \"0\",\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n borderWidth: \"0\",\n transform: \"translateX(-100%)\"\n};\nexport const srOnlyStylesString = styleToString(srOnlyStyles);\n","import { BROWSER } from \"esm-env\";\nexport const defaultWindow = BROWSER && typeof window !== \"undefined\" ? window : undefined;\nexport const defaultDocument = BROWSER && typeof window !== \"undefined\" ? window.document : undefined;\nexport const defaultNavigator = BROWSER && typeof window !== \"undefined\" ? window.navigator : undefined;\nexport const defaultLocation = BROWSER && typeof window !== \"undefined\" ? window.location : undefined;\n","import { defaultDocument } from \"../configurable-globals.js\";\n/**\n * Handles getting the active element in a document or shadow root.\n * If the active element is within a shadow root, it will traverse the shadow root\n * to find the active element.\n * If not, it will return the active element in the document.\n *\n * @param document A document or shadow root to get the active element from.\n * @returns The active element in the document or shadow root.\n */\nexport function getActiveElement(document) {\n let activeElement = document.activeElement;\n while (activeElement?.shadowRoot) {\n const node = activeElement.shadowRoot.activeElement;\n if (node === activeElement)\n break;\n else\n activeElement = node;\n }\n return activeElement;\n}\n/**\n * Returns the owner document of a given element.\n *\n * @param node The element to get the owner document from.\n * @returns\n */\nexport function getOwnerDocument(node, fallback = defaultDocument) {\n return node?.ownerDocument ?? fallback;\n}\n/**\n * Checks if an element is or is contained by another element.\n *\n * @param node The element to check if it or its descendants contain the target element.\n * @param target The element to check if it is contained by the node.\n * @returns\n */\nexport function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport { set, source, state, increment } from '../internal/client/reactivity/sources.js';\nimport { label, tag } from '../internal/client/dev/tracing.js';\nimport { get, update_version } from '../internal/client/runtime.js';\n\n/**\n * A reactive version of the built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) object.\n * Reading contents of the map (by iterating, or by reading `map.size` or calling `map.get(...)` or `map.has(...)` as in the [tic-tac-toe example](https://svelte.dev/playground/0b0ff4aa49c9443f9b47fe5203c78293) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)\n * will cause it to be re-evaluated as necessary when the map is updated.\n *\n * Note that values in a reactive map are _not_ made [deeply reactive](https://svelte.dev/docs/svelte/$state#Deep-state).\n *\n * ```svelte\n * <script>\n * \timport { SvelteMap } from 'svelte/reactivity';\n * \timport { result } from './game.js';\n *\n * \tlet board = new SvelteMap();\n * \tlet player = $state('x');\n * \tlet winner = $derived(result(board));\n *\n * \tfunction reset() {\n * \t\tplayer = 'x';\n * \t\tboard.clear();\n * \t}\n * </script>\n *\n * <div class=\"board\">\n * \t{#each Array(9), i}\n * \t\t<button\n * \t\t\tdisabled={board.has(i) || winner}\n * \t\t\tonclick={() => {\n * \t\t\t\tboard.set(i, player);\n * \t\t\t\tplayer = player === 'x' ? 'o' : 'x';\n * \t\t\t}}\n * \t\t>{board.get(i)}</button>\n * \t{/each}\n * </div>\n *\n * {#if winner}\n * \t<p>{winner} wins!</p>\n * \t<button onclick={reset}>reset</button>\n * {:else}\n * \t<p>{player} is next</p>\n * {/if}\n * ```\n *\n * @template K\n * @template V\n * @extends {Map<K, V>}\n */\nexport class SvelteMap extends Map {\n\t/** @type {Map<K, Source<number>>} */\n\t#sources = new Map();\n\t#version = state(0);\n\t#size = state(0);\n\t#update_version = update_version || -1;\n\n\t/**\n\t * @param {Iterable<readonly [K, V]> | null | undefined} [value]\n\t */\n\tconstructor(value) {\n\t\tsuper();\n\n\t\tif (DEV) {\n\t\t\t// If the value is invalid then the native exception will fire here\n\t\t\tvalue = new Map(value);\n\n\t\t\ttag(this.#version, 'SvelteMap version');\n\t\t\ttag(this.#size, 'SvelteMap.size');\n\t\t}\n\n\t\tif (value) {\n\t\t\tfor (var [key, v] of value) {\n\t\t\t\tsuper.set(key, v);\n\t\t\t}\n\t\t\tthis.#size.v = super.size;\n\t\t}\n\t}\n\n\t/**\n\t * If the source is being created inside the same reaction as the SvelteMap instance,\n\t * we use `state` so that it will not be a dependency of the reaction. Otherwise we\n\t * use `source` so it will be.\n\t *\n\t * @template T\n\t * @param {T} value\n\t * @returns {Source<T>}\n\t */\n\t#source(value) {\n\t\treturn update_version === this.#update_version ? state(value) : source(value);\n\t}\n\n\t/** @param {K} key */\n\thas(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\n\t\tif (s === undefined) {\n\t\t\tif (super.has(key)) {\n\t\t\t\ts = this.#source(0);\n\n\t\t\t\tif (DEV) {\n\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t}\n\n\t\t\t\tsources.set(key, s);\n\t\t\t} else {\n\t\t\t\t// We should always track the version in case\n\t\t\t\t// the Set ever gets this value in the future.\n\t\t\t\tget(this.#version);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tget(s);\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param {(value: V, key: K, map: Map<K, V>) => void} callbackfn\n\t * @param {any} [this_arg]\n\t */\n\tforEach(callbackfn, this_arg) {\n\t\tthis.#read_all();\n\t\tsuper.forEach(callbackfn, this_arg);\n\t}\n\n\t/** @param {K} key */\n\tget(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\n\t\tif (s === undefined) {\n\t\t\tif (super.has(key)) {\n\t\t\t\ts = this.#source(0);\n\n\t\t\t\tif (DEV) {\n\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t}\n\n\t\t\t\tsources.set(key, s);\n\t\t\t} else {\n\t\t\t\t// We should always track the version in case\n\t\t\t\t// the Set ever gets this value in the future.\n\t\t\t\tget(this.#version);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\tget(s);\n\t\treturn super.get(key);\n\t}\n\n\t/**\n\t * @param {K} key\n\t * @param {V} value\n\t * */\n\tgetOrInsert(key, value) {\n\t\tif (!super.has(key)) {\n\t\t\tthis.set(key, value);\n\t\t}\n\t\treturn /** @type {V} */ (this.get(key));\n\t}\n\n\t/**\n\t * @param {K} key\n\t * @param {(key: K) => V} callbackFn\n\t */\n\tgetOrInsertComputed(key, callbackFn) {\n\t\tif (!super.has(key)) {\n\t\t\tthis.set(key, callbackFn(key));\n\t\t}\n\t\treturn /** @type {V} */ (this.get(key));\n\t}\n\n\t/**\n\t * @param {K} key\n\t * @param {V} value\n\t * */\n\tset(key, value) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\t\tvar prev_res = super.get(key);\n\t\tvar res = super.set(key, value);\n\t\tvar version = this.#version;\n\n\t\tif (s === undefined) {\n\t\t\ts = this.#source(0);\n\n\t\t\tif (DEV) {\n\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t}\n\n\t\t\tsources.set(key, s);\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(version);\n\t\t} else if (prev_res !== value) {\n\t\t\tincrement(s);\n\n\t\t\t// if not every reaction of s is a reaction of version we need to also include version\n\t\t\tvar v_reactions = version.reactions === null ? null : new Set(version.reactions);\n\t\t\tvar needs_version_increase =\n\t\t\t\tv_reactions === null ||\n\t\t\t\t!s.reactions?.every((r) =>\n\t\t\t\t\t/** @type {NonNullable<typeof v_reactions>} */ (v_reactions).has(r)\n\t\t\t\t);\n\t\t\tif (needs_version_increase) {\n\t\t\t\tincrement(version);\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/** @param {K} key */\n\tdelete(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\t\tvar res = super.delete(key);\n\n\t\tif (s !== undefined) {\n\t\t\tsources.delete(key);\n\t\t\tset(s, -1);\n\t\t}\n\n\t\tif (res) {\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(this.#version);\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tclear() {\n\t\tif (super.size === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// Clear first, so we get nice console.log outputs with $inspect\n\t\tsuper.clear();\n\t\tvar sources = this.#sources;\n\t\tset(this.#size, 0);\n\t\tfor (var s of sources.values()) {\n\t\t\tset(s, -1);\n\t\t}\n\t\tincrement(this.#version);\n\t\tsources.clear();\n\t}\n\n\t#read_all() {\n\t\tget(this.#version);\n\n\t\tvar sources = this.#sources;\n\t\tif (this.#size.v !== sources.size) {\n\t\t\tfor (var key of super.keys()) {\n\t\t\t\tif (!sources.has(key)) {\n\t\t\t\t\tvar s = this.#source(0);\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t\t}\n\n\t\t\t\t\tsources.set(key, s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor ([, s] of this.#sources) {\n\t\t\tget(s);\n\t\t}\n\t}\n\n\tkeys() {\n\t\tget(this.#version);\n\t\treturn super.keys();\n\t}\n\n\tvalues() {\n\t\tthis.#read_all();\n\t\treturn super.values();\n\t}\n\n\tentries() {\n\t\tthis.#read_all();\n\t\treturn super.entries();\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\tget size() {\n\t\tget(this.#size);\n\t\treturn super.size;\n\t}\n}\n","import { defaultWindow, } from \"../../internal/configurable-globals.js\";\nimport { getActiveElement } from \"../../internal/utils/dom.js\";\nimport { on } from \"svelte/events\";\nimport { createSubscriber } from \"svelte/reactivity\";\nexport class ActiveElement {\n #document;\n #subscribe;\n constructor(options = {}) {\n const { window = defaultWindow, document = window?.document } = options;\n if (window === undefined)\n return;\n this.#document = document;\n this.#subscribe = createSubscriber((update) => {\n const cleanupFocusIn = on(window, \"focusin\", update);\n const cleanupFocusOut = on(window, \"focusout\", update);\n return () => {\n cleanupFocusIn();\n cleanupFocusOut();\n };\n });\n }\n get current() {\n this.#subscribe?.();\n if (!this.#document)\n return null;\n return getActiveElement(this.#document);\n }\n}\n/**\n * An object holding a reactive value that is equal to `document.activeElement`.\n * It automatically listens for changes, keeping the reference up to date.\n *\n * If you wish to use a custom document or shadowRoot, you should use\n * [useActiveElement](https://runed.dev/docs/utilities/active-element) instead.\n *\n * @see {@link https://runed.dev/docs/utilities/active-element}\n */\nexport const activeElement = new ActiveElement();\n","export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nexport function isElement(value) {\n return value instanceof Element;\n}\n","import { getContext, hasContext, setContext } from \"svelte\";\nexport class Context {\n #name;\n #key;\n /**\n * @param name The name of the context.\n * This is used for generating the context key and error messages.\n */\n constructor(name) {\n this.#name = name;\n this.#key = Symbol(name);\n }\n /**\n * The key used to get and set the context.\n *\n * It is not recommended to use this value directly.\n * Instead, use the methods provided by this class.\n */\n get key() {\n return this.#key;\n }\n /**\n * Checks whether this has been set in the context of a parent component.\n *\n * Must be called during component initialisation.\n */\n exists() {\n return hasContext(this.#key);\n }\n /**\n * Retrieves the context that belongs to the closest parent component.\n *\n * Must be called during component initialisation.\n *\n * @throws An error if the context does not exist.\n */\n get() {\n const context = getContext(this.#key);\n if (context === undefined) {\n throw new Error(`Context \"${this.#name}\" not found`);\n }\n return context;\n }\n /**\n * Retrieves the context that belongs to the closest parent component,\n * or the given fallback value if the context does not exist.\n *\n * Must be called during component initialisation.\n */\n getOr(fallback) {\n const context = getContext(this.#key);\n if (context === undefined) {\n return fallback;\n }\n return context;\n }\n /**\n * Associates the given value with the current component and returns it.\n *\n * Must be called during component initialisation.\n */\n set(context) {\n return setContext(this.#key, context);\n }\n}\n","import { untrack } from \"svelte\";\nfunction runEffect(flush, effect) {\n switch (flush) {\n case \"post\":\n $effect(effect);\n break;\n case \"pre\":\n $effect.pre(effect);\n break;\n }\n}\nfunction runWatcher(sources, flush, effect, options = {}) {\n const { lazy = false } = options;\n // Run the effect immediately if `lazy` is `false`.\n let active = !lazy;\n // On the first run, if the dependencies are an array, pass an empty array\n // to the previous value instead of `undefined` to allow destructuring.\n //\n // watch(() => [a, b], ([a, b], [prevA, prevB]) => { ... });\n let previousValues = Array.isArray(sources)\n ? []\n : undefined;\n runEffect(flush, () => {\n const values = Array.isArray(sources) ? sources.map((source) => source()) : sources();\n if (!active) {\n active = true;\n previousValues = values;\n return;\n }\n const cleanup = untrack(() => effect(values, previousValues));\n previousValues = values;\n return cleanup;\n });\n}\nfunction runWatcherOnce(sources, flush, effect) {\n const cleanupRoot = $effect.root(() => {\n let stop = false;\n runWatcher(sources, flush, (values, previousValues) => {\n if (stop) {\n cleanupRoot();\n return;\n }\n // Since `lazy` is `true`, `previousValues` is always defined.\n const cleanup = effect(values, previousValues);\n stop = true;\n return cleanup;\n }, \n // Running the effect immediately just once makes no sense at all.\n // That's just `onMount` with extra steps.\n { lazy: true });\n });\n $effect(() => {\n return cleanupRoot;\n });\n}\nexport function watch(sources, effect, options) {\n runWatcher(sources, \"post\", effect, options);\n}\nfunction watchPre(sources, effect, options) {\n runWatcher(sources, \"pre\", effect, options);\n}\nwatch.pre = watchPre;\nexport function watchOnce(source, effect) {\n runWatcherOnce(source, \"post\", effect);\n}\nfunction watchOncePre(source, effect) {\n runWatcherOnce(source, \"pre\", effect);\n}\nwatchOnce.pre = watchOncePre;\n","import { isFunction } from \"./is.js\";\nexport function get(value) {\n if (isFunction(value)) {\n return value();\n }\n return value;\n}\n","import { defaultWindow } from \"../../internal/configurable-globals.js\";\nimport { get } from \"../../internal/utils/get.js\";\nimport { createSubscriber } from \"svelte/reactivity\";\n/**\n * Returns a reactive value holding the size of `node`.\n *\n * Accepts an `options` object with the following properties:\n * - `initialSize`: The initial size of the element. Defaults to `{ width: 0, height: 0 }`.\n * - `box`: The box model to use. Can be either `\"content-box\"` or `\"border-box\"`. Defaults to `\"border-box\"`.\n *\n * @returns an object with `width` and `height` properties.\n *\n * @see {@link https://runed.dev/docs/utilities/element-size}\n */\nexport class ElementSize {\n // no need to use `$state` here since we are using createSubscriber\n #size = {\n width: 0,\n height: 0,\n };\n #observed = false;\n #options;\n #node;\n #window;\n // we use a derived here to extract the width so that if the width doesn't change we don't get a state update\n // which we would get if we would just use a getter since the version of the subscriber will be changing\n #width = $derived.by(() => {\n this.#subscribe?.();\n return this.getSize().width;\n });\n // we use a derived here to extract the height so that if the height doesn't change we don't get a state update\n // which we would get if we would just use a getter since the version of the subscriber will be changing\n #height = $derived.by(() => {\n this.#subscribe?.();\n return this.getSize().height;\n });\n // we need to use a derived here because the class will be created before the node is bound to the ref\n #subscribe = $derived.by(() => {\n const node$ = get(this.#node);\n if (!node$)\n return;\n return createSubscriber((update) => {\n if (!this.#window)\n return;\n const observer = new this.#window.ResizeObserver((entries) => {\n this.#observed = true;\n for (const entry of entries) {\n const boxSize = this.#options.box === \"content-box\" ? entry.contentBoxSize : entry.borderBoxSize;\n const boxSizeArr = Array.isArray(boxSize) ? boxSize : [boxSize];\n this.#size.width = boxSizeArr.reduce((acc, size) => Math.max(acc, size.inlineSize), 0);\n this.#size.height = boxSizeArr.reduce((acc, size) => Math.max(acc, size.blockSize), 0);\n }\n update();\n });\n observer.observe(node$);\n return () => {\n this.#observed = false;\n observer.disconnect();\n };\n });\n });\n constructor(node, options = { box: \"border-box\" }) {\n this.#window = options.window ?? defaultWindow;\n this.#options = options;\n this.#node = node;\n this.#size = {\n width: 0,\n height: 0,\n };\n }\n calculateSize() {\n const element = get(this.#node);\n // no element or no window, return undefined, we will return 0x0 in the getSize method\n if (!element || !this.#window) {\n return;\n }\n const offsetWidth = element.offsetWidth;\n const offsetHeight = element.offsetHeight;\n // easy mode, just return offsets\n if (this.#options.box === \"border-box\") {\n return {\n width: offsetWidth,\n height: offsetHeight,\n };\n }\n // hard mode, we need to calculate the content size\n const style = this.#window.getComputedStyle(element);\n const paddingWidth = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n const paddingHeight = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n const borderWidth = parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);\n const borderHeight = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n const contentWidth = offsetWidth - paddingWidth - borderWidth;\n const contentHeight = offsetHeight - paddingHeight - borderHeight;\n return {\n width: contentWidth,\n height: contentHeight,\n };\n }\n getSize() {\n // if the resize observer already run we can just return the size\n // otherwise we calculate the size if possible or we return the initial size\n return this.#observed ? this.#size : (this.calculateSize() ?? this.#size);\n }\n get current() {\n this.#subscribe?.();\n return this.getSize();\n }\n get width() {\n return this.#width;\n }\n get height() {\n return this.#height;\n }\n}\n","export function onDestroyEffect(fn) {\n $effect(() => {\n return () => {\n fn();\n };\n });\n}\n","/**\n * A utility function that executes a callback after a specified number of milliseconds.\n */\nexport function afterSleep(ms, cb) {\n return setTimeout(cb, ms);\n}\n","import { tick } from \"svelte\";\nexport function afterTick(fn) {\n tick().then(fn);\n}\n","import { isObject } from \"./is.js\";\nconst ELEMENT_NODE = 1;\nconst DOCUMENT_NODE = 9;\nconst DOCUMENT_FRAGMENT_NODE = 11;\nexport function isHTMLElement(node) {\n return isObject(node) && node.nodeType === ELEMENT_NODE && typeof node.nodeName === \"string\";\n}\nexport function isDocument(node) {\n return isObject(node) && node.nodeType === DOCUMENT_NODE;\n}\nexport function isWindow(node) {\n return isObject(node) && node.constructor?.name === \"VisualViewport\";\n}\nexport function getNodeName(node) {\n if (isHTMLElement(node))\n return node.localName ?? \"\";\n return \"#document\";\n}\nexport function isNode(node) {\n return isObject(node) && node.nodeType !== undefined;\n}\nexport function isShadowRoot(node) {\n return isNode(node) && node.nodeType === DOCUMENT_FRAGMENT_NODE && \"host\" in node;\n}\nexport function contains(parent, child) {\n if (!parent || !child)\n return false;\n if (!isHTMLElement(parent) || !isHTMLElement(child))\n return false;\n const rootNode = child.getRootNode?.();\n if (parent === child)\n return true;\n if (parent.contains(child))\n return true;\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next)\n return true;\n // @ts-expect-error - host is not typed\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nexport function getDocument(node) {\n if (isDocument(node))\n return node;\n if (isWindow(node))\n return node.document;\n return node?.ownerDocument ?? document;\n}\nexport function getDocumentElement(node) {\n return getDocument(node).documentElement;\n}\nexport function getWindow(node) {\n if (isShadowRoot(node))\n return getWindow(node.host);\n if (isDocument(node))\n return node.defaultView ?? window;\n if (isHTMLElement(node))\n return node.ownerDocument?.defaultView ?? window;\n return window;\n}\nexport function getActiveElement(rootNode) {\n let activeElement = rootNode.activeElement;\n while (activeElement?.shadowRoot) {\n const el = activeElement.shadowRoot.activeElement;\n if (el === activeElement)\n break;\n else\n activeElement = el;\n }\n return activeElement;\n}\nexport function getParentNode(node) {\n if (getNodeName(node) === \"html\")\n return node;\n const result = \n // @ts-expect-error - assignedSlot is not typed\n node.assignedSlot ||\n node.parentNode ||\n (isShadowRoot(node) && node.host) ||\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\n","import { boxWith } from \"../box/box-extras.svelte.js\";\nimport { getActiveElement, getDocument } from \"./dom.js\";\nexport class DOMContext {\n element;\n root = $derived.by(() => {\n if (!this.element.current)\n return document;\n const rootNode = this.element.current.getRootNode() ?? document;\n return rootNode;\n });\n constructor(element) {\n if (typeof element === \"function\") {\n this.element = boxWith(element);\n }\n else {\n this.element = element;\n }\n }\n getDocument = () => {\n return getDocument(this.root);\n };\n getWindow = () => {\n return this.getDocument().defaultView ?? window;\n };\n getActiveElement = () => {\n return getActiveElement(this.root);\n };\n isActiveElement = (node) => {\n return node === this.getActiveElement();\n };\n getElementById(id) {\n return this.root.getElementById(id);\n }\n querySelector = (selector) => {\n if (!this.root)\n return null;\n return this.root.querySelector(selector);\n };\n querySelectorAll = (selector) => {\n if (!this.root)\n return [];\n return this.root.querySelectorAll(selector);\n };\n setTimeout = (callback, delay) => {\n return this.getWindow().setTimeout(callback, delay);\n };\n clearTimeout = (timeoutId) => {\n return this.getWindow().clearTimeout(timeoutId);\n };\n}\n","import { untrack } from \"svelte\";\nimport { isBox } from \"../box/box-extras.svelte.js\";\nimport { createAttachmentKey } from \"svelte/attachments\";\n/**\n * Creates a Svelte Attachment that attaches a DOM element to a ref.\n * The ref can be either a WritableBox or a callback function.\n *\n * @param ref - Either a WritableBox to store the element in, or a callback function that receives the element\n * @param onChange - Optional callback that fires when the ref changes\n * @returns An object with a spreadable attachment key that should be spread onto the element\n *\n * @example\n * // Using with WritableBox\n * const ref = box<HTMLDivElement | null>(null);\n * <div {...attachRef(ref)}>Content</div>\n *\n * @example\n * // Using with callback\n * <div {...attachRef((node) => myNode = node)}>Content</div>\n *\n * @example\n * // Using with onChange\n * <div {...attachRef(ref, (node) => console.log(node))}>Content</div>\n */\nexport function attachRef(ref, onChange) {\n return {\n [createAttachmentKey()]: (node) => {\n if (isBox(ref)) {\n ref.current = node;\n untrack(() => onChange?.(node));\n return () => {\n // we don't want to detach the node if it's still connected\n if (\"isConnected\" in node && node.isConnected)\n return;\n ref.current = null;\n onChange?.(null);\n };\n }\n ref(node);\n untrack(() => onChange?.(node));\n return () => {\n // we don't want to detach the node if it's still connected\n if (\"isConnected\" in node && node.isConnected)\n return;\n ref(null);\n onChange?.(null);\n };\n }\n };\n}\n","export function boolToStr(condition) {\n return condition ? \"true\" : \"false\";\n}\nexport function boolToStrTrueOrUndef(condition) {\n return condition ? \"true\" : undefined;\n}\nexport function boolToEmptyStrOrUndef(condition) {\n return condition ? \"\" : undefined;\n}\nexport function boolToTrueOrUndef(condition) {\n return condition ? true : undefined;\n}\nexport function getDataOpenClosed(condition) {\n return condition ? \"open\" : \"closed\";\n}\nexport function getDataChecked(condition) {\n return condition ? \"checked\" : \"unchecked\";\n}\nexport function getDataTransitionAttrs(state) {\n if (state === \"starting\")\n return { \"data-starting-style\": \"\" };\n if (state === \"ending\")\n return { \"data-ending-style\": \"\" };\n return {};\n}\nexport function getAriaChecked(checked, indeterminate) {\n if (indeterminate)\n return \"mixed\";\n return checked ? \"true\" : \"false\";\n}\nexport class BitsAttrs {\n #variant;\n #prefix;\n attrs;\n constructor(config) {\n this.#variant = config.getVariant ? config.getVariant() : null;\n this.#prefix = this.#variant ? `data-${this.#variant}-` : `data-${config.component}-`;\n this.getAttr = this.getAttr.bind(this);\n this.selector = this.selector.bind(this);\n this.attrs = Object.fromEntries(config.parts.map((part) => [part, this.getAttr(part)]));\n }\n getAttr(part, variantOverride) {\n if (variantOverride)\n return `data-${variantOverride}-${part}`;\n return `${this.#prefix}${part}`;\n }\n selector(part, variantOverride) {\n return `[${this.getAttr(part, variantOverride)}]`;\n }\n}\nexport function createBitsAttrs(config) {\n const bitsAttrs = new BitsAttrs(config);\n return {\n ...bitsAttrs.attrs,\n selector: bitsAttrs.selector,\n getAttr: bitsAttrs.getAttr,\n };\n}\n","export const ALT = \"Alt\";\nexport const ARROW_DOWN = \"ArrowDown\";\nexport const ARROW_LEFT = \"ArrowLeft\";\nexport const ARROW_RIGHT = \"ArrowRight\";\nexport const ARROW_UP = \"ArrowUp\";\nexport const BACKSPACE = \"Backspace\";\nexport const CAPS_LOCK = \"CapsLock\";\nexport const CONTROL = \"Control\";\nexport const DELETE = \"Delete\";\nexport const END = \"End\";\nexport const ENTER = \"Enter\";\nexport const ESCAPE = \"Escape\";\nexport const F1 = \"F1\";\nexport const F10 = \"F10\";\nexport const F11 = \"F11\";\nexport const F12 = \"F12\";\nexport const F2 = \"F2\";\nexport const F3 = \"F3\";\nexport const F4 = \"F4\";\nexport const F5 = \"F5\";\nexport const F6 = \"F6\";\nexport const F7 = \"F7\";\nexport const F8 = \"F8\";\nexport const F9 = \"F9\";\nexport const HOME = \"Home\";\nexport const META = \"Meta\";\nexport const PAGE_DOWN = \"PageDown\";\nexport const PAGE_UP = \"PageUp\";\nexport const SHIFT = \"Shift\";\nexport const SPACE = \" \";\nexport const TAB = \"Tab\";\nexport const CTRL = \"Control\";\nexport const ASTERISK = \"*\";\nexport const a = \"a\";\nexport const P = \"P\";\nexport const A = \"A\";\nexport const p = \"p\";\nexport const n = \"n\";\nexport const j = \"j\";\nexport const k = \"k\";\nexport const h = \"h\";\nexport const l = \"l\";\n","export const isBrowser = typeof document !== \"undefined\";\nexport const isIOS = getIsIOS();\nfunction getIsIOS() {\n return (isBrowser &&\n window?.navigator?.userAgent &&\n (/iP(ad|hone|od)/.test(window.navigator.userAgent) ||\n // The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.\n (window?.navigator?.maxTouchPoints > 2 &&\n /iPad|Macintosh/.test(window?.navigator.userAgent))));\n}\nexport function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isHTMLElement(element) {\n return element instanceof HTMLElement;\n}\nexport function isElement(element) {\n return element instanceof Element;\n}\nexport function isElementOrSVGElement(element) {\n return element instanceof Element || element instanceof SVGElement;\n}\nexport function isNumberString(value) {\n return !Number.isNaN(Number(value)) && !Number.isNaN(Number.parseFloat(value));\n}\nexport function isNull(value) {\n return value === null;\n}\nexport function isTouch(e) {\n return e.pointerType === \"touch\";\n}\nexport function isFocusVisible(element) {\n return element.matches(\":focus-visible\");\n}\nexport function isNotNull(value) {\n return value !== null;\n}\n/**\n * Determines if the provided object is a valid `HTMLInputElement` with\n * a `select` method available.\n */\nexport function isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\n/**\n * Given a node, determine if it is hidden by walking up the\n * DOM tree until we hit the `stopAt` node (exclusive), if provided)\n * otherwise we stop at the document root.\n */\nexport function isElementHidden(node, stopAt) {\n if (getComputedStyle(node).visibility === \"hidden\")\n return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (stopAt !== undefined && node === stopAt)\n return false;\n if (getComputedStyle(node).display === \"none\")\n return true;\n node = node.parentElement;\n }\n return false;\n}\n","import { afterTick, onDestroyEffect } from \"svelte-toolbelt\";\nexport class AnimationsComplete {\n #opts;\n #currentFrame = null;\n #observer = null;\n #runId = 0;\n constructor(opts) {\n this.#opts = opts;\n onDestroyEffect(() => this.#cleanup());\n }\n #cleanup() {\n if (this.#currentFrame !== null) {\n window.cancelAnimationFrame(this.#currentFrame);\n this.#currentFrame = null;\n }\n this.#observer?.disconnect();\n this.#observer = null;\n this.#runId++;\n }\n run(fn) {\n this.#cleanup();\n const node = this.#opts.ref.current;\n if (!node)\n return;\n if (typeof node.getAnimations !== \"function\") {\n this.#executeCallback(fn);\n return;\n }\n const runId = this.#runId;\n const executeIfCurrent = () => {\n if (runId !== this.#runId)\n return;\n this.#executeCallback(fn);\n };\n const waitForAnimations = () => {\n if (runId !== this.#runId)\n return;\n const animations = node.getAnimations();\n if (animations.length === 0) {\n executeIfCurrent();\n return;\n }\n Promise.all(animations.map((animation) => animation.finished))\n .then(() => {\n executeIfCurrent();\n })\n .catch(() => {\n if (runId !== this.#runId)\n return;\n const currentAnimations = node.getAnimations();\n const hasRunningAnimations = currentAnimations.some((animation) => animation.pending || animation.playState !== \"finished\");\n if (hasRunningAnimations) {\n waitForAnimations();\n return;\n }\n executeIfCurrent();\n });\n };\n const requestWaitForAnimations = () => {\n this.#currentFrame = window.requestAnimationFrame(() => {\n this.#currentFrame = null;\n waitForAnimations();\n });\n };\n if (!this.#opts.afterTick.current) {\n requestWaitForAnimations();\n return;\n }\n this.#currentFrame = window.requestAnimationFrame(() => {\n this.#currentFrame = null;\n const startingStyleAttr = \"data-starting-style\";\n if (!node.hasAttribute(startingStyleAttr)) {\n requestWaitForAnimations();\n return;\n }\n this.#observer = new MutationObserver(() => {\n if (runId !== this.#runId)\n return;\n if (node.hasAttribute(startingStyleAttr))\n return;\n this.#observer?.disconnect();\n this.#observer = null;\n requestWaitForAnimations();\n });\n this.#observer.observe(node, {\n attributes: true,\n attributeFilter: [startingStyleAttr],\n });\n });\n }\n #executeCallback(fn) {\n const execute = () => {\n fn();\n };\n if (this.#opts.afterTick) {\n afterTick(execute);\n }\n else {\n execute();\n }\n }\n}\n","import { watch } from \"runed\";\nimport { onDestroyEffect } from \"svelte-toolbelt\";\nimport { AnimationsComplete } from \"./animations-complete.js\";\nexport class PresenceManager {\n #opts;\n #enabled;\n #afterAnimations;\n #shouldRender = $state(false);\n #transitionStatus = $state(undefined);\n #hasMounted = false;\n #transitionFrame = null;\n constructor(opts) {\n this.#opts = opts;\n this.#shouldRender = opts.open.current;\n this.#enabled = opts.enabled ?? true;\n this.#afterAnimations = new AnimationsComplete({\n ref: this.#opts.ref,\n afterTick: this.#opts.open,\n });\n onDestroyEffect(() => this.#clearTransitionFrame());\n watch(() => this.#opts.open.current, (isOpen) => {\n if (!this.#hasMounted) {\n this.#hasMounted = true;\n return;\n }\n this.#clearTransitionFrame();\n if (!isOpen && this.#opts.shouldSkipExitAnimation?.()) {\n this.#shouldRender = false;\n this.#transitionStatus = undefined;\n this.#opts.onComplete?.();\n return;\n }\n if (isOpen)\n this.#shouldRender = true;\n this.#transitionStatus = isOpen ? \"starting\" : \"ending\";\n if (isOpen) {\n this.#transitionFrame = window.requestAnimationFrame(() => {\n this.#transitionFrame = null;\n if (this.#opts.open.current) {\n this.#transitionStatus = undefined;\n }\n });\n }\n if (!this.#enabled) {\n if (!isOpen) {\n this.#shouldRender = false;\n }\n this.#transitionStatus = undefined;\n this.#opts.onComplete?.();\n return;\n }\n this.#afterAnimations.run(() => {\n if (isOpen === this.#opts.open.current) {\n if (!this.#opts.open.current) {\n this.#shouldRender = false;\n }\n this.#transitionStatus = undefined;\n this.#opts.onComplete?.();\n }\n });\n });\n }\n get shouldRender() {\n return this.#shouldRender;\n }\n get transitionStatus() {\n return this.#transitionStatus;\n }\n #clearTransitionFrame() {\n if (this.#transitionFrame === null)\n return;\n window.cancelAnimationFrame(this.#transitionFrame);\n this.#transitionFrame = null;\n }\n}\n","/**\n * A no operation function (does nothing)\n */\nexport function noop() { }\n","export function createId(prefixOrUid, uid) {\n if (uid === undefined)\n return `bits-${prefixOrUid}`;\n return `bits-${prefixOrUid}-${uid}`;\n}\n","import { attachRef, boxWith, onDestroyEffect, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { createBitsAttrs, boolToStr, getDataOpenClosed, boolToEmptyStrOrUndef, getDataTransitionAttrs, } from \"../../internal/attrs.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nconst dialogAttrs = createBitsAttrs({\n component: \"dialog\",\n parts: [\"content\", \"trigger\", \"overlay\", \"title\", \"description\", \"close\", \"cancel\", \"action\"],\n});\nconst DialogRootContext = new Context(\"Dialog.Root | AlertDialog.Root\");\nexport class DialogRootState {\n static create(opts) {\n const parent = DialogRootContext.getOr(null);\n return DialogRootContext.set(new DialogRootState(opts, parent));\n }\n opts;\n triggerNode = $state(null);\n contentNode = $state(null);\n overlayNode = $state(null);\n descriptionNode = $state(null);\n contentId = $state(undefined);\n titleId = $state(undefined);\n triggerId = $state(undefined);\n descriptionId = $state(undefined);\n cancelNode = $state(null);\n nestedOpenCount = $state(0);\n depth;\n parent;\n contentPresence;\n overlayPresence;\n constructor(opts, parent) {\n this.opts = opts;\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n this.handleOpen = this.handleOpen.bind(this);\n this.handleClose = this.handleClose.bind(this);\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n enabled: true,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n });\n this.overlayPresence = new PresenceManager({\n ref: boxWith(() => this.overlayNode),\n open: this.opts.open,\n enabled: true,\n });\n watch(() => this.opts.open.current, (isOpen) => {\n if (!this.parent)\n return;\n if (isOpen) {\n this.parent.incrementNested();\n }\n else {\n this.parent.decrementNested();\n }\n }, { lazy: true });\n onDestroyEffect(() => {\n if (this.opts.open.current) {\n this.parent?.decrementNested();\n }\n });\n }\n handleOpen() {\n if (this.opts.open.current)\n return;\n this.opts.open.current = true;\n }\n handleClose() {\n if (!this.opts.open.current)\n return;\n this.opts.open.current = false;\n }\n getBitsAttr = (part) => {\n return dialogAttrs.getAttr(part, this.opts.variant.current);\n };\n incrementNested() {\n this.nestedOpenCount++;\n this.parent?.incrementNested();\n }\n decrementNested() {\n if (this.nestedOpenCount === 0)\n return;\n this.nestedOpenCount--;\n this.parent?.decrementNested();\n }\n sharedProps = $derived.by(() => ({\n \"data-state\": getDataOpenClosed(this.opts.open.current),\n }));\n}\nexport class DialogTriggerState {\n static create(opts) {\n return new DialogTriggerState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.triggerNode = v;\n this.root.triggerId = v?.id;\n });\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleOpen();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleOpen();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": boolToStr(this.root.opts.open.current),\n \"aria-controls\": this.root.contentId,\n [this.root.getBitsAttr(\"trigger\")]: \"\",\n onkeydown: this.onkeydown,\n onclick: this.onclick,\n disabled: this.opts.disabled.current ? true : undefined,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogCloseState {\n static create(opts) {\n return new DialogCloseState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleClose();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleClose();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(this.opts.variant.current)]: \"\",\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n disabled: this.opts.disabled.current ? true : undefined,\n tabindex: 0,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogActionState {\n static create(opts) {\n return new DialogActionState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"action\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogTitleState {\n static create(opts) {\n return new DialogTitleState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.root.titleId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref);\n watch.pre(() => this.opts.id.current, (id) => {\n this.root.titleId = id;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"heading\",\n \"aria-level\": this.opts.level.current,\n [this.root.getBitsAttr(\"title\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogDescriptionState {\n static create(opts) {\n return new DialogDescriptionState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.root.descriptionId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.descriptionNode = v;\n });\n watch.pre(() => this.opts.id.current, (id) => {\n this.root.descriptionId = id;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"description\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogContentState {\n static create(opts) {\n return new DialogContentState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.contentNode = v;\n this.root.contentId = v?.id;\n });\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: this.root.opts.variant.current === \"alert-dialog\" ? \"alertdialog\" : \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-describedby\": this.root.descriptionId,\n \"aria-labelledby\": this.root.titleId,\n [this.root.getBitsAttr(\"content\")]: \"\",\n style: {\n pointerEvents: \"auto\",\n outline: this.root.opts.variant.current === \"alert-dialog\" ? \"none\" : undefined,\n \"--bits-dialog-depth\": this.root.depth,\n \"--bits-dialog-nested-count\": this.root.nestedOpenCount,\n // CSS containment isolates style/layout calculations from the rest of the page,\n // improving performance when there's a large DOM behind the dialog.\n // Paint is omitted so tooltips/selects can render outside dialog bounds.\n contain: \"layout style\",\n },\n tabindex: this.root.opts.variant.current === \"alert-dialog\" ? -1 : undefined,\n \"data-nested-open\": boolToEmptyStrOrUndef(this.root.nestedOpenCount > 0),\n \"data-nested\": boolToEmptyStrOrUndef(this.root.parent !== null),\n ...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n get shouldRender() {\n return this.root.contentPresence.shouldRender;\n }\n}\nexport class DialogOverlayState {\n static create(opts) {\n return new DialogOverlayState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.overlayNode = v));\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"overlay\")]: \"\",\n style: {\n pointerEvents: \"auto\",\n \"--bits-dialog-depth\": this.root.depth,\n \"--bits-dialog-nested-count\": this.root.nestedOpenCount,\n },\n \"data-nested-open\": boolToEmptyStrOrUndef(this.root.nestedOpenCount > 0),\n \"data-nested\": boolToEmptyStrOrUndef(this.root.parent !== null),\n ...getDataTransitionAttrs(this.root.overlayPresence.transitionStatus),\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n get shouldRender() {\n return this.root.overlayPresence.shouldRender;\n }\n}\nexport class AlertDialogCancelState {\n static create(opts) {\n return new AlertDialogCancelState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.cancelNode = v));\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleClose();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleClose();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"cancel\")]: \"\",\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n tabindex: 0,\n disabled: this.opts.disabled.current,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { AlertDialogRootProps } from \"../types.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport { DialogRootState } from \"../../dialog/dialog.svelte.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: AlertDialogRootProps = $props();\n\n\tDialogRootState.create({\n\t\tvariant: boxWith(() => \"alert-dialog\"),\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n</script>\n\n{@render children?.()}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogTitleState } from \"../dialog.svelte.js\";\n\timport type { DialogTitleProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\tchild,\n\t\tchildren,\n\t\tlevel = 2,\n\t\t...restProps\n\t}: DialogTitleProps = $props();\n\n\tconst titleState = DialogTitleState.create({\n\t\tid: boxWith(() => id),\n\t\tlevel: boxWith(() => level),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, titleState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { AlertDialogActionProps } from \"../types.js\";\n\timport { DialogActionState } from \"../../dialog/dialog.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\t...restProps\n\t}: AlertDialogActionProps = $props();\n\n\tconst actionState = DialogActionState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, actionState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { AlertDialogCancelProps } from \"../types.js\";\n\timport { AlertDialogCancelState } from \"../../dialog/dialog.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\tchildren,\n\t\tchild,\n\t\tdisabled = false,\n\t\t...restProps\n\t}: AlertDialogCancelProps = $props();\n\n\tconst cancelState = AlertDialogCancelState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, cancelState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport type { Snippet } from \"svelte\";\n\n\tconst { children }: { children?: Snippet } = $props();\n</script>\n\n{#key children}\n\t{@render children?.()}\n{/key}\n","import { Context } from \"runed\";\nimport { boxWith } from \"svelte-toolbelt\";\nexport const BitsConfigContext = new Context(\"BitsConfig\");\n/**\n * Gets the current Bits UI configuration state from the context.\n *\n * Returns a default configuration (where all values are `undefined`) if no configuration is found.\n */\nexport function getBitsConfig() {\n const fallback = new BitsConfigState(null, {});\n return BitsConfigContext.getOr(fallback).opts;\n}\n/**\n * Creates and sets a new Bits UI configuration state that inherits from parent configs.\n *\n * @param opts - Configuration options for this level\n * @returns The configuration state instance\n *\n * @example\n * ```typescript\n * // In a component that wants to set a default portal target\n * const config = useBitsConfig({ defaultPortalTo: box(\"#some-element\") });\n *\n * // Child components will inherit this config and can override specific values\n * const childConfig = useBitsConfig({ someOtherProp: box(\"value\") });\n * // childConfig still has defaultPortalTo=\"#some-element\" from parent\n * ```\n */\nexport function useBitsConfig(opts) {\n return BitsConfigContext.set(new BitsConfigState(BitsConfigContext.getOr(null), opts));\n}\n/**\n * Configuration state that inherits from parent configurations.\n *\n * @example\n * Config resolution:\n * ```\n * Level 1: { defaultPortalTo: \"#some-element\", theme: \"dark\" }\n * Level 2: { spacing: \"large\" } // inherits defaultPortalTo=\"#some-element\", theme=\"dark\"\n * Level 3: { theme: \"light\" } // inherits defaultPortalTo=\"#some-element\", spacing=\"large\", overrides theme=\"light\"\n * ```\n */\nexport class BitsConfigState {\n opts;\n constructor(parent, opts) {\n const resolveConfigOption = createConfigResolver(parent, opts);\n this.opts = {\n defaultPortalTo: resolveConfigOption((config) => config.defaultPortalTo),\n defaultLocale: resolveConfigOption((config) => config.defaultLocale),\n };\n }\n}\n/**\n * Returns a config resolver that resolves a given config option's value.\n *\n * The resolver creates reactive boxes that resolve config option values using this priority:\n * 1. Current level's value (if defined)\n * 2. Parent level's value (if defined and current is undefined)\n * 3. `undefined` (if no value is found in either parent or child)\n *\n * @param parent - Parent configuration state (null if this is root level)\n * @param currentOpts - Current level's configuration options\n *\n * @example\n * ```typescript\n * // Given this hierarchy:\n * // Root: { defaultPortalTo: \"#some-element\" }\n * // Child: { someOtherProp: \"value\" } // no defaultPortalTo specified\n *\n * const resolveConfigOption = createConfigResolver(parent, opts);\n * const portalTo = resolveConfigOption(config => config.defaultPortalTo);\n *\n * // portalTo.current === \"#some-element\" (inherited from parent)\n * // even when child didn't specify `defaultPortalTo`\n * ```\n */\nfunction createConfigResolver(parent, currentOpts) {\n return (getter) => {\n const configOption = boxWith(() => {\n // try current opts first\n const value = getter(currentOpts)?.current;\n if (value !== undefined)\n return value;\n // if no parent, return undefined\n if (parent === null)\n return undefined;\n // get value from parent (which already has its own chain resolved)\n return getter(parent.opts)?.current;\n });\n return configOption;\n };\n}\n","import { boxWith } from \"svelte-toolbelt\";\nimport { getBitsConfig } from \"./bits-config.js\";\n/**\n * Creates a generic prop resolver that follows a standard priority chain:\n * 1. The getter's prop value (if defined)\n * 2. The config default value (if no getter prop value is defined)\n * 3. The fallback value (if no config value found)\n */\nfunction createPropResolver(configOption, fallback) {\n return (getProp) => {\n const config = getBitsConfig();\n return boxWith(() => {\n // 1. return the prop's value, if provided\n const propValue = getProp();\n if (propValue !== undefined)\n return propValue;\n // 2. return the resolved config option value, if available\n const option = configOption(config).current;\n if (option !== undefined)\n return option;\n // 3. return the fallback if no other value is found\n return fallback;\n });\n };\n}\n/**\n * Resolves a locale value using the prop, the config default, or a fallback.\n *\n * Default value: `\"en\"`\n */\nexport const resolveLocaleProp = createPropResolver((config) => config.defaultLocale, \"en\");\n/**\n * Resolves a portal's `to` value using the prop, the config default, or a fallback.\n *\n * Default value: `\"body\"`\n */\nexport const resolvePortalToProp = createPropResolver((config) => config.defaultPortalTo, \"body\");\n","<script lang=\"ts\">\n\timport { getAllContexts, mount, unmount } from \"svelte\";\n\timport { DEV } from \"esm-env\";\n\timport { watch } from \"runed\";\n\timport PortalConsumer from \"./portal-consumer.svelte\";\n\timport type { PortalProps } from \"./types.js\";\n\timport { isBrowser } from \"../../../internal/is.js\";\n\timport { resolvePortalToProp } from \"../config/prop-resolvers.js\";\n\n\tlet { to: toProp, children, disabled }: PortalProps = $props();\n\n\tconst to = resolvePortalToProp(() => toProp);\n\tconst context = getAllContexts();\n\n\tlet target = $derived(getTarget());\n\n\tfunction getTarget() {\n\t\tif (!isBrowser || disabled) return null;\n\n\t\tlet localTarget: Element | null = null;\n\n\t\tif (typeof to.current === \"string\") {\n\t\t\tconst target = document.querySelector(to.current);\n\t\t\tif (DEV && target === null) {\n\t\t\t\tthrow new Error(`Target element \"${to.current}\" not found.`);\n\t\t\t}\n\t\t\tlocalTarget = target;\n\t\t} else {\n\t\t\tlocalTarget = to.current;\n\t\t}\n\n\t\tif (DEV && !(localTarget instanceof Element)) {\n\t\t\tconst type = localTarget === null ? \"null\" : typeof localTarget;\n\t\t\tthrow new TypeError(\n\t\t\t\t`Unknown portal target type: ${type}. Allowed types: string (query selector) or Element.`\n\t\t\t);\n\t\t}\n\n\t\treturn localTarget;\n\t}\n\n\tlet instance: ReturnType<typeof mount> | null;\n\n\tfunction unmountInstance() {\n\t\tif (instance) {\n\t\t\tunmount(instance);\n\t\t\tinstance = null;\n\t\t}\n\t}\n\n\twatch([() => target, () => disabled], ([target, disabled]) => {\n\t\tif (!target || disabled) {\n\t\t\tunmountInstance();\n\t\t\treturn;\n\t\t}\n\t\tinstance = mount(PortalConsumer, {\n\t\t\ttarget: target,\n\t\t\tprops: { children },\n\t\t\tcontext,\n\t\t});\n\n\t\treturn () => {\n\t\t\tunmountInstance();\n\t\t};\n\t});\n</script>\n\n{#if disabled}\n\t{@render children?.()}\n{/if}\n","// oxlint-disable-next-line no-explicit-any\nexport function debounce(fn, wait = 500) {\n let timeout = null;\n const debounced = (...args) => {\n if (timeout !== null) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n fn(...args);\n }, wait);\n };\n debounced.destroy = () => {\n if (timeout !== null) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n return debounced;\n}\n","export function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\nexport function getOwnerDocument(el) {\n return el?.ownerDocument ?? document;\n}\n","export function getFirstNonCommentChild(element) {\n if (!element)\n return null;\n for (const child of element.childNodes) {\n if (child.nodeType !== Node.COMMENT_NODE) {\n return child;\n }\n }\n return null;\n}\n/**\n * Determines if the click event truly occurred outside the content node.\n * This was added to handle password managers and other elements that may be injected\n * into the DOM but visually appear inside the content.\n */\nexport function isClickTrulyOutside(event, contentNode) {\n const { clientX, clientY } = event;\n const rect = contentNode.getBoundingClientRect();\n return (clientX < rect.left || clientX > rect.right || clientY < rect.top || clientY > rect.bottom);\n}\n","export const CONTEXT_MENU_TRIGGER_ATTR = \"data-context-menu-trigger\";\nexport const CONTEXT_MENU_CONTENT_ATTR = \"data-context-menu-content\";\n","import { afterTick, executeCallbacks, onDestroyEffect, } from \"svelte-toolbelt\";\nimport { watch } from \"runed\";\nimport { untrack } from \"svelte\";\nimport { on } from \"svelte/events\";\nimport {} from \"../../../internal/events.js\";\nimport { debounce } from \"../../../internal/debounce.js\";\nimport { noop } from \"../../../internal/noop.js\";\nimport { getOwnerDocument, isOrContainsTarget } from \"../../../internal/elements.js\";\nimport { isElementOrSVGElement } from \"../../../internal/is.js\";\nimport { isClickTrulyOutside } from \"../../../internal/dom.js\";\nimport { CONTEXT_MENU_CONTENT_ATTR, CONTEXT_MENU_TRIGGER_ATTR, } from \"../../menu/context-menu-attributes.js\";\nglobalThis.bitsDismissableLayers ??= new Map();\nexport class DismissibleLayerState {\n static create(opts) {\n return new DismissibleLayerState(opts);\n }\n opts;\n #interactOutsideProp;\n #behaviorType;\n #interceptedEvents = {\n pointerdown: false,\n };\n #isResponsibleLayer = false;\n #capturedPointerDown = null;\n #isFocusInsideDOMTree = false;\n #documentObj = undefined;\n #onFocusOutside;\n #unsubClickListener = noop;\n /**\n * Set once the layer is torn down. Deferred work scheduled before teardown can\n * still run afterwards, so every such callback must short-circuit on this\n * before reading `this.opts.ref.current` — reading a destroyed `$derived`\n * triggers Svelte's `derived_inert` warning. A class field rather than a\n * constructor local so the class-field handlers below can see it too.\n */\n #destroyed = false;\n constructor(opts) {\n this.opts = opts;\n this.#behaviorType = opts.interactOutsideBehavior;\n this.#interactOutsideProp = opts.onInteractOutside;\n this.#onFocusOutside = opts.onFocusOutside;\n let unsubEvents = noop;\n let registeredNode = null;\n const cleanup = () => {\n registeredNode = null;\n this.#resetState();\n globalThis.bitsDismissableLayers.delete(this);\n this.#handleInteractOutside.destroy();\n this.#unsubClickListener();\n unsubEvents();\n };\n watch([() => this.opts.enabled.current, () => this.opts.ref.current], ([enabled, node]) => {\n const nextNode = enabled ? node : null;\n // Ref boxes can invalidate without changing the DOM node during opening.\n // Keep an in-flight interaction when this is still the same registration.\n if (registeredNode === nextNode)\n return;\n cleanup();\n if (!nextNode)\n return;\n registeredNode = nextNode;\n this.#documentObj = getOwnerDocument(nextNode);\n globalThis.bitsDismissableLayers.set(this, this.#behaviorType);\n unsubEvents = this.#addEventListeners();\n });\n onDestroyEffect(() => {\n this.#destroyed = true;\n cleanup();\n });\n }\n #handleFocus = (event) => {\n if (event.defaultPrevented)\n return;\n if (this.#destroyed || !this.opts.ref.current)\n return;\n afterTick(() => {\n // The layer can be destroyed between the focus event and this tick — a\n // focus change is frequently what closes it. `#destroyed` must\n // short-circuit before any `this.opts.ref.current` read.\n if (this.#destroyed)\n return;\n if (!this.opts.ref.current || this.#isTargetWithinLayer(event.target))\n return;\n if (event.target && !this.#isFocusInsideDOMTree) {\n this.#onFocusOutside.current?.(event);\n }\n });\n };\n #addEventListeners() {\n const document = this.#documentObj;\n const onPointerDownCapture = (event) => {\n untrack(() => {\n this.#markInterceptedEvent(event);\n this.#markResponsibleLayer(event);\n });\n };\n const onPointerDown = (event) => {\n // Ignore stopped events and bubble-only events such as the opening pointerdown.\n // It can resume bubbling after a nested early outside click has been captured.\n if (event.cancelBubble || event !== this.#capturedPointerDown)\n return;\n this.#markNonInterceptedEvent(event);\n if (event.pointerType === \"touch\") {\n // a tap's click can follow its pointerdown within a millisecond (WebKit), so\n // arm the click listener now rather than after the debounce flushes\n this.#handleInteractOutside.destroy();\n this.#interactOutside(event);\n }\n else {\n this.#handleInteractOutside(event);\n }\n };\n // `svelte/events.on` defers pointer listener attachment to a microtask, leaving\n // a gap even without a registration timer. Document is already connected, so\n // attach immediately. Only layers present at capture can own this interaction;\n // a layer opened by its target/bubble handlers must not dismiss itself.\n document.addEventListener(\"pointerdown\", onPointerDownCapture, true);\n document.addEventListener(\"pointerdown\", onPointerDown);\n return executeCallbacks(() => document.removeEventListener(\"pointerdown\", onPointerDownCapture, true), () => document.removeEventListener(\"pointerdown\", onPointerDown), on(document, \"focusin\", this.#handleFocus));\n }\n #handleDismiss = (e) => {\n let event = e;\n if (event.defaultPrevented) {\n event = createWrappedEvent(e);\n }\n this.#interactOutsideProp.current(e);\n };\n #interactOutside = (e) => {\n if (!this.opts.ref.current) {\n this.#unsubClickListener();\n return;\n }\n const isEventValid = this.opts.isValidEvent.current(e, this.opts.ref.current) ||\n isValidEvent(e, this.opts.ref.current);\n if (!this.#isResponsibleLayer || this.#isAnyEventIntercepted() || !isEventValid) {\n this.#unsubClickListener();\n return;\n }\n let event = e;\n if (event.defaultPrevented) {\n event = createWrappedEvent(event);\n }\n if (this.#behaviorType.current !== \"close\" &&\n this.#behaviorType.current !== \"defer-otherwise-close\") {\n this.#unsubClickListener();\n return;\n }\n if (e.pointerType === \"touch\") {\n this.#unsubClickListener();\n // the tap's click dismisses from the bubble phase, as before. A capture-phase\n // listener backs it up with a task, so a target that stops propagation cannot\n // hide the click, while a target that closes this layer still tears it down\n // (and the backup with it) before the task runs.\n let backup = null;\n let unsubClick = noop;\n const dismiss = (event) => {\n unsubClick();\n this.#handleDismiss(event);\n };\n unsubClick = executeCallbacks(on(this.#documentObj, \"click\", dismiss, { once: true }), on(this.#documentObj, \"click\", (event) => {\n backup = setTimeout(() => dismiss(event), 0);\n }, { once: true, capture: true }), () => {\n if (backup !== null)\n clearTimeout(backup);\n backup = null;\n });\n this.#unsubClickListener = unsubClick;\n }\n else {\n this.#interactOutsideProp.current(event);\n }\n };\n #handleInteractOutside = debounce(this.#interactOutside, 10);\n #markInterceptedEvent = (e) => {\n this.#interceptedEvents[e.type] = true;\n };\n #markNonInterceptedEvent = (e) => {\n this.#interceptedEvents[e.type] = false;\n };\n #markResponsibleLayer = (event) => {\n this.#capturedPointerDown = event;\n if (!this.opts.ref.current)\n return;\n this.#isResponsibleLayer = isResponsibleLayer(this.opts.ref.current);\n };\n #isTargetWithinLayer = (target) => {\n if (!this.opts.ref.current)\n return false;\n return isOrContainsTarget(this.opts.ref.current, target);\n };\n /**\n * Resets the per-interaction state. Must stay synchronous.\n *\n * This was a `debounce(..., 20)` from when it was also wired to a capture-phase\n * interaction-end listener and had to land after the 10ms `#handleInteractOutside`\n * debounce. That listener is gone, but the debounce stayed on the `cleanup()` path —\n * and because `watch` runs `cleanup()` once per open (`ref` goes null -> node), every\n * layer scheduled a reset 20ms into its own lifetime. An outside `pointerdown` landing\n * 10-20ms after that cleanup would have its `#isResponsibleLayer` flag cleared by the\n * stale reset in the gap before the debounced `#handleInteractOutside` ran, which then\n * bailed and left the layer open. `cleanup()` destroys `#handleInteractOutside` anyway,\n * so nothing is left in flight that needs to observe the pre-reset state.\n */\n #resetState = () => {\n for (const eventType in this.#interceptedEvents) {\n this.#interceptedEvents[eventType] = false;\n }\n this.#isResponsibleLayer = false;\n this.#capturedPointerDown = null;\n };\n #isAnyEventIntercepted() {\n const i = Object.values(this.#interceptedEvents).some(Boolean);\n return i;\n }\n #onfocuscapture = () => {\n this.#isFocusInsideDOMTree = true;\n };\n #onblurcapture = () => {\n this.#isFocusInsideDOMTree = false;\n };\n props = {\n onfocuscapture: this.#onfocuscapture,\n onblurcapture: this.#onblurcapture,\n };\n}\nexport function getTopMostDismissableLayer(layersArr = [\n ...globalThis.bitsDismissableLayers,\n]) {\n return layersArr.findLast(([_, { current: behaviorType }]) => behaviorType === \"close\" || behaviorType === \"ignore\");\n}\nfunction isResponsibleLayer(node) {\n const layersArr = [...globalThis.bitsDismissableLayers];\n /**\n * We first check if we can find a top layer with `close` or `ignore`.\n * If that top layer was found and matches the provided node, then the node is\n * responsible for the outside interaction. Otherwise, we know that all layers defer so\n * the first layer is the responsible one.\n */\n const topMostLayer = getTopMostDismissableLayer(layersArr);\n if (topMostLayer)\n return topMostLayer[0].opts.ref.current === node;\n const [firstLayerNode] = layersArr[0];\n return firstLayerNode.opts.ref.current === node;\n}\nfunction isValidEvent(e, node) {\n const target = e.target;\n if (!isElementOrSVGElement(target))\n return false;\n const targetIsContextMenuTrigger = Boolean(target.closest(`[${CONTEXT_MENU_TRIGGER_ATTR}]`));\n const nodeIsContextMenu = Boolean(node.closest(`[${CONTEXT_MENU_CONTENT_ATTR}]`));\n if (\"button\" in e && e.button > 0 && !targetIsContextMenuTrigger)\n return false;\n if (\"button\" in e && e.button === 0 && targetIsContextMenuTrigger && nodeIsContextMenu) {\n return true;\n }\n if (targetIsContextMenuTrigger && nodeIsContextMenu)\n return false;\n const ownerDocument = getOwnerDocument(target);\n const isValid = ownerDocument.documentElement.contains(target) &&\n !isOrContainsTarget(node, target) &&\n isClickTrulyOutside(e, node);\n return isValid;\n}\nfunction createWrappedEvent(e) {\n const capturedCurrentTarget = e.currentTarget;\n const capturedTarget = e.target;\n let newEvent;\n if (e instanceof PointerEvent) {\n newEvent = new PointerEvent(e.type, e);\n }\n else {\n newEvent = new PointerEvent(\"pointerdown\", e);\n }\n // track the prevented state separately\n let isPrevented = false;\n // Create a proxy to intercept property access and method calls\n const wrappedEvent = new Proxy(newEvent, {\n get: (target, prop) => {\n if (prop === \"currentTarget\") {\n return capturedCurrentTarget;\n }\n if (prop === \"target\") {\n return capturedTarget;\n }\n if (prop === \"preventDefault\") {\n return () => {\n isPrevented = true;\n if (typeof target.preventDefault === \"function\") {\n target.preventDefault();\n }\n };\n }\n if (prop === \"defaultPrevented\") {\n return isPrevented;\n }\n if (prop in target) {\n // oxlint-disable-next-line no-explicit-any\n return target[prop];\n }\n // oxlint-disable-next-line no-explicit-any\n return e[prop];\n },\n });\n return wrappedEvent;\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { DismissibleLayerImplProps } from \"./types.js\";\n\timport { DismissibleLayerState } from \"./use-dismissable-layer.svelte.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\tinteractOutsideBehavior = \"close\",\n\t\tonInteractOutside = noop,\n\t\tonFocusOutside = noop,\n\t\tid,\n\t\tchildren,\n\t\tenabled,\n\t\tisValidEvent = () => false,\n\t\tref,\n\t}: DismissibleLayerImplProps = $props();\n\n\tconst dismissibleLayerState = DismissibleLayerState.create({\n\t\tid: boxWith(() => id),\n\t\tinteractOutsideBehavior: boxWith(() => interactOutsideBehavior),\n\t\tonInteractOutside: boxWith(() => onInteractOutside),\n\t\tenabled: boxWith(() => enabled),\n\t\tonFocusOutside: boxWith(() => onFocusOutside),\n\t\tisValidEvent: boxWith(() => isValidEvent),\n\t\tref,\n\t});\n</script>\n\n{@render children?.({ props: dismissibleLayerState.props })}\n","import { DOMContext } from \"svelte-toolbelt\";\nimport { watch } from \"runed\";\nimport { on } from \"svelte/events\";\nimport { kbd } from \"../../../internal/kbd.js\";\nimport { noop } from \"../../../internal/noop.js\";\nglobalThis.bitsEscapeLayers ??= new Map();\nexport class EscapeLayerState {\n static create(opts) {\n return new EscapeLayerState(opts);\n }\n opts;\n domContext;\n constructor(opts) {\n this.opts = opts;\n this.domContext = new DOMContext(this.opts.ref);\n let unsubEvents = noop;\n watch(() => opts.enabled.current, (enabled) => {\n if (enabled) {\n globalThis.bitsEscapeLayers.set(this, opts.escapeKeydownBehavior);\n unsubEvents = this.#addEventListener();\n }\n return () => {\n unsubEvents();\n globalThis.bitsEscapeLayers.delete(this);\n };\n });\n }\n #addEventListener = () => {\n return on(this.domContext.getDocument(), \"keydown\", this.#onkeydown, { passive: false });\n };\n #onkeydown = (e) => {\n if (e.key !== kbd.ESCAPE || !isResponsibleEscapeLayer(this))\n return;\n const clonedEvent = new KeyboardEvent(e.type, e);\n e.preventDefault();\n const behaviorType = this.opts.escapeKeydownBehavior.current;\n if (behaviorType !== \"close\" && behaviorType !== \"defer-otherwise-close\")\n return;\n this.opts.onEscapeKeydown.current(clonedEvent);\n };\n}\nfunction isResponsibleEscapeLayer(instance) {\n const layersArr = [...globalThis.bitsEscapeLayers];\n /**\n * We first check if we can find a top layer with `close` or `ignore`.\n * If that top layer was found and matches the provided node, then the node is\n * responsible for the escape. Otherwise, we know that all layers defer so\n * the first layer is the responsible one.\n */\n const topMostLayer = layersArr.findLast(([_, { current: behaviorType }]) => behaviorType === \"close\" || behaviorType === \"ignore\");\n if (topMostLayer)\n return topMostLayer[0] === instance;\n const [firstLayerNode] = layersArr[0];\n return firstLayerNode === instance;\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { EscapeLayerImplProps } from \"./types.js\";\n\timport { EscapeLayerState } from \"./use-escape-layer.svelte.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\tescapeKeydownBehavior = \"close\",\n\t\tonEscapeKeydown = noop,\n\t\tchildren,\n\t\tenabled,\n\t\tref,\n\t}: EscapeLayerImplProps = $props();\n\n\tEscapeLayerState.create({\n\t\tescapeKeydownBehavior: boxWith(() => escapeKeydownBehavior),\n\t\tonEscapeKeydown: boxWith(() => onEscapeKeydown),\n\t\tenabled: boxWith(() => enabled),\n\t\tref,\n\t});\n</script>\n\n{@render children?.()}\n","import { getActiveElement, simpleBox } from \"svelte-toolbelt\";\nimport { FocusScope } from \"./focus-scope.svelte.js\";\nexport class FocusScopeManager {\n static instance;\n #scopeStack = simpleBox([]);\n #focusHistory = new WeakMap();\n #preFocusHistory = new WeakMap();\n static getInstance() {\n if (!this.instance) {\n this.instance = new FocusScopeManager();\n }\n return this.instance;\n }\n register(scope) {\n const current = this.getActive();\n if (current && current !== scope) {\n current.pause();\n }\n // capture the currently focused element before this scope becomes active\n const activeElement = getActiveElement(document);\n if (activeElement && activeElement !== document.body) {\n this.#preFocusHistory.set(scope, activeElement);\n }\n this.#scopeStack.current = this.#scopeStack.current.filter((s) => s !== scope);\n this.#scopeStack.current.unshift(scope);\n }\n unregister(scope) {\n this.#scopeStack.current = this.#scopeStack.current.filter((s) => s !== scope);\n const next = this.getActive();\n if (next) {\n next.resume();\n }\n }\n getActive() {\n return this.#scopeStack.current[0];\n }\n setFocusMemory(scope, element) {\n this.#focusHistory.set(scope, element);\n }\n getFocusMemory(scope) {\n return this.#focusHistory.get(scope);\n }\n isActiveScope(scope) {\n return this.getActive() === scope;\n }\n setPreFocusMemory(scope, element) {\n this.#preFocusHistory.set(scope, element);\n }\n getPreFocusMemory(scope) {\n return this.#preFocusHistory.get(scope);\n }\n clearPreFocusMemory(scope) {\n this.#preFocusHistory.delete(scope);\n }\n}\n","/*!\n* tabbable 6.5.0\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\n// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\nvar candidateSelectors = ['input:not([inert]):not([inert] *)', 'select:not([inert]):not([inert] *)', 'textarea:not([inert]):not([inert] *)', 'a[href]:not([inert]):not([inert] *)', 'area[href]:not([inert]):not([inert] *)', 'button:not([inert]):not([inert] *)', '[tabindex]:not(slot):not([inert]):not([inert] *)', 'audio[controls]:not([inert]):not([inert] *)', 'video[controls]:not([inert]):not([inert] *)', '[contenteditable]:not([contenteditable=\"false\"]):not([inert]):not([inert] *)', 'details>summary:first-of-type:not([inert]):not([inert] *)', 'details:not([inert]):not([inert] *)'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n var _element$getRootNode;\n return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);\n} : function (element) {\n return element === null || element === void 0 ? void 0 : element.ownerDocument;\n};\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Node} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nvar _isInert = function isInert(node, lookUp) {\n var _node$getAttribute;\n if (lookUp === void 0) {\n lookUp = true;\n }\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');\n var inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n var result = inert || lookUp && node && (\n // closest does not exist on shadow roots, so we fall back to a manual\n // lookup upward, in case it is not defined.\n typeof node.closest === 'function' ? node.closest('[inert]') : _isInert(node.parentNode));\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nvar isContentEditable = function isContentEditable(node) {\n var _node$getAttribute2;\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert (either by itself or via its parent), then all its children are inert\n if (_isInert(el)) {\n return [];\n }\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.<Element|CandidateScope>}\n */\nvar _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n if (_isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = _getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n var shadowRoot = element.shadowRoot ||\n // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nvar hasTabIndex = function hasTabIndex(node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nvar getTabIndex = function getTabIndex(node) {\n if (!node) {\n throw new Error('No node provided');\n }\n if (node.tabIndex < 0) {\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {\n return 0;\n }\n }\n return node.tabIndex;\n};\n\n/**\n * Determine the tab index of a given node __for sort order purposes__.\n * @param {HTMLElement} node\n * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,\n * has tabIndex -1, but needs to be sorted by document order in order for its content to be\n * inserted into the correct sort position.\n * @returns {number} Tab order (negative, 0, or positive number).\n */\nvar getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {\n var tabIndex = getTabIndex(node);\n if (tabIndex < 0 && isScope && !hasTabIndex(node)) {\n return 0;\n }\n return tabIndex;\n};\nvar sortOrderedTabbables = function sortOrderedTabbables(a, b) {\n return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;\n};\nvar isInput = function isInput(node) {\n return node.tagName === 'INPUT';\n};\nvar isHiddenInput = function isHiddenInput(node) {\n return isInput(node) && node.type === 'hidden';\n};\nvar isDetailsWithSummary = function isDetailsWithSummary(node) {\n var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {\n return child.tagName === 'SUMMARY';\n });\n return r;\n};\nvar getCheckedRadio = function getCheckedRadio(nodes, form) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\nvar isTabbableRadio = function isTabbableRadio(node) {\n if (!node.name) {\n return true;\n }\n var radioScope = node.form || getRootNode(node);\n var queryRadios = function queryRadios(name) {\n return radioScope.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');\n };\n var radioSet;\n if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);\n return false;\n }\n }\n var checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\nvar isRadio = function isRadio(node) {\n return isInput(node) && node.type === 'radio';\n};\nvar isNonTabbableRadio = function isNonTabbableRadio(node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\n// determines if a node is ultimately attached to the window's document\nvar isNodeAttached = function isNodeAttached(node) {\n var _nodeRoot;\n // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n // (but NOT _the_ document; see second 'If' comment below for more).\n // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n // is attached, and the one we need to check if it's in the document or not (because the\n // shadow, and all nodes it contains, is never considered in the document since shadows\n // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n // is hidden, or is not in the document itself but is detached, it will affect the shadow's\n // visibility, including all the nodes it contains). The host could be any normal node,\n // or a custom element (i.e. web component). Either way, that's the one that is considered\n // part of the document, not the shadow root, nor any of its children (i.e. the node being\n // tested).\n // To further complicate things, we have to look all the way up until we find a shadow HOST\n // that is attached (or find none) because the node might be in nested shadows...\n // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n // document (per the docs) and while it's a Document-type object, that document does not\n // appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n // node is actually detached.\n // NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible\n // if a tabbable/focusable node was quickly added to the DOM, focused, and then removed\n // from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then\n // `ownerDocument` will be `null`, hence the optional chaining on it.\n var nodeRoot = node && getRootNode(node);\n var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;\n\n // in some cases, a detached node will return itself as the root instead of a document or\n // shadow root object, in which case, we shouldn't try to look further up the host chain\n var attached = false;\n if (nodeRoot && nodeRoot !== node) {\n var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;\n attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));\n while (!attached && nodeRootHost) {\n var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;\n // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,\n // which means we need to get the host's host and check if that parent host is contained\n // in (i.e. attached to) the document\n nodeRoot = getRootNode(nodeRootHost);\n nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;\n attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));\n }\n }\n return attached;\n};\nvar isZeroArea = function isZeroArea(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n width = _node$getBoundingClie.width,\n height = _node$getBoundingClie.height;\n return width === 0 && height === 0;\n};\nvar isHidden = function isHidden(node, _ref) {\n var displayCheck = _ref.displayCheck,\n getShadowRoot = _ref.getShadowRoot;\n if (displayCheck === 'full-native') {\n if ('checkVisibility' in node) {\n // Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility\n var visible = node.checkVisibility({\n // Checking opacity might be desirable for some use cases, but natively,\n // opacity zero elements _are_ focusable and tabbable.\n checkOpacity: false,\n opacityProperty: false,\n contentVisibilityAuto: true,\n visibilityProperty: true,\n // This is an alias for `visibilityProperty`. Contemporary browsers\n // support both. However, this alias has wider browser support (Chrome\n // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so\n // we include it anyway.\n checkVisibilityCSS: true\n });\n return !visible;\n }\n // Fall through to manual visibility checks\n }\n\n // NOTE: visibility will be `undefined` if node is detached from the document\n // (see notes about this further down), which means we will consider it visible\n // (this is legacy behavior from a very long way back)\n // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n // _visibility_ check, not a _display_ check\n var _getComputedStyle = getComputedStyle(node),\n visibility = _getComputedStyle.visibility;\n if (visibility === 'hidden' || visibility === 'collapse') {\n return true;\n }\n var isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n var nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n }\n if (!displayCheck || displayCheck === 'full' ||\n // full-native can run this branch when it falls through in case\n // Element#checkVisibility is unsupported\n displayCheck === 'full-native' || displayCheck === 'legacy-full') {\n if (typeof getShadowRoot === 'function') {\n // figure out if we should consider the node to be in an undisclosed shadow and use the\n // 'non-zero-area' fallback\n var originalNode = node;\n while (node) {\n var parentElement = node.parentElement;\n var rootNode = getRootNode(node);\n if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n ) {\n // node has an undisclosed shadow which means we can only treat it as a black box, so we\n // fall back to a non-zero-area test\n return isZeroArea(node);\n } else if (node.assignedSlot) {\n // iterate up slot\n node = node.assignedSlot;\n } else if (!parentElement && rootNode !== node.ownerDocument) {\n // cross shadow boundary\n node = rootNode.host;\n } else {\n // iterate up normal dom\n node = parentElement;\n }\n }\n node = originalNode;\n }\n // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n // (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n // it might be a falsy value, which means shadow DOM support is disabled\n\n // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n // now we can just test to see if it would normally be visible or not, provided it's\n // attached to the main document.\n // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n if (isNodeAttached(node)) {\n // this works wherever the node is: if there's at least one client rect, it's\n // somehow displayed; it also covers the CSS 'display: contents' case where the\n // node itself is hidden in place of its contents; and there's no need to search\n // up the hierarchy either\n return !node.getClientRects().length;\n }\n\n // Else, the node isn't attached to the document, which means the `getClientRects()`\n // API will __always__ return zero rects (this can happen, for example, if React\n // is used to render nodes onto a detached tree, as confirmed in this thread:\n // https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n //\n // It also means that even window.getComputedStyle(node).display will return `undefined`\n // because styles are only computed for nodes that are in the document.\n //\n // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n // somehow. Though it was never stated officially, anyone who has ever used tabbable\n // APIs on nodes in detached containers has actually implicitly used tabbable in what\n // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n // considering __everything__ to be visible because of the innability to determine styles.\n //\n // v6.0.0: As of this major release, the default 'full' option __no longer treats detached\n // nodes as visible with the 'none' fallback.__\n if (displayCheck !== 'legacy-full') {\n return true; // hidden\n }\n // else, fallback to 'none' mode and consider the node visible\n } else if (displayCheck === 'non-zero-area') {\n // NOTE: Even though this tests that the node's client rect is non-zero to determine\n // whether it's displayed, and that a detached node will __always__ have a zero-area\n // client rect, we don't special-case for whether the node is attached or not. In\n // this mode, we do want to consider nodes that have a zero area to be hidden at all\n // times, and that includes attached or not.\n return isZeroArea(node);\n }\n\n // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume\n // it's visible\n return false;\n};\n\n// form fields (nested) inside a disabled fieldset are not focusable/tabbable\n// unless they are in the _first_ <legend> element of the top-most disabled\n// fieldset\nvar isDisabledFromFieldset = function isDisabledFromFieldset(node) {\n if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n var parentNode = node.parentElement;\n // check if `node` is contained in a disabled <fieldset>\n while (parentNode) {\n if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n // look for the first <legend> among the children of the disabled <fieldset>\n for (var i = 0; i < parentNode.children.length; i++) {\n var child = parentNode.children.item(i);\n // when the first <legend> (in document order) is found\n if (child.tagName === 'LEGEND') {\n // if its parent <fieldset> is not nested in another disabled <fieldset>,\n // return whether `node` is a descendant of its first <legend>\n return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);\n }\n }\n // the disabled <fieldset> containing `node` has no <legend>\n return true;\n }\n parentNode = parentNode.parentElement;\n }\n }\n\n // else, node's tabbable/focusable state should not be affected by a fieldset's\n // enabled/disabled state\n return false;\n};\nvar isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {\n if (node.disabled || isHiddenInput(node) || isHidden(node, options) ||\n // For a details element with a summary, the summary element gets the focus\n isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {\n return false;\n }\n return true;\n};\nvar isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {\n if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {\n return false;\n }\n return true;\n};\nvar isShadowRootTabbable = function isShadowRootTabbable(shadowHostNode) {\n var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n if (isNaN(tabIndex) || tabIndex >= 0) {\n return true;\n }\n // If a custom element has an explicit negative tabindex,\n // browsers will not allow tab targeting said element's children.\n return false;\n};\n\n/**\n * @param {Array.<Element|CandidateScope>} candidates\n * @returns Element[]\n */\nvar _sortByOrder = function sortByOrder(candidates) {\n var regularTabbables = [];\n var orderedTabbables = [];\n candidates.forEach(function (item, i) {\n var isScope = !!item.scopeParent;\n var element = isScope ? item.scopeParent : item;\n var candidateTabindex = getSortOrderTabIndex(element, isScope);\n var elements = isScope ? _sortByOrder(item.candidates) : element;\n if (candidateTabindex === 0) {\n isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n item: item,\n isScope: isScope,\n content: elements\n });\n }\n });\n return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {\n sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);\n return acc;\n }, []).concat(regularTabbables);\n};\nvar tabbable = function tabbable(container, options) {\n options = options || {};\n var candidates;\n if (options.getShadowRoot) {\n candidates = _getCandidatesIteratively([container], options.includeContainer, {\n filter: isNodeMatchingSelectorTabbable.bind(null, options),\n flatten: false,\n getShadowRoot: options.getShadowRoot,\n shadowRootFilter: isShadowRootTabbable\n });\n } else {\n candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));\n }\n return _sortByOrder(candidates);\n};\nvar focusable = function focusable(container, options) {\n options = options || {};\n var candidates;\n if (options.getShadowRoot) {\n candidates = _getCandidatesIteratively([container], options.includeContainer, {\n filter: isNodeMatchingSelectorFocusable.bind(null, options),\n flatten: true,\n getShadowRoot: options.getShadowRoot\n });\n } else {\n candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));\n }\n return candidates;\n};\nvar isTabbable = function isTabbable(node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorTabbable(options, node);\n};\nvar focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe:not([inert]):not([inert] *)').join(',');\nvar isFocusable = function isFocusable(node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { focusable, getTabIndex, isFocusable, isTabbable, tabbable };\n//# sourceMappingURL=index.esm.js.map\n","import { getActiveElement, onDestroyEffect } from \"svelte-toolbelt\";\nimport { FocusScopeManager } from \"./focus-scope-manager.js\";\nimport { focusable, isFocusable, tabbable } from \"tabbable\";\nimport { on } from \"svelte/events\";\nimport { watch } from \"runed\";\nexport class FocusScope {\n #paused = false;\n #container = null;\n #manager = FocusScopeManager.getInstance();\n #cleanupFns = [];\n #opts;\n constructor(opts) {\n this.#opts = opts;\n }\n get paused() {\n return this.#paused;\n }\n pause() {\n this.#paused = true;\n }\n resume() {\n this.#paused = false;\n }\n #cleanup() {\n for (const fn of this.#cleanupFns) {\n fn();\n }\n this.#cleanupFns = [];\n }\n mount(container) {\n if (this.#container) {\n this.unmount();\n }\n this.#container = container;\n this.#manager.register(this);\n this.#setupEventListeners();\n this.#handleOpenAutoFocus();\n }\n unmount() {\n if (!this.#container)\n return;\n this.#cleanup();\n // handle close auto-focus\n this.#handleCloseAutoFocus();\n this.#manager.unregister(this);\n this.#manager.clearPreFocusMemory(this);\n this.#container = null;\n }\n #handleOpenAutoFocus() {\n if (!this.#container)\n return;\n const event = new CustomEvent(\"focusScope.onOpenAutoFocus\", {\n bubbles: false,\n cancelable: true,\n });\n this.#opts.onOpenAutoFocus.current(event);\n if (!event.defaultPrevented) {\n requestAnimationFrame(() => {\n if (!this.#container ||\n this.#paused ||\n !this.#manager.isActiveScope(this) ||\n this.#container.contains(getActiveElement(this.#container.ownerDocument))) {\n return;\n }\n const firstTabbable = this.#getFirstTabbable();\n if (firstTabbable) {\n firstTabbable.focus();\n this.#manager.setFocusMemory(this, firstTabbable);\n }\n else {\n this.#container.focus();\n }\n });\n }\n }\n #handleCloseAutoFocus() {\n const event = new CustomEvent(\"focusScope.onCloseAutoFocus\", {\n bubbles: false,\n cancelable: true,\n });\n this.#opts.onCloseAutoFocus.current?.(event);\n if (!event.defaultPrevented) {\n // return focus to the element that was focused before this scope opened\n const preFocusedElement = this.#manager.getPreFocusMemory(this);\n if (preFocusedElement && preFocusedElement.isConnected) {\n // ensure the element is still focusable and in the document\n try {\n preFocusedElement.focus();\n }\n catch {\n // fallback if focus fails\n document.body.focus();\n }\n }\n }\n }\n #setupEventListeners() {\n if (!this.#container || !this.#opts.trap.current)\n return;\n const container = this.#container;\n const doc = container.ownerDocument;\n const handleFocus = (e) => {\n if (this.#paused || !this.#manager.isActiveScope(this))\n return;\n const target = e.composedPath()[0];\n if (!target)\n return;\n const isInside = container.contains(target);\n if (isInside) {\n // store last focused element\n this.#manager.setFocusMemory(this, target);\n }\n else {\n // focus escaped - bring it back\n const lastFocused = this.#manager.getFocusMemory(this);\n if (lastFocused && container.contains(lastFocused) && isFocusable(lastFocused)) {\n e.preventDefault();\n lastFocused.focus();\n }\n else {\n // fallback to first tabbable or first focusable or container\n const firstTabbable = this.#getFirstTabbable();\n const firstFocusable = this.#getAllFocusables()[0];\n (firstTabbable || firstFocusable || container).focus();\n }\n }\n };\n const handleKeydown = (e) => {\n if (!this.#opts.loop || this.#paused || e.key !== \"Tab\")\n return;\n if (!this.#manager.isActiveScope(this))\n return;\n const tabbables = this.#getTabbables();\n if (tabbables.length === 0)\n return;\n const first = tabbables[0];\n const last = tabbables[tabbables.length - 1];\n if (!e.shiftKey && getActiveElement(doc) === last) {\n e.preventDefault();\n first.focus();\n }\n else if (e.shiftKey && getActiveElement(doc) === first) {\n e.preventDefault();\n last.focus();\n }\n };\n this.#cleanupFns.push(on(doc, \"focusin\", handleFocus, { capture: true }), on(container, \"keydown\", handleKeydown));\n const observer = new MutationObserver(() => {\n const lastFocused = this.#manager.getFocusMemory(this);\n if (lastFocused && !container.contains(lastFocused)) {\n // last focused element was removed\n const firstTabbable = this.#getFirstTabbable();\n const firstFocusable = this.#getAllFocusables()[0];\n const elementToFocus = firstTabbable || firstFocusable;\n if (elementToFocus) {\n elementToFocus.focus();\n this.#manager.setFocusMemory(this, elementToFocus);\n }\n else {\n // no focusable elements left, focus container\n container.focus();\n }\n }\n });\n observer.observe(container, {\n childList: true,\n subtree: true,\n });\n this.#cleanupFns.push(() => observer.disconnect());\n }\n #getTabbables() {\n if (!this.#container)\n return [];\n return tabbable(this.#container, {\n includeContainer: false,\n getShadowRoot: true,\n });\n }\n #getFirstTabbable() {\n const tabbables = this.#getTabbables();\n return tabbables[0] || null;\n }\n #getAllFocusables() {\n if (!this.#container)\n return [];\n return focusable(this.#container, {\n includeContainer: false,\n getShadowRoot: true,\n });\n }\n static use(opts) {\n let scope = null;\n watch([() => opts.ref.current, () => opts.enabled.current], ([ref, enabled]) => {\n if (ref && enabled) {\n if (!scope) {\n scope = new FocusScope(opts);\n }\n scope.mount(ref);\n }\n else if (scope) {\n scope.unmount();\n scope = null;\n }\n });\n onDestroyEffect(() => {\n scope?.unmount();\n });\n return {\n get props() {\n return {\n tabindex: -1,\n };\n },\n };\n }\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { FocusScopeImplProps } from \"./types.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport { FocusScope } from \"./focus-scope.svelte.js\";\n\n\tlet {\n\t\tenabled = false,\n\t\ttrapFocus = false,\n\t\tloop = false,\n\t\tonCloseAutoFocus = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tfocusScope,\n\t\tref,\n\t}: FocusScopeImplProps = $props();\n\n\tconst focusScopeState = FocusScope.use({\n\t\tenabled: boxWith(() => enabled),\n\t\ttrap: boxWith(() => trapFocus),\n\t\tloop: loop,\n\t\tonCloseAutoFocus: boxWith(() => onCloseAutoFocus),\n\t\tonOpenAutoFocus: boxWith(() => onOpenAutoFocus),\n\t\tref,\n\t});\n</script>\n\n{@render focusScope?.({ props: focusScopeState.props })}\n","import { DOMContext, contains, executeCallbacks, } from \"svelte-toolbelt\";\nimport { watch } from \"runed\";\nimport { on } from \"svelte/events\";\nimport { noop } from \"../../../internal/noop.js\";\nimport { isHTMLElement } from \"../../../internal/is.js\";\nconst noopPointer = () => { };\nglobalThis.bitsTextSelectionLayers ??= new Map();\nexport class TextSelectionLayerState {\n static create(opts) {\n return new TextSelectionLayerState(opts);\n }\n opts;\n domContext;\n #unsubSelectionLock = noop;\n #enabledSnapshot = false;\n #onPointerDownSnapshot = noopPointer;\n #onPointerUpSnapshot = noopPointer;\n constructor(opts) {\n this.opts = opts;\n this.domContext = new DOMContext(opts.ref);\n let unsubEvents = noop;\n watch(() => [\n this.opts.enabled.current,\n this.opts.onPointerDown.current,\n this.opts.onPointerUp.current,\n ], ([enabled, onPointerDown, onPointerUp]) => {\n this.#enabledSnapshot = enabled;\n this.#onPointerDownSnapshot = onPointerDown;\n this.#onPointerUpSnapshot = onPointerUp;\n if (enabled) {\n globalThis.bitsTextSelectionLayers.set(this, this.opts.enabled);\n unsubEvents();\n unsubEvents = this.#addEventListeners();\n }\n return () => {\n this.#enabledSnapshot = false;\n unsubEvents();\n this.#resetSelectionLock();\n globalThis.bitsTextSelectionLayers.delete(this);\n };\n });\n }\n #addEventListeners() {\n return executeCallbacks(on(this.domContext.getDocument(), \"pointerdown\", this.#pointerdown), on(this.domContext.getDocument(), \"pointerup\", this.#pointerup));\n }\n #pointerup = (e) => {\n // Releasing the lock is internal cleanup, not a consumer callback, so it must run\n // whatever the event's default-prevented state. Composing it with the user handler\n // meant `composeHandlers` bailed out of the whole chain on a `pointerup` that\n // anything else had cancelled, leaving `user-select: none` on `<body>`.\n this.#resetSelectionLock();\n if (e.defaultPrevented)\n return;\n this.#onPointerUpSnapshot(e);\n };\n #pointerdown = (e) => {\n // Check the plain-boolean snapshot BEFORE reading `this.opts.ref.current`.\n // If this document listener outlives its component, that box is a `$derived`\n // owned by a destroyed effect, and reading it emits `derived_inert` on every\n // pointerdown anywhere in the document, forever.\n if (!this.#enabledSnapshot)\n return;\n // Release any lock still held before arming a new one. Under `forceMount` this\n // handler can run twice for a single event, and `preventTextSelectionOverflow`\n // snapshots the current `user-select` to restore later. Resetting the lock\n // prevents the second arm from re-snapshotting the `none` written the first time.\n this.#resetSelectionLock();\n const node = this.opts.ref.current;\n const target = e.target;\n if (!isHTMLElement(node) || !isHTMLElement(target))\n return;\n /**\n * We only lock user-selection overflow if layer is the top most layer and\n * pointerdown occurred inside the node. You are still allowed to select text\n * outside the node provided pointerdown occurs outside the node.\n */\n if (!isHighestLayer(this) || !contains(node, target))\n return;\n this.#onPointerDownSnapshot(e);\n if (e.defaultPrevented)\n return;\n this.#unsubSelectionLock = preventTextSelectionOverflow(node, this.domContext.getDocument().body);\n };\n #resetSelectionLock = () => {\n this.#unsubSelectionLock();\n this.#unsubSelectionLock = noop;\n };\n}\nconst getUserSelect = (node) => node.style.userSelect || node.style.webkitUserSelect;\nfunction preventTextSelectionOverflow(node, body) {\n const originalBodyUserSelect = getUserSelect(body);\n const originalNodeUserSelect = getUserSelect(node);\n setUserSelect(body, \"none\");\n setUserSelect(node, \"text\");\n return () => {\n setUserSelect(body, originalBodyUserSelect);\n setUserSelect(node, originalNodeUserSelect);\n };\n}\nfunction setUserSelect(node, value) {\n node.style.userSelect = value;\n node.style.webkitUserSelect = value;\n}\nfunction isHighestLayer(instance) {\n const layersArr = [...globalThis.bitsTextSelectionLayers];\n if (!layersArr.length)\n return false;\n const highestLayer = layersArr.at(-1);\n if (!highestLayer)\n return false;\n return highestLayer[0] === instance;\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { TextSelectionLayerImplProps } from \"./types.js\";\n\timport { TextSelectionLayerState } from \"./use-text-selection-layer.svelte.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\tpreventOverflowTextSelection = true,\n\t\tonPointerDown = noop,\n\t\tonPointerUp = noop,\n\t\tid,\n\t\tchildren,\n\t\tenabled,\n\t\tref,\n\t}: TextSelectionLayerImplProps = $props();\n\n\tTextSelectionLayerState.create({\n\t\tid: boxWith(() => id),\n\t\tonPointerDown: boxWith(() => onPointerDown),\n\t\tonPointerUp: boxWith(() => onPointerUp),\n\t\tenabled: boxWith(() => enabled && preventOverflowTextSelection),\n\t\tref,\n\t});\n</script>\n\n{@render children?.()}\n","globalThis.bitsIdCounter ??= { current: 0 };\n/**\n * Generates a unique ID based on a global counter.\n */\nexport function useId(prefix = \"bits\") {\n globalThis.bitsIdCounter.current++;\n return `${prefix}-${globalThis.bitsIdCounter.current}`;\n}\n","export class SharedState {\n #factory;\n #subscribers = 0;\n #state = $state();\n #scope;\n constructor(factory) {\n this.#factory = factory;\n }\n #dispose() {\n this.#subscribers -= 1;\n if (this.#scope && this.#subscribers <= 0) {\n this.#scope();\n this.#state = undefined;\n this.#scope = undefined;\n }\n }\n get(...args) {\n this.#subscribers += 1;\n if (this.#state === undefined) {\n this.#scope = $effect.root(() => {\n this.#state = this.#factory(...args);\n });\n }\n $effect(() => {\n return () => {\n this.#dispose();\n };\n });\n return this.#state;\n }\n}\n","import { SvelteMap } from \"svelte/reactivity\";\nimport { afterTick, boxWith, onDestroyEffect, } from \"svelte-toolbelt\";\nimport { isIOS } from \"./is.js\";\nimport { useId } from \"./use-id.js\";\nimport { watch } from \"runed\";\nimport { SharedState } from \"./shared-state.svelte.js\";\nimport { BROWSER } from \"esm-env\";\nimport { on } from \"svelte/events\";\n/** A map of lock ids to their `locked` state. */\nconst lockMap = new SvelteMap();\nconst MANAGED_PROPERTIES = [\n \"padding-right\",\n \"margin-right\",\n // the shorthand reads \"\" when only one axis is set inline, so its longhands are snapshotted\n // too and restored after it (keep this order)\n \"overflow\",\n \"overflow-x\",\n \"overflow-y\",\n \"pointer-events\",\n \"--scrollbar-width\",\n];\nlet initialProperties = null;\nlet hadInitialStyleAttribute = false;\nconst modifiedProperties = new Set();\nlet stopTouchMoveListener = null;\nlet cleanupTimeoutId = null;\nlet isInCleanupTransition = false;\nfunction setManagedProperty(style, property, value) {\n style.setProperty(property, value);\n modifiedProperties.add(property);\n if (property === \"overflow\") {\n modifiedProperties.add(\"overflow-x\");\n modifiedProperties.add(\"overflow-y\");\n }\n}\nconst anyLocked = boxWith(() => {\n for (const value of lockMap.values()) {\n if (value)\n return true;\n }\n return false;\n});\n/**\n * We track the time we scheduled the cleanup to prevent race conditions\n * when multiple locks are created/destroyed in the same tick, ensuring\n * only the last one to schedule the cleanup will run.\n *\n * reference: https://github.com/huntabyte/bits-ui/issues/1639\n */\nlet cleanupScheduledAt = null;\nconst bodyLockStackCount = new SharedState(() => {\n function resetBodyStyle(documentObj) {\n if (!BROWSER)\n return;\n // without a snapshot, still remove what we set so the body is never left locked\n for (const prop of MANAGED_PROPERTIES) {\n if (!modifiedProperties.has(prop))\n continue;\n const initial = initialProperties?.get(prop);\n if (initial?.value) {\n documentObj.body.style.setProperty(prop, initial.value, initial.priority);\n }\n else {\n documentObj.body.style.removeProperty(prop);\n }\n }\n if (!hadInitialStyleAttribute && documentObj.body.style.length === 0) {\n documentObj.body.removeAttribute(\"style\");\n }\n initialProperties = null;\n modifiedProperties.clear();\n isIOS && stopTouchMoveListener?.();\n }\n function cancelPendingCleanup() {\n if (cleanupTimeoutId === null)\n return;\n window.clearTimeout(cleanupTimeoutId);\n cleanupTimeoutId = null;\n }\n function scheduleCleanupIfNoNewLocks(delay, callback) {\n cancelPendingCleanup();\n isInCleanupTransition = true;\n cleanupScheduledAt = Date.now();\n const currentCleanupId = cleanupScheduledAt;\n /**\n * We schedule the cleanup to run after a delay to allow new locks to register\n * that might have been added in the same tick as the current cleanup.\n *\n * If a new lock is added in the same tick, the cleanup will be cancelled and\n * a new cleanup will be scheduled.\n *\n * This is to prevent the cleanup from running too early and resetting the body\n * style before the new lock has had a chance to apply its styles.\n */\n const cleanupFn = () => {\n cleanupTimeoutId = null;\n // check if this cleanup is still valid (no newer cleanups scheduled)\n if (cleanupScheduledAt !== currentCleanupId)\n return;\n // ensure no new locks were added during the delay\n if (!isAnyLocked(lockMap)) {\n isInCleanupTransition = false;\n callback();\n }\n else {\n isInCleanupTransition = false;\n }\n };\n const actualDelay = delay === null ? 24 : delay;\n cleanupTimeoutId = window.setTimeout(cleanupFn, actualDelay);\n }\n function ensureInitialStyleCaptured() {\n // only capture initial style once, when no locks exist and no cleanup is in progress\n if (initialProperties === null && lockMap.size === 0 && !isInCleanupTransition) {\n hadInitialStyleAttribute = document.body.hasAttribute(\"style\");\n initialProperties = new Map();\n for (const prop of MANAGED_PROPERTIES) {\n initialProperties.set(prop, {\n value: document.body.style.getPropertyValue(prop),\n priority: document.body.style.getPropertyPriority(prop),\n });\n }\n }\n }\n watch(() => anyLocked.current, () => {\n if (!anyLocked.current)\n return;\n // ensure we've captured the initial style before applying any lock styles\n ensureInitialStyleCaptured();\n // if we're applying lock styles, we're no longer in a cleanup transition\n isInCleanupTransition = false;\n const htmlStyle = getComputedStyle(document.documentElement);\n const bodyStyle = getComputedStyle(document.body);\n // check if scrollbar-gutter: stable is already handling scrollbar space\n const hasStableGutter = htmlStyle.scrollbarGutter?.includes(\"stable\") ||\n bodyStyle.scrollbarGutter?.includes(\"stable\");\n // TODO: account for RTL direction, etc.\n const verticalScrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n const paddingRight = Number.parseInt(bodyStyle.paddingRight ?? \"0\", 10);\n const config = {\n padding: paddingRight + verticalScrollbarWidth,\n margin: Number.parseInt(bodyStyle.marginRight ?? \"0\", 10),\n };\n // only add padding compensation if stable gutter isn't handling it\n if (verticalScrollbarWidth > 0 && !hasStableGutter) {\n setManagedProperty(document.body.style, \"padding-right\", `${config.padding}px`);\n setManagedProperty(document.body.style, \"margin-right\", `${config.margin}px`);\n setManagedProperty(document.body.style, \"--scrollbar-width\", `${verticalScrollbarWidth}px`);\n }\n setManagedProperty(document.body.style, \"overflow\", \"hidden\");\n if (isIOS) {\n // IOS devices are special and require a touchmove listener to prevent scrolling\n stopTouchMoveListener = on(document, \"touchmove\", (e) => {\n if (e.target !== document.documentElement)\n return;\n if (e.touches.length > 1)\n return;\n e.preventDefault();\n }, { passive: false });\n }\n /**\n * We ensure pointer-events: none is applied _after_ DOM updates, so that any focus/\n * interaction changes from opening overlays/menus complete _before_ we block pointer\n * events.\n *\n * this avoids race conditions where pointer-events could be set too early and break\n * focus/interaction.\n */\n afterTick(() => {\n setManagedProperty(document.body.style, \"pointer-events\", \"none\");\n setManagedProperty(document.body.style, \"overflow\", \"hidden\");\n });\n });\n onDestroyEffect(() => {\n return () => {\n stopTouchMoveListener?.();\n };\n });\n return {\n get lockMap() {\n return lockMap;\n },\n resetBodyStyle,\n scheduleCleanupIfNoNewLocks,\n cancelPendingCleanup,\n ensureInitialStyleCaptured,\n };\n});\nexport class BodyScrollLock {\n #id = useId();\n #initialState;\n #restoreScrollDelay = () => null;\n #countState;\n locked;\n constructor(initialState, restoreScrollDelay = () => null) {\n this.#initialState = initialState;\n this.#restoreScrollDelay = restoreScrollDelay;\n this.#countState = bodyLockStackCount.get();\n if (!this.#countState)\n return;\n /**\n * Since a new lock is being created, we cancel any pending cleanup to\n * prevent the cleanup from running too early and resetting the body style\n * before the new lock has had a chance to apply its styles.\n *\n * reference: https://github.com/huntabyte/bits-ui/issues/1639\n */\n this.#countState.cancelPendingCleanup();\n // capture initial style before this lock is registered\n this.#countState.ensureInitialStyleCaptured();\n this.#countState.lockMap.set(this.#id, this.#initialState ?? false);\n this.locked = boxWith(() => this.#countState.lockMap.get(this.#id) ?? false, (v) => this.#countState.lockMap.set(this.#id, v));\n onDestroyEffect(() => {\n this.#countState.lockMap.delete(this.#id);\n // if not the last lock, we don't need to do anything\n if (isAnyLocked(this.#countState.lockMap))\n return;\n const restoreScrollDelay = this.#restoreScrollDelay();\n const documentObj = document;\n /**\n * We schedule the cleanup to run after a delay to handle same-tick\n * destroy/create scenarios.\n *\n * reference: https://github.com/huntabyte/bits-ui/issues/1639\n */\n this.#countState.scheduleCleanupIfNoNewLocks(restoreScrollDelay, () => {\n this.#countState.resetBodyStyle(documentObj);\n });\n });\n }\n}\nfunction isAnyLocked(map) {\n for (const [_, value] of map) {\n if (value)\n return true;\n }\n return false;\n}\n","<script lang=\"ts\">\n\timport type { ScrollLockProps } from \"./index.js\";\n\timport { BodyScrollLock } from \"../../../internal/body-scroll-lock.svelte.js\";\n\n\tlet { preventScroll = true, restoreScrollDelay = null }: ScrollLockProps = $props();\n\n\tif (preventScroll) {\n\t\tnew BodyScrollLock(preventScroll, () => restoreScrollDelay);\n\t}\n</script>\n","<script lang=\"ts\">\n\timport { afterSleep, boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { AlertDialogContentProps } from \"../types.js\";\n\timport DismissibleLayer from \"../../utilities/dismissible-layer/dismissible-layer.svelte\";\n\timport EscapeLayer from \"../../utilities/escape-layer/escape-layer.svelte\";\n\timport FocusScope from \"../../utilities/focus-scope/focus-scope.svelte\";\n\timport TextSelectionLayer from \"../../utilities/text-selection-layer/text-selection-layer.svelte\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport ScrollLock from \"../../utilities/scroll-lock/scroll-lock.svelte\";\n\timport { DialogContentState } from \"../../dialog/dialog.svelte.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tforceMount = false,\n\t\tinteractOutsideBehavior = \"ignore\",\n\t\tonCloseAutoFocus = noop,\n\t\tonEscapeKeydown = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tonInteractOutside = noop,\n\t\tpreventScroll = true,\n\t\tpreventOverflowTextSelection = true,\n\t\ttrapFocus = true,\n\t\trestoreScrollDelay = null,\n\t\t...restProps\n\t}: AlertDialogContentProps = $props();\n\n\tconst contentState = DialogContentState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n</script>\n\n{#if contentState.shouldRender || forceMount}\n\t<FocusScope\n\t\tref={contentState.opts.ref}\n\t\tloop\n\t\t{trapFocus}\n\t\tenabled={contentState.root.opts.open.current}\n\t\t{onCloseAutoFocus}\n\t\tonOpenAutoFocus={(e) => {\n\t\t\tonOpenAutoFocus(e);\n\t\t\tif (e.defaultPrevented) return;\n\t\t\te.preventDefault();\n\t\t\tafterSleep(0, () => contentState.opts.ref.current?.focus());\n\t\t}}\n\t>\n\t\t{#snippet focusScope({ props: focusScopeProps })}\n\t\t\t<EscapeLayer\n\t\t\t\t{...mergedProps}\n\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\tref={contentState.opts.ref}\n\t\t\t\tonEscapeKeydown={(e) => {\n\t\t\t\t\tonEscapeKeydown(e);\n\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<DismissibleLayer\n\t\t\t\t\t{...mergedProps}\n\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\t{interactOutsideBehavior}\n\t\t\t\t\tonInteractOutside={(e) => {\n\t\t\t\t\t\tonInteractOutside(e);\n\t\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<TextSelectionLayer\n\t\t\t\t\t\t{...mergedProps}\n\t\t\t\t\t\t{preventOverflowTextSelection}\n\t\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\t>\n\t\t\t\t\t\t{#if child}\n\t\t\t\t\t\t\t{#if contentState.root.opts.open.current}\n\t\t\t\t\t\t\t\t<ScrollLock {preventScroll} {restoreScrollDelay} />\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{@render child({\n\t\t\t\t\t\t\t\tprops: mergeProps(mergedProps, focusScopeProps),\n\t\t\t\t\t\t\t\t...contentState.snippetProps,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<ScrollLock {preventScroll} />\n\t\t\t\t\t\t\t<div {...mergeProps(mergedProps, focusScopeProps)}>\n\t\t\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</TextSelectionLayer>\n\t\t\t\t</DismissibleLayer>\n\t\t\t</EscapeLayer>\n\t\t{/snippet}\n\t</FocusScope>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogOverlayState } from \"../dialog.svelte.js\";\n\timport type { DialogOverlayProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tforceMount = false,\n\t\tchild,\n\t\tchildren,\n\t\tref = $bindable(null),\n\t\t...restProps\n\t}: DialogOverlayProps = $props();\n\n\tconst overlayState = DialogOverlayState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, overlayState.props));\n</script>\n\n{#if overlayState.shouldRender || forceMount}\n\t{#if child}\n\t\t{@render child({ props: mergeProps(mergedProps), ...overlayState.snippetProps })}\n\t{:else}\n\t\t<div {...mergeProps(mergedProps)}>\n\t\t\t{@render children?.(overlayState.snippetProps)}\n\t\t</div>\n\t{/if}\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogDescriptionState } from \"../dialog.svelte.js\";\n\timport type { DialogDescriptionProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\t...restProps\n\t}: DialogDescriptionProps = $props();\n\n\tconst descriptionState = DialogDescriptionState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, descriptionState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","import { attachRef } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { boolToStr, createBitsAttrs, getAriaChecked, boolToEmptyStrOrUndef, } from \"../../internal/attrs.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { arraysAreEqual } from \"../../internal/arrays.js\";\nimport { isHTMLElement } from \"../../internal/is.js\";\nconst checkboxAttrs = createBitsAttrs({\n component: \"checkbox\",\n parts: [\"root\", \"group\", \"group-label\", \"input\"],\n});\nexport const CheckboxGroupContext = new Context(\"Checkbox.Group\");\nexport class CheckboxGroupState {\n static create(opts) {\n return CheckboxGroupContext.set(new CheckboxGroupState(opts));\n }\n opts;\n attachment;\n labelId = $state(undefined);\n constructor(opts) {\n this.opts = opts;\n this.attachment = attachRef(this.opts.ref);\n }\n addValue(checkboxValue) {\n if (!checkboxValue)\n return;\n if (!this.opts.value.current.includes(checkboxValue)) {\n const newValue = [...$state.snapshot(this.opts.value.current), checkboxValue];\n this.opts.value.current = newValue;\n if (arraysAreEqual(this.opts.value.current, newValue))\n return;\n this.opts.onValueChange.current(newValue);\n }\n }\n removeValue(checkboxValue) {\n if (!checkboxValue)\n return;\n const index = this.opts.value.current.indexOf(checkboxValue);\n if (index === -1)\n return;\n const newValue = this.opts.value.current.filter((v) => v !== checkboxValue);\n this.opts.value.current = newValue;\n if (arraysAreEqual(this.opts.value.current, newValue))\n return;\n this.opts.onValueChange.current(newValue);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"group\",\n \"aria-labelledby\": this.labelId,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n [checkboxAttrs.group]: \"\",\n ...this.attachment,\n }));\n}\nexport class CheckboxGroupLabelState {\n static create(opts) {\n return new CheckboxGroupLabelState(opts, CheckboxGroupContext.get());\n }\n opts;\n group;\n attachment;\n constructor(opts, group) {\n this.opts = opts;\n this.group = group;\n this.group.labelId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref);\n watch.pre(() => this.opts.id.current, (id) => {\n this.group.labelId = id;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.group.opts.disabled.current),\n [checkboxAttrs[\"group-label\"]]: \"\",\n ...this.attachment,\n }));\n}\nconst CheckboxRootContext = new Context(\"Checkbox.Root\");\nexport class CheckboxRootState {\n static create(opts, group = null) {\n return CheckboxRootContext.set(new CheckboxRootState(opts, group));\n }\n opts;\n group;\n trueName = $derived.by(() => {\n if (this.group && this.group.opts.name.current)\n return this.group.opts.name.current;\n return this.opts.name.current;\n });\n trueRequired = $derived.by(() => {\n if (this.group && this.group.opts.required.current)\n return true;\n return this.opts.required.current;\n });\n trueDisabled = $derived.by(() => {\n if (this.group && this.group.opts.disabled.current)\n return true;\n return this.opts.disabled.current;\n });\n trueReadonly = $derived.by(() => {\n if (this.group && this.group.opts.readonly.current)\n return true;\n return this.opts.readonly.current;\n });\n attachment;\n constructor(opts, group) {\n this.opts = opts;\n this.group = group;\n this.attachment = attachRef(this.opts.ref);\n this.onkeydown = this.onkeydown.bind(this);\n this.onclick = this.onclick.bind(this);\n watch.pre([() => $state.snapshot(this.group?.opts.value.current), () => this.opts.value.current], ([groupValue, value]) => {\n if (!groupValue || !value)\n return;\n this.opts.checked.current = groupValue.includes(value);\n });\n watch.pre(() => this.opts.checked.current, (checked) => {\n if (!this.group)\n return;\n if (checked) {\n this.group?.addValue(this.opts.value.current);\n }\n else {\n this.group?.removeValue(this.opts.value.current);\n }\n });\n }\n onkeydown(e) {\n if (this.trueDisabled || this.trueReadonly)\n return;\n if (e.key === kbd.ENTER) {\n e.preventDefault();\n if (this.opts.type.current === \"submit\") {\n const form = e.currentTarget.closest(\"form\");\n form?.requestSubmit();\n }\n return;\n }\n if (e.key === kbd.SPACE) {\n e.preventDefault();\n this.#toggle();\n }\n }\n #toggle() {\n if (this.opts.indeterminate.current) {\n this.opts.indeterminate.current = false;\n this.opts.checked.current = true;\n }\n else {\n this.opts.checked.current = !this.opts.checked.current;\n }\n }\n onclick(e) {\n if (this.trueDisabled || this.trueReadonly)\n return;\n if (this.opts.type.current === \"submit\") {\n this.#toggle();\n return;\n }\n e.preventDefault();\n this.#toggle();\n }\n snippetProps = $derived.by(() => ({\n checked: this.opts.checked.current,\n indeterminate: this.opts.indeterminate.current,\n }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"checkbox\",\n type: this.opts.type.current,\n disabled: this.trueDisabled,\n \"aria-checked\": getAriaChecked(this.opts.checked.current, this.opts.indeterminate.current),\n \"aria-required\": boolToStr(this.trueRequired),\n \"aria-readonly\": boolToStr(this.trueReadonly),\n \"data-disabled\": boolToEmptyStrOrUndef(this.trueDisabled),\n \"data-readonly\": boolToEmptyStrOrUndef(this.trueReadonly),\n \"data-state\": getCheckboxDataState(this.opts.checked.current, this.opts.indeterminate.current),\n [checkboxAttrs.root]: \"\",\n //\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }));\n}\nexport class CheckboxInputState {\n static create() {\n return new CheckboxInputState(CheckboxRootContext.get());\n }\n root;\n trueChecked = $derived.by(() => {\n if (!this.root.group)\n return this.root.opts.checked.current;\n if (this.root.opts.value.current !== undefined &&\n this.root.group.opts.value.current.includes(this.root.opts.value.current)) {\n return true;\n }\n return false;\n });\n shouldRender = $derived.by(() => Boolean(this.root.trueName));\n constructor(root) {\n this.root = root;\n this.onfocus = this.onfocus.bind(this);\n }\n onfocus(_) {\n if (!isHTMLElement(this.root.opts.ref.current))\n return;\n this.root.opts.ref.current.focus();\n }\n props = $derived.by(() => ({\n type: \"checkbox\",\n checked: this.root.opts.checked.current === true,\n disabled: this.root.trueDisabled,\n required: this.root.trueRequired,\n name: this.root.trueName,\n form: this.root.opts.form.current,\n value: this.root.opts.value.current,\n readonly: this.root.trueReadonly,\n onfocus: this.onfocus,\n }));\n}\nfunction getCheckboxDataState(checked, indeterminate) {\n if (indeterminate)\n return \"indeterminate\";\n return checked ? \"checked\" : \"unchecked\";\n}\n","import { enable_legacy_mode_flag } from './index.js';\n\nenable_legacy_mode_flag();\n","<script lang=\"ts\">\n\timport { mergeProps, srOnlyStyles } from \"svelte-toolbelt\";\n\timport type { HTMLInputAttributes } from \"svelte/elements\";\n\n\tlet { value = $bindable(), ...restProps }: HTMLInputAttributes = $props();\n\n\tconst mergedProps = $derived(\n\t\tmergeProps(restProps, {\n\t\t\t\"aria-hidden\": \"true\",\n\t\t\ttabindex: -1,\n\t\t\tstyle: {\n\t\t\t\t...srOnlyStyles,\n\t\t\t\tposition: \"absolute\",\n\t\t\t\ttop: \"0\",\n\t\t\t\tleft: \"0\",\n\t\t\t},\n\t\t})\n\t);\n</script>\n\n{#if mergedProps.type === \"checkbox\"}\n\t<input {...mergedProps} {value} />\n{:else}\n\t<input bind:value {...mergedProps} />\n{/if}\n","<script lang=\"ts\">\n\timport { CheckboxInputState } from \"../checkbox.svelte.js\";\n\timport HiddenInput from \"../../utilities/hidden-input.svelte\";\n\n\tconst inputState = CheckboxInputState.create();\n</script>\n\n{#if inputState.shouldRender}\n\t<HiddenInput {...inputState.props} />\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { CheckboxRootProps } from \"../types.js\";\n\timport { CheckboxGroupContext, CheckboxRootState } from \"../checkbox.svelte.js\";\n\timport CheckboxInput from \"./checkbox-input.svelte\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { watch } from \"runed\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchecked = $bindable(false),\n\t\tref = $bindable(null),\n\t\tonCheckedChange,\n\t\tchildren,\n\t\tdisabled = false,\n\t\trequired = false,\n\t\tname = undefined,\n\t\tform = undefined,\n\t\tvalue = \"on\",\n\t\tid = createId(uid),\n\t\tindeterminate = $bindable(false),\n\t\tonIndeterminateChange,\n\t\tchild,\n\t\ttype = \"button\",\n\t\treadonly,\n\t\t...restProps\n\t}: CheckboxRootProps = $props();\n\n\tconst group = CheckboxGroupContext.getOr(null);\n\n\tif (group && value) {\n\t\tif (group.opts.value.current.includes(value)) {\n\t\t\tchecked = true;\n\t\t} else {\n\t\t\tchecked = false;\n\t\t}\n\t}\n\n\twatch.pre(\n\t\t() => value,\n\t\t() => {\n\t\t\tif (group && value) {\n\t\t\t\tif (group.opts.value.current.includes(value)) {\n\t\t\t\t\tchecked = true;\n\t\t\t\t} else {\n\t\t\t\t\tchecked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\n\tconst rootState = CheckboxRootState.create(\n\t\t{\n\t\t\tchecked: boxWith(\n\t\t\t\t() => checked,\n\t\t\t\t(v) => {\n\t\t\t\t\tchecked = v;\n\t\t\t\t\tonCheckedChange?.(v);\n\t\t\t\t}\n\t\t\t),\n\t\t\tdisabled: boxWith(() => disabled ?? false),\n\t\t\trequired: boxWith(() => required),\n\t\t\tname: boxWith(() => name),\n\t\t\tform: boxWith(() => form),\n\t\t\tvalue: boxWith(() => value),\n\t\t\tid: boxWith(() => id),\n\t\t\tref: boxWith(\n\t\t\t\t() => ref,\n\t\t\t\t(v) => (ref = v)\n\t\t\t),\n\t\t\tindeterminate: boxWith(\n\t\t\t\t() => indeterminate,\n\t\t\t\t(v) => {\n\t\t\t\t\tindeterminate = v;\n\t\t\t\t\tonIndeterminateChange?.(v);\n\t\t\t\t}\n\t\t\t),\n\t\t\ttype: boxWith(() => type),\n\t\t\treadonly: boxWith(() => Boolean(readonly)),\n\t\t},\n\t\tgroup\n\t);\n\n\tconst mergedProps = $derived(mergeProps({ ...restProps }, rootState.props));\n</script>\n\n{#if child}\n\t{@render child({\n\t\tprops: mergedProps,\n\t\t...rootState.snippetProps,\n\t})}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.(rootState.snippetProps)}\n\t</button>\n{/if}\n\n<CheckboxInput />\n","import { boxFrom, simpleBox } from \"svelte-toolbelt\";\nimport { Context } from \"runed\";\nexport const FloatingRootContext = new Context(\"Floating.Root\");\nexport const FloatingTooltipRootContext = new Context(\"Floating.Root\");\nexport class FloatingRootState {\n static create(tooltip = false) {\n return tooltip\n ? FloatingTooltipRootContext.set(new FloatingRootState())\n : FloatingRootContext.set(new FloatingRootState());\n }\n anchorNode = simpleBox(null);\n customAnchorNode = simpleBox(null);\n triggerNode = simpleBox(null);\n constructor() {\n $effect(() => {\n if (this.customAnchorNode.current) {\n if (typeof this.customAnchorNode.current === \"string\") {\n this.anchorNode.current = document.querySelector(this.customAnchorNode.current);\n }\n else {\n this.anchorNode.current = this.customAnchorNode.current;\n }\n }\n else {\n this.anchorNode.current = this.triggerNode.current;\n }\n });\n }\n}\nexport class FloatingAnchorState {\n static create(opts, tooltip = false) {\n return tooltip\n ? new FloatingAnchorState(opts, FloatingTooltipRootContext.get())\n : new FloatingAnchorState(opts, FloatingRootContext.get());\n }\n opts;\n root;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n if (opts.virtualEl && opts.virtualEl.current) {\n root.triggerNode = boxFrom(opts.virtualEl.current);\n }\n else {\n root.triggerNode = opts.ref;\n }\n }\n}\n","<script lang=\"ts\">\n\timport type { Snippet } from \"svelte\";\n\timport { FloatingRootState } from \"../floating-root.svelte.js\";\n\n\tlet { children, tooltip = false }: { children?: Snippet; tooltip?: boolean } = $props();\n\n\tFloatingRootState.create(tooltip);\n</script>\n\n{@render children?.()}\n","export function get(valueOrGetValue) {\n return typeof valueOrGetValue === \"function\"\n ? valueOrGetValue()\n : valueOrGetValue;\n}\nexport function getDPR(element) {\n if (typeof window === \"undefined\")\n return 1;\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\nexport function roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\nexport function getFloatingContentCSSVars(name) {\n return {\n [`--bits-${name}-content-transform-origin`]: `var(--bits-floating-transform-origin)`,\n [`--bits-${name}-content-available-width`]: `var(--bits-floating-available-width)`,\n [`--bits-${name}-content-available-height`]: `var(--bits-floating-available-height)`,\n [`--bits-${name}-anchor-width`]: `var(--bits-floating-anchor-width)`,\n [`--bits-${name}-anchor-height`]: `var(--bits-floating-anchor-height)`,\n };\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport { FloatingAnchorState } from \"../floating-root.svelte.js\";\n\timport type { AnchorProps } from \"./index.js\";\n\timport type { Measurable } from \"../../../../internal/floating-svelte/types.js\";\n\n\tlet { id, children, virtualEl, ref, tooltip = false }: AnchorProps = $props();\n\n\tFloatingAnchorState.create(\n\t\t{\n\t\t\tid: boxWith(() => id),\n\t\t\tvirtualEl: boxWith(() => virtualEl as unknown as Measurable | null),\n\t\t\tref,\n\t\t},\n\t\ttooltip\n\t);\n</script>\n\n{@render children?.()}\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n var _padding$top, _padding$right, _padding$bottom, _padding$left;\n return {\n top: (_padding$top = padding.top) != null ? _padding$top : 0,\n right: (_padding$right = padding.right) != null ? _padding$right : 0,\n bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,\n left: (_padding$left = padding.left) != null ? _padding$left : 0\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n const alignment = getAlignment(placement);\n if (alignment) {\n coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(minPadding, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n\n // No rects (e.g. a hidden or detached reference, or a collapsed range) —\n // keep the existing reference rect rather than resetting to an invalid\n // one with non-finite values.\n if (!nativeClientRects.length) {\n return {};\n }\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n return rectToClientRect({\n x: left,\n y: top,\n width: right - left,\n height: bottom - top\n });\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n return rectToClientRect({\n x: minLeft,\n y: top,\n width: maxRight - minLeft,\n height: bottom - top\n });\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);\n if (checkMainAxis) {\n mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);\n }\n if (checkCrossAxis) {\n crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n var _rawOffset$mainAxis, _rawOffset$crossAxis;\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,\n crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n// Method syntax keeps callback parameters bivariant, but expressing the\n// explicit `| undefined` required by `exactOptionalPropertyTypes` needs\n// property syntax, which is contravariant under `strictFunctionTypes`.\n// Extracting the function from a method position restores that bivariance so\n// consumers can still assign callbacks with narrower parameter types.\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const shiftData = state.middlewareData.shift;\n const noShift = !shiftData;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (shiftData != null && shiftData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if (shiftData != null && shiftData.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n if (isYAxis) {\n availableWidth = width - 2 * max(overflow.left, overflow.right);\n } else {\n availableHeight = height - 2 * max(overflow.top, overflow.bottom);\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement && offsetParent) {\n const win = getWindow(domElement);\n const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return element.getClientRects ? Array.from(element.getClientRects()) : [];\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(html) {\n const scroll = getNodeScroll(html);\n const body = html.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(html);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy, rootBoundary) {\n if (rootBoundary === void 0) {\n rootBoundary = 'viewport';\n }\n const isLayoutViewport = rootBoundary === 'layoutViewport';\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n // Client coordinates are relative to the layout viewport, except in\n // WebKit with an `absolute` strategy, where they are relative to the\n // visual viewport.\n const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';\n if (isLayoutViewport) {\n if (!layoutRelativeClientCoords) {\n x = -visualViewport.offsetLeft;\n y = -visualViewport.offsetTop;\n }\n } else {\n width = visualViewport.width;\n height = visualViewport.height;\n if (layoutRelativeClientCoords) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks\n // the visual width but isn't reflected in `html.clientWidth`, so subtract it.\n // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also\n // reserves an empty inline-start gutter that clips nothing, so exclude just\n // the one scrollbar-side gutter — halve the measured (two-gutter) total. A\n // left-side scrollbar (`windowScrollbarX > 0`) is already handled by\n // `getHTMLOffset`/`visualViewport.width`; skip it here.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;\n if (gutter <= SCROLLBAR_MAX) {\n width -= gutter;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = getScale(element);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {\n rect = getViewportRect(element, strategy, clippingAncestor);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let lastKeptComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n // Position of the containing block chain below the current node. A fixed\n // element whose containing block hasn't been found yet is a fixed chain.\n const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';\n\n // A non-containing ancestor does not clip the element when the chain\n // below it escapes it: a fixed chain escapes all ancestors up to the\n // next containing block, an absolute chain escapes static ancestors.\n const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // The kept node carries the chain position for the next iteration.\n lastKeptComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n if (!isOffsetParentAnElement && documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove, ancestorResize) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n\n // The entry is a snapshot, so the reference may have moved since the\n // intersection was computed (under performance constraints, or between\n // consecutive frames of a multi-frame layout shift). The reported ratio\n // and the observed area are stale in that case and cannot be trusted to\n // detect subsequent movement, so refresh regardless of the ratio.\n if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n return refresh();\n }\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped in place, the ratio is 0. Throttle\n // the refresh to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n const win = getWindow(element);\n // The window is a resize ancestor, so when `ancestorResize` is enabled its\n // listener already runs the update on resize. Here we only need to rebuild\n // the `IntersectionObserver` for the new root size, skipping a redundant\n // update. When `ancestorResize` is disabled, this becomes the sole update.\n const handleResize = () => refresh(ancestorResize);\n win.addEventListener('resize', handleResize);\n refresh(true);\n return () => {\n win.removeEventListener('resize', handleResize);\n cleanup();\n };\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update);\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = options != null ? options : {};\n const platformWithCache = {\n ...platform,\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { computePosition } from \"@floating-ui/dom\";\nimport { simpleBox } from \"svelte-toolbelt\";\nimport { get, getDPR, roundByDPR } from \"./floating-utils.svelte.js\";\nexport function useFloating(options) {\n /** Options */\n const whileElementsMountedOption = options.whileElementsMounted;\n const openOption = $derived(get(options.open) ?? true);\n const middlewareOption = $derived(get(options.middleware));\n const transformOption = $derived(get(options.transform) ?? true);\n const placementOption = $derived(get(options.placement) ?? \"bottom\");\n const strategyOption = $derived(get(options.strategy) ?? \"absolute\");\n const sideOffsetOption = $derived(get(options.sideOffset) ?? 0);\n const alignOffsetOption = $derived(get(options.alignOffset) ?? 0);\n const reference = options.reference;\n /** State */\n let x = $state(0);\n let y = $state(0);\n const floating = simpleBox(null);\n // svelte-ignore state_referenced_locally\n let strategy = $state(strategyOption);\n // svelte-ignore state_referenced_locally\n let placement = $state(placementOption);\n let middlewareData = $state({});\n let isPositioned = $state(false);\n let hasWhileMountedPosition = false;\n let updateRequestId = 0;\n // `update` is handed to `whileElementsMounted` (floating-ui's `autoUpdate`),\n // whose observers can still fire after the effect owning the option\n // `$derived`s above is destroyed. Reading them then warns `derived_inert`.\n let destroyed = false;\n const floatingStyles = $derived.by(() => {\n // preserve last known position when floating ref is null (during transitions)\n const xVal = floating.current ? roundByDPR(floating.current, x) : x;\n const yVal = floating.current ? roundByDPR(floating.current, y) : y;\n if (transformOption) {\n return {\n position: strategy,\n left: \"0\",\n top: \"0\",\n transform: `translate(${xVal}px, ${yVal}px)`,\n ...(floating.current &&\n getDPR(floating.current) >= 1.5 && {\n willChange: \"transform\",\n }),\n };\n }\n return {\n position: strategy,\n left: `${xVal}px`,\n top: `${yVal}px`,\n };\n });\n /** Effects */\n let whileElementsMountedCleanup;\n function update() {\n if (destroyed)\n return;\n if (reference.current === null || floating.current === null)\n return;\n const referenceNode = reference.current;\n const floatingNode = floating.current;\n const requestId = ++updateRequestId;\n computePosition(referenceNode, floatingNode, {\n middleware: middlewareOption,\n placement: placementOption,\n strategy: strategyOption,\n }).then((position) => {\n // ignore stale async resolutions when newer updates were requested.\n if (requestId !== updateRequestId)\n return;\n // ignore stale resolutions after ref replacement.\n if (reference.current !== referenceNode || floating.current !== floatingNode)\n return;\n const referenceHidden = isReferenceHidden(referenceNode);\n if (referenceHidden) {\n // keep last good coordinates when the anchor disappears to avoid\n // a transient jump to viewport origin before close propagates.\n middlewareData = {\n ...middlewareData,\n hide: {\n // oxlint-disable-next-line no-explicit-any\n ...middlewareData.hide,\n referenceHidden: true,\n },\n };\n return;\n }\n // ignore bad coordinates that cause jumping during close transitions\n if (!openOption && x !== 0 && y !== 0) {\n // if we had a good position and now getting coordinates near\n // the expected offset bounds during close, ignore it\n const maxExpectedOffset = Math.max(Math.abs(sideOffsetOption), Math.abs(alignOffsetOption), 15);\n if (position.x <= maxExpectedOffset && position.y <= maxExpectedOffset)\n return;\n }\n x = position.x;\n y = position.y;\n strategy = position.strategy;\n placement = position.placement;\n middlewareData = position.middlewareData;\n isPositioned = true;\n });\n }\n function cleanup() {\n if (typeof whileElementsMountedCleanup === \"function\") {\n whileElementsMountedCleanup();\n whileElementsMountedCleanup = undefined;\n }\n updateRequestId++;\n }\n function attach() {\n cleanup();\n if (whileElementsMountedOption === undefined) {\n update();\n return;\n }\n if (!openOption)\n return;\n if (reference.current === null || floating.current === null)\n return;\n whileElementsMountedCleanup = whileElementsMountedOption(reference.current, floating.current, update);\n }\n function reset() {\n if (!openOption && floating.current === null) {\n isPositioned = false;\n }\n }\n function trackWhileMountedDeps() {\n return [\n middlewareOption,\n placementOption,\n strategyOption,\n sideOffsetOption,\n alignOffsetOption,\n openOption,\n ];\n }\n $effect(() => {\n if (whileElementsMountedOption !== undefined)\n return;\n if (!openOption)\n return;\n update();\n });\n $effect(attach);\n $effect(() => {\n if (whileElementsMountedOption === undefined)\n return;\n trackWhileMountedDeps();\n if (!openOption) {\n hasWhileMountedPosition = false;\n return;\n }\n if (!isPositioned) {\n hasWhileMountedPosition = false;\n return;\n }\n // skip the first post-position run, since autoUpdate already computed it\n if (!hasWhileMountedPosition) {\n hasWhileMountedPosition = true;\n return;\n }\n update();\n });\n $effect(reset);\n $effect(() => () => {\n destroyed = true;\n cleanup();\n });\n return {\n floating,\n reference,\n get strategy() {\n return strategy;\n },\n get placement() {\n return placement;\n },\n get middlewareData() {\n return middlewareData;\n },\n get isPositioned() {\n return isPositioned;\n },\n get floatingStyles() {\n return floatingStyles;\n },\n get update() {\n return update;\n },\n };\n}\nfunction isReferenceHidden(node) {\n if (!(node instanceof Element))\n return false;\n if (!node.isConnected)\n return true;\n if (node instanceof HTMLElement && node.hidden)\n return true;\n return node.getClientRects().length === 0;\n}\n","import { arrow, autoUpdate, flip, hide, limitShift, offset, shift, size, } from \"@floating-ui/dom\";\nimport { attachRef, cssToStyleObj, getWindow, styleToString, simpleBox, } from \"svelte-toolbelt\";\nimport { Context, ElementSize, watch } from \"runed\";\nimport { FloatingRootContext, FloatingTooltipRootContext, } from \"./floating-root.svelte.js\";\nimport { isNotNull } from \"../../../internal/is.js\";\nimport { useId } from \"../../../internal/use-id.js\";\nimport { useFloating } from \"../../../internal/floating-svelte/use-floating.svelte.js\";\nexport const SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nexport const ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nconst OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\",\n};\nconst FloatingContentContext = new Context(\"Floating.Content\");\nexport class FloatingContentState {\n static create(opts, tooltip = false) {\n return tooltip\n ? FloatingContentContext.set(new FloatingContentState(opts, FloatingTooltipRootContext.get()))\n : FloatingContentContext.set(new FloatingContentState(opts, FloatingRootContext.get()));\n }\n opts;\n root;\n // nodes\n contentRef = simpleBox(null);\n wrapperRef = simpleBox(null);\n arrowRef = simpleBox(null);\n contentAttachment = attachRef(this.contentRef);\n wrapperAttachment = attachRef(this.wrapperRef);\n arrowAttachment = attachRef(this.arrowRef);\n // ids\n arrowId = simpleBox(useId());\n #transformedStyle = $derived.by(() => {\n if (typeof this.opts.style === \"string\")\n return cssToStyleObj(this.opts.style);\n if (!this.opts.style)\n return {};\n });\n #updatePositionStrategy = undefined;\n #arrowSize = new ElementSize(() => this.arrowRef.current ?? undefined);\n #arrowWidth = $derived(this.#arrowSize?.width ?? 0);\n #arrowHeight = $derived(this.#arrowSize?.height ?? 0);\n #desiredPlacement = $derived.by(() => (this.opts.side?.current +\n (this.opts.align.current !== \"center\"\n ? `-${this.opts.align.current}`\n : \"\")));\n #boundary = $derived.by(() => Array.isArray(this.opts.collisionBoundary.current)\n ? this.opts.collisionBoundary.current\n : [this.opts.collisionBoundary.current]);\n hasExplicitBoundaries = $derived(this.#boundary.length > 0);\n detectOverflowOptions = $derived.by(() => ({\n padding: this.opts.collisionPadding.current,\n boundary: this.#boundary.filter(isNotNull),\n altBoundary: this.hasExplicitBoundaries,\n }));\n #availableWidth = $state(undefined);\n #availableHeight = $state(undefined);\n #anchorWidth = $state(undefined);\n #anchorHeight = $state(undefined);\n middleware = $derived.by(() => [\n offset({\n mainAxis: this.opts.sideOffset.current + this.#arrowHeight,\n alignmentAxis: this.opts.alignOffset.current,\n }),\n this.opts.avoidCollisions.current &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: this.opts.sticky.current === \"partial\" ? limitShift() : undefined,\n ...this.detectOverflowOptions,\n }),\n this.opts.avoidCollisions.current && flip({ ...this.detectOverflowOptions }),\n size({\n ...this.detectOverflowOptions,\n apply: ({ rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n this.#availableWidth = availableWidth;\n this.#availableHeight = availableHeight;\n this.#anchorWidth = anchorWidth;\n this.#anchorHeight = anchorHeight;\n },\n }),\n this.arrowRef.current &&\n arrow({\n element: this.arrowRef.current,\n padding: this.opts.arrowPadding.current,\n }),\n transformOrigin({ arrowWidth: this.#arrowWidth, arrowHeight: this.#arrowHeight }),\n this.opts.hideWhenDetached.current &&\n hide({ strategy: \"referenceHidden\", ...this.detectOverflowOptions }),\n ].filter(Boolean));\n floating;\n placedSide = $derived.by(() => getSideFromPlacement(this.floating.placement));\n placedAlign = $derived.by(() => getAlignFromPlacement(this.floating.placement));\n arrowX = $derived.by(() => this.floating.middlewareData.arrow?.x ?? 0);\n arrowY = $derived.by(() => this.floating.middlewareData.arrow?.y ?? 0);\n cannotCenterArrow = $derived.by(() => this.floating.middlewareData.arrow?.centerOffset !== 0);\n contentZIndex = $state();\n arrowBaseSide = $derived(OPPOSITE_SIDE[this.placedSide]);\n wrapperProps = $derived.by(() => ({\n id: this.opts.wrapperId.current,\n \"data-bits-floating-content-wrapper\": \"\",\n style: {\n ...this.floating.floatingStyles,\n // keep off page when measuring\n transform: this.floating.isPositioned\n ? this.floating.floatingStyles.transform\n : \"translate(0, -200%)\",\n minWidth: \"max-content\",\n zIndex: this.contentZIndex,\n \"--bits-floating-transform-origin\": `${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,\n \"--bits-floating-available-width\": `${this.#availableWidth}px`,\n \"--bits-floating-available-height\": `${this.#availableHeight}px`,\n \"--bits-floating-anchor-width\": `${this.#anchorWidth}px`,\n \"--bits-floating-anchor-height\": `${this.#anchorHeight}px`,\n // hide the content if using the hide middleware and should be hidden\n ...(this.floating.middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n \"pointer-events\": \"none\",\n }),\n ...this.#transformedStyle,\n },\n // Floating UI calculates logical alignment based the `dir` attribute\n dir: this.opts.dir.current,\n ...this.wrapperAttachment,\n }));\n props = $derived.by(() => ({\n \"data-side\": this.placedSide,\n \"data-align\": this.placedAlign,\n style: styleToString({\n ...this.#transformedStyle,\n }),\n ...this.contentAttachment,\n }));\n arrowStyle = $derived({\n position: \"absolute\",\n left: this.arrowX ? `${this.arrowX}px` : undefined,\n top: this.arrowY ? `${this.arrowY}px` : undefined,\n [this.arrowBaseSide]: 0,\n \"transform-origin\": {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\",\n }[this.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: \"rotate(180deg)\",\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\",\n }[this.placedSide],\n visibility: this.cannotCenterArrow ? \"hidden\" : undefined,\n });\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.#updatePositionStrategy = opts.updatePositionStrategy;\n if (opts.customAnchor) {\n this.root.customAnchorNode.current = opts.customAnchor.current;\n }\n watch(() => opts.customAnchor.current, (customAnchor) => {\n this.root.customAnchorNode.current = customAnchor;\n });\n this.floating = useFloating({\n strategy: () => this.opts.strategy.current,\n placement: () => this.#desiredPlacement,\n middleware: () => this.middleware,\n reference: this.root.anchorNode,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: this.#updatePositionStrategy?.current === \"always\",\n });\n return cleanup;\n },\n open: () => this.opts.enabled.current,\n sideOffset: () => this.opts.sideOffset.current,\n alignOffset: () => this.opts.alignOffset.current,\n });\n $effect(() => {\n if (!this.floating.isPositioned)\n return;\n this.opts.onPlaced?.current();\n });\n watch(() => this.contentRef.current, (contentNode) => {\n if (!contentNode || !this.opts.enabled.current)\n return;\n const win = getWindow(contentNode);\n const rafId = win.requestAnimationFrame(() => {\n // avoid applying stale values when refs change quickly\n if (this.contentRef.current !== contentNode || !this.opts.enabled.current)\n return;\n const zIndex = win.getComputedStyle(contentNode).zIndex;\n if (zIndex !== this.contentZIndex) {\n this.contentZIndex = zIndex;\n }\n });\n return () => {\n win.cancelAnimationFrame(rafId);\n };\n });\n $effect(() => {\n this.floating.floating.current = this.wrapperRef.current;\n });\n }\n}\nexport class FloatingArrowState {\n static create(opts) {\n return new FloatingArrowState(opts, FloatingContentContext.get());\n }\n opts;\n content;\n constructor(opts, content) {\n this.opts = opts;\n this.content = content;\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n style: this.content.arrowStyle,\n \"data-side\": this.content.placedSide,\n ...this.content.arrowAttachment,\n }));\n}\n//\n// HELPERS\n//\nfunction transformOrigin(options) {\n return {\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n }\n else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n }\n else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n },\n };\n}\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nexport function getSideFromPlacement(placement) {\n return getSideAndAlignFromPlacement(placement)[0];\n}\nexport function getAlignFromPlacement(placement) {\n return getSideAndAlignFromPlacement(placement)[1];\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { FloatingContentState } from \"../use-floating-layer.svelte.js\";\n\timport type { ContentImplProps } from \"./index.js\";\n\timport { useId } from \"../../../../internal/use-id.js\";\n\n\tlet {\n\t\tcontent,\n\t\tside = \"bottom\",\n\t\tsideOffset = 0,\n\t\talign = \"center\",\n\t\talignOffset = 0,\n\t\tid,\n\t\tarrowPadding = 0,\n\t\tavoidCollisions = true,\n\t\tcollisionBoundary = [],\n\t\tcollisionPadding = 0,\n\t\thideWhenDetached = false,\n\t\tonPlaced = () => {},\n\t\tsticky = \"partial\",\n\t\tupdatePositionStrategy = \"optimized\",\n\t\tstrategy = \"fixed\",\n\t\tdir = \"ltr\",\n\t\tstyle = {},\n\t\twrapperId = useId(),\n\t\tcustomAnchor = null,\n\t\tenabled,\n\t\ttooltip = false,\n\t}: ContentImplProps = $props();\n\n\tconst contentState = FloatingContentState.create(\n\t\t{\n\t\t\tside: boxWith(() => side),\n\t\t\tsideOffset: boxWith(() => sideOffset),\n\t\t\talign: boxWith(() => align),\n\t\t\talignOffset: boxWith(() => alignOffset),\n\t\t\tid: boxWith(() => id),\n\t\t\tarrowPadding: boxWith(() => arrowPadding),\n\t\t\tavoidCollisions: boxWith(() => avoidCollisions),\n\t\t\tcollisionBoundary: boxWith(() => collisionBoundary),\n\t\t\tcollisionPadding: boxWith(() => collisionPadding),\n\t\t\thideWhenDetached: boxWith(() => hideWhenDetached),\n\t\t\tonPlaced: boxWith(() => onPlaced),\n\t\t\tsticky: boxWith(() => sticky),\n\t\t\tupdatePositionStrategy: boxWith(() => updatePositionStrategy),\n\t\t\tstrategy: boxWith(() => strategy),\n\t\t\tdir: boxWith(() => dir),\n\t\t\tstyle: boxWith(() => style),\n\t\t\tenabled: boxWith(() => enabled),\n\t\t\twrapperId: boxWith(() => wrapperId),\n\t\t\tcustomAnchor: boxWith(() => customAnchor),\n\t\t},\n\t\ttooltip\n\t);\n\n\tconst mergedProps = $derived(\n\t\tmergeProps(contentState.wrapperProps, {\n\t\t\tstyle: {\n\t\t\t\tpointerEvents: \"auto\",\n\t\t\t},\n\t\t})\n\t);\n</script>\n\n{@render content?.({ props: contentState.props, wrapperProps: mergedProps })}\n","<script lang=\"ts\">\n\timport { type Snippet, onMount } from \"svelte\";\n\n\tlet {\n\t\tcontent,\n\t\tonPlaced,\n\t}: {\n\t\tcontent?: Snippet<\n\t\t\t[{ props: Record<string, unknown>; wrapperProps: Record<string, unknown> }]\n\t\t>;\n\t\tonPlaced?: () => void;\n\t} = $props();\n\n\tonMount(() => {\n\t\tonPlaced?.();\n\t});\n</script>\n\n{@render content?.({ props: {}, wrapperProps: {} })}\n","<script lang=\"ts\">\n\timport FloatingLayerContentStatic from \"../floating-layer/components/floating-layer-content-static.svelte\";\n\timport FloatingLayerContent from \"../floating-layer/components/floating-layer-content.svelte\";\n\timport type { FloatingLayerContentImplProps } from \"../floating-layer/types.js\";\n\n\tlet {\n\t\tcontent,\n\t\tisStatic = false,\n\t\tonPlaced,\n\t\t...restProps\n\t}: FloatingLayerContentImplProps & { isStatic: boolean } = $props();\n</script>\n\n{#if isStatic}\n\t<FloatingLayerContentStatic {content} {onPlaced} />\n{:else}\n\t<FloatingLayerContent {content} {onPlaced} {...restProps} />\n{/if}\n","<script lang=\"ts\">\n\timport { mergeProps } from \"svelte-toolbelt\";\n\timport ScrollLock from \"../scroll-lock/scroll-lock.svelte\";\n\timport type { PopperLayerImplProps } from \"./types.js\";\n\timport PopperContent from \"./popper-content.svelte\";\n\timport EscapeLayer from \"../escape-layer/escape-layer.svelte\";\n\timport DismissibleLayer from \"../dismissible-layer/dismissible-layer.svelte\";\n\timport TextSelectionLayer from \"../text-selection-layer/text-selection-layer.svelte\";\n\timport FocusScope from \"../focus-scope/focus-scope.svelte\";\n\n\tlet {\n\t\tpopper,\n\t\tonEscapeKeydown,\n\t\tescapeKeydownBehavior,\n\t\tpreventOverflowTextSelection,\n\t\tid,\n\t\tonPointerDown,\n\t\tonPointerUp,\n\t\tside,\n\t\tsideOffset,\n\t\talign,\n\t\talignOffset,\n\t\tarrowPadding,\n\t\tavoidCollisions,\n\t\tcollisionBoundary,\n\t\tcollisionPadding,\n\t\tsticky,\n\t\thideWhenDetached,\n\t\tupdatePositionStrategy,\n\t\tstrategy,\n\t\tdir,\n\t\tpreventScroll,\n\t\twrapperId,\n\t\tstyle,\n\t\tonPlaced,\n\t\tonInteractOutside,\n\t\tonCloseAutoFocus,\n\t\tonOpenAutoFocus,\n\t\tonFocusOutside,\n\t\tinteractOutsideBehavior = \"close\",\n\t\tloop,\n\t\ttrapFocus = true,\n\t\tisValidEvent = () => false,\n\t\tcustomAnchor = null,\n\t\tisStatic = false,\n\t\tenabled,\n\t\tforceMount,\n\t\tref,\n\t\ttooltip = false,\n\t\tcontentPointerEvents = \"auto\",\n\t\t...restProps\n\t}: Omit<PopperLayerImplProps, \"open\" | \"children\" | \"shouldRender\"> & {\n\t\tenabled: boolean;\n\t\tcontentPointerEvents?: \"auto\" | \"none\";\n\t} = $props();\n\n\tconst resolvedPreventScroll = $derived(preventScroll ?? true);\n\tconst effectiveStrategy = $derived(strategy ?? (resolvedPreventScroll ? \"fixed\" : \"absolute\"));\n</script>\n\n<PopperContent\n\t{isStatic}\n\t{id}\n\t{side}\n\t{sideOffset}\n\t{align}\n\t{alignOffset}\n\t{arrowPadding}\n\t{avoidCollisions}\n\t{collisionBoundary}\n\t{collisionPadding}\n\t{sticky}\n\t{hideWhenDetached}\n\t{updatePositionStrategy}\n\tstrategy={effectiveStrategy}\n\t{dir}\n\t{wrapperId}\n\t{style}\n\t{onPlaced}\n\t{customAnchor}\n\t{enabled}\n\t{tooltip}\n>\n\t{#snippet content({ props: floatingProps, wrapperProps })}\n\t\t{#if forceMount && enabled}\n\t\t\t<ScrollLock preventScroll={resolvedPreventScroll} />\n\t\t{:else if !forceMount}\n\t\t\t<ScrollLock preventScroll={resolvedPreventScroll} />\n\t\t{/if}\n\t\t<FocusScope\n\t\t\t{onOpenAutoFocus}\n\t\t\t{onCloseAutoFocus}\n\t\t\t{loop}\n\t\t\t{enabled}\n\t\t\t{trapFocus}\n\t\t\t{forceMount}\n\t\t\t{ref}\n\t\t>\n\t\t\t{#snippet focusScope({ props: focusScopeProps })}\n\t\t\t\t<EscapeLayer {onEscapeKeydown} {escapeKeydownBehavior} {enabled} {ref}>\n\t\t\t\t\t<DismissibleLayer\n\t\t\t\t\t\t{id}\n\t\t\t\t\t\t{onInteractOutside}\n\t\t\t\t\t\t{onFocusOutside}\n\t\t\t\t\t\t{interactOutsideBehavior}\n\t\t\t\t\t\t{isValidEvent}\n\t\t\t\t\t\t{enabled}\n\t\t\t\t\t\t{ref}\n\t\t\t\t\t>\n\t\t\t\t\t\t{#snippet children({ props: dismissibleProps })}\n\t\t\t\t\t\t\t<TextSelectionLayer\n\t\t\t\t\t\t\t\t{id}\n\t\t\t\t\t\t\t\t{preventOverflowTextSelection}\n\t\t\t\t\t\t\t\t{onPointerDown}\n\t\t\t\t\t\t\t\t{onPointerUp}\n\t\t\t\t\t\t\t\t{enabled}\n\t\t\t\t\t\t\t\t{ref}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{@render popper?.({\n\t\t\t\t\t\t\t\t\tprops: mergeProps(\n\t\t\t\t\t\t\t\t\t\trestProps,\n\t\t\t\t\t\t\t\t\t\tfloatingProps,\n\t\t\t\t\t\t\t\t\t\tdismissibleProps,\n\t\t\t\t\t\t\t\t\t\tfocusScopeProps,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t\t\t\tpointerEvents: contentPointerEvents,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\twrapperProps,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</TextSelectionLayer>\n\t\t\t\t\t\t{/snippet}\n\t\t\t\t\t</DismissibleLayer>\n\t\t\t\t</EscapeLayer>\n\t\t\t{/snippet}\n\t\t</FocusScope>\n\t{/snippet}\n</PopperContent>\n","<script lang=\"ts\">\n\timport type { PopperLayerImplProps } from \"./types.js\";\n\timport PopperLayerInner from \"./popper-layer-inner.svelte\";\n\n\tlet {\n\t\tpopper,\n\t\topen,\n\t\tonEscapeKeydown,\n\t\tescapeKeydownBehavior,\n\t\tpreventOverflowTextSelection,\n\t\tid,\n\t\tonPointerDown,\n\t\tonPointerUp,\n\t\tside,\n\t\tsideOffset,\n\t\talign,\n\t\talignOffset,\n\t\tarrowPadding,\n\t\tavoidCollisions,\n\t\tcollisionBoundary,\n\t\tcollisionPadding,\n\t\tsticky,\n\t\thideWhenDetached,\n\t\tupdatePositionStrategy,\n\t\tstrategy,\n\t\tdir,\n\t\tpreventScroll,\n\t\twrapperId,\n\t\tstyle,\n\t\tonPlaced,\n\t\tonInteractOutside,\n\t\tonCloseAutoFocus,\n\t\tonOpenAutoFocus,\n\t\tonFocusOutside,\n\t\tinteractOutsideBehavior = \"close\",\n\t\tloop,\n\t\ttrapFocus = true,\n\t\tisValidEvent = () => false,\n\t\tcustomAnchor = null,\n\t\tisStatic = false,\n\t\tref,\n\t\tshouldRender,\n\t\t...restProps\n\t}: PopperLayerImplProps = $props();\n</script>\n\n{#if shouldRender}\n\t<PopperLayerInner\n\t\t{popper}\n\t\t{onEscapeKeydown}\n\t\t{escapeKeydownBehavior}\n\t\t{preventOverflowTextSelection}\n\t\t{id}\n\t\t{onPointerDown}\n\t\t{onPointerUp}\n\t\t{side}\n\t\t{sideOffset}\n\t\t{align}\n\t\t{alignOffset}\n\t\t{arrowPadding}\n\t\t{avoidCollisions}\n\t\t{collisionBoundary}\n\t\t{collisionPadding}\n\t\t{sticky}\n\t\t{hideWhenDetached}\n\t\t{updatePositionStrategy}\n\t\t{strategy}\n\t\t{dir}\n\t\t{preventScroll}\n\t\t{wrapperId}\n\t\t{style}\n\t\t{onPlaced}\n\t\t{customAnchor}\n\t\t{isStatic}\n\t\tenabled={open}\n\t\t{onInteractOutside}\n\t\t{onCloseAutoFocus}\n\t\t{onOpenAutoFocus}\n\t\t{interactOutsideBehavior}\n\t\t{loop}\n\t\t{trapFocus}\n\t\t{isValidEvent}\n\t\t{onFocusOutside}\n\t\tforceMount={false}\n\t\t{ref}\n\t\t{...restProps}\n\t/>\n{/if}\n","<script lang=\"ts\">\n\timport type { PopperLayerImplProps } from \"./types.js\";\n\timport PopperLayerInner from \"./popper-layer-inner.svelte\";\n\n\tlet {\n\t\tpopper,\n\t\tonEscapeKeydown,\n\t\tescapeKeydownBehavior,\n\t\tpreventOverflowTextSelection,\n\t\tid,\n\t\tonPointerDown,\n\t\tonPointerUp,\n\t\tside,\n\t\tsideOffset,\n\t\talign,\n\t\talignOffset,\n\t\tarrowPadding,\n\t\tavoidCollisions,\n\t\tcollisionBoundary,\n\t\tcollisionPadding,\n\t\tsticky,\n\t\thideWhenDetached,\n\t\tupdatePositionStrategy,\n\t\tstrategy,\n\t\tdir,\n\t\tpreventScroll,\n\t\twrapperId,\n\t\tstyle,\n\t\tonPlaced,\n\t\tonInteractOutside,\n\t\tonCloseAutoFocus,\n\t\tonOpenAutoFocus,\n\t\tonFocusOutside,\n\t\tinteractOutsideBehavior = \"close\",\n\t\tloop,\n\t\ttrapFocus = true,\n\t\tisValidEvent = () => false,\n\t\tcustomAnchor = null,\n\t\tisStatic = false,\n\t\tenabled,\n\t\t...restProps\n\t}: Omit<PopperLayerImplProps, \"open\"> & {\n\t\tenabled: boolean;\n\t} = $props();\n</script>\n\n<PopperLayerInner\n\t{popper}\n\t{onEscapeKeydown}\n\t{escapeKeydownBehavior}\n\t{preventOverflowTextSelection}\n\t{id}\n\t{onPointerDown}\n\t{onPointerUp}\n\t{side}\n\t{sideOffset}\n\t{align}\n\t{alignOffset}\n\t{arrowPadding}\n\t{avoidCollisions}\n\t{collisionBoundary}\n\t{collisionPadding}\n\t{sticky}\n\t{hideWhenDetached}\n\t{updatePositionStrategy}\n\t{strategy}\n\t{dir}\n\t{preventScroll}\n\t{wrapperId}\n\t{style}\n\t{onPlaced}\n\t{customAnchor}\n\t{isStatic}\n\t{enabled}\n\t{onInteractOutside}\n\t{onCloseAutoFocus}\n\t{onOpenAutoFocus}\n\t{interactOutsideBehavior}\n\t{loop}\n\t{trapFocus}\n\t{isValidEvent}\n\t{onFocusOutside}\n\t{...restProps}\n\tforceMount={true}\n/>\n","import { getDocument } from \"svelte-toolbelt\";\nimport { on } from \"svelte/events\";\nimport { watch } from \"runed\";\nimport { isElement } from \"./is.js\";\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] ?? [0, 0];\n const [xj, yj] = polygon[j] ?? [0, 0];\n const intersect = yi >= y !== yj >= y && x <= ((xj - xi) * (y - yi)) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\nfunction isInsideRect(point, rect) {\n return (point[0] >= rect.left &&\n point[0] <= rect.right &&\n point[1] >= rect.top &&\n point[1] <= rect.bottom);\n}\nfunction getSide(triggerRect, contentRect) {\n // determine which side the content is on relative to trigger\n const triggerCenterX = triggerRect.left + triggerRect.width / 2;\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n const contentCenterX = contentRect.left + contentRect.width / 2;\n const contentCenterY = contentRect.top + contentRect.height / 2;\n const deltaX = contentCenterX - triggerCenterX;\n const deltaY = contentCenterY - triggerCenterY;\n if (Math.abs(deltaX) > Math.abs(deltaY)) {\n return deltaX > 0 ? \"right\" : \"left\";\n }\n return deltaY > 0 ? \"bottom\" : \"top\";\n}\n/**\n * Creates a safe polygon area that allows users to move their cursor between\n * the trigger and floating content without closing it.\n */\nexport class SafePolygon {\n #opts;\n #buffer;\n #transitIntentTimeout;\n // tracks the cursor position when leaving trigger or content\n #exitPoint = null;\n // tracks what we're moving toward: \"content\" when leaving trigger, \"trigger\" when leaving content\n #exitTarget = null;\n #transitTargets = [];\n #trackedTriggerNode = null;\n #leaveFallbackRafId = null;\n #transitIntentTimeoutId = null;\n #cancelLeaveFallback() {\n if (this.#leaveFallbackRafId !== null) {\n cancelAnimationFrame(this.#leaveFallbackRafId);\n this.#leaveFallbackRafId = null;\n }\n }\n #scheduleLeaveFallback() {\n this.#cancelLeaveFallback();\n this.#leaveFallbackRafId = requestAnimationFrame(() => {\n this.#leaveFallbackRafId = null;\n if (!this.#exitPoint || !this.#exitTarget)\n return;\n this.#clearTracking();\n this.#opts.onPointerExit();\n });\n }\n #cancelTransitIntentTimeout() {\n if (this.#transitIntentTimeoutId !== null) {\n clearTimeout(this.#transitIntentTimeoutId);\n this.#transitIntentTimeoutId = null;\n }\n }\n #scheduleTransitIntentTimeout() {\n if (this.#transitIntentTimeout === null)\n return;\n this.#cancelTransitIntentTimeout();\n this.#transitIntentTimeoutId = window.setTimeout(() => {\n this.#transitIntentTimeoutId = null;\n if (!this.#exitPoint || !this.#exitTarget)\n return;\n this.#clearTracking();\n this.#opts.onPointerExit();\n }, this.#transitIntentTimeout);\n }\n constructor(opts) {\n this.#opts = opts;\n this.#buffer = opts.buffer ?? 1;\n const transitIntentTimeout = opts.transitIntentTimeout;\n this.#transitIntentTimeout =\n typeof transitIntentTimeout === \"number\" && transitIntentTimeout > 0\n ? transitIntentTimeout\n : null;\n watch([opts.triggerNode, opts.contentNode, opts.enabled], ([triggerNode, contentNode, enabled]) => {\n if (!triggerNode || !contentNode || !enabled) {\n this.#trackedTriggerNode = null;\n this.#clearTracking();\n return;\n }\n if (this.#trackedTriggerNode && this.#trackedTriggerNode !== triggerNode) {\n this.#clearTracking();\n }\n this.#trackedTriggerNode = triggerNode;\n const doc = getDocument(triggerNode);\n const handlePointerMove = (e) => {\n this.#onPointerMove([e.clientX, e.clientY], triggerNode, contentNode);\n };\n const handleTriggerLeave = (e) => {\n // when leaving trigger toward content, record exit point\n const target = e.relatedTarget;\n // if going directly to content, no need for polygon tracking\n if (isElement(target) && contentNode.contains(target)) {\n return;\n }\n // if moving to an ignored target (e.g. a sibling trigger), don't close —\n // the sibling's enter handler will take over\n const ignoredTargets = this.#opts.ignoredTargets?.() ?? [];\n if (isElement(target) &&\n ignoredTargets.some((n) => n === target || n.contains(target))) {\n return;\n }\n this.#transitTargets =\n isElement(target) && ignoredTargets.length > 0\n ? ignoredTargets.filter((n) => target.contains(n))\n : [];\n // for unrelated elements, defer close decisions to pointer geometry checks.\n // this allows the cursor to pass through intermediate elements on the way\n // to content without immediately closing.\n this.#exitPoint = [e.clientX, e.clientY];\n this.#exitTarget = \"content\";\n this.#scheduleLeaveFallback();\n };\n const handleTriggerEnter = () => {\n // reached trigger, clear tracking\n this.#clearTracking();\n };\n const handleContentEnter = () => {\n // reached content, clear tracking\n this.#clearTracking();\n };\n const handleContentLeave = (e) => {\n // when leaving content, check if going directly back to trigger\n const target = e.relatedTarget;\n if (isElement(target) && triggerNode.contains(target)) {\n // going directly to trigger, no polygon tracking needed\n return;\n }\n // set up polygon tracking toward trigger — pointermove decides whether to close\n this.#exitPoint = [e.clientX, e.clientY];\n this.#exitTarget = \"trigger\";\n this.#scheduleLeaveFallback();\n };\n return [\n on(doc, \"pointermove\", handlePointerMove),\n on(triggerNode, \"pointerleave\", handleTriggerLeave),\n on(triggerNode, \"pointerenter\", handleTriggerEnter),\n on(contentNode, \"pointerenter\", handleContentEnter),\n on(contentNode, \"pointerleave\", handleContentLeave),\n ].reduce((acc, cleanup) => () => {\n acc();\n cleanup();\n }, () => { });\n });\n }\n #onPointerMove(clientPoint, triggerNode, contentNode) {\n // if no exit point recorded, nothing to check\n if (!this.#exitPoint || !this.#exitTarget)\n return;\n this.#cancelLeaveFallback();\n this.#scheduleTransitIntentTimeout();\n const triggerRect = triggerNode.getBoundingClientRect();\n const contentRect = contentNode.getBoundingClientRect();\n // check if pointer reached the target\n if (this.#exitTarget === \"content\" && isInsideRect(clientPoint, contentRect)) {\n this.#clearTracking();\n return;\n }\n if (this.#exitTarget === \"trigger\" && isInsideRect(clientPoint, triggerRect)) {\n this.#clearTracking();\n return;\n }\n if (this.#exitTarget === \"content\" && this.#transitTargets.length > 0) {\n for (const transitTarget of this.#transitTargets) {\n const transitRect = transitTarget.getBoundingClientRect();\n if (isInsideRect(clientPoint, transitRect))\n return;\n const transitSide = getSide(triggerRect, transitRect);\n const transitCorridor = this.#getCorridorPolygon(triggerRect, transitRect, transitSide);\n if (transitCorridor && isPointInPolygon(clientPoint, transitCorridor))\n return;\n }\n }\n // check if pointer is in the rectangular corridor between trigger and content\n const side = getSide(triggerRect, contentRect);\n const corridorPoly = this.#getCorridorPolygon(triggerRect, contentRect, side);\n if (corridorPoly && isPointInPolygon(clientPoint, corridorPoly)) {\n return;\n }\n // check if pointer is within the safe polygon from exit point to target\n const targetRect = this.#exitTarget === \"content\" ? contentRect : triggerRect;\n const safePoly = this.#getSafePolygon(this.#exitPoint, targetRect, side, this.#exitTarget);\n if (isPointInPolygon(clientPoint, safePoly)) {\n return;\n }\n // pointer is outside all safe zones - close\n this.#clearTracking();\n this.#opts.onPointerExit();\n }\n #clearTracking() {\n this.#exitPoint = null;\n this.#exitTarget = null;\n this.#transitTargets = [];\n this.#cancelLeaveFallback();\n this.#cancelTransitIntentTimeout();\n }\n /**\n * Creates a rectangular corridor between trigger and content\n * This prevents closing when cursor is in the gap between them\n */\n #getCorridorPolygon(triggerRect, contentRect, side) {\n const buffer = this.#buffer;\n switch (side) {\n case \"top\":\n return [\n [Math.min(triggerRect.left, contentRect.left) - buffer, triggerRect.top],\n [Math.min(triggerRect.left, contentRect.left) - buffer, contentRect.bottom],\n [Math.max(triggerRect.right, contentRect.right) + buffer, contentRect.bottom],\n [Math.max(triggerRect.right, contentRect.right) + buffer, triggerRect.top],\n ];\n case \"bottom\":\n return [\n [Math.min(triggerRect.left, contentRect.left) - buffer, triggerRect.bottom],\n [Math.min(triggerRect.left, contentRect.left) - buffer, contentRect.top],\n [Math.max(triggerRect.right, contentRect.right) + buffer, contentRect.top],\n [Math.max(triggerRect.right, contentRect.right) + buffer, triggerRect.bottom],\n ];\n case \"left\":\n return [\n [triggerRect.left, Math.min(triggerRect.top, contentRect.top) - buffer],\n [contentRect.right, Math.min(triggerRect.top, contentRect.top) - buffer],\n [contentRect.right, Math.max(triggerRect.bottom, contentRect.bottom) + buffer],\n [triggerRect.left, Math.max(triggerRect.bottom, contentRect.bottom) + buffer],\n ];\n case \"right\":\n return [\n [triggerRect.right, Math.min(triggerRect.top, contentRect.top) - buffer],\n [contentRect.left, Math.min(triggerRect.top, contentRect.top) - buffer],\n [contentRect.left, Math.max(triggerRect.bottom, contentRect.bottom) + buffer],\n [triggerRect.right, Math.max(triggerRect.bottom, contentRect.bottom) + buffer],\n ];\n }\n }\n /**\n * Creates a triangular/trapezoidal safe zone from the exit point to the target\n */\n #getSafePolygon(exitPoint, targetRect, side, exitTarget) {\n const buffer = this.#buffer * 4;\n const [x, y] = exitPoint;\n // when going back to trigger, we need to flip the side\n const effectiveSide = exitTarget === \"trigger\" ? this.#flipSide(side) : side;\n // create polygon points from cursor to target edges\n switch (effectiveSide) {\n case \"top\":\n return [\n [x - buffer, y + buffer],\n [x + buffer, y + buffer],\n [targetRect.right + buffer, targetRect.bottom],\n [targetRect.right + buffer, targetRect.top],\n [targetRect.left - buffer, targetRect.top],\n [targetRect.left - buffer, targetRect.bottom],\n ];\n case \"bottom\":\n return [\n [x - buffer, y - buffer],\n [x + buffer, y - buffer],\n [targetRect.right + buffer, targetRect.top],\n [targetRect.right + buffer, targetRect.bottom],\n [targetRect.left - buffer, targetRect.bottom],\n [targetRect.left - buffer, targetRect.top],\n ];\n case \"left\":\n return [\n [x + buffer, y - buffer],\n [x + buffer, y + buffer],\n [targetRect.right, targetRect.bottom + buffer],\n [targetRect.left, targetRect.bottom + buffer],\n [targetRect.left, targetRect.top - buffer],\n [targetRect.right, targetRect.top - buffer],\n ];\n case \"right\":\n return [\n [x - buffer, y - buffer],\n [x - buffer, y + buffer],\n [targetRect.left, targetRect.bottom + buffer],\n [targetRect.right, targetRect.bottom + buffer],\n [targetRect.right, targetRect.top - buffer],\n [targetRect.left, targetRect.top - buffer],\n ];\n }\n }\n #flipSide(side) {\n switch (side) {\n case \"top\":\n return \"bottom\";\n case \"bottom\":\n return \"top\";\n case \"left\":\n return \"right\";\n case \"right\":\n return \"left\";\n }\n }\n}\n","import { attachRef, boxWith, DOMContext, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { createBitsAttrs, boolToStr, getDataOpenClosed, getDataTransitionAttrs, } from \"../../internal/attrs.js\";\nimport { isElement, isTouch } from \"../../internal/is.js\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nimport { SafePolygon } from \"../../internal/safe-polygon.svelte.js\";\nimport { isTabbable } from \"tabbable\";\nconst popoverAttrs = createBitsAttrs({\n component: \"popover\",\n parts: [\"root\", \"trigger\", \"content\", \"close\", \"overlay\"],\n});\nconst PopoverRootContext = new Context(\"Popover.Root\");\nexport class PopoverRootState {\n static create(opts) {\n return PopoverRootContext.set(new PopoverRootState(opts));\n }\n opts;\n contentNode = $state(null);\n contentPresence;\n triggerNode = $state(null);\n overlayNode = $state(null);\n overlayPresence;\n // hover tracking state\n openedViaHover = $state(false);\n hasInteractedWithContent = $state(false);\n hoverCooldown = $state(false);\n closeDelay = $state(0);\n #closeTimeout = null;\n #domContext = null;\n constructor(opts) {\n this.opts = opts;\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n });\n this.overlayPresence = new PresenceManager({\n ref: boxWith(() => this.overlayNode),\n open: this.opts.open,\n });\n watch(() => this.opts.open.current, (isOpen) => {\n if (!isOpen) {\n this.openedViaHover = false;\n this.hasInteractedWithContent = false;\n this.#clearCloseTimeout();\n }\n });\n }\n setDomContext(ctx) {\n this.#domContext = ctx;\n }\n #clearCloseTimeout() {\n if (this.#closeTimeout !== null && this.#domContext) {\n this.#domContext.clearTimeout(this.#closeTimeout);\n this.#closeTimeout = null;\n }\n }\n toggleOpen() {\n this.#clearCloseTimeout();\n this.opts.open.current = !this.opts.open.current;\n }\n handleClose() {\n this.#clearCloseTimeout();\n if (!this.opts.open.current)\n return;\n this.opts.open.current = false;\n }\n handleHoverOpen() {\n this.#clearCloseTimeout();\n if (this.opts.open.current)\n return;\n this.openedViaHover = true;\n this.opts.open.current = true;\n }\n handleHoverClose() {\n if (!this.opts.open.current)\n return;\n // only close if opened via hover and user hasn't interacted with content\n if (this.openedViaHover && !this.hasInteractedWithContent) {\n this.opts.open.current = false;\n }\n }\n handleDelayedHoverClose() {\n if (!this.opts.open.current)\n return;\n if (!this.openedViaHover || this.hasInteractedWithContent)\n return;\n this.#clearCloseTimeout();\n if (this.closeDelay <= 0) {\n this.opts.open.current = false;\n }\n else if (this.#domContext) {\n this.#closeTimeout = this.#domContext.setTimeout(() => {\n if (this.openedViaHover && !this.hasInteractedWithContent) {\n this.opts.open.current = false;\n }\n this.#closeTimeout = null;\n }, this.closeDelay);\n }\n }\n cancelDelayedClose() {\n this.#clearCloseTimeout();\n }\n markInteraction() {\n this.hasInteractedWithContent = true;\n this.#clearCloseTimeout();\n }\n}\nexport class PopoverTriggerState {\n static create(opts) {\n return new PopoverTriggerState(opts, PopoverRootContext.get());\n }\n opts;\n root;\n attachment;\n domContext;\n #openTimeout = null;\n #closeTimeout = null;\n #isHovering = $state(false);\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.triggerNode = v));\n this.domContext = new DOMContext(opts.ref);\n this.root.setDomContext(this.domContext);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n this.onpointerenter = this.onpointerenter.bind(this);\n this.onpointerleave = this.onpointerleave.bind(this);\n watch(() => this.opts.closeDelay.current, (delay) => {\n this.root.closeDelay = delay;\n });\n }\n #clearOpenTimeout() {\n if (this.#openTimeout !== null) {\n this.domContext.clearTimeout(this.#openTimeout);\n this.#openTimeout = null;\n }\n }\n #clearCloseTimeout() {\n if (this.#closeTimeout !== null) {\n this.domContext.clearTimeout(this.#closeTimeout);\n this.#closeTimeout = null;\n }\n }\n #clearAllTimeouts() {\n this.#clearOpenTimeout();\n this.#clearCloseTimeout();\n }\n onpointerenter(e) {\n if (this.opts.disabled.current)\n return;\n if (!this.opts.openOnHover.current)\n return;\n if (isTouch(e))\n return;\n this.#isHovering = true;\n this.#clearCloseTimeout();\n this.root.cancelDelayedClose();\n if (this.root.opts.open.current || this.root.hoverCooldown)\n return;\n const delay = this.opts.openDelay.current;\n if (delay <= 0) {\n this.root.handleHoverOpen();\n }\n else {\n this.#openTimeout = this.domContext.setTimeout(() => {\n this.root.handleHoverOpen();\n this.#openTimeout = null;\n }, delay);\n }\n }\n onpointerleave(e) {\n if (this.opts.disabled.current)\n return;\n if (!this.opts.openOnHover.current)\n return;\n if (isTouch(e))\n return;\n this.#isHovering = false;\n this.#clearOpenTimeout();\n this.root.hoverCooldown = false;\n // let GraceArea handle the close - it will call handleHoverClose via onPointerExit\n // we just need to stop any pending open timer\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button !== 0)\n return;\n this.#clearAllTimeouts();\n // if clicked while hovering and popover is open, convert to click-based open\n if (this.#isHovering && this.root.opts.open.current && this.root.openedViaHover) {\n this.root.openedViaHover = false;\n this.root.hasInteractedWithContent = true;\n return;\n }\n // if closing while hovering with openOnHover enabled, set cooldown to prevent\n // immediate re-open via hover\n if (this.#isHovering && this.opts.openOnHover.current && this.root.opts.open.current) {\n this.root.hoverCooldown = true;\n }\n // if clicking to open while in cooldown, reset cooldown (explicit open)\n if (this.root.hoverCooldown && !this.root.opts.open.current) {\n this.root.hoverCooldown = false;\n }\n this.root.toggleOpen();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (!(e.key === kbd.ENTER || e.key === kbd.SPACE))\n return;\n e.preventDefault();\n this.#clearAllTimeouts();\n this.root.toggleOpen();\n }\n #getAriaControls() {\n if (this.root.opts.open.current && this.root.contentNode?.id) {\n return this.root.contentNode?.id;\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": boolToStr(this.root.opts.open.current),\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n \"aria-controls\": this.#getAriaControls(),\n [popoverAttrs.trigger]: \"\",\n disabled: this.opts.disabled.current,\n //\n onkeydown: this.onkeydown,\n onclick: this.onclick,\n onpointerenter: this.onpointerenter,\n onpointerleave: this.onpointerleave,\n ...this.attachment,\n }));\n}\nexport class PopoverContentState {\n static create(opts) {\n return new PopoverContentState(opts, PopoverRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.contentNode = v));\n this.onpointerdown = this.onpointerdown.bind(this);\n this.onfocusin = this.onfocusin.bind(this);\n this.onpointerenter = this.onpointerenter.bind(this);\n this.onpointerleave = this.onpointerleave.bind(this);\n new SafePolygon({\n triggerNode: () => this.root.triggerNode,\n contentNode: () => this.root.contentNode,\n enabled: () => this.root.opts.open.current &&\n this.root.openedViaHover &&\n !this.root.hasInteractedWithContent,\n onPointerExit: () => {\n this.root.handleDelayedHoverClose();\n },\n });\n }\n onpointerdown(_) {\n this.root.markInteraction();\n }\n onfocusin(e) {\n const target = e.target;\n if (isElement(target) && isTabbable(target)) {\n this.root.markInteraction();\n }\n }\n onpointerenter(e) {\n if (isTouch(e))\n return;\n this.root.cancelDelayedClose();\n }\n onpointerleave(e) {\n if (isTouch(e))\n return;\n // handled by grace area\n }\n onInteractOutside = (e) => {\n this.opts.onInteractOutside.current(e);\n if (e.defaultPrevented)\n return;\n if (!isElement(e.target))\n return;\n const closestTrigger = e.target.closest(popoverAttrs.selector(\"trigger\"));\n if (closestTrigger && closestTrigger === this.root.triggerNode)\n return;\n if (this.opts.customAnchor.current) {\n if (isElement(this.opts.customAnchor.current)) {\n if (this.opts.customAnchor.current.contains(e.target))\n return;\n }\n else if (typeof this.opts.customAnchor.current === \"string\") {\n const el = document.querySelector(this.opts.customAnchor.current);\n if (el && el.contains(e.target))\n return;\n }\n }\n this.root.handleClose();\n };\n onEscapeKeydown = (e) => {\n this.opts.onEscapeKeydown.current(e);\n if (e.defaultPrevented)\n return;\n this.root.handleClose();\n };\n get shouldRender() {\n return this.root.contentPresence.shouldRender;\n }\n get shouldTrapFocus() {\n if (this.root.openedViaHover && !this.root.hasInteractedWithContent)\n return false;\n return true;\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n tabindex: -1,\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n ...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),\n [popoverAttrs.content]: \"\",\n style: {\n pointerEvents: \"auto\",\n // CSS containment isolates style/layout/paint calculations from the rest of the page\n contain: \"layout style\",\n },\n onpointerdown: this.onpointerdown,\n onfocusin: this.onfocusin,\n onpointerenter: this.onpointerenter,\n onpointerleave: this.onpointerleave,\n ...this.attachment,\n }));\n popperProps = {\n onInteractOutside: this.onInteractOutside,\n onEscapeKeydown: this.onEscapeKeydown,\n };\n}\nexport class PopoverCloseState {\n static create(opts) {\n return new PopoverCloseState(opts, PopoverRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(_) {\n this.root.handleClose();\n }\n onkeydown(e) {\n if (!(e.key === kbd.ENTER || e.key === kbd.SPACE))\n return;\n e.preventDefault();\n this.root.handleClose();\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n type: \"button\",\n [popoverAttrs.close]: \"\",\n ...this.attachment,\n }));\n}\nexport class PopoverOverlayState {\n static create(opts) {\n return new PopoverOverlayState(opts, PopoverRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.overlayNode = v));\n }\n get shouldRender() {\n return this.root.overlayPresence.shouldRender;\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [popoverAttrs.overlay]: \"\",\n style: {\n pointerEvents: \"auto\",\n },\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n ...getDataTransitionAttrs(this.root.overlayPresence.transitionStatus),\n ...this.attachment,\n }));\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { PopoverContentProps } from \"../types.js\";\n\timport { PopoverContentState } from \"../popover.svelte.js\";\n\timport PopperLayer from \"../../utilities/popper-layer/popper-layer.svelte\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { getFloatingContentCSSVars } from \"../../../internal/floating-svelte/floating-utils.svelte.js\";\n\timport PopperLayerForceMount from \"../../utilities/popper-layer/popper-layer-force-mount.svelte\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchild,\n\t\tchildren,\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tforceMount = false,\n\t\tonOpenAutoFocus = noop,\n\t\tonCloseAutoFocus = noop,\n\t\tonEscapeKeydown = noop,\n\t\tonInteractOutside = noop,\n\t\ttrapFocus = true,\n\t\tpreventScroll = false,\n\t\tcustomAnchor = null,\n\t\tstyle,\n\t\t...restProps\n\t}: PopoverContentProps = $props();\n\n\tconst contentState = PopoverContentState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tonInteractOutside: boxWith(() => onInteractOutside),\n\t\tonEscapeKeydown: boxWith(() => onEscapeKeydown),\n\t\tcustomAnchor: boxWith(() => customAnchor),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n\n\t// respect user's trapFocus setting, but disable when hover-opened without interaction\n\tconst effectiveTrapFocus = $derived(trapFocus && contentState.shouldTrapFocus);\n\n\t// prevent auto-focus when opened via hover until user interacts\n\tfunction handleOpenAutoFocus(e: Event) {\n\t\tif (!contentState.shouldTrapFocus) {\n\t\t\te.preventDefault();\n\t\t}\n\t\tonOpenAutoFocus(e);\n\t}\n</script>\n\n{#if forceMount}\n\t<PopperLayerForceMount\n\t\t{...mergedProps}\n\t\t{...contentState.popperProps}\n\t\tref={contentState.opts.ref}\n\t\tenabled={contentState.root.opts.open.current}\n\t\t{id}\n\t\ttrapFocus={effectiveTrapFocus}\n\t\t{preventScroll}\n\t\tloop\n\t\tforceMount={true}\n\t\t{customAnchor}\n\t\tonOpenAutoFocus={handleOpenAutoFocus}\n\t\t{onCloseAutoFocus}\n\t\tshouldRender={contentState.shouldRender}\n\t>\n\t\t{#snippet popper({ props, wrapperProps })}\n\t\t\t{@const finalProps = mergeProps(\n\t\t\t\tprops,\n\t\t\t\t{ style: getFloatingContentCSSVars(\"popover\") },\n\t\t\t\t{ style }\n\t\t\t)}\n\t\t\t{#if child}\n\t\t\t\t{@render child({ props: finalProps, wrapperProps, ...contentState.snippetProps })}\n\t\t\t{:else}\n\t\t\t\t<div {...wrapperProps}>\n\t\t\t\t\t<div {...finalProps}>\n\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/snippet}\n\t</PopperLayerForceMount>\n{:else if !forceMount}\n\t<PopperLayer\n\t\t{...mergedProps}\n\t\t{...contentState.popperProps}\n\t\tref={contentState.opts.ref}\n\t\topen={contentState.root.opts.open.current}\n\t\t{id}\n\t\ttrapFocus={effectiveTrapFocus}\n\t\t{preventScroll}\n\t\tloop\n\t\tforceMount={false}\n\t\t{customAnchor}\n\t\tonOpenAutoFocus={handleOpenAutoFocus}\n\t\t{onCloseAutoFocus}\n\t\tshouldRender={contentState.shouldRender}\n\t>\n\t\t{#snippet popper({ props, wrapperProps })}\n\t\t\t{@const finalProps = mergeProps(\n\t\t\t\tprops,\n\t\t\t\t{ style: getFloatingContentCSSVars(\"popover\") },\n\t\t\t\t{ style }\n\t\t\t)}\n\t\t\t{#if child}\n\t\t\t\t{@render child({ props: finalProps, wrapperProps, ...contentState.snippetProps })}\n\t\t\t{:else}\n\t\t\t\t<div {...wrapperProps}>\n\t\t\t\t\t<div {...finalProps}>\n\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/snippet}\n\t</PopperLayer>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { PopoverTriggerProps } from \"../types.js\";\n\timport { PopoverTriggerState } from \"../popover.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport FloatingLayerAnchor from \"../../utilities/floating-layer/components/floating-layer-anchor.svelte\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\ttype = \"button\",\n\t\tdisabled = false,\n\t\topenOnHover = false,\n\t\topenDelay = 700,\n\t\tcloseDelay = 300,\n\t\t...restProps\n\t}: PopoverTriggerProps = $props();\n\n\tconst triggerState = PopoverTriggerState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t\topenOnHover: boxWith(() => openOnHover),\n\t\topenDelay: boxWith(() => openDelay),\n\t\tcloseDelay: boxWith(() => closeDelay),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, triggerState.props, { type }));\n</script>\n\n<FloatingLayerAnchor {id} ref={triggerState.opts.ref}>\n\t{#if child}\n\t\t{@render child({ props: mergedProps })}\n\t{:else}\n\t\t<button {...mergedProps}>\n\t\t\t{@render children?.()}\n\t\t</button>\n\t{/if}\n</FloatingLayerAnchor>\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport { DialogRootState } from \"../dialog.svelte.js\";\n\timport type { DialogRootProps } from \"../types.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: DialogRootProps = $props();\n\n\tDialogRootState.create({\n\t\tvariant: boxWith(() => \"dialog\"),\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n</script>\n\n{@render children?.()}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogCloseState } from \"../dialog.svelte.js\";\n\timport type { DialogCloseProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\tdisabled = false,\n\t\t...restProps\n\t}: DialogCloseProps = $props();\n\n\tconst closeState = DialogCloseState.create({\n\t\tvariant: boxWith(() => \"close\"),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, closeState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogContentState } from \"../dialog.svelte.js\";\n\timport type { DialogContentProps } from \"../types.js\";\n\timport DismissibleLayer from \"../../utilities/dismissible-layer/dismissible-layer.svelte\";\n\timport EscapeLayer from \"../../utilities/escape-layer/escape-layer.svelte\";\n\timport FocusScope from \"../../utilities/focus-scope/focus-scope.svelte\";\n\timport TextSelectionLayer from \"../../utilities/text-selection-layer/text-selection-layer.svelte\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport ScrollLock from \"../../utilities/scroll-lock/scroll-lock.svelte\";\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tforceMount = false,\n\t\tonCloseAutoFocus = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tonEscapeKeydown = noop,\n\t\tonInteractOutside = noop,\n\t\ttrapFocus = true,\n\t\tpreventScroll = true,\n\t\tpreventOverflowTextSelection = true,\n\t\trestoreScrollDelay = null,\n\t\t...restProps\n\t}: DialogContentProps = $props();\n\n\tconst contentState = DialogContentState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n</script>\n\n{#if contentState.shouldRender || forceMount}\n\t<FocusScope\n\t\tref={contentState.opts.ref}\n\t\tloop\n\t\t{trapFocus}\n\t\tenabled={contentState.root.opts.open.current}\n\t\t{onOpenAutoFocus}\n\t\t{onCloseAutoFocus}\n\t>\n\t\t{#snippet focusScope({ props: focusScopeProps })}\n\t\t\t<EscapeLayer\n\t\t\t\t{...mergedProps}\n\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\tref={contentState.opts.ref}\n\t\t\t\tonEscapeKeydown={(e) => {\n\t\t\t\t\tonEscapeKeydown(e);\n\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<DismissibleLayer\n\t\t\t\t\t{...mergedProps}\n\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\tonInteractOutside={(e) => {\n\t\t\t\t\t\tonInteractOutside(e);\n\t\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<TextSelectionLayer\n\t\t\t\t\t\t{...mergedProps}\n\t\t\t\t\t\t{preventOverflowTextSelection}\n\t\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\t>\n\t\t\t\t\t\t{#if child}\n\t\t\t\t\t\t\t{#if contentState.root.opts.open.current}\n\t\t\t\t\t\t\t\t<ScrollLock {preventScroll} {restoreScrollDelay} />\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{@render child({\n\t\t\t\t\t\t\t\tprops: mergeProps(mergedProps, focusScopeProps),\n\t\t\t\t\t\t\t\t...contentState.snippetProps,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<ScrollLock {preventScroll} />\n\t\t\t\t\t\t\t<div {...mergeProps(mergedProps, focusScopeProps)}>\n\t\t\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</TextSelectionLayer>\n\t\t\t\t</DismissibleLayer>\n\t\t\t</EscapeLayer>\n\t\t{/snippet}\n\t</FocusScope>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { PopoverRootProps } from \"../types.js\";\n\timport { PopoverRootState } from \"../popover.svelte.js\";\n\timport FloatingLayer from \"../../utilities/floating-layer/components/floating-layer.svelte\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: PopoverRootProps = $props();\n\n\tPopoverRootState.create({\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n</script>\n\n<FloatingLayer>\n\t{@render children?.()}\n</FloatingLayer>\n","import { attachRef } from \"svelte-toolbelt\";\nimport { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, boolToTrueOrUndef, } from \"../../internal/attrs.js\";\nexport const toggleAttrs = createBitsAttrs({\n component: \"toggle\",\n parts: [\"root\"],\n});\nexport class ToggleRootState {\n static create(opts) {\n return new ToggleRootState(opts);\n }\n opts;\n attachment;\n constructor(opts) {\n this.opts = opts;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n }\n onclick(_) {\n if (this.opts.disabled.current)\n return;\n this.opts.pressed.current = !this.opts.pressed.current;\n }\n snippetProps = $derived.by(() => ({\n pressed: this.opts.pressed.current,\n }));\n props = $derived.by(() => ({\n [toggleAttrs.root]: \"\",\n id: this.opts.id.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"aria-pressed\": boolToStr(this.opts.pressed.current),\n \"data-state\": getToggleDataState(this.opts.pressed.current),\n disabled: boolToTrueOrUndef(this.opts.disabled.current),\n onclick: this.onclick,\n ...this.attachment,\n }));\n}\nexport function getToggleDataState(condition) {\n return condition ? \"on\" : \"off\";\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { ToggleRootProps } from \"../types.js\";\n\timport { ToggleRootState } from \"../toggle.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tpressed = $bindable(false),\n\t\tonPressedChange = noop,\n\t\tdisabled = false,\n\t\ttype = \"button\",\n\t\tchildren,\n\t\tchild,\n\t\t...restProps\n\t}: ToggleRootProps = $props();\n\n\tconst toggleState = ToggleRootState.create({\n\t\tpressed: boxWith(\n\t\t\t() => pressed,\n\t\t\t(v) => {\n\t\t\t\tpressed = v;\n\t\t\t\tonPressedChange(v);\n\t\t\t}\n\t\t),\n\t\tdisabled: boxWith(() => disabled ?? false),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, toggleState.props, { type }));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps, ...toggleState.snippetProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.(toggleState.snippetProps)}\n\t</button>\n{/if}\n","/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n * \n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n * \n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n * \n * ---\n * \n * The MIT License (MIT) (for portions derived from Feather)\n * \n * Copyright (c) 2013-2023 Cole Bemis\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n */\nconst defaultAttributes = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n};\nexport default defaultAttributes;\n","<script lang=\"ts\">import defaultAttributes from './defaultAttributes.js';\nconst { name, color = 'currentColor', size = 24, strokeWidth = 2, absoluteStrokeWidth = false, iconNode = [], children, ...props } = $props();\n</script>\n\n<svg\n {...defaultAttributes}\n {...props}\n width={size}\n height={size}\n stroke={color}\n stroke-width={absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth}\n class={['lucide-icon lucide', name && `lucide-${name}`, props.class]}\n>\n {#each iconNode as [tag, attrs]}\n <svelte:element\n this={tag}\n {...attrs}\n />\n {/each}\n {@render children?.()}\n</svg>\n","<script lang=\"ts\">/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * ---\n *\n * The MIT License (MIT) (for portions derived from Feather)\n *\n * Copyright (c) 2013-2023 Cole Bemis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\nimport Icon from '../Icon.svelte';\nlet props = $props();\nconst iconNode = [[\"path\", { \"d\": \"M20 6 9 17l-5-5\" }]];\n/**\n * @component @name Check\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgNiA5IDE3bC01LTUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/check\n * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {FunctionalComponent} Svelte component\n *\n */\n</script>\n\n<Icon name=\"check\" {...props} iconNode={iconNode}>\n {@render props.children?.()}\n</Icon>\n","<script lang=\"ts\">\n\t/**\n\t * The project the session works in: the repo root (else the cwd), the\n\t * branch, and the URLs named in the repo's `.claude-mux.json`. The\n\t * simplest pane there is, shipped with the panel so the container has\n\t * something to hold before the Changes, Files and Web panes arrive.\n\t */\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport type { ProjectInfo } from '$shared/server/project.js';\n\n\tlet { session, setActions, active }: PaneBodyProps = $props();\n\n\tlet info = $state<ProjectInfo | null>(null);\n\tlet error = $state<string | null>(null);\n\tlet loading = $state(false);\n\n\t/** Bumped by each load, so an answer that arrives after a newer request is dropped. */\n\tlet seq = 0;\n\n\tasync function load(id: string) {\n\t\tconst mine = ++seq;\n\t\tloading = true;\n\t\terror = null;\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/sessions/${encodeURIComponent(id)}/project`);\n\t\t\tconst body = await res.json();\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tif (mine === seq) info = body as ProjectInfo;\n\t\t} catch (err) {\n\t\t\tif (mine === seq) error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === seq) loading = false;\n\t\t}\n\t}\n\n\tconst sessionId = $derived(session?.id ?? null);\n\t// Read when first shown, and again whenever the session moves to another directory.\n\tconst cwd = $derived(session?.cwd ?? null);\n\t$effect(() => {\n\t\tif (sessionId && cwd && active) void load(sessionId);\n\t});\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId || loading,\n\t\t\t\trun: () => sessionId && void load(sessionId)\n\t\t\t}\n\t\t]);\n\t});\n\n\tconst urls = $derived(Object.entries(info?.config?.urls ?? {}));\n</script>\n\n<div class=\"project\">\n\t{#if error}\n\t\t<p class=\"err\">{error}</p>\n\t{:else if !info}\n\t\t<p class=\"dim\">Loading…</p>\n\t{:else}\n\t\t<dl>\n\t\t\t<dt>{info.repo ? 'Repository' : 'Directory'}</dt>\n\t\t\t<dd class=\"mono\" title={info.root}>{info.root}</dd>\n\t\t\t<dt>Branch</dt>\n\t\t\t<dd class=\"mono\">\n\t\t\t\t{#if info.branch}{info.branch}{:else if info.repo}<span class=\"dim\">detached HEAD</span>{:else}<span\n\t\t\t\t\t\tclass=\"dim\">not a git repository</span\n\t\t\t\t\t>{/if}\n\t\t\t</dd>\n\t\t\t<dt>URLs</dt>\n\t\t\t<dd>\n\t\t\t\t{#if urls.length > 0}\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t{#each urls as [name, url] (name)}\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<span class=\"name\">{name}</span>\n\t\t\t\t\t\t\t\t<a class=\"mono\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">{url}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</ul>\n\t\t\t\t{:else if info.configError}\n\t\t\t\t\t<span class=\"err\">.claude-mux.json: {info.configError}</span>\n\t\t\t\t{:else}\n\t\t\t\t\t<span class=\"dim\">\n\t\t\t\t\t\tNone. Commit a <code>.claude-mux.json</code> at the root to name them:\n\t\t\t\t\t</span>\n\t\t\t\t\t<pre>{`{ \"urls\": { \"prod\": \"https://…\", \"dev\": \"http://localhost:5173\" } }`}</pre>\n\t\t\t\t{/if}\n\t\t\t</dd>\n\t\t</dl>\n\t{/if}\n</div>\n\n<style>\n\t.project {\n\t\tpadding: 16px 18px;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\tdl {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: max-content 1fr;\n\t\tgap: 10px 16px;\n\t\tmargin: 0;\n\t}\n\tdt {\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tpadding-top: 2px;\n\t}\n\tdd {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.mono,\n\tcode,\n\tpre {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\tul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tdisplay: grid;\n\t\tgap: 6px;\n\t}\n\tli {\n\t\tdisplay: flex;\n\t\tgap: 10px;\n\t\talign-items: baseline;\n\t\tmin-width: 0;\n\t}\n\t.name {\n\t\tcolor: #a8a29e;\n\t\tmin-width: 3.5em;\n\t}\n\ta {\n\t\tcolor: #93c5fd;\n\t\ttext-decoration: none;\n\t\toverflow-wrap: anywhere;\n\t}\n\ta:hover {\n\t\ttext-decoration: underline;\n\t}\n\tpre {\n\t\tmargin: 8px 0 0;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 6px;\n\t\tbackground: #1a1a1a;\n\t\twhite-space: pre-wrap;\n\t\tcolor: #a8a29e;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n</style>\n","<script lang=\"ts\" module>\n\timport { type VariantProps, tv } from \"tailwind-variants\";\n\n\texport const toggleVariants = tv({\n\t\tbase: \"hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-lg text-sm font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none hover:bg-muted focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\toutline: \"border-input hover:bg-muted border bg-transparent\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: \"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\tsm: \"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\txs: \"h-6 min-w-6 rounded-md px-1.5 text-[11px] [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\tlg: \"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t});\n\n\texport type ToggleVariant = VariantProps<typeof toggleVariants>[\"variant\"];\n\texport type ToggleSize = VariantProps<typeof toggleVariants>[\"size\"];\n\texport type ToggleVariants = VariantProps<typeof toggleVariants>;\n</script>\n\n<script lang=\"ts\">\n\timport { Toggle as TogglePrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tpressed = $bindable(false),\n\t\tclass: className,\n\t\tsize = \"default\",\n\t\tvariant = \"default\",\n\t\t...restProps\n\t}: TogglePrimitive.RootProps & {\n\t\tvariant?: ToggleVariant;\n\t\tsize?: ToggleSize;\n\t} = $props();\n</script>\n\n<TogglePrimitive.Root\n\tbind:ref\n\tbind:pressed\n\tdata-slot=\"toggle\"\n\tclass={cn(toggleVariants({ variant, size }), className)}\n\t{...restProps}\n/>\n","/**\n * Syntax colouring for the Changes pane's diff, loaded the first time a diff\n * is drawn so the session page does not carry highlight.js until then.\n *\n * Lines are coloured one at a time: a diff shows fragments, so a construct\n * that opens above the hunk (a block comment, a template string) is never\n * seen whole anyway, and per line keeps a bad guess from spilling further.\n */\nimport type { HLJSApi, LanguageFn } from 'highlight.js';\n\nlet loading: Promise<HLJSApi> | null = null;\n\nconst LOADERS: Record<string, () => Promise<{ default: LanguageFn }>> = {\n\ttypescript: () => import('highlight.js/lib/languages/typescript'),\n\tjavascript: () => import('highlight.js/lib/languages/javascript'),\n\txml: () => import('highlight.js/lib/languages/xml'),\n\tcss: () => import('highlight.js/lib/languages/css'),\n\tscss: () => import('highlight.js/lib/languages/scss'),\n\tjson: () => import('highlight.js/lib/languages/json'),\n\tmarkdown: () => import('highlight.js/lib/languages/markdown'),\n\tpython: () => import('highlight.js/lib/languages/python'),\n\tbash: () => import('highlight.js/lib/languages/bash'),\n\tyaml: () => import('highlight.js/lib/languages/yaml'),\n\tini: () => import('highlight.js/lib/languages/ini'),\n\trust: () => import('highlight.js/lib/languages/rust'),\n\tgo: () => import('highlight.js/lib/languages/go'),\n\tsql: () => import('highlight.js/lib/languages/sql'),\n\tjava: () => import('highlight.js/lib/languages/java'),\n\tkotlin: () => import('highlight.js/lib/languages/kotlin'),\n\tc: () => import('highlight.js/lib/languages/c'),\n\tcpp: () => import('highlight.js/lib/languages/cpp'),\n\truby: () => import('highlight.js/lib/languages/ruby'),\n\tphp: () => import('highlight.js/lib/languages/php'),\n\tswift: () => import('highlight.js/lib/languages/swift'),\n\tlua: () => import('highlight.js/lib/languages/lua'),\n\tdockerfile: () => import('highlight.js/lib/languages/dockerfile'),\n\tmakefile: () => import('highlight.js/lib/languages/makefile')\n};\n\nconst core = () => (loading ??= import('highlight.js/lib/core').then((m) => m.default));\n\n/**\n * Each line as escaped HTML with highlight.js's token spans, or null when the\n * language is unknown (the caller then draws the text as is).\n */\nexport async function highlightLines(lines: string[], language: string | null): Promise<string[] | null> {\n\tif (!language || !LOADERS[language]) return null;\n\tconst load = LOADERS[language];\n\tconst hljs = await core();\n\tif (!hljs.getLanguage(language)) hljs.registerLanguage(language, (await load()).default);\n\treturn lines.map((line) => hljs.highlight(line, { language, ignoreIllegals: true }).value);\n}\n","<script lang=\"ts\">\n\t/**\n\t * What the session changed, from one of two sources: Current (git's\n\t * working tree, which catches edits made through Bash) or Session (the\n\t * edits in the session's own log, which reach files outside the repo and\n\t * know which turn made each). A file list on the left, the selected\n\t * file's diff on the right; narrower than the two fit, one at a time.\n\t *\n\t * The URL holds the file (`file`), the Session turn (`turn`, its number in\n\t * the session) and the source (`source`), so a link can open any of it.\n\t * While shown, the pane re-reads whenever the session's hooks report in.\n\t */\n\timport { untrack } from 'svelte';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Button } from '$lib/components/ui/button';\n\timport {\n\t\tdiffRows,\n\t\tdisplayPath,\n\t\tisGenerated,\n\t\tlanguageFor,\n\t\tstatusLetter,\n\t\tsumCounts,\n\t\ttype Diff,\n\t\ttype DiffRow,\n\t\ttype Listing,\n\t\ttype Source\n\t} from '$lib/side-panel/changes';\n\timport { highlightLines } from '$lib/side-panel/highlight';\n\n\tlet { session, params, setParams, setActions, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\t/** Git when the session sits in a repo, else its log; a `source` param overrides. */\n\tconst inRepo = $derived(!!session?.git_root || session?.changes?.source === 'git');\n\t/** Set once git answered that the session is not in a work tree. */\n\tlet gitMissing = $state(false);\n\tconst wanted = $derived<Source>(\n\t\tparams.source === 'session' || params.source === 'git' ? params.source : inRepo ? 'git' : 'session'\n\t);\n\tconst source = $derived<Source>(gitMissing && wanted === 'git' ? 'session' : wanted);\n\n\tlet listing = $state<Listing | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet loadingList = $state(false);\n\t/** Bumped by each listing read, so the diff is read again with it. */\n\tlet listStamp = $state(0);\n\tlet listSeq = 0;\n\t/** A reload asked for while one was in flight: run once more when it lands. */\n\tlet again: { id: string; src: Source } | null = null;\n\n\tasync function loadList(id: string, src: Source) {\n\t\tif (loadingList) {\n\t\t\tagain = { id, src };\n\t\t\treturn;\n\t\t}\n\t\tconst mine = ++listSeq;\n\t\tloadingList = true;\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/sessions/${encodeURIComponent(id)}/changes?source=${src}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== listSeq) return;\n\t\t\tif (res.status === 404 && src === 'git') {\n\t\t\t\tgitMissing = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tlisting = body as Listing;\n\t\t\tlistStamp++;\n\t\t\tlistError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === listSeq) listError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === listSeq) loadingList = false;\n\t\t\tconst next = again;\n\t\t\tagain = null;\n\t\t\tif (next) void loadList(next.id, next.src);\n\t\t}\n\t}\n\n\t/**\n\t * Re-read whenever a hook reports in or the broadcast count moves — what\n\t * makes git re-read the repo, too. A hidden pane waits until shown.\n\t */\n\tconst pulse = $derived(\n\t\t`${session?.last_update ?? 0}:${session?.changes?.additions ?? 0}:${session?.changes?.deletions ?? 0}:${session?.changes?.files ?? 0}`\n\t);\n\t$effect(() => {\n\t\tvoid pulse;\n\t\tif (sessionId && active) void loadList(sessionId, source);\n\t});\n\n\t// A listing for the other source is no answer for this one.\n\tconst current = $derived(listing?.source === source ? listing : null);\n\tconst turns = $derived(current?.turns ?? []);\n\tconst turn = $derived(\n\t\tsource === 'session' && params.turn !== undefined\n\t\t\t? (turns.find((t) => String(t.n) === params.turn) ?? null)\n\t\t\t: null\n\t);\n\tconst files = $derived(turn ? turn.files : (current?.files ?? []));\n\tconst root = $derived(current?.root ?? session?.git_root ?? session?.cwd ?? null);\n\tconst totals = $derived(turn ? sumCounts(files) : (current?.totals ?? sumCounts(files)));\n\t/** Newest first, each with its own totals. */\n\tconst chips = $derived(turns.map((t) => ({ ...t, ...sumCounts(t.files) })).reverse());\n\n\tlet showGenerated = $state(false);\n\tconst split = $derived.by(() => {\n\t\tconst generated: typeof files = [];\n\t\tconst kept: typeof files = [];\n\t\t// Relative to the root, so a repo that sits under a `build/` is not all generated.\n\t\tfor (const f of files) (isGenerated(displayPath(f.file, root)) ? generated : kept).push(f);\n\t\treturn { generated, kept };\n\t});\n\tconst shown = $derived(showGenerated ? files : split.kept);\n\n\t/** The file the URL names, else the first one listed, so a wide pane never sits empty. */\n\tconst selected = $derived(\n\t\tfiles.find((f) => f.file === params.file) ?? (params.file ? null : (shown[0] ?? null))\n\t);\n\n\tfunction pick(file: string) {\n\t\tsetParams({ file });\n\t}\n\n\tfunction setSource(next: Source) {\n\t\tif (next === source) return;\n\t\tsetParams({ source: next, turn: null, file: null });\n\t}\n\n\tfunction setTurn(n: number | null) {\n\t\tsetParams({ turn: n === null ? null : String(n), file: null });\n\t}\n\n\tconst NO_PROMPT = 'Before the first prompt';\n\n\t/** Scroll the transcript to the prompt that opened a turn; the page does the scrolling. */\n\tfunction revealTurn(id: string) {\n\t\twindow.dispatchEvent(new CustomEvent('claude-mux:reveal-entry', { detail: { id } }));\n\t}\n\n\t// ── the selected file's diff ─────────────────────────────────────────\n\n\tlet diff = $state<Diff | null>(null);\n\tlet diffError = $state<{ file: string; message: string } | null>(null);\n\tlet diffSeq = 0;\n\t/** Highlighted HTML per row index, filled in once highlight.js has loaded. */\n\tlet painted = $state<(string | null)[] | null>(null);\n\n\tasync function loadDiff(id: string, src: Source, file: string, turnId: string | null | undefined) {\n\t\tconst mine = ++diffSeq;\n\t\tconst q = new URLSearchParams({ source: src, file });\n\t\t// An empty turn is the one before the first prompt; no turn at all is every turn.\n\t\tif (turnId !== undefined) q.set('turn', turnId ?? '');\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/sessions/${encodeURIComponent(id)}/changes/diff?${q}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== diffSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tdiff = body as Diff;\n\t\t\tdiffError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === diffSeq) {\n\t\t\t\tdiff = null;\n\t\t\t\tdiffError = { file, message: err instanceof Error ? err.message : String(err) };\n\t\t\t}\n\t\t}\n\t}\n\n\t/** What the diff depends on: the file, the turn, and each fresh read of the list. */\n\tconst diffKey = $derived(\n\t\tselected ? `${source}\\0${selected.file}\\0${turn ? `t${turn.n}` : ''}\\0${listStamp}` : null\n\t);\n\t$effect(() => {\n\t\tif (!diffKey || !sessionId || !active) return;\n\t\t// Only the key decides: a reloaded list hands back new objects for the same file.\n\t\tconst id = sessionId;\n\t\tuntrack(() => void loadDiff(id, source, selected!.file, turn ? turn.id : undefined));\n\t});\n\n\tconst shownDiff = $derived(diff && diff.file === selected?.file ? diff : null);\n\tconst shownError = $derived(diffError?.file === selected?.file ? diffError!.message : null);\n\tconst rows = $derived<DiffRow[]>(shownDiff ? diffRows(shownDiff.hunks) : []);\n\tconst hunkCount = $derived(shownDiff?.hunks.length ?? 0);\n\n\tconst SIGN = { add: '+', del: '−', context: ' ' } as const;\n\n\t/** Rows past this many are drawn plain: colouring them costs more than it gives. */\n\tconst PAINT_LIMIT = 4000;\n\t$effect(() => {\n\t\tpainted = null;\n\t\tif (rows.length === 0 || rows.length > PAINT_LIMIT) return;\n\t\tconst lines = rows.map((r) => ('text' in r ? r.text : ''));\n\t\tconst language = untrack(() => languageFor(selected!.file));\n\t\tlet stale = false;\n\t\tvoid highlightLines(lines, language).then((html) => {\n\t\t\tif (!stale && html) painted = html;\n\t\t});\n\t\treturn () => (stale = true);\n\t});\n\n\t// ── header actions and keys ──────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId || loadingList,\n\t\t\t\trun: () => sessionId && void loadList(sessionId, source)\n\t\t\t}\n\t\t]);\n\t});\n\n\t/** j/k step through the files, unless someone is typing. */\n\tfunction onKey(e: KeyboardEvent) {\n\t\tif (!active || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return;\n\t\tif (e.key !== 'j' && e.key !== 'k') return;\n\t\tconst el = e.target as HTMLElement | null;\n\t\tif (el?.closest('input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]')) return;\n\t\tif (shown.length === 0) return;\n\t\tconst at = selected ? shown.findIndex((f) => f.file === selected.file) : -1;\n\t\tconst next = e.key === 'j' ? Math.min(at + 1, shown.length - 1) : Math.max(at - 1, 0);\n\t\te.preventDefault();\n\t\tpick(shown[next].file);\n\t\tdocument\n\t\t\t.querySelector(`[data-change-file=\"${CSS.escape(shown[next].file)}\"]`)\n\t\t\t?.scrollIntoView({ block: 'nearest' });\n\t}\n\n</script>\n\n<svelte:window onkeydown={onKey} />\n\n<div class=\"changes\" class:picked={!!params.file}>\n\t<div class=\"bar\">\n\t\t<span class=\"title\">\n\t\t\t{#if current}\n\t\t\t\t{files.length} {files.length === 1 ? 'file' : 'files'} changed\n\t\t\t\t{#if totals.additions || totals.deletions}\n\t\t\t\t\t<span class=\"mono\"><span class=\"add\">+{totals.additions}</span> <span class=\"del\">−{totals.deletions}</span></span>\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\tChanges\n\t\t\t{/if}\n\t\t</span>\n\t\t<span class=\"sp\"></span>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"Source\">\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tbind:pressed={() => source === 'git', (on) => on && setSource('git')}\n\t\t\t\tdisabled={gitMissing}\n\t\t\t\ttitle={gitMissing ? 'Not a git repository' : 'What git sees in the working tree now'}>Current · git</Toggle\n\t\t\t>\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tbind:pressed={() => source === 'session', (on) => on && setSource('session')}\n\t\t\t\ttitle=\"The edits this session's tools made\">Session</Toggle\n\t\t\t>\n\t\t</div>\n\t</div>\n\n\t{#if source === 'session' && turns.length > 0}\n\t\t<div class=\"turns\" role=\"group\" aria-label=\"Turn\">\n\t\t\t<Toggle\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tclass=\"chip\"\n\t\t\t\tbind:pressed={() => !turn, (on) => on && setTurn(null)}>All turns</Toggle\n\t\t\t>\n\t\t\t{#each chips as t (t.n)}\n\t\t\t\t<Toggle\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclass=\"chip\"\n\t\t\t\t\ttitle={t.prompt || NO_PROMPT}\n\t\t\t\t\tbind:pressed={() => turn?.n === t.n, (on) => on && setTurn(t.n)}\n\t\t\t\t>\n\t\t\t\t\t{t.n === 0 ? 'Start' : `Turn ${t.n}`}\n\t\t\t\t\t{#if t.additions}<span class=\"add\">+{t.additions}</span>{/if}\n\t\t\t\t\t{#if t.deletions}<span class=\"del\">−{t.deletions}</span>{/if}\n\t\t\t\t</Toggle>\n\t\t\t{/each}\n\t\t</div>\n\t\t{#if turn}\n\t\t\t<div class=\"turn-note\">\n\t\t\t\t<span class=\"prompt\" title={turn.prompt}>{turn.prompt || NO_PROMPT}</span>\n\t\t\t\t{#if turn.id}\n\t\t\t\t\t{@const id = turn.id}\n\t\t\t\t\t<Button variant=\"link\" size=\"sm\" class=\"link\" onclick={() => revealTurn(id)}>Show in transcript</Button>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t{/if}\n\n\t{#if listError && !current}\n\t\t<p class=\"msg err\">{listError}</p>\n\t{:else if !current}\n\t\t<p class=\"msg\">Loading…</p>\n\t{:else if files.length === 0}\n\t\t<p class=\"msg\">\n\t\t\t{source === 'git' ? 'The working tree is clean.' : 'This session has not edited any files yet.'}\n\t\t</p>\n\t{:else}\n\t\t<div class=\"split\">\n\t\t\t<nav aria-label=\"Changed files\">\n\t\t\t\t{#each shown as f (f.file)}\n\t\t\t\t\t{@const letter = statusLetter(f)}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"file\"\n\t\t\t\t\t\tclass:on={selected?.file === f.file}\n\t\t\t\t\t\tclass:untracked={f.untracked}\n\t\t\t\t\t\taria-current={selected?.file === f.file ? 'true' : undefined}\n\t\t\t\t\t\tdata-change-file={f.file}\n\t\t\t\t\t\ttitle={f.oldPath ? `${f.oldPath} → ${f.file}` : f.file}\n\t\t\t\t\t\tonclick={() => pick(f.file)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"st st-{letter === '?' ? 'u' : letter.toLowerCase()}\">{letter}</span>\n\t\t\t\t\t\t<!-- rtl puts the ellipsis on the left; bdi keeps the path itself left to right. -->\n\t\t\t\t\t\t<span class=\"path\"><bdi>{displayPath(f.file, root)}</bdi></span>\n\t\t\t\t\t\t{#if f.binary}\n\t\t\t\t\t\t\t<span class=\"dim\">bin</span>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t{#if f.additions}<span class=\"add\">+{f.additions}</span>{/if}\n\t\t\t\t\t\t\t{#if f.deletions}<span class=\"del\">−{f.deletions}</span>{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</button>\n\t\t\t\t{/each}\n\t\t\t\t{#if split.generated.length > 0}\n\t\t\t\t\t<Button variant=\"ghost\" size=\"sm\" class=\"more\" onclick={() => (showGenerated = !showGenerated)}>\n\t\t\t\t\t\t{showGenerated ? 'Hide generated' : `+ ${split.generated.length} generated (show)`}\n\t\t\t\t\t</Button>\n\t\t\t\t{/if}\n\t\t\t</nav>\n\n\t\t\t<section class=\"diff\" aria-label=\"Diff\">\n\t\t\t\t{#if selected}\n\t\t\t\t\t<div class=\"diff-head\">\n\t\t\t\t\t\t<button type=\"button\" class=\"back\" aria-label=\"Back to files\" onclick={() => setParams({ file: null })}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<span class=\"path\" title={selected.file}>{displayPath(selected.file, root)}</span>\n\t\t\t\t\t\t<span class=\"sp\"></span>\n\t\t\t\t\t\t{#if hunkCount}<span class=\"dim\">{hunkCount} {hunkCount === 1 ? 'hunk' : 'hunks'}</span>{/if}\n\t\t\t\t\t</div>\n\t\t\t\t\t{#if shownError}\n\t\t\t\t\t\t<p class=\"msg err\">{shownError}</p>\n\t\t\t\t\t{:else if shownDiff?.binary}\n\t\t\t\t\t\t<p class=\"msg\">Binary file; no text diff.</p>\n\t\t\t\t\t{:else if rows.length > 0}\n\t\t\t\t\t\t<div class=\"lines\">\n\t\t\t\t\t\t\t{#each rows as row, i (i)}\n\t\t\t\t\t\t\t\t{#if row.type === 'hunk'}\n\t\t\t\t\t\t\t\t\t<div class=\"hunk\">{row.header}</div>\n\t\t\t\t\t\t\t\t{:else if row.type === 'gap'}\n\t\t\t\t\t\t\t\t\t<div class=\"gap\">⋯ {row.count} unchanged {row.count === 1 ? 'line' : 'lines'} ⋯</div>\n\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t<div class=\"ln {row.type}\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"no\">{row.old ?? ''}</span><span class=\"no\">{row.new ?? ''}</span><span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"sign\">{SIGN[row.type]}</span\n\t\t\t\t\t\t\t\t\t\t><!-- eslint-disable-next-line svelte/no-at-html-tags -- highlight.js escapes the text it colours --><span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"code\">{#if painted?.[i] != null}{@html painted[i]}{:else}{row.text}{/if}</span\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{:else if diff}\n\t\t\t\t\t\t<p class=\"msg\">No line changes.</p>\n\t\t\t\t\t{/if}\n\t\t\t\t{:else}\n\t\t\t\t\t<p class=\"msg\">That file has no change here.</p>\n\t\t\t\t{/if}\n\t\t\t</section>\n\t\t</div>\n\t{/if}\n\t<div class=\"foot\"><kbd>j</kbd>/<kbd>k</kbd> next / previous file</div>\n</div>\n\n<style>\n\t.changes {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\t.mono,\n\tnav,\n\t.diff,\n\t.turns {\n\t\tfont-family: var(--font-mono);\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\tpadding: 10px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.title {\n\t\tfont-size: 13.5px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t\tdisplay: inline-flex;\n\t\tgap: 10px;\n\t\talign-items: baseline;\n\t}\n\t.title .mono {\n\t\tfont-size: 12px;\n\t\tfont-weight: 400;\n\t}\n\t.sp {\n\t\tflex: 1;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 30px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.turns {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t\tpadding: 8px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t\tscrollbar-width: thin;\n\t}\n\t.turns :global(.chip) {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 28px;\n\t\tpadding: 0 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.turns :global(.chip:hover) {\n\t\tcolor: #f5f5f4;\n\t}\n\t.turns :global(.chip[data-state='on']) {\n\t\tborder-color: #3f3f46;\n\t\tbackground: #232326;\n\t\tcolor: #f5f5f4;\n\t}\n\t.turn-note {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\tpadding: 6px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tfont-size: 12px;\n\t\tcolor: #a8a29e;\n\t\tflex: none;\n\t}\n\t.prompt,\n\t.file .path,\n\t.diff-head .path {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.prompt {\n\t\tflex: 1;\n\t}\n\t.turn-note :global(.link) {\n\t\tflex: none;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tpadding: 4px 0;\n\t\tcolor: #93c5fd;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.turn-note :global(.link:hover) {\n\t\ttext-decoration: underline;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.split {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tdisplay: flex;\n\t}\n\tnav {\n\t\twidth: 250px;\n\t\tflex: none;\n\t\toverflow-y: auto;\n\t\tborder-right: 1px solid #222;\n\t\tpadding: 8px 6px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1px;\n\t\tfont-size: 12px;\n\t}\n\t.file {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tmin-height: 32px;\n\t\tpadding: 0 8px;\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.file:hover {\n\t\tbackground: #1a1a1a;\n\t}\n\t.file.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.file.untracked {\n\t\tcolor: #78716c;\n\t}\n\t.file .path {\n\t\tflex: 1;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t}\n\t.st {\n\t\twidth: 10px;\n\t\tflex: none;\n\t}\n\t.st-m,\n\t.st-r {\n\t\tcolor: #fbbf24;\n\t}\n\t.st-a {\n\t\tcolor: #4ade80;\n\t}\n\t.st-d {\n\t\tcolor: #f87171;\n\t}\n\t.st-u {\n\t\tcolor: #78716c;\n\t}\n\tnav :global(.more) {\n\t\tborder: 0;\n\t\tbackground: none;\n\t\ttext-align: left;\n\t\tpadding: 9px 8px 4px;\n\t\tmin-height: 32px;\n\t\tcolor: #78716c;\n\t\tfont: inherit;\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t}\n\tnav :global(.more:hover) {\n\t\tcolor: #d6d3d1;\n\t}\n\t.add {\n\t\tcolor: #4ade80;\n\t}\n\t.del {\n\t\tcolor: #f87171;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.diff {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-size: 12px;\n\t}\n\t.diff-head {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\tpadding: 8px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tflex: none;\n\t\twidth: 44px;\n\t\theight: 44px;\n\t\tmargin: -8px 0 -8px -12px;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 18px;\n\t\tcursor: pointer;\n\t}\n\t.lines {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 6px 0 16px;\n\t\tline-height: 1.65;\n\t}\n\t.hunk {\n\t\tpadding: 2px 14px;\n\t\tcolor: #78716c;\n\t\tbackground: #161616;\n\t\twhite-space: pre;\n\t}\n\t.gap {\n\t\tpadding: 3px 14px;\n\t\tcolor: #78716c;\n\t\tbackground: #141414;\n\t\ttext-align: center;\n\t}\n\t.ln {\n\t\tdisplay: flex;\n\t\twidth: max-content;\n\t\tmin-width: 100%;\n\t\tcolor: #a8a29e;\n\t}\n\t.ln.add {\n\t\tbackground: #0f2417;\n\t\tcolor: #bbf7d0;\n\t}\n\t.ln.del {\n\t\tbackground: #2a1215;\n\t\tcolor: #fecaca;\n\t}\n\t.no {\n\t\tflex: none;\n\t\twidth: 4ch;\n\t\tpadding-right: 1ch;\n\t\ttext-align: right;\n\t\tcolor: #57534e;\n\t\tuser-select: none;\n\t}\n\t.sign {\n\t\tflex: none;\n\t\twidth: 2ch;\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t}\n\t.ln.add .sign {\n\t\tcolor: #4ade80;\n\t}\n\t.ln.del .sign {\n\t\tcolor: #f87171;\n\t}\n\t.code {\n\t\twhite-space: pre;\n\t\tpadding-right: 14px;\n\t}\n\t/* highlight.js tokens, muted so the add/del backgrounds still lead. */\n\t.code :global(.hljs-keyword),\n\t.code :global(.hljs-built_in),\n\t.code :global(.hljs-literal),\n\t.code :global(.hljs-selector-tag) {\n\t\tcolor: #c4b5fd;\n\t}\n\t.code :global(.hljs-string),\n\t.code :global(.hljs-regexp),\n\t.code :global(.hljs-attr),\n\t.code :global(.hljs-selector-attr) {\n\t\tcolor: #fcd34d;\n\t}\n\t.code :global(.hljs-number),\n\t.code :global(.hljs-symbol) {\n\t\tcolor: #fdba74;\n\t}\n\t.code :global(.hljs-comment),\n\t.code :global(.hljs-meta) {\n\t\tcolor: #78716c;\n\t\tfont-style: italic;\n\t}\n\t.code :global(.hljs-title),\n\t.code :global(.hljs-function),\n\t.code :global(.hljs-section) {\n\t\tcolor: #93c5fd;\n\t}\n\t.code :global(.hljs-type),\n\t.code :global(.hljs-class),\n\t.code :global(.hljs-name),\n\t.code :global(.hljs-selector-class) {\n\t\tcolor: #5eead4;\n\t}\n\t.code :global(.hljs-variable),\n\t.code :global(.hljs-template-variable),\n\t.code :global(.hljs-property) {\n\t\tcolor: #f9a8d4;\n\t}\n\t.foot {\n\t\tflex: none;\n\t\tpadding: 8px 14px;\n\t\tborder-top: 1px solid #222;\n\t\tfont-size: 11.5px;\n\t\tcolor: #78716c;\n\t}\n\tkbd {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 10.5px;\n\t\tpadding: 0 4px;\n\t\tborder-radius: 4px;\n\t\tbackground: #1f1f1f;\n\t\tcolor: #a8a29e;\n\t}\n\n\t/* Too narrow for both: the list, or the picked file's diff with a way back. */\n\t@container (max-width: 38rem) {\n\t\tnav {\n\t\t\twidth: auto;\n\t\t\tflex: 1;\n\t\t\tborder-right: 0;\n\t\t}\n\t\t.diff {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.picked .diff {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.foot {\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* A finger needs room. */\n\t\t.file,\n\t\tnav :global(.more),\n\t\t.turns :global(.chip),\n\t\t.turn-note :global(.link) {\n\t\t\tmin-height: 44px;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.file,\n\t\tnav :global(.more),\n\t\t.turns :global(.chip),\n\t\t.turn-note :global(.link) {\n\t\t\tmin-height: 44px;\n\t\t}\n\t\t.seg :global([data-slot='toggle']) {\n\t\t\theight: 40px;\n\t\t}\n\t}\n</style>\n","export function cn(...classes) {\n return classes.filter(Boolean).join(' ');\n}\nexport const isBrowser = typeof document !== 'undefined';\n","import { isBrowser } from './internal/helpers.js';\nimport { sonnerContext } from './internal/ctx.js';\nimport { untrack } from 'svelte';\nlet toastsCounter = 0;\n// A toast keeps the id it was given, otherwise it gets the next one from the counter.\n// `custom` needs the same id `create` would pick, as it hands it to the component.\nfunction getToastId(data) {\n return typeof data?.id === 'number' || (typeof data?.id === 'string' && data.id.length > 0)\n ? data.id\n : toastsCounter++;\n}\nclass ToastState {\n toasts = $state([]);\n heights = $state([]);\n // Removals whose exit animation is running but whose entry hasn't been removed yet\n #pendingRemovals = new Map();\n #findToastIdx = (id) => {\n const idx = this.toasts.findIndex((toast) => toast.id === id);\n if (idx === -1)\n return null;\n return idx;\n };\n #findHeightIdx = (toastId) => this.heights.findIndex((height) => height.toastId === toastId);\n addToast = (data) => {\n if (!isBrowser)\n return;\n this.toasts.unshift(data);\n };\n updateToast = ({ id, data, type, message }) => {\n const toastIdx = this.toasts.findIndex((toast) => toast.id === id);\n const toastToUpdate = this.toasts[toastIdx];\n this.toasts[toastIdx] = {\n ...toastToUpdate,\n ...data,\n id,\n title: message,\n type,\n // A dismissal that hasn't been processed yet gets cancelled: the toast is\n // still on screen, so this is an update of it rather than a new toast.\n dismiss: false,\n delete: false,\n updated: true\n };\n };\n // Flags a toast that was dismissed from inside the Toast component (close button,\n // swipe, action/cancel click, auto-close) so `create` treats an id reuse as a new\n // toast instead of merging the old props into it.\n markDismissed = (id) => {\n const toastIdx = this.#findToastIdx(id);\n if (toastIdx === null)\n return;\n const toast = this.toasts[toastIdx];\n if (!toast)\n return;\n if (!toast.dismiss || !toast.delete) {\n this.toasts[toastIdx] = { ...toast, dismiss: true, delete: true };\n }\n };\n scheduleRemoval = (id, delay) => {\n this.cancelRemoval(id);\n this.#pendingRemovals.set(id, setTimeout(() => {\n this.#pendingRemovals.delete(id);\n this.remove(id);\n }, delay));\n };\n cancelRemoval = (id) => {\n const timeout = this.#pendingRemovals.get(id);\n if (timeout !== undefined) {\n clearTimeout(timeout);\n this.#pendingRemovals.delete(id);\n }\n };\n create = (data) => {\n const { message, ...rest } = data;\n const id = getToastId(data);\n // Support deprecated `dismissable` as a fallback for backwards compatibility\n const dismissible = data.dismissible !== undefined\n ? data.dismissible\n : data.dismissable !== undefined\n ? data.dismissable\n : true;\n const type = data.type === undefined ? 'default' : data.type;\n untrack(() => {\n // A removal that hasn't run yet gets cancelled: this create() supersedes it,\n // otherwise the old toast's unmount timeout would remove the new one.\n this.cancelRemoval(id);\n const alreadyExists = this.toasts.find((toast) => toast.id === id);\n if (alreadyExists?.dismiss || alreadyExists?.delete) {\n // The previous toast with this id was dismissed, so this is a brand new\n // toast. Drop the old one instead of merging into it, otherwise its\n // props (e.g. `action`) leak into the new one. `updated` makes the still\n // mounted component reset its auto-close timer: when the recreate happens\n // in the same tick as the dismissal, the keyed each reuses the component\n // before it ever processed the dismissal, so the old timer would\n // otherwise keep running.\n this.remove(id);\n this.addToast({\n ...rest,\n id,\n title: message,\n dismissible,\n type,\n updated: true\n });\n }\n else if (alreadyExists) {\n this.updateToast({ id, data, type, message, dismissible });\n }\n else {\n this.addToast({ ...rest, id, title: message, dismissible, type });\n }\n });\n return id;\n };\n dismiss = (id) => {\n untrack(() => {\n if (id === undefined) {\n // we're dismissing all the active toasts\n this.toasts = this.toasts.map((toast) => toast.dismiss ? toast : { ...toast, dismiss: true });\n return;\n }\n // we're dismissing a specific toast\n const toastIdx = this.toasts.findIndex((toast) => toast.id === id);\n if (this.toasts[toastIdx]) {\n this.toasts[toastIdx] = { ...this.toasts[toastIdx], dismiss: true };\n }\n });\n return id;\n };\n remove = (id) => {\n if (id === undefined) {\n // remove all toasts\n this.toasts = [];\n return;\n }\n // remove a specific toast\n const toastIdx = this.#findToastIdx(id);\n if (toastIdx === null)\n return;\n this.toasts.splice(toastIdx, 1);\n return id;\n };\n message = (message, data) => {\n return this.create({ ...data, type: 'default', message });\n };\n error = (message, data) => {\n return this.create({ ...data, type: 'error', message });\n };\n success = (message, data) => {\n return this.create({ ...data, type: 'success', message });\n };\n info = (message, data) => {\n return this.create({ ...data, type: 'info', message });\n };\n warning = (message, data) => {\n return this.create({ ...data, type: 'warning', message });\n };\n loading = (message, data) => {\n return this.create({ ...data, type: 'loading', message });\n };\n promise = (promise, data) => {\n if (!data) {\n // Nothing to show\n return;\n }\n let id = undefined;\n if (data.loading !== undefined) {\n id = this.create({\n ...data,\n promise,\n type: 'loading',\n message: typeof data.loading === 'string' ? data.loading : data.loading()\n });\n }\n const p = promise instanceof Promise ? promise : promise();\n let shouldDismiss = id !== undefined;\n p.then((response) => {\n if (typeof response === 'object' &&\n response &&\n 'ok' in response &&\n typeof response.ok === 'boolean' &&\n !response.ok) {\n shouldDismiss = false;\n const message = constructPromiseErrorMessage(response);\n this.create({ id, type: 'error', message });\n }\n else if (data.success !== undefined) {\n shouldDismiss = false;\n const message = typeof data.success === 'function' ? data.success(response) : data.success;\n this.create({ id, type: 'success', message });\n }\n })\n .catch((error) => {\n if (data.error !== undefined) {\n shouldDismiss = false;\n const message = typeof data.error === 'function' ? data.error(error) : data.error;\n this.create({ id, type: 'error', message });\n }\n })\n .finally(() => {\n if (shouldDismiss) {\n // Toast is still in load state (and will be indefinitely — dismiss it)\n this.dismiss(id);\n id = undefined;\n }\n data.finally?.();\n });\n return id;\n };\n custom = (component, data) => {\n const id = getToastId(data);\n this.create({ component, ...data, id });\n return id;\n };\n removeHeight = (id) => {\n this.heights = this.heights.filter((height) => height.toastId !== id);\n };\n setHeight = (data) => {\n // untrack: setHeight runs inside a $effect; a tracked read of this.heights\n // would re-trigger it on the write below (effect_update_depth_exceeded).\n untrack(() => {\n const heightIdx = this.#findHeightIdx(data.toastId);\n if (heightIdx !== -1) {\n this.heights[heightIdx] = data;\n return;\n }\n // The offset math and --front-toast-height assume heights share the\n // newest-first order of `toasts`, so insert at the matching position.\n // With batched mounts (several toasts created in one tick, or created\n // before the Toaster mounted) the components mount newest-first and a\n // plain unshift would reverse them.\n const order = new Map(this.toasts.map((toast, idx) => [toast.id, idx]));\n const toastOrder = order.get(data.toastId) ?? -1;\n const insertIdx = this.heights.findIndex((height) => (order.get(height.toastId) ?? Infinity) > toastOrder);\n if (insertIdx === -1) {\n this.heights.push(data);\n }\n else {\n this.heights.splice(insertIdx, 0, data);\n }\n });\n };\n reset = () => {\n this.toasts = [];\n this.heights = [];\n this.#pendingRemovals.forEach((timeout) => clearTimeout(timeout));\n this.#pendingRemovals.clear();\n };\n}\nfunction constructPromiseErrorMessage(response) {\n if (response && typeof response === 'object' && 'status' in response) {\n return `HTTP error! Status: ${response.status}`;\n }\n return `Error! ${response}`;\n}\nexport const toastState = new ToastState();\nfunction toastFunction(message, data) {\n return toastState.message(message, data);\n}\nexport class SonnerState {\n /**\n * A derived state of the toasts that are not dismissed.\n */\n #activeToasts = $derived(toastState.toasts.filter((toast) => !toast.dismiss));\n get toasts() {\n return this.#activeToasts;\n }\n}\n/**\n * A hook to get a reference to the sonner toast state.\n *\n * Returns a class instance a getter for the `toasts` array.\n *\n * @example\n * ```svelte\n * <script lang=\"ts\">\n * import { useSonner } from 'svelte-sonner';\n *\n * const sonner = useSonner();\n *\n * // Reactive access to the toasts\n * $effect(() => console.log(sonner.toasts))\n * </script>\n * ```\n */\nexport function useSonner() {\n return sonnerContext.get();\n}\nconst basicToast = toastFunction;\nexport const toast = Object.assign(basicToast, {\n success: toastState.success,\n info: toastState.info,\n warning: toastState.warning,\n error: toastState.error,\n custom: toastState.custom,\n message: toastState.message,\n promise: toastState.promise,\n dismiss: toastState.dismiss,\n loading: toastState.loading,\n getActiveToasts: () => {\n return toastState.toasts.filter((toast) => !toast.dismiss);\n }\n});\n","/**\n * Syntax colouring for the Files pane, loaded the first time a file is shown\n * so the session page does not carry Shiki until the pane is opened. The\n * fine-grained build: Shiki's core, its JavaScript regex engine (no WASM),\n * one theme, and a grammar only when a file of that language is opened.\n * Anything else is drawn plain.\n */\nimport type { HighlighterCore, LanguageRegistration, ThemedToken } from 'shiki/core';\n\ntype Grammar = () => Promise<{ default: LanguageRegistration[] }>;\n\nconst GRAMMARS: Record<string, Grammar> = {\n\ttypescript: () => import('shiki/langs/typescript.mjs'),\n\ttsx: () => import('shiki/langs/tsx.mjs'),\n\tjavascript: () => import('shiki/langs/javascript.mjs'),\n\tjsx: () => import('shiki/langs/jsx.mjs'),\n\tsvelte: () => import('shiki/langs/svelte.mjs'),\n\thtml: () => import('shiki/langs/html.mjs'),\n\txml: () => import('shiki/langs/xml.mjs'),\n\tcss: () => import('shiki/langs/css.mjs'),\n\tscss: () => import('shiki/langs/scss.mjs'),\n\tjson: () => import('shiki/langs/json.mjs'),\n\tjsonc: () => import('shiki/langs/jsonc.mjs'),\n\tmarkdown: () => import('shiki/langs/markdown.mjs'),\n\tpython: () => import('shiki/langs/python.mjs'),\n\tshellscript: () => import('shiki/langs/shellscript.mjs'),\n\tyaml: () => import('shiki/langs/yaml.mjs'),\n\ttoml: () => import('shiki/langs/toml.mjs'),\n\trust: () => import('shiki/langs/rust.mjs'),\n\tgo: () => import('shiki/langs/go.mjs'),\n\tsql: () => import('shiki/langs/sql.mjs'),\n\tdiff: () => import('shiki/langs/diff.mjs'),\n\tdocker: () => import('shiki/langs/docker.mjs'),\n\tmake: () => import('shiki/langs/make.mjs')\n};\n\nconst THEME = 'github-dark-default';\n\n/** Text longer than this is drawn plain: tokenizing it would stall the page. */\nconst HIGHLIGHT_LIMIT_CHARS = 400_000;\n\nlet core: Promise<HighlighterCore> | null = null;\n\nfunction highlighter(): Promise<HighlighterCore> {\n\treturn (core ??= (async () => {\n\t\tconst [{ createHighlighterCore }, { createJavaScriptRegexEngine }, theme] = await Promise.all([\n\t\t\timport('shiki/core'),\n\t\t\timport('shiki/engine/javascript'),\n\t\t\timport('shiki/themes/github-dark-default.mjs')\n\t\t]);\n\t\treturn createHighlighterCore({ themes: [theme.default], langs: [], engine: createJavaScriptRegexEngine() });\n\t})());\n}\n\n/**\n * Each line's tokens with their colours, or null when the language is not one\n * this loads or the text is too long (the caller then draws it plain).\n */\nexport async function highlightFile(text: string, language: string | null): Promise<ThemedToken[][] | null> {\n\tif (!language || !GRAMMARS[language] || text.length > HIGHLIGHT_LIMIT_CHARS) return null;\n\tconst shiki = await highlighter();\n\tif (!shiki.getLoadedLanguages().includes(language)) await shiki.loadLanguage((await GRAMMARS[language]()).default);\n\treturn shiki.codeToTokens(text, { lang: language, theme: THEME }).tokens;\n}\n","import { createPersisted } from './persisted';\n\n/** What the Files pane keeps per session between visits; the URL holds the open file. */\nexport interface FilesPrefs {\n\t/** Directories open in the tree, relative to the project root. */\n\texpanded?: string[];\n\t/** The file last open, which the pane reopens when the URL names none. */\n\tfile?: string;\n\t/** List the entries git ignores. */\n\tshowIgnored?: boolean;\n}\n\nconst persisted = createPersisted<Record<string, FilesPrefs>>('claude-mux-files-pane', {});\n\n/** The Files pane's per-session preferences, keyed by session id: a pane target is reused by later sessions. */\nclass FilesPaneStore {\n\tprivate state = $state<Record<string, FilesPrefs>>(persisted.load());\n\n\tget(id: string | null): FilesPrefs {\n\t\treturn (id && this.state[id]) || {};\n\t}\n\n\tupdate(id: string | null, patch: FilesPrefs): void {\n\t\tif (!id) return;\n\t\tthis.state[id] = { ...this.state[id], ...patch };\n\t\tpersisted.save(this.state);\n\t}\n}\n\nexport const filesPaneStore = new FilesPaneStore();\n","<script lang=\"ts\">\n\t/**\n\t * The session's project, read-only: a tree on the left, the open file on\n\t * the right. With no file open the tree takes the whole pane; once one is,\n\t * the tree narrows to a column docked inside the viewer, and on a narrow\n\t * pane the two take turns.\n\t *\n\t * The URL holds the file (`file`, relative to the project root) and the\n\t * line to show (`line`). Which directories are open, the last file, and\n\t * whether ignored entries are listed persist per session. Shiki loads the\n\t * first time a file is drawn.\n\t */\n\timport { untrack } from 'svelte';\n\timport { toast } from 'svelte-sonner';\n\timport type { ThemedToken } from 'shiki/core';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Input } from '$lib/components/ui/input';\n\timport {\n\t\tancestors,\n\t\tfuzzyFilter,\n\t\tisMarkdown,\n\t\tshikiLanguage,\n\t\ttype DirListing,\n\t\ttype FileEntry,\n\t\ttype FileRead\n\t} from '$lib/side-panel/files';\n\timport { displayPath } from '$lib/side-panel/changes';\n\timport { highlightFile } from '$lib/side-panel/shiki';\n\timport { renderMarkdown } from '$lib/markdown';\n\timport { filesPaneStore } from '$lib/stores/filesPane.svelte';\n\n\tlet { session, params, setParams, setActions, mention, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\tconst api = $derived(sessionId ? `/api/sessions/${encodeURIComponent(sessionId)}/files` : null);\n\tconst prefs = $derived(filesPaneStore.get(sessionId));\n\tconst showIgnored = $derived(prefs.showIgnored === true);\n\t// Only paths inside the root belong here; an older build could save others.\n\tconst expanded = $derived(new Set((prefs.expanded ?? []).filter((d) => d && !d.startsWith('/'))));\n\n\t// ── the tree ─────────────────────────────────────────────────────────\n\n\ttype DirState = DirListing | { error: string } | 'loading';\n\tlet dirs = $state<Record<string, DirState>>({});\n\t/** Bumped by a reload or the ignored toggle, so answers for the old tree are dropped. */\n\tlet treeEpoch = 0;\n\n\tasync function loadDir(dir: string) {\n\t\tif (!api) return;\n\t\tconst epoch = treeEpoch;\n\t\tdirs[dir] = 'loading';\n\t\tconst q = new URLSearchParams({ dir });\n\t\tif (showIgnored) q.set('ignored', '1');\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/tree?${q}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (epoch !== treeEpoch) return;\n\t\t\tdirs[dir] = res.ok ? (body as DirListing) : { error: body.error ?? `HTTP ${res.status}` };\n\t\t} catch (err) {\n\t\t\tif (epoch === treeEpoch) dirs[dir] = { error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\tfunction reloadTree() {\n\t\ttreeEpoch++;\n\t\tdirs = {};\n\t\tvoid loadDir('');\n\t\tfor (const dir of expanded) void loadDir(dir);\n\t}\n\n\tconst rootListing = $derived.by(() => {\n\t\tconst r = dirs[''];\n\t\treturn r && r !== 'loading' && 'entries' in r ? r : null;\n\t});\n\tconst root = $derived(rootListing?.root ?? null);\n\tconst repo = $derived(rootListing?.repo ?? false);\n\n\t/** What the tree was last read for; showing the pane again reuses it, Reload reads it afresh. */\n\tlet readFor: string | null = null;\n\t$effect(() => {\n\t\tconst key = `${api}\\0${showIgnored}`;\n\t\tif (!active || !api || key === readFor) return;\n\t\treadFor = key;\n\t\tuntrack(reloadTree);\n\t});\n\n\tfunction setExpanded(dir: string, open: boolean) {\n\t\tconst next = new Set(expanded);\n\t\tif (open) next.add(dir);\n\t\telse next.delete(dir);\n\t\tfilesPaneStore.update(sessionId, { expanded: [...next] });\n\t\tif (open && !dirs[dir]) void loadDir(dir);\n\t}\n\n\tfunction toggleIgnored() {\n\t\tfilesPaneStore.update(sessionId, { showIgnored: !showIgnored });\n\t}\n\n\t// ── the open file ────────────────────────────────────────────────────\n\n\t/** The file the URL names, made relative when it is an absolute path inside the root. */\n\tconst wantedFile = $derived(params.file ? displayPath(params.file, root) : null);\n\tconst wantedLine = $derived.by(() => {\n\t\tconst n = Number(params.line);\n\t\treturn Number.isInteger(n) && n > 0 ? n : null;\n\t});\n\n\t// No file in the URL: reopen the one last open here.\n\tlet restored = false;\n\t$effect(() => {\n\t\tif (!active || restored) return;\n\t\trestored = true;\n\t\tconst last = untrack(() => prefs.file);\n\t\tif (!params.file && last) setParams({ file: last });\n\t});\n\n\ttype Shown = { path: string; read: FileRead } | { path: string; error: string; binary?: boolean };\n\tlet shown = $state<Shown | null>(null);\n\tlet fileSeq = 0;\n\n\tasync function loadFile(path: string) {\n\t\tif (!api) return;\n\t\tconst mine = ++fileSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/read?${new URLSearchParams({ path })}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== fileSeq) return;\n\t\t\tif (!res.ok) {\n\t\t\t\tshown = { path, error: body.error ?? `HTTP ${res.status}`, binary: body.binary === true };\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst read = body as FileRead;\n\t\t\tshown = { path, read };\n\t\t\t// An absolute or roundabout spelling settles on the path inside the root.\n\t\t\tif (read.path !== path) {\n\t\t\t\tfileReadFor = `${read.path}\\0${params.line ?? ''}`;\n\t\t\t\tsetParams({ file: read.path });\n\t\t\t}\n\t\t\trevealInTree(read.path);\n\t\t\tfilesPaneStore.update(sessionId, { file: read.path });\n\t\t} catch (err) {\n\t\t\tif (mine === fileSeq) shown = { path, error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\t/**\n\t * What the file was last read for: its path and the line asked. A link\n\t * that names the open file again (after Claude edited it, say) reads it\n\t * afresh rather than scrolling stale text; showing the pane again does not.\n\t */\n\tlet fileReadFor: string | null = null;\n\t$effect(() => {\n\t\tconst path = wantedFile;\n\t\tif (!path || !active) return;\n\t\tconst key = `${path}\\0${params.line ?? ''}`;\n\t\tif (key === fileReadFor) return;\n\t\tfileReadFor = key;\n\t\tuntrack(() => void loadFile(path));\n\t});\n\n\t/** Open the directories that hold `path` (inside the root), so the tree shows where it is. */\n\tfunction revealInTree(path: string) {\n\t\tconst missing = ancestors(path).filter((d) => !expanded.has(d));\n\t\tif (missing.length === 0) return;\n\t\tfilesPaneStore.update(sessionId, { expanded: [...expanded, ...missing] });\n\t\tfor (const d of missing) if (!dirs[d]) void loadDir(d);\n\t}\n\n\tconst current = $derived(\n\t\tshown && wantedFile && (shown.path === wantedFile || ('read' in shown && shown.read.path === wantedFile))\n\t\t\t? shown\n\t\t\t: null\n\t);\n\tconst read = $derived(current && 'read' in current ? current.read : null);\n\tconst openPath = $derived(read?.path ?? wantedFile);\n\n\tfunction openFile(path: string, line?: number) {\n\t\tsetParams({ file: path, line: line ? String(line) : null }, { push: true });\n\t}\n\n\tfunction closeFile() {\n\t\tfilesPaneStore.update(sessionId, { file: undefined });\n\t\tsetParams({ file: null, line: null });\n\t}\n\n\t/** Markdown opens rendered; this flips the open file to its source. */\n\tlet mdSource = $state(false);\n\tconst markdown = $derived(read?.kind === 'text' && isMarkdown(read.path));\n\tconst rendered = $derived(markdown && !mdSource && wantedLine === null);\n\n\tconst lines = $derived(read?.kind === 'text' ? read.text.replace(/\\n$/, '').split('\\n') : []);\n\tlet tokens = $state<ThemedToken[][] | null>(null);\n\t$effect(() => {\n\t\ttokens = null;\n\t\tif (read?.kind !== 'text' || rendered) return;\n\t\tconst { text, path } = read;\n\t\tlet stale = false;\n\t\tvoid highlightFile(text, shikiLanguage(path)).then((t) => {\n\t\t\tif (!stale) tokens = t;\n\t\t});\n\t\treturn () => (stale = true);\n\t});\n\n\t/** Lines are drawn in blocks the browser may skip laying out while off screen. */\n\tconst CHUNK = 200;\n\tconst chunks = $derived(\n\t\tArray.from({ length: Math.ceil(lines.length / CHUNK) }, (_, i) => i * CHUNK)\n\t);\n\n\tlet codeEl = $state<HTMLElement | null>(null);\n\t$effect(() => {\n\t\tconst line = wantedLine;\n\t\tif (!line || !codeEl || lines.length === 0) return;\n\t\tvoid tokens;\n\t\trequestAnimationFrame(() =>\n\t\t\tcodeEl?.querySelector(`[data-line=\"${line}\"]`)?.scrollIntoView({ block: 'center' })\n\t\t);\n\t});\n\n\tfunction pickLine(n: number) {\n\t\tsetParams({ line: wantedLine === n ? null : String(n) });\n\t}\n\n\tasync function copyPath() {\n\t\tif (!openPath) return;\n\t\tconst text = wantedLine ? `${openPath}:${wantedLine}` : openPath;\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\ttoast.success('Path copied', { description: text });\n\t\t} catch {\n\t\t\ttoast.error('Could not copy the path');\n\t\t}\n\t}\n\n\t/**\n\t * Claude Code reads an `@path` from the session's cwd, which may sit below\n\t * the root this pane lists from: the path is made relative to the cwd, or\n\t * left absolute when the cwd is not inside the root.\n\t */\n\tfunction mentionOpen() {\n\t\tif (!openPath || !root) return;\n\t\tconst abs = `${root}/${openPath}`;\n\t\tconst cwd = session?.cwd ?? root;\n\t\tmention(`@${cwd === root ? openPath : displayPath(abs, cwd)}`);\n\t}\n\n\tfunction formatSize(bytes: number): string {\n\t\tif (bytes < 1024) return `${bytes} B`;\n\t\tif (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n\t\treturn `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n\t}\n\n\t// ── quick open ───────────────────────────────────────────────────────\n\n\tlet query = $state('');\n\tlet allFiles = $state<string[] | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet listing = false;\n\tlet picked = $state(0);\n\n\tasync function loadAll() {\n\t\tif (allFiles || listing || !api) return;\n\t\tlisting = true;\n\t\tlistError = null;\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/list`);\n\t\t\tconst body = await res.json();\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tallFiles = (body as { files: string[] }).files;\n\t\t} catch (err) {\n\t\t\tlistError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tlisting = false;\n\t\t}\n\t}\n\n\tconst results = $derived(query.trim() && allFiles ? fuzzyFilter(query, allFiles) : []);\n\t$effect(() => {\n\t\tvoid results;\n\t\tpicked = 0;\n\t});\n\n\tfunction openResult(path: string) {\n\t\tquery = '';\n\t\topenFile(path);\n\t}\n\n\tfunction onQueryKey(e: KeyboardEvent) {\n\t\tif (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n\t\t\te.preventDefault();\n\t\t\tconst n = results.length;\n\t\t\tif (n) picked = (picked + (e.key === 'ArrowDown' ? 1 : n - 1)) % n;\n\t\t\tdocument.querySelector(`[data-result=\"${picked}\"]`)?.scrollIntoView({ block: 'nearest' });\n\t\t} else if (e.key === 'Enter' && results[picked]) {\n\t\t\te.preventDefault();\n\t\t\topenResult(results[picked]);\n\t\t} else if (e.key === 'Escape' && query) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tquery = '';\n\t\t}\n\t}\n\n\t// ── header actions ───────────────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t...(repo\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticon: showIgnored ? 'mdi:eye-outline' : 'mdi:eye-off-outline',\n\t\t\t\t\t\t\tlabel: showIgnored ? 'Hide ignored files' : 'Show ignored files',\n\t\t\t\t\t\t\tpressed: showIgnored,\n\t\t\t\t\t\t\trun: toggleIgnored\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId,\n\t\t\t\trun: () => {\n\t\t\t\t\tallFiles = null;\n\t\t\t\t\tif (query.trim()) void loadAll();\n\t\t\t\t\treloadTree();\n\t\t\t\t\tif (wantedFile) void loadFile(wantedFile);\n\t\t\t\t}\n\t\t\t}\n\t\t]);\n\t});\n</script>\n\n{#snippet tree(dir: string, depth: number)}\n\t{@const d = dirs[dir]}\n\t{#if d === 'loading' || d === undefined}\n\t\t<div class=\"note\" style:--depth={depth}>Loading…</div>\n\t{:else if 'error' in d}\n\t\t<div class=\"note err\" style:--depth={depth}>{d.error}</div>\n\t{:else}\n\t\t{#each d.entries as entry (entry.path)}\n\t\t\t{@render node(entry, depth)}\n\t\t{/each}\n\t\t{#if d.entries.length === 0}\n\t\t\t<div class=\"note\" style:--depth={depth}>{d.hidden ? `${d.hidden} ignored` : 'Empty'}</div>\n\t\t{/if}\n\t{/if}\n{/snippet}\n\n{#snippet node(entry: FileEntry, depth: number)}\n\t{#if entry.type === 'dir'}\n\t\t{@const open = expanded.has(entry.path)}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"item dir\"\n\t\t\tclass:ignored={entry.ignored}\n\t\t\tstyle:--depth={depth}\n\t\t\taria-expanded={open}\n\t\t\ttitle={entry.path}\n\t\t\tonclick={() => setExpanded(entry.path, !open)}\n\t\t>\n\t\t\t<iconify-icon class=\"chev\" class:open icon=\"mdi:chevron-right\"></iconify-icon>\n\t\t\t<iconify-icon class=\"ico\" icon={open ? 'mdi:folder-open-outline' : 'mdi:folder-outline'}></iconify-icon>\n\t\t\t<span class=\"name\">{entry.name}</span>\n\t\t\t{#if entry.link}<iconify-icon class=\"link\" icon=\"mdi:link-variant\"></iconify-icon>{/if}\n\t\t</button>\n\t\t{#if open}{@render tree(entry.path, depth + 1)}{/if}\n\t{:else}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"item file\"\n\t\t\tclass:ignored={entry.ignored}\n\t\t\tclass:on={openPath === entry.path}\n\t\t\taria-current={openPath === entry.path ? 'true' : undefined}\n\t\t\tstyle:--depth={depth}\n\t\t\ttitle={entry.path}\n\t\t\tonclick={() => openFile(entry.path)}\n\t\t>\n\t\t\t<span class=\"chev\"></span>\n\t\t\t<iconify-icon class=\"ico\" icon=\"mdi:file-outline\"></iconify-icon>\n\t\t\t<span class=\"name\">{entry.name}</span>\n\t\t\t{#if entry.link}<iconify-icon class=\"link\" icon=\"mdi:link-variant\"></iconify-icon>{/if}\n\t\t</button>\n\t{/if}\n{/snippet}\n\n<div class=\"files\" class:picked={!!wantedFile}>\n\t<nav aria-label=\"Project files\">\n\t\t{#if repo}\n\t\t\t<div class=\"search\">\n\t\t\t\t<iconify-icon icon=\"mdi:magnify\"></iconify-icon>\n\t\t\t\t<Input\n\t\t\t\t\tbind:value={query}\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tplaceholder=\"Go to file…\"\n\t\t\t\t\taria-label=\"Go to file\"\n\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\tspellcheck={false}\n\t\t\t\t\tonfocus={loadAll}\n\t\t\t\t\tonkeydown={onQueryKey}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t{/if}\n\t\t<div class=\"list\">\n\t\t\t{#if query.trim()}\n\t\t\t\t{#if listError}\n\t\t\t\t\t<div class=\"note err\">{listError}</div>\n\t\t\t\t{:else if !allFiles}\n\t\t\t\t\t<div class=\"note\">Loading…</div>\n\t\t\t\t{:else if results.length === 0}\n\t\t\t\t\t<div class=\"note\">No file matches.</div>\n\t\t\t\t{:else}\n\t\t\t\t\t{#each results as path, i (path)}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"item result\"\n\t\t\t\t\t\t\tclass:on={i === picked}\n\t\t\t\t\t\t\tdata-result={i}\n\t\t\t\t\t\t\ttitle={path}\n\t\t\t\t\t\t\tonclick={() => openResult(path)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"name\">{path.split('/').pop()}</span>\n\t\t\t\t\t\t\t<span class=\"dirname\"><bdi>{path.split('/').slice(0, -1).join('/')}</bdi></span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/each}\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\t{#if root}\n\t\t\t\t\t<div class=\"root\" title={root}>{root.split('/').pop() || root}</div>\n\t\t\t\t{/if}\n\t\t\t\t{@render tree('', 0)}\n\t\t\t\t{#if rootListing && !showIgnored && rootListing.hidden > 0}\n\t\t\t\t\t<button type=\"button\" class=\"more\" onclick={toggleIgnored}>\n\t\t\t\t\t\t+ {rootListing.hidden} ignored at the top level (show)\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t{/if}\n\t\t</div>\n\t</nav>\n\n\t{#if wantedFile}\n\t\t<section class=\"viewer\" aria-label=\"File\">\n\t\t\t<div class=\"vhead\">\n\t\t\t\t<button type=\"button\" class=\"icon back\" aria-label=\"Back to files\" onclick={closeFile}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<span class=\"path\" title={openPath}><bdi>{openPath}</bdi></span>\n\t\t\t\t{#if read}<span class=\"dim size\">{formatSize(read.size)}</span>{/if}\n\t\t\t\t{#if markdown}\n\t\t\t\t\t<div class=\"seg\" role=\"group\" aria-label=\"Markdown view\">\n\t\t\t\t\t\t<Toggle\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tbind:pressed={() => rendered, (on) => {\n\t\t\t\t\t\t\t\tif (on) {\n\t\t\t\t\t\t\t\t\tmdSource = false;\n\t\t\t\t\t\t\t\t\tsetParams({ line: null });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}>Preview</Toggle\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<Toggle size=\"sm\" bind:pressed={() => !rendered, (on) => on && (mdSource = true)}>Source</Toggle>\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t\t<button type=\"button\" class=\"icon\" title=\"Copy path\" aria-label=\"Copy path\" onclick={copyPath}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"icon\"\n\t\t\t\t\ttitle=\"Mention in composer\"\n\t\t\t\t\taria-label=\"Mention in composer\"\n\t\t\t\t\tonclick={mentionOpen}\n\t\t\t\t>\n\t\t\t\t\t<iconify-icon icon=\"mdi:at\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<button type=\"button\" class=\"icon wide-only\" title=\"Close file\" aria-label=\"Close file\" onclick={closeFile}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:close\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t{#if read?.kind === 'text' && read.truncated}\n\t\t\t\t<div class=\"banner\">Truncated at 1 MB: showing the first {formatSize(read.shown)} of {formatSize(read.size)}.</div>\n\t\t\t{/if}\n\t\t\t{#if !current}\n\t\t\t\t<p class=\"msg\">Loading…</p>\n\t\t\t{:else if 'error' in current}\n\t\t\t\t<p class=\"msg\" class:err={!current.binary}>\n\t\t\t\t\t{current.binary ? 'Binary file; not shown.' : current.error}\n\t\t\t\t</p>\n\t\t\t{:else if read?.kind === 'image'}\n\t\t\t\t<div class=\"image\">\n\t\t\t\t\t<img src=\"{api}/read?{new URLSearchParams({ path: read.path, raw: '1' })}\" alt={read.path} />\n\t\t\t\t</div>\n\t\t\t{:else if rendered && read?.kind === 'text'}\n\t\t\t\t<!-- eslint-disable-next-line svelte/no-at-html-tags -- markdown output with raw HTML escaped -->\n\t\t\t\t<div class=\"md markdown\">{@html renderMarkdown(read.text)}</div>\n\t\t\t{:else if lines.length === 0}\n\t\t\t\t<p class=\"msg\">Empty file.</p>\n\t\t\t{:else}\n\t\t\t\t<div class=\"code\" bind:this={codeEl} style:--gutter=\"{String(lines.length).length + 1}ch\">\n\t\t\t\t\t{#each chunks as start (start)}\n\t\t\t\t\t\t<div class=\"chunk\" style:--rows={Math.min(CHUNK, lines.length - start)}>\n\t\t\t\t\t\t\t{#each lines.slice(start, start + CHUNK) as text, j (j)}\n\t\t\t\t\t\t\t\t{@const n = start + j + 1}\n\t\t\t\t\t\t\t\t<div class=\"ln\" class:hl={wantedLine === n} data-line={n}>\n\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"no\" tabindex=\"-1\" onclick={() => pickLine(n)}>{n}</button>\n\t\t\t\t\t\t\t\t\t<span class=\"src\"\n\t\t\t\t\t\t\t\t\t\t>{#if tokens?.[n - 1]}{#each tokens[n - 1] as t, k (k)}<span style:color={t.color}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>{t.content}</span\n\t\t\t\t\t\t\t\t\t\t\t\t>{/each}{:else}{text}{/if}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</section>\n\t{/if}\n</div>\n\n<style>\n\t.files {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\tnav {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.picked nav {\n\t\tflex: none;\n\t\twidth: min(22rem, 46%);\n\t\tborder-right: 1px solid #222;\n\t}\n\t.search {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 8px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tcolor: #78716c;\n\t\tflex: none;\n\t}\n\t.search :global(input) {\n\t\theight: 32px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tbackground: #1a1a1a;\n\t\tborder-color: #2a2a2a;\n\t}\n\t.list {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t\tpadding: 6px 6px 16px;\n\t}\n\t.root {\n\t\tpadding: 4px 8px 6px;\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.item {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\twidth: 100%;\n\t\tmin-height: 28px;\n\t\tpadding: 0 8px 0 calc(4px + var(--depth, 0) * 14px);\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.item:hover {\n\t\tbackground: #1a1a1a;\n\t}\n\t.item.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.item.ignored {\n\t\tcolor: #6b6560;\n\t}\n\t.chev {\n\t\tflex: none;\n\t\twidth: 14px;\n\t\tcolor: #78716c;\n\t\ttransition: transform 0.12s;\n\t}\n\t.chev.open {\n\t\ttransform: rotate(90deg);\n\t}\n\t.ico {\n\t\tflex: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 14px;\n\t}\n\t.dir .ico {\n\t\tcolor: #93c5fd;\n\t}\n\t.ignored .ico {\n\t\tcolor: inherit;\n\t\topacity: 0.6;\n\t}\n\t.link {\n\t\tflex: none;\n\t\tcolor: #78716c;\n\t\tfont-size: 12px;\n\t}\n\t.name {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.result {\n\t\tgap: 10px;\n\t\tpadding-left: 8px;\n\t}\n\t.result .name {\n\t\tflex: none;\n\t\tmax-width: 60%;\n\t}\n\t.dirname {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t\tcolor: #78716c;\n\t}\n\t.note {\n\t\tpadding: 5px 8px 5px calc(26px + var(--depth, 0) * 14px);\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.more {\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tpadding: 9px 8px 4px;\n\t\tmin-height: 32px;\n\t\tcolor: #78716c;\n\t\tfont: inherit;\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t\ttext-align: left;\n\t}\n\t.more:hover {\n\t\tcolor: #d6d3d1;\n\t}\n\t.viewer {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t.vhead {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmin-height: 44px;\n\t\tpadding: 6px 8px 6px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.path {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tcolor: #e7e5e4;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.size {\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t}\n\t.icon {\n\t\tflex: none;\n\t\twidth: 30px;\n\t\theight: 30px;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tborder-radius: 7px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 15px;\n\t\tcursor: pointer;\n\t}\n\t.icon:hover {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tmargin-left: -8px;\n\t}\n\t.seg {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 2px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 26px;\n\t\tfont-size: 12px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.banner {\n\t\tflex: none;\n\t\tpadding: 6px 14px;\n\t\tbackground: #2a2110;\n\t\tcolor: #fcd34d;\n\t\tfont-size: 12px;\n\t\tborder-bottom: 1px solid #3a2e14;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.msg.err {\n\t\tcolor: #f87171;\n\t}\n\t.image {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 16px;\n\t\tbackground:\n\t\t\trepeating-conic-gradient(#161616 0 25%, #1c1c1c 0 50%) 0 0 / 16px 16px;\n\t}\n\t.image img {\n\t\tmax-width: 100%;\n\t\theight: auto;\n\t\tdisplay: block;\n\t\tmargin: 0 auto;\n\t}\n\t.md {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 16px 20px 32px;\n\t\tfont-size: 14px;\n\t\tline-height: 1.6;\n\t}\n\t/* A document, not a reply: its headings stand out more than the transcript's. */\n\t.md :global(h1) {\n\t\tfont-size: 1.45em;\n\t\tmargin-top: 4px;\n\t}\n\t.md :global(h2) {\n\t\tfont-size: 1.2em;\n\t\tmargin-top: 20px;\n\t}\n\t.md :global(h3) {\n\t\tfont-size: 1.05em;\n\t}\n\t.code {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 6px 0 24px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tline-height: 1.65;\n\t}\n\t.chunk {\n\t\twidth: max-content;\n\t\tmin-width: 100%;\n\t\tcontent-visibility: auto;\n\t\tcontain-intrinsic-size: auto calc(var(--rows) * 1.65em);\n\t}\n\t.ln {\n\t\tdisplay: flex;\n\t\tcolor: #c9d1d9;\n\t}\n\t.ln.hl {\n\t\tbackground: #2a2a1a;\n\t}\n\t.no {\n\t\tflex: none;\n\t\twidth: calc(var(--gutter) + 1ch);\n\t\tpadding: 0 1.5ch 0 0;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\ttext-align: right;\n\t\tcolor: #57534e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t\tuser-select: none;\n\t}\n\t.no:hover,\n\t.hl .no {\n\t\tcolor: #d6d3d1;\n\t}\n\t.src {\n\t\twhite-space: pre;\n\t\tpadding-right: 14px;\n\t}\n\n\t/* Too narrow for both: the tree, or the open file with a way back. */\n\t@container (max-width: 38rem) {\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.wide-only {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.item,\n\t\t.more {\n\t\t\tmin-height: 40px;\n\t\t}\n\t\t.icon {\n\t\t\twidth: 40px;\n\t\t\theight: 40px;\n\t\t}\n\t}\n</style>\n","/** A hostname or bound address that only this machine can reach. */\nexport function isLoopback(host: string): boolean {\n\tconst h = host.replace(/^\\[|\\]$/g, '').toLowerCase();\n\treturn h === 'localhost' || h.endsWith('.localhost') || h === '::1' || /^(::ffff:)?127\\./.test(h);\n}\n","/**\n * The Web pane's logic, apart from the component: which URL a choice names,\n * and how a URL can be shown from the device the page is open on.\n *\n * claude-mux is usually reached over HTTPS through tailscale serve, so an\n * `http://` page cannot be framed (mixed content), and a `localhost` URL means\n * the phone itself when opened on the phone. A dev server on this machine is\n * therefore framed through its tailscale serve HTTPS mapping when it has one,\n * and otherwise offered in a new tab with the command that would map it.\n */\nimport { isLoopback } from '$shared/utils/loopback.js';\nimport type { DevServer, WebInfo } from '$shared/server/web-preview.js';\n\nexport type { DevServer, FrameCheck, WebInfo } from '$shared/server/web-preview.js';\n\n/** The named choices; anything else in `?url=` is a URL typed by hand. */\nexport type WebChoice = 'prod' | 'dev';\n\n/**\n * The URL a choice names. `dev` falls back to the first dev server found\n * running in the project when `.claude-mux.json` names none.\n */\nexport function choiceUrl(choice: string, info: Pick<WebInfo, 'urls' | 'detected'> | null): string | null {\n\tif (choice === 'prod') return info?.urls.prod ?? null;\n\tif (choice === 'dev') return info?.urls.dev ?? info?.detected[0]?.url ?? null;\n\treturn choice;\n}\n\n/** A URL typed into the bar, given a scheme when it has none. Null when it will not parse. */\nexport function normalizeTyped(text: string): string | null {\n\tconst t = text.trim();\n\tif (!t) return null;\n\tconst hasScheme = /^[a-z][a-z0-9+.-]*:\\/\\//i.test(t);\n\ttry {\n\t\tlet u = new URL(hasScheme ? t : `http://${t}`);\n\t\t// Without a scheme, only this machine is assumed to speak plain HTTP.\n\t\tif (!hasScheme && !pointsHere(u)) u = new URL(`https://${t}`);\n\t\treturn u.protocol === 'http:' || u.protocol === 'https:' ? u.href : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** A URL that points at the machine claude-mux runs on. */\nfunction pointsHere(u: URL): boolean {\n\treturn isLoopback(u.hostname) || u.hostname === '0.0.0.0';\n}\n\nfunction portOf(u: URL): number {\n\treturn Number(u.port || (u.protocol === 'https:' ? 443 : 80));\n}\n\nexport type Embed =\n\t| {\n\t\t\tkind: 'frame';\n\t\t\tsrc: string;\n\t }\n\t| {\n\t\t\tkind: 'card';\n\t\t\t/** Why it cannot be framed from here. */\n\t\t\treason: string;\n\t\t\t/** The URL that opens it in a tab of its own. */\n\t\t\topen: string;\n\t\t\t/** The command that would make it embeddable. */\n\t\t\tcommand?: string;\n\t };\n\nexport interface EmbedContext {\n\t/** Where this page is open: `location`. */\n\tpage: { protocol: string; hostname: string };\n\tserves: WebInfo['serves'];\n\tdetected: DevServer[];\n}\n\n/** How `target` can be shown in the pane from the page in `ctx`. */\nexport function resolveEmbed(target: string, ctx: EmbedContext): Embed {\n\tconst u = new URL(target);\n\tconst pageSecure = ctx.page.protocol === 'https:';\n\tif (!pointsHere(u)) {\n\t\tif (pageSecure && u.protocol === 'http:') {\n\t\t\treturn {\n\t\t\t\tkind: 'card',\n\t\t\t\treason: 'This page is served over HTTPS, and browsers will not frame a plain-HTTP page inside it.',\n\t\t\t\topen: u.href\n\t\t\t};\n\t\t}\n\t\treturn { kind: 'frame', src: u.href };\n\t}\n\n\tconst port = portOf(u);\n\tconst served = ctx.serves[port];\n\tif (served) {\n\t\treturn { kind: 'frame', src: `${served}${u.pathname}${u.search}${u.hash}` };\n\t}\n\t// Opened on the machine itself, localhost is the same machine, and browsers treat it as secure.\n\tif (isLoopback(ctx.page.hostname)) {\n\t\treturn { kind: 'frame', src: u.href.replace('//0.0.0.0', '//localhost') };\n\t}\n\n\t// Whatever name the device reached claude-mux by reaches this machine's other ports too.\n\tconst remote = new URL(u.href);\n\tremote.hostname = ctx.page.hostname;\n\tconst card = { kind: 'card' as const, open: remote.href, command: `tailscale serve --bg --https=${port} http://localhost:${port}` };\n\tif (ctx.detected.find((d) => d.port === port)?.loopbackOnly) {\n\t\treturn {\n\t\t\t...card,\n\t\t\treason: `The server on port ${port} listens on 127.0.0.1 only, so nothing off this machine reaches it. Map it with tailscale serve, or restart it bound to 0.0.0.0.`\n\t\t};\n\t}\n\tif (pageSecure && remote.protocol === 'http:') {\n\t\treturn {\n\t\t\t...card,\n\t\t\treason: `Port ${port} has no tailscale serve HTTPS mapping, and this page, served over HTTPS, cannot frame plain HTTP.`\n\t\t};\n\t}\n\treturn { kind: 'frame', src: remote.href };\n}\n","import { createPersisted } from './persisted';\n\nconst persisted = createPersisted<Record<string, string>>('claude-mux-web-pane', {});\n\n/**\n * The URL the Web pane last showed, per session id: `prod`, `dev`, or a URL\n * typed by hand. The pane reopens it when the page's URL names none.\n */\nclass WebPaneStore {\n\tprivate state = $state<Record<string, string>>(persisted.load());\n\n\tget(id: string | null): string | null {\n\t\treturn (id && this.state[id]) || null;\n\t}\n\n\tset(id: string | null, url: string): void {\n\t\tif (!id || this.state[id] === url) return;\n\t\tthis.state[id] = url;\n\t\tpersisted.save(this.state);\n\t}\n}\n\nexport const webPaneStore = new WebPaneStore();\n","<script lang=\"ts\">\n\t/**\n\t * The project's site in a frame: the prod or dev URL `.claude-mux.json`\n\t * names, a dev server found running inside the project, or a URL typed into\n\t * the bar. The URL holds the choice (`?url=prod|dev|<url>`), and the last\n\t * one persists per session.\n\t *\n\t * A URL on this machine is framed through its tailscale serve mapping when\n\t * it has one, so the phone reaches it too; one that cannot be framed from\n\t * here (mixed content, X-Frame-Options, CSP frame-ancestors) gets a card\n\t * that opens it in a tab of its own instead of a blank frame. Discovery is\n\t * polled only while the pane is showing.\n\t */\n\timport { untrack } from 'svelte';\n\timport { toast } from 'svelte-sonner';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Input } from '$lib/components/ui/input';\n\timport { Button } from '$lib/components/ui/button';\n\timport {\n\t\tchoiceUrl,\n\t\tnormalizeTyped,\n\t\tresolveEmbed,\n\t\ttype FrameCheck,\n\t\ttype WebChoice,\n\t\ttype WebInfo\n\t} from '$lib/side-panel/web';\n\timport { webPaneStore } from '$lib/stores/webPane.svelte';\n\n\tlet { session, params, setParams, setActions, active }: PaneBodyProps = $props();\n\n\t/** How often discovery runs while the pane is showing. */\n\tconst POLL_MS = 5_000;\n\tconst CONFIG_SAMPLE = `{ \"urls\": { \"prod\": \"https://…\", \"dev\": \"http://localhost:5173\" } }`;\n\n\tconst sessionId = $derived(session?.id ?? null);\n\n\t// ── discovery ────────────────────────────────────────────────────────\n\n\tlet info = $state<WebInfo | null>(null);\n\tlet infoError = $state<string | null>(null);\n\tlet infoSeq = 0;\n\n\tasync function loadInfo(id: string) {\n\t\tconst mine = ++infoSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/sessions/${encodeURIComponent(id)}/web`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== infoSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tinfo = body as WebInfo;\n\t\t\tinfoError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === infoSeq) infoError = err instanceof Error ? err.message : String(err);\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tconst id = sessionId;\n\t\tif (!id || !active) return;\n\t\tuntrack(() => void loadInfo(id));\n\t\tconst timer = setInterval(() => {\n\t\t\tif (document.visibilityState === 'visible') void loadInfo(id);\n\t\t}, POLL_MS);\n\t\treturn () => clearInterval(timer);\n\t});\n\n\t// ── the choice ───────────────────────────────────────────────────────\n\n\tconst devConfigured = $derived(!!info?.urls.dev);\n\t/** What to show when neither the URL nor this browser names anything. */\n\tconst fallback = $derived<WebChoice | null>(\n\t\tdevConfigured || info?.detected.length ? 'dev' : info?.urls.prod ? 'prod' : null\n\t);\n\tconst choice = $derived(params.url ?? fallback);\n\tconst target = $derived(choice ? choiceUrl(choice, info) : null);\n\n\t// No URL in the address: put the one last shown here back.\n\tlet restored = false;\n\t$effect(() => {\n\t\tif (!active || restored || !sessionId) return;\n\t\trestored = true;\n\t\tconst last = untrack(() => webPaneStore.get(sessionId));\n\t\tif (!params.url && last) setParams({ url: last });\n\t});\n\n\t$effect(() => {\n\t\tif (params.url) webPaneStore.set(sessionId, params.url);\n\t});\n\n\t/**\n\t * The choices shown before this one, newest last, for Back. A frame on\n\t * another origin keeps its own history out of reach, so Back steps\n\t * through what was picked here rather than through the page's links.\n\t */\n\tlet trail = $state<string[]>([]);\n\n\tfunction choose(next: string) {\n\t\tif (next === choice) return;\n\t\tif (choice) trail = [...trail, choice];\n\t\tsetParams({ url: next });\n\t}\n\n\tfunction goBack() {\n\t\tconst prev = trail.at(-1);\n\t\tif (!prev) return;\n\t\ttrail = trail.slice(0, -1);\n\t\tsetParams({ url: prev });\n\t}\n\n\t// ── the bar ──────────────────────────────────────────────────────────\n\n\tlet typed = $state('');\n\t$effect(() => {\n\t\ttyped = target ?? '';\n\t});\n\n\tfunction submitTyped(e: SubmitEvent) {\n\t\te.preventDefault();\n\t\tconst url = normalizeTyped(typed);\n\t\tif (!url) {\n\t\t\ttoast.error('Not an http(s) URL', { description: typed });\n\t\t\treturn;\n\t\t}\n\t\tconst named = (['prod', 'dev'] as const).find((c) => {\n\t\t\tconst configured = choiceUrl(c, info);\n\t\t\treturn configured !== null && normalizeTyped(configured) === url;\n\t\t});\n\t\tchoose(named ?? url);\n\t}\n\n\t// ── what is drawn ────────────────────────────────────────────────────\n\n\tconst embed = $derived.by(() => {\n\t\tif (!target || !info) return null;\n\t\ttry {\n\t\t\treturn resolveEmbed(target, { page: location, serves: info.serves, detected: info.detected });\n\t\t} catch {\n\t\t\treturn 'invalid' as const;\n\t\t}\n\t});\n\tconst frameSrc = $derived(embed !== 'invalid' && embed?.kind === 'frame' ? embed.src : null);\n\tconst openUrl = $derived(\n\t\tembed === 'invalid' ? null : embed ? (embed.kind === 'frame' ? embed.src : embed.open) : target\n\t);\n\n\t/** The frame check for the frame's URL; until it lands the frame is not drawn. */\n\tlet check = $state<{ src: string; result: FrameCheck } | null>(null);\n\t$effect(() => {\n\t\tconst src = frameSrc;\n\t\tif (!src) return;\n\t\tlet stale = false;\n\t\tconst q = new URLSearchParams({ url: src, origin: location.origin });\n\t\tfetch(`/api/web/frame?${q}`)\n\t\t\t.then((res) => res.json() as Promise<FrameCheck>)\n\t\t\t.catch((err): FrameCheck => ({ embeddable: null, reason: String(err) }))\n\t\t\t.then((result) => {\n\t\t\t\tif (!stale) check = { src, result };\n\t\t\t});\n\t\treturn () => (stale = true);\n\t});\n\tconst verdict = $derived(check && check.src === frameSrc ? check.result : null);\n\t/** Why the target is shown as a card rather than framed, or null to frame it. */\n\tconst blocked = $derived.by((): { reason: string; open: string; command?: string } | null => {\n\t\tif (embed === 'invalid') return null;\n\t\tif (embed?.kind === 'card') return embed;\n\t\tif (embed && verdict?.embeddable === false) {\n\t\t\treturn { reason: `The site forbids framing. ${verdict.reason}`, open: embed.src };\n\t\t}\n\t\treturn null;\n\t});\n\n\tlet reloads = $state(0);\n\n\tfunction reload() {\n\t\tif (frameSrc) reloads++;\n\t\tif (sessionId) void loadInfo(sessionId);\n\t}\n\n\tasync function copy(text: string) {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\ttoast.success('Copied', { description: text });\n\t\t} catch {\n\t\t\ttoast.error('Could not copy');\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{ icon: 'mdi:arrow-left', label: 'Back', disabled: trail.length === 0, run: goBack },\n\t\t\t{ icon: 'mdi:refresh', label: 'Reload', disabled: !sessionId, run: reload },\n\t\t\t{\n\t\t\t\ticon: 'mdi:open-in-new',\n\t\t\t\tlabel: 'Open in new tab',\n\t\t\t\tdisabled: !openUrl,\n\t\t\t\trun: () => openUrl && window.open(openUrl, '_blank', 'noopener,noreferrer')\n\t\t\t}\n\t\t]);\n\t});\n\n\tfunction hostLabel(url: string): string {\n\t\ttry {\n\t\t\treturn new URL(url).host;\n\t\t} catch {\n\t\t\treturn url;\n\t\t}\n\t}\n</script>\n\n<div class=\"web\">\n\t<form class=\"bar\" onsubmit={submitTyped}>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"Site\">\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={!info?.urls.prod}\n\t\t\t\ttitle={info?.urls.prod ?? 'No prod URL in .claude-mux.json'}\n\t\t\t\tbind:pressed={() => choice === 'prod', (on) => on && choose('prod')}>Prod</Toggle\n\t\t\t>\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={!devConfigured && !info?.detected.length}\n\t\t\t\ttitle={info?.urls.dev ?? (info?.detected.length ? 'A dev server found running in the project' : 'No dev server found')}\n\t\t\t\tbind:pressed={() =>\n\t\t\t\t\tchoice === 'dev' || (!devConfigured && !!info?.detected.some((d) => d.url === choice)),\n\t\t\t\t(on) => on && choose('dev')}>Dev</Toggle\n\t\t\t>\n\t\t</div>\n\t\t<Input\n\t\t\tbind:value={typed}\n\t\t\tclass=\"url\"\n\t\t\ttype=\"text\"\n\t\t\tinputmode=\"url\"\n\t\t\tplaceholder=\"Type a URL…\"\n\t\t\taria-label=\"URL\"\n\t\t\tautocomplete=\"off\"\n\t\t\tspellcheck={false}\n\t\t/>\n\t</form>\n\n\t{#if info && !devConfigured && info.detected.length > 0}\n\t\t<div class=\"detected\">\n\t\t\t<span class=\"label\">Detected dev servers</span>\n\t\t\t{#each info.detected as server, i (server.port)}\n\t\t\t\t<Toggle\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclass=\"chip\"\n\t\t\t\t\ttitle={`${server.process} (pid ${server.pid}) · ${server.url}`}\n\t\t\t\t\tbind:pressed={() => target === server.url, (on) => on && choose(i === 0 ? 'dev' : server.url)}\n\t\t\t\t>\n\t\t\t\t\t<span class=\"dot\"></span>:{server.port}\n\t\t\t\t\t<span class=\"proc\">{server.process}</span>\n\t\t\t\t\t{#if server.loopbackOnly}<iconify-icon icon=\"mdi:lock-outline\" title=\"127.0.0.1 only\"></iconify-icon>{/if}\n\t\t\t\t</Toggle>\n\t\t\t{/each}\n\t\t</div>\n\t{/if}\n\n\t<div class=\"view\">\n\t\t{#if infoError && !info}\n\t\t\t<p class=\"msg err\">{infoError}</p>\n\t\t{:else if !info && !params.url}\n\t\t\t<p class=\"msg dim\">Looking for the project's URLs…</p>\n\t\t{:else if !target}\n\t\t\t<div class=\"empty\">\n\t\t\t\t<iconify-icon icon=\"mdi:web-off\"></iconify-icon>\n\t\t\t\t{#if choice === 'prod'}\n\t\t\t\t\t<h3>No prod URL</h3>\n\t\t\t\t\t<p>Name one as <code>urls.prod</code> in <code>.claude-mux.json</code> at the repo root.</p>\n\t\t\t\t{:else if choice === 'dev'}\n\t\t\t\t\t<h3>No dev server running</h3>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tNothing inside <code>{info?.root}</code> is serving HTML. Start the dev server, or name one as\n\t\t\t\t\t\t<code>urls.dev</code> in <code>.claude-mux.json</code>.\n\t\t\t\t\t</p>\n\t\t\t\t{:else}\n\t\t\t\t\t<h3>Nothing to show yet</h3>\n\t\t\t\t\t<p>Type a URL above, start a dev server in the project, or commit a <code>.claude-mux.json</code>:</p>\n\t\t\t\t\t<pre>{CONFIG_SAMPLE}</pre>\n\t\t\t\t{/if}\n\t\t\t\t{#if info?.configError}<p class=\"err\">.claude-mux.json: {info.configError}</p>{/if}\n\t\t\t</div>\n\t\t{:else if embed === 'invalid'}\n\t\t\t<p class=\"msg err\">Not a URL: {target}</p>\n\t\t{:else if !embed}\n\t\t\t<p class=\"msg dim\">Resolving {target}…</p>\n\t\t{:else if blocked}\n\t\t\t{@const command = blocked.command}\n\t\t\t<div class=\"empty card\">\n\t\t\t\t<iconify-icon icon=\"mdi:application-brackets-outline\"></iconify-icon>\n\t\t\t\t<h3>Can't show {hostLabel(blocked.open)} here</h3>\n\t\t\t\t<p>{blocked.reason}</p>\n\t\t\t\t<Button href={blocked.open} target=\"_blank\" rel=\"noopener noreferrer\" size=\"sm\">\n\t\t\t\t\t<iconify-icon icon=\"mdi:open-in-new\"></iconify-icon> Open in new tab\n\t\t\t\t</Button>\n\t\t\t\t{#if command}\n\t\t\t\t\t<p class=\"dim\">To show it here, map the port over HTTPS on this machine:</p>\n\t\t\t\t\t<div class=\"cmd\">\n\t\t\t\t\t\t<code>{command}</code>\n\t\t\t\t\t\t<Button variant=\"ghost\" size=\"icon-sm\" title=\"Copy command\" aria-label=\"Copy command\" onclick={() => copy(command)}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{:else if frameSrc && !verdict}\n\t\t\t<p class=\"msg dim\">Checking {hostLabel(frameSrc)}…</p>\n\t\t{:else if frameSrc}\n\t\t\t{#key `${frameSrc}\\0${reloads}`}\n\t\t\t\t<iframe src={frameSrc} title=\"Web preview\" allow=\"clipboard-read; clipboard-write; fullscreen\"></iframe>\n\t\t\t{/key}\n\t\t{/if}\n\t</div>\n</div>\n\n<style>\n\t.web {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmin-width: 0;\n\t\tcolor: #d6d3d1;\n\t\tfont-size: 13px;\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tpadding: 8px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\tflex: none;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 28px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.bar :global(.url) {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\theight: 34px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.detected {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 7px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t\tscrollbar-width: thin;\n\t}\n\t.label {\n\t\tcolor: #78716c;\n\t\tfont-size: 10.5px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\twhite-space: nowrap;\n\t\tmargin-right: 2px;\n\t}\n\t.detected :global(.chip) {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 26px;\n\t\tpadding: 0 9px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t}\n\t.detected :global(.chip[data-state='on']) {\n\t\tborder-color: #3f3f46;\n\t\tbackground: #232326;\n\t\tcolor: #f5f5f4;\n\t}\n\t.dot {\n\t\twidth: 6px;\n\t\theight: 6px;\n\t\tborder-radius: 50%;\n\t\tbackground: #34d399;\n\t}\n\t.proc {\n\t\tcolor: #78716c;\n\t}\n\t.view {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t}\n\tiframe {\n\t\tflex: 1;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: 0;\n\t\tbackground: #fff;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t}\n\t.empty {\n\t\tmargin: auto;\n\t\tmax-width: 420px;\n\t\tpadding: 24px 20px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\ttext-align: center;\n\t\tline-height: 1.5;\n\t}\n\t.empty > iconify-icon {\n\t\tfont-size: 30px;\n\t\tcolor: #57534e;\n\t}\n\t.empty h3 {\n\t\tmargin: 0;\n\t\tfont-size: 14px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.empty p {\n\t\tmargin: 0;\n\t\tcolor: #a8a29e;\n\t}\n\tcode,\n\tpre {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\tpre {\n\t\tmargin: 0;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 6px;\n\t\tbackground: #1a1a1a;\n\t\twhite-space: pre-wrap;\n\t\tcolor: #a8a29e;\n\t\ttext-align: left;\n\t}\n\t.cmd {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmax-width: 100%;\n\t\tpadding: 6px 6px 6px 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\ttext-align: left;\n\t}\n\t.cmd code {\n\t\tcolor: #e7e5e4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n</style>\n","/**\n * The pane kinds the side panel can show. A pane registers here: its kind\n * (the `?panel=` value), icon, label, the key that toggles it, the URL params\n * it owns, its body component, and when it cannot apply. Its header actions\n * come from the body itself, through `setActions`, since they usually depend\n * on what the body is showing.\n */\nimport type { Component } from 'svelte';\nimport type { Session } from '$lib/stores/sessions.svelte';\nimport type { ChangesInfo } from '$shared/types/ws-messages.js';\nimport ProjectPane from '$lib/components/side-panel/ProjectPane.svelte';\nimport ChangesPane from '$lib/components/side-panel/ChangesPane.svelte';\nimport FilesPane from '$lib/components/side-panel/FilesPane.svelte';\nimport WebPane from '$lib/components/side-panel/WebPane.svelte';\nimport { IS_MAC } from '$lib/constants';\n\nexport interface PaneAction {\n\ticon: string;\n\tlabel: string;\n\trun: () => void;\n\t/** For an action that toggles, whether it is on. */\n\tpressed?: boolean;\n\tdisabled?: boolean;\n}\n\nexport interface PaneBodyProps {\n\tsession: Session | null;\n\ttarget: string;\n\t/** The params this pane owns, as the URL has them. */\n\tparams: Record<string, string>;\n\t/** Change this pane's params; a null value removes one. Replaces the history entry unless `push`. */\n\tsetParams: (own: Record<string, string | null>, opts?: { push?: boolean }) => void;\n\t/** The actions the panel header draws beside the pane's title. */\n\tsetActions: (actions: PaneAction[]) => void;\n\t/** The pane is the one showing; a hidden pane stays mounted but may idle. */\n\tactive: boolean;\n\t/** Put `text` into the session's composer, at the end of the draft. */\n\tmention: (text: string) => void;\n}\n\nexport interface PaneDef {\n\tkind: string;\n\tlabel: string;\n\ticon: string;\n\t/** The letter that, with Alt+Shift, toggles this pane. */\n\tkey: string;\n\t/** The query params this pane owns besides `panel`. */\n\tparams: readonly string[];\n\tbody: Component<PaneBodyProps>;\n\t/** Why the pane cannot apply to this session, or null when it can. */\n\tunavailable?: (session: Session | null) => string | null;\n\t/** Lines added and removed, drawn on the pane's toggle while non-zero. */\n\tcount?: (session: Session | null) => ChangesInfo | null;\n}\n\nexport const PANES: readonly PaneDef[] = [\n\t{\n\t\tkind: 'changes',\n\t\tlabel: 'Changes',\n\t\ticon: 'mdi:plus-minus-variant',\n\t\tkey: 'C',\n\t\tparams: ['file', 'turn', 'source'],\n\t\tbody: ChangesPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session'),\n\t\tcount: (s) => s?.changes ?? null\n\t},\n\t{\n\t\tkind: 'files',\n\t\tlabel: 'Files',\n\t\ticon: 'mdi:file-tree-outline',\n\t\tkey: 'F',\n\t\tparams: ['file', 'line'],\n\t\tbody: FilesPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'web',\n\t\tlabel: 'Web',\n\t\ticon: 'mdi:web',\n\t\tkey: 'W',\n\t\tparams: ['url'],\n\t\tbody: WebPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'project',\n\t\tlabel: 'Project',\n\t\ticon: 'mdi:folder-information-outline',\n\t\tkey: 'P',\n\t\tparams: [],\n\t\tbody: ProjectPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t}\n];\n\nexport const PANE_KINDS = PANES.map((p) => p.kind);\n/** Every param any pane owns, which switching panes clears. */\nexport const PANE_PARAMS = [...new Set(PANES.flatMap((p) => p.params))];\n\nexport function paneDef(kind: string | null): PaneDef | null {\n\treturn PANES.find((p) => p.kind === kind) ?? null;\n}\n\n/** How Alt+Shift+`letter` is written for this keyboard. */\nfunction altShift(letter: string): string {\n\treturn IS_MAC ? `⌥⇧${letter}` : `Alt Shift ${letter}`;\n}\n\n/** How the keys that toggle a pane are written for this keyboard. */\nexport function paneKeys(def: PaneDef): string {\n\treturn altShift(def.key);\n}\n/** Toggles maximize. */\nconst MAXIMIZE_KEY = 'M';\nexport const MAXIMIZE_KEYS = altShift(MAXIMIZE_KEY);\n/** Closes the panel, or reopens the pane last shown. */\nexport const CLOSE_KEYS = IS_MAC ? '⌘\\\\' : 'Ctrl \\\\';\n\n/** The pane an Alt+Shift+letter press names, or 'maximize'. */\nexport function panelKeyAction(e: KeyboardEvent): PaneDef | 'maximize' | 'toggle' | null {\n\tif ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && e.code === 'Backslash') return 'toggle';\n\tif (!e.altKey || !e.shiftKey || e.ctrlKey || e.metaKey) return null;\n\tif (e.code === `Key${MAXIMIZE_KEY}`) return 'maximize';\n\treturn PANES.find((p) => e.code === `Key${p.key}`) ?? null;\n}\n","import { browser } from '$app/environment';\nimport type { TmuxPane } from '$lib/types/tmux';\n\nconst POLL_INTERVAL_MS = 5000;\n\nfunction panesEqual(a: TmuxPane[], b: TmuxPane[]): boolean {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst x = a[i];\n\t\tconst y = b[i];\n\t\tif (x.target !== y.target || x.command !== y.command || x.cwd !== y.cwd || x.session !== y.session) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nclass TmuxPanesStore {\n\tpanes = $state<TmuxPane[]>([]);\n\tloaded = $state(false);\n\n\tprivate interval: ReturnType<typeof setInterval> | null = null;\n\tprivate subscribers = 0;\n\tprivate pending = false;\n\n\tprivate fetchPanes = async () => {\n\t\tif (this.pending) return;\n\t\tthis.pending = true;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/tmux/panes');\n\t\t\tconst next: TmuxPane[] = await res.json();\n\t\t\tif (!panesEqual(this.panes, next)) this.panes = next;\n\t\t\tthis.loaded = true;\n\t\t} catch {\n\t\t\t// Keep existing panes; don't flip `loaded` so consumers don't render stale-dead state on transient failures\n\t\t} finally {\n\t\t\tthis.pending = false;\n\t\t}\n\t};\n\n\tprivate start() {\n\t\tif (this.interval == null) this.interval = setInterval(this.fetchPanes, POLL_INTERVAL_MS);\n\t}\n\n\tprivate stop() {\n\t\tif (this.interval != null) {\n\t\t\tclearInterval(this.interval);\n\t\t\tthis.interval = null;\n\t\t}\n\t}\n\n\tprivate onVis = () => {\n\t\tif (document.hidden) this.stop();\n\t\telse {\n\t\t\tthis.fetchPanes();\n\t\t\tthis.start();\n\t\t}\n\t};\n\n\tsubscribe(): () => void {\n\t\tif (!browser) return () => {};\n\t\tthis.subscribers++;\n\t\tif (this.subscribers === 1) {\n\t\t\tthis.fetchPanes();\n\t\t\tthis.start();\n\t\t\tdocument.addEventListener('visibilitychange', this.onVis);\n\t\t}\n\t\treturn () => {\n\t\t\tthis.subscribers--;\n\t\t\tif (this.subscribers === 0) {\n\t\t\t\tthis.stop();\n\t\t\t\tdocument.removeEventListener('visibilitychange', this.onVis);\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport const tmuxPanesStore = new TmuxPanesStore();\n","import { createPersisted } from './persisted';\n\nconst PREVIEW_LEN = 32;\nconst SAVE_DEBOUNCE_MS = 250;\nconst persisted = createPersisted<Record<string, string>>('claude-mux-drafts', {});\n\nclass DraftsStore {\n\tprivate state = $state<Record<string, string>>(persisted.load());\n\tprivate flushTimer: ReturnType<typeof setTimeout> | null = null;\n\n\tget(target: string | null): string {\n\t\tif (!target) return '';\n\t\treturn this.state[target] ?? '';\n\t}\n\n\tset(target: string | null, text: string): void {\n\t\tif (!target) return;\n\t\tconst cur = this.state[target] ?? '';\n\t\tif (text === cur) return;\n\t\tif (text === '') delete this.state[target];\n\t\telse this.state[target] = text;\n\t\tthis.scheduleFlush();\n\t}\n\n\thas(target: string | null): boolean {\n\t\treturn !!target && (this.state[target]?.length ?? 0) > 0;\n\t}\n\n\tpreview(target: string | null): string {\n\t\tconst text = this.get(target);\n\t\tif (!text) return '';\n\t\tconst flat = text.replace(/\\s+/g, ' ').trim();\n\t\treturn flat.length > PREVIEW_LEN ? flat.slice(0, PREVIEW_LEN - 1) + '…' : flat;\n\t}\n\n\t// Coalesce keystrokes: localStorage writes serialize the whole map, so per-key\n\t// JSON.stringify is wasteful when the user is typing quickly.\n\tprivate scheduleFlush(): void {\n\t\tif (this.flushTimer !== null) return;\n\t\tthis.flushTimer = setTimeout(() => {\n\t\t\tthis.flushTimer = null;\n\t\t\tpersisted.save(this.state);\n\t\t}, SAVE_DEBOUNCE_MS);\n\t}\n}\n\nexport const draftsStore = new DraftsStore();\n","// File attachments staged for the next send, kept per target the way drafts\n// are (see docs/adr/0001, 0002). In memory only: a chip holds the File and a\n// blob URL, neither of which survives a reload.\nexport type AttachmentStatus = 'uploading' | 'ready' | 'failed';\nexport interface Attachment {\n\tlocalId: string;\n\tfile: File;\n\tname: string;\n\tsize: number;\n\tmime: string;\n\tstatus: AttachmentStatus;\n\tpath?: string;\n\terror?: string;\n\tthumb?: string;\n\tabort?: AbortController;\n}\n\nconst NONE: Attachment[] = [];\n\nfunction release(chip: Attachment): void {\n\tchip.abort?.abort();\n\tif (chip.thumb) URL.revokeObjectURL(chip.thumb);\n}\n\nclass AttachmentsStore {\n\tprivate state = $state<Record<string, Attachment[]>>({});\n\n\tget(target: string | null): Attachment[] {\n\t\tif (!target) return NONE;\n\t\treturn this.state[target] ?? NONE;\n\t}\n\n\tcount(target: string | null): number {\n\t\treturn this.get(target).length;\n\t}\n\n\tadd(target: string | null, chip: Attachment): void {\n\t\tif (!target) return;\n\t\tthis.state[target] = [...this.get(target), chip];\n\t}\n\n\t/** Patch a chip in its own target's list; a no-op once it has been removed. */\n\tpatch(target: string, localId: string, changes: Partial<Attachment>): void {\n\t\tconst list = this.state[target];\n\t\tif (!list?.some((a) => a.localId === localId)) return;\n\t\tthis.state[target] = list.map((a) => (a.localId === localId ? { ...a, ...changes } : a));\n\t}\n\n\t/** Drop one chip, aborting its upload and revoking its blob URL. */\n\tremove(target: string | null, localId: string): Attachment | undefined {\n\t\tconst list = target ? this.state[target] : undefined;\n\t\tconst chip = list?.find((a) => a.localId === localId);\n\t\tif (!target || !list || !chip) return undefined;\n\t\trelease(chip);\n\t\tconst rest = list.filter((a) => a.localId !== localId);\n\t\tif (rest.length) this.state[target] = rest;\n\t\telse delete this.state[target];\n\t\treturn chip;\n\t}\n\n\tclear(target: string | null): void {\n\t\tconst list = target ? this.state[target] : undefined;\n\t\tif (!target || !list) return;\n\t\tlist.forEach(release);\n\t\tdelete this.state[target];\n\t}\n}\n\nexport const attachmentsStore = new AttachmentsStore();\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: AlertDialogPrimitive.RootProps = $props();\n</script>\n\n<AlertDialogPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: AlertDialogPrimitive.PortalProps = $props();\n</script>\n\n<AlertDialogPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.TitleProps = $props();\n</script>\n\n<AlertDialogPrimitive.Title\n\tbind:ref\n\tdata-slot=\"alert-dialog-title\"\n\tclass={cn(\"text-lg font-semibold\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { buttonVariants } from \"$lib/components/ui/button/index.js\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.ActionProps = $props();\n</script>\n\n<AlertDialogPrimitive.Action\n\tbind:ref\n\tdata-slot=\"alert-dialog-action\"\n\tclass={cn(buttonVariants(), className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { buttonVariants } from \"$lib/components/ui/button/index.js\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.CancelProps = $props();\n</script>\n\n<AlertDialogPrimitive.Cancel\n\tbind:ref\n\tdata-slot=\"alert-dialog-cancel\"\n\tclass={cn(buttonVariants({ variant: \"outline\" }), className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"alert-dialog-footer\"\n\tclass={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"alert-dialog-header\"\n\tclass={cn(\"flex flex-col gap-2 text-center sm:text-start\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.OverlayProps = $props();\n</script>\n\n<AlertDialogPrimitive.Overlay\n\tbind:ref\n\tdata-slot=\"alert-dialog-overlay\"\n\tclass={cn(\n\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-(--z-modal) bg-black/50\",\n\t\tclassName\n\t)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport AlertDialogPortal from \"./alert-dialog-portal.svelte\";\n\timport AlertDialogOverlay from \"./alert-dialog-overlay.svelte\";\n\timport { cn, type WithoutChild, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tportalProps,\n\t\t...restProps\n\t}: WithoutChild<AlertDialogPrimitive.ContentProps> & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof AlertDialogPortal>>;\n\t} = $props();\n</script>\n\n<AlertDialogPortal {...portalProps}>\n\t<AlertDialogOverlay />\n\t<AlertDialogPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"alert-dialog-content\"\n\t\tclass={cn(\n\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-(--z-modal) grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t/>\n</AlertDialogPortal>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.DescriptionProps = $props();\n</script>\n\n<AlertDialogPrimitive.Description\n\tbind:ref\n\tdata-slot=\"alert-dialog-description\"\n\tclass={cn(\"text-muted-foreground text-sm\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: DialogPrimitive.RootProps = $props();\n</script>\n\n<DialogPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: DialogPrimitive.PortalProps = $props();\n</script>\n\n<DialogPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.TitleProps = $props();\n</script>\n\n<DialogPrimitive.Title\n\tbind:ref\n\tdata-slot=\"dialog-title\"\n\tclass={cn(\"text-lg leading-none font-semibold\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"dialog-footer\"\n\tclass={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"dialog-header\"\n\tclass={cn(\"flex flex-col gap-2 text-center sm:text-start\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.OverlayProps = $props();\n</script>\n\n<DialogPrimitive.Overlay\n\tbind:ref\n\tdata-slot=\"dialog-overlay\"\n\tclass={cn(\n\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-(--z-modal) bg-black/50\",\n\t\tclassName\n\t)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * ---\n *\n * The MIT License (MIT) (for portions derived from Feather)\n *\n * Copyright (c) 2013-2023 Cole Bemis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\nimport Icon from '../Icon.svelte';\nlet props = $props();\nconst iconNode = [[\"path\", { \"d\": \"M18 6 6 18\" }], [\"path\", { \"d\": \"m6 6 12 12\" }]];\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {FunctionalComponent} Svelte component\n *\n */\n</script>\n\n<Icon name=\"x\" {...props} iconNode={iconNode}>\n {@render props.children?.()}\n</Icon>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport DialogPortal from \"./dialog-portal.svelte\";\n\timport XIcon from \"@lucide/svelte/icons/x\";\n\timport type { Snippet } from \"svelte\";\n\timport * as Dialog from \"./index.js\";\n\timport { cn, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tportalProps,\n\t\tchildren,\n\t\tshowCloseButton = true,\n\t\t...restProps\n\t}: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof DialogPortal>>;\n\t\tchildren: Snippet;\n\t\tshowCloseButton?: boolean;\n\t} = $props();\n</script>\n\n<DialogPortal {...portalProps}>\n\t<Dialog.Overlay />\n\t<DialogPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"dialog-content\"\n\t\tclass={cn(\n\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-(--z-modal) grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t>\n\t\t{@render children?.()}\n\t\t{#if showCloseButton}\n\t\t\t<DialogPrimitive.Close\n\t\t\t\tclass=\"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n\t\t\t>\n\t\t\t\t<XIcon />\n\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t</DialogPrimitive.Close>\n\t\t{/if}\n\t</DialogPrimitive.Content>\n</DialogPortal>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.DescriptionProps = $props();\n</script>\n\n<DialogPrimitive.Description\n\tbind:ref\n\tdata-slot=\"dialog-description\"\n\tclass={cn(\"text-muted-foreground text-sm\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: PopoverPrimitive.RootProps = $props();\n</script>\n\n<PopoverPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: PopoverPrimitive.PortalProps = $props();\n</script>\n\n<PopoverPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\timport PopoverPortal from \"./popover-portal.svelte\";\n\timport { cn, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tsideOffset = 4,\n\t\talign = \"center\",\n\t\tportalProps,\n\t\t...restProps\n\t}: PopoverPrimitive.ContentProps & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof PopoverPortal>>;\n\t} = $props();\n</script>\n\n<PopoverPortal {...portalProps}>\n\t<PopoverPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"popover-content\"\n\t\t{sideOffset}\n\t\t{align}\n\t\tclass={cn(\n\t\t\t\"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-(--z-floating) w-72 origin-(--bits-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t/>\n</PopoverPortal>\n","<script lang=\"ts\">\n\timport { cn } from \"$lib/utils.js\";\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: PopoverPrimitive.TriggerProps = $props();\n</script>\n\n<PopoverPrimitive.Trigger\n\tbind:ref\n\tdata-slot=\"popover-trigger\"\n\tclass={cn(\"\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { untrack } from 'svelte';\n\timport * as Dialog from '$lib/components/ui/dialog';\n\timport { Button } from '$lib/components/ui/button';\n\timport { Input } from '$lib/components/ui/input';\n\timport { sessionStore } from '$lib/stores/sessions.svelte';\n\n\tinterface Props {\n\t\t/** The session to rename; `null` keeps the dialog closed. */\n\t\tsessionId: string | null;\n\t\tonClose: () => void;\n\t}\n\n\tlet { sessionId, onClose }: Props = $props();\n\n\t// Looked up rather than passed in, so the dialog reads the live session\n\t// instead of a snapshot frozen at the moment the row was clicked.\n\tconst session = $derived(sessionId ? sessionStore.sessionById.get(sessionId) ?? null : null);\n\n\tlet value = $state('');\n\tlet inputEl = $state<HTMLInputElement | null>(null);\n\t/**\n\t * The kill arms before it fires. On a phone this dialog is the long-press\n\t * menu — the only place a pane can be killed at all, since the row's kill\n\t * switch needs a hover to appear — so it sits next to a text field a thumb\n\t * is already aiming at, and one stray tap must not end a session.\n\t */\n\tlet killArmed = $state(false);\n\n\t// Seed the field once per opening. The name is read untracked so a rename\n\t// arriving back over the WebSocket cannot overwrite what is being typed.\n\t$effect(() => {\n\t\tif (sessionId) {\n\t\t\tvalue = untrack(() => session?.display_name ?? '');\n\t\t\tkillArmed = false;\n\t\t}\n\t});\n\n\tconst TOP_MARGIN_PX = 16;\n\t/** Below this share of the layout viewport, the shortfall is the keyboard. */\n\tconst KEYBOARD_RATIO = 0.75;\n\n\t/**\n\t * The dialog is `position: fixed`, which anchors it to the layout viewport —\n\t * on a phone the on-screen keyboard then covers it, and the focused field\n\t * sits behind the keys. Pinning it to the top of `visualViewport` instead\n\t * keeps it in sight as the keyboard opens and closes.\n\t *\n\t * Android resizes the layout viewport along with the keyboard, so the default\n\t * centring already lands above it and there is nothing to correct. iOS Safari\n\t * does not, and supports neither `env(keyboard-inset-height)` nor\n\t * `interactive-widget`, which is why this is done in script.\n\t */\n\tlet positionStyle = $state<string | undefined>(undefined);\n\n\t$effect(() => {\n\t\tconst vv = window.visualViewport;\n\t\tif (!sessionId || !vv) return;\n\t\t// Assigning the same string is a no-op in Svelte, so the per-frame `scroll`\n\t\t// events an opening keyboard produces cost nothing extra. Reading\n\t\t// `positionStyle` here to compare would make this effect depend on its own\n\t\t// output and re-subscribe the listeners on every change.\n\t\tconst sync = () => {\n\t\t\t// `translate` (not `transform`) is what centres the panel, so the vertical\n\t\t\t// half of it has to be cancelled here or the panel rides off the top.\n\t\t\tpositionStyle =\n\t\t\t\tvv.height < window.innerHeight * KEYBOARD_RATIO\n\t\t\t\t\t? `top: ${vv.offsetTop + TOP_MARGIN_PX}px; translate: -50% 0;`\n\t\t\t\t\t: undefined;\n\t\t};\n\t\tsync();\n\t\tvv.addEventListener('resize', sync);\n\t\tvv.addEventListener('scroll', sync);\n\t\treturn () => {\n\t\t\tvv.removeEventListener('resize', sync);\n\t\t\tvv.removeEventListener('scroll', sync);\n\t\t\tpositionStyle = undefined;\n\t\t};\n\t});\n\n\tasync function commit() {\n\t\tconst target = session;\n\t\tconst next = value.trim();\n\t\tonClose();\n\t\tif (!target || next === (target.display_name ?? '')) return;\n\t\ttry {\n\t\t\tawait fetch(`/api/sessions/${encodeURIComponent(target.id)}/rename`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ name: next || null })\n\t\t\t});\n\t\t} catch {\n\t\t\t// watcher will reconcile\n\t\t}\n\t}\n\n\tasync function kill() {\n\t\tconst target = session;\n\t\tif (!target) return;\n\t\tif (!killArmed) {\n\t\t\tkillArmed = true;\n\t\t\treturn;\n\t\t}\n\t\tonClose();\n\t\ttry {\n\t\t\tawait fetch(`/api/sessions/${encodeURIComponent(target.id)}/kill`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ pid: target.pid, tmux_target: target.tmux_target })\n\t\t\t});\n\t\t} catch {\n\t\t\t// watcher will reconcile\n\t\t}\n\t}\n\n\tfunction onKeydown(e: KeyboardEvent) {\n\t\tif (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tvoid commit();\n\t\t}\n\t}\n</script>\n\n<Dialog.Root open={session !== null} onOpenChange={(open) => { if (!open) onClose(); }}>\n\t<Dialog.Content\n\t\tclass=\"max-w-sm\"\n\t\tstyle={positionStyle}\n\t\tonOpenAutoFocus={(e) => {\n\t\t\t// bits-ui focuses the panel itself; the point of this dialog is to type\n\t\t\t// straight away, so hand focus to the field instead.\n\t\t\te.preventDefault();\n\t\t\tinputEl?.focus();\n\t\t\tinputEl?.select();\n\t\t}}\n\t>\n\t\t<Dialog.Header>\n\t\t\t<Dialog.Title>Rename session</Dialog.Title>\n\t\t\t<Dialog.Description>\n\t\t\t\tAlso sent to the agent as <code>/rename</code>, once its pane is back at a prompt. Leave\n\t\t\t\tblank to fall back to the tmux target.\n\t\t\t</Dialog.Description>\n\t\t</Dialog.Header>\n\t\t<Input\n\t\t\tbind:ref={inputEl}\n\t\t\tbind:value\n\t\t\tonkeydown={onKeydown}\n\t\t\tclass=\"font-mono\"\n\t\t\ttype=\"text\"\n\t\t\tplaceholder={session?.tmux_target ?? session?.id ?? 'session name'}\n\t\t\taria-label=\"Session name\"\n\t\t\tautocomplete=\"off\"\n\t\t\tautocapitalize=\"off\"\n\t\t\tspellcheck=\"false\"\n\t\t\tenterkeyhint=\"done\"\n\t\t\tmaxlength={120}\n\t\t/>\n\t\t<Dialog.Footer>\n\t\t\t<Button\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tclass=\"min-h-11 text-destructive hover:text-destructive sm:mr-auto\"\n\t\t\t\tonclick={kill}\n\t\t\t>\n\t\t\t\t{killArmed ? 'Confirm kill' : 'Kill session'}\n\t\t\t</Button>\n\t\t\t<Button variant=\"ghost\" class=\"min-h-11\" onclick={onClose}>Cancel</Button>\n\t\t\t<Button class=\"min-h-11\" onclick={commit}>Rename</Button>\n\t\t</Dialog.Footer>\n\t</Dialog.Content>\n</Dialog.Root>\n","export interface FuzzyMatch {\n /** Higher is better. */\n score: number;\n /** Indices of the characters in `text` that the query matched. */\n positions: number[];\n}\n\n/**\n * Subsequence fuzzy match with the matched character positions.\n * Prefers: prefix match, matches at word boundaries, contiguous runs, shorter names.\n * Returns null when the query is not a subsequence of the text.\n * Pass `wantPositions: false` when only the score is used — it skips collecting them.\n */\nexport function fuzzyMatch(text: string, q: string, wantPositions = true): FuzzyMatch | null {\n if (!q) return { score: 0, positions: [] };\n const t = text.toLowerCase();\n const needle = q.toLowerCase();\n // Fast path: substring\n const idx = t.indexOf(needle);\n if (idx !== -1) {\n const positions = wantPositions\n ? Array.from({ length: needle.length }, (_, i) => idx + i)\n : [];\n return { score: 1000 - idx * 5 - t.length, positions };\n }\n const positions: number[] = [];\n let score = 0;\n let ti = 0;\n let prev = -2;\n for (let qi = 0; qi < needle.length; qi++) {\n const ch = needle[qi];\n const found = t.indexOf(ch, ti);\n if (found === -1) return null;\n score += found === prev + 1 ? 10 : 1;\n if (found === 0 || /[^a-z0-9]/.test(t[found - 1] ?? \"\")) score += 5;\n if (wantPositions) positions.push(found);\n prev = found;\n ti = found + 1;\n }\n return { score: score - t.length * 0.1, positions };\n}\n\n/** Score only — skips collecting match positions. Higher is better; null = no match. */\nexport function fuzzyScore(text: string, q: string): number | null {\n return fuzzyMatch(text, q, false)?.score ?? null;\n}\n\n/** Split `text` into alternating plain/matched runs for highlighting. */\nexport function highlightRuns(text: string, positions: number[]): { text: string; hit: boolean }[] {\n if (positions.length === 0) return [{ text, hit: false }];\n const runs: { text: string; hit: boolean }[] = [];\n let cut = 0;\n for (let i = 0; i < positions.length; ) {\n // positions is ascending, so a run of matched chars is one slice\n const from = positions[i];\n let to = from;\n while (i + 1 < positions.length && positions[i + 1] === to + 1) {\n to = positions[++i];\n }\n i++;\n if (from > cut) runs.push({ text: text.slice(cut, from), hit: false });\n runs.push({ text: text.slice(from, to + 1), hit: true });\n cut = to + 1;\n }\n if (cut < text.length) runs.push({ text: text.slice(cut), hit: false });\n return runs;\n}\n\n/**\n * Ranking shared by the web command list and spoken-command resolution: a\n * fuzzy match on the name (boosted so any name hit beats any description\n * hit), else a substring match on the description — substring only, because\n * a subsequence over long prose matches everything. Lives here rather than\n * beside the command scanner so the browser bundle never sees \"fs\".\n */\nexport function scoreCommand(\n cmd: { name: string; description: string },\n query: string\n): number | null {\n const nameScore = fuzzyScore(cmd.name, query);\n if (nameScore != null) return nameScore + 500;\n const descIdx = query ? cmd.description.toLowerCase().indexOf(query.toLowerCase()) : -1;\n return descIdx === -1 ? null : 100 - descIdx * 0.5;\n}\n","<script lang=\"ts\">/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * ---\n *\n * The MIT License (MIT) (for portions derived from Feather)\n *\n * Copyright (c) 2013-2023 Cole Bemis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\nimport Icon from '../Icon.svelte';\nlet props = $props();\nconst iconNode = [[\"path\", { \"d\": \"M5 12h14\" }]];\n/**\n * @component @name Minus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxMmgxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/minus\n * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {FunctionalComponent} Svelte component\n *\n */\n</script>\n\n<Icon name=\"minus\" {...props} iconNode={iconNode}>\n {@render props.children?.()}\n</Icon>\n","<script lang=\"ts\">\n\timport { Checkbox as CheckboxPrimitive } from \"bits-ui\";\n\timport CheckIcon from \"@lucide/svelte/icons/check\";\n\timport MinusIcon from \"@lucide/svelte/icons/minus\";\n\timport { cn, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tchecked = $bindable(false),\n\t\tindeterminate = $bindable(false),\n\t\tclass: className,\n\t\t...restProps\n\t}: WithoutChildrenOrChild<CheckboxPrimitive.RootProps> = $props();\n</script>\n\n<CheckboxPrimitive.Root\n\tbind:ref\n\tdata-slot=\"checkbox\"\n\tclass={cn(\n\t\t\"border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n\t\tclassName\n\t)}\n\tbind:checked\n\tbind:indeterminate\n\t{...restProps}\n>\n\t{#snippet children({ checked, indeterminate })}\n\t\t<div data-slot=\"checkbox-indicator\" class=\"text-current transition-none\">\n\t\t\t{#if checked}\n\t\t\t\t<CheckIcon class=\"size-3.5\" />\n\t\t\t{:else if indeterminate}\n\t\t\t\t<MinusIcon class=\"size-3.5\" />\n\t\t\t{/if}\n\t\t</div>\n\t{/snippet}\n</CheckboxPrimitive.Root>\n","export type ChordAction = {\n\tlabel: string;\n\ticon: string;\n\trun: () => void;\n\tdanger?: boolean;\n\tflashing?: boolean;\n\tvariant?: 'destructive' | 'secondary';\n};\n\nfunction sameShape(a: ChordAction[], b: ChordAction[]): boolean {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst x = a[i];\n\t\tconst y = b[i];\n\t\tif (\n\t\t\tx.label !== y.label ||\n\t\t\tx.icon !== y.icon ||\n\t\t\tx.danger !== y.danger ||\n\t\t\tx.variant !== y.variant ||\n\t\t\tx.flashing !== y.flashing\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nclass SidebarActionsStore {\n\tactions: ChordAction[] = $state([]);\n\n\tset(actions: ChordAction[]): void {\n\t\tif (sameShape(this.actions, actions)) return;\n\t\tthis.actions = actions;\n\t}\n\n\tclear(): void {\n\t\tif (this.actions.length === 0) return;\n\t\tthis.actions = [];\n\t}\n}\n\nexport const sidebarActionsStore = new SidebarActionsStore();\n"],"file":"CmDdyjOR.js"}
1
+ {"version":3,"mappings":";+4BAWA,MAAMA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,OARJ,KAAK,iBAAL,IAAK85B,EAAA,WAML,SAAK,iBAAL,QAAKA,EAAA,WACL,eAAK,iBAAL,cAAKA,EAAA,OAGK,SAAAyd,sCAbH,CCJR,SAASI,GAAUhlD,EAAkB/F,EAA2B,CAC/D,GAAI+F,EAAE,SAAW/F,EAAE,OAAQ,MAAO,GAClC,QAASlE,EAAI,EAAGA,EAAIiK,EAAE,OAAQjK,IAAK,CAClC,MAAM0wB,EAAIzmB,EAAEjK,CAAC,EACP2wB,EAAIzsB,EAAElE,CAAC,EACb,GACC0wB,EAAE,QAAUC,EAAE,OACdD,EAAE,OAASC,EAAE,MACbD,EAAE,SAAWC,EAAE,QACfD,EAAE,UAAYC,EAAE,SAChBD,EAAE,WAAaC,EAAE,SAEjB,MAAO,EAET,CACA,MAAO,EACR,CAEA,MAAMu+B,EAAoB,IACA3sD,KAAO,EAAE,OAAlC,wCAAAlD,EAAA,iBAEA,IAAI8vD,EAA8B,CAC7BF,GAAU,KAAK,QAASE,CAAO,IACnC,KAAK,QAAUA,EAChB,CAEA,OAAc,CACT,KAAK,QAAQ,SAAW,IAC5B,KAAK,QAAU,GAChB,CACD,CAEO,MAAMC,GAAsB,IAAIF","names":["empty","snapshot","value","skip_warning","no_tojson","clone","cloned","path","paths","original","unwrapped","is_array","copy","i","element","get_prototype_of","object_prototype","key","createAttachmentKey","ATTACHMENT_KEY","init","immutable","context","component_context","callbacks","props","deep_read_state","version","prev","d","derived","changed","get","user_pre_effect","observe_all","run_all","user_effect","fns","untrack","run","fn","signal","STORAGE_KEYS","IS_MAC","MOD_LABEL","cache","createPersisted","detectCurrent","host","hostname","url","ServerStore","$.state","$.proxy","cached","res","data","err","serverStore","isFunction","isObject","CLASS_VALUE_PRIMITIVE_TYPES","isClassValue","item","BoxSymbol","isWritableSymbol","boxWith","getter","setter","$.derived","$.get","v","isBox","isWritableBox","boxFrom","simpleBox","boxFlatten","boxes","acc","b","toReadonlyBox","initialValue","current","$.set","composeHandlers","handlers","e","handler","COMMENT_REGEX","NEWLINE_REGEX","WHITESPACE_REGEX","PROPERTY_REGEX","COLON_REGEX","VALUE_REGEX","SEMICOLON_REGEX","TRIM_REGEX","NEWLINE","FORWARD_SLASH","ASTERISK","EMPTY_STRING","TYPE_COMMENT","TYPE_DECLARATION","index","style","options","lineno","column","updatePosition","str","lines","position","start","node","Position","whitespace","error","msg","match","re","comments","rules","c","comment","pos","declaration","prop","val","ret","trim","declarations","decls","decl","StyleToObject","iterator","styleObject","parse","hasIterator","property","NUMBER_CHAR_RE","STR_SPLITTERS","isUppercase","char","splitByCase","parts","buff","previousUpper","previousSplitter","isSplitter","isUpper","lastChar","pascalCase","p","upperFirst","camelCase","lowerFirst","cssToStyleObj","css","styleObj","name","executeCallbacks","args","callback","createParser","matcher","replacer","regex","camelToKebab","styleToCSS","styleToString","EVENT_LIST","EVENT_LIST_SET","isEventHandler","mergeProps","result","a","aIsFunction","bIsFunction","aHandler","bHandler","aIsClassValue","bIsClassValue","clsx","aIsObject","bIsObject","aIsString","bIsString","parsedStyle","parsedStyleA","parsedStyleB","srOnlyStyles","defaultWindow","getActiveElement","document","activeElement","SvelteMap","#sources","#version","state","#size","#update_version","update_version","#source","source","sources","callbackfn","this_arg","#read_all","callbackFn","s","prev_res","set","increment","v_reactions","needs_version_increase","r","ActiveElement","#document","#subscribe","window","createSubscriber","update","cleanupFocusIn","on","cleanupFocusOut","Context","#name","#key","hasContext","getContext","fallback","setContext","runEffect","flush","effect","$.user_effect","$.user_pre_effect","runWatcher","lazy","active","previousValues","values","cleanup","watch","watchPre","ElementSize","#observed","#options","#node","#window","#width","#height","node$","observer","entries","entry","boxSize","boxSizeArr","size","offsetWidth","offsetHeight","paddingWidth","paddingHeight","borderWidth","borderHeight","contentWidth","contentHeight","onDestroyEffect","afterSleep","ms","cb","afterTick","tick","ELEMENT_NODE","DOCUMENT_NODE","DOCUMENT_FRAGMENT_NODE","isHTMLElement","isDocument","isWindow","isNode","isShadowRoot","contains","parent","child","rootNode","next","getDocument","getWindow","el","DOMContext","#root","id","selector","delay","timeoutId","attachRef","ref","onChange","boolToStr","condition","boolToEmptyStrOrUndef","boolToTrueOrUndef","getDataOpenClosed","getDataTransitionAttrs","getAriaChecked","checked","indeterminate","BitsAttrs","#variant","#prefix","config","part","variantOverride","createBitsAttrs","bitsAttrs","ARROW_DOWN","ARROW_LEFT","ARROW_RIGHT","ARROW_UP","END","ENTER","ESCAPE","HOME","PAGE_DOWN","PAGE_UP","SPACE","TAB","isBrowser","isIOS","getIsIOS","isElement","isElementOrSVGElement","isTouch","isFocusVisible","isNotNull","isSelectableInput","AnimationsComplete","#opts","#currentFrame","#observer","#runId","opts","#cleanup","#executeCallback","runId","executeIfCurrent","waitForAnimations","animations","animation","requestWaitForAnimations","startingStyleAttr","execute","PresenceManager","#enabled","#afterAnimations","#shouldRender","#transitionStatus","#hasMounted","#transitionFrame","#clearTransitionFrame","isOpen","noop","createId","prefixOrUid","uid","dialogAttrs","DialogRootContext","DialogRootState","#sharedProps","DialogCloseState","root","kbd.SPACE","kbd.ENTER","#props","DialogActionState","DialogTitleState","DialogDescriptionState","DialogContentState","#snippetProps","DialogOverlayState","AlertDialogCancelState","open","$.prop","$$props","onOpenChange","onOpenChangeComplete","$.props_id","level","restProps","$.rest_props","rest_excludes","titleState","mergedProps","div","$.attribute_effect","actionState","button","disabled","cancelState","BitsConfigContext","getBitsConfig","BitsConfigState","resolveConfigOption","createConfigResolver","currentOpts","createPropResolver","configOption","getProp","propValue","option","resolvePortalToProp","to","getAllContexts","target","getTarget","localTarget","instance","unmountInstance","unmount","mount","PortalConsumer","debounce","wait","timeout","debounced","isOrContainsTarget","getOwnerDocument","isClickTrulyOutside","event","contentNode","clientX","clientY","rect","CONTEXT_MENU_TRIGGER_ATTR","CONTEXT_MENU_CONTENT_ATTR","DismissibleLayerState","#interactOutsideProp","#behaviorType","#interceptedEvents","#isResponsibleLayer","#capturedPointerDown","#isFocusInsideDOMTree","#documentObj","#onFocusOutside","#unsubClickListener","#destroyed","unsubEvents","registeredNode","#resetState","#handleInteractOutside","enabled","nextNode","#addEventListeners","#handleFocus","#isTargetWithinLayer","onPointerDownCapture","#markInterceptedEvent","#markResponsibleLayer","onPointerDown","#markNonInterceptedEvent","#interactOutside","#handleDismiss","createWrappedEvent","isEventValid","isValidEvent","#isAnyEventIntercepted","backup","unsubClick","dismiss","isResponsibleLayer","eventType","#onfocuscapture","#onblurcapture","getTopMostDismissableLayer","layersArr","_","behaviorType","topMostLayer","firstLayerNode","targetIsContextMenuTrigger","nodeIsContextMenu","capturedCurrentTarget","capturedTarget","newEvent","isPrevented","interactOutsideBehavior","onInteractOutside","onFocusOutside","dismissibleLayerState","$.snippet","$.noop","EscapeLayerState","#addEventListener","#onkeydown","kbd.ESCAPE","isResponsibleEscapeLayer","clonedEvent","escapeKeydownBehavior","onEscapeKeydown","FocusScopeManager","#scopeStack","#focusHistory","#preFocusHistory","scope","candidateSelectors","candidateSelector","NoElement","matches","getRootNode","_element$getRootNode","_isInert","lookUp","_node$getAttribute","inertAtt","inert","isContentEditable","_node$getAttribute2","attValue","getCandidates","includeContainer","filter","candidates","_getCandidatesIteratively","elements","elementsToCheck","assigned","content","nestedCandidates","validCandidate","shadowRoot","validShadowRoot","_nestedCandidates","hasTabIndex","getTabIndex","getSortOrderTabIndex","isScope","tabIndex","sortOrderedTabbables","isInput","isHiddenInput","isDetailsWithSummary","getCheckedRadio","nodes","form","isTabbableRadio","radioScope","queryRadios","radioSet","isRadio","isNonTabbableRadio","isNodeAttached","_nodeRoot","nodeRoot","nodeRootHost","attached","_nodeRootHost","_nodeRootHost$ownerDo","_node$ownerDocument","_nodeRoot2","_nodeRootHost2","_nodeRootHost2$ownerD","isZeroArea","_node$getBoundingClie","width","height","isHidden","_ref","displayCheck","getShadowRoot","visible","_getComputedStyle","visibility","isDirectSummary","nodeUnderDetails","originalNode","parentElement","isDisabledFromFieldset","parentNode","isNodeMatchingSelectorFocusable","isNodeMatchingSelectorTabbable","isShadowRootTabbable","shadowHostNode","_sortByOrder","regularTabbables","orderedTabbables","candidateTabindex","sortable","tabbable","container","focusable","isTabbable","focusableCandidateSelector","isFocusable","FocusScope","#paused","#container","#manager","#cleanupFns","#setupEventListeners","#handleOpenAutoFocus","#handleCloseAutoFocus","firstTabbable","#getFirstTabbable","preFocusedElement","doc","handleFocus","lastFocused","firstFocusable","#getAllFocusables","handleKeydown","tabbables","#getTabbables","first","last","elementToFocus","trapFocus","loop","onCloseAutoFocus","onOpenAutoFocus","focusScopeState","noopPointer","TextSelectionLayerState","#unsubSelectionLock","#enabledSnapshot","#onPointerDownSnapshot","#onPointerUpSnapshot","onPointerUp","#resetSelectionLock","#pointerdown","#pointerup","isHighestLayer","preventTextSelectionOverflow","getUserSelect","body","originalBodyUserSelect","originalNodeUserSelect","setUserSelect","highestLayer","preventOverflowTextSelection","useId","prefix","SharedState","#factory","#subscribers","#state","#scope","factory","#dispose","$.effect_root","lockMap","MANAGED_PROPERTIES","initialProperties","hadInitialStyleAttribute","modifiedProperties","stopTouchMoveListener","cleanupTimeoutId","isInCleanupTransition","setManagedProperty","anyLocked","cleanupScheduledAt","bodyLockStackCount","resetBodyStyle","documentObj","initial","cancelPendingCleanup","scheduleCleanupIfNoNewLocks","currentCleanupId","cleanupFn","isAnyLocked","actualDelay","ensureInitialStyleCaptured","htmlStyle","bodyStyle","hasStableGutter","verticalScrollbarWidth","BodyScrollLock","#id","#initialState","#restoreScrollDelay","#countState","initialState","restoreScrollDelay","map","preventScroll","forceMount","contentState","$$anchor","$$arg0","focusScopeProps","EscapeLayer","$.spread_props","DismissibleLayer","TextSelectionLayer","ScrollLock","$$render","consequent","$0","node_4","$.sibling","consequent_2","overlayState","node_3","consequent_1","descriptionState","checkboxAttrs","CheckboxGroupContext","CheckboxRootContext","CheckboxRootState","group","#trueName","#trueRequired","#trueDisabled","#trueReadonly","$.snapshot","groupValue","#toggle","getCheckboxDataState","CheckboxInputState","#trueChecked","enable_legacy_mode_flag","input","input_1","$.bind_value","$.append","alternate","inputState","HiddenInput","required","type","rootState","node_2","CheckboxInput","FloatingRootContext","FloatingTooltipRootContext","FloatingRootState","tooltip","FloatingAnchorState","valueOrGetValue","getDPR","roundByDPR","dpr","getFloatingContentCSSVars","sides","min","max","round","floor","createCoords","oppositeSideMap","clamp","end","evaluate","param","getSide","placement","getAlignment","getOppositeAxis","axis","getAxisLength","getSideAxis","firstChar","getAlignmentAxis","getAlignmentSides","rects","rtl","alignment","alignmentAxis","length","mainAlignmentSide","getOppositePlacement","getExpandedPlacements","oppositePlacement","getOppositeAlignmentPlacement","lrPlacement","rlPlacement","tbPlacement","btPlacement","getSideList","side","isStart","getOppositeAxisPlacements","flipAlignment","direction","list","expandPaddingObject","padding","_padding$top","_padding$right","_padding$bottom","_padding$left","getPaddingObject","rectToClientRect","x","y","computeCoordsFromPlacement","reference","floating","sideAxis","alignLength","isVertical","commonX","commonY","commonAlign","coords","detectOverflow","_await$platform$isEle","platform","strategy","boundary","rootBoundary","elementContext","altBoundary","paddingObject","clippingClientRect","offsetParent","offsetScale","elementClientRect","MAX_RESET_COUNT","computePosition","middleware","platformWithDetectOverflow","statefulPlacement","resetCount","middlewareData","currentMiddleware","nextX","nextY","reset","arrow","arrowDimensions","isYAxis","minProp","maxProp","clientProp","endDiff","startDiff","arrowOffsetParent","clientSize","centerToReference","largestPossiblePadding","minPadding","maxPadding","center","offset","shouldAddOffset","alignmentOffset","flip","_middlewareData$arrow","_middlewareData$flip","initialPlacement","checkMainAxis","checkCrossAxis","specifiedFallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","detectOverflowOptions","initialSideAxis","isBasePlacement","fallbackPlacements","hasFallbackAxisSideDirection","placements","overflow","overflows","overflowsData","_middlewareData$flip2","_overflowsData$filter","nextIndex","nextPlacement","resetPlacement","_overflowsData$filter2","currentSideAxis","getSideOffsets","isAnySideFullyClipped","hide","offsets","originSides","convertValueToCoords","mainAxisMulti","crossAxisMulti","rawValue","mainAxis","crossAxis","_middlewareData$offse","diffCoords","shift","limiter","mainAxisCoord","crossAxisCoord","clampCoord","coord","limitedCoords","limitShift","_rawOffset$mainAxis","_rawOffset$crossAxis","rawOffset","computedOffset","len","limitMin","limitMax","_middlewareData$offse2","isOriginSide","apply","heightSide","widthSide","maximumClippingHeight","maximumClippingWidth","overflowAvailableHeight","overflowAvailableWidth","shiftData","noShift","availableHeight","availableWidth","nextDimensions","hasWindow","getNodeName","getDocumentElement","isOverflowElement","overflowX","overflowY","display","getComputedStyle","isTableElement","isTopLayer","willChangeRe","containRe","isNotNone","isWebKitValue","isContainingBlock","elementOrCss","isWebKit","getContainingBlock","currentNode","getParentNode","isLastTraversableNode","getNodeScroll","getNearestOverflowAncestor","getOverflowAncestors","traverseIframes","_node$ownerDocument2","scrollableAncestor","isBody","win","frameElement","getFrameElement","getCssDimensions","getComputedStyle$1","hasOffset","shouldFallback","unwrapElement","getScale","domElement","$","noOffsets","getVisualOffsets","shouldAddVisualOffsets","isFixed","floatingOffsetParent","getBoundingClientRect","includeScale","isFixedStrategy","clientRect","scale","visualOffsets","offsetWin","currentWin","currentIFrame","iframeScale","iframeRect","left","top","getWindowScrollBarX","leftScroll","getHTMLOffset","documentElement","scroll","htmlRect","convertOffsetParentRelativeRectToViewportRelativeRect","topLayer","isOffsetParentAnElement","offsetRect","htmlOffset","getClientRects","getDocumentRect","html","SCROLLBAR_MAX","getViewportRect","isLayoutViewport","visualViewport","layoutRelativeClientCoords","bodyStyles","bodyMarginInline","reservedWidth","gutter","getInnerBoundingClientRect","getClientRectFromClippingAncestor","clippingAncestor","getClippingElementAncestors","cachedResult","lastKeptComputedStyle","elementIsFixed","computedStyle","currentNodeIsContaining","lastPosition","ancestor","getClippingRect","clippingAncestors","firstRect","right","bottom","getDimensions","getRectRelativeToOffsetParent","isStaticPositioned","getTrueOffsetParent","polyfill","rawOffsetParent","getOffsetParent","svgOffsetParent","getElementRects","getOffsetParentFn","getDimensionsFn","floatingDimensions","isRTL","rectsAreEqual","observeMove","onMove","ancestorResize","io","_io","refresh","skip","threshold","elementRectForRootMargin","insetTop","insetRight","insetBottom","insetLeft","isFirstUpdate","handleObserve","ratio","handleResize","autoUpdate","ancestorScroll","elementResize","layoutShift","animationFrame","referenceEl","ancestors","cleanupIo","reobserveFrame","resizeObserver","firstEntry","_resizeObserver","frameId","prevRefRect","frameLoop","nextRefRect","_resizeObserver2","offset$1","shift$1","flip$1","size$1","hide$1","arrow$1","limitShift$1","mergedOptions","platformWithCache","computePosition$1","useFloating","whileElementsMountedOption","openOption","middlewareOption","transformOption","placementOption","strategyOption","sideOffsetOption","alignOffsetOption","isPositioned","hasWhileMountedPosition","updateRequestId","destroyed","floatingStyles","xVal","yVal","whileElementsMountedCleanup","referenceNode","floatingNode","requestId","isReferenceHidden","maxExpectedOffset","attach","trackWhileMountedDeps","OPPOSITE_SIDE","FloatingContentContext","FloatingContentState","#transformedStyle","#updatePositionStrategy","#arrowSize","#arrowWidth","#arrowHeight","#desiredPlacement","#boundary","#hasExplicitBoundaries","#detectOverflowOptions","#availableWidth","#availableHeight","#anchorWidth","#anchorHeight","anchorWidth","anchorHeight","transformOrigin","#placedSide","getSideFromPlacement","#placedAlign","getAlignFromPlacement","#contentZIndex","#arrowBaseSide","#wrapperProps","customAnchor","rafId","zIndex","FloatingArrowState","isArrowHidden","arrowWidth","arrowHeight","placedSide","placedAlign","getSideAndAlignFromPlacement","noArrowAlign","arrowXCenter","arrowYCenter","align","sideOffset","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","hideWhenDetached","onPlaced","sticky","updatePositionStrategy","dir","wrapperId","onMount","isStatic","FloatingLayerContentStatic","FloatingLayerContent","contentPointerEvents","resolvedPreventScroll","effectiveStrategy","PopperContent","floatingProps","wrapperProps","node_1","dismissibleProps","PopperLayerInner","isPointInPolygon","point","polygon","isInside","j","xi","yi","xj","yj","isInsideRect","triggerRect","contentRect","triggerCenterX","triggerCenterY","contentCenterX","contentCenterY","deltaX","deltaY","SafePolygon","#buffer","#transitIntentTimeout","#exitPoint","#exitTarget","#transitTargets","#trackedTriggerNode","#leaveFallbackRafId","#transitIntentTimeoutId","#cancelLeaveFallback","#scheduleLeaveFallback","#clearTracking","#cancelTransitIntentTimeout","#scheduleTransitIntentTimeout","transitIntentTimeout","triggerNode","handlePointerMove","#onPointerMove","handleTriggerLeave","ignoredTargets","n","handleTriggerEnter","handleContentEnter","handleContentLeave","clientPoint","transitTarget","transitRect","transitSide","transitCorridor","#getCorridorPolygon","corridorPoly","targetRect","safePoly","#getSafePolygon","buffer","exitPoint","exitTarget","#flipSide","popoverAttrs","PopoverRootContext","PopoverRootState","#closeTimeout","#domContext","#clearCloseTimeout","ctx","PopoverTriggerState","#openTimeout","#isHovering","#clearOpenTimeout","#clearAllTimeouts","#getAriaControls","PopoverContentState","closestTrigger","effectiveTrapFocus","handleOpenAutoFocus","PopperLayerForceMount","finalProps","div_1","$.child","$.reset","PopperLayer","div_2","div_3","node_6","consequent_3","openOnHover","openDelay","closeDelay","triggerState","FloatingLayerAnchor","closeState","FloatingLayer","toggleAttrs","ToggleRootState","getToggleDataState","pressed","onPressedChange","toggleState","defaultAttributes","color","strokeWidth","absoluteStrokeWidth","iconNode","svg","$.index","$$item","tag","$$array","attrs","$$element","Icon","info","loading","seq","load","mine","sessionId","cwd","urls","root_9","p_1","root_1","dl","root_8","dt","dd","dd_1","$.template_effect","$.set_text","text_3","span","root_2","span_1","root_3","dd_2","ul","root_5","li","root_4","span_2","text_4","$.only_child","$.set_attribute","span_3","root_6","text_6","pre","$.first_child","fragment_1","consequent_4","consequent_5","alternate_1","text_1","text_2","alternate_2","toggleVariants","tv","variant","cn","TogglePrimitive_Root","$$value","LOADERS","__vitePreload","core","m","highlightLines","language","hljs","line","inRepo","gitMissing","wanted","listing","listError","loadingList","listStamp","listSeq","again","loadList","src","$.update","pulse","turns","turn","t","files","totals","sumCounts","chips","showGenerated","split","generated","kept","f","isGenerated","displayPath","shown","selected","pick","file","setSource","setTurn","NO_PROMPT","revealTurn","diff","diffError","diffSeq","painted","loadDiff","turnId","q","diffKey","shownDiff","shownError","rows","diffRows","hunkCount","SIGN","PAINT_LIMIT","languageFor","stale","onKey","at","root_24","bind_set","Toggle","bind_set_1","node_5","bind_get_2","bind_set_2","$.each","bind_get_3","span_4","text_8","span_5","text_9","node_9","div_4","span_6","text_10","node_10","Button","consequent_6","p_2","root_10","text_13","div_5","root_23","nav","node_12","letter","statusLetter","root_13","span_7","text_14","span_8","bdi","node_13","span_9","root_11","span_10","text_16","consequent_11","span_11","text_17","consequent_12","consequent_10","classes_1","$.set_class","$.delegated","consequent_13","section","div_6","fragment_8","button_1","iconify_icon","span_12","text_19","node_18","span_13","root_14","text_20","consequent_14","node_19","p_3","text_21","p_4","root_15","div_7","root_19","row","div_8","root_16","text_22","div_9","root_17","text_23","div_10","root_18","span_14","text_24","span_15","text_25","span_16","text_26","span_17","node_21","text_27","consequent_19","consequent_18","alternate_3","p_5","root_20","consequent_15","consequent_16","consequent_20","consequent_21","p_6","root_22","consequent_22","alternate_4","consequent_7","consequent_9","alternate_5","consequent_8","classes","toastsCounter","getToastId","ToastState","#pendingRemovals","#findToastIdx","idx","toast","#findHeightIdx","toastId","message","toastIdx","toastToUpdate","rest","dismissible","alreadyExists","promise","shouldDismiss","response","constructPromiseErrorMessage","component","heightIdx","order","toastOrder","insertIdx","toastState","toastFunction","SonnerState","#activeToasts","basicToast","GRAMMARS","THEME","HIGHLIGHT_LIMIT_CHARS","highlighter","createHighlighterCore","createJavaScriptRegexEngine","theme","highlightFile","text","shiki","persisted","FilesPaneStore","patch","filesPaneStore","tree","depth","dirs","styles","$.set_style","fragment_4","iconify_icon_1","$.set_custom_element_data","iconify_icon_2","styles_3","setExpanded","root_7","iconify_icon_3","node_7","iconify_icon_4","classes_2","openPath","styles_4","openFile","api","prefs","showIgnored","expanded","treeEpoch","loadDir","epoch","reloadTree","rootListing","repo","readFor","toggleIgnored","wantedFile","wantedLine","restored","fileSeq","loadFile","read","fileReadFor","revealInTree","missing","closeFile","mdSource","markdown","isMarkdown","rendered","tokens","shikiLanguage","CHUNK","chunks","codeEl","pickLine","copyPath","mentionOpen","abs","formatSize","bytes","query","allFiles","picked","loadAll","results","fuzzyFilter","openResult","onQueryKey","root_27","iconify_icon_5","Input","node_8","text_5","button_2","classes_4","node_14","button_3","root_12","root_26","button_4","iconify_icon_6","bdi_1","node_17","text_11","div_11","bind_get","bind_get_1","node_20","button_5","iconify_icon_7","button_6","iconify_icon_8","button_7","iconify_icon_9","div_12","text_15","classes_5","div_13","img","div_14","$.html","renderMarkdown","root_21","div_15","root_25","div_16","div_17","button_8","node_23","node_24","styles_7","classes_6","styles_6","$.bind_this","styles_5","consequent_17","consequent_23","classes_3","isLoopback","h","choiceUrl","choice","normalizeTyped","hasScheme","u","pointsHere","portOf","resolveEmbed","pageSecure","port","served","remote","card","WebPaneStore","webPaneStore","POLL_MS","infoError","infoSeq","loadInfo","timer","devConfigured","trail","choose","goBack","typed","submitTyped","named","configured","embed","frameSrc","openUrl","check","verdict","blocked","reloads","reload","hostLabel","$1","server","fragment_3","code","text_7","command","h3","fragment_5","fragment_6","code_1","text_12","node_11","p_7","iframe","$.event","PANES","ChangesPane","FilesPane","WebPane","ProjectPane","PANE_KINDS","PANE_PARAMS","paneDef","kind","altShift","paneKeys","def","MAXIMIZE_KEY","MAXIMIZE_KEYS","CLOSE_KEYS","panelKeyAction","POLL_INTERVAL_MS","panesEqual","TmuxPanesStore","tmuxPanesStore","PREVIEW_LEN","SAVE_DEBOUNCE_MS","DraftsStore","cur","flat","draftsStore","NONE","release","chip","AttachmentsStore","localId","changes","attachmentsStore","AlertDialogPrimitive_Root","AlertDialogPrimitive_Portal","AlertDialogPrimitive_Title","buttonVariants","AlertDialogPrimitive_Action","AlertDialogPrimitive_Cancel","AlertDialogPrimitive_Overlay","AlertDialogPortal","AlertDialogOverlay","AlertDialogPrimitive_Content","AlertDialogPrimitive_Description","DialogPrimitive_Root","DialogPrimitive_Portal","DialogPrimitive_Title","DialogPrimitive_Overlay","showCloseButton","DialogPortal","Dialog_Overlay","DialogPrimitive_Content","DialogPrimitive_Close","XIcon","DialogPrimitive_Description","PopoverPrimitive_Root","PopoverPrimitive_Portal","PopoverPortal","PopoverPrimitive_Content","PopoverPrimitive_Trigger","session","sessionStore","inputEl","killArmed","TOP_MARGIN_PX","KEYBOARD_RATIO","positionStyle","vv","sync","commit","kill","onKeydown","Dialog_Root","Dialog_Content","Dialog_Header","Dialog_Title","Dialog_Description","Dialog_Footer","fuzzyMatch","wantPositions","needle","positions","score","ti","qi","ch","found","fuzzyScore","highlightRuns","runs","cut","from","scoreCommand","cmd","nameScore","descIdx","children","CheckIcon","MinusIcon","CheckboxPrimitive_Root","sameShape","SidebarActionsStore","actions","sidebarActionsStore"],"ignoreList":[0,1,2,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,108,109,137,146],"sources":["../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/internal/shared/clone.js","../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/attachments/index.js","../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/internal/client/dom/legacy/lifecycle.js","../../../../../../src/lib/constants.ts","../../../../../../src/lib/stores/servers.svelte.ts","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/is.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/box/box-extras.svelte.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/compose-handlers.js","../../../../../../../node_modules/.bun/inline-style-parser@0.2.7/node_modules/inline-style-parser/esm/index.mjs","../../../../../../../node_modules/.bun/style-to-object@1.0.14/node_modules/style-to-object/esm/index.mjs","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/strings.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/css-to-style-obj.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/execute-callbacks.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/style-to-css.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/style.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/event-list.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/merge-props.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/sr-only-styles.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/internal/configurable-globals.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/internal/utils/dom.js","../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/reactivity/map.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/utilities/active-element/active-element.svelte.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/internal/utils/is.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/utilities/context/context.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/utilities/watch/watch.svelte.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/internal/utils/get.js","../../../../../../../node_modules/.bun/runed@0.35.1+fabb43e41e936932/node_modules/runed/dist/utilities/element-size/element-size.svelte.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/on-destroy-effect.svelte.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/after-sleep.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/after-tick.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/dom.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/dom-context.svelte.js","../../../../../../../node_modules/.bun/svelte-toolbelt@0.10.6+fabb43e41e936932/node_modules/svelte-toolbelt/dist/utils/attach-ref.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/attrs.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/kbd-constants.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/is.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/animations-complete.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/presence-manager.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/noop.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/create-id.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/dialog.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-title.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-action.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-cancel.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/portal/portal-consumer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/config/bits-config.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/config/prop-resolvers.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/portal/portal.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/debounce.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/elements.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/dom.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/menu/context-menu-attributes.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/dismissible-layer/use-dismissable-layer.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/dismissible-layer/dismissible-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/escape-layer/use-escape-layer.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/escape-layer/escape-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope-manager.js","../../../../../../../node_modules/.bun/tabbable@6.5.0/node_modules/tabbable/dist/index.esm.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/focus-scope/focus-scope.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/text-selection-layer/use-text-selection-layer.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/text-selection-layer/text-selection-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/use-id.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/shared-state.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/body-scroll-lock.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/scroll-lock/scroll-lock.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/alert-dialog/components/alert-dialog-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-overlay.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-description.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/checkbox/checkbox.svelte.js","../../../../../../../node_modules/.bun/svelte@5.57.2/node_modules/svelte/src/internal/flags/legacy.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/hidden-input.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/checkbox/components/checkbox-input.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/checkbox/components/checkbox.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/floating-root.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/floating-svelte/floating-utils.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-anchor.svelte","../../../../../../../node_modules/.bun/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../../../../../../node_modules/.bun/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../../../../../../node_modules/.bun/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../../../../../../node_modules/.bun/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/floating-svelte/use-floating.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/use-floating-layer.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/floating-layer/components/floating-layer-content-static.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer-inner.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/utilities/popper-layer/popper-layer-force-mount.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/internal/safe-polygon.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/popover/popover.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/popover/components/popover-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/popover/components/popover-trigger.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-close.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/dialog/components/dialog-content.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/popover/components/popover.svelte","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/toggle/toggle.svelte.js","../../../../../../../node_modules/.bun/bits-ui@2.19.5+f33ddd582b05d758/node_modules/bits-ui/dist/bits/toggle/components/toggle.svelte","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/defaultAttributes.js","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/Icon.svelte","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/icons/check.svelte","../../../../../../src/lib/components/side-panel/ProjectPane.svelte","../../../../../../src/lib/components/ui/toggle/toggle.svelte","../../../../../../src/lib/side-panel/highlight.ts","../../../../../../src/lib/components/side-panel/ChangesPane.svelte","../../../../../../../node_modules/.bun/svelte-sonner@1.2.1+fabb43e41e936932/node_modules/svelte-sonner/dist/internal/helpers.js","../../../../../../../node_modules/.bun/svelte-sonner@1.2.1+fabb43e41e936932/node_modules/svelte-sonner/dist/toast-state.svelte.js","../../../../../../src/lib/side-panel/shiki.ts","../../../../../../src/lib/stores/filesPane.svelte.ts","../../../../../../src/lib/components/side-panel/FilesPane.svelte","../../../../../../../src/utils/loopback.ts","../../../../../../src/lib/side-panel/web.ts","../../../../../../src/lib/stores/webPane.svelte.ts","../../../../../../src/lib/components/side-panel/WebPane.svelte","../../../../../../src/lib/side-panel/panes.ts","../../../../../../src/lib/stores/tmuxPanes.svelte.ts","../../../../../../src/lib/stores/drafts.svelte.ts","../../../../../../src/lib/stores/attachments.svelte.ts","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-portal.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-title.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-action.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-header.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-content.svelte","../../../../../../src/lib/components/ui/alert-dialog/alert-dialog-description.svelte","../../../../../../src/lib/components/ui/dialog/dialog.svelte","../../../../../../src/lib/components/ui/dialog/dialog-portal.svelte","../../../../../../src/lib/components/ui/dialog/dialog-title.svelte","../../../../../../src/lib/components/ui/dialog/dialog-footer.svelte","../../../../../../src/lib/components/ui/dialog/dialog-header.svelte","../../../../../../src/lib/components/ui/dialog/dialog-overlay.svelte","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/icons/x.svelte","../../../../../../src/lib/components/ui/dialog/dialog-content.svelte","../../../../../../src/lib/components/ui/dialog/dialog-description.svelte","../../../../../../src/lib/components/ui/popover/popover.svelte","../../../../../../src/lib/components/ui/popover/popover-portal.svelte","../../../../../../src/lib/components/ui/popover/popover-content.svelte","../../../../../../src/lib/components/ui/popover/popover-trigger.svelte","../../../../../../src/lib/components/RenameSessionDialog.svelte","../../../../../../../src/utils/fuzzy.ts","../../../../../../../node_modules/.bun/@lucide+svelte@0.561.0+fabb43e41e936932/node_modules/@lucide/svelte/dist/icons/minus.svelte","../../../../../../src/lib/components/ui/checkbox/checkbox.svelte","../../../../../../src/lib/stores/sidebarActions.svelte.ts"],"sourcesContent":["/** @import { Snapshot } from './types' */\nimport { DEV } from 'esm-env';\nimport * as w from './warnings.js';\nimport { get_prototype_of, is_array, object_prototype } from './utils.js';\n\n/**\n * In dev, we keep track of which properties could not be cloned. In prod\n * we don't bother, but we keep a dummy array around so that the\n * signature stays the same\n * @type {string[]}\n */\nconst empty = [];\n\n/**\n * @template T\n * @param {T} value\n * @param {boolean} [skip_warning]\n * @param {boolean} [no_tojson]\n * @returns {Snapshot<T>}\n */\nexport function snapshot(value, skip_warning = false, no_tojson = false) {\n\tif (DEV && !skip_warning) {\n\t\t/** @type {string[]} */\n\t\tconst paths = [];\n\n\t\tconst copy = clone(value, new Map(), '', paths, null, no_tojson);\n\t\tif (paths.length === 1 && paths[0] === '') {\n\t\t\t// value could not be cloned\n\t\t\tw.state_snapshot_uncloneable();\n\t\t} else if (paths.length > 0) {\n\t\t\t// some properties could not be cloned\n\t\t\tconst slice = paths.length > 10 ? paths.slice(0, 7) : paths.slice(0, 10);\n\t\t\tconst excess = paths.length - slice.length;\n\n\t\t\tlet uncloned = slice.map((path) => `- <value>${path}`).join('\\n');\n\t\t\tif (excess > 0) uncloned += `\\n- ...and ${excess} more`;\n\n\t\t\tw.state_snapshot_uncloneable(uncloned);\n\t\t}\n\n\t\treturn copy;\n\t}\n\n\treturn clone(value, new Map(), '', empty, null, no_tojson);\n}\n\n/**\n * @template T\n * @param {T} value\n * @param {Map<T, Snapshot<T>>} cloned\n * @param {string} path\n * @param {string[]} paths\n * @param {null | T} [original] The original value, if `value` was produced from a `toJSON` call\n * @param {boolean} [no_tojson]\n * @returns {Snapshot<T>}\n */\nfunction clone(value, cloned, path, paths, original = null, no_tojson = false) {\n\tif (typeof value === 'object' && value !== null) {\n\t\tvar unwrapped = cloned.get(value);\n\t\tif (unwrapped !== undefined) return unwrapped;\n\n\t\tif (value instanceof Map) return /** @type {Snapshot<T>} */ (new Map(value));\n\t\tif (value instanceof Set) return /** @type {Snapshot<T>} */ (new Set(value));\n\n\t\tif (is_array(value)) {\n\t\t\tvar copy = /** @type {Snapshot<any>} */ (Array(value.length));\n\t\t\tcloned.set(value, copy);\n\n\t\t\tif (original !== null) {\n\t\t\t\tcloned.set(original, copy);\n\t\t\t}\n\n\t\t\tfor (var i = 0; i < value.length; i += 1) {\n\t\t\t\tvar element = value[i];\n\t\t\t\tif (i in value) {\n\t\t\t\t\tcopy[i] = clone(element, cloned, DEV ? `${path}[${i}]` : path, paths, null, no_tojson);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn copy;\n\t\t}\n\n\t\tif (get_prototype_of(value) === object_prototype) {\n\t\t\t/** @type {Snapshot<any>} */\n\t\t\tcopy = {};\n\t\t\tcloned.set(value, copy);\n\n\t\t\tif (original !== null) {\n\t\t\t\tcloned.set(original, copy);\n\t\t\t}\n\n\t\t\tfor (var key of Object.keys(value)) {\n\t\t\t\tcopy[key] = clone(\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\tvalue[key],\n\t\t\t\t\tcloned,\n\t\t\t\t\tDEV ? `${path}.${key}` : path,\n\t\t\t\t\tpaths,\n\t\t\t\t\tnull,\n\t\t\t\t\tno_tojson\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn copy;\n\t\t}\n\n\t\tif (value instanceof Date) {\n\t\t\t// Ensure SvelteDate snapshots are tracked\n\t\t\tvalue.getTime();\n\t\t\treturn /** @type {Snapshot<T>} */ (structuredClone(value));\n\t\t}\n\n\t\tif (typeof (/** @type {T & { toJSON?: any } } */ (value).toJSON) === 'function' && !no_tojson) {\n\t\t\treturn clone(\n\t\t\t\t/** @type {T & { toJSON(): any } } */ (value).toJSON(),\n\t\t\t\tcloned,\n\t\t\t\tDEV ? `${path}.toJSON()` : path,\n\t\t\t\tpaths,\n\t\t\t\t// Associate the instance with the toJSON clone\n\t\t\t\tvalue\n\t\t\t);\n\t\t}\n\t}\n\n\tif (value instanceof EventTarget) {\n\t\t// can't be cloned\n\t\treturn /** @type {Snapshot<T>} */ (value);\n\t}\n\n\ttry {\n\t\treturn /** @type {Snapshot<T>} */ (structuredClone(value));\n\t} catch (e) {\n\t\tif (DEV) {\n\t\t\tpaths.push(path);\n\t\t}\n\n\t\treturn /** @type {Snapshot<T>} */ (value);\n\t}\n}\n","/** @import { Action, ActionReturn } from '../action/public' */\n/** @import { Attachment } from './public' */\nimport { noop, render_effect } from 'svelte/internal/client';\nimport { ATTACHMENT_KEY } from '../constants.js';\nimport { untrack } from '../index-client.js';\nimport { teardown } from '../internal/client/reactivity/effects.js';\n\n/**\n * Creates an object key that will be recognised as an attachment when the object is spread onto an element,\n * as a programmatic alternative to using `{@attach ...}`. This can be useful for library authors, though\n * is generally not needed when building an app.\n *\n * ```svelte\n * <script>\n * \timport { createAttachmentKey } from 'svelte/attachments';\n *\n * \tconst props = {\n * \t\tclass: 'cool',\n * \t\tonclick: () => alert('clicked'),\n * \t\t[createAttachmentKey()]: (node) => {\n * \t\t\tnode.textContent = 'attached!';\n * \t\t}\n * \t};\n * </script>\n *\n * <button {...props}>click me</button>\n * ```\n * @since 5.29\n */\nexport function createAttachmentKey() {\n\treturn Symbol(ATTACHMENT_KEY);\n}\n\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * <!-- with an action -->\n * <div use:foo={bar}>...</div>\n *\n * <!-- with an attachment -->\n * <div {@attach fromAction(foo, () => bar)}>...</div>\n * ```\n * @template {EventTarget} E\n * @template {unknown} T\n * @overload\n * @param {Action<E, T> | ((element: E, arg: T) => void | ActionReturn<T>)} action The action function\n * @param {() => T} fn A function that returns the argument for the action\n * @returns {Attachment<E>}\n */\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * <!-- with an action -->\n * <div use:foo={bar}>...</div>\n *\n * <!-- with an attachment -->\n * <div {@attach fromAction(foo, () => bar)}>...</div>\n * ```\n * @template {EventTarget} E\n * @overload\n * @param {Action<E, void> | ((element: E) => void | ActionReturn<void>)} action The action function\n * @returns {Attachment<E>}\n */\n/**\n * Converts an [action](https://svelte.dev/docs/svelte/use) into an [attachment](https://svelte.dev/docs/svelte/@attach) keeping the same behavior.\n * It's useful if you want to start using attachments on components but you have actions provided by a library.\n *\n * Note that the second argument, if provided, must be a function that _returns_ the argument to the\n * action function, not the argument itself.\n *\n * ```svelte\n * <!-- with an action -->\n * <div use:foo={bar}>...</div>\n *\n * <!-- with an attachment -->\n * <div {@attach fromAction(foo, () => bar)}>...</div>\n * ```\n *\n * @template {EventTarget} E\n * @template {unknown} T\n * @param {Action<E, T> | ((element: E, arg: T) => void | ActionReturn<T>)} action The action function\n * @param {() => T} fn A function that returns the argument for the action\n * @returns {Attachment<E>}\n * @since 5.32\n */\nexport function fromAction(action, fn = /** @type {() => T} */ (noop)) {\n\treturn (element) => {\n\t\tconst { update, destroy } = untrack(() => action(element, fn()) ?? {});\n\n\t\tif (update) {\n\t\t\tvar ran = false;\n\t\t\trender_effect(() => {\n\t\t\t\tconst arg = fn();\n\t\t\t\tif (ran) update(arg);\n\t\t\t});\n\t\t\tran = true;\n\t\t}\n\n\t\tif (destroy) {\n\t\t\tteardown(destroy);\n\t\t}\n\t};\n}\n","/** @import { ComponentContextLegacy } from '#client' */\nimport { run, run_all } from '../../../shared/utils.js';\nimport { component_context } from '../../context.js';\nimport { derived } from '../../reactivity/deriveds.js';\nimport { user_pre_effect, user_effect } from '../../reactivity/effects.js';\nimport { deep_read_state, get, untrack } from '../../runtime.js';\n\n/**\n * Legacy-mode only: Call `onMount` callbacks and set up `beforeUpdate`/`afterUpdate` effects\n * @param {boolean} [immutable]\n */\nexport function init(immutable = false) {\n\tconst context = /** @type {ComponentContextLegacy} */ (component_context);\n\n\tconst callbacks = context.l.u;\n\tif (!callbacks) return;\n\n\tlet props = () => deep_read_state(context.s);\n\n\tif (immutable) {\n\t\tlet version = 0;\n\t\tlet prev = /** @type {Record<string, any>} */ ({});\n\n\t\t// In legacy immutable mode, before/afterUpdate only fire if the object identity of a prop changes\n\t\tconst d = derived(() => {\n\t\t\tlet changed = false;\n\t\t\tconst props = context.s;\n\t\t\tfor (const key in props) {\n\t\t\t\tif (props[key] !== prev[key]) {\n\t\t\t\t\tprev[key] = props[key];\n\t\t\t\t\tchanged = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (changed) version++;\n\t\t\treturn version;\n\t\t});\n\n\t\tprops = () => get(d);\n\t}\n\n\t// beforeUpdate\n\tif (callbacks.b.length) {\n\t\tuser_pre_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.b);\n\t\t});\n\t}\n\n\t// onMount (must run before afterUpdate)\n\tuser_effect(() => {\n\t\tconst fns = untrack(() => callbacks.m.map(run));\n\t\treturn () => {\n\t\t\tfor (const fn of fns) {\n\t\t\t\tif (typeof fn === 'function') {\n\t\t\t\t\tfn();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t});\n\n\t// afterUpdate\n\tif (callbacks.a.length) {\n\t\tuser_effect(() => {\n\t\t\tobserve_all(context, props);\n\t\t\trun_all(callbacks.a);\n\t\t});\n\t}\n}\n\n/**\n * Invoke the getter of all signals associated with a component\n * so they can be registered to the effect this function is called in.\n * @param {ComponentContextLegacy} context\n * @param {(() => void)} props\n */\nfunction observe_all(context, props) {\n\tif (context.l.s) {\n\t\tfor (const signal of context.l.s) get(signal);\n\t}\n\n\tprops();\n}\n","export const APP_MARKER = 'claude-mux';\nexport const STORAGE_KEYS = {\n\tlastSession: 'claude-mux-last-session',\n\tservers: 'claude-mux-servers',\n\tsidebarWidth: 'claude-mux-sidebar-width'\n} as const;\n\n/** Apple keyboards say ⌘ where everyone else says Ctrl. */\nexport const IS_MAC = typeof navigator !== 'undefined' && /Mac|iPhone|iPad/.test(navigator.platform);\nexport const MOD_LABEL = IS_MAC ? '\\u2318' : 'Ctrl';\n","import { browser } from '$app/environment';\nimport { createPersisted } from './persisted';\nimport { STORAGE_KEYS } from '$lib/constants';\nimport type { DiscoverResponse, ServerInfo } from '$lib/types/servers';\n\nconst cache = createPersisted<ServerInfo[]>(STORAGE_KEYS.servers, []);\n\nfunction detectCurrent(): ServerInfo {\n\tif (!browser) return { hostname: '', url: '' };\n\tconst host = window.location.host;\n\tconst hostname = host.split(':')[0].split('.')[0];\n\tconst url = `${window.location.protocol}//${host}`;\n\treturn { hostname, url };\n}\n\nclass ServerStore {\n\tcurrent = $state<ServerInfo>({ hostname: '', url: '' });\n\tservers = $state<ServerInfo[]>([]);\n\t/**\n\t * This host's tailnet name, as discovery reports it. The page may have\n\t * been opened as `localhost`, and the server list still names the machine\n\t * by its tailnet name, so this is what tells the two apart.\n\t */\n\tself = $state('');\n\tloading = $state(false);\n\terror = $state<string | null>(null);\n\n\tinit(): void {\n\t\tthis.current = detectCurrent();\n\t\tconst cached = cache.load();\n\t\tthis.servers = cached.length > 0 ? cached : this.current.hostname ? [this.current] : [];\n\t}\n\n\tasync refresh(): Promise<void> {\n\t\tif (this.loading) return;\n\t\tthis.loading = true;\n\t\tthis.error = null;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/servers/discover');\n\t\t\tconst data = (await res.json()) as DiscoverResponse;\n\t\t\tif (!res.ok || data.error) {\n\t\t\t\tthis.error = data.error ?? `HTTP ${res.status}`;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.servers = data.servers;\n\t\t\tthis.self = data.self;\n\t\t\tcache.save(data.servers);\n\t\t} catch (err) {\n\t\t\tthis.error = err instanceof Error ? err.message : 'discover failed';\n\t\t} finally {\n\t\t\tthis.loading = false;\n\t\t}\n\t}\n}\n\nexport const serverStore = new ServerStore();\n","export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nconst CLASS_VALUE_PRIMITIVE_TYPES = [\"string\", \"number\", \"bigint\", \"boolean\"];\nexport function isClassValue(value) {\n // handle primitive types\n if (value === null || value === undefined)\n return true;\n if (CLASS_VALUE_PRIMITIVE_TYPES.includes(typeof value))\n return true;\n // handle arrays (ClassArray)\n if (Array.isArray(value))\n return value.every((item) => isClassValue(item));\n // handle objects (ClassDictionary)\n if (typeof value === \"object\") {\n // ensure it's a plain object and not some other object type\n if (Object.getPrototypeOf(value) !== Object.prototype)\n return false;\n return true;\n }\n return false;\n}\n","import { isFunction, isObject } from \"../utils/is.js\";\nexport const BoxSymbol = Symbol(\"box\");\nexport const isWritableSymbol = Symbol(\"is-writable\");\nfunction boxWith(getter, setter) {\n const derived = $derived.by(getter);\n if (setter) {\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return derived;\n },\n set current(v) {\n setter(v);\n }\n };\n }\n return {\n [BoxSymbol]: true,\n get current() {\n return getter();\n }\n };\n}\n/**\n * @returns Whether the value is a Box\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isBox(value) {\n return isObject(value) && BoxSymbol in value;\n}\n/**\n * @returns Whether the value is a WritableBox\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction isWritableBox(value) {\n return isBox(value) && isWritableSymbol in value;\n}\nfunction boxFrom(value) {\n if (isBox(value))\n return value;\n if (isFunction(value))\n return boxWith(value);\n return simpleBox(value);\n}\n/**\n * Function that gets an object of boxes, and returns an object of reactive values\n *\n * @example\n * const count = box(0)\n * const flat = box.flatten({ count, double: box.with(() => count.current) })\n * // type of flat is { count: number, readonly double: number }\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction boxFlatten(boxes) {\n return Object.entries(boxes).reduce((acc, [key, b]) => {\n if (!isBox(b)) {\n return Object.assign(acc, { [key]: b });\n }\n if (isWritableBox(b)) {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n set(v) {\n b.current = v;\n }\n });\n }\n else {\n Object.defineProperty(acc, key, {\n get() {\n return b.current;\n }\n });\n }\n return acc;\n }, {});\n}\n/**\n * Function that converts a box to a readonly box.\n *\n * @example\n * const count = box(0) // WritableBox<number>\n * const countReadonly = box.readonly(count) // ReadableBox<number>\n *\n * @see {@link https://runed.dev/docs/functions/box}\n */\nfunction toReadonlyBox(b) {\n if (!isWritableBox(b))\n return b;\n return {\n [BoxSymbol]: true,\n get current() {\n return b.current;\n }\n };\n}\nfunction simpleBox(initialValue) {\n let current = $state(initialValue);\n return {\n [BoxSymbol]: true,\n [isWritableSymbol]: true,\n get current() {\n return current;\n },\n set current(v) {\n current = v;\n }\n };\n}\nexport { boxWith, isBox, isWritableBox, boxFrom, boxFlatten, toReadonlyBox, simpleBox };\n","/**\n * Composes event handlers into a single function that can be called with an event.\n * If the previous handler cancels the event using `event.preventDefault()`, the handlers\n * that follow will not be called.\n */\nexport function composeHandlers(...handlers) {\n return function (e) {\n for (const handler of handlers) {\n if (!handler)\n continue;\n if (e.defaultPrevented)\n return;\n if (typeof handler === \"function\") {\n handler.call(this, e);\n }\n else {\n handler.current?.call(this, e);\n }\n }\n };\n}\n","// http://www.w3.org/TR/CSS21/grammar.html\n// https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027\nvar COMMENT_REGEX = /\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\//g;\n\nvar NEWLINE_REGEX = /\\n/g;\nvar WHITESPACE_REGEX = /^\\s*/;\n\n// declaration\nvar PROPERTY_REGEX = /^(\\*?[-#/*\\\\\\w]+(\\[[0-9a-z_-]+\\])?)\\s*/;\nvar COLON_REGEX = /^:\\s*/;\nvar VALUE_REGEX = /^((?:'(?:\\\\'|.)*?'|\"(?:\\\\\"|.)*?\"|\\([^)]*?\\)|[^};])+)/;\nvar SEMICOLON_REGEX = /^[;\\s]*/;\n\n// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim#Polyfill\nvar TRIM_REGEX = /^\\s+|\\s+$/g;\n\n// strings\nvar NEWLINE = '\\n';\nvar FORWARD_SLASH = '/';\nvar ASTERISK = '*';\nvar EMPTY_STRING = '';\n\n// types\nvar TYPE_COMMENT = 'comment';\nvar TYPE_DECLARATION = 'declaration';\n\n/**\n * @param {String} style\n * @param {Object} [options]\n * @return {Object[]}\n * @throws {TypeError}\n * @throws {Error}\n */\nfunction index (style, options) {\n if (typeof style !== 'string') {\n throw new TypeError('First argument must be a string');\n }\n\n if (!style) return [];\n\n options = options || {};\n\n /**\n * Positional.\n */\n var lineno = 1;\n var column = 1;\n\n /**\n * Update lineno and column based on `str`.\n *\n * @param {String} str\n */\n function updatePosition(str) {\n var lines = str.match(NEWLINE_REGEX);\n if (lines) lineno += lines.length;\n var i = str.lastIndexOf(NEWLINE);\n column = ~i ? str.length - i : column + str.length;\n }\n\n /**\n * Mark position and patch `node.position`.\n *\n * @return {Function}\n */\n function position() {\n var start = { line: lineno, column: column };\n return function (node) {\n node.position = new Position(start);\n whitespace();\n return node;\n };\n }\n\n /**\n * Store position information for a node.\n *\n * @constructor\n * @property {Object} start\n * @property {Object} end\n * @property {undefined|String} source\n */\n function Position(start) {\n this.start = start;\n this.end = { line: lineno, column: column };\n this.source = options.source;\n }\n\n /**\n * Non-enumerable source string.\n */\n Position.prototype.content = style;\n\n /**\n * Error `msg`.\n *\n * @param {String} msg\n * @throws {Error}\n */\n function error(msg) {\n var err = new Error(\n options.source + ':' + lineno + ':' + column + ': ' + msg\n );\n err.reason = msg;\n err.filename = options.source;\n err.line = lineno;\n err.column = column;\n err.source = style;\n\n if (options.silent) ; else {\n throw err;\n }\n }\n\n /**\n * Match `re` and return captures.\n *\n * @param {RegExp} re\n * @return {undefined|Array}\n */\n function match(re) {\n var m = re.exec(style);\n if (!m) return;\n var str = m[0];\n updatePosition(str);\n style = style.slice(str.length);\n return m;\n }\n\n /**\n * Parse whitespace.\n */\n function whitespace() {\n match(WHITESPACE_REGEX);\n }\n\n /**\n * Parse comments.\n *\n * @param {Object[]} [rules]\n * @return {Object[]}\n */\n function comments(rules) {\n var c;\n rules = rules || [];\n while ((c = comment())) {\n if (c !== false) {\n rules.push(c);\n }\n }\n return rules;\n }\n\n /**\n * Parse comment.\n *\n * @return {Object}\n * @throws {Error}\n */\n function comment() {\n var pos = position();\n if (FORWARD_SLASH != style.charAt(0) || ASTERISK != style.charAt(1)) return;\n\n var i = 2;\n while (\n EMPTY_STRING != style.charAt(i) &&\n (ASTERISK != style.charAt(i) || FORWARD_SLASH != style.charAt(i + 1))\n ) {\n ++i;\n }\n i += 2;\n\n if (EMPTY_STRING === style.charAt(i - 1)) {\n return error('End of comment missing');\n }\n\n var str = style.slice(2, i - 2);\n column += 2;\n updatePosition(str);\n style = style.slice(i);\n column += 2;\n\n return pos({\n type: TYPE_COMMENT,\n comment: str\n });\n }\n\n /**\n * Parse declaration.\n *\n * @return {Object}\n * @throws {Error}\n */\n function declaration() {\n var pos = position();\n\n // prop\n var prop = match(PROPERTY_REGEX);\n if (!prop) return;\n comment();\n\n // :\n if (!match(COLON_REGEX)) return error(\"property missing ':'\");\n\n // val\n var val = match(VALUE_REGEX);\n\n var ret = pos({\n type: TYPE_DECLARATION,\n property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)),\n value: val\n ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING))\n : EMPTY_STRING\n });\n\n // ;\n match(SEMICOLON_REGEX);\n\n return ret;\n }\n\n /**\n * Parse declarations.\n *\n * @return {Object[]}\n */\n function declarations() {\n var decls = [];\n\n comments(decls);\n\n // declarations\n var decl;\n while ((decl = declaration())) {\n if (decl !== false) {\n decls.push(decl);\n comments(decls);\n }\n }\n\n return decls;\n }\n\n whitespace();\n return declarations();\n}\n\n/**\n * Trim `str`.\n *\n * @param {String} str\n * @return {String}\n */\nfunction trim(str) {\n return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING;\n}\n\nexport { index as default };\n//# sourceMappingURL=index.mjs.map\n","import parse from 'inline-style-parser';\n\n/**\n * Parses inline style to object.\n *\n * @param style - Inline style.\n * @param iterator - Iterator.\n * @returns - Style object or null.\n *\n * @example Parsing inline style to object:\n *\n * ```js\n * import parse from 'style-to-object';\n * parse('line-height: 42;'); // { 'line-height': '42' }\n * ```\n */\nfunction StyleToObject(style, iterator) {\n let styleObject = null;\n if (!style || typeof style !== 'string') {\n return styleObject;\n }\n const declarations = parse(style);\n const hasIterator = typeof iterator === 'function';\n declarations.forEach((declaration) => {\n if (declaration.type !== 'declaration') {\n return;\n }\n const { property, value } = declaration;\n if (hasIterator) {\n iterator(property, value, declaration);\n }\n else if (value) {\n styleObject = styleObject || {};\n styleObject[property] = value;\n }\n });\n return styleObject;\n}\n\nexport { StyleToObject as default };\n//# sourceMappingURL=index.mjs.map\n","const NUMBER_CHAR_RE = /\\d/;\nconst STR_SPLITTERS = [\"-\", \"_\", \"/\", \".\"];\nfunction isUppercase(char = \"\") {\n if (NUMBER_CHAR_RE.test(char))\n return undefined;\n return char !== char.toLowerCase();\n}\nfunction splitByCase(str) {\n const parts = [];\n let buff = \"\";\n let previousUpper;\n let previousSplitter;\n for (const char of str) {\n // Splitter\n const isSplitter = STR_SPLITTERS.includes(char);\n if (isSplitter === true) {\n parts.push(buff);\n buff = \"\";\n previousUpper = undefined;\n continue;\n }\n const isUpper = isUppercase(char);\n if (previousSplitter === false) {\n // Case rising edge\n if (previousUpper === false && isUpper === true) {\n parts.push(buff);\n buff = char;\n previousUpper = isUpper;\n continue;\n }\n // Case falling edge\n if (previousUpper === true && isUpper === false && buff.length > 1) {\n const lastChar = buff.at(-1);\n parts.push(buff.slice(0, Math.max(0, buff.length - 1)));\n buff = lastChar + char;\n previousUpper = isUpper;\n continue;\n }\n }\n // Normal char\n buff += char;\n previousUpper = isUpper;\n previousSplitter = isSplitter;\n }\n parts.push(buff);\n return parts;\n}\nexport function pascalCase(str) {\n if (!str)\n return \"\";\n return splitByCase(str)\n .map((p) => upperFirst(p))\n .join(\"\");\n}\nexport function camelCase(str) {\n return lowerFirst(pascalCase(str || \"\"));\n}\nexport function kebabCase(str) {\n return str\n ? splitByCase(str)\n .map((p) => p.toLowerCase())\n .join(\"-\")\n : \"\";\n}\nfunction upperFirst(str) {\n return str ? str[0].toUpperCase() + str.slice(1) : \"\";\n}\nfunction lowerFirst(str) {\n return str ? str[0].toLowerCase() + str.slice(1) : \"\";\n}\n","import parse from \"style-to-object\";\nimport { camelCase, pascalCase } from \"./strings.js\";\nexport function cssToStyleObj(css) {\n if (!css)\n return {};\n const styleObj = {};\n function iterator(name, value) {\n if (name.startsWith(\"-moz-\") ||\n name.startsWith(\"-webkit-\") ||\n name.startsWith(\"-ms-\") ||\n name.startsWith(\"-o-\")) {\n styleObj[pascalCase(name)] = value;\n return;\n }\n if (name.startsWith(\"--\")) {\n styleObj[name] = value;\n return;\n }\n styleObj[camelCase(name)] = value;\n }\n parse(css, iterator);\n return styleObj;\n}\n","/**\n * Executes an array of callback functions with the same arguments.\n * @template T The types of the arguments that the callback functions take.\n * @param callbacks array of callback functions to execute.\n * @returns A new function that executes all of the original callback functions with the same arguments.\n */\nexport function executeCallbacks(...callbacks) {\n return (...args) => {\n for (const callback of callbacks) {\n if (typeof callback === \"function\") {\n callback(...args);\n }\n }\n };\n}\n","function createParser(matcher, replacer) {\n const regex = RegExp(matcher, \"g\");\n return (str) => {\n // throw an error if not a string\n if (typeof str !== \"string\") {\n throw new TypeError(`expected an argument of type string, but got ${typeof str}`);\n }\n // if no match between string and matcher\n if (!str.match(regex))\n return str;\n // executes the replacer function for each match\n return str.replace(regex, replacer);\n };\n}\nconst camelToKebab = createParser(/[A-Z]/, (match) => `-${match.toLowerCase()}`);\nexport function styleToCSS(styleObj) {\n if (!styleObj || typeof styleObj !== \"object\" || Array.isArray(styleObj)) {\n throw new TypeError(`expected an argument of type object, but got ${typeof styleObj}`);\n }\n return Object.keys(styleObj)\n .map((property) => `${camelToKebab(property)}: ${styleObj[property]};`)\n .join(\"\\n\");\n}\n","import { styleToCSS } from \"./style-to-css.js\";\nexport function styleToString(style = {}) {\n return styleToCSS(style).replace(\"\\n\", \" \");\n}\n","const EVENT_LIST = [\n \"onabort\",\n \"onanimationcancel\",\n \"onanimationend\",\n \"onanimationiteration\",\n \"onanimationstart\",\n \"onauxclick\",\n \"onbeforeinput\",\n \"onbeforetoggle\",\n \"onblur\",\n \"oncancel\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"onchange\",\n \"onclick\",\n \"onclose\",\n \"oncompositionend\",\n \"oncompositionstart\",\n \"oncompositionupdate\",\n \"oncontextlost\",\n \"oncontextmenu\",\n \"oncontextrestored\",\n \"oncopy\",\n \"oncuechange\",\n \"oncut\",\n \"ondblclick\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onended\",\n \"onerror\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onformdata\",\n \"ongotpointercapture\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadstart\",\n \"onlostpointercapture\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onprogress\",\n \"onratechange\",\n \"onreset\",\n \"onresize\",\n \"onscroll\",\n \"onscrollend\",\n \"onsecuritypolicyviolation\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onslotchange\",\n \"onstalled\",\n \"onsubmit\",\n \"onsuspend\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitioncancel\",\n \"ontransitionend\",\n \"ontransitionrun\",\n \"ontransitionstart\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwebkitanimationend\",\n \"onwebkitanimationiteration\",\n \"onwebkitanimationstart\",\n \"onwebkittransitionend\",\n \"onwheel\"\n];\nexport const EVENT_LIST_SET = new Set(EVENT_LIST);\n","/**\n * Modified from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/utils/src/mergeProps.ts (see NOTICE.txt for source)\n */\nimport { clsx } from \"clsx\";\nimport { composeHandlers } from \"./compose-handlers.js\";\nimport { cssToStyleObj } from \"./css-to-style-obj.js\";\nimport { isClassValue } from \"./is.js\";\nimport { executeCallbacks } from \"./execute-callbacks.js\";\nimport { styleToString } from \"./style.js\";\nimport { EVENT_LIST_SET } from \"./event-list.js\";\nfunction isEventHandler(key) {\n return EVENT_LIST_SET.has(key);\n}\n/**\n * Given a list of prop objects, merges them into a single object.\n * - Automatically composes event handlers (e.g. `onclick`, `oninput`, etc.)\n * - Chains regular functions with the same name so they are called in order\n * - Merges class strings with `clsx`\n * - Merges style objects and converts them to strings\n * - Handles a bug with Svelte where setting the `hidden` attribute to `false` doesn't remove it\n * - Overrides other values with the last one\n */\nexport function mergeProps(...args) {\n const result = { ...args[0] };\n for (let i = 1; i < args.length; i++) {\n const props = args[i];\n if (!props)\n continue;\n // Handle string keys\n for (const key of Object.keys(props)) {\n const a = result[key];\n const b = props[key];\n const aIsFunction = typeof a === \"function\";\n const bIsFunction = typeof b === \"function\";\n // compose event handlers\n if (aIsFunction && typeof bIsFunction && isEventHandler(key)) {\n // handle merging of event handlers\n const aHandler = a;\n const bHandler = b;\n result[key] = composeHandlers(aHandler, bHandler);\n }\n else if (aIsFunction && bIsFunction) {\n // chain non-event handler functions\n result[key] = executeCallbacks(a, b);\n }\n else if (key === \"class\") {\n // handle merging acceptable class values from clsx\n const aIsClassValue = isClassValue(a);\n const bIsClassValue = isClassValue(b);\n if (aIsClassValue && bIsClassValue) {\n result[key] = clsx(a, b);\n }\n else if (aIsClassValue) {\n result[key] = clsx(a);\n }\n else if (bIsClassValue) {\n result[key] = clsx(b);\n }\n }\n else if (key === \"style\") {\n const aIsObject = typeof a === \"object\";\n const bIsObject = typeof b === \"object\";\n const aIsString = typeof a === \"string\";\n const bIsString = typeof b === \"string\";\n if (aIsObject && bIsObject) {\n // both are style objects, merge them\n result[key] = { ...a, ...b };\n }\n else if (aIsObject && bIsString) {\n // a is style object, b is string, convert b to style object and merge\n const parsedStyle = cssToStyleObj(b);\n result[key] = { ...a, ...parsedStyle };\n }\n else if (aIsString && bIsObject) {\n // a is string, b is style object, convert a to style object and merge\n const parsedStyle = cssToStyleObj(a);\n result[key] = { ...parsedStyle, ...b };\n }\n else if (aIsString && bIsString) {\n // both are strings, convert both to objects and merge\n const parsedStyleA = cssToStyleObj(a);\n const parsedStyleB = cssToStyleObj(b);\n result[key] = { ...parsedStyleA, ...parsedStyleB };\n }\n else if (aIsObject) {\n result[key] = a;\n }\n else if (bIsObject) {\n result[key] = b;\n }\n else if (aIsString) {\n result[key] = a;\n }\n else if (bIsString) {\n result[key] = b;\n }\n }\n else {\n // override other values\n result[key] = b !== undefined ? b : a;\n }\n }\n // handle symbol keys (mostly for `Attachments`)\n for (const key of Object.getOwnPropertySymbols(props)) {\n const a = result[key];\n const b = props[key];\n // for matching symbols, we just override\n result[key] = b !== undefined ? b : a;\n }\n }\n // convert style object to string\n if (typeof result.style === \"object\") {\n result.style = styleToString(result.style).replaceAll(\"\\n\", \" \");\n }\n // handle weird svelte bug where `hidden` is not removed when set to `false`\n if (result.hidden === false) {\n result.hidden = undefined;\n delete result.hidden;\n }\n // handle weird svelte bug where `disabled` is not removed when set to `false`\n if (result.disabled === false) {\n result.disabled = undefined;\n delete result.disabled;\n }\n return result;\n}\n","import { styleToString } from \"./style.js\";\nexport const srOnlyStyles = {\n position: \"absolute\",\n width: \"1px\",\n height: \"1px\",\n padding: \"0\",\n margin: \"-1px\",\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n borderWidth: \"0\",\n transform: \"translateX(-100%)\"\n};\nexport const srOnlyStylesString = styleToString(srOnlyStyles);\n","import { BROWSER } from \"esm-env\";\nexport const defaultWindow = BROWSER && typeof window !== \"undefined\" ? window : undefined;\nexport const defaultDocument = BROWSER && typeof window !== \"undefined\" ? window.document : undefined;\nexport const defaultNavigator = BROWSER && typeof window !== \"undefined\" ? window.navigator : undefined;\nexport const defaultLocation = BROWSER && typeof window !== \"undefined\" ? window.location : undefined;\n","import { defaultDocument } from \"../configurable-globals.js\";\n/**\n * Handles getting the active element in a document or shadow root.\n * If the active element is within a shadow root, it will traverse the shadow root\n * to find the active element.\n * If not, it will return the active element in the document.\n *\n * @param document A document or shadow root to get the active element from.\n * @returns The active element in the document or shadow root.\n */\nexport function getActiveElement(document) {\n let activeElement = document.activeElement;\n while (activeElement?.shadowRoot) {\n const node = activeElement.shadowRoot.activeElement;\n if (node === activeElement)\n break;\n else\n activeElement = node;\n }\n return activeElement;\n}\n/**\n * Returns the owner document of a given element.\n *\n * @param node The element to get the owner document from.\n * @returns\n */\nexport function getOwnerDocument(node, fallback = defaultDocument) {\n return node?.ownerDocument ?? fallback;\n}\n/**\n * Checks if an element is or is contained by another element.\n *\n * @param node The element to check if it or its descendants contain the target element.\n * @param target The element to check if it is contained by the node.\n * @returns\n */\nexport function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\n","/** @import { Source } from '#client' */\nimport { DEV } from 'esm-env';\nimport { set, source, state, increment } from '../internal/client/reactivity/sources.js';\nimport { label, tag } from '../internal/client/dev/tracing.js';\nimport { get, update_version } from '../internal/client/runtime.js';\n\n/**\n * A reactive version of the built-in [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) object.\n * Reading contents of the map (by iterating, or by reading `map.size` or calling `map.get(...)` or `map.has(...)` as in the [tic-tac-toe example](https://svelte.dev/playground/0b0ff4aa49c9443f9b47fe5203c78293) below) in an [effect](https://svelte.dev/docs/svelte/$effect) or [derived](https://svelte.dev/docs/svelte/$derived)\n * will cause it to be re-evaluated as necessary when the map is updated.\n *\n * Note that values in a reactive map are _not_ made [deeply reactive](https://svelte.dev/docs/svelte/$state#Deep-state).\n *\n * ```svelte\n * <script>\n * \timport { SvelteMap } from 'svelte/reactivity';\n * \timport { result } from './game.js';\n *\n * \tlet board = new SvelteMap();\n * \tlet player = $state('x');\n * \tlet winner = $derived(result(board));\n *\n * \tfunction reset() {\n * \t\tplayer = 'x';\n * \t\tboard.clear();\n * \t}\n * </script>\n *\n * <div class=\"board\">\n * \t{#each Array(9), i}\n * \t\t<button\n * \t\t\tdisabled={board.has(i) || winner}\n * \t\t\tonclick={() => {\n * \t\t\t\tboard.set(i, player);\n * \t\t\t\tplayer = player === 'x' ? 'o' : 'x';\n * \t\t\t}}\n * \t\t>{board.get(i)}</button>\n * \t{/each}\n * </div>\n *\n * {#if winner}\n * \t<p>{winner} wins!</p>\n * \t<button onclick={reset}>reset</button>\n * {:else}\n * \t<p>{player} is next</p>\n * {/if}\n * ```\n *\n * @template K\n * @template V\n * @extends {Map<K, V>}\n */\nexport class SvelteMap extends Map {\n\t/** @type {Map<K, Source<number>>} */\n\t#sources = new Map();\n\t#version = state(0);\n\t#size = state(0);\n\t#update_version = update_version || -1;\n\n\t/**\n\t * @param {Iterable<readonly [K, V]> | null | undefined} [value]\n\t */\n\tconstructor(value) {\n\t\tsuper();\n\n\t\tif (DEV) {\n\t\t\t// If the value is invalid then the native exception will fire here\n\t\t\tvalue = new Map(value);\n\n\t\t\ttag(this.#version, 'SvelteMap version');\n\t\t\ttag(this.#size, 'SvelteMap.size');\n\t\t}\n\n\t\tif (value) {\n\t\t\tfor (var [key, v] of value) {\n\t\t\t\tsuper.set(key, v);\n\t\t\t}\n\t\t\tthis.#size.v = super.size;\n\t\t}\n\t}\n\n\t/**\n\t * If the source is being created inside the same reaction as the SvelteMap instance,\n\t * we use `state` so that it will not be a dependency of the reaction. Otherwise we\n\t * use `source` so it will be.\n\t *\n\t * @template T\n\t * @param {T} value\n\t * @returns {Source<T>}\n\t */\n\t#source(value) {\n\t\treturn update_version === this.#update_version ? state(value) : source(value);\n\t}\n\n\t/** @param {K} key */\n\thas(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\n\t\tif (s === undefined) {\n\t\t\tif (super.has(key)) {\n\t\t\t\ts = this.#source(0);\n\n\t\t\t\tif (DEV) {\n\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t}\n\n\t\t\t\tsources.set(key, s);\n\t\t\t} else {\n\t\t\t\t// We should always track the version in case\n\t\t\t\t// the Set ever gets this value in the future.\n\t\t\t\tget(this.#version);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tget(s);\n\t\treturn true;\n\t}\n\n\t/**\n\t * @param {(value: V, key: K, map: Map<K, V>) => void} callbackfn\n\t * @param {any} [this_arg]\n\t */\n\tforEach(callbackfn, this_arg) {\n\t\tthis.#read_all();\n\t\tsuper.forEach(callbackfn, this_arg);\n\t}\n\n\t/** @param {K} key */\n\tget(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\n\t\tif (s === undefined) {\n\t\t\tif (super.has(key)) {\n\t\t\t\ts = this.#source(0);\n\n\t\t\t\tif (DEV) {\n\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t}\n\n\t\t\t\tsources.set(key, s);\n\t\t\t} else {\n\t\t\t\t// We should always track the version in case\n\t\t\t\t// the Set ever gets this value in the future.\n\t\t\t\tget(this.#version);\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t}\n\n\t\tget(s);\n\t\treturn super.get(key);\n\t}\n\n\t/**\n\t * @param {K} key\n\t * @param {V} value\n\t * */\n\tgetOrInsert(key, value) {\n\t\tif (!super.has(key)) {\n\t\t\tthis.set(key, value);\n\t\t}\n\t\treturn /** @type {V} */ (this.get(key));\n\t}\n\n\t/**\n\t * @param {K} key\n\t * @param {(key: K) => V} callbackFn\n\t */\n\tgetOrInsertComputed(key, callbackFn) {\n\t\tif (!super.has(key)) {\n\t\t\tthis.set(key, callbackFn(key));\n\t\t}\n\t\treturn /** @type {V} */ (this.get(key));\n\t}\n\n\t/**\n\t * @param {K} key\n\t * @param {V} value\n\t * */\n\tset(key, value) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\t\tvar prev_res = super.get(key);\n\t\tvar res = super.set(key, value);\n\t\tvar version = this.#version;\n\n\t\tif (s === undefined) {\n\t\t\ts = this.#source(0);\n\n\t\t\tif (DEV) {\n\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t}\n\n\t\t\tsources.set(key, s);\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(version);\n\t\t} else if (prev_res !== value) {\n\t\t\tincrement(s);\n\n\t\t\t// if not every reaction of s is a reaction of version we need to also include version\n\t\t\tvar v_reactions = version.reactions === null ? null : new Set(version.reactions);\n\t\t\tvar needs_version_increase =\n\t\t\t\tv_reactions === null ||\n\t\t\t\t!s.reactions?.every((r) =>\n\t\t\t\t\t/** @type {NonNullable<typeof v_reactions>} */ (v_reactions).has(r)\n\t\t\t\t);\n\t\t\tif (needs_version_increase) {\n\t\t\t\tincrement(version);\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}\n\n\t/** @param {K} key */\n\tdelete(key) {\n\t\tvar sources = this.#sources;\n\t\tvar s = sources.get(key);\n\t\tvar res = super.delete(key);\n\n\t\tif (s !== undefined) {\n\t\t\tsources.delete(key);\n\t\t\tset(s, -1);\n\t\t}\n\n\t\tif (res) {\n\t\t\tset(this.#size, super.size);\n\t\t\tincrement(this.#version);\n\t\t}\n\n\t\treturn res;\n\t}\n\n\tclear() {\n\t\tif (super.size === 0) {\n\t\t\treturn;\n\t\t}\n\t\t// Clear first, so we get nice console.log outputs with $inspect\n\t\tsuper.clear();\n\t\tvar sources = this.#sources;\n\t\tset(this.#size, 0);\n\t\tfor (var s of sources.values()) {\n\t\t\tset(s, -1);\n\t\t}\n\t\tincrement(this.#version);\n\t\tsources.clear();\n\t}\n\n\t#read_all() {\n\t\tget(this.#version);\n\n\t\tvar sources = this.#sources;\n\t\tif (this.#size.v !== sources.size) {\n\t\t\tfor (var key of super.keys()) {\n\t\t\t\tif (!sources.has(key)) {\n\t\t\t\t\tvar s = this.#source(0);\n\t\t\t\t\tif (DEV) {\n\t\t\t\t\t\ttag(s, `SvelteMap get(${label(key)})`);\n\t\t\t\t\t}\n\n\t\t\t\t\tsources.set(key, s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor ([, s] of this.#sources) {\n\t\t\tget(s);\n\t\t}\n\t}\n\n\tkeys() {\n\t\tget(this.#version);\n\t\treturn super.keys();\n\t}\n\n\tvalues() {\n\t\tthis.#read_all();\n\t\treturn super.values();\n\t}\n\n\tentries() {\n\t\tthis.#read_all();\n\t\treturn super.entries();\n\t}\n\n\t[Symbol.iterator]() {\n\t\treturn this.entries();\n\t}\n\n\tget size() {\n\t\tget(this.#size);\n\t\treturn super.size;\n\t}\n}\n","import { defaultWindow, } from \"../../internal/configurable-globals.js\";\nimport { getActiveElement } from \"../../internal/utils/dom.js\";\nimport { on } from \"svelte/events\";\nimport { createSubscriber } from \"svelte/reactivity\";\nexport class ActiveElement {\n #document;\n #subscribe;\n constructor(options = {}) {\n const { window = defaultWindow, document = window?.document } = options;\n if (window === undefined)\n return;\n this.#document = document;\n this.#subscribe = createSubscriber((update) => {\n const cleanupFocusIn = on(window, \"focusin\", update);\n const cleanupFocusOut = on(window, \"focusout\", update);\n return () => {\n cleanupFocusIn();\n cleanupFocusOut();\n };\n });\n }\n get current() {\n this.#subscribe?.();\n if (!this.#document)\n return null;\n return getActiveElement(this.#document);\n }\n}\n/**\n * An object holding a reactive value that is equal to `document.activeElement`.\n * It automatically listens for changes, keeping the reference up to date.\n *\n * If you wish to use a custom document or shadowRoot, you should use\n * [useActiveElement](https://runed.dev/docs/utilities/active-element) instead.\n *\n * @see {@link https://runed.dev/docs/utilities/active-element}\n */\nexport const activeElement = new ActiveElement();\n","export function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isObject(value) {\n return value !== null && typeof value === \"object\";\n}\nexport function isElement(value) {\n return value instanceof Element;\n}\n","import { getContext, hasContext, setContext } from \"svelte\";\nexport class Context {\n #name;\n #key;\n /**\n * @param name The name of the context.\n * This is used for generating the context key and error messages.\n */\n constructor(name) {\n this.#name = name;\n this.#key = Symbol(name);\n }\n /**\n * The key used to get and set the context.\n *\n * It is not recommended to use this value directly.\n * Instead, use the methods provided by this class.\n */\n get key() {\n return this.#key;\n }\n /**\n * Checks whether this has been set in the context of a parent component.\n *\n * Must be called during component initialisation.\n */\n exists() {\n return hasContext(this.#key);\n }\n /**\n * Retrieves the context that belongs to the closest parent component.\n *\n * Must be called during component initialisation.\n *\n * @throws An error if the context does not exist.\n */\n get() {\n const context = getContext(this.#key);\n if (context === undefined) {\n throw new Error(`Context \"${this.#name}\" not found`);\n }\n return context;\n }\n /**\n * Retrieves the context that belongs to the closest parent component,\n * or the given fallback value if the context does not exist.\n *\n * Must be called during component initialisation.\n */\n getOr(fallback) {\n const context = getContext(this.#key);\n if (context === undefined) {\n return fallback;\n }\n return context;\n }\n /**\n * Associates the given value with the current component and returns it.\n *\n * Must be called during component initialisation.\n */\n set(context) {\n return setContext(this.#key, context);\n }\n}\n","import { untrack } from \"svelte\";\nfunction runEffect(flush, effect) {\n switch (flush) {\n case \"post\":\n $effect(effect);\n break;\n case \"pre\":\n $effect.pre(effect);\n break;\n }\n}\nfunction runWatcher(sources, flush, effect, options = {}) {\n const { lazy = false } = options;\n // Run the effect immediately if `lazy` is `false`.\n let active = !lazy;\n // On the first run, if the dependencies are an array, pass an empty array\n // to the previous value instead of `undefined` to allow destructuring.\n //\n // watch(() => [a, b], ([a, b], [prevA, prevB]) => { ... });\n let previousValues = Array.isArray(sources)\n ? []\n : undefined;\n runEffect(flush, () => {\n const values = Array.isArray(sources) ? sources.map((source) => source()) : sources();\n if (!active) {\n active = true;\n previousValues = values;\n return;\n }\n const cleanup = untrack(() => effect(values, previousValues));\n previousValues = values;\n return cleanup;\n });\n}\nfunction runWatcherOnce(sources, flush, effect) {\n const cleanupRoot = $effect.root(() => {\n let stop = false;\n runWatcher(sources, flush, (values, previousValues) => {\n if (stop) {\n cleanupRoot();\n return;\n }\n // Since `lazy` is `true`, `previousValues` is always defined.\n const cleanup = effect(values, previousValues);\n stop = true;\n return cleanup;\n }, \n // Running the effect immediately just once makes no sense at all.\n // That's just `onMount` with extra steps.\n { lazy: true });\n });\n $effect(() => {\n return cleanupRoot;\n });\n}\nexport function watch(sources, effect, options) {\n runWatcher(sources, \"post\", effect, options);\n}\nfunction watchPre(sources, effect, options) {\n runWatcher(sources, \"pre\", effect, options);\n}\nwatch.pre = watchPre;\nexport function watchOnce(source, effect) {\n runWatcherOnce(source, \"post\", effect);\n}\nfunction watchOncePre(source, effect) {\n runWatcherOnce(source, \"pre\", effect);\n}\nwatchOnce.pre = watchOncePre;\n","import { isFunction } from \"./is.js\";\nexport function get(value) {\n if (isFunction(value)) {\n return value();\n }\n return value;\n}\n","import { defaultWindow } from \"../../internal/configurable-globals.js\";\nimport { get } from \"../../internal/utils/get.js\";\nimport { createSubscriber } from \"svelte/reactivity\";\n/**\n * Returns a reactive value holding the size of `node`.\n *\n * Accepts an `options` object with the following properties:\n * - `initialSize`: The initial size of the element. Defaults to `{ width: 0, height: 0 }`.\n * - `box`: The box model to use. Can be either `\"content-box\"` or `\"border-box\"`. Defaults to `\"border-box\"`.\n *\n * @returns an object with `width` and `height` properties.\n *\n * @see {@link https://runed.dev/docs/utilities/element-size}\n */\nexport class ElementSize {\n // no need to use `$state` here since we are using createSubscriber\n #size = {\n width: 0,\n height: 0,\n };\n #observed = false;\n #options;\n #node;\n #window;\n // we use a derived here to extract the width so that if the width doesn't change we don't get a state update\n // which we would get if we would just use a getter since the version of the subscriber will be changing\n #width = $derived.by(() => {\n this.#subscribe?.();\n return this.getSize().width;\n });\n // we use a derived here to extract the height so that if the height doesn't change we don't get a state update\n // which we would get if we would just use a getter since the version of the subscriber will be changing\n #height = $derived.by(() => {\n this.#subscribe?.();\n return this.getSize().height;\n });\n // we need to use a derived here because the class will be created before the node is bound to the ref\n #subscribe = $derived.by(() => {\n const node$ = get(this.#node);\n if (!node$)\n return;\n return createSubscriber((update) => {\n if (!this.#window)\n return;\n const observer = new this.#window.ResizeObserver((entries) => {\n this.#observed = true;\n for (const entry of entries) {\n const boxSize = this.#options.box === \"content-box\" ? entry.contentBoxSize : entry.borderBoxSize;\n const boxSizeArr = Array.isArray(boxSize) ? boxSize : [boxSize];\n this.#size.width = boxSizeArr.reduce((acc, size) => Math.max(acc, size.inlineSize), 0);\n this.#size.height = boxSizeArr.reduce((acc, size) => Math.max(acc, size.blockSize), 0);\n }\n update();\n });\n observer.observe(node$);\n return () => {\n this.#observed = false;\n observer.disconnect();\n };\n });\n });\n constructor(node, options = { box: \"border-box\" }) {\n this.#window = options.window ?? defaultWindow;\n this.#options = options;\n this.#node = node;\n this.#size = {\n width: 0,\n height: 0,\n };\n }\n calculateSize() {\n const element = get(this.#node);\n // no element or no window, return undefined, we will return 0x0 in the getSize method\n if (!element || !this.#window) {\n return;\n }\n const offsetWidth = element.offsetWidth;\n const offsetHeight = element.offsetHeight;\n // easy mode, just return offsets\n if (this.#options.box === \"border-box\") {\n return {\n width: offsetWidth,\n height: offsetHeight,\n };\n }\n // hard mode, we need to calculate the content size\n const style = this.#window.getComputedStyle(element);\n const paddingWidth = parseFloat(style.paddingLeft) + parseFloat(style.paddingRight);\n const paddingHeight = parseFloat(style.paddingTop) + parseFloat(style.paddingBottom);\n const borderWidth = parseFloat(style.borderLeftWidth) + parseFloat(style.borderRightWidth);\n const borderHeight = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n const contentWidth = offsetWidth - paddingWidth - borderWidth;\n const contentHeight = offsetHeight - paddingHeight - borderHeight;\n return {\n width: contentWidth,\n height: contentHeight,\n };\n }\n getSize() {\n // if the resize observer already run we can just return the size\n // otherwise we calculate the size if possible or we return the initial size\n return this.#observed ? this.#size : (this.calculateSize() ?? this.#size);\n }\n get current() {\n this.#subscribe?.();\n return this.getSize();\n }\n get width() {\n return this.#width;\n }\n get height() {\n return this.#height;\n }\n}\n","export function onDestroyEffect(fn) {\n $effect(() => {\n return () => {\n fn();\n };\n });\n}\n","/**\n * A utility function that executes a callback after a specified number of milliseconds.\n */\nexport function afterSleep(ms, cb) {\n return setTimeout(cb, ms);\n}\n","import { tick } from \"svelte\";\nexport function afterTick(fn) {\n tick().then(fn);\n}\n","import { isObject } from \"./is.js\";\nconst ELEMENT_NODE = 1;\nconst DOCUMENT_NODE = 9;\nconst DOCUMENT_FRAGMENT_NODE = 11;\nexport function isHTMLElement(node) {\n return isObject(node) && node.nodeType === ELEMENT_NODE && typeof node.nodeName === \"string\";\n}\nexport function isDocument(node) {\n return isObject(node) && node.nodeType === DOCUMENT_NODE;\n}\nexport function isWindow(node) {\n return isObject(node) && node.constructor?.name === \"VisualViewport\";\n}\nexport function getNodeName(node) {\n if (isHTMLElement(node))\n return node.localName ?? \"\";\n return \"#document\";\n}\nexport function isNode(node) {\n return isObject(node) && node.nodeType !== undefined;\n}\nexport function isShadowRoot(node) {\n return isNode(node) && node.nodeType === DOCUMENT_FRAGMENT_NODE && \"host\" in node;\n}\nexport function contains(parent, child) {\n if (!parent || !child)\n return false;\n if (!isHTMLElement(parent) || !isHTMLElement(child))\n return false;\n const rootNode = child.getRootNode?.();\n if (parent === child)\n return true;\n if (parent.contains(child))\n return true;\n if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n while (next) {\n if (parent === next)\n return true;\n // @ts-expect-error - host is not typed\n next = next.parentNode || next.host;\n }\n }\n return false;\n}\nexport function getDocument(node) {\n if (isDocument(node))\n return node;\n if (isWindow(node))\n return node.document;\n return node?.ownerDocument ?? document;\n}\nexport function getDocumentElement(node) {\n return getDocument(node).documentElement;\n}\nexport function getWindow(node) {\n if (isShadowRoot(node))\n return getWindow(node.host);\n if (isDocument(node))\n return node.defaultView ?? window;\n if (isHTMLElement(node))\n return node.ownerDocument?.defaultView ?? window;\n return window;\n}\nexport function getActiveElement(rootNode) {\n let activeElement = rootNode.activeElement;\n while (activeElement?.shadowRoot) {\n const el = activeElement.shadowRoot.activeElement;\n if (el === activeElement)\n break;\n else\n activeElement = el;\n }\n return activeElement;\n}\nexport function getParentNode(node) {\n if (getNodeName(node) === \"html\")\n return node;\n const result = \n // @ts-expect-error - assignedSlot is not typed\n node.assignedSlot ||\n node.parentNode ||\n (isShadowRoot(node) && node.host) ||\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\n","import { boxWith } from \"../box/box-extras.svelte.js\";\nimport { getActiveElement, getDocument } from \"./dom.js\";\nexport class DOMContext {\n element;\n root = $derived.by(() => {\n if (!this.element.current)\n return document;\n const rootNode = this.element.current.getRootNode() ?? document;\n return rootNode;\n });\n constructor(element) {\n if (typeof element === \"function\") {\n this.element = boxWith(element);\n }\n else {\n this.element = element;\n }\n }\n getDocument = () => {\n return getDocument(this.root);\n };\n getWindow = () => {\n return this.getDocument().defaultView ?? window;\n };\n getActiveElement = () => {\n return getActiveElement(this.root);\n };\n isActiveElement = (node) => {\n return node === this.getActiveElement();\n };\n getElementById(id) {\n return this.root.getElementById(id);\n }\n querySelector = (selector) => {\n if (!this.root)\n return null;\n return this.root.querySelector(selector);\n };\n querySelectorAll = (selector) => {\n if (!this.root)\n return [];\n return this.root.querySelectorAll(selector);\n };\n setTimeout = (callback, delay) => {\n return this.getWindow().setTimeout(callback, delay);\n };\n clearTimeout = (timeoutId) => {\n return this.getWindow().clearTimeout(timeoutId);\n };\n}\n","import { untrack } from \"svelte\";\nimport { isBox } from \"../box/box-extras.svelte.js\";\nimport { createAttachmentKey } from \"svelte/attachments\";\n/**\n * Creates a Svelte Attachment that attaches a DOM element to a ref.\n * The ref can be either a WritableBox or a callback function.\n *\n * @param ref - Either a WritableBox to store the element in, or a callback function that receives the element\n * @param onChange - Optional callback that fires when the ref changes\n * @returns An object with a spreadable attachment key that should be spread onto the element\n *\n * @example\n * // Using with WritableBox\n * const ref = box<HTMLDivElement | null>(null);\n * <div {...attachRef(ref)}>Content</div>\n *\n * @example\n * // Using with callback\n * <div {...attachRef((node) => myNode = node)}>Content</div>\n *\n * @example\n * // Using with onChange\n * <div {...attachRef(ref, (node) => console.log(node))}>Content</div>\n */\nexport function attachRef(ref, onChange) {\n return {\n [createAttachmentKey()]: (node) => {\n if (isBox(ref)) {\n ref.current = node;\n untrack(() => onChange?.(node));\n return () => {\n // we don't want to detach the node if it's still connected\n if (\"isConnected\" in node && node.isConnected)\n return;\n ref.current = null;\n onChange?.(null);\n };\n }\n ref(node);\n untrack(() => onChange?.(node));\n return () => {\n // we don't want to detach the node if it's still connected\n if (\"isConnected\" in node && node.isConnected)\n return;\n ref(null);\n onChange?.(null);\n };\n }\n };\n}\n","export function boolToStr(condition) {\n return condition ? \"true\" : \"false\";\n}\nexport function boolToStrTrueOrUndef(condition) {\n return condition ? \"true\" : undefined;\n}\nexport function boolToEmptyStrOrUndef(condition) {\n return condition ? \"\" : undefined;\n}\nexport function boolToTrueOrUndef(condition) {\n return condition ? true : undefined;\n}\nexport function getDataOpenClosed(condition) {\n return condition ? \"open\" : \"closed\";\n}\nexport function getDataChecked(condition) {\n return condition ? \"checked\" : \"unchecked\";\n}\nexport function getDataTransitionAttrs(state) {\n if (state === \"starting\")\n return { \"data-starting-style\": \"\" };\n if (state === \"ending\")\n return { \"data-ending-style\": \"\" };\n return {};\n}\nexport function getAriaChecked(checked, indeterminate) {\n if (indeterminate)\n return \"mixed\";\n return checked ? \"true\" : \"false\";\n}\nexport class BitsAttrs {\n #variant;\n #prefix;\n attrs;\n constructor(config) {\n this.#variant = config.getVariant ? config.getVariant() : null;\n this.#prefix = this.#variant ? `data-${this.#variant}-` : `data-${config.component}-`;\n this.getAttr = this.getAttr.bind(this);\n this.selector = this.selector.bind(this);\n this.attrs = Object.fromEntries(config.parts.map((part) => [part, this.getAttr(part)]));\n }\n getAttr(part, variantOverride) {\n if (variantOverride)\n return `data-${variantOverride}-${part}`;\n return `${this.#prefix}${part}`;\n }\n selector(part, variantOverride) {\n return `[${this.getAttr(part, variantOverride)}]`;\n }\n}\nexport function createBitsAttrs(config) {\n const bitsAttrs = new BitsAttrs(config);\n return {\n ...bitsAttrs.attrs,\n selector: bitsAttrs.selector,\n getAttr: bitsAttrs.getAttr,\n };\n}\n","export const ALT = \"Alt\";\nexport const ARROW_DOWN = \"ArrowDown\";\nexport const ARROW_LEFT = \"ArrowLeft\";\nexport const ARROW_RIGHT = \"ArrowRight\";\nexport const ARROW_UP = \"ArrowUp\";\nexport const BACKSPACE = \"Backspace\";\nexport const CAPS_LOCK = \"CapsLock\";\nexport const CONTROL = \"Control\";\nexport const DELETE = \"Delete\";\nexport const END = \"End\";\nexport const ENTER = \"Enter\";\nexport const ESCAPE = \"Escape\";\nexport const F1 = \"F1\";\nexport const F10 = \"F10\";\nexport const F11 = \"F11\";\nexport const F12 = \"F12\";\nexport const F2 = \"F2\";\nexport const F3 = \"F3\";\nexport const F4 = \"F4\";\nexport const F5 = \"F5\";\nexport const F6 = \"F6\";\nexport const F7 = \"F7\";\nexport const F8 = \"F8\";\nexport const F9 = \"F9\";\nexport const HOME = \"Home\";\nexport const META = \"Meta\";\nexport const PAGE_DOWN = \"PageDown\";\nexport const PAGE_UP = \"PageUp\";\nexport const SHIFT = \"Shift\";\nexport const SPACE = \" \";\nexport const TAB = \"Tab\";\nexport const CTRL = \"Control\";\nexport const ASTERISK = \"*\";\nexport const a = \"a\";\nexport const P = \"P\";\nexport const A = \"A\";\nexport const p = \"p\";\nexport const n = \"n\";\nexport const j = \"j\";\nexport const k = \"k\";\nexport const h = \"h\";\nexport const l = \"l\";\n","export const isBrowser = typeof document !== \"undefined\";\nexport const isIOS = getIsIOS();\nfunction getIsIOS() {\n return (isBrowser &&\n window?.navigator?.userAgent &&\n (/iP(ad|hone|od)/.test(window.navigator.userAgent) ||\n // The new iPad Pro Gen3 does not identify itself as iPad, but as Macintosh.\n (window?.navigator?.maxTouchPoints > 2 &&\n /iPad|Macintosh/.test(window?.navigator.userAgent))));\n}\nexport function isFunction(value) {\n return typeof value === \"function\";\n}\nexport function isHTMLElement(element) {\n return element instanceof HTMLElement;\n}\nexport function isElement(element) {\n return element instanceof Element;\n}\nexport function isElementOrSVGElement(element) {\n return element instanceof Element || element instanceof SVGElement;\n}\nexport function isNumberString(value) {\n return !Number.isNaN(Number(value)) && !Number.isNaN(Number.parseFloat(value));\n}\nexport function isNull(value) {\n return value === null;\n}\nexport function isTouch(e) {\n return e.pointerType === \"touch\";\n}\nexport function isFocusVisible(element) {\n return element.matches(\":focus-visible\");\n}\nexport function isNotNull(value) {\n return value !== null;\n}\n/**\n * Determines if the provided object is a valid `HTMLInputElement` with\n * a `select` method available.\n */\nexport function isSelectableInput(element) {\n return element instanceof HTMLInputElement && \"select\" in element;\n}\n/**\n * Given a node, determine if it is hidden by walking up the\n * DOM tree until we hit the `stopAt` node (exclusive), if provided)\n * otherwise we stop at the document root.\n */\nexport function isElementHidden(node, stopAt) {\n if (getComputedStyle(node).visibility === \"hidden\")\n return true;\n while (node) {\n // we stop at `upTo` (excluding it)\n if (stopAt !== undefined && node === stopAt)\n return false;\n if (getComputedStyle(node).display === \"none\")\n return true;\n node = node.parentElement;\n }\n return false;\n}\n","import { afterTick, onDestroyEffect } from \"svelte-toolbelt\";\nexport class AnimationsComplete {\n #opts;\n #currentFrame = null;\n #observer = null;\n #runId = 0;\n constructor(opts) {\n this.#opts = opts;\n onDestroyEffect(() => this.#cleanup());\n }\n #cleanup() {\n if (this.#currentFrame !== null) {\n window.cancelAnimationFrame(this.#currentFrame);\n this.#currentFrame = null;\n }\n this.#observer?.disconnect();\n this.#observer = null;\n this.#runId++;\n }\n run(fn) {\n this.#cleanup();\n const node = this.#opts.ref.current;\n if (!node)\n return;\n if (typeof node.getAnimations !== \"function\") {\n this.#executeCallback(fn);\n return;\n }\n const runId = this.#runId;\n const executeIfCurrent = () => {\n if (runId !== this.#runId)\n return;\n this.#executeCallback(fn);\n };\n const waitForAnimations = () => {\n if (runId !== this.#runId)\n return;\n const animations = node.getAnimations();\n if (animations.length === 0) {\n executeIfCurrent();\n return;\n }\n Promise.all(animations.map((animation) => animation.finished))\n .then(() => {\n executeIfCurrent();\n })\n .catch(() => {\n if (runId !== this.#runId)\n return;\n const currentAnimations = node.getAnimations();\n const hasRunningAnimations = currentAnimations.some((animation) => animation.pending || animation.playState !== \"finished\");\n if (hasRunningAnimations) {\n waitForAnimations();\n return;\n }\n executeIfCurrent();\n });\n };\n const requestWaitForAnimations = () => {\n this.#currentFrame = window.requestAnimationFrame(() => {\n this.#currentFrame = null;\n waitForAnimations();\n });\n };\n if (!this.#opts.afterTick.current) {\n requestWaitForAnimations();\n return;\n }\n this.#currentFrame = window.requestAnimationFrame(() => {\n this.#currentFrame = null;\n const startingStyleAttr = \"data-starting-style\";\n if (!node.hasAttribute(startingStyleAttr)) {\n requestWaitForAnimations();\n return;\n }\n this.#observer = new MutationObserver(() => {\n if (runId !== this.#runId)\n return;\n if (node.hasAttribute(startingStyleAttr))\n return;\n this.#observer?.disconnect();\n this.#observer = null;\n requestWaitForAnimations();\n });\n this.#observer.observe(node, {\n attributes: true,\n attributeFilter: [startingStyleAttr],\n });\n });\n }\n #executeCallback(fn) {\n const execute = () => {\n fn();\n };\n if (this.#opts.afterTick) {\n afterTick(execute);\n }\n else {\n execute();\n }\n }\n}\n","import { watch } from \"runed\";\nimport { onDestroyEffect } from \"svelte-toolbelt\";\nimport { AnimationsComplete } from \"./animations-complete.js\";\nexport class PresenceManager {\n #opts;\n #enabled;\n #afterAnimations;\n #shouldRender = $state(false);\n #transitionStatus = $state(undefined);\n #hasMounted = false;\n #transitionFrame = null;\n constructor(opts) {\n this.#opts = opts;\n this.#shouldRender = opts.open.current;\n this.#enabled = opts.enabled ?? true;\n this.#afterAnimations = new AnimationsComplete({\n ref: this.#opts.ref,\n afterTick: this.#opts.open,\n });\n onDestroyEffect(() => this.#clearTransitionFrame());\n watch(() => this.#opts.open.current, (isOpen) => {\n if (!this.#hasMounted) {\n this.#hasMounted = true;\n return;\n }\n this.#clearTransitionFrame();\n if (!isOpen && this.#opts.shouldSkipExitAnimation?.()) {\n this.#shouldRender = false;\n this.#transitionStatus = undefined;\n this.#opts.onComplete?.();\n return;\n }\n if (isOpen)\n this.#shouldRender = true;\n this.#transitionStatus = isOpen ? \"starting\" : \"ending\";\n if (isOpen) {\n this.#transitionFrame = window.requestAnimationFrame(() => {\n this.#transitionFrame = null;\n if (this.#opts.open.current) {\n this.#transitionStatus = undefined;\n }\n });\n }\n if (!this.#enabled) {\n if (!isOpen) {\n this.#shouldRender = false;\n }\n this.#transitionStatus = undefined;\n this.#opts.onComplete?.();\n return;\n }\n this.#afterAnimations.run(() => {\n if (isOpen === this.#opts.open.current) {\n if (!this.#opts.open.current) {\n this.#shouldRender = false;\n }\n this.#transitionStatus = undefined;\n this.#opts.onComplete?.();\n }\n });\n });\n }\n get shouldRender() {\n return this.#shouldRender;\n }\n get transitionStatus() {\n return this.#transitionStatus;\n }\n #clearTransitionFrame() {\n if (this.#transitionFrame === null)\n return;\n window.cancelAnimationFrame(this.#transitionFrame);\n this.#transitionFrame = null;\n }\n}\n","/**\n * A no operation function (does nothing)\n */\nexport function noop() { }\n","export function createId(prefixOrUid, uid) {\n if (uid === undefined)\n return `bits-${prefixOrUid}`;\n return `bits-${prefixOrUid}-${uid}`;\n}\n","import { attachRef, boxWith, onDestroyEffect, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { createBitsAttrs, boolToStr, getDataOpenClosed, boolToEmptyStrOrUndef, getDataTransitionAttrs, } from \"../../internal/attrs.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nconst dialogAttrs = createBitsAttrs({\n component: \"dialog\",\n parts: [\"content\", \"trigger\", \"overlay\", \"title\", \"description\", \"close\", \"cancel\", \"action\"],\n});\nconst DialogRootContext = new Context(\"Dialog.Root | AlertDialog.Root\");\nexport class DialogRootState {\n static create(opts) {\n const parent = DialogRootContext.getOr(null);\n return DialogRootContext.set(new DialogRootState(opts, parent));\n }\n opts;\n triggerNode = $state(null);\n contentNode = $state(null);\n overlayNode = $state(null);\n descriptionNode = $state(null);\n contentId = $state(undefined);\n titleId = $state(undefined);\n triggerId = $state(undefined);\n descriptionId = $state(undefined);\n cancelNode = $state(null);\n nestedOpenCount = $state(0);\n depth;\n parent;\n contentPresence;\n overlayPresence;\n constructor(opts, parent) {\n this.opts = opts;\n this.parent = parent;\n this.depth = parent ? parent.depth + 1 : 0;\n this.handleOpen = this.handleOpen.bind(this);\n this.handleClose = this.handleClose.bind(this);\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n enabled: true,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n });\n this.overlayPresence = new PresenceManager({\n ref: boxWith(() => this.overlayNode),\n open: this.opts.open,\n enabled: true,\n });\n watch(() => this.opts.open.current, (isOpen) => {\n if (!this.parent)\n return;\n if (isOpen) {\n this.parent.incrementNested();\n }\n else {\n this.parent.decrementNested();\n }\n }, { lazy: true });\n onDestroyEffect(() => {\n if (this.opts.open.current) {\n this.parent?.decrementNested();\n }\n });\n }\n handleOpen() {\n if (this.opts.open.current)\n return;\n this.opts.open.current = true;\n }\n handleClose() {\n if (!this.opts.open.current)\n return;\n this.opts.open.current = false;\n }\n getBitsAttr = (part) => {\n return dialogAttrs.getAttr(part, this.opts.variant.current);\n };\n incrementNested() {\n this.nestedOpenCount++;\n this.parent?.incrementNested();\n }\n decrementNested() {\n if (this.nestedOpenCount === 0)\n return;\n this.nestedOpenCount--;\n this.parent?.decrementNested();\n }\n sharedProps = $derived.by(() => ({\n \"data-state\": getDataOpenClosed(this.opts.open.current),\n }));\n}\nexport class DialogTriggerState {\n static create(opts) {\n return new DialogTriggerState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.triggerNode = v;\n this.root.triggerId = v?.id;\n });\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleOpen();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleOpen();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": boolToStr(this.root.opts.open.current),\n \"aria-controls\": this.root.contentId,\n [this.root.getBitsAttr(\"trigger\")]: \"\",\n onkeydown: this.onkeydown,\n onclick: this.onclick,\n disabled: this.opts.disabled.current ? true : undefined,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogCloseState {\n static create(opts) {\n return new DialogCloseState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleClose();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleClose();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(this.opts.variant.current)]: \"\",\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n disabled: this.opts.disabled.current ? true : undefined,\n tabindex: 0,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogActionState {\n static create(opts) {\n return new DialogActionState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"action\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogTitleState {\n static create(opts) {\n return new DialogTitleState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.root.titleId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref);\n watch.pre(() => this.opts.id.current, (id) => {\n this.root.titleId = id;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"heading\",\n \"aria-level\": this.opts.level.current,\n [this.root.getBitsAttr(\"title\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogDescriptionState {\n static create(opts) {\n return new DialogDescriptionState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.root.descriptionId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.descriptionNode = v;\n });\n watch.pre(() => this.opts.id.current, (id) => {\n this.root.descriptionId = id;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"description\")]: \"\",\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\nexport class DialogContentState {\n static create(opts) {\n return new DialogContentState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => {\n this.root.contentNode = v;\n this.root.contentId = v?.id;\n });\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: this.root.opts.variant.current === \"alert-dialog\" ? \"alertdialog\" : \"dialog\",\n \"aria-modal\": \"true\",\n \"aria-describedby\": this.root.descriptionId,\n \"aria-labelledby\": this.root.titleId,\n [this.root.getBitsAttr(\"content\")]: \"\",\n style: {\n pointerEvents: \"auto\",\n outline: this.root.opts.variant.current === \"alert-dialog\" ? \"none\" : undefined,\n \"--bits-dialog-depth\": this.root.depth,\n \"--bits-dialog-nested-count\": this.root.nestedOpenCount,\n // CSS containment isolates style/layout calculations from the rest of the page,\n // improving performance when there's a large DOM behind the dialog.\n // Paint is omitted so tooltips/selects can render outside dialog bounds.\n contain: \"layout style\",\n },\n tabindex: this.root.opts.variant.current === \"alert-dialog\" ? -1 : undefined,\n \"data-nested-open\": boolToEmptyStrOrUndef(this.root.nestedOpenCount > 0),\n \"data-nested\": boolToEmptyStrOrUndef(this.root.parent !== null),\n ...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n get shouldRender() {\n return this.root.contentPresence.shouldRender;\n }\n}\nexport class DialogOverlayState {\n static create(opts) {\n return new DialogOverlayState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.overlayNode = v));\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"overlay\")]: \"\",\n style: {\n pointerEvents: \"auto\",\n \"--bits-dialog-depth\": this.root.depth,\n \"--bits-dialog-nested-count\": this.root.nestedOpenCount,\n },\n \"data-nested-open\": boolToEmptyStrOrUndef(this.root.nestedOpenCount > 0),\n \"data-nested\": boolToEmptyStrOrUndef(this.root.parent !== null),\n ...getDataTransitionAttrs(this.root.overlayPresence.transitionStatus),\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n get shouldRender() {\n return this.root.overlayPresence.shouldRender;\n }\n}\nexport class AlertDialogCancelState {\n static create(opts) {\n return new AlertDialogCancelState(opts, DialogRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.cancelNode = v));\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button > 0)\n return;\n this.root.handleClose();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (e.key === kbd.SPACE || e.key === kbd.ENTER) {\n e.preventDefault();\n this.root.handleClose();\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [this.root.getBitsAttr(\"cancel\")]: \"\",\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n tabindex: 0,\n disabled: this.opts.disabled.current,\n ...this.root.sharedProps,\n ...this.attachment,\n }));\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { AlertDialogRootProps } from \"../types.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport { DialogRootState } from \"../../dialog/dialog.svelte.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: AlertDialogRootProps = $props();\n\n\tDialogRootState.create({\n\t\tvariant: boxWith(() => \"alert-dialog\"),\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n</script>\n\n{@render children?.()}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogTitleState } from \"../dialog.svelte.js\";\n\timport type { DialogTitleProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\tchild,\n\t\tchildren,\n\t\tlevel = 2,\n\t\t...restProps\n\t}: DialogTitleProps = $props();\n\n\tconst titleState = DialogTitleState.create({\n\t\tid: boxWith(() => id),\n\t\tlevel: boxWith(() => level),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, titleState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { AlertDialogActionProps } from \"../types.js\";\n\timport { DialogActionState } from \"../../dialog/dialog.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\t...restProps\n\t}: AlertDialogActionProps = $props();\n\n\tconst actionState = DialogActionState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, actionState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { AlertDialogCancelProps } from \"../types.js\";\n\timport { AlertDialogCancelState } from \"../../dialog/dialog.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\tchildren,\n\t\tchild,\n\t\tdisabled = false,\n\t\t...restProps\n\t}: AlertDialogCancelProps = $props();\n\n\tconst cancelState = AlertDialogCancelState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, cancelState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport type { Snippet } from \"svelte\";\n\n\tconst { children }: { children?: Snippet } = $props();\n</script>\n\n{#key children}\n\t{@render children?.()}\n{/key}\n","import { Context } from \"runed\";\nimport { boxWith } from \"svelte-toolbelt\";\nexport const BitsConfigContext = new Context(\"BitsConfig\");\n/**\n * Gets the current Bits UI configuration state from the context.\n *\n * Returns a default configuration (where all values are `undefined`) if no configuration is found.\n */\nexport function getBitsConfig() {\n const fallback = new BitsConfigState(null, {});\n return BitsConfigContext.getOr(fallback).opts;\n}\n/**\n * Creates and sets a new Bits UI configuration state that inherits from parent configs.\n *\n * @param opts - Configuration options for this level\n * @returns The configuration state instance\n *\n * @example\n * ```typescript\n * // In a component that wants to set a default portal target\n * const config = useBitsConfig({ defaultPortalTo: box(\"#some-element\") });\n *\n * // Child components will inherit this config and can override specific values\n * const childConfig = useBitsConfig({ someOtherProp: box(\"value\") });\n * // childConfig still has defaultPortalTo=\"#some-element\" from parent\n * ```\n */\nexport function useBitsConfig(opts) {\n return BitsConfigContext.set(new BitsConfigState(BitsConfigContext.getOr(null), opts));\n}\n/**\n * Configuration state that inherits from parent configurations.\n *\n * @example\n * Config resolution:\n * ```\n * Level 1: { defaultPortalTo: \"#some-element\", theme: \"dark\" }\n * Level 2: { spacing: \"large\" } // inherits defaultPortalTo=\"#some-element\", theme=\"dark\"\n * Level 3: { theme: \"light\" } // inherits defaultPortalTo=\"#some-element\", spacing=\"large\", overrides theme=\"light\"\n * ```\n */\nexport class BitsConfigState {\n opts;\n constructor(parent, opts) {\n const resolveConfigOption = createConfigResolver(parent, opts);\n this.opts = {\n defaultPortalTo: resolveConfigOption((config) => config.defaultPortalTo),\n defaultLocale: resolveConfigOption((config) => config.defaultLocale),\n };\n }\n}\n/**\n * Returns a config resolver that resolves a given config option's value.\n *\n * The resolver creates reactive boxes that resolve config option values using this priority:\n * 1. Current level's value (if defined)\n * 2. Parent level's value (if defined and current is undefined)\n * 3. `undefined` (if no value is found in either parent or child)\n *\n * @param parent - Parent configuration state (null if this is root level)\n * @param currentOpts - Current level's configuration options\n *\n * @example\n * ```typescript\n * // Given this hierarchy:\n * // Root: { defaultPortalTo: \"#some-element\" }\n * // Child: { someOtherProp: \"value\" } // no defaultPortalTo specified\n *\n * const resolveConfigOption = createConfigResolver(parent, opts);\n * const portalTo = resolveConfigOption(config => config.defaultPortalTo);\n *\n * // portalTo.current === \"#some-element\" (inherited from parent)\n * // even when child didn't specify `defaultPortalTo`\n * ```\n */\nfunction createConfigResolver(parent, currentOpts) {\n return (getter) => {\n const configOption = boxWith(() => {\n // try current opts first\n const value = getter(currentOpts)?.current;\n if (value !== undefined)\n return value;\n // if no parent, return undefined\n if (parent === null)\n return undefined;\n // get value from parent (which already has its own chain resolved)\n return getter(parent.opts)?.current;\n });\n return configOption;\n };\n}\n","import { boxWith } from \"svelte-toolbelt\";\nimport { getBitsConfig } from \"./bits-config.js\";\n/**\n * Creates a generic prop resolver that follows a standard priority chain:\n * 1. The getter's prop value (if defined)\n * 2. The config default value (if no getter prop value is defined)\n * 3. The fallback value (if no config value found)\n */\nfunction createPropResolver(configOption, fallback) {\n return (getProp) => {\n const config = getBitsConfig();\n return boxWith(() => {\n // 1. return the prop's value, if provided\n const propValue = getProp();\n if (propValue !== undefined)\n return propValue;\n // 2. return the resolved config option value, if available\n const option = configOption(config).current;\n if (option !== undefined)\n return option;\n // 3. return the fallback if no other value is found\n return fallback;\n });\n };\n}\n/**\n * Resolves a locale value using the prop, the config default, or a fallback.\n *\n * Default value: `\"en\"`\n */\nexport const resolveLocaleProp = createPropResolver((config) => config.defaultLocale, \"en\");\n/**\n * Resolves a portal's `to` value using the prop, the config default, or a fallback.\n *\n * Default value: `\"body\"`\n */\nexport const resolvePortalToProp = createPropResolver((config) => config.defaultPortalTo, \"body\");\n","<script lang=\"ts\">\n\timport { getAllContexts, mount, unmount } from \"svelte\";\n\timport { DEV } from \"esm-env\";\n\timport { watch } from \"runed\";\n\timport PortalConsumer from \"./portal-consumer.svelte\";\n\timport type { PortalProps } from \"./types.js\";\n\timport { isBrowser } from \"../../../internal/is.js\";\n\timport { resolvePortalToProp } from \"../config/prop-resolvers.js\";\n\n\tlet { to: toProp, children, disabled }: PortalProps = $props();\n\n\tconst to = resolvePortalToProp(() => toProp);\n\tconst context = getAllContexts();\n\n\tlet target = $derived(getTarget());\n\n\tfunction getTarget() {\n\t\tif (!isBrowser || disabled) return null;\n\n\t\tlet localTarget: Element | null = null;\n\n\t\tif (typeof to.current === \"string\") {\n\t\t\tconst target = document.querySelector(to.current);\n\t\t\tif (DEV && target === null) {\n\t\t\t\tthrow new Error(`Target element \"${to.current}\" not found.`);\n\t\t\t}\n\t\t\tlocalTarget = target;\n\t\t} else {\n\t\t\tlocalTarget = to.current;\n\t\t}\n\n\t\tif (DEV && !(localTarget instanceof Element)) {\n\t\t\tconst type = localTarget === null ? \"null\" : typeof localTarget;\n\t\t\tthrow new TypeError(\n\t\t\t\t`Unknown portal target type: ${type}. Allowed types: string (query selector) or Element.`\n\t\t\t);\n\t\t}\n\n\t\treturn localTarget;\n\t}\n\n\tlet instance: ReturnType<typeof mount> | null;\n\n\tfunction unmountInstance() {\n\t\tif (instance) {\n\t\t\tunmount(instance);\n\t\t\tinstance = null;\n\t\t}\n\t}\n\n\twatch([() => target, () => disabled], ([target, disabled]) => {\n\t\tif (!target || disabled) {\n\t\t\tunmountInstance();\n\t\t\treturn;\n\t\t}\n\t\tinstance = mount(PortalConsumer, {\n\t\t\ttarget: target,\n\t\t\tprops: { children },\n\t\t\tcontext,\n\t\t});\n\n\t\treturn () => {\n\t\t\tunmountInstance();\n\t\t};\n\t});\n</script>\n\n{#if disabled}\n\t{@render children?.()}\n{/if}\n","// oxlint-disable-next-line no-explicit-any\nexport function debounce(fn, wait = 500) {\n let timeout = null;\n const debounced = (...args) => {\n if (timeout !== null) {\n clearTimeout(timeout);\n }\n timeout = setTimeout(() => {\n fn(...args);\n }, wait);\n };\n debounced.destroy = () => {\n if (timeout !== null) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n return debounced;\n}\n","export function isOrContainsTarget(node, target) {\n return node === target || node.contains(target);\n}\nexport function getOwnerDocument(el) {\n return el?.ownerDocument ?? document;\n}\n","export function getFirstNonCommentChild(element) {\n if (!element)\n return null;\n for (const child of element.childNodes) {\n if (child.nodeType !== Node.COMMENT_NODE) {\n return child;\n }\n }\n return null;\n}\n/**\n * Determines if the click event truly occurred outside the content node.\n * This was added to handle password managers and other elements that may be injected\n * into the DOM but visually appear inside the content.\n */\nexport function isClickTrulyOutside(event, contentNode) {\n const { clientX, clientY } = event;\n const rect = contentNode.getBoundingClientRect();\n return (clientX < rect.left || clientX > rect.right || clientY < rect.top || clientY > rect.bottom);\n}\n","export const CONTEXT_MENU_TRIGGER_ATTR = \"data-context-menu-trigger\";\nexport const CONTEXT_MENU_CONTENT_ATTR = \"data-context-menu-content\";\n","import { afterTick, executeCallbacks, onDestroyEffect, } from \"svelte-toolbelt\";\nimport { watch } from \"runed\";\nimport { untrack } from \"svelte\";\nimport { on } from \"svelte/events\";\nimport {} from \"../../../internal/events.js\";\nimport { debounce } from \"../../../internal/debounce.js\";\nimport { noop } from \"../../../internal/noop.js\";\nimport { getOwnerDocument, isOrContainsTarget } from \"../../../internal/elements.js\";\nimport { isElementOrSVGElement } from \"../../../internal/is.js\";\nimport { isClickTrulyOutside } from \"../../../internal/dom.js\";\nimport { CONTEXT_MENU_CONTENT_ATTR, CONTEXT_MENU_TRIGGER_ATTR, } from \"../../menu/context-menu-attributes.js\";\nglobalThis.bitsDismissableLayers ??= new Map();\nexport class DismissibleLayerState {\n static create(opts) {\n return new DismissibleLayerState(opts);\n }\n opts;\n #interactOutsideProp;\n #behaviorType;\n #interceptedEvents = {\n pointerdown: false,\n };\n #isResponsibleLayer = false;\n #capturedPointerDown = null;\n #isFocusInsideDOMTree = false;\n #documentObj = undefined;\n #onFocusOutside;\n #unsubClickListener = noop;\n /**\n * Set once the layer is torn down. Deferred work scheduled before teardown can\n * still run afterwards, so every such callback must short-circuit on this\n * before reading `this.opts.ref.current` — reading a destroyed `$derived`\n * triggers Svelte's `derived_inert` warning. A class field rather than a\n * constructor local so the class-field handlers below can see it too.\n */\n #destroyed = false;\n constructor(opts) {\n this.opts = opts;\n this.#behaviorType = opts.interactOutsideBehavior;\n this.#interactOutsideProp = opts.onInteractOutside;\n this.#onFocusOutside = opts.onFocusOutside;\n let unsubEvents = noop;\n let registeredNode = null;\n const cleanup = () => {\n registeredNode = null;\n this.#resetState();\n globalThis.bitsDismissableLayers.delete(this);\n this.#handleInteractOutside.destroy();\n this.#unsubClickListener();\n unsubEvents();\n };\n watch([() => this.opts.enabled.current, () => this.opts.ref.current], ([enabled, node]) => {\n const nextNode = enabled ? node : null;\n // Ref boxes can invalidate without changing the DOM node during opening.\n // Keep an in-flight interaction when this is still the same registration.\n if (registeredNode === nextNode)\n return;\n cleanup();\n if (!nextNode)\n return;\n registeredNode = nextNode;\n this.#documentObj = getOwnerDocument(nextNode);\n globalThis.bitsDismissableLayers.set(this, this.#behaviorType);\n unsubEvents = this.#addEventListeners();\n });\n onDestroyEffect(() => {\n this.#destroyed = true;\n cleanup();\n });\n }\n #handleFocus = (event) => {\n if (event.defaultPrevented)\n return;\n if (this.#destroyed || !this.opts.ref.current)\n return;\n afterTick(() => {\n // The layer can be destroyed between the focus event and this tick — a\n // focus change is frequently what closes it. `#destroyed` must\n // short-circuit before any `this.opts.ref.current` read.\n if (this.#destroyed)\n return;\n if (!this.opts.ref.current || this.#isTargetWithinLayer(event.target))\n return;\n if (event.target && !this.#isFocusInsideDOMTree) {\n this.#onFocusOutside.current?.(event);\n }\n });\n };\n #addEventListeners() {\n const document = this.#documentObj;\n const onPointerDownCapture = (event) => {\n untrack(() => {\n this.#markInterceptedEvent(event);\n this.#markResponsibleLayer(event);\n });\n };\n const onPointerDown = (event) => {\n // Ignore stopped events and bubble-only events such as the opening pointerdown.\n // It can resume bubbling after a nested early outside click has been captured.\n if (event.cancelBubble || event !== this.#capturedPointerDown)\n return;\n this.#markNonInterceptedEvent(event);\n if (event.pointerType === \"touch\") {\n // a tap's click can follow its pointerdown within a millisecond (WebKit), so\n // arm the click listener now rather than after the debounce flushes\n this.#handleInteractOutside.destroy();\n this.#interactOutside(event);\n }\n else {\n this.#handleInteractOutside(event);\n }\n };\n // `svelte/events.on` defers pointer listener attachment to a microtask, leaving\n // a gap even without a registration timer. Document is already connected, so\n // attach immediately. Only layers present at capture can own this interaction;\n // a layer opened by its target/bubble handlers must not dismiss itself.\n document.addEventListener(\"pointerdown\", onPointerDownCapture, true);\n document.addEventListener(\"pointerdown\", onPointerDown);\n return executeCallbacks(() => document.removeEventListener(\"pointerdown\", onPointerDownCapture, true), () => document.removeEventListener(\"pointerdown\", onPointerDown), on(document, \"focusin\", this.#handleFocus));\n }\n #handleDismiss = (e) => {\n let event = e;\n if (event.defaultPrevented) {\n event = createWrappedEvent(e);\n }\n this.#interactOutsideProp.current(e);\n };\n #interactOutside = (e) => {\n if (!this.opts.ref.current) {\n this.#unsubClickListener();\n return;\n }\n const isEventValid = this.opts.isValidEvent.current(e, this.opts.ref.current) ||\n isValidEvent(e, this.opts.ref.current);\n if (!this.#isResponsibleLayer || this.#isAnyEventIntercepted() || !isEventValid) {\n this.#unsubClickListener();\n return;\n }\n let event = e;\n if (event.defaultPrevented) {\n event = createWrappedEvent(event);\n }\n if (this.#behaviorType.current !== \"close\" &&\n this.#behaviorType.current !== \"defer-otherwise-close\") {\n this.#unsubClickListener();\n return;\n }\n if (e.pointerType === \"touch\") {\n this.#unsubClickListener();\n // the tap's click dismisses from the bubble phase, as before. A capture-phase\n // listener backs it up with a task, so a target that stops propagation cannot\n // hide the click, while a target that closes this layer still tears it down\n // (and the backup with it) before the task runs.\n let backup = null;\n let unsubClick = noop;\n const dismiss = (event) => {\n unsubClick();\n this.#handleDismiss(event);\n };\n unsubClick = executeCallbacks(on(this.#documentObj, \"click\", dismiss, { once: true }), on(this.#documentObj, \"click\", (event) => {\n backup = setTimeout(() => dismiss(event), 0);\n }, { once: true, capture: true }), () => {\n if (backup !== null)\n clearTimeout(backup);\n backup = null;\n });\n this.#unsubClickListener = unsubClick;\n }\n else {\n this.#interactOutsideProp.current(event);\n }\n };\n #handleInteractOutside = debounce(this.#interactOutside, 10);\n #markInterceptedEvent = (e) => {\n this.#interceptedEvents[e.type] = true;\n };\n #markNonInterceptedEvent = (e) => {\n this.#interceptedEvents[e.type] = false;\n };\n #markResponsibleLayer = (event) => {\n this.#capturedPointerDown = event;\n if (!this.opts.ref.current)\n return;\n this.#isResponsibleLayer = isResponsibleLayer(this.opts.ref.current);\n };\n #isTargetWithinLayer = (target) => {\n if (!this.opts.ref.current)\n return false;\n return isOrContainsTarget(this.opts.ref.current, target);\n };\n /**\n * Resets the per-interaction state. Must stay synchronous.\n *\n * This was a `debounce(..., 20)` from when it was also wired to a capture-phase\n * interaction-end listener and had to land after the 10ms `#handleInteractOutside`\n * debounce. That listener is gone, but the debounce stayed on the `cleanup()` path —\n * and because `watch` runs `cleanup()` once per open (`ref` goes null -> node), every\n * layer scheduled a reset 20ms into its own lifetime. An outside `pointerdown` landing\n * 10-20ms after that cleanup would have its `#isResponsibleLayer` flag cleared by the\n * stale reset in the gap before the debounced `#handleInteractOutside` ran, which then\n * bailed and left the layer open. `cleanup()` destroys `#handleInteractOutside` anyway,\n * so nothing is left in flight that needs to observe the pre-reset state.\n */\n #resetState = () => {\n for (const eventType in this.#interceptedEvents) {\n this.#interceptedEvents[eventType] = false;\n }\n this.#isResponsibleLayer = false;\n this.#capturedPointerDown = null;\n };\n #isAnyEventIntercepted() {\n const i = Object.values(this.#interceptedEvents).some(Boolean);\n return i;\n }\n #onfocuscapture = () => {\n this.#isFocusInsideDOMTree = true;\n };\n #onblurcapture = () => {\n this.#isFocusInsideDOMTree = false;\n };\n props = {\n onfocuscapture: this.#onfocuscapture,\n onblurcapture: this.#onblurcapture,\n };\n}\nexport function getTopMostDismissableLayer(layersArr = [\n ...globalThis.bitsDismissableLayers,\n]) {\n return layersArr.findLast(([_, { current: behaviorType }]) => behaviorType === \"close\" || behaviorType === \"ignore\");\n}\nfunction isResponsibleLayer(node) {\n const layersArr = [...globalThis.bitsDismissableLayers];\n /**\n * We first check if we can find a top layer with `close` or `ignore`.\n * If that top layer was found and matches the provided node, then the node is\n * responsible for the outside interaction. Otherwise, we know that all layers defer so\n * the first layer is the responsible one.\n */\n const topMostLayer = getTopMostDismissableLayer(layersArr);\n if (topMostLayer)\n return topMostLayer[0].opts.ref.current === node;\n const [firstLayerNode] = layersArr[0];\n return firstLayerNode.opts.ref.current === node;\n}\nfunction isValidEvent(e, node) {\n const target = e.target;\n if (!isElementOrSVGElement(target))\n return false;\n const targetIsContextMenuTrigger = Boolean(target.closest(`[${CONTEXT_MENU_TRIGGER_ATTR}]`));\n const nodeIsContextMenu = Boolean(node.closest(`[${CONTEXT_MENU_CONTENT_ATTR}]`));\n if (\"button\" in e && e.button > 0 && !targetIsContextMenuTrigger)\n return false;\n if (\"button\" in e && e.button === 0 && targetIsContextMenuTrigger && nodeIsContextMenu) {\n return true;\n }\n if (targetIsContextMenuTrigger && nodeIsContextMenu)\n return false;\n const ownerDocument = getOwnerDocument(target);\n const isValid = ownerDocument.documentElement.contains(target) &&\n !isOrContainsTarget(node, target) &&\n isClickTrulyOutside(e, node);\n return isValid;\n}\nfunction createWrappedEvent(e) {\n const capturedCurrentTarget = e.currentTarget;\n const capturedTarget = e.target;\n let newEvent;\n if (e instanceof PointerEvent) {\n newEvent = new PointerEvent(e.type, e);\n }\n else {\n newEvent = new PointerEvent(\"pointerdown\", e);\n }\n // track the prevented state separately\n let isPrevented = false;\n // Create a proxy to intercept property access and method calls\n const wrappedEvent = new Proxy(newEvent, {\n get: (target, prop) => {\n if (prop === \"currentTarget\") {\n return capturedCurrentTarget;\n }\n if (prop === \"target\") {\n return capturedTarget;\n }\n if (prop === \"preventDefault\") {\n return () => {\n isPrevented = true;\n if (typeof target.preventDefault === \"function\") {\n target.preventDefault();\n }\n };\n }\n if (prop === \"defaultPrevented\") {\n return isPrevented;\n }\n if (prop in target) {\n // oxlint-disable-next-line no-explicit-any\n return target[prop];\n }\n // oxlint-disable-next-line no-explicit-any\n return e[prop];\n },\n });\n return wrappedEvent;\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { DismissibleLayerImplProps } from \"./types.js\";\n\timport { DismissibleLayerState } from \"./use-dismissable-layer.svelte.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\tinteractOutsideBehavior = \"close\",\n\t\tonInteractOutside = noop,\n\t\tonFocusOutside = noop,\n\t\tid,\n\t\tchildren,\n\t\tenabled,\n\t\tisValidEvent = () => false,\n\t\tref,\n\t}: DismissibleLayerImplProps = $props();\n\n\tconst dismissibleLayerState = DismissibleLayerState.create({\n\t\tid: boxWith(() => id),\n\t\tinteractOutsideBehavior: boxWith(() => interactOutsideBehavior),\n\t\tonInteractOutside: boxWith(() => onInteractOutside),\n\t\tenabled: boxWith(() => enabled),\n\t\tonFocusOutside: boxWith(() => onFocusOutside),\n\t\tisValidEvent: boxWith(() => isValidEvent),\n\t\tref,\n\t});\n</script>\n\n{@render children?.({ props: dismissibleLayerState.props })}\n","import { DOMContext } from \"svelte-toolbelt\";\nimport { watch } from \"runed\";\nimport { on } from \"svelte/events\";\nimport { kbd } from \"../../../internal/kbd.js\";\nimport { noop } from \"../../../internal/noop.js\";\nglobalThis.bitsEscapeLayers ??= new Map();\nexport class EscapeLayerState {\n static create(opts) {\n return new EscapeLayerState(opts);\n }\n opts;\n domContext;\n constructor(opts) {\n this.opts = opts;\n this.domContext = new DOMContext(this.opts.ref);\n let unsubEvents = noop;\n watch(() => opts.enabled.current, (enabled) => {\n if (enabled) {\n globalThis.bitsEscapeLayers.set(this, opts.escapeKeydownBehavior);\n unsubEvents = this.#addEventListener();\n }\n return () => {\n unsubEvents();\n globalThis.bitsEscapeLayers.delete(this);\n };\n });\n }\n #addEventListener = () => {\n return on(this.domContext.getDocument(), \"keydown\", this.#onkeydown, { passive: false });\n };\n #onkeydown = (e) => {\n if (e.key !== kbd.ESCAPE || !isResponsibleEscapeLayer(this))\n return;\n const clonedEvent = new KeyboardEvent(e.type, e);\n e.preventDefault();\n const behaviorType = this.opts.escapeKeydownBehavior.current;\n if (behaviorType !== \"close\" && behaviorType !== \"defer-otherwise-close\")\n return;\n this.opts.onEscapeKeydown.current(clonedEvent);\n };\n}\nfunction isResponsibleEscapeLayer(instance) {\n const layersArr = [...globalThis.bitsEscapeLayers];\n /**\n * We first check if we can find a top layer with `close` or `ignore`.\n * If that top layer was found and matches the provided node, then the node is\n * responsible for the escape. Otherwise, we know that all layers defer so\n * the first layer is the responsible one.\n */\n const topMostLayer = layersArr.findLast(([_, { current: behaviorType }]) => behaviorType === \"close\" || behaviorType === \"ignore\");\n if (topMostLayer)\n return topMostLayer[0] === instance;\n const [firstLayerNode] = layersArr[0];\n return firstLayerNode === instance;\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { EscapeLayerImplProps } from \"./types.js\";\n\timport { EscapeLayerState } from \"./use-escape-layer.svelte.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\tescapeKeydownBehavior = \"close\",\n\t\tonEscapeKeydown = noop,\n\t\tchildren,\n\t\tenabled,\n\t\tref,\n\t}: EscapeLayerImplProps = $props();\n\n\tEscapeLayerState.create({\n\t\tescapeKeydownBehavior: boxWith(() => escapeKeydownBehavior),\n\t\tonEscapeKeydown: boxWith(() => onEscapeKeydown),\n\t\tenabled: boxWith(() => enabled),\n\t\tref,\n\t});\n</script>\n\n{@render children?.()}\n","import { getActiveElement, simpleBox } from \"svelte-toolbelt\";\nimport { FocusScope } from \"./focus-scope.svelte.js\";\nexport class FocusScopeManager {\n static instance;\n #scopeStack = simpleBox([]);\n #focusHistory = new WeakMap();\n #preFocusHistory = new WeakMap();\n static getInstance() {\n if (!this.instance) {\n this.instance = new FocusScopeManager();\n }\n return this.instance;\n }\n register(scope) {\n const current = this.getActive();\n if (current && current !== scope) {\n current.pause();\n }\n // capture the currently focused element before this scope becomes active\n const activeElement = getActiveElement(document);\n if (activeElement && activeElement !== document.body) {\n this.#preFocusHistory.set(scope, activeElement);\n }\n this.#scopeStack.current = this.#scopeStack.current.filter((s) => s !== scope);\n this.#scopeStack.current.unshift(scope);\n }\n unregister(scope) {\n this.#scopeStack.current = this.#scopeStack.current.filter((s) => s !== scope);\n const next = this.getActive();\n if (next) {\n next.resume();\n }\n }\n getActive() {\n return this.#scopeStack.current[0];\n }\n setFocusMemory(scope, element) {\n this.#focusHistory.set(scope, element);\n }\n getFocusMemory(scope) {\n return this.#focusHistory.get(scope);\n }\n isActiveScope(scope) {\n return this.getActive() === scope;\n }\n setPreFocusMemory(scope, element) {\n this.#preFocusHistory.set(scope, element);\n }\n getPreFocusMemory(scope) {\n return this.#preFocusHistory.get(scope);\n }\n clearPreFocusMemory(scope) {\n this.#preFocusHistory.delete(scope);\n }\n}\n","/*!\n* tabbable 6.5.0\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\n// NOTE: separate `:not()` selectors has broader browser support than the newer\n// `:not([inert], [inert] *)` (Feb 2023)\nvar candidateSelectors = ['input:not([inert]):not([inert] *)', 'select:not([inert]):not([inert] *)', 'textarea:not([inert]):not([inert] *)', 'a[href]:not([inert]):not([inert] *)', 'area[href]:not([inert]):not([inert] *)', 'button:not([inert]):not([inert] *)', '[tabindex]:not(slot):not([inert]):not([inert] *)', 'audio[controls]:not([inert]):not([inert] *)', 'video[controls]:not([inert]):not([inert] *)', '[contenteditable]:not([contenteditable=\"false\"]):not([inert]):not([inert] *)', 'details>summary:first-of-type:not([inert]):not([inert] *)', 'details:not([inert]):not([inert] *)'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n var _element$getRootNode;\n return element === null || element === void 0 ? void 0 : (_element$getRootNode = element.getRootNode) === null || _element$getRootNode === void 0 ? void 0 : _element$getRootNode.call(element);\n} : function (element) {\n return element === null || element === void 0 ? void 0 : element.ownerDocument;\n};\n\n/**\n * Determines if a node is inert or in an inert ancestor.\n * @param {Node} [node]\n * @param {boolean} [lookUp] If true and `node` is not inert, looks up at ancestors to\n * see if any of them are inert. If false, only `node` itself is considered.\n * @returns {boolean} True if inert itself or by way of being in an inert ancestor.\n * False if `node` is falsy.\n */\nvar _isInert = function isInert(node, lookUp) {\n var _node$getAttribute;\n if (lookUp === void 0) {\n lookUp = true;\n }\n // CAREFUL: JSDom does not support inert at all, so we can't use the `HTMLElement.inert`\n // JS API property; we have to check the attribute, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's an active element\n var inertAtt = node === null || node === void 0 ? void 0 : (_node$getAttribute = node.getAttribute) === null || _node$getAttribute === void 0 ? void 0 : _node$getAttribute.call(node, 'inert');\n var inert = inertAtt === '' || inertAtt === 'true';\n\n // NOTE: this could also be handled with `node.matches('[inert], :is([inert] *)')`\n // if it weren't for `matches()` not being a function on shadow roots; the following\n // code works for any kind of node\n var result = inert || lookUp && node && (\n // closest does not exist on shadow roots, so we fall back to a manual\n // lookup upward, in case it is not defined.\n typeof node.closest === 'function' ? node.closest('[inert]') : _isInert(node.parentNode));\n return result;\n};\n\n/**\n * Determines if a node's content is editable.\n * @param {Element} [node]\n * @returns True if it's content-editable; false if it's not or `node` is falsy.\n */\nvar isContentEditable = function isContentEditable(node) {\n var _node$getAttribute2;\n // CAREFUL: JSDom does not support the `HTMLElement.isContentEditable` API so we have\n // to use the attribute directly to check for this, which can either be empty or 'true';\n // if it's `null` (not specified) or 'false', it's a non-editable element\n var attValue = node === null || node === void 0 ? void 0 : (_node$getAttribute2 = node.getAttribute) === null || _node$getAttribute2 === void 0 ? void 0 : _node$getAttribute2.call(node, 'contenteditable');\n return attValue === '' || attValue === 'true';\n};\n\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n // even if `includeContainer=false`, we still have to check it for inertness because\n // if it's inert (either by itself or via its parent), then all its children are inert\n if (_isInert(el)) {\n return [];\n }\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n candidates = candidates.filter(filter);\n return candidates;\n};\n\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidateScope\n * @property {Element} scopeParent contains inner candidates\n * @property {Element[]} candidates list of candidates found in the scope parent\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidateScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.<Element|CandidateScope>}\n */\nvar _getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n if (_isInert(element, false)) {\n // no need to look up since we're drilling down\n // anything inside this container will also be inert\n continue;\n }\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = _getCandidatesIteratively(content, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n }\n\n // iterate over shadow content if possible\n var shadowRoot = element.shadowRoot ||\n // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n\n // no inert look up because we're already drilling down and checking for inertness\n // on the way down, so all containers to this root node should have already been\n // vetted as non-inert\n var validShadowRoot = !_isInert(shadowRoot, false) && (!options.shadowRootFilter || options.shadowRootFilter(element));\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = _getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scopeParent: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n return candidates;\n};\n\n/**\n * @private\n * Determines if the node has an explicitly specified `tabindex` attribute.\n * @param {HTMLElement} node\n * @returns {boolean} True if so; false if not.\n */\nvar hasTabIndex = function hasTabIndex(node) {\n return !isNaN(parseInt(node.getAttribute('tabindex'), 10));\n};\n\n/**\n * Determine the tab index of a given node.\n * @param {HTMLElement} node\n * @returns {number} Tab order (negative, 0, or positive number).\n * @throws {Error} If `node` is falsy.\n */\nvar getTabIndex = function getTabIndex(node) {\n if (!node) {\n throw new Error('No node provided');\n }\n if (node.tabIndex < 0) {\n // in Chrome, <details/>, <audio controls/> and <video controls/> elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n if ((/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || isContentEditable(node)) && !hasTabIndex(node)) {\n return 0;\n }\n }\n return node.tabIndex;\n};\n\n/**\n * Determine the tab index of a given node __for sort order purposes__.\n * @param {HTMLElement} node\n * @param {boolean} [isScope] True for a custom element with shadow root or slot that, by default,\n * has tabIndex -1, but needs to be sorted by document order in order for its content to be\n * inserted into the correct sort position.\n * @returns {number} Tab order (negative, 0, or positive number).\n */\nvar getSortOrderTabIndex = function getSortOrderTabIndex(node, isScope) {\n var tabIndex = getTabIndex(node);\n if (tabIndex < 0 && isScope && !hasTabIndex(node)) {\n return 0;\n }\n return tabIndex;\n};\nvar sortOrderedTabbables = function sortOrderedTabbables(a, b) {\n return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;\n};\nvar isInput = function isInput(node) {\n return node.tagName === 'INPUT';\n};\nvar isHiddenInput = function isHiddenInput(node) {\n return isInput(node) && node.type === 'hidden';\n};\nvar isDetailsWithSummary = function isDetailsWithSummary(node) {\n var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {\n return child.tagName === 'SUMMARY';\n });\n return r;\n};\nvar getCheckedRadio = function getCheckedRadio(nodes, form) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\nvar isTabbableRadio = function isTabbableRadio(node) {\n if (!node.name) {\n return true;\n }\n var radioScope = node.form || getRootNode(node);\n var queryRadios = function queryRadios(name) {\n return radioScope.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');\n };\n var radioSet;\n if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);\n return false;\n }\n }\n var checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\nvar isRadio = function isRadio(node) {\n return isInput(node) && node.type === 'radio';\n};\nvar isNonTabbableRadio = function isNonTabbableRadio(node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\n// determines if a node is ultimately attached to the window's document\nvar isNodeAttached = function isNodeAttached(node) {\n var _nodeRoot;\n // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n // (but NOT _the_ document; see second 'If' comment below for more).\n // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n // is attached, and the one we need to check if it's in the document or not (because the\n // shadow, and all nodes it contains, is never considered in the document since shadows\n // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n // is hidden, or is not in the document itself but is detached, it will affect the shadow's\n // visibility, including all the nodes it contains). The host could be any normal node,\n // or a custom element (i.e. web component). Either way, that's the one that is considered\n // part of the document, not the shadow root, nor any of its children (i.e. the node being\n // tested).\n // To further complicate things, we have to look all the way up until we find a shadow HOST\n // that is attached (or find none) because the node might be in nested shadows...\n // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n // document (per the docs) and while it's a Document-type object, that document does not\n // appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n // node is actually detached.\n // NOTE: If `nodeRootHost` or `node` happens to be the `document` itself (which is possible\n // if a tabbable/focusable node was quickly added to the DOM, focused, and then removed\n // from the DOM as in https://github.com/focus-trap/focus-trap-react/issues/905), then\n // `ownerDocument` will be `null`, hence the optional chaining on it.\n var nodeRoot = node && getRootNode(node);\n var nodeRootHost = (_nodeRoot = nodeRoot) === null || _nodeRoot === void 0 ? void 0 : _nodeRoot.host;\n\n // in some cases, a detached node will return itself as the root instead of a document or\n // shadow root object, in which case, we shouldn't try to look further up the host chain\n var attached = false;\n if (nodeRoot && nodeRoot !== node) {\n var _nodeRootHost, _nodeRootHost$ownerDo, _node$ownerDocument;\n attached = !!((_nodeRootHost = nodeRootHost) !== null && _nodeRootHost !== void 0 && (_nodeRootHost$ownerDo = _nodeRootHost.ownerDocument) !== null && _nodeRootHost$ownerDo !== void 0 && _nodeRootHost$ownerDo.contains(nodeRootHost) || node !== null && node !== void 0 && (_node$ownerDocument = node.ownerDocument) !== null && _node$ownerDocument !== void 0 && _node$ownerDocument.contains(node));\n while (!attached && nodeRootHost) {\n var _nodeRoot2, _nodeRootHost2, _nodeRootHost2$ownerD;\n // since it's not attached and we have a root host, the node MUST be in a nested shadow DOM,\n // which means we need to get the host's host and check if that parent host is contained\n // in (i.e. attached to) the document\n nodeRoot = getRootNode(nodeRootHost);\n nodeRootHost = (_nodeRoot2 = nodeRoot) === null || _nodeRoot2 === void 0 ? void 0 : _nodeRoot2.host;\n attached = !!((_nodeRootHost2 = nodeRootHost) !== null && _nodeRootHost2 !== void 0 && (_nodeRootHost2$ownerD = _nodeRootHost2.ownerDocument) !== null && _nodeRootHost2$ownerD !== void 0 && _nodeRootHost2$ownerD.contains(nodeRootHost));\n }\n }\n return attached;\n};\nvar isZeroArea = function isZeroArea(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n width = _node$getBoundingClie.width,\n height = _node$getBoundingClie.height;\n return width === 0 && height === 0;\n};\nvar isHidden = function isHidden(node, _ref) {\n var displayCheck = _ref.displayCheck,\n getShadowRoot = _ref.getShadowRoot;\n if (displayCheck === 'full-native') {\n if ('checkVisibility' in node) {\n // Chrome >= 105, Edge >= 105, Firefox >= 106, Safari >= 17.4\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Element/checkVisibility#browser_compatibility\n var visible = node.checkVisibility({\n // Checking opacity might be desirable for some use cases, but natively,\n // opacity zero elements _are_ focusable and tabbable.\n checkOpacity: false,\n opacityProperty: false,\n contentVisibilityAuto: true,\n visibilityProperty: true,\n // This is an alias for `visibilityProperty`. Contemporary browsers\n // support both. However, this alias has wider browser support (Chrome\n // >= 105 and Firefox >= 106, vs. Chrome >= 121 and Firefox >= 122), so\n // we include it anyway.\n checkVisibilityCSS: true\n });\n return !visible;\n }\n // Fall through to manual visibility checks\n }\n\n // NOTE: visibility will be `undefined` if node is detached from the document\n // (see notes about this further down), which means we will consider it visible\n // (this is legacy behavior from a very long way back)\n // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n // _visibility_ check, not a _display_ check\n var _getComputedStyle = getComputedStyle(node),\n visibility = _getComputedStyle.visibility;\n if (visibility === 'hidden' || visibility === 'collapse') {\n return true;\n }\n var isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n var nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n }\n if (!displayCheck || displayCheck === 'full' ||\n // full-native can run this branch when it falls through in case\n // Element#checkVisibility is unsupported\n displayCheck === 'full-native' || displayCheck === 'legacy-full') {\n if (typeof getShadowRoot === 'function') {\n // figure out if we should consider the node to be in an undisclosed shadow and use the\n // 'non-zero-area' fallback\n var originalNode = node;\n while (node) {\n var parentElement = node.parentElement;\n var rootNode = getRootNode(node);\n if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n ) {\n // node has an undisclosed shadow which means we can only treat it as a black box, so we\n // fall back to a non-zero-area test\n return isZeroArea(node);\n } else if (node.assignedSlot) {\n // iterate up slot\n node = node.assignedSlot;\n } else if (!parentElement && rootNode !== node.ownerDocument) {\n // cross shadow boundary\n node = rootNode.host;\n } else {\n // iterate up normal dom\n node = parentElement;\n }\n }\n node = originalNode;\n }\n // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n // (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n // it might be a falsy value, which means shadow DOM support is disabled\n\n // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n // now we can just test to see if it would normally be visible or not, provided it's\n // attached to the main document.\n // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n if (isNodeAttached(node)) {\n // this works wherever the node is: if there's at least one client rect, it's\n // somehow displayed; it also covers the CSS 'display: contents' case where the\n // node itself is hidden in place of its contents; and there's no need to search\n // up the hierarchy either\n return !node.getClientRects().length;\n }\n\n // Else, the node isn't attached to the document, which means the `getClientRects()`\n // API will __always__ return zero rects (this can happen, for example, if React\n // is used to render nodes onto a detached tree, as confirmed in this thread:\n // https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n //\n // It also means that even window.getComputedStyle(node).display will return `undefined`\n // because styles are only computed for nodes that are in the document.\n //\n // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n // somehow. Though it was never stated officially, anyone who has ever used tabbable\n // APIs on nodes in detached containers has actually implicitly used tabbable in what\n // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n // considering __everything__ to be visible because of the innability to determine styles.\n //\n // v6.0.0: As of this major release, the default 'full' option __no longer treats detached\n // nodes as visible with the 'none' fallback.__\n if (displayCheck !== 'legacy-full') {\n return true; // hidden\n }\n // else, fallback to 'none' mode and consider the node visible\n } else if (displayCheck === 'non-zero-area') {\n // NOTE: Even though this tests that the node's client rect is non-zero to determine\n // whether it's displayed, and that a detached node will __always__ have a zero-area\n // client rect, we don't special-case for whether the node is attached or not. In\n // this mode, we do want to consider nodes that have a zero area to be hidden at all\n // times, and that includes attached or not.\n return isZeroArea(node);\n }\n\n // visible, as far as we can tell, or per current `displayCheck=none` mode, we assume\n // it's visible\n return false;\n};\n\n// form fields (nested) inside a disabled fieldset are not focusable/tabbable\n// unless they are in the _first_ <legend> element of the top-most disabled\n// fieldset\nvar isDisabledFromFieldset = function isDisabledFromFieldset(node) {\n if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n var parentNode = node.parentElement;\n // check if `node` is contained in a disabled <fieldset>\n while (parentNode) {\n if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n // look for the first <legend> among the children of the disabled <fieldset>\n for (var i = 0; i < parentNode.children.length; i++) {\n var child = parentNode.children.item(i);\n // when the first <legend> (in document order) is found\n if (child.tagName === 'LEGEND') {\n // if its parent <fieldset> is not nested in another disabled <fieldset>,\n // return whether `node` is a descendant of its first <legend>\n return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);\n }\n }\n // the disabled <fieldset> containing `node` has no <legend>\n return true;\n }\n parentNode = parentNode.parentElement;\n }\n }\n\n // else, node's tabbable/focusable state should not be affected by a fieldset's\n // enabled/disabled state\n return false;\n};\nvar isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {\n if (node.disabled || isHiddenInput(node) || isHidden(node, options) ||\n // For a details element with a summary, the summary element gets the focus\n isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {\n return false;\n }\n return true;\n};\nvar isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {\n if (isNonTabbableRadio(node) || getTabIndex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {\n return false;\n }\n return true;\n};\nvar isShadowRootTabbable = function isShadowRootTabbable(shadowHostNode) {\n var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n if (isNaN(tabIndex) || tabIndex >= 0) {\n return true;\n }\n // If a custom element has an explicit negative tabindex,\n // browsers will not allow tab targeting said element's children.\n return false;\n};\n\n/**\n * @param {Array.<Element|CandidateScope>} candidates\n * @returns Element[]\n */\nvar _sortByOrder = function sortByOrder(candidates) {\n var regularTabbables = [];\n var orderedTabbables = [];\n candidates.forEach(function (item, i) {\n var isScope = !!item.scopeParent;\n var element = isScope ? item.scopeParent : item;\n var candidateTabindex = getSortOrderTabIndex(element, isScope);\n var elements = isScope ? _sortByOrder(item.candidates) : element;\n if (candidateTabindex === 0) {\n isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n item: item,\n isScope: isScope,\n content: elements\n });\n }\n });\n return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {\n sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);\n return acc;\n }, []).concat(regularTabbables);\n};\nvar tabbable = function tabbable(container, options) {\n options = options || {};\n var candidates;\n if (options.getShadowRoot) {\n candidates = _getCandidatesIteratively([container], options.includeContainer, {\n filter: isNodeMatchingSelectorTabbable.bind(null, options),\n flatten: false,\n getShadowRoot: options.getShadowRoot,\n shadowRootFilter: isShadowRootTabbable\n });\n } else {\n candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));\n }\n return _sortByOrder(candidates);\n};\nvar focusable = function focusable(container, options) {\n options = options || {};\n var candidates;\n if (options.getShadowRoot) {\n candidates = _getCandidatesIteratively([container], options.includeContainer, {\n filter: isNodeMatchingSelectorFocusable.bind(null, options),\n flatten: true,\n getShadowRoot: options.getShadowRoot\n });\n } else {\n candidates = getCandidates(container, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));\n }\n return candidates;\n};\nvar isTabbable = function isTabbable(node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorTabbable(options, node);\n};\nvar focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe:not([inert]):not([inert] *)').join(',');\nvar isFocusable = function isFocusable(node, options) {\n options = options || {};\n if (!node) {\n throw new Error('No node provided');\n }\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { focusable, getTabIndex, isFocusable, isTabbable, tabbable };\n//# sourceMappingURL=index.esm.js.map\n","import { getActiveElement, onDestroyEffect } from \"svelte-toolbelt\";\nimport { FocusScopeManager } from \"./focus-scope-manager.js\";\nimport { focusable, isFocusable, tabbable } from \"tabbable\";\nimport { on } from \"svelte/events\";\nimport { watch } from \"runed\";\nexport class FocusScope {\n #paused = false;\n #container = null;\n #manager = FocusScopeManager.getInstance();\n #cleanupFns = [];\n #opts;\n constructor(opts) {\n this.#opts = opts;\n }\n get paused() {\n return this.#paused;\n }\n pause() {\n this.#paused = true;\n }\n resume() {\n this.#paused = false;\n }\n #cleanup() {\n for (const fn of this.#cleanupFns) {\n fn();\n }\n this.#cleanupFns = [];\n }\n mount(container) {\n if (this.#container) {\n this.unmount();\n }\n this.#container = container;\n this.#manager.register(this);\n this.#setupEventListeners();\n this.#handleOpenAutoFocus();\n }\n unmount() {\n if (!this.#container)\n return;\n this.#cleanup();\n // handle close auto-focus\n this.#handleCloseAutoFocus();\n this.#manager.unregister(this);\n this.#manager.clearPreFocusMemory(this);\n this.#container = null;\n }\n #handleOpenAutoFocus() {\n if (!this.#container)\n return;\n const event = new CustomEvent(\"focusScope.onOpenAutoFocus\", {\n bubbles: false,\n cancelable: true,\n });\n this.#opts.onOpenAutoFocus.current(event);\n if (!event.defaultPrevented) {\n requestAnimationFrame(() => {\n if (!this.#container ||\n this.#paused ||\n !this.#manager.isActiveScope(this) ||\n this.#container.contains(getActiveElement(this.#container.ownerDocument))) {\n return;\n }\n const firstTabbable = this.#getFirstTabbable();\n if (firstTabbable) {\n firstTabbable.focus();\n this.#manager.setFocusMemory(this, firstTabbable);\n }\n else {\n this.#container.focus();\n }\n });\n }\n }\n #handleCloseAutoFocus() {\n const event = new CustomEvent(\"focusScope.onCloseAutoFocus\", {\n bubbles: false,\n cancelable: true,\n });\n this.#opts.onCloseAutoFocus.current?.(event);\n if (!event.defaultPrevented) {\n // return focus to the element that was focused before this scope opened\n const preFocusedElement = this.#manager.getPreFocusMemory(this);\n if (preFocusedElement && preFocusedElement.isConnected) {\n // ensure the element is still focusable and in the document\n try {\n preFocusedElement.focus();\n }\n catch {\n // fallback if focus fails\n document.body.focus();\n }\n }\n }\n }\n #setupEventListeners() {\n if (!this.#container || !this.#opts.trap.current)\n return;\n const container = this.#container;\n const doc = container.ownerDocument;\n const handleFocus = (e) => {\n if (this.#paused || !this.#manager.isActiveScope(this))\n return;\n const target = e.composedPath()[0];\n if (!target)\n return;\n const isInside = container.contains(target);\n if (isInside) {\n // store last focused element\n this.#manager.setFocusMemory(this, target);\n }\n else {\n // focus escaped - bring it back\n const lastFocused = this.#manager.getFocusMemory(this);\n if (lastFocused && container.contains(lastFocused) && isFocusable(lastFocused)) {\n e.preventDefault();\n lastFocused.focus();\n }\n else {\n // fallback to first tabbable or first focusable or container\n const firstTabbable = this.#getFirstTabbable();\n const firstFocusable = this.#getAllFocusables()[0];\n (firstTabbable || firstFocusable || container).focus();\n }\n }\n };\n const handleKeydown = (e) => {\n if (!this.#opts.loop || this.#paused || e.key !== \"Tab\")\n return;\n if (!this.#manager.isActiveScope(this))\n return;\n const tabbables = this.#getTabbables();\n if (tabbables.length === 0)\n return;\n const first = tabbables[0];\n const last = tabbables[tabbables.length - 1];\n if (!e.shiftKey && getActiveElement(doc) === last) {\n e.preventDefault();\n first.focus();\n }\n else if (e.shiftKey && getActiveElement(doc) === first) {\n e.preventDefault();\n last.focus();\n }\n };\n this.#cleanupFns.push(on(doc, \"focusin\", handleFocus, { capture: true }), on(container, \"keydown\", handleKeydown));\n const observer = new MutationObserver(() => {\n const lastFocused = this.#manager.getFocusMemory(this);\n if (lastFocused && !container.contains(lastFocused)) {\n // last focused element was removed\n const firstTabbable = this.#getFirstTabbable();\n const firstFocusable = this.#getAllFocusables()[0];\n const elementToFocus = firstTabbable || firstFocusable;\n if (elementToFocus) {\n elementToFocus.focus();\n this.#manager.setFocusMemory(this, elementToFocus);\n }\n else {\n // no focusable elements left, focus container\n container.focus();\n }\n }\n });\n observer.observe(container, {\n childList: true,\n subtree: true,\n });\n this.#cleanupFns.push(() => observer.disconnect());\n }\n #getTabbables() {\n if (!this.#container)\n return [];\n return tabbable(this.#container, {\n includeContainer: false,\n getShadowRoot: true,\n });\n }\n #getFirstTabbable() {\n const tabbables = this.#getTabbables();\n return tabbables[0] || null;\n }\n #getAllFocusables() {\n if (!this.#container)\n return [];\n return focusable(this.#container, {\n includeContainer: false,\n getShadowRoot: true,\n });\n }\n static use(opts) {\n let scope = null;\n watch([() => opts.ref.current, () => opts.enabled.current], ([ref, enabled]) => {\n if (ref && enabled) {\n if (!scope) {\n scope = new FocusScope(opts);\n }\n scope.mount(ref);\n }\n else if (scope) {\n scope.unmount();\n scope = null;\n }\n });\n onDestroyEffect(() => {\n scope?.unmount();\n });\n return {\n get props() {\n return {\n tabindex: -1,\n };\n },\n };\n }\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { FocusScopeImplProps } from \"./types.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport { FocusScope } from \"./focus-scope.svelte.js\";\n\n\tlet {\n\t\tenabled = false,\n\t\ttrapFocus = false,\n\t\tloop = false,\n\t\tonCloseAutoFocus = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tfocusScope,\n\t\tref,\n\t}: FocusScopeImplProps = $props();\n\n\tconst focusScopeState = FocusScope.use({\n\t\tenabled: boxWith(() => enabled),\n\t\ttrap: boxWith(() => trapFocus),\n\t\tloop: loop,\n\t\tonCloseAutoFocus: boxWith(() => onCloseAutoFocus),\n\t\tonOpenAutoFocus: boxWith(() => onOpenAutoFocus),\n\t\tref,\n\t});\n</script>\n\n{@render focusScope?.({ props: focusScopeState.props })}\n","import { DOMContext, contains, executeCallbacks, } from \"svelte-toolbelt\";\nimport { watch } from \"runed\";\nimport { on } from \"svelte/events\";\nimport { noop } from \"../../../internal/noop.js\";\nimport { isHTMLElement } from \"../../../internal/is.js\";\nconst noopPointer = () => { };\nglobalThis.bitsTextSelectionLayers ??= new Map();\nexport class TextSelectionLayerState {\n static create(opts) {\n return new TextSelectionLayerState(opts);\n }\n opts;\n domContext;\n #unsubSelectionLock = noop;\n #enabledSnapshot = false;\n #onPointerDownSnapshot = noopPointer;\n #onPointerUpSnapshot = noopPointer;\n constructor(opts) {\n this.opts = opts;\n this.domContext = new DOMContext(opts.ref);\n let unsubEvents = noop;\n watch(() => [\n this.opts.enabled.current,\n this.opts.onPointerDown.current,\n this.opts.onPointerUp.current,\n ], ([enabled, onPointerDown, onPointerUp]) => {\n this.#enabledSnapshot = enabled;\n this.#onPointerDownSnapshot = onPointerDown;\n this.#onPointerUpSnapshot = onPointerUp;\n if (enabled) {\n globalThis.bitsTextSelectionLayers.set(this, this.opts.enabled);\n unsubEvents();\n unsubEvents = this.#addEventListeners();\n }\n return () => {\n this.#enabledSnapshot = false;\n unsubEvents();\n this.#resetSelectionLock();\n globalThis.bitsTextSelectionLayers.delete(this);\n };\n });\n }\n #addEventListeners() {\n return executeCallbacks(on(this.domContext.getDocument(), \"pointerdown\", this.#pointerdown), on(this.domContext.getDocument(), \"pointerup\", this.#pointerup));\n }\n #pointerup = (e) => {\n // Releasing the lock is internal cleanup, not a consumer callback, so it must run\n // whatever the event's default-prevented state. Composing it with the user handler\n // meant `composeHandlers` bailed out of the whole chain on a `pointerup` that\n // anything else had cancelled, leaving `user-select: none` on `<body>`.\n this.#resetSelectionLock();\n if (e.defaultPrevented)\n return;\n this.#onPointerUpSnapshot(e);\n };\n #pointerdown = (e) => {\n // Check the plain-boolean snapshot BEFORE reading `this.opts.ref.current`.\n // If this document listener outlives its component, that box is a `$derived`\n // owned by a destroyed effect, and reading it emits `derived_inert` on every\n // pointerdown anywhere in the document, forever.\n if (!this.#enabledSnapshot)\n return;\n // Release any lock still held before arming a new one. Under `forceMount` this\n // handler can run twice for a single event, and `preventTextSelectionOverflow`\n // snapshots the current `user-select` to restore later. Resetting the lock\n // prevents the second arm from re-snapshotting the `none` written the first time.\n this.#resetSelectionLock();\n const node = this.opts.ref.current;\n const target = e.target;\n if (!isHTMLElement(node) || !isHTMLElement(target))\n return;\n /**\n * We only lock user-selection overflow if layer is the top most layer and\n * pointerdown occurred inside the node. You are still allowed to select text\n * outside the node provided pointerdown occurs outside the node.\n */\n if (!isHighestLayer(this) || !contains(node, target))\n return;\n this.#onPointerDownSnapshot(e);\n if (e.defaultPrevented)\n return;\n this.#unsubSelectionLock = preventTextSelectionOverflow(node, this.domContext.getDocument().body);\n };\n #resetSelectionLock = () => {\n this.#unsubSelectionLock();\n this.#unsubSelectionLock = noop;\n };\n}\nconst getUserSelect = (node) => node.style.userSelect || node.style.webkitUserSelect;\nfunction preventTextSelectionOverflow(node, body) {\n const originalBodyUserSelect = getUserSelect(body);\n const originalNodeUserSelect = getUserSelect(node);\n setUserSelect(body, \"none\");\n setUserSelect(node, \"text\");\n return () => {\n setUserSelect(body, originalBodyUserSelect);\n setUserSelect(node, originalNodeUserSelect);\n };\n}\nfunction setUserSelect(node, value) {\n node.style.userSelect = value;\n node.style.webkitUserSelect = value;\n}\nfunction isHighestLayer(instance) {\n const layersArr = [...globalThis.bitsTextSelectionLayers];\n if (!layersArr.length)\n return false;\n const highestLayer = layersArr.at(-1);\n if (!highestLayer)\n return false;\n return highestLayer[0] === instance;\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { TextSelectionLayerImplProps } from \"./types.js\";\n\timport { TextSelectionLayerState } from \"./use-text-selection-layer.svelte.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\tpreventOverflowTextSelection = true,\n\t\tonPointerDown = noop,\n\t\tonPointerUp = noop,\n\t\tid,\n\t\tchildren,\n\t\tenabled,\n\t\tref,\n\t}: TextSelectionLayerImplProps = $props();\n\n\tTextSelectionLayerState.create({\n\t\tid: boxWith(() => id),\n\t\tonPointerDown: boxWith(() => onPointerDown),\n\t\tonPointerUp: boxWith(() => onPointerUp),\n\t\tenabled: boxWith(() => enabled && preventOverflowTextSelection),\n\t\tref,\n\t});\n</script>\n\n{@render children?.()}\n","globalThis.bitsIdCounter ??= { current: 0 };\n/**\n * Generates a unique ID based on a global counter.\n */\nexport function useId(prefix = \"bits\") {\n globalThis.bitsIdCounter.current++;\n return `${prefix}-${globalThis.bitsIdCounter.current}`;\n}\n","export class SharedState {\n #factory;\n #subscribers = 0;\n #state = $state();\n #scope;\n constructor(factory) {\n this.#factory = factory;\n }\n #dispose() {\n this.#subscribers -= 1;\n if (this.#scope && this.#subscribers <= 0) {\n this.#scope();\n this.#state = undefined;\n this.#scope = undefined;\n }\n }\n get(...args) {\n this.#subscribers += 1;\n if (this.#state === undefined) {\n this.#scope = $effect.root(() => {\n this.#state = this.#factory(...args);\n });\n }\n $effect(() => {\n return () => {\n this.#dispose();\n };\n });\n return this.#state;\n }\n}\n","import { SvelteMap } from \"svelte/reactivity\";\nimport { afterTick, boxWith, onDestroyEffect, } from \"svelte-toolbelt\";\nimport { isIOS } from \"./is.js\";\nimport { useId } from \"./use-id.js\";\nimport { watch } from \"runed\";\nimport { SharedState } from \"./shared-state.svelte.js\";\nimport { BROWSER } from \"esm-env\";\nimport { on } from \"svelte/events\";\n/** A map of lock ids to their `locked` state. */\nconst lockMap = new SvelteMap();\nconst MANAGED_PROPERTIES = [\n \"padding-right\",\n \"margin-right\",\n // the shorthand reads \"\" when only one axis is set inline, so its longhands are snapshotted\n // too and restored after it (keep this order)\n \"overflow\",\n \"overflow-x\",\n \"overflow-y\",\n \"pointer-events\",\n \"--scrollbar-width\",\n];\nlet initialProperties = null;\nlet hadInitialStyleAttribute = false;\nconst modifiedProperties = new Set();\nlet stopTouchMoveListener = null;\nlet cleanupTimeoutId = null;\nlet isInCleanupTransition = false;\nfunction setManagedProperty(style, property, value) {\n style.setProperty(property, value);\n modifiedProperties.add(property);\n if (property === \"overflow\") {\n modifiedProperties.add(\"overflow-x\");\n modifiedProperties.add(\"overflow-y\");\n }\n}\nconst anyLocked = boxWith(() => {\n for (const value of lockMap.values()) {\n if (value)\n return true;\n }\n return false;\n});\n/**\n * We track the time we scheduled the cleanup to prevent race conditions\n * when multiple locks are created/destroyed in the same tick, ensuring\n * only the last one to schedule the cleanup will run.\n *\n * reference: https://github.com/huntabyte/bits-ui/issues/1639\n */\nlet cleanupScheduledAt = null;\nconst bodyLockStackCount = new SharedState(() => {\n function resetBodyStyle(documentObj) {\n if (!BROWSER)\n return;\n // without a snapshot, still remove what we set so the body is never left locked\n for (const prop of MANAGED_PROPERTIES) {\n if (!modifiedProperties.has(prop))\n continue;\n const initial = initialProperties?.get(prop);\n if (initial?.value) {\n documentObj.body.style.setProperty(prop, initial.value, initial.priority);\n }\n else {\n documentObj.body.style.removeProperty(prop);\n }\n }\n if (!hadInitialStyleAttribute && documentObj.body.style.length === 0) {\n documentObj.body.removeAttribute(\"style\");\n }\n initialProperties = null;\n modifiedProperties.clear();\n isIOS && stopTouchMoveListener?.();\n }\n function cancelPendingCleanup() {\n if (cleanupTimeoutId === null)\n return;\n window.clearTimeout(cleanupTimeoutId);\n cleanupTimeoutId = null;\n }\n function scheduleCleanupIfNoNewLocks(delay, callback) {\n cancelPendingCleanup();\n isInCleanupTransition = true;\n cleanupScheduledAt = Date.now();\n const currentCleanupId = cleanupScheduledAt;\n /**\n * We schedule the cleanup to run after a delay to allow new locks to register\n * that might have been added in the same tick as the current cleanup.\n *\n * If a new lock is added in the same tick, the cleanup will be cancelled and\n * a new cleanup will be scheduled.\n *\n * This is to prevent the cleanup from running too early and resetting the body\n * style before the new lock has had a chance to apply its styles.\n */\n const cleanupFn = () => {\n cleanupTimeoutId = null;\n // check if this cleanup is still valid (no newer cleanups scheduled)\n if (cleanupScheduledAt !== currentCleanupId)\n return;\n // ensure no new locks were added during the delay\n if (!isAnyLocked(lockMap)) {\n isInCleanupTransition = false;\n callback();\n }\n else {\n isInCleanupTransition = false;\n }\n };\n const actualDelay = delay === null ? 24 : delay;\n cleanupTimeoutId = window.setTimeout(cleanupFn, actualDelay);\n }\n function ensureInitialStyleCaptured() {\n // only capture initial style once, when no locks exist and no cleanup is in progress\n if (initialProperties === null && lockMap.size === 0 && !isInCleanupTransition) {\n hadInitialStyleAttribute = document.body.hasAttribute(\"style\");\n initialProperties = new Map();\n for (const prop of MANAGED_PROPERTIES) {\n initialProperties.set(prop, {\n value: document.body.style.getPropertyValue(prop),\n priority: document.body.style.getPropertyPriority(prop),\n });\n }\n }\n }\n watch(() => anyLocked.current, () => {\n if (!anyLocked.current)\n return;\n // ensure we've captured the initial style before applying any lock styles\n ensureInitialStyleCaptured();\n // if we're applying lock styles, we're no longer in a cleanup transition\n isInCleanupTransition = false;\n const htmlStyle = getComputedStyle(document.documentElement);\n const bodyStyle = getComputedStyle(document.body);\n // check if scrollbar-gutter: stable is already handling scrollbar space\n const hasStableGutter = htmlStyle.scrollbarGutter?.includes(\"stable\") ||\n bodyStyle.scrollbarGutter?.includes(\"stable\");\n // TODO: account for RTL direction, etc.\n const verticalScrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n const paddingRight = Number.parseInt(bodyStyle.paddingRight ?? \"0\", 10);\n const config = {\n padding: paddingRight + verticalScrollbarWidth,\n margin: Number.parseInt(bodyStyle.marginRight ?? \"0\", 10),\n };\n // only add padding compensation if stable gutter isn't handling it\n if (verticalScrollbarWidth > 0 && !hasStableGutter) {\n setManagedProperty(document.body.style, \"padding-right\", `${config.padding}px`);\n setManagedProperty(document.body.style, \"margin-right\", `${config.margin}px`);\n setManagedProperty(document.body.style, \"--scrollbar-width\", `${verticalScrollbarWidth}px`);\n }\n setManagedProperty(document.body.style, \"overflow\", \"hidden\");\n if (isIOS) {\n // IOS devices are special and require a touchmove listener to prevent scrolling\n stopTouchMoveListener = on(document, \"touchmove\", (e) => {\n if (e.target !== document.documentElement)\n return;\n if (e.touches.length > 1)\n return;\n e.preventDefault();\n }, { passive: false });\n }\n /**\n * We ensure pointer-events: none is applied _after_ DOM updates, so that any focus/\n * interaction changes from opening overlays/menus complete _before_ we block pointer\n * events.\n *\n * this avoids race conditions where pointer-events could be set too early and break\n * focus/interaction.\n */\n afterTick(() => {\n setManagedProperty(document.body.style, \"pointer-events\", \"none\");\n setManagedProperty(document.body.style, \"overflow\", \"hidden\");\n });\n });\n onDestroyEffect(() => {\n return () => {\n stopTouchMoveListener?.();\n };\n });\n return {\n get lockMap() {\n return lockMap;\n },\n resetBodyStyle,\n scheduleCleanupIfNoNewLocks,\n cancelPendingCleanup,\n ensureInitialStyleCaptured,\n };\n});\nexport class BodyScrollLock {\n #id = useId();\n #initialState;\n #restoreScrollDelay = () => null;\n #countState;\n locked;\n constructor(initialState, restoreScrollDelay = () => null) {\n this.#initialState = initialState;\n this.#restoreScrollDelay = restoreScrollDelay;\n this.#countState = bodyLockStackCount.get();\n if (!this.#countState)\n return;\n /**\n * Since a new lock is being created, we cancel any pending cleanup to\n * prevent the cleanup from running too early and resetting the body style\n * before the new lock has had a chance to apply its styles.\n *\n * reference: https://github.com/huntabyte/bits-ui/issues/1639\n */\n this.#countState.cancelPendingCleanup();\n // capture initial style before this lock is registered\n this.#countState.ensureInitialStyleCaptured();\n this.#countState.lockMap.set(this.#id, this.#initialState ?? false);\n this.locked = boxWith(() => this.#countState.lockMap.get(this.#id) ?? false, (v) => this.#countState.lockMap.set(this.#id, v));\n onDestroyEffect(() => {\n this.#countState.lockMap.delete(this.#id);\n // if not the last lock, we don't need to do anything\n if (isAnyLocked(this.#countState.lockMap))\n return;\n const restoreScrollDelay = this.#restoreScrollDelay();\n const documentObj = document;\n /**\n * We schedule the cleanup to run after a delay to handle same-tick\n * destroy/create scenarios.\n *\n * reference: https://github.com/huntabyte/bits-ui/issues/1639\n */\n this.#countState.scheduleCleanupIfNoNewLocks(restoreScrollDelay, () => {\n this.#countState.resetBodyStyle(documentObj);\n });\n });\n }\n}\nfunction isAnyLocked(map) {\n for (const [_, value] of map) {\n if (value)\n return true;\n }\n return false;\n}\n","<script lang=\"ts\">\n\timport type { ScrollLockProps } from \"./index.js\";\n\timport { BodyScrollLock } from \"../../../internal/body-scroll-lock.svelte.js\";\n\n\tlet { preventScroll = true, restoreScrollDelay = null }: ScrollLockProps = $props();\n\n\tif (preventScroll) {\n\t\tnew BodyScrollLock(preventScroll, () => restoreScrollDelay);\n\t}\n</script>\n","<script lang=\"ts\">\n\timport { afterSleep, boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { AlertDialogContentProps } from \"../types.js\";\n\timport DismissibleLayer from \"../../utilities/dismissible-layer/dismissible-layer.svelte\";\n\timport EscapeLayer from \"../../utilities/escape-layer/escape-layer.svelte\";\n\timport FocusScope from \"../../utilities/focus-scope/focus-scope.svelte\";\n\timport TextSelectionLayer from \"../../utilities/text-selection-layer/text-selection-layer.svelte\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport ScrollLock from \"../../utilities/scroll-lock/scroll-lock.svelte\";\n\timport { DialogContentState } from \"../../dialog/dialog.svelte.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tforceMount = false,\n\t\tinteractOutsideBehavior = \"ignore\",\n\t\tonCloseAutoFocus = noop,\n\t\tonEscapeKeydown = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tonInteractOutside = noop,\n\t\tpreventScroll = true,\n\t\tpreventOverflowTextSelection = true,\n\t\ttrapFocus = true,\n\t\trestoreScrollDelay = null,\n\t\t...restProps\n\t}: AlertDialogContentProps = $props();\n\n\tconst contentState = DialogContentState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n</script>\n\n{#if contentState.shouldRender || forceMount}\n\t<FocusScope\n\t\tref={contentState.opts.ref}\n\t\tloop\n\t\t{trapFocus}\n\t\tenabled={contentState.root.opts.open.current}\n\t\t{onCloseAutoFocus}\n\t\tonOpenAutoFocus={(e) => {\n\t\t\tonOpenAutoFocus(e);\n\t\t\tif (e.defaultPrevented) return;\n\t\t\te.preventDefault();\n\t\t\tafterSleep(0, () => contentState.opts.ref.current?.focus());\n\t\t}}\n\t>\n\t\t{#snippet focusScope({ props: focusScopeProps })}\n\t\t\t<EscapeLayer\n\t\t\t\t{...mergedProps}\n\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\tref={contentState.opts.ref}\n\t\t\t\tonEscapeKeydown={(e) => {\n\t\t\t\t\tonEscapeKeydown(e);\n\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<DismissibleLayer\n\t\t\t\t\t{...mergedProps}\n\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\t{interactOutsideBehavior}\n\t\t\t\t\tonInteractOutside={(e) => {\n\t\t\t\t\t\tonInteractOutside(e);\n\t\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<TextSelectionLayer\n\t\t\t\t\t\t{...mergedProps}\n\t\t\t\t\t\t{preventOverflowTextSelection}\n\t\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\t>\n\t\t\t\t\t\t{#if child}\n\t\t\t\t\t\t\t{#if contentState.root.opts.open.current}\n\t\t\t\t\t\t\t\t<ScrollLock {preventScroll} {restoreScrollDelay} />\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{@render child({\n\t\t\t\t\t\t\t\tprops: mergeProps(mergedProps, focusScopeProps),\n\t\t\t\t\t\t\t\t...contentState.snippetProps,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<ScrollLock {preventScroll} />\n\t\t\t\t\t\t\t<div {...mergeProps(mergedProps, focusScopeProps)}>\n\t\t\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</TextSelectionLayer>\n\t\t\t\t</DismissibleLayer>\n\t\t\t</EscapeLayer>\n\t\t{/snippet}\n\t</FocusScope>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogOverlayState } from \"../dialog.svelte.js\";\n\timport type { DialogOverlayProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tforceMount = false,\n\t\tchild,\n\t\tchildren,\n\t\tref = $bindable(null),\n\t\t...restProps\n\t}: DialogOverlayProps = $props();\n\n\tconst overlayState = DialogOverlayState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, overlayState.props));\n</script>\n\n{#if overlayState.shouldRender || forceMount}\n\t{#if child}\n\t\t{@render child({ props: mergeProps(mergedProps), ...overlayState.snippetProps })}\n\t{:else}\n\t\t<div {...mergeProps(mergedProps)}>\n\t\t\t{@render children?.(overlayState.snippetProps)}\n\t\t</div>\n\t{/if}\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogDescriptionState } from \"../dialog.svelte.js\";\n\timport type { DialogDescriptionProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\t...restProps\n\t}: DialogDescriptionProps = $props();\n\n\tconst descriptionState = DialogDescriptionState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, descriptionState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<div {...mergedProps}>\n\t\t{@render children?.()}\n\t</div>\n{/if}\n","import { attachRef } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { boolToStr, createBitsAttrs, getAriaChecked, boolToEmptyStrOrUndef, } from \"../../internal/attrs.js\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { arraysAreEqual } from \"../../internal/arrays.js\";\nimport { isHTMLElement } from \"../../internal/is.js\";\nconst checkboxAttrs = createBitsAttrs({\n component: \"checkbox\",\n parts: [\"root\", \"group\", \"group-label\", \"input\"],\n});\nexport const CheckboxGroupContext = new Context(\"Checkbox.Group\");\nexport class CheckboxGroupState {\n static create(opts) {\n return CheckboxGroupContext.set(new CheckboxGroupState(opts));\n }\n opts;\n attachment;\n labelId = $state(undefined);\n constructor(opts) {\n this.opts = opts;\n this.attachment = attachRef(this.opts.ref);\n }\n addValue(checkboxValue) {\n if (!checkboxValue)\n return;\n if (!this.opts.value.current.includes(checkboxValue)) {\n const newValue = [...$state.snapshot(this.opts.value.current), checkboxValue];\n this.opts.value.current = newValue;\n if (arraysAreEqual(this.opts.value.current, newValue))\n return;\n this.opts.onValueChange.current(newValue);\n }\n }\n removeValue(checkboxValue) {\n if (!checkboxValue)\n return;\n const index = this.opts.value.current.indexOf(checkboxValue);\n if (index === -1)\n return;\n const newValue = this.opts.value.current.filter((v) => v !== checkboxValue);\n this.opts.value.current = newValue;\n if (arraysAreEqual(this.opts.value.current, newValue))\n return;\n this.opts.onValueChange.current(newValue);\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"group\",\n \"aria-labelledby\": this.labelId,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n [checkboxAttrs.group]: \"\",\n ...this.attachment,\n }));\n}\nexport class CheckboxGroupLabelState {\n static create(opts) {\n return new CheckboxGroupLabelState(opts, CheckboxGroupContext.get());\n }\n opts;\n group;\n attachment;\n constructor(opts, group) {\n this.opts = opts;\n this.group = group;\n this.group.labelId = this.opts.id.current;\n this.attachment = attachRef(this.opts.ref);\n watch.pre(() => this.opts.id.current, (id) => {\n this.group.labelId = id;\n });\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.group.opts.disabled.current),\n [checkboxAttrs[\"group-label\"]]: \"\",\n ...this.attachment,\n }));\n}\nconst CheckboxRootContext = new Context(\"Checkbox.Root\");\nexport class CheckboxRootState {\n static create(opts, group = null) {\n return CheckboxRootContext.set(new CheckboxRootState(opts, group));\n }\n opts;\n group;\n trueName = $derived.by(() => {\n if (this.group && this.group.opts.name.current)\n return this.group.opts.name.current;\n return this.opts.name.current;\n });\n trueRequired = $derived.by(() => {\n if (this.group && this.group.opts.required.current)\n return true;\n return this.opts.required.current;\n });\n trueDisabled = $derived.by(() => {\n if (this.group && this.group.opts.disabled.current)\n return true;\n return this.opts.disabled.current;\n });\n trueReadonly = $derived.by(() => {\n if (this.group && this.group.opts.readonly.current)\n return true;\n return this.opts.readonly.current;\n });\n attachment;\n constructor(opts, group) {\n this.opts = opts;\n this.group = group;\n this.attachment = attachRef(this.opts.ref);\n this.onkeydown = this.onkeydown.bind(this);\n this.onclick = this.onclick.bind(this);\n watch.pre([() => $state.snapshot(this.group?.opts.value.current), () => this.opts.value.current], ([groupValue, value]) => {\n if (!groupValue || !value)\n return;\n this.opts.checked.current = groupValue.includes(value);\n });\n watch.pre(() => this.opts.checked.current, (checked) => {\n if (!this.group)\n return;\n if (checked) {\n this.group?.addValue(this.opts.value.current);\n }\n else {\n this.group?.removeValue(this.opts.value.current);\n }\n });\n }\n onkeydown(e) {\n if (this.trueDisabled || this.trueReadonly)\n return;\n if (e.key === kbd.ENTER) {\n e.preventDefault();\n if (this.opts.type.current === \"submit\") {\n const form = e.currentTarget.closest(\"form\");\n form?.requestSubmit();\n }\n return;\n }\n if (e.key === kbd.SPACE) {\n e.preventDefault();\n this.#toggle();\n }\n }\n #toggle() {\n if (this.opts.indeterminate.current) {\n this.opts.indeterminate.current = false;\n this.opts.checked.current = true;\n }\n else {\n this.opts.checked.current = !this.opts.checked.current;\n }\n }\n onclick(e) {\n if (this.trueDisabled || this.trueReadonly)\n return;\n if (this.opts.type.current === \"submit\") {\n this.#toggle();\n return;\n }\n e.preventDefault();\n this.#toggle();\n }\n snippetProps = $derived.by(() => ({\n checked: this.opts.checked.current,\n indeterminate: this.opts.indeterminate.current,\n }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n role: \"checkbox\",\n type: this.opts.type.current,\n disabled: this.trueDisabled,\n \"aria-checked\": getAriaChecked(this.opts.checked.current, this.opts.indeterminate.current),\n \"aria-required\": boolToStr(this.trueRequired),\n \"aria-readonly\": boolToStr(this.trueReadonly),\n \"data-disabled\": boolToEmptyStrOrUndef(this.trueDisabled),\n \"data-readonly\": boolToEmptyStrOrUndef(this.trueReadonly),\n \"data-state\": getCheckboxDataState(this.opts.checked.current, this.opts.indeterminate.current),\n [checkboxAttrs.root]: \"\",\n //\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n ...this.attachment,\n }));\n}\nexport class CheckboxInputState {\n static create() {\n return new CheckboxInputState(CheckboxRootContext.get());\n }\n root;\n trueChecked = $derived.by(() => {\n if (!this.root.group)\n return this.root.opts.checked.current;\n if (this.root.opts.value.current !== undefined &&\n this.root.group.opts.value.current.includes(this.root.opts.value.current)) {\n return true;\n }\n return false;\n });\n shouldRender = $derived.by(() => Boolean(this.root.trueName));\n constructor(root) {\n this.root = root;\n this.onfocus = this.onfocus.bind(this);\n }\n onfocus(_) {\n if (!isHTMLElement(this.root.opts.ref.current))\n return;\n this.root.opts.ref.current.focus();\n }\n props = $derived.by(() => ({\n type: \"checkbox\",\n checked: this.root.opts.checked.current === true,\n disabled: this.root.trueDisabled,\n required: this.root.trueRequired,\n name: this.root.trueName,\n form: this.root.opts.form.current,\n value: this.root.opts.value.current,\n readonly: this.root.trueReadonly,\n onfocus: this.onfocus,\n }));\n}\nfunction getCheckboxDataState(checked, indeterminate) {\n if (indeterminate)\n return \"indeterminate\";\n return checked ? \"checked\" : \"unchecked\";\n}\n","import { enable_legacy_mode_flag } from './index.js';\n\nenable_legacy_mode_flag();\n","<script lang=\"ts\">\n\timport { mergeProps, srOnlyStyles } from \"svelte-toolbelt\";\n\timport type { HTMLInputAttributes } from \"svelte/elements\";\n\n\tlet { value = $bindable(), ...restProps }: HTMLInputAttributes = $props();\n\n\tconst mergedProps = $derived(\n\t\tmergeProps(restProps, {\n\t\t\t\"aria-hidden\": \"true\",\n\t\t\ttabindex: -1,\n\t\t\tstyle: {\n\t\t\t\t...srOnlyStyles,\n\t\t\t\tposition: \"absolute\",\n\t\t\t\ttop: \"0\",\n\t\t\t\tleft: \"0\",\n\t\t\t},\n\t\t})\n\t);\n</script>\n\n{#if mergedProps.type === \"checkbox\"}\n\t<input {...mergedProps} {value} />\n{:else}\n\t<input bind:value {...mergedProps} />\n{/if}\n","<script lang=\"ts\">\n\timport { CheckboxInputState } from \"../checkbox.svelte.js\";\n\timport HiddenInput from \"../../utilities/hidden-input.svelte\";\n\n\tconst inputState = CheckboxInputState.create();\n</script>\n\n{#if inputState.shouldRender}\n\t<HiddenInput {...inputState.props} />\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { CheckboxRootProps } from \"../types.js\";\n\timport { CheckboxGroupContext, CheckboxRootState } from \"../checkbox.svelte.js\";\n\timport CheckboxInput from \"./checkbox-input.svelte\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { watch } from \"runed\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchecked = $bindable(false),\n\t\tref = $bindable(null),\n\t\tonCheckedChange,\n\t\tchildren,\n\t\tdisabled = false,\n\t\trequired = false,\n\t\tname = undefined,\n\t\tform = undefined,\n\t\tvalue = \"on\",\n\t\tid = createId(uid),\n\t\tindeterminate = $bindable(false),\n\t\tonIndeterminateChange,\n\t\tchild,\n\t\ttype = \"button\",\n\t\treadonly,\n\t\t...restProps\n\t}: CheckboxRootProps = $props();\n\n\tconst group = CheckboxGroupContext.getOr(null);\n\n\tif (group && value) {\n\t\tif (group.opts.value.current.includes(value)) {\n\t\t\tchecked = true;\n\t\t} else {\n\t\t\tchecked = false;\n\t\t}\n\t}\n\n\twatch.pre(\n\t\t() => value,\n\t\t() => {\n\t\t\tif (group && value) {\n\t\t\t\tif (group.opts.value.current.includes(value)) {\n\t\t\t\t\tchecked = true;\n\t\t\t\t} else {\n\t\t\t\t\tchecked = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t);\n\n\tconst rootState = CheckboxRootState.create(\n\t\t{\n\t\t\tchecked: boxWith(\n\t\t\t\t() => checked,\n\t\t\t\t(v) => {\n\t\t\t\t\tchecked = v;\n\t\t\t\t\tonCheckedChange?.(v);\n\t\t\t\t}\n\t\t\t),\n\t\t\tdisabled: boxWith(() => disabled ?? false),\n\t\t\trequired: boxWith(() => required),\n\t\t\tname: boxWith(() => name),\n\t\t\tform: boxWith(() => form),\n\t\t\tvalue: boxWith(() => value),\n\t\t\tid: boxWith(() => id),\n\t\t\tref: boxWith(\n\t\t\t\t() => ref,\n\t\t\t\t(v) => (ref = v)\n\t\t\t),\n\t\t\tindeterminate: boxWith(\n\t\t\t\t() => indeterminate,\n\t\t\t\t(v) => {\n\t\t\t\t\tindeterminate = v;\n\t\t\t\t\tonIndeterminateChange?.(v);\n\t\t\t\t}\n\t\t\t),\n\t\t\ttype: boxWith(() => type),\n\t\t\treadonly: boxWith(() => Boolean(readonly)),\n\t\t},\n\t\tgroup\n\t);\n\n\tconst mergedProps = $derived(mergeProps({ ...restProps }, rootState.props));\n</script>\n\n{#if child}\n\t{@render child({\n\t\tprops: mergedProps,\n\t\t...rootState.snippetProps,\n\t})}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.(rootState.snippetProps)}\n\t</button>\n{/if}\n\n<CheckboxInput />\n","import { boxFrom, simpleBox } from \"svelte-toolbelt\";\nimport { Context } from \"runed\";\nexport const FloatingRootContext = new Context(\"Floating.Root\");\nexport const FloatingTooltipRootContext = new Context(\"Floating.Root\");\nexport class FloatingRootState {\n static create(tooltip = false) {\n return tooltip\n ? FloatingTooltipRootContext.set(new FloatingRootState())\n : FloatingRootContext.set(new FloatingRootState());\n }\n anchorNode = simpleBox(null);\n customAnchorNode = simpleBox(null);\n triggerNode = simpleBox(null);\n constructor() {\n $effect(() => {\n if (this.customAnchorNode.current) {\n if (typeof this.customAnchorNode.current === \"string\") {\n this.anchorNode.current = document.querySelector(this.customAnchorNode.current);\n }\n else {\n this.anchorNode.current = this.customAnchorNode.current;\n }\n }\n else {\n this.anchorNode.current = this.triggerNode.current;\n }\n });\n }\n}\nexport class FloatingAnchorState {\n static create(opts, tooltip = false) {\n return tooltip\n ? new FloatingAnchorState(opts, FloatingTooltipRootContext.get())\n : new FloatingAnchorState(opts, FloatingRootContext.get());\n }\n opts;\n root;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n if (opts.virtualEl && opts.virtualEl.current) {\n root.triggerNode = boxFrom(opts.virtualEl.current);\n }\n else {\n root.triggerNode = opts.ref;\n }\n }\n}\n","<script lang=\"ts\">\n\timport type { Snippet } from \"svelte\";\n\timport { FloatingRootState } from \"../floating-root.svelte.js\";\n\n\tlet { children, tooltip = false }: { children?: Snippet; tooltip?: boolean } = $props();\n\n\tFloatingRootState.create(tooltip);\n</script>\n\n{@render children?.()}\n","export function get(valueOrGetValue) {\n return typeof valueOrGetValue === \"function\"\n ? valueOrGetValue()\n : valueOrGetValue;\n}\nexport function getDPR(element) {\n if (typeof window === \"undefined\")\n return 1;\n const win = element.ownerDocument.defaultView || window;\n return win.devicePixelRatio || 1;\n}\nexport function roundByDPR(element, value) {\n const dpr = getDPR(element);\n return Math.round(value * dpr) / dpr;\n}\nexport function getFloatingContentCSSVars(name) {\n return {\n [`--bits-${name}-content-transform-origin`]: `var(--bits-floating-transform-origin)`,\n [`--bits-${name}-content-available-width`]: `var(--bits-floating-available-width)`,\n [`--bits-${name}-content-available-height`]: `var(--bits-floating-available-height)`,\n [`--bits-${name}-anchor-width`]: `var(--bits-floating-anchor-width)`,\n [`--bits-${name}-anchor-height`]: `var(--bits-floating-anchor-height)`,\n };\n}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport { FloatingAnchorState } from \"../floating-root.svelte.js\";\n\timport type { AnchorProps } from \"./index.js\";\n\timport type { Measurable } from \"../../../../internal/floating-svelte/types.js\";\n\n\tlet { id, children, virtualEl, ref, tooltip = false }: AnchorProps = $props();\n\n\tFloatingAnchorState.create(\n\t\t{\n\t\t\tid: boxWith(() => id),\n\t\t\tvirtualEl: boxWith(() => virtualEl as unknown as Measurable | null),\n\t\t\tref,\n\t\t},\n\t\ttooltip\n\t);\n</script>\n\n{@render children?.()}\n","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n var _padding$top, _padding$right, _padding$bottom, _padding$left;\n return {\n top: (_padding$top = padding.top) != null ? _padding$top : 0,\n right: (_padding$right = padding.right) != null ? _padding$right : 0,\n bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0,\n left: (_padding$left = padding.left) != null ? _padding$left : 0\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n const alignment = getAlignment(placement);\n if (alignment) {\n coords[alignmentAxis] += commonAlign * (alignment === 'end' ? 1 : -1) * (rtl && isVertical ? -1 : 1);\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) && (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(minPadding, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < minPadding ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < minPadding ? center - minPadding : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n\n // No rects (e.g. a hidden or detached reference, or a collapsed range) —\n // keep the existing reference rect rather than resetting to an invalid\n // one with non-finite values.\n if (!nativeClientRects.length) {\n return {};\n }\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && (clientRects[0].left > clientRects[1].right || clientRects[1].left > clientRects[0].right) && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n return rectToClientRect({\n x: left,\n y: top,\n width: right - left,\n height: bottom - top\n });\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n return rectToClientRect({\n x: minLeft,\n y: top,\n width: maxRight - minLeft,\n height: bottom - top\n });\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const clampCoord = (axis, coord) => clamp(coord + overflow[axis === 'y' ? 'top' : 'left'], coord, coord - overflow[axis === 'y' ? 'bottom' : 'right']);\n if (checkMainAxis) {\n mainAxisCoord = clampCoord(mainAxis, mainAxisCoord);\n }\n if (checkCrossAxis) {\n crossAxisCoord = clampCoord(crossAxis, crossAxisCoord);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n var _rawOffset$mainAxis, _rawOffset$crossAxis;\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0,\n crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n// Method syntax keeps callback parameters bivariant, but expressing the\n// explicit `| undefined` required by `exactOptionalPropertyTypes` needs\n// property syntax, which is contravariant under `strictFunctionTypes`.\n// Extracting the function from a method position restores that bivariance so\n// consumers can still assign callbacks with narrower parameter types.\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const shiftData = state.middlewareData.shift;\n const noShift = !shiftData;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (shiftData != null && shiftData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if (shiftData != null && shiftData.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n if (isYAxis) {\n availableWidth = width - 2 * max(overflow.left, overflow.right);\n } else {\n availableHeight = height - 2 * max(overflow.top, overflow.bottom);\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return (node.ownerDocument || node).body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element);\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement && offsetParent) {\n const win = getWindow(domElement);\n const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return element.getClientRects ? Array.from(element.getClientRects()) : [];\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(html) {\n const scroll = getNodeScroll(html);\n const body = html.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(html);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy, rootBoundary) {\n if (rootBoundary === void 0) {\n rootBoundary = 'viewport';\n }\n const isLayoutViewport = rootBoundary === 'layoutViewport';\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n // Client coordinates are relative to the layout viewport, except in\n // WebKit with an `absolute` strategy, where they are relative to the\n // visual viewport.\n const layoutRelativeClientCoords = !isWebKit() || strategy === 'fixed';\n if (isLayoutViewport) {\n if (!layoutRelativeClientCoords) {\n x = -visualViewport.offsetLeft;\n y = -visualViewport.offsetTop;\n }\n } else {\n width = visualViewport.width;\n height = visualViewport.height;\n if (layoutRelativeClientCoords) {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // `scrollbar-gutter: stable` on the <html> reserves gutter space that shrinks\n // the visual width but isn't reflected in `html.clientWidth`, so subtract it.\n // Only the inline-end (right) gutter can hold the scrollbar; `both-edges` also\n // reserves an empty inline-start gutter that clips nothing, so exclude just\n // the one scrollbar-side gutter — halve the measured (two-gutter) total. A\n // left-side scrollbar (`windowScrollbarX > 0`) is already handled by\n // `getHTMLOffset`/`visualViewport.width`; skip it here.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n const gutter = getComputedStyle(html).scrollbarGutter === 'stable both-edges' ? reservedWidth / 2 : reservedWidth;\n if (gutter <= SCROLLBAR_MAX) {\n width -= gutter;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = getScale(element);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport' || clippingAncestor === 'layoutViewport') {\n rect = getViewportRect(element, strategy, clippingAncestor);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let lastKeptComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n // Position of the containing block chain below the current node. A fixed\n // element whose containing block hasn't been found yet is a fixed chain.\n const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? 'fixed' : '';\n\n // A non-containing ancestor does not clip the element when the chain\n // below it escapes it: a fixed chain escapes all ancestors up to the\n // next containing block, an absolute chain escapes static ancestors.\n const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === 'fixed' || lastPosition === 'absolute' && computedStyle.position === 'static');\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // The kept node carries the chain position for the next iteration.\n lastKeptComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n if (!isOffsetParentAnElement && documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove, ancestorResize) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n\n // The entry is a snapshot, so the reference may have moved since the\n // intersection was computed (under performance constraints, or between\n // consecutive frames of a multi-frame layout shift). The reported ratio\n // and the observed area are stale in that case and cannot be trusted to\n // detect subsequent movement, so refresh regardless of the ratio.\n if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n return refresh();\n }\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped in place, the ratio is 0. Throttle\n // the refresh to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n const win = getWindow(element);\n // The window is a resize ancestor, so when `ancestorResize` is enabled its\n // listener already runs the update on resize. Here we only need to rebuild\n // the `IntersectionObserver` for the new root size, skipping a redundant\n // update. When `ancestorResize` is disabled, this becomes the sole update.\n const handleResize = () => refresh(ancestorResize);\n win.addEventListener('resize', handleResize);\n refresh(true);\n return () => {\n win.removeEventListener('resize', handleResize);\n cleanup();\n };\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update);\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update, ancestorResize) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = options != null ? options : {};\n const platformWithCache = {\n ...platform,\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n","import { computePosition } from \"@floating-ui/dom\";\nimport { simpleBox } from \"svelte-toolbelt\";\nimport { get, getDPR, roundByDPR } from \"./floating-utils.svelte.js\";\nexport function useFloating(options) {\n /** Options */\n const whileElementsMountedOption = options.whileElementsMounted;\n const openOption = $derived(get(options.open) ?? true);\n const middlewareOption = $derived(get(options.middleware));\n const transformOption = $derived(get(options.transform) ?? true);\n const placementOption = $derived(get(options.placement) ?? \"bottom\");\n const strategyOption = $derived(get(options.strategy) ?? \"absolute\");\n const sideOffsetOption = $derived(get(options.sideOffset) ?? 0);\n const alignOffsetOption = $derived(get(options.alignOffset) ?? 0);\n const reference = options.reference;\n /** State */\n let x = $state(0);\n let y = $state(0);\n const floating = simpleBox(null);\n // svelte-ignore state_referenced_locally\n let strategy = $state(strategyOption);\n // svelte-ignore state_referenced_locally\n let placement = $state(placementOption);\n let middlewareData = $state({});\n let isPositioned = $state(false);\n let hasWhileMountedPosition = false;\n let updateRequestId = 0;\n // `update` is handed to `whileElementsMounted` (floating-ui's `autoUpdate`),\n // whose observers can still fire after the effect owning the option\n // `$derived`s above is destroyed. Reading them then warns `derived_inert`.\n let destroyed = false;\n const floatingStyles = $derived.by(() => {\n // preserve last known position when floating ref is null (during transitions)\n const xVal = floating.current ? roundByDPR(floating.current, x) : x;\n const yVal = floating.current ? roundByDPR(floating.current, y) : y;\n if (transformOption) {\n return {\n position: strategy,\n left: \"0\",\n top: \"0\",\n transform: `translate(${xVal}px, ${yVal}px)`,\n ...(floating.current &&\n getDPR(floating.current) >= 1.5 && {\n willChange: \"transform\",\n }),\n };\n }\n return {\n position: strategy,\n left: `${xVal}px`,\n top: `${yVal}px`,\n };\n });\n /** Effects */\n let whileElementsMountedCleanup;\n function update() {\n if (destroyed)\n return;\n if (reference.current === null || floating.current === null)\n return;\n const referenceNode = reference.current;\n const floatingNode = floating.current;\n const requestId = ++updateRequestId;\n computePosition(referenceNode, floatingNode, {\n middleware: middlewareOption,\n placement: placementOption,\n strategy: strategyOption,\n }).then((position) => {\n // ignore stale async resolutions when newer updates were requested.\n if (requestId !== updateRequestId)\n return;\n // ignore stale resolutions after ref replacement.\n if (reference.current !== referenceNode || floating.current !== floatingNode)\n return;\n const referenceHidden = isReferenceHidden(referenceNode);\n if (referenceHidden) {\n // keep last good coordinates when the anchor disappears to avoid\n // a transient jump to viewport origin before close propagates.\n middlewareData = {\n ...middlewareData,\n hide: {\n // oxlint-disable-next-line no-explicit-any\n ...middlewareData.hide,\n referenceHidden: true,\n },\n };\n return;\n }\n // ignore bad coordinates that cause jumping during close transitions\n if (!openOption && x !== 0 && y !== 0) {\n // if we had a good position and now getting coordinates near\n // the expected offset bounds during close, ignore it\n const maxExpectedOffset = Math.max(Math.abs(sideOffsetOption), Math.abs(alignOffsetOption), 15);\n if (position.x <= maxExpectedOffset && position.y <= maxExpectedOffset)\n return;\n }\n x = position.x;\n y = position.y;\n strategy = position.strategy;\n placement = position.placement;\n middlewareData = position.middlewareData;\n isPositioned = true;\n });\n }\n function cleanup() {\n if (typeof whileElementsMountedCleanup === \"function\") {\n whileElementsMountedCleanup();\n whileElementsMountedCleanup = undefined;\n }\n updateRequestId++;\n }\n function attach() {\n cleanup();\n if (whileElementsMountedOption === undefined) {\n update();\n return;\n }\n if (!openOption)\n return;\n if (reference.current === null || floating.current === null)\n return;\n whileElementsMountedCleanup = whileElementsMountedOption(reference.current, floating.current, update);\n }\n function reset() {\n if (!openOption && floating.current === null) {\n isPositioned = false;\n }\n }\n function trackWhileMountedDeps() {\n return [\n middlewareOption,\n placementOption,\n strategyOption,\n sideOffsetOption,\n alignOffsetOption,\n openOption,\n ];\n }\n $effect(() => {\n if (whileElementsMountedOption !== undefined)\n return;\n if (!openOption)\n return;\n update();\n });\n $effect(attach);\n $effect(() => {\n if (whileElementsMountedOption === undefined)\n return;\n trackWhileMountedDeps();\n if (!openOption) {\n hasWhileMountedPosition = false;\n return;\n }\n if (!isPositioned) {\n hasWhileMountedPosition = false;\n return;\n }\n // skip the first post-position run, since autoUpdate already computed it\n if (!hasWhileMountedPosition) {\n hasWhileMountedPosition = true;\n return;\n }\n update();\n });\n $effect(reset);\n $effect(() => () => {\n destroyed = true;\n cleanup();\n });\n return {\n floating,\n reference,\n get strategy() {\n return strategy;\n },\n get placement() {\n return placement;\n },\n get middlewareData() {\n return middlewareData;\n },\n get isPositioned() {\n return isPositioned;\n },\n get floatingStyles() {\n return floatingStyles;\n },\n get update() {\n return update;\n },\n };\n}\nfunction isReferenceHidden(node) {\n if (!(node instanceof Element))\n return false;\n if (!node.isConnected)\n return true;\n if (node instanceof HTMLElement && node.hidden)\n return true;\n return node.getClientRects().length === 0;\n}\n","import { arrow, autoUpdate, flip, hide, limitShift, offset, shift, size, } from \"@floating-ui/dom\";\nimport { attachRef, cssToStyleObj, getWindow, styleToString, simpleBox, } from \"svelte-toolbelt\";\nimport { Context, ElementSize, watch } from \"runed\";\nimport { FloatingRootContext, FloatingTooltipRootContext, } from \"./floating-root.svelte.js\";\nimport { isNotNull } from \"../../../internal/is.js\";\nimport { useId } from \"../../../internal/use-id.js\";\nimport { useFloating } from \"../../../internal/floating-svelte/use-floating.svelte.js\";\nexport const SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nexport const ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nconst OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\",\n};\nconst FloatingContentContext = new Context(\"Floating.Content\");\nexport class FloatingContentState {\n static create(opts, tooltip = false) {\n return tooltip\n ? FloatingContentContext.set(new FloatingContentState(opts, FloatingTooltipRootContext.get()))\n : FloatingContentContext.set(new FloatingContentState(opts, FloatingRootContext.get()));\n }\n opts;\n root;\n // nodes\n contentRef = simpleBox(null);\n wrapperRef = simpleBox(null);\n arrowRef = simpleBox(null);\n contentAttachment = attachRef(this.contentRef);\n wrapperAttachment = attachRef(this.wrapperRef);\n arrowAttachment = attachRef(this.arrowRef);\n // ids\n arrowId = simpleBox(useId());\n #transformedStyle = $derived.by(() => {\n if (typeof this.opts.style === \"string\")\n return cssToStyleObj(this.opts.style);\n if (!this.opts.style)\n return {};\n });\n #updatePositionStrategy = undefined;\n #arrowSize = new ElementSize(() => this.arrowRef.current ?? undefined);\n #arrowWidth = $derived(this.#arrowSize?.width ?? 0);\n #arrowHeight = $derived(this.#arrowSize?.height ?? 0);\n #desiredPlacement = $derived.by(() => (this.opts.side?.current +\n (this.opts.align.current !== \"center\"\n ? `-${this.opts.align.current}`\n : \"\")));\n #boundary = $derived.by(() => Array.isArray(this.opts.collisionBoundary.current)\n ? this.opts.collisionBoundary.current\n : [this.opts.collisionBoundary.current]);\n hasExplicitBoundaries = $derived(this.#boundary.length > 0);\n detectOverflowOptions = $derived.by(() => ({\n padding: this.opts.collisionPadding.current,\n boundary: this.#boundary.filter(isNotNull),\n altBoundary: this.hasExplicitBoundaries,\n }));\n #availableWidth = $state(undefined);\n #availableHeight = $state(undefined);\n #anchorWidth = $state(undefined);\n #anchorHeight = $state(undefined);\n middleware = $derived.by(() => [\n offset({\n mainAxis: this.opts.sideOffset.current + this.#arrowHeight,\n alignmentAxis: this.opts.alignOffset.current,\n }),\n this.opts.avoidCollisions.current &&\n shift({\n mainAxis: true,\n crossAxis: false,\n limiter: this.opts.sticky.current === \"partial\" ? limitShift() : undefined,\n ...this.detectOverflowOptions,\n }),\n this.opts.avoidCollisions.current && flip({ ...this.detectOverflowOptions }),\n size({\n ...this.detectOverflowOptions,\n apply: ({ rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n this.#availableWidth = availableWidth;\n this.#availableHeight = availableHeight;\n this.#anchorWidth = anchorWidth;\n this.#anchorHeight = anchorHeight;\n },\n }),\n this.arrowRef.current &&\n arrow({\n element: this.arrowRef.current,\n padding: this.opts.arrowPadding.current,\n }),\n transformOrigin({ arrowWidth: this.#arrowWidth, arrowHeight: this.#arrowHeight }),\n this.opts.hideWhenDetached.current &&\n hide({ strategy: \"referenceHidden\", ...this.detectOverflowOptions }),\n ].filter(Boolean));\n floating;\n placedSide = $derived.by(() => getSideFromPlacement(this.floating.placement));\n placedAlign = $derived.by(() => getAlignFromPlacement(this.floating.placement));\n arrowX = $derived.by(() => this.floating.middlewareData.arrow?.x ?? 0);\n arrowY = $derived.by(() => this.floating.middlewareData.arrow?.y ?? 0);\n cannotCenterArrow = $derived.by(() => this.floating.middlewareData.arrow?.centerOffset !== 0);\n contentZIndex = $state();\n arrowBaseSide = $derived(OPPOSITE_SIDE[this.placedSide]);\n wrapperProps = $derived.by(() => ({\n id: this.opts.wrapperId.current,\n \"data-bits-floating-content-wrapper\": \"\",\n style: {\n ...this.floating.floatingStyles,\n // keep off page when measuring\n transform: this.floating.isPositioned\n ? this.floating.floatingStyles.transform\n : \"translate(0, -200%)\",\n minWidth: \"max-content\",\n zIndex: this.contentZIndex,\n \"--bits-floating-transform-origin\": `${this.floating.middlewareData.transformOrigin?.x} ${this.floating.middlewareData.transformOrigin?.y}`,\n \"--bits-floating-available-width\": `${this.#availableWidth}px`,\n \"--bits-floating-available-height\": `${this.#availableHeight}px`,\n \"--bits-floating-anchor-width\": `${this.#anchorWidth}px`,\n \"--bits-floating-anchor-height\": `${this.#anchorHeight}px`,\n // hide the content if using the hide middleware and should be hidden\n ...(this.floating.middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n \"pointer-events\": \"none\",\n }),\n ...this.#transformedStyle,\n },\n // Floating UI calculates logical alignment based the `dir` attribute\n dir: this.opts.dir.current,\n ...this.wrapperAttachment,\n }));\n props = $derived.by(() => ({\n \"data-side\": this.placedSide,\n \"data-align\": this.placedAlign,\n style: styleToString({\n ...this.#transformedStyle,\n }),\n ...this.contentAttachment,\n }));\n arrowStyle = $derived({\n position: \"absolute\",\n left: this.arrowX ? `${this.arrowX}px` : undefined,\n top: this.arrowY ? `${this.arrowY}px` : undefined,\n [this.arrowBaseSide]: 0,\n \"transform-origin\": {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\",\n }[this.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: \"rotate(180deg)\",\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\",\n }[this.placedSide],\n visibility: this.cannotCenterArrow ? \"hidden\" : undefined,\n });\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.#updatePositionStrategy = opts.updatePositionStrategy;\n if (opts.customAnchor) {\n this.root.customAnchorNode.current = opts.customAnchor.current;\n }\n watch(() => opts.customAnchor.current, (customAnchor) => {\n this.root.customAnchorNode.current = customAnchor;\n });\n this.floating = useFloating({\n strategy: () => this.opts.strategy.current,\n placement: () => this.#desiredPlacement,\n middleware: () => this.middleware,\n reference: this.root.anchorNode,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: this.#updatePositionStrategy?.current === \"always\",\n });\n return cleanup;\n },\n open: () => this.opts.enabled.current,\n sideOffset: () => this.opts.sideOffset.current,\n alignOffset: () => this.opts.alignOffset.current,\n });\n $effect(() => {\n if (!this.floating.isPositioned)\n return;\n this.opts.onPlaced?.current();\n });\n watch(() => this.contentRef.current, (contentNode) => {\n if (!contentNode || !this.opts.enabled.current)\n return;\n const win = getWindow(contentNode);\n const rafId = win.requestAnimationFrame(() => {\n // avoid applying stale values when refs change quickly\n if (this.contentRef.current !== contentNode || !this.opts.enabled.current)\n return;\n const zIndex = win.getComputedStyle(contentNode).zIndex;\n if (zIndex !== this.contentZIndex) {\n this.contentZIndex = zIndex;\n }\n });\n return () => {\n win.cancelAnimationFrame(rafId);\n };\n });\n $effect(() => {\n this.floating.floating.current = this.wrapperRef.current;\n });\n }\n}\nexport class FloatingArrowState {\n static create(opts) {\n return new FloatingArrowState(opts, FloatingContentContext.get());\n }\n opts;\n content;\n constructor(opts, content) {\n this.opts = opts;\n this.content = content;\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n style: this.content.arrowStyle,\n \"data-side\": this.content.placedSide,\n ...this.content.arrowAttachment,\n }));\n}\n//\n// HELPERS\n//\nfunction transformOrigin(options) {\n return {\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n }\n else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n }\n else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n },\n };\n}\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nexport function getSideFromPlacement(placement) {\n return getSideAndAlignFromPlacement(placement)[0];\n}\nexport function getAlignFromPlacement(placement) {\n return getSideAndAlignFromPlacement(placement)[1];\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { FloatingContentState } from \"../use-floating-layer.svelte.js\";\n\timport type { ContentImplProps } from \"./index.js\";\n\timport { useId } from \"../../../../internal/use-id.js\";\n\n\tlet {\n\t\tcontent,\n\t\tside = \"bottom\",\n\t\tsideOffset = 0,\n\t\talign = \"center\",\n\t\talignOffset = 0,\n\t\tid,\n\t\tarrowPadding = 0,\n\t\tavoidCollisions = true,\n\t\tcollisionBoundary = [],\n\t\tcollisionPadding = 0,\n\t\thideWhenDetached = false,\n\t\tonPlaced = () => {},\n\t\tsticky = \"partial\",\n\t\tupdatePositionStrategy = \"optimized\",\n\t\tstrategy = \"fixed\",\n\t\tdir = \"ltr\",\n\t\tstyle = {},\n\t\twrapperId = useId(),\n\t\tcustomAnchor = null,\n\t\tenabled,\n\t\ttooltip = false,\n\t}: ContentImplProps = $props();\n\n\tconst contentState = FloatingContentState.create(\n\t\t{\n\t\t\tside: boxWith(() => side),\n\t\t\tsideOffset: boxWith(() => sideOffset),\n\t\t\talign: boxWith(() => align),\n\t\t\talignOffset: boxWith(() => alignOffset),\n\t\t\tid: boxWith(() => id),\n\t\t\tarrowPadding: boxWith(() => arrowPadding),\n\t\t\tavoidCollisions: boxWith(() => avoidCollisions),\n\t\t\tcollisionBoundary: boxWith(() => collisionBoundary),\n\t\t\tcollisionPadding: boxWith(() => collisionPadding),\n\t\t\thideWhenDetached: boxWith(() => hideWhenDetached),\n\t\t\tonPlaced: boxWith(() => onPlaced),\n\t\t\tsticky: boxWith(() => sticky),\n\t\t\tupdatePositionStrategy: boxWith(() => updatePositionStrategy),\n\t\t\tstrategy: boxWith(() => strategy),\n\t\t\tdir: boxWith(() => dir),\n\t\t\tstyle: boxWith(() => style),\n\t\t\tenabled: boxWith(() => enabled),\n\t\t\twrapperId: boxWith(() => wrapperId),\n\t\t\tcustomAnchor: boxWith(() => customAnchor),\n\t\t},\n\t\ttooltip\n\t);\n\n\tconst mergedProps = $derived(\n\t\tmergeProps(contentState.wrapperProps, {\n\t\t\tstyle: {\n\t\t\t\tpointerEvents: \"auto\",\n\t\t\t},\n\t\t})\n\t);\n</script>\n\n{@render content?.({ props: contentState.props, wrapperProps: mergedProps })}\n","<script lang=\"ts\">\n\timport { type Snippet, onMount } from \"svelte\";\n\n\tlet {\n\t\tcontent,\n\t\tonPlaced,\n\t}: {\n\t\tcontent?: Snippet<\n\t\t\t[{ props: Record<string, unknown>; wrapperProps: Record<string, unknown> }]\n\t\t>;\n\t\tonPlaced?: () => void;\n\t} = $props();\n\n\tonMount(() => {\n\t\tonPlaced?.();\n\t});\n</script>\n\n{@render content?.({ props: {}, wrapperProps: {} })}\n","<script lang=\"ts\">\n\timport FloatingLayerContentStatic from \"../floating-layer/components/floating-layer-content-static.svelte\";\n\timport FloatingLayerContent from \"../floating-layer/components/floating-layer-content.svelte\";\n\timport type { FloatingLayerContentImplProps } from \"../floating-layer/types.js\";\n\n\tlet {\n\t\tcontent,\n\t\tisStatic = false,\n\t\tonPlaced,\n\t\t...restProps\n\t}: FloatingLayerContentImplProps & { isStatic: boolean } = $props();\n</script>\n\n{#if isStatic}\n\t<FloatingLayerContentStatic {content} {onPlaced} />\n{:else}\n\t<FloatingLayerContent {content} {onPlaced} {...restProps} />\n{/if}\n","<script lang=\"ts\">\n\timport { mergeProps } from \"svelte-toolbelt\";\n\timport ScrollLock from \"../scroll-lock/scroll-lock.svelte\";\n\timport type { PopperLayerImplProps } from \"./types.js\";\n\timport PopperContent from \"./popper-content.svelte\";\n\timport EscapeLayer from \"../escape-layer/escape-layer.svelte\";\n\timport DismissibleLayer from \"../dismissible-layer/dismissible-layer.svelte\";\n\timport TextSelectionLayer from \"../text-selection-layer/text-selection-layer.svelte\";\n\timport FocusScope from \"../focus-scope/focus-scope.svelte\";\n\n\tlet {\n\t\tpopper,\n\t\tonEscapeKeydown,\n\t\tescapeKeydownBehavior,\n\t\tpreventOverflowTextSelection,\n\t\tid,\n\t\tonPointerDown,\n\t\tonPointerUp,\n\t\tside,\n\t\tsideOffset,\n\t\talign,\n\t\talignOffset,\n\t\tarrowPadding,\n\t\tavoidCollisions,\n\t\tcollisionBoundary,\n\t\tcollisionPadding,\n\t\tsticky,\n\t\thideWhenDetached,\n\t\tupdatePositionStrategy,\n\t\tstrategy,\n\t\tdir,\n\t\tpreventScroll,\n\t\twrapperId,\n\t\tstyle,\n\t\tonPlaced,\n\t\tonInteractOutside,\n\t\tonCloseAutoFocus,\n\t\tonOpenAutoFocus,\n\t\tonFocusOutside,\n\t\tinteractOutsideBehavior = \"close\",\n\t\tloop,\n\t\ttrapFocus = true,\n\t\tisValidEvent = () => false,\n\t\tcustomAnchor = null,\n\t\tisStatic = false,\n\t\tenabled,\n\t\tforceMount,\n\t\tref,\n\t\ttooltip = false,\n\t\tcontentPointerEvents = \"auto\",\n\t\t...restProps\n\t}: Omit<PopperLayerImplProps, \"open\" | \"children\" | \"shouldRender\"> & {\n\t\tenabled: boolean;\n\t\tcontentPointerEvents?: \"auto\" | \"none\";\n\t} = $props();\n\n\tconst resolvedPreventScroll = $derived(preventScroll ?? true);\n\tconst effectiveStrategy = $derived(strategy ?? (resolvedPreventScroll ? \"fixed\" : \"absolute\"));\n</script>\n\n<PopperContent\n\t{isStatic}\n\t{id}\n\t{side}\n\t{sideOffset}\n\t{align}\n\t{alignOffset}\n\t{arrowPadding}\n\t{avoidCollisions}\n\t{collisionBoundary}\n\t{collisionPadding}\n\t{sticky}\n\t{hideWhenDetached}\n\t{updatePositionStrategy}\n\tstrategy={effectiveStrategy}\n\t{dir}\n\t{wrapperId}\n\t{style}\n\t{onPlaced}\n\t{customAnchor}\n\t{enabled}\n\t{tooltip}\n>\n\t{#snippet content({ props: floatingProps, wrapperProps })}\n\t\t{#if forceMount && enabled}\n\t\t\t<ScrollLock preventScroll={resolvedPreventScroll} />\n\t\t{:else if !forceMount}\n\t\t\t<ScrollLock preventScroll={resolvedPreventScroll} />\n\t\t{/if}\n\t\t<FocusScope\n\t\t\t{onOpenAutoFocus}\n\t\t\t{onCloseAutoFocus}\n\t\t\t{loop}\n\t\t\t{enabled}\n\t\t\t{trapFocus}\n\t\t\t{forceMount}\n\t\t\t{ref}\n\t\t>\n\t\t\t{#snippet focusScope({ props: focusScopeProps })}\n\t\t\t\t<EscapeLayer {onEscapeKeydown} {escapeKeydownBehavior} {enabled} {ref}>\n\t\t\t\t\t<DismissibleLayer\n\t\t\t\t\t\t{id}\n\t\t\t\t\t\t{onInteractOutside}\n\t\t\t\t\t\t{onFocusOutside}\n\t\t\t\t\t\t{interactOutsideBehavior}\n\t\t\t\t\t\t{isValidEvent}\n\t\t\t\t\t\t{enabled}\n\t\t\t\t\t\t{ref}\n\t\t\t\t\t>\n\t\t\t\t\t\t{#snippet children({ props: dismissibleProps })}\n\t\t\t\t\t\t\t<TextSelectionLayer\n\t\t\t\t\t\t\t\t{id}\n\t\t\t\t\t\t\t\t{preventOverflowTextSelection}\n\t\t\t\t\t\t\t\t{onPointerDown}\n\t\t\t\t\t\t\t\t{onPointerUp}\n\t\t\t\t\t\t\t\t{enabled}\n\t\t\t\t\t\t\t\t{ref}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{@render popper?.({\n\t\t\t\t\t\t\t\t\tprops: mergeProps(\n\t\t\t\t\t\t\t\t\t\trestProps,\n\t\t\t\t\t\t\t\t\t\tfloatingProps,\n\t\t\t\t\t\t\t\t\t\tdismissibleProps,\n\t\t\t\t\t\t\t\t\t\tfocusScopeProps,\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t\t\t\t\t\tpointerEvents: contentPointerEvents,\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\twrapperProps,\n\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t</TextSelectionLayer>\n\t\t\t\t\t\t{/snippet}\n\t\t\t\t\t</DismissibleLayer>\n\t\t\t\t</EscapeLayer>\n\t\t\t{/snippet}\n\t\t</FocusScope>\n\t{/snippet}\n</PopperContent>\n","<script lang=\"ts\">\n\timport type { PopperLayerImplProps } from \"./types.js\";\n\timport PopperLayerInner from \"./popper-layer-inner.svelte\";\n\n\tlet {\n\t\tpopper,\n\t\topen,\n\t\tonEscapeKeydown,\n\t\tescapeKeydownBehavior,\n\t\tpreventOverflowTextSelection,\n\t\tid,\n\t\tonPointerDown,\n\t\tonPointerUp,\n\t\tside,\n\t\tsideOffset,\n\t\talign,\n\t\talignOffset,\n\t\tarrowPadding,\n\t\tavoidCollisions,\n\t\tcollisionBoundary,\n\t\tcollisionPadding,\n\t\tsticky,\n\t\thideWhenDetached,\n\t\tupdatePositionStrategy,\n\t\tstrategy,\n\t\tdir,\n\t\tpreventScroll,\n\t\twrapperId,\n\t\tstyle,\n\t\tonPlaced,\n\t\tonInteractOutside,\n\t\tonCloseAutoFocus,\n\t\tonOpenAutoFocus,\n\t\tonFocusOutside,\n\t\tinteractOutsideBehavior = \"close\",\n\t\tloop,\n\t\ttrapFocus = true,\n\t\tisValidEvent = () => false,\n\t\tcustomAnchor = null,\n\t\tisStatic = false,\n\t\tref,\n\t\tshouldRender,\n\t\t...restProps\n\t}: PopperLayerImplProps = $props();\n</script>\n\n{#if shouldRender}\n\t<PopperLayerInner\n\t\t{popper}\n\t\t{onEscapeKeydown}\n\t\t{escapeKeydownBehavior}\n\t\t{preventOverflowTextSelection}\n\t\t{id}\n\t\t{onPointerDown}\n\t\t{onPointerUp}\n\t\t{side}\n\t\t{sideOffset}\n\t\t{align}\n\t\t{alignOffset}\n\t\t{arrowPadding}\n\t\t{avoidCollisions}\n\t\t{collisionBoundary}\n\t\t{collisionPadding}\n\t\t{sticky}\n\t\t{hideWhenDetached}\n\t\t{updatePositionStrategy}\n\t\t{strategy}\n\t\t{dir}\n\t\t{preventScroll}\n\t\t{wrapperId}\n\t\t{style}\n\t\t{onPlaced}\n\t\t{customAnchor}\n\t\t{isStatic}\n\t\tenabled={open}\n\t\t{onInteractOutside}\n\t\t{onCloseAutoFocus}\n\t\t{onOpenAutoFocus}\n\t\t{interactOutsideBehavior}\n\t\t{loop}\n\t\t{trapFocus}\n\t\t{isValidEvent}\n\t\t{onFocusOutside}\n\t\tforceMount={false}\n\t\t{ref}\n\t\t{...restProps}\n\t/>\n{/if}\n","<script lang=\"ts\">\n\timport type { PopperLayerImplProps } from \"./types.js\";\n\timport PopperLayerInner from \"./popper-layer-inner.svelte\";\n\n\tlet {\n\t\tpopper,\n\t\tonEscapeKeydown,\n\t\tescapeKeydownBehavior,\n\t\tpreventOverflowTextSelection,\n\t\tid,\n\t\tonPointerDown,\n\t\tonPointerUp,\n\t\tside,\n\t\tsideOffset,\n\t\talign,\n\t\talignOffset,\n\t\tarrowPadding,\n\t\tavoidCollisions,\n\t\tcollisionBoundary,\n\t\tcollisionPadding,\n\t\tsticky,\n\t\thideWhenDetached,\n\t\tupdatePositionStrategy,\n\t\tstrategy,\n\t\tdir,\n\t\tpreventScroll,\n\t\twrapperId,\n\t\tstyle,\n\t\tonPlaced,\n\t\tonInteractOutside,\n\t\tonCloseAutoFocus,\n\t\tonOpenAutoFocus,\n\t\tonFocusOutside,\n\t\tinteractOutsideBehavior = \"close\",\n\t\tloop,\n\t\ttrapFocus = true,\n\t\tisValidEvent = () => false,\n\t\tcustomAnchor = null,\n\t\tisStatic = false,\n\t\tenabled,\n\t\t...restProps\n\t}: Omit<PopperLayerImplProps, \"open\"> & {\n\t\tenabled: boolean;\n\t} = $props();\n</script>\n\n<PopperLayerInner\n\t{popper}\n\t{onEscapeKeydown}\n\t{escapeKeydownBehavior}\n\t{preventOverflowTextSelection}\n\t{id}\n\t{onPointerDown}\n\t{onPointerUp}\n\t{side}\n\t{sideOffset}\n\t{align}\n\t{alignOffset}\n\t{arrowPadding}\n\t{avoidCollisions}\n\t{collisionBoundary}\n\t{collisionPadding}\n\t{sticky}\n\t{hideWhenDetached}\n\t{updatePositionStrategy}\n\t{strategy}\n\t{dir}\n\t{preventScroll}\n\t{wrapperId}\n\t{style}\n\t{onPlaced}\n\t{customAnchor}\n\t{isStatic}\n\t{enabled}\n\t{onInteractOutside}\n\t{onCloseAutoFocus}\n\t{onOpenAutoFocus}\n\t{interactOutsideBehavior}\n\t{loop}\n\t{trapFocus}\n\t{isValidEvent}\n\t{onFocusOutside}\n\t{...restProps}\n\tforceMount={true}\n/>\n","import { getDocument } from \"svelte-toolbelt\";\nimport { on } from \"svelte/events\";\nimport { watch } from \"runed\";\nimport { isElement } from \"./is.js\";\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] ?? [0, 0];\n const [xj, yj] = polygon[j] ?? [0, 0];\n const intersect = yi >= y !== yj >= y && x <= ((xj - xi) * (y - yi)) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\nfunction isInsideRect(point, rect) {\n return (point[0] >= rect.left &&\n point[0] <= rect.right &&\n point[1] >= rect.top &&\n point[1] <= rect.bottom);\n}\nfunction getSide(triggerRect, contentRect) {\n // determine which side the content is on relative to trigger\n const triggerCenterX = triggerRect.left + triggerRect.width / 2;\n const triggerCenterY = triggerRect.top + triggerRect.height / 2;\n const contentCenterX = contentRect.left + contentRect.width / 2;\n const contentCenterY = contentRect.top + contentRect.height / 2;\n const deltaX = contentCenterX - triggerCenterX;\n const deltaY = contentCenterY - triggerCenterY;\n if (Math.abs(deltaX) > Math.abs(deltaY)) {\n return deltaX > 0 ? \"right\" : \"left\";\n }\n return deltaY > 0 ? \"bottom\" : \"top\";\n}\n/**\n * Creates a safe polygon area that allows users to move their cursor between\n * the trigger and floating content without closing it.\n */\nexport class SafePolygon {\n #opts;\n #buffer;\n #transitIntentTimeout;\n // tracks the cursor position when leaving trigger or content\n #exitPoint = null;\n // tracks what we're moving toward: \"content\" when leaving trigger, \"trigger\" when leaving content\n #exitTarget = null;\n #transitTargets = [];\n #trackedTriggerNode = null;\n #leaveFallbackRafId = null;\n #transitIntentTimeoutId = null;\n #cancelLeaveFallback() {\n if (this.#leaveFallbackRafId !== null) {\n cancelAnimationFrame(this.#leaveFallbackRafId);\n this.#leaveFallbackRafId = null;\n }\n }\n #scheduleLeaveFallback() {\n this.#cancelLeaveFallback();\n this.#leaveFallbackRafId = requestAnimationFrame(() => {\n this.#leaveFallbackRafId = null;\n if (!this.#exitPoint || !this.#exitTarget)\n return;\n this.#clearTracking();\n this.#opts.onPointerExit();\n });\n }\n #cancelTransitIntentTimeout() {\n if (this.#transitIntentTimeoutId !== null) {\n clearTimeout(this.#transitIntentTimeoutId);\n this.#transitIntentTimeoutId = null;\n }\n }\n #scheduleTransitIntentTimeout() {\n if (this.#transitIntentTimeout === null)\n return;\n this.#cancelTransitIntentTimeout();\n this.#transitIntentTimeoutId = window.setTimeout(() => {\n this.#transitIntentTimeoutId = null;\n if (!this.#exitPoint || !this.#exitTarget)\n return;\n this.#clearTracking();\n this.#opts.onPointerExit();\n }, this.#transitIntentTimeout);\n }\n constructor(opts) {\n this.#opts = opts;\n this.#buffer = opts.buffer ?? 1;\n const transitIntentTimeout = opts.transitIntentTimeout;\n this.#transitIntentTimeout =\n typeof transitIntentTimeout === \"number\" && transitIntentTimeout > 0\n ? transitIntentTimeout\n : null;\n watch([opts.triggerNode, opts.contentNode, opts.enabled], ([triggerNode, contentNode, enabled]) => {\n if (!triggerNode || !contentNode || !enabled) {\n this.#trackedTriggerNode = null;\n this.#clearTracking();\n return;\n }\n if (this.#trackedTriggerNode && this.#trackedTriggerNode !== triggerNode) {\n this.#clearTracking();\n }\n this.#trackedTriggerNode = triggerNode;\n const doc = getDocument(triggerNode);\n const handlePointerMove = (e) => {\n this.#onPointerMove([e.clientX, e.clientY], triggerNode, contentNode);\n };\n const handleTriggerLeave = (e) => {\n // when leaving trigger toward content, record exit point\n const target = e.relatedTarget;\n // if going directly to content, no need for polygon tracking\n if (isElement(target) && contentNode.contains(target)) {\n return;\n }\n // if moving to an ignored target (e.g. a sibling trigger), don't close —\n // the sibling's enter handler will take over\n const ignoredTargets = this.#opts.ignoredTargets?.() ?? [];\n if (isElement(target) &&\n ignoredTargets.some((n) => n === target || n.contains(target))) {\n return;\n }\n this.#transitTargets =\n isElement(target) && ignoredTargets.length > 0\n ? ignoredTargets.filter((n) => target.contains(n))\n : [];\n // for unrelated elements, defer close decisions to pointer geometry checks.\n // this allows the cursor to pass through intermediate elements on the way\n // to content without immediately closing.\n this.#exitPoint = [e.clientX, e.clientY];\n this.#exitTarget = \"content\";\n this.#scheduleLeaveFallback();\n };\n const handleTriggerEnter = () => {\n // reached trigger, clear tracking\n this.#clearTracking();\n };\n const handleContentEnter = () => {\n // reached content, clear tracking\n this.#clearTracking();\n };\n const handleContentLeave = (e) => {\n // when leaving content, check if going directly back to trigger\n const target = e.relatedTarget;\n if (isElement(target) && triggerNode.contains(target)) {\n // going directly to trigger, no polygon tracking needed\n return;\n }\n // set up polygon tracking toward trigger — pointermove decides whether to close\n this.#exitPoint = [e.clientX, e.clientY];\n this.#exitTarget = \"trigger\";\n this.#scheduleLeaveFallback();\n };\n return [\n on(doc, \"pointermove\", handlePointerMove),\n on(triggerNode, \"pointerleave\", handleTriggerLeave),\n on(triggerNode, \"pointerenter\", handleTriggerEnter),\n on(contentNode, \"pointerenter\", handleContentEnter),\n on(contentNode, \"pointerleave\", handleContentLeave),\n ].reduce((acc, cleanup) => () => {\n acc();\n cleanup();\n }, () => { });\n });\n }\n #onPointerMove(clientPoint, triggerNode, contentNode) {\n // if no exit point recorded, nothing to check\n if (!this.#exitPoint || !this.#exitTarget)\n return;\n this.#cancelLeaveFallback();\n this.#scheduleTransitIntentTimeout();\n const triggerRect = triggerNode.getBoundingClientRect();\n const contentRect = contentNode.getBoundingClientRect();\n // check if pointer reached the target\n if (this.#exitTarget === \"content\" && isInsideRect(clientPoint, contentRect)) {\n this.#clearTracking();\n return;\n }\n if (this.#exitTarget === \"trigger\" && isInsideRect(clientPoint, triggerRect)) {\n this.#clearTracking();\n return;\n }\n if (this.#exitTarget === \"content\" && this.#transitTargets.length > 0) {\n for (const transitTarget of this.#transitTargets) {\n const transitRect = transitTarget.getBoundingClientRect();\n if (isInsideRect(clientPoint, transitRect))\n return;\n const transitSide = getSide(triggerRect, transitRect);\n const transitCorridor = this.#getCorridorPolygon(triggerRect, transitRect, transitSide);\n if (transitCorridor && isPointInPolygon(clientPoint, transitCorridor))\n return;\n }\n }\n // check if pointer is in the rectangular corridor between trigger and content\n const side = getSide(triggerRect, contentRect);\n const corridorPoly = this.#getCorridorPolygon(triggerRect, contentRect, side);\n if (corridorPoly && isPointInPolygon(clientPoint, corridorPoly)) {\n return;\n }\n // check if pointer is within the safe polygon from exit point to target\n const targetRect = this.#exitTarget === \"content\" ? contentRect : triggerRect;\n const safePoly = this.#getSafePolygon(this.#exitPoint, targetRect, side, this.#exitTarget);\n if (isPointInPolygon(clientPoint, safePoly)) {\n return;\n }\n // pointer is outside all safe zones - close\n this.#clearTracking();\n this.#opts.onPointerExit();\n }\n #clearTracking() {\n this.#exitPoint = null;\n this.#exitTarget = null;\n this.#transitTargets = [];\n this.#cancelLeaveFallback();\n this.#cancelTransitIntentTimeout();\n }\n /**\n * Creates a rectangular corridor between trigger and content\n * This prevents closing when cursor is in the gap between them\n */\n #getCorridorPolygon(triggerRect, contentRect, side) {\n const buffer = this.#buffer;\n switch (side) {\n case \"top\":\n return [\n [Math.min(triggerRect.left, contentRect.left) - buffer, triggerRect.top],\n [Math.min(triggerRect.left, contentRect.left) - buffer, contentRect.bottom],\n [Math.max(triggerRect.right, contentRect.right) + buffer, contentRect.bottom],\n [Math.max(triggerRect.right, contentRect.right) + buffer, triggerRect.top],\n ];\n case \"bottom\":\n return [\n [Math.min(triggerRect.left, contentRect.left) - buffer, triggerRect.bottom],\n [Math.min(triggerRect.left, contentRect.left) - buffer, contentRect.top],\n [Math.max(triggerRect.right, contentRect.right) + buffer, contentRect.top],\n [Math.max(triggerRect.right, contentRect.right) + buffer, triggerRect.bottom],\n ];\n case \"left\":\n return [\n [triggerRect.left, Math.min(triggerRect.top, contentRect.top) - buffer],\n [contentRect.right, Math.min(triggerRect.top, contentRect.top) - buffer],\n [contentRect.right, Math.max(triggerRect.bottom, contentRect.bottom) + buffer],\n [triggerRect.left, Math.max(triggerRect.bottom, contentRect.bottom) + buffer],\n ];\n case \"right\":\n return [\n [triggerRect.right, Math.min(triggerRect.top, contentRect.top) - buffer],\n [contentRect.left, Math.min(triggerRect.top, contentRect.top) - buffer],\n [contentRect.left, Math.max(triggerRect.bottom, contentRect.bottom) + buffer],\n [triggerRect.right, Math.max(triggerRect.bottom, contentRect.bottom) + buffer],\n ];\n }\n }\n /**\n * Creates a triangular/trapezoidal safe zone from the exit point to the target\n */\n #getSafePolygon(exitPoint, targetRect, side, exitTarget) {\n const buffer = this.#buffer * 4;\n const [x, y] = exitPoint;\n // when going back to trigger, we need to flip the side\n const effectiveSide = exitTarget === \"trigger\" ? this.#flipSide(side) : side;\n // create polygon points from cursor to target edges\n switch (effectiveSide) {\n case \"top\":\n return [\n [x - buffer, y + buffer],\n [x + buffer, y + buffer],\n [targetRect.right + buffer, targetRect.bottom],\n [targetRect.right + buffer, targetRect.top],\n [targetRect.left - buffer, targetRect.top],\n [targetRect.left - buffer, targetRect.bottom],\n ];\n case \"bottom\":\n return [\n [x - buffer, y - buffer],\n [x + buffer, y - buffer],\n [targetRect.right + buffer, targetRect.top],\n [targetRect.right + buffer, targetRect.bottom],\n [targetRect.left - buffer, targetRect.bottom],\n [targetRect.left - buffer, targetRect.top],\n ];\n case \"left\":\n return [\n [x + buffer, y - buffer],\n [x + buffer, y + buffer],\n [targetRect.right, targetRect.bottom + buffer],\n [targetRect.left, targetRect.bottom + buffer],\n [targetRect.left, targetRect.top - buffer],\n [targetRect.right, targetRect.top - buffer],\n ];\n case \"right\":\n return [\n [x - buffer, y - buffer],\n [x - buffer, y + buffer],\n [targetRect.left, targetRect.bottom + buffer],\n [targetRect.right, targetRect.bottom + buffer],\n [targetRect.right, targetRect.top - buffer],\n [targetRect.left, targetRect.top - buffer],\n ];\n }\n }\n #flipSide(side) {\n switch (side) {\n case \"top\":\n return \"bottom\";\n case \"bottom\":\n return \"top\";\n case \"left\":\n return \"right\";\n case \"right\":\n return \"left\";\n }\n }\n}\n","import { attachRef, boxWith, DOMContext, } from \"svelte-toolbelt\";\nimport { Context, watch } from \"runed\";\nimport { kbd } from \"../../internal/kbd.js\";\nimport { createBitsAttrs, boolToStr, getDataOpenClosed, getDataTransitionAttrs, } from \"../../internal/attrs.js\";\nimport { isElement, isTouch } from \"../../internal/is.js\";\nimport { PresenceManager } from \"../../internal/presence-manager.svelte.js\";\nimport { SafePolygon } from \"../../internal/safe-polygon.svelte.js\";\nimport { isTabbable } from \"tabbable\";\nconst popoverAttrs = createBitsAttrs({\n component: \"popover\",\n parts: [\"root\", \"trigger\", \"content\", \"close\", \"overlay\"],\n});\nconst PopoverRootContext = new Context(\"Popover.Root\");\nexport class PopoverRootState {\n static create(opts) {\n return PopoverRootContext.set(new PopoverRootState(opts));\n }\n opts;\n contentNode = $state(null);\n contentPresence;\n triggerNode = $state(null);\n overlayNode = $state(null);\n overlayPresence;\n // hover tracking state\n openedViaHover = $state(false);\n hasInteractedWithContent = $state(false);\n hoverCooldown = $state(false);\n closeDelay = $state(0);\n #closeTimeout = null;\n #domContext = null;\n constructor(opts) {\n this.opts = opts;\n this.contentPresence = new PresenceManager({\n ref: boxWith(() => this.contentNode),\n open: this.opts.open,\n onComplete: () => {\n this.opts.onOpenChangeComplete.current(this.opts.open.current);\n },\n });\n this.overlayPresence = new PresenceManager({\n ref: boxWith(() => this.overlayNode),\n open: this.opts.open,\n });\n watch(() => this.opts.open.current, (isOpen) => {\n if (!isOpen) {\n this.openedViaHover = false;\n this.hasInteractedWithContent = false;\n this.#clearCloseTimeout();\n }\n });\n }\n setDomContext(ctx) {\n this.#domContext = ctx;\n }\n #clearCloseTimeout() {\n if (this.#closeTimeout !== null && this.#domContext) {\n this.#domContext.clearTimeout(this.#closeTimeout);\n this.#closeTimeout = null;\n }\n }\n toggleOpen() {\n this.#clearCloseTimeout();\n this.opts.open.current = !this.opts.open.current;\n }\n handleClose() {\n this.#clearCloseTimeout();\n if (!this.opts.open.current)\n return;\n this.opts.open.current = false;\n }\n handleHoverOpen() {\n this.#clearCloseTimeout();\n if (this.opts.open.current)\n return;\n this.openedViaHover = true;\n this.opts.open.current = true;\n }\n handleHoverClose() {\n if (!this.opts.open.current)\n return;\n // only close if opened via hover and user hasn't interacted with content\n if (this.openedViaHover && !this.hasInteractedWithContent) {\n this.opts.open.current = false;\n }\n }\n handleDelayedHoverClose() {\n if (!this.opts.open.current)\n return;\n if (!this.openedViaHover || this.hasInteractedWithContent)\n return;\n this.#clearCloseTimeout();\n if (this.closeDelay <= 0) {\n this.opts.open.current = false;\n }\n else if (this.#domContext) {\n this.#closeTimeout = this.#domContext.setTimeout(() => {\n if (this.openedViaHover && !this.hasInteractedWithContent) {\n this.opts.open.current = false;\n }\n this.#closeTimeout = null;\n }, this.closeDelay);\n }\n }\n cancelDelayedClose() {\n this.#clearCloseTimeout();\n }\n markInteraction() {\n this.hasInteractedWithContent = true;\n this.#clearCloseTimeout();\n }\n}\nexport class PopoverTriggerState {\n static create(opts) {\n return new PopoverTriggerState(opts, PopoverRootContext.get());\n }\n opts;\n root;\n attachment;\n domContext;\n #openTimeout = null;\n #closeTimeout = null;\n #isHovering = $state(false);\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.triggerNode = v));\n this.domContext = new DOMContext(opts.ref);\n this.root.setDomContext(this.domContext);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n this.onpointerenter = this.onpointerenter.bind(this);\n this.onpointerleave = this.onpointerleave.bind(this);\n watch(() => this.opts.closeDelay.current, (delay) => {\n this.root.closeDelay = delay;\n });\n }\n #clearOpenTimeout() {\n if (this.#openTimeout !== null) {\n this.domContext.clearTimeout(this.#openTimeout);\n this.#openTimeout = null;\n }\n }\n #clearCloseTimeout() {\n if (this.#closeTimeout !== null) {\n this.domContext.clearTimeout(this.#closeTimeout);\n this.#closeTimeout = null;\n }\n }\n #clearAllTimeouts() {\n this.#clearOpenTimeout();\n this.#clearCloseTimeout();\n }\n onpointerenter(e) {\n if (this.opts.disabled.current)\n return;\n if (!this.opts.openOnHover.current)\n return;\n if (isTouch(e))\n return;\n this.#isHovering = true;\n this.#clearCloseTimeout();\n this.root.cancelDelayedClose();\n if (this.root.opts.open.current || this.root.hoverCooldown)\n return;\n const delay = this.opts.openDelay.current;\n if (delay <= 0) {\n this.root.handleHoverOpen();\n }\n else {\n this.#openTimeout = this.domContext.setTimeout(() => {\n this.root.handleHoverOpen();\n this.#openTimeout = null;\n }, delay);\n }\n }\n onpointerleave(e) {\n if (this.opts.disabled.current)\n return;\n if (!this.opts.openOnHover.current)\n return;\n if (isTouch(e))\n return;\n this.#isHovering = false;\n this.#clearOpenTimeout();\n this.root.hoverCooldown = false;\n // let GraceArea handle the close - it will call handleHoverClose via onPointerExit\n // we just need to stop any pending open timer\n }\n onclick(e) {\n if (this.opts.disabled.current)\n return;\n if (e.button !== 0)\n return;\n this.#clearAllTimeouts();\n // if clicked while hovering and popover is open, convert to click-based open\n if (this.#isHovering && this.root.opts.open.current && this.root.openedViaHover) {\n this.root.openedViaHover = false;\n this.root.hasInteractedWithContent = true;\n return;\n }\n // if closing while hovering with openOnHover enabled, set cooldown to prevent\n // immediate re-open via hover\n if (this.#isHovering && this.opts.openOnHover.current && this.root.opts.open.current) {\n this.root.hoverCooldown = true;\n }\n // if clicking to open while in cooldown, reset cooldown (explicit open)\n if (this.root.hoverCooldown && !this.root.opts.open.current) {\n this.root.hoverCooldown = false;\n }\n this.root.toggleOpen();\n }\n onkeydown(e) {\n if (this.opts.disabled.current)\n return;\n if (!(e.key === kbd.ENTER || e.key === kbd.SPACE))\n return;\n e.preventDefault();\n this.#clearAllTimeouts();\n this.root.toggleOpen();\n }\n #getAriaControls() {\n if (this.root.opts.open.current && this.root.contentNode?.id) {\n return this.root.contentNode?.id;\n }\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n \"aria-haspopup\": \"dialog\",\n \"aria-expanded\": boolToStr(this.root.opts.open.current),\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n \"aria-controls\": this.#getAriaControls(),\n [popoverAttrs.trigger]: \"\",\n disabled: this.opts.disabled.current,\n //\n onkeydown: this.onkeydown,\n onclick: this.onclick,\n onpointerenter: this.onpointerenter,\n onpointerleave: this.onpointerleave,\n ...this.attachment,\n }));\n}\nexport class PopoverContentState {\n static create(opts) {\n return new PopoverContentState(opts, PopoverRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.contentNode = v));\n this.onpointerdown = this.onpointerdown.bind(this);\n this.onfocusin = this.onfocusin.bind(this);\n this.onpointerenter = this.onpointerenter.bind(this);\n this.onpointerleave = this.onpointerleave.bind(this);\n new SafePolygon({\n triggerNode: () => this.root.triggerNode,\n contentNode: () => this.root.contentNode,\n enabled: () => this.root.opts.open.current &&\n this.root.openedViaHover &&\n !this.root.hasInteractedWithContent,\n onPointerExit: () => {\n this.root.handleDelayedHoverClose();\n },\n });\n }\n onpointerdown(_) {\n this.root.markInteraction();\n }\n onfocusin(e) {\n const target = e.target;\n if (isElement(target) && isTabbable(target)) {\n this.root.markInteraction();\n }\n }\n onpointerenter(e) {\n if (isTouch(e))\n return;\n this.root.cancelDelayedClose();\n }\n onpointerleave(e) {\n if (isTouch(e))\n return;\n // handled by grace area\n }\n onInteractOutside = (e) => {\n this.opts.onInteractOutside.current(e);\n if (e.defaultPrevented)\n return;\n if (!isElement(e.target))\n return;\n const closestTrigger = e.target.closest(popoverAttrs.selector(\"trigger\"));\n if (closestTrigger && closestTrigger === this.root.triggerNode)\n return;\n if (this.opts.customAnchor.current) {\n if (isElement(this.opts.customAnchor.current)) {\n if (this.opts.customAnchor.current.contains(e.target))\n return;\n }\n else if (typeof this.opts.customAnchor.current === \"string\") {\n const el = document.querySelector(this.opts.customAnchor.current);\n if (el && el.contains(e.target))\n return;\n }\n }\n this.root.handleClose();\n };\n onEscapeKeydown = (e) => {\n this.opts.onEscapeKeydown.current(e);\n if (e.defaultPrevented)\n return;\n this.root.handleClose();\n };\n get shouldRender() {\n return this.root.contentPresence.shouldRender;\n }\n get shouldTrapFocus() {\n if (this.root.openedViaHover && !this.root.hasInteractedWithContent)\n return false;\n return true;\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n tabindex: -1,\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n ...getDataTransitionAttrs(this.root.contentPresence.transitionStatus),\n [popoverAttrs.content]: \"\",\n style: {\n pointerEvents: \"auto\",\n // CSS containment isolates style/layout/paint calculations from the rest of the page\n contain: \"layout style\",\n },\n onpointerdown: this.onpointerdown,\n onfocusin: this.onfocusin,\n onpointerenter: this.onpointerenter,\n onpointerleave: this.onpointerleave,\n ...this.attachment,\n }));\n popperProps = {\n onInteractOutside: this.onInteractOutside,\n onEscapeKeydown: this.onEscapeKeydown,\n };\n}\nexport class PopoverCloseState {\n static create(opts) {\n return new PopoverCloseState(opts, PopoverRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n this.onkeydown = this.onkeydown.bind(this);\n }\n onclick(_) {\n this.root.handleClose();\n }\n onkeydown(e) {\n if (!(e.key === kbd.ENTER || e.key === kbd.SPACE))\n return;\n e.preventDefault();\n this.root.handleClose();\n }\n props = $derived.by(() => ({\n id: this.opts.id.current,\n onclick: this.onclick,\n onkeydown: this.onkeydown,\n type: \"button\",\n [popoverAttrs.close]: \"\",\n ...this.attachment,\n }));\n}\nexport class PopoverOverlayState {\n static create(opts) {\n return new PopoverOverlayState(opts, PopoverRootContext.get());\n }\n opts;\n root;\n attachment;\n constructor(opts, root) {\n this.opts = opts;\n this.root = root;\n this.attachment = attachRef(this.opts.ref, (v) => (this.root.overlayNode = v));\n }\n get shouldRender() {\n return this.root.overlayPresence.shouldRender;\n }\n snippetProps = $derived.by(() => ({ open: this.root.opts.open.current }));\n props = $derived.by(() => ({\n id: this.opts.id.current,\n [popoverAttrs.overlay]: \"\",\n style: {\n pointerEvents: \"auto\",\n },\n \"data-state\": getDataOpenClosed(this.root.opts.open.current),\n ...getDataTransitionAttrs(this.root.overlayPresence.transitionStatus),\n ...this.attachment,\n }));\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { PopoverContentProps } from \"../types.js\";\n\timport { PopoverContentState } from \"../popover.svelte.js\";\n\timport PopperLayer from \"../../utilities/popper-layer/popper-layer.svelte\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { getFloatingContentCSSVars } from \"../../../internal/floating-svelte/floating-utils.svelte.js\";\n\timport PopperLayerForceMount from \"../../utilities/popper-layer/popper-layer-force-mount.svelte\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchild,\n\t\tchildren,\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tforceMount = false,\n\t\tonOpenAutoFocus = noop,\n\t\tonCloseAutoFocus = noop,\n\t\tonEscapeKeydown = noop,\n\t\tonInteractOutside = noop,\n\t\ttrapFocus = true,\n\t\tpreventScroll = false,\n\t\tcustomAnchor = null,\n\t\tstyle,\n\t\t...restProps\n\t}: PopoverContentProps = $props();\n\n\tconst contentState = PopoverContentState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tonInteractOutside: boxWith(() => onInteractOutside),\n\t\tonEscapeKeydown: boxWith(() => onEscapeKeydown),\n\t\tcustomAnchor: boxWith(() => customAnchor),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n\n\t// respect user's trapFocus setting, but disable when hover-opened without interaction\n\tconst effectiveTrapFocus = $derived(trapFocus && contentState.shouldTrapFocus);\n\n\t// prevent auto-focus when opened via hover until user interacts\n\tfunction handleOpenAutoFocus(e: Event) {\n\t\tif (!contentState.shouldTrapFocus) {\n\t\t\te.preventDefault();\n\t\t}\n\t\tonOpenAutoFocus(e);\n\t}\n</script>\n\n{#if forceMount}\n\t<PopperLayerForceMount\n\t\t{...mergedProps}\n\t\t{...contentState.popperProps}\n\t\tref={contentState.opts.ref}\n\t\tenabled={contentState.root.opts.open.current}\n\t\t{id}\n\t\ttrapFocus={effectiveTrapFocus}\n\t\t{preventScroll}\n\t\tloop\n\t\tforceMount={true}\n\t\t{customAnchor}\n\t\tonOpenAutoFocus={handleOpenAutoFocus}\n\t\t{onCloseAutoFocus}\n\t\tshouldRender={contentState.shouldRender}\n\t>\n\t\t{#snippet popper({ props, wrapperProps })}\n\t\t\t{@const finalProps = mergeProps(\n\t\t\t\tprops,\n\t\t\t\t{ style: getFloatingContentCSSVars(\"popover\") },\n\t\t\t\t{ style }\n\t\t\t)}\n\t\t\t{#if child}\n\t\t\t\t{@render child({ props: finalProps, wrapperProps, ...contentState.snippetProps })}\n\t\t\t{:else}\n\t\t\t\t<div {...wrapperProps}>\n\t\t\t\t\t<div {...finalProps}>\n\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/snippet}\n\t</PopperLayerForceMount>\n{:else if !forceMount}\n\t<PopperLayer\n\t\t{...mergedProps}\n\t\t{...contentState.popperProps}\n\t\tref={contentState.opts.ref}\n\t\topen={contentState.root.opts.open.current}\n\t\t{id}\n\t\ttrapFocus={effectiveTrapFocus}\n\t\t{preventScroll}\n\t\tloop\n\t\tforceMount={false}\n\t\t{customAnchor}\n\t\tonOpenAutoFocus={handleOpenAutoFocus}\n\t\t{onCloseAutoFocus}\n\t\tshouldRender={contentState.shouldRender}\n\t>\n\t\t{#snippet popper({ props, wrapperProps })}\n\t\t\t{@const finalProps = mergeProps(\n\t\t\t\tprops,\n\t\t\t\t{ style: getFloatingContentCSSVars(\"popover\") },\n\t\t\t\t{ style }\n\t\t\t)}\n\t\t\t{#if child}\n\t\t\t\t{@render child({ props: finalProps, wrapperProps, ...contentState.snippetProps })}\n\t\t\t{:else}\n\t\t\t\t<div {...wrapperProps}>\n\t\t\t\t\t<div {...finalProps}>\n\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t{/snippet}\n\t</PopperLayer>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { PopoverTriggerProps } from \"../types.js\";\n\timport { PopoverTriggerState } from \"../popover.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport FloatingLayerAnchor from \"../../utilities/floating-layer/components/floating-layer-anchor.svelte\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\ttype = \"button\",\n\t\tdisabled = false,\n\t\topenOnHover = false,\n\t\topenDelay = 700,\n\t\tcloseDelay = 300,\n\t\t...restProps\n\t}: PopoverTriggerProps = $props();\n\n\tconst triggerState = PopoverTriggerState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t\topenOnHover: boxWith(() => openOnHover),\n\t\topenDelay: boxWith(() => openDelay),\n\t\tcloseDelay: boxWith(() => closeDelay),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, triggerState.props, { type }));\n</script>\n\n<FloatingLayerAnchor {id} ref={triggerState.opts.ref}>\n\t{#if child}\n\t\t{@render child({ props: mergedProps })}\n\t{:else}\n\t\t<button {...mergedProps}>\n\t\t\t{@render children?.()}\n\t\t</button>\n\t{/if}\n</FloatingLayerAnchor>\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport { DialogRootState } from \"../dialog.svelte.js\";\n\timport type { DialogRootProps } from \"../types.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: DialogRootProps = $props();\n\n\tDialogRootState.create({\n\t\tvariant: boxWith(() => \"dialog\"),\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n</script>\n\n{@render children?.()}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogCloseState } from \"../dialog.svelte.js\";\n\timport type { DialogCloseProps } from \"../types.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tchildren,\n\t\tchild,\n\t\tid = createId(uid),\n\t\tref = $bindable(null),\n\t\tdisabled = false,\n\t\t...restProps\n\t}: DialogCloseProps = $props();\n\n\tconst closeState = DialogCloseState.create({\n\t\tvariant: boxWith(() => \"close\"),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t\tdisabled: boxWith(() => Boolean(disabled)),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, closeState.props));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.()}\n\t</button>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport { DialogContentState } from \"../dialog.svelte.js\";\n\timport type { DialogContentProps } from \"../types.js\";\n\timport DismissibleLayer from \"../../utilities/dismissible-layer/dismissible-layer.svelte\";\n\timport EscapeLayer from \"../../utilities/escape-layer/escape-layer.svelte\";\n\timport FocusScope from \"../../utilities/focus-scope/focus-scope.svelte\";\n\timport TextSelectionLayer from \"../../utilities/text-selection-layer/text-selection-layer.svelte\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\timport ScrollLock from \"../../utilities/scroll-lock/scroll-lock.svelte\";\n\tconst uid = $props.id();\n\n\tlet {\n\t\tid = createId(uid),\n\t\tchildren,\n\t\tchild,\n\t\tref = $bindable(null),\n\t\tforceMount = false,\n\t\tonCloseAutoFocus = noop,\n\t\tonOpenAutoFocus = noop,\n\t\tonEscapeKeydown = noop,\n\t\tonInteractOutside = noop,\n\t\ttrapFocus = true,\n\t\tpreventScroll = true,\n\t\tpreventOverflowTextSelection = true,\n\t\trestoreScrollDelay = null,\n\t\t...restProps\n\t}: DialogContentProps = $props();\n\n\tconst contentState = DialogContentState.create({\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, contentState.props));\n</script>\n\n{#if contentState.shouldRender || forceMount}\n\t<FocusScope\n\t\tref={contentState.opts.ref}\n\t\tloop\n\t\t{trapFocus}\n\t\tenabled={contentState.root.opts.open.current}\n\t\t{onOpenAutoFocus}\n\t\t{onCloseAutoFocus}\n\t>\n\t\t{#snippet focusScope({ props: focusScopeProps })}\n\t\t\t<EscapeLayer\n\t\t\t\t{...mergedProps}\n\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\tref={contentState.opts.ref}\n\t\t\t\tonEscapeKeydown={(e) => {\n\t\t\t\t\tonEscapeKeydown(e);\n\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<DismissibleLayer\n\t\t\t\t\t{...mergedProps}\n\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\tonInteractOutside={(e) => {\n\t\t\t\t\t\tonInteractOutside(e);\n\t\t\t\t\t\tif (e.defaultPrevented) return;\n\t\t\t\t\t\tcontentState.root.handleClose();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<TextSelectionLayer\n\t\t\t\t\t\t{...mergedProps}\n\t\t\t\t\t\t{preventOverflowTextSelection}\n\t\t\t\t\t\tref={contentState.opts.ref}\n\t\t\t\t\t\tenabled={contentState.root.opts.open.current}\n\t\t\t\t\t>\n\t\t\t\t\t\t{#if child}\n\t\t\t\t\t\t\t{#if contentState.root.opts.open.current}\n\t\t\t\t\t\t\t\t<ScrollLock {preventScroll} {restoreScrollDelay} />\n\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{@render child({\n\t\t\t\t\t\t\t\tprops: mergeProps(mergedProps, focusScopeProps),\n\t\t\t\t\t\t\t\t...contentState.snippetProps,\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t<ScrollLock {preventScroll} />\n\t\t\t\t\t\t\t<div {...mergeProps(mergedProps, focusScopeProps)}>\n\t\t\t\t\t\t\t\t{@render children?.()}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</TextSelectionLayer>\n\t\t\t\t</DismissibleLayer>\n\t\t\t</EscapeLayer>\n\t\t{/snippet}\n\t</FocusScope>\n{/if}\n","<script lang=\"ts\">\n\timport { boxWith } from \"svelte-toolbelt\";\n\timport type { PopoverRootProps } from \"../types.js\";\n\timport { PopoverRootState } from \"../popover.svelte.js\";\n\timport FloatingLayer from \"../../utilities/floating-layer/components/floating-layer.svelte\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tlet {\n\t\topen = $bindable(false),\n\t\tonOpenChange = noop,\n\t\tonOpenChangeComplete = noop,\n\t\tchildren,\n\t}: PopoverRootProps = $props();\n\n\tPopoverRootState.create({\n\t\topen: boxWith(\n\t\t\t() => open,\n\t\t\t(v) => {\n\t\t\t\topen = v;\n\t\t\t\tonOpenChange(v);\n\t\t\t}\n\t\t),\n\t\tonOpenChangeComplete: boxWith(() => onOpenChangeComplete),\n\t});\n</script>\n\n<FloatingLayer>\n\t{@render children?.()}\n</FloatingLayer>\n","import { attachRef } from \"svelte-toolbelt\";\nimport { createBitsAttrs, boolToStr, boolToEmptyStrOrUndef, boolToTrueOrUndef, } from \"../../internal/attrs.js\";\nexport const toggleAttrs = createBitsAttrs({\n component: \"toggle\",\n parts: [\"root\"],\n});\nexport class ToggleRootState {\n static create(opts) {\n return new ToggleRootState(opts);\n }\n opts;\n attachment;\n constructor(opts) {\n this.opts = opts;\n this.attachment = attachRef(this.opts.ref);\n this.onclick = this.onclick.bind(this);\n }\n onclick(_) {\n if (this.opts.disabled.current)\n return;\n this.opts.pressed.current = !this.opts.pressed.current;\n }\n snippetProps = $derived.by(() => ({\n pressed: this.opts.pressed.current,\n }));\n props = $derived.by(() => ({\n [toggleAttrs.root]: \"\",\n id: this.opts.id.current,\n \"data-disabled\": boolToEmptyStrOrUndef(this.opts.disabled.current),\n \"aria-pressed\": boolToStr(this.opts.pressed.current),\n \"data-state\": getToggleDataState(this.opts.pressed.current),\n disabled: boolToTrueOrUndef(this.opts.disabled.current),\n onclick: this.onclick,\n ...this.attachment,\n }));\n}\nexport function getToggleDataState(condition) {\n return condition ? \"on\" : \"off\";\n}\n","<script lang=\"ts\">\n\timport { boxWith, mergeProps } from \"svelte-toolbelt\";\n\timport type { ToggleRootProps } from \"../types.js\";\n\timport { ToggleRootState } from \"../toggle.svelte.js\";\n\timport { createId } from \"../../../internal/create-id.js\";\n\timport { noop } from \"../../../internal/noop.js\";\n\n\tconst uid = $props.id();\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tid = createId(uid),\n\t\tpressed = $bindable(false),\n\t\tonPressedChange = noop,\n\t\tdisabled = false,\n\t\ttype = \"button\",\n\t\tchildren,\n\t\tchild,\n\t\t...restProps\n\t}: ToggleRootProps = $props();\n\n\tconst toggleState = ToggleRootState.create({\n\t\tpressed: boxWith(\n\t\t\t() => pressed,\n\t\t\t(v) => {\n\t\t\t\tpressed = v;\n\t\t\t\tonPressedChange(v);\n\t\t\t}\n\t\t),\n\t\tdisabled: boxWith(() => disabled ?? false),\n\t\tid: boxWith(() => id),\n\t\tref: boxWith(\n\t\t\t() => ref,\n\t\t\t(v) => (ref = v)\n\t\t),\n\t});\n\n\tconst mergedProps = $derived(mergeProps(restProps, toggleState.props, { type }));\n</script>\n\n{#if child}\n\t{@render child({ props: mergedProps, ...toggleState.snippetProps })}\n{:else}\n\t<button {...mergedProps}>\n\t\t{@render children?.(toggleState.snippetProps)}\n\t</button>\n{/if}\n","/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n * \n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n * \n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n * \n * ---\n * \n * The MIT License (MIT) (for portions derived from Feather)\n * \n * Copyright (c) 2013-2023 Cole Bemis\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n * \n */\nconst defaultAttributes = {\n xmlns: 'http://www.w3.org/2000/svg',\n width: 24,\n height: 24,\n viewBox: '0 0 24 24',\n fill: 'none',\n stroke: 'currentColor',\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n};\nexport default defaultAttributes;\n","<script lang=\"ts\">import defaultAttributes from './defaultAttributes.js';\nconst { name, color = 'currentColor', size = 24, strokeWidth = 2, absoluteStrokeWidth = false, iconNode = [], children, ...props } = $props();\n</script>\n\n<svg\n {...defaultAttributes}\n {...props}\n width={size}\n height={size}\n stroke={color}\n stroke-width={absoluteStrokeWidth ? (Number(strokeWidth) * 24) / Number(size) : strokeWidth}\n class={['lucide-icon lucide', name && `lucide-${name}`, props.class]}\n>\n {#each iconNode as [tag, attrs]}\n <svelte:element\n this={tag}\n {...attrs}\n />\n {/each}\n {@render children?.()}\n</svg>\n","<script lang=\"ts\">/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * ---\n *\n * The MIT License (MIT) (for portions derived from Feather)\n *\n * Copyright (c) 2013-2023 Cole Bemis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\nimport Icon from '../Icon.svelte';\nlet props = $props();\nconst iconNode = [[\"path\", { \"d\": \"M20 6 9 17l-5-5\" }]];\n/**\n * @component @name Check\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgNiA5IDE3bC01LTUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/check\n * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {FunctionalComponent} Svelte component\n *\n */\n</script>\n\n<Icon name=\"check\" {...props} iconNode={iconNode}>\n {@render props.children?.()}\n</Icon>\n","<script lang=\"ts\">\n\t/**\n\t * The project the session works in: the repo root (else the cwd), the\n\t * branch, and the URLs named in the repo's `.claude-mux.json`. The\n\t * simplest pane there is, shipped with the panel so the container has\n\t * something to hold before the Changes, Files and Web panes arrive.\n\t */\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport type { ProjectInfo } from '$shared/server/project.js';\n\n\tlet { session, setActions, active }: PaneBodyProps = $props();\n\n\tlet info = $state<ProjectInfo | null>(null);\n\tlet error = $state<string | null>(null);\n\tlet loading = $state(false);\n\n\t/** Bumped by each load, so an answer that arrives after a newer request is dropped. */\n\tlet seq = 0;\n\n\tasync function load(id: string) {\n\t\tconst mine = ++seq;\n\t\tloading = true;\n\t\terror = null;\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/sessions/${encodeURIComponent(id)}/project`);\n\t\t\tconst body = await res.json();\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tif (mine === seq) info = body as ProjectInfo;\n\t\t} catch (err) {\n\t\t\tif (mine === seq) error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === seq) loading = false;\n\t\t}\n\t}\n\n\tconst sessionId = $derived(session?.id ?? null);\n\t// Read when first shown, and again whenever the session moves to another directory.\n\tconst cwd = $derived(session?.cwd ?? null);\n\t$effect(() => {\n\t\tif (sessionId && cwd && active) void load(sessionId);\n\t});\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId || loading,\n\t\t\t\trun: () => sessionId && void load(sessionId)\n\t\t\t}\n\t\t]);\n\t});\n\n\tconst urls = $derived(Object.entries(info?.config?.urls ?? {}));\n</script>\n\n<div class=\"project\">\n\t{#if error}\n\t\t<p class=\"err\">{error}</p>\n\t{:else if !info}\n\t\t<p class=\"dim\">Loading…</p>\n\t{:else}\n\t\t<dl>\n\t\t\t<dt>{info.repo ? 'Repository' : 'Directory'}</dt>\n\t\t\t<dd class=\"mono\" title={info.root}>{info.root}</dd>\n\t\t\t<dt>Branch</dt>\n\t\t\t<dd class=\"mono\">\n\t\t\t\t{#if info.branch}{info.branch}{:else if info.repo}<span class=\"dim\">detached HEAD</span>{:else}<span\n\t\t\t\t\t\tclass=\"dim\">not a git repository</span\n\t\t\t\t\t>{/if}\n\t\t\t</dd>\n\t\t\t<dt>URLs</dt>\n\t\t\t<dd>\n\t\t\t\t{#if urls.length > 0}\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t{#each urls as [name, url] (name)}\n\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t<span class=\"name\">{name}</span>\n\t\t\t\t\t\t\t\t<a class=\"mono\" href={url} target=\"_blank\" rel=\"noopener noreferrer\">{url}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t{/each}\n\t\t\t\t\t</ul>\n\t\t\t\t{:else if info.configError}\n\t\t\t\t\t<span class=\"err\">.claude-mux.json: {info.configError}</span>\n\t\t\t\t{:else}\n\t\t\t\t\t<span class=\"dim\">\n\t\t\t\t\t\tNone. Commit a <code>.claude-mux.json</code> at the root to name them:\n\t\t\t\t\t</span>\n\t\t\t\t\t<pre>{`{ \"urls\": { \"prod\": \"https://…\", \"dev\": \"http://localhost:5173\" } }`}</pre>\n\t\t\t\t{/if}\n\t\t\t</dd>\n\t\t</dl>\n\t{/if}\n</div>\n\n<style>\n\t.project {\n\t\tpadding: 16px 18px;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\tdl {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: max-content 1fr;\n\t\tgap: 10px 16px;\n\t\tmargin: 0;\n\t}\n\tdt {\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tpadding-top: 2px;\n\t}\n\tdd {\n\t\tmargin: 0;\n\t\tmin-width: 0;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.mono,\n\tcode,\n\tpre {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\tul {\n\t\tlist-style: none;\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tdisplay: grid;\n\t\tgap: 6px;\n\t}\n\tli {\n\t\tdisplay: flex;\n\t\tgap: 10px;\n\t\talign-items: baseline;\n\t\tmin-width: 0;\n\t}\n\t.name {\n\t\tcolor: #a8a29e;\n\t\tmin-width: 3.5em;\n\t}\n\ta {\n\t\tcolor: #93c5fd;\n\t\ttext-decoration: none;\n\t\toverflow-wrap: anywhere;\n\t}\n\ta:hover {\n\t\ttext-decoration: underline;\n\t}\n\tpre {\n\t\tmargin: 8px 0 0;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 6px;\n\t\tbackground: #1a1a1a;\n\t\twhite-space: pre-wrap;\n\t\tcolor: #a8a29e;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n</style>\n","<script lang=\"ts\" module>\n\timport { type VariantProps, tv } from \"tailwind-variants\";\n\n\texport const toggleVariants = tv({\n\t\tbase: \"hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-lg text-sm font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none hover:bg-muted focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t\tvariants: {\n\t\t\tvariant: {\n\t\t\t\tdefault: \"bg-transparent\",\n\t\t\t\toutline: \"border-input hover:bg-muted border bg-transparent\",\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: \"h-8 min-w-8 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t\tsm: \"h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5\",\n\t\t\t\txs: \"h-6 min-w-6 rounded-md px-1.5 text-[11px] [&_svg:not([class*='size-'])]:size-3\",\n\t\t\t\tlg: \"h-9 min-w-9 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2\",\n\t\t\t},\n\t\t},\n\t\tdefaultVariants: {\n\t\t\tvariant: \"default\",\n\t\t\tsize: \"default\",\n\t\t},\n\t});\n\n\texport type ToggleVariant = VariantProps<typeof toggleVariants>[\"variant\"];\n\texport type ToggleSize = VariantProps<typeof toggleVariants>[\"size\"];\n\texport type ToggleVariants = VariantProps<typeof toggleVariants>;\n</script>\n\n<script lang=\"ts\">\n\timport { Toggle as TogglePrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tpressed = $bindable(false),\n\t\tclass: className,\n\t\tsize = \"default\",\n\t\tvariant = \"default\",\n\t\t...restProps\n\t}: TogglePrimitive.RootProps & {\n\t\tvariant?: ToggleVariant;\n\t\tsize?: ToggleSize;\n\t} = $props();\n</script>\n\n<TogglePrimitive.Root\n\tbind:ref\n\tbind:pressed\n\tdata-slot=\"toggle\"\n\tclass={cn(toggleVariants({ variant, size }), className)}\n\t{...restProps}\n/>\n","/**\n * Syntax colouring for the Changes pane's diff, loaded the first time a diff\n * is drawn so the session page does not carry highlight.js until then.\n *\n * Lines are coloured one at a time: a diff shows fragments, so a construct\n * that opens above the hunk (a block comment, a template string) is never\n * seen whole anyway, and per line keeps a bad guess from spilling further.\n */\nimport type { HLJSApi, LanguageFn } from 'highlight.js';\n\nlet loading: Promise<HLJSApi> | null = null;\n\nconst LOADERS: Record<string, () => Promise<{ default: LanguageFn }>> = {\n\ttypescript: () => import('highlight.js/lib/languages/typescript'),\n\tjavascript: () => import('highlight.js/lib/languages/javascript'),\n\txml: () => import('highlight.js/lib/languages/xml'),\n\tcss: () => import('highlight.js/lib/languages/css'),\n\tscss: () => import('highlight.js/lib/languages/scss'),\n\tjson: () => import('highlight.js/lib/languages/json'),\n\tmarkdown: () => import('highlight.js/lib/languages/markdown'),\n\tpython: () => import('highlight.js/lib/languages/python'),\n\tbash: () => import('highlight.js/lib/languages/bash'),\n\tyaml: () => import('highlight.js/lib/languages/yaml'),\n\tini: () => import('highlight.js/lib/languages/ini'),\n\trust: () => import('highlight.js/lib/languages/rust'),\n\tgo: () => import('highlight.js/lib/languages/go'),\n\tsql: () => import('highlight.js/lib/languages/sql'),\n\tjava: () => import('highlight.js/lib/languages/java'),\n\tkotlin: () => import('highlight.js/lib/languages/kotlin'),\n\tc: () => import('highlight.js/lib/languages/c'),\n\tcpp: () => import('highlight.js/lib/languages/cpp'),\n\truby: () => import('highlight.js/lib/languages/ruby'),\n\tphp: () => import('highlight.js/lib/languages/php'),\n\tswift: () => import('highlight.js/lib/languages/swift'),\n\tlua: () => import('highlight.js/lib/languages/lua'),\n\tdockerfile: () => import('highlight.js/lib/languages/dockerfile'),\n\tmakefile: () => import('highlight.js/lib/languages/makefile')\n};\n\nconst core = () => (loading ??= import('highlight.js/lib/core').then((m) => m.default));\n\n/**\n * Each line as escaped HTML with highlight.js's token spans, or null when the\n * language is unknown (the caller then draws the text as is).\n */\nexport async function highlightLines(lines: string[], language: string | null): Promise<string[] | null> {\n\tif (!language || !LOADERS[language]) return null;\n\tconst load = LOADERS[language];\n\tconst hljs = await core();\n\tif (!hljs.getLanguage(language)) hljs.registerLanguage(language, (await load()).default);\n\treturn lines.map((line) => hljs.highlight(line, { language, ignoreIllegals: true }).value);\n}\n","<script lang=\"ts\">\n\t/**\n\t * What the session changed, from one of two sources: Current (git's\n\t * working tree, which catches edits made through Bash) or Session (the\n\t * edits in the session's own log, which reach files outside the repo and\n\t * know which turn made each). A file list on the left, the selected\n\t * file's diff on the right; narrower than the two fit, one at a time.\n\t *\n\t * The URL holds the file (`file`), the Session turn (`turn`, its number in\n\t * the session) and the source (`source`), so a link can open any of it.\n\t * While shown, the pane re-reads whenever the session's hooks report in.\n\t */\n\timport { untrack } from 'svelte';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Button } from '$lib/components/ui/button';\n\timport {\n\t\tdiffRows,\n\t\tdisplayPath,\n\t\tisGenerated,\n\t\tlanguageFor,\n\t\tstatusLetter,\n\t\tsumCounts,\n\t\ttype Diff,\n\t\ttype DiffRow,\n\t\ttype Listing,\n\t\ttype Source\n\t} from '$lib/side-panel/changes';\n\timport { highlightLines } from '$lib/side-panel/highlight';\n\n\tlet { session, params, setParams, setActions, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\t/** Git when the session sits in a repo, else its log; a `source` param overrides. */\n\tconst inRepo = $derived(!!session?.git_root || session?.changes?.source === 'git');\n\t/** Set once git answered that the session is not in a work tree. */\n\tlet gitMissing = $state(false);\n\tconst wanted = $derived<Source>(\n\t\tparams.source === 'session' || params.source === 'git' ? params.source : inRepo ? 'git' : 'session'\n\t);\n\tconst source = $derived<Source>(gitMissing && wanted === 'git' ? 'session' : wanted);\n\n\tlet listing = $state<Listing | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet loadingList = $state(false);\n\t/** Bumped by each listing read, so the diff is read again with it. */\n\tlet listStamp = $state(0);\n\tlet listSeq = 0;\n\t/** A reload asked for while one was in flight: run once more when it lands. */\n\tlet again: { id: string; src: Source } | null = null;\n\n\tasync function loadList(id: string, src: Source) {\n\t\tif (loadingList) {\n\t\t\tagain = { id, src };\n\t\t\treturn;\n\t\t}\n\t\tconst mine = ++listSeq;\n\t\tloadingList = true;\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/sessions/${encodeURIComponent(id)}/changes?source=${src}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== listSeq) return;\n\t\t\tif (res.status === 404 && src === 'git') {\n\t\t\t\tgitMissing = true;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tlisting = body as Listing;\n\t\t\tlistStamp++;\n\t\t\tlistError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === listSeq) listError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (mine === listSeq) loadingList = false;\n\t\t\tconst next = again;\n\t\t\tagain = null;\n\t\t\tif (next) void loadList(next.id, next.src);\n\t\t}\n\t}\n\n\t/**\n\t * Re-read whenever a hook reports in or the broadcast count moves — what\n\t * makes git re-read the repo, too. A hidden pane waits until shown.\n\t */\n\tconst pulse = $derived(\n\t\t`${session?.last_update ?? 0}:${session?.changes?.additions ?? 0}:${session?.changes?.deletions ?? 0}:${session?.changes?.files ?? 0}`\n\t);\n\t$effect(() => {\n\t\tvoid pulse;\n\t\tif (sessionId && active) void loadList(sessionId, source);\n\t});\n\n\t// A listing for the other source is no answer for this one.\n\tconst current = $derived(listing?.source === source ? listing : null);\n\tconst turns = $derived(current?.turns ?? []);\n\tconst turn = $derived(\n\t\tsource === 'session' && params.turn !== undefined\n\t\t\t? (turns.find((t) => String(t.n) === params.turn) ?? null)\n\t\t\t: null\n\t);\n\tconst files = $derived(turn ? turn.files : (current?.files ?? []));\n\tconst root = $derived(current?.root ?? session?.git_root ?? session?.cwd ?? null);\n\tconst totals = $derived(turn ? sumCounts(files) : (current?.totals ?? sumCounts(files)));\n\t/** Newest first, each with its own totals. */\n\tconst chips = $derived(turns.map((t) => ({ ...t, ...sumCounts(t.files) })).reverse());\n\n\tlet showGenerated = $state(false);\n\tconst split = $derived.by(() => {\n\t\tconst generated: typeof files = [];\n\t\tconst kept: typeof files = [];\n\t\t// Relative to the root, so a repo that sits under a `build/` is not all generated.\n\t\tfor (const f of files) (isGenerated(displayPath(f.file, root)) ? generated : kept).push(f);\n\t\treturn { generated, kept };\n\t});\n\tconst shown = $derived(showGenerated ? files : split.kept);\n\n\t/** The file the URL names, else the first one listed, so a wide pane never sits empty. */\n\tconst selected = $derived(\n\t\tfiles.find((f) => f.file === params.file) ?? (params.file ? null : (shown[0] ?? null))\n\t);\n\n\tfunction pick(file: string) {\n\t\tsetParams({ file });\n\t}\n\n\tfunction setSource(next: Source) {\n\t\tif (next === source) return;\n\t\tsetParams({ source: next, turn: null, file: null });\n\t}\n\n\tfunction setTurn(n: number | null) {\n\t\tsetParams({ turn: n === null ? null : String(n), file: null });\n\t}\n\n\tconst NO_PROMPT = 'Before the first prompt';\n\n\t/** Scroll the transcript to the prompt that opened a turn; the page does the scrolling. */\n\tfunction revealTurn(id: string) {\n\t\twindow.dispatchEvent(new CustomEvent('claude-mux:reveal-entry', { detail: { id } }));\n\t}\n\n\t// ── the selected file's diff ─────────────────────────────────────────\n\n\tlet diff = $state<Diff | null>(null);\n\tlet diffError = $state<{ file: string; message: string } | null>(null);\n\tlet diffSeq = 0;\n\t/** Highlighted HTML per row index, filled in once highlight.js has loaded. */\n\tlet painted = $state<(string | null)[] | null>(null);\n\n\tasync function loadDiff(id: string, src: Source, file: string, turnId: string | null | undefined) {\n\t\tconst mine = ++diffSeq;\n\t\tconst q = new URLSearchParams({ source: src, file });\n\t\t// An empty turn is the one before the first prompt; no turn at all is every turn.\n\t\tif (turnId !== undefined) q.set('turn', turnId ?? '');\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/sessions/${encodeURIComponent(id)}/changes/diff?${q}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== diffSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tdiff = body as Diff;\n\t\t\tdiffError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === diffSeq) {\n\t\t\t\tdiff = null;\n\t\t\t\tdiffError = { file, message: err instanceof Error ? err.message : String(err) };\n\t\t\t}\n\t\t}\n\t}\n\n\t/** What the diff depends on: the file, the turn, and each fresh read of the list. */\n\tconst diffKey = $derived(\n\t\tselected ? `${source}\\0${selected.file}\\0${turn ? `t${turn.n}` : ''}\\0${listStamp}` : null\n\t);\n\t$effect(() => {\n\t\tif (!diffKey || !sessionId || !active) return;\n\t\t// Only the key decides: a reloaded list hands back new objects for the same file.\n\t\tconst id = sessionId;\n\t\tuntrack(() => void loadDiff(id, source, selected!.file, turn ? turn.id : undefined));\n\t});\n\n\tconst shownDiff = $derived(diff && diff.file === selected?.file ? diff : null);\n\tconst shownError = $derived(diffError?.file === selected?.file ? diffError!.message : null);\n\tconst rows = $derived<DiffRow[]>(shownDiff ? diffRows(shownDiff.hunks) : []);\n\tconst hunkCount = $derived(shownDiff?.hunks.length ?? 0);\n\n\tconst SIGN = { add: '+', del: '−', context: ' ' } as const;\n\n\t/** Rows past this many are drawn plain: colouring them costs more than it gives. */\n\tconst PAINT_LIMIT = 4000;\n\t$effect(() => {\n\t\tpainted = null;\n\t\tif (rows.length === 0 || rows.length > PAINT_LIMIT) return;\n\t\tconst lines = rows.map((r) => ('text' in r ? r.text : ''));\n\t\tconst language = untrack(() => languageFor(selected!.file));\n\t\tlet stale = false;\n\t\tvoid highlightLines(lines, language).then((html) => {\n\t\t\tif (!stale && html) painted = html;\n\t\t});\n\t\treturn () => (stale = true);\n\t});\n\n\t// ── header actions and keys ──────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId || loadingList,\n\t\t\t\trun: () => sessionId && void loadList(sessionId, source)\n\t\t\t}\n\t\t]);\n\t});\n\n\t/** j/k step through the files, unless someone is typing. */\n\tfunction onKey(e: KeyboardEvent) {\n\t\tif (!active || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey) return;\n\t\tif (e.key !== 'j' && e.key !== 'k') return;\n\t\tconst el = e.target as HTMLElement | null;\n\t\tif (el?.closest('input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"]')) return;\n\t\tif (shown.length === 0) return;\n\t\tconst at = selected ? shown.findIndex((f) => f.file === selected.file) : -1;\n\t\tconst next = e.key === 'j' ? Math.min(at + 1, shown.length - 1) : Math.max(at - 1, 0);\n\t\te.preventDefault();\n\t\tpick(shown[next].file);\n\t\tdocument\n\t\t\t.querySelector(`[data-change-file=\"${CSS.escape(shown[next].file)}\"]`)\n\t\t\t?.scrollIntoView({ block: 'nearest' });\n\t}\n\n</script>\n\n<svelte:window onkeydown={onKey} />\n\n<div class=\"changes\" class:picked={!!params.file}>\n\t<div class=\"bar\">\n\t\t<span class=\"title\">\n\t\t\t{#if current}\n\t\t\t\t{files.length} {files.length === 1 ? 'file' : 'files'} changed\n\t\t\t\t{#if totals.additions || totals.deletions}\n\t\t\t\t\t<span class=\"mono\"><span class=\"add\">+{totals.additions}</span> <span class=\"del\">−{totals.deletions}</span></span>\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\tChanges\n\t\t\t{/if}\n\t\t</span>\n\t\t<span class=\"sp\"></span>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"Source\">\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tbind:pressed={() => source === 'git', (on) => on && setSource('git')}\n\t\t\t\tdisabled={gitMissing}\n\t\t\t\ttitle={gitMissing ? 'Not a git repository' : 'What git sees in the working tree now'}>Current · git</Toggle\n\t\t\t>\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tbind:pressed={() => source === 'session', (on) => on && setSource('session')}\n\t\t\t\ttitle=\"The edits this session's tools made\">Session</Toggle\n\t\t\t>\n\t\t</div>\n\t</div>\n\n\t{#if source === 'session' && turns.length > 0}\n\t\t<div class=\"turns\" role=\"group\" aria-label=\"Turn\">\n\t\t\t<Toggle\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\tclass=\"chip\"\n\t\t\t\tbind:pressed={() => !turn, (on) => on && setTurn(null)}>All turns</Toggle\n\t\t\t>\n\t\t\t{#each chips as t (t.n)}\n\t\t\t\t<Toggle\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclass=\"chip\"\n\t\t\t\t\ttitle={t.prompt || NO_PROMPT}\n\t\t\t\t\tbind:pressed={() => turn?.n === t.n, (on) => on && setTurn(t.n)}\n\t\t\t\t>\n\t\t\t\t\t{t.n === 0 ? 'Start' : `Turn ${t.n}`}\n\t\t\t\t\t{#if t.additions}<span class=\"add\">+{t.additions}</span>{/if}\n\t\t\t\t\t{#if t.deletions}<span class=\"del\">−{t.deletions}</span>{/if}\n\t\t\t\t</Toggle>\n\t\t\t{/each}\n\t\t</div>\n\t\t{#if turn}\n\t\t\t<div class=\"turn-note\">\n\t\t\t\t<span class=\"prompt\" title={turn.prompt}>{turn.prompt || NO_PROMPT}</span>\n\t\t\t\t{#if turn.id}\n\t\t\t\t\t{@const id = turn.id}\n\t\t\t\t\t<Button variant=\"link\" size=\"sm\" class=\"link\" onclick={() => revealTurn(id)}>Show in transcript</Button>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{/if}\n\t{/if}\n\n\t{#if listError && !current}\n\t\t<p class=\"msg err\">{listError}</p>\n\t{:else if !current}\n\t\t<p class=\"msg\">Loading…</p>\n\t{:else if files.length === 0}\n\t\t<p class=\"msg\">\n\t\t\t{source === 'git' ? 'The working tree is clean.' : 'This session has not edited any files yet.'}\n\t\t</p>\n\t{:else}\n\t\t<div class=\"split\">\n\t\t\t<nav aria-label=\"Changed files\">\n\t\t\t\t{#each shown as f (f.file)}\n\t\t\t\t\t{@const letter = statusLetter(f)}\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tclass=\"file\"\n\t\t\t\t\t\tclass:on={selected?.file === f.file}\n\t\t\t\t\t\tclass:untracked={f.untracked}\n\t\t\t\t\t\taria-current={selected?.file === f.file ? 'true' : undefined}\n\t\t\t\t\t\tdata-change-file={f.file}\n\t\t\t\t\t\ttitle={f.oldPath ? `${f.oldPath} → ${f.file}` : f.file}\n\t\t\t\t\t\tonclick={() => pick(f.file)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"st st-{letter === '?' ? 'u' : letter.toLowerCase()}\">{letter}</span>\n\t\t\t\t\t\t<!-- rtl puts the ellipsis on the left; bdi keeps the path itself left to right. -->\n\t\t\t\t\t\t<span class=\"path\"><bdi>{displayPath(f.file, root)}</bdi></span>\n\t\t\t\t\t\t{#if f.binary}\n\t\t\t\t\t\t\t<span class=\"dim\">bin</span>\n\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t{#if f.additions}<span class=\"add\">+{f.additions}</span>{/if}\n\t\t\t\t\t\t\t{#if f.deletions}<span class=\"del\">−{f.deletions}</span>{/if}\n\t\t\t\t\t\t{/if}\n\t\t\t\t\t</button>\n\t\t\t\t{/each}\n\t\t\t\t{#if split.generated.length > 0}\n\t\t\t\t\t<Button variant=\"ghost\" size=\"sm\" class=\"more\" onclick={() => (showGenerated = !showGenerated)}>\n\t\t\t\t\t\t{showGenerated ? 'Hide generated' : `+ ${split.generated.length} generated (show)`}\n\t\t\t\t\t</Button>\n\t\t\t\t{/if}\n\t\t\t</nav>\n\n\t\t\t<section class=\"diff\" aria-label=\"Diff\">\n\t\t\t\t{#if selected}\n\t\t\t\t\t<div class=\"diff-head\">\n\t\t\t\t\t\t<button type=\"button\" class=\"back\" aria-label=\"Back to files\" onclick={() => setParams({ file: null })}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t\t<span class=\"path\" title={selected.file}>{displayPath(selected.file, root)}</span>\n\t\t\t\t\t\t<span class=\"sp\"></span>\n\t\t\t\t\t\t{#if hunkCount}<span class=\"dim\">{hunkCount} {hunkCount === 1 ? 'hunk' : 'hunks'}</span>{/if}\n\t\t\t\t\t</div>\n\t\t\t\t\t{#if shownError}\n\t\t\t\t\t\t<p class=\"msg err\">{shownError}</p>\n\t\t\t\t\t{:else if shownDiff?.binary}\n\t\t\t\t\t\t<p class=\"msg\">Binary file; no text diff.</p>\n\t\t\t\t\t{:else if rows.length > 0}\n\t\t\t\t\t\t<div class=\"lines\">\n\t\t\t\t\t\t\t{#each rows as row, i (i)}\n\t\t\t\t\t\t\t\t{#if row.type === 'hunk'}\n\t\t\t\t\t\t\t\t\t<div class=\"hunk\">{row.header}</div>\n\t\t\t\t\t\t\t\t{:else if row.type === 'gap'}\n\t\t\t\t\t\t\t\t\t<div class=\"gap\">⋯ {row.count} unchanged {row.count === 1 ? 'line' : 'lines'} ⋯</div>\n\t\t\t\t\t\t\t\t{:else}\n\t\t\t\t\t\t\t\t\t<div class=\"ln {row.type}\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"no\">{row.old ?? ''}</span><span class=\"no\">{row.new ?? ''}</span><span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"sign\">{SIGN[row.type]}</span\n\t\t\t\t\t\t\t\t\t\t><!-- eslint-disable-next-line svelte/no-at-html-tags -- highlight.js escapes the text it colours --><span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"code\">{#if painted?.[i] != null}{@html painted[i]}{:else}{row.text}{/if}</span\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t{/if}\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{:else if diff}\n\t\t\t\t\t\t<p class=\"msg\">No line changes.</p>\n\t\t\t\t\t{/if}\n\t\t\t\t{:else}\n\t\t\t\t\t<p class=\"msg\">That file has no change here.</p>\n\t\t\t\t{/if}\n\t\t\t</section>\n\t\t</div>\n\t{/if}\n\t<div class=\"foot\"><kbd>j</kbd>/<kbd>k</kbd> next / previous file</div>\n</div>\n\n<style>\n\t.changes {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\t.mono,\n\tnav,\n\t.diff,\n\t.turns {\n\t\tfont-family: var(--font-mono);\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\tpadding: 10px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.title {\n\t\tfont-size: 13.5px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t\tdisplay: inline-flex;\n\t\tgap: 10px;\n\t\talign-items: baseline;\n\t}\n\t.title .mono {\n\t\tfont-size: 12px;\n\t\tfont-weight: 400;\n\t}\n\t.sp {\n\t\tflex: 1;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 30px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.turns {\n\t\tdisplay: flex;\n\t\tgap: 6px;\n\t\tpadding: 8px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t\tscrollbar-width: thin;\n\t}\n\t.turns :global(.chip) {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 28px;\n\t\tpadding: 0 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.turns :global(.chip:hover) {\n\t\tcolor: #f5f5f4;\n\t}\n\t.turns :global(.chip[data-state='on']) {\n\t\tborder-color: #3f3f46;\n\t\tbackground: #232326;\n\t\tcolor: #f5f5f4;\n\t}\n\t.turn-note {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\tpadding: 6px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tfont-size: 12px;\n\t\tcolor: #a8a29e;\n\t\tflex: none;\n\t}\n\t.prompt,\n\t.file .path,\n\t.diff-head .path {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.prompt {\n\t\tflex: 1;\n\t}\n\t.turn-note :global(.link) {\n\t\tflex: none;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tpadding: 4px 0;\n\t\tcolor: #93c5fd;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t}\n\t.turn-note :global(.link:hover) {\n\t\ttext-decoration: underline;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.split {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tdisplay: flex;\n\t}\n\tnav {\n\t\twidth: 250px;\n\t\tflex: none;\n\t\toverflow-y: auto;\n\t\tborder-right: 1px solid #222;\n\t\tpadding: 8px 6px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 1px;\n\t\tfont-size: 12px;\n\t}\n\t.file {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tmin-height: 32px;\n\t\tpadding: 0 8px;\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.file:hover {\n\t\tbackground: #1a1a1a;\n\t}\n\t.file.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.file.untracked {\n\t\tcolor: #78716c;\n\t}\n\t.file .path {\n\t\tflex: 1;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t}\n\t.st {\n\t\twidth: 10px;\n\t\tflex: none;\n\t}\n\t.st-m,\n\t.st-r {\n\t\tcolor: #fbbf24;\n\t}\n\t.st-a {\n\t\tcolor: #4ade80;\n\t}\n\t.st-d {\n\t\tcolor: #f87171;\n\t}\n\t.st-u {\n\t\tcolor: #78716c;\n\t}\n\tnav :global(.more) {\n\t\tborder: 0;\n\t\tbackground: none;\n\t\ttext-align: left;\n\t\tpadding: 9px 8px 4px;\n\t\tmin-height: 32px;\n\t\tcolor: #78716c;\n\t\tfont: inherit;\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t}\n\tnav :global(.more:hover) {\n\t\tcolor: #d6d3d1;\n\t}\n\t.add {\n\t\tcolor: #4ade80;\n\t}\n\t.del {\n\t\tcolor: #f87171;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.diff {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-size: 12px;\n\t}\n\t.diff-head {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\tpadding: 8px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tflex: none;\n\t\twidth: 44px;\n\t\theight: 44px;\n\t\tmargin: -8px 0 -8px -12px;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 18px;\n\t\tcursor: pointer;\n\t}\n\t.lines {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 6px 0 16px;\n\t\tline-height: 1.65;\n\t}\n\t.hunk {\n\t\tpadding: 2px 14px;\n\t\tcolor: #78716c;\n\t\tbackground: #161616;\n\t\twhite-space: pre;\n\t}\n\t.gap {\n\t\tpadding: 3px 14px;\n\t\tcolor: #78716c;\n\t\tbackground: #141414;\n\t\ttext-align: center;\n\t}\n\t.ln {\n\t\tdisplay: flex;\n\t\twidth: max-content;\n\t\tmin-width: 100%;\n\t\tcolor: #a8a29e;\n\t}\n\t.ln.add {\n\t\tbackground: #0f2417;\n\t\tcolor: #bbf7d0;\n\t}\n\t.ln.del {\n\t\tbackground: #2a1215;\n\t\tcolor: #fecaca;\n\t}\n\t.no {\n\t\tflex: none;\n\t\twidth: 4ch;\n\t\tpadding-right: 1ch;\n\t\ttext-align: right;\n\t\tcolor: #57534e;\n\t\tuser-select: none;\n\t}\n\t.sign {\n\t\tflex: none;\n\t\twidth: 2ch;\n\t\ttext-align: center;\n\t\tuser-select: none;\n\t}\n\t.ln.add .sign {\n\t\tcolor: #4ade80;\n\t}\n\t.ln.del .sign {\n\t\tcolor: #f87171;\n\t}\n\t.code {\n\t\twhite-space: pre;\n\t\tpadding-right: 14px;\n\t}\n\t/* highlight.js tokens, muted so the add/del backgrounds still lead. */\n\t.code :global(.hljs-keyword),\n\t.code :global(.hljs-built_in),\n\t.code :global(.hljs-literal),\n\t.code :global(.hljs-selector-tag) {\n\t\tcolor: #c4b5fd;\n\t}\n\t.code :global(.hljs-string),\n\t.code :global(.hljs-regexp),\n\t.code :global(.hljs-attr),\n\t.code :global(.hljs-selector-attr) {\n\t\tcolor: #fcd34d;\n\t}\n\t.code :global(.hljs-number),\n\t.code :global(.hljs-symbol) {\n\t\tcolor: #fdba74;\n\t}\n\t.code :global(.hljs-comment),\n\t.code :global(.hljs-meta) {\n\t\tcolor: #78716c;\n\t\tfont-style: italic;\n\t}\n\t.code :global(.hljs-title),\n\t.code :global(.hljs-function),\n\t.code :global(.hljs-section) {\n\t\tcolor: #93c5fd;\n\t}\n\t.code :global(.hljs-type),\n\t.code :global(.hljs-class),\n\t.code :global(.hljs-name),\n\t.code :global(.hljs-selector-class) {\n\t\tcolor: #5eead4;\n\t}\n\t.code :global(.hljs-variable),\n\t.code :global(.hljs-template-variable),\n\t.code :global(.hljs-property) {\n\t\tcolor: #f9a8d4;\n\t}\n\t.foot {\n\t\tflex: none;\n\t\tpadding: 8px 14px;\n\t\tborder-top: 1px solid #222;\n\t\tfont-size: 11.5px;\n\t\tcolor: #78716c;\n\t}\n\tkbd {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 10.5px;\n\t\tpadding: 0 4px;\n\t\tborder-radius: 4px;\n\t\tbackground: #1f1f1f;\n\t\tcolor: #a8a29e;\n\t}\n\n\t/* Too narrow for both: the list, or the picked file's diff with a way back. */\n\t@container (max-width: 38rem) {\n\t\tnav {\n\t\t\twidth: auto;\n\t\t\tflex: 1;\n\t\t\tborder-right: 0;\n\t\t}\n\t\t.diff {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.picked .diff {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.foot {\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* A finger needs room. */\n\t\t.file,\n\t\tnav :global(.more),\n\t\t.turns :global(.chip),\n\t\t.turn-note :global(.link) {\n\t\t\tmin-height: 44px;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.file,\n\t\tnav :global(.more),\n\t\t.turns :global(.chip),\n\t\t.turn-note :global(.link) {\n\t\t\tmin-height: 44px;\n\t\t}\n\t\t.seg :global([data-slot='toggle']) {\n\t\t\theight: 40px;\n\t\t}\n\t}\n</style>\n","export function cn(...classes) {\n return classes.filter(Boolean).join(' ');\n}\nexport const isBrowser = typeof document !== 'undefined';\n","import { isBrowser } from './internal/helpers.js';\nimport { sonnerContext } from './internal/ctx.js';\nimport { untrack } from 'svelte';\nlet toastsCounter = 0;\n// A toast keeps the id it was given, otherwise it gets the next one from the counter.\n// `custom` needs the same id `create` would pick, as it hands it to the component.\nfunction getToastId(data) {\n return typeof data?.id === 'number' || (typeof data?.id === 'string' && data.id.length > 0)\n ? data.id\n : toastsCounter++;\n}\nclass ToastState {\n toasts = $state([]);\n heights = $state([]);\n // Removals whose exit animation is running but whose entry hasn't been removed yet\n #pendingRemovals = new Map();\n #findToastIdx = (id) => {\n const idx = this.toasts.findIndex((toast) => toast.id === id);\n if (idx === -1)\n return null;\n return idx;\n };\n #findHeightIdx = (toastId) => this.heights.findIndex((height) => height.toastId === toastId);\n addToast = (data) => {\n if (!isBrowser)\n return;\n this.toasts.unshift(data);\n };\n updateToast = ({ id, data, type, message }) => {\n const toastIdx = this.toasts.findIndex((toast) => toast.id === id);\n const toastToUpdate = this.toasts[toastIdx];\n this.toasts[toastIdx] = {\n ...toastToUpdate,\n ...data,\n id,\n title: message,\n type,\n // A dismissal that hasn't been processed yet gets cancelled: the toast is\n // still on screen, so this is an update of it rather than a new toast.\n dismiss: false,\n delete: false,\n updated: true\n };\n };\n // Flags a toast that was dismissed from inside the Toast component (close button,\n // swipe, action/cancel click, auto-close) so `create` treats an id reuse as a new\n // toast instead of merging the old props into it.\n markDismissed = (id) => {\n const toastIdx = this.#findToastIdx(id);\n if (toastIdx === null)\n return;\n const toast = this.toasts[toastIdx];\n if (!toast)\n return;\n if (!toast.dismiss || !toast.delete) {\n this.toasts[toastIdx] = { ...toast, dismiss: true, delete: true };\n }\n };\n scheduleRemoval = (id, delay) => {\n this.cancelRemoval(id);\n this.#pendingRemovals.set(id, setTimeout(() => {\n this.#pendingRemovals.delete(id);\n this.remove(id);\n }, delay));\n };\n cancelRemoval = (id) => {\n const timeout = this.#pendingRemovals.get(id);\n if (timeout !== undefined) {\n clearTimeout(timeout);\n this.#pendingRemovals.delete(id);\n }\n };\n create = (data) => {\n const { message, ...rest } = data;\n const id = getToastId(data);\n // Support deprecated `dismissable` as a fallback for backwards compatibility\n const dismissible = data.dismissible !== undefined\n ? data.dismissible\n : data.dismissable !== undefined\n ? data.dismissable\n : true;\n const type = data.type === undefined ? 'default' : data.type;\n untrack(() => {\n // A removal that hasn't run yet gets cancelled: this create() supersedes it,\n // otherwise the old toast's unmount timeout would remove the new one.\n this.cancelRemoval(id);\n const alreadyExists = this.toasts.find((toast) => toast.id === id);\n if (alreadyExists?.dismiss || alreadyExists?.delete) {\n // The previous toast with this id was dismissed, so this is a brand new\n // toast. Drop the old one instead of merging into it, otherwise its\n // props (e.g. `action`) leak into the new one. `updated` makes the still\n // mounted component reset its auto-close timer: when the recreate happens\n // in the same tick as the dismissal, the keyed each reuses the component\n // before it ever processed the dismissal, so the old timer would\n // otherwise keep running.\n this.remove(id);\n this.addToast({\n ...rest,\n id,\n title: message,\n dismissible,\n type,\n updated: true\n });\n }\n else if (alreadyExists) {\n this.updateToast({ id, data, type, message, dismissible });\n }\n else {\n this.addToast({ ...rest, id, title: message, dismissible, type });\n }\n });\n return id;\n };\n dismiss = (id) => {\n untrack(() => {\n if (id === undefined) {\n // we're dismissing all the active toasts\n this.toasts = this.toasts.map((toast) => toast.dismiss ? toast : { ...toast, dismiss: true });\n return;\n }\n // we're dismissing a specific toast\n const toastIdx = this.toasts.findIndex((toast) => toast.id === id);\n if (this.toasts[toastIdx]) {\n this.toasts[toastIdx] = { ...this.toasts[toastIdx], dismiss: true };\n }\n });\n return id;\n };\n remove = (id) => {\n if (id === undefined) {\n // remove all toasts\n this.toasts = [];\n return;\n }\n // remove a specific toast\n const toastIdx = this.#findToastIdx(id);\n if (toastIdx === null)\n return;\n this.toasts.splice(toastIdx, 1);\n return id;\n };\n message = (message, data) => {\n return this.create({ ...data, type: 'default', message });\n };\n error = (message, data) => {\n return this.create({ ...data, type: 'error', message });\n };\n success = (message, data) => {\n return this.create({ ...data, type: 'success', message });\n };\n info = (message, data) => {\n return this.create({ ...data, type: 'info', message });\n };\n warning = (message, data) => {\n return this.create({ ...data, type: 'warning', message });\n };\n loading = (message, data) => {\n return this.create({ ...data, type: 'loading', message });\n };\n promise = (promise, data) => {\n if (!data) {\n // Nothing to show\n return;\n }\n let id = undefined;\n if (data.loading !== undefined) {\n id = this.create({\n ...data,\n promise,\n type: 'loading',\n message: typeof data.loading === 'string' ? data.loading : data.loading()\n });\n }\n const p = promise instanceof Promise ? promise : promise();\n let shouldDismiss = id !== undefined;\n p.then((response) => {\n if (typeof response === 'object' &&\n response &&\n 'ok' in response &&\n typeof response.ok === 'boolean' &&\n !response.ok) {\n shouldDismiss = false;\n const message = constructPromiseErrorMessage(response);\n this.create({ id, type: 'error', message });\n }\n else if (data.success !== undefined) {\n shouldDismiss = false;\n const message = typeof data.success === 'function' ? data.success(response) : data.success;\n this.create({ id, type: 'success', message });\n }\n })\n .catch((error) => {\n if (data.error !== undefined) {\n shouldDismiss = false;\n const message = typeof data.error === 'function' ? data.error(error) : data.error;\n this.create({ id, type: 'error', message });\n }\n })\n .finally(() => {\n if (shouldDismiss) {\n // Toast is still in load state (and will be indefinitely — dismiss it)\n this.dismiss(id);\n id = undefined;\n }\n data.finally?.();\n });\n return id;\n };\n custom = (component, data) => {\n const id = getToastId(data);\n this.create({ component, ...data, id });\n return id;\n };\n removeHeight = (id) => {\n this.heights = this.heights.filter((height) => height.toastId !== id);\n };\n setHeight = (data) => {\n // untrack: setHeight runs inside a $effect; a tracked read of this.heights\n // would re-trigger it on the write below (effect_update_depth_exceeded).\n untrack(() => {\n const heightIdx = this.#findHeightIdx(data.toastId);\n if (heightIdx !== -1) {\n this.heights[heightIdx] = data;\n return;\n }\n // The offset math and --front-toast-height assume heights share the\n // newest-first order of `toasts`, so insert at the matching position.\n // With batched mounts (several toasts created in one tick, or created\n // before the Toaster mounted) the components mount newest-first and a\n // plain unshift would reverse them.\n const order = new Map(this.toasts.map((toast, idx) => [toast.id, idx]));\n const toastOrder = order.get(data.toastId) ?? -1;\n const insertIdx = this.heights.findIndex((height) => (order.get(height.toastId) ?? Infinity) > toastOrder);\n if (insertIdx === -1) {\n this.heights.push(data);\n }\n else {\n this.heights.splice(insertIdx, 0, data);\n }\n });\n };\n reset = () => {\n this.toasts = [];\n this.heights = [];\n this.#pendingRemovals.forEach((timeout) => clearTimeout(timeout));\n this.#pendingRemovals.clear();\n };\n}\nfunction constructPromiseErrorMessage(response) {\n if (response && typeof response === 'object' && 'status' in response) {\n return `HTTP error! Status: ${response.status}`;\n }\n return `Error! ${response}`;\n}\nexport const toastState = new ToastState();\nfunction toastFunction(message, data) {\n return toastState.message(message, data);\n}\nexport class SonnerState {\n /**\n * A derived state of the toasts that are not dismissed.\n */\n #activeToasts = $derived(toastState.toasts.filter((toast) => !toast.dismiss));\n get toasts() {\n return this.#activeToasts;\n }\n}\n/**\n * A hook to get a reference to the sonner toast state.\n *\n * Returns a class instance a getter for the `toasts` array.\n *\n * @example\n * ```svelte\n * <script lang=\"ts\">\n * import { useSonner } from 'svelte-sonner';\n *\n * const sonner = useSonner();\n *\n * // Reactive access to the toasts\n * $effect(() => console.log(sonner.toasts))\n * </script>\n * ```\n */\nexport function useSonner() {\n return sonnerContext.get();\n}\nconst basicToast = toastFunction;\nexport const toast = Object.assign(basicToast, {\n success: toastState.success,\n info: toastState.info,\n warning: toastState.warning,\n error: toastState.error,\n custom: toastState.custom,\n message: toastState.message,\n promise: toastState.promise,\n dismiss: toastState.dismiss,\n loading: toastState.loading,\n getActiveToasts: () => {\n return toastState.toasts.filter((toast) => !toast.dismiss);\n }\n});\n","/**\n * Syntax colouring for the Files pane, loaded the first time a file is shown\n * so the session page does not carry Shiki until the pane is opened. The\n * fine-grained build: Shiki's core, its JavaScript regex engine (no WASM),\n * one theme, and a grammar only when a file of that language is opened.\n * Anything else is drawn plain.\n */\nimport type { HighlighterCore, LanguageRegistration, ThemedToken } from 'shiki/core';\n\ntype Grammar = () => Promise<{ default: LanguageRegistration[] }>;\n\nconst GRAMMARS: Record<string, Grammar> = {\n\ttypescript: () => import('shiki/langs/typescript.mjs'),\n\ttsx: () => import('shiki/langs/tsx.mjs'),\n\tjavascript: () => import('shiki/langs/javascript.mjs'),\n\tjsx: () => import('shiki/langs/jsx.mjs'),\n\tsvelte: () => import('shiki/langs/svelte.mjs'),\n\thtml: () => import('shiki/langs/html.mjs'),\n\txml: () => import('shiki/langs/xml.mjs'),\n\tcss: () => import('shiki/langs/css.mjs'),\n\tscss: () => import('shiki/langs/scss.mjs'),\n\tjson: () => import('shiki/langs/json.mjs'),\n\tjsonc: () => import('shiki/langs/jsonc.mjs'),\n\tmarkdown: () => import('shiki/langs/markdown.mjs'),\n\tpython: () => import('shiki/langs/python.mjs'),\n\tshellscript: () => import('shiki/langs/shellscript.mjs'),\n\tyaml: () => import('shiki/langs/yaml.mjs'),\n\ttoml: () => import('shiki/langs/toml.mjs'),\n\trust: () => import('shiki/langs/rust.mjs'),\n\tgo: () => import('shiki/langs/go.mjs'),\n\tsql: () => import('shiki/langs/sql.mjs'),\n\tdiff: () => import('shiki/langs/diff.mjs'),\n\tdocker: () => import('shiki/langs/docker.mjs'),\n\tmake: () => import('shiki/langs/make.mjs')\n};\n\nconst THEME = 'github-dark-default';\n\n/** Text longer than this is drawn plain: tokenizing it would stall the page. */\nconst HIGHLIGHT_LIMIT_CHARS = 400_000;\n\nlet core: Promise<HighlighterCore> | null = null;\n\nfunction highlighter(): Promise<HighlighterCore> {\n\treturn (core ??= (async () => {\n\t\tconst [{ createHighlighterCore }, { createJavaScriptRegexEngine }, theme] = await Promise.all([\n\t\t\timport('shiki/core'),\n\t\t\timport('shiki/engine/javascript'),\n\t\t\timport('shiki/themes/github-dark-default.mjs')\n\t\t]);\n\t\treturn createHighlighterCore({ themes: [theme.default], langs: [], engine: createJavaScriptRegexEngine() });\n\t})());\n}\n\n/**\n * Each line's tokens with their colours, or null when the language is not one\n * this loads or the text is too long (the caller then draws it plain).\n */\nexport async function highlightFile(text: string, language: string | null): Promise<ThemedToken[][] | null> {\n\tif (!language || !GRAMMARS[language] || text.length > HIGHLIGHT_LIMIT_CHARS) return null;\n\tconst shiki = await highlighter();\n\tif (!shiki.getLoadedLanguages().includes(language)) await shiki.loadLanguage((await GRAMMARS[language]()).default);\n\treturn shiki.codeToTokens(text, { lang: language, theme: THEME }).tokens;\n}\n","import { createPersisted } from './persisted';\n\n/** What the Files pane keeps per session between visits; the URL holds the open file. */\nexport interface FilesPrefs {\n\t/** Directories open in the tree, relative to the project root. */\n\texpanded?: string[];\n\t/** The file last open, which the pane reopens when the URL names none. */\n\tfile?: string;\n\t/** List the entries git ignores. */\n\tshowIgnored?: boolean;\n}\n\nconst persisted = createPersisted<Record<string, FilesPrefs>>('claude-mux-files-pane', {});\n\n/** The Files pane's per-session preferences, keyed by session id: a pane target is reused by later sessions. */\nclass FilesPaneStore {\n\tprivate state = $state<Record<string, FilesPrefs>>(persisted.load());\n\n\tget(id: string | null): FilesPrefs {\n\t\treturn (id && this.state[id]) || {};\n\t}\n\n\tupdate(id: string | null, patch: FilesPrefs): void {\n\t\tif (!id) return;\n\t\tthis.state[id] = { ...this.state[id], ...patch };\n\t\tpersisted.save(this.state);\n\t}\n}\n\nexport const filesPaneStore = new FilesPaneStore();\n","<script lang=\"ts\">\n\t/**\n\t * The session's project, read-only: a tree on the left, the open file on\n\t * the right. With no file open the tree takes the whole pane; once one is,\n\t * the tree narrows to a column docked inside the viewer, and on a narrow\n\t * pane the two take turns.\n\t *\n\t * The URL holds the file (`file`, relative to the project root) and the\n\t * line to show (`line`). Which directories are open, the last file, and\n\t * whether ignored entries are listed persist per session. Shiki loads the\n\t * first time a file is drawn.\n\t */\n\timport { untrack } from 'svelte';\n\timport { toast } from 'svelte-sonner';\n\timport type { ThemedToken } from 'shiki/core';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Input } from '$lib/components/ui/input';\n\timport {\n\t\tancestors,\n\t\tfuzzyFilter,\n\t\tisMarkdown,\n\t\tshikiLanguage,\n\t\ttype DirListing,\n\t\ttype FileEntry,\n\t\ttype FileRead\n\t} from '$lib/side-panel/files';\n\timport { displayPath } from '$lib/side-panel/changes';\n\timport { highlightFile } from '$lib/side-panel/shiki';\n\timport { renderMarkdown } from '$lib/markdown';\n\timport { filesPaneStore } from '$lib/stores/filesPane.svelte';\n\n\tlet { session, params, setParams, setActions, mention, active }: PaneBodyProps = $props();\n\n\tconst sessionId = $derived(session?.id ?? null);\n\tconst api = $derived(sessionId ? `/api/sessions/${encodeURIComponent(sessionId)}/files` : null);\n\tconst prefs = $derived(filesPaneStore.get(sessionId));\n\tconst showIgnored = $derived(prefs.showIgnored === true);\n\t// Only paths inside the root belong here; an older build could save others.\n\tconst expanded = $derived(new Set((prefs.expanded ?? []).filter((d) => d && !d.startsWith('/'))));\n\n\t// ── the tree ─────────────────────────────────────────────────────────\n\n\ttype DirState = DirListing | { error: string } | 'loading';\n\tlet dirs = $state<Record<string, DirState>>({});\n\t/** Bumped by a reload or the ignored toggle, so answers for the old tree are dropped. */\n\tlet treeEpoch = 0;\n\n\tasync function loadDir(dir: string) {\n\t\tif (!api) return;\n\t\tconst epoch = treeEpoch;\n\t\tdirs[dir] = 'loading';\n\t\tconst q = new URLSearchParams({ dir });\n\t\tif (showIgnored) q.set('ignored', '1');\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/tree?${q}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (epoch !== treeEpoch) return;\n\t\t\tdirs[dir] = res.ok ? (body as DirListing) : { error: body.error ?? `HTTP ${res.status}` };\n\t\t} catch (err) {\n\t\t\tif (epoch === treeEpoch) dirs[dir] = { error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\tfunction reloadTree() {\n\t\ttreeEpoch++;\n\t\tdirs = {};\n\t\tvoid loadDir('');\n\t\tfor (const dir of expanded) void loadDir(dir);\n\t}\n\n\tconst rootListing = $derived.by(() => {\n\t\tconst r = dirs[''];\n\t\treturn r && r !== 'loading' && 'entries' in r ? r : null;\n\t});\n\tconst root = $derived(rootListing?.root ?? null);\n\tconst repo = $derived(rootListing?.repo ?? false);\n\n\t/** What the tree was last read for; showing the pane again reuses it, Reload reads it afresh. */\n\tlet readFor: string | null = null;\n\t$effect(() => {\n\t\tconst key = `${api}\\0${showIgnored}`;\n\t\tif (!active || !api || key === readFor) return;\n\t\treadFor = key;\n\t\tuntrack(reloadTree);\n\t});\n\n\tfunction setExpanded(dir: string, open: boolean) {\n\t\tconst next = new Set(expanded);\n\t\tif (open) next.add(dir);\n\t\telse next.delete(dir);\n\t\tfilesPaneStore.update(sessionId, { expanded: [...next] });\n\t\tif (open && !dirs[dir]) void loadDir(dir);\n\t}\n\n\tfunction toggleIgnored() {\n\t\tfilesPaneStore.update(sessionId, { showIgnored: !showIgnored });\n\t}\n\n\t// ── the open file ────────────────────────────────────────────────────\n\n\t/** The file the URL names, made relative when it is an absolute path inside the root. */\n\tconst wantedFile = $derived(params.file ? displayPath(params.file, root) : null);\n\tconst wantedLine = $derived.by(() => {\n\t\tconst n = Number(params.line);\n\t\treturn Number.isInteger(n) && n > 0 ? n : null;\n\t});\n\n\t// No file in the URL: reopen the one last open here.\n\tlet restored = false;\n\t$effect(() => {\n\t\tif (!active || restored) return;\n\t\trestored = true;\n\t\tconst last = untrack(() => prefs.file);\n\t\tif (!params.file && last) setParams({ file: last });\n\t});\n\n\ttype Shown = { path: string; read: FileRead } | { path: string; error: string; binary?: boolean };\n\tlet shown = $state<Shown | null>(null);\n\tlet fileSeq = 0;\n\n\tasync function loadFile(path: string) {\n\t\tif (!api) return;\n\t\tconst mine = ++fileSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/read?${new URLSearchParams({ path })}`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== fileSeq) return;\n\t\t\tif (!res.ok) {\n\t\t\t\tshown = { path, error: body.error ?? `HTTP ${res.status}`, binary: body.binary === true };\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst read = body as FileRead;\n\t\t\tshown = { path, read };\n\t\t\t// An absolute or roundabout spelling settles on the path inside the root.\n\t\t\tif (read.path !== path) {\n\t\t\t\tfileReadFor = `${read.path}\\0${params.line ?? ''}`;\n\t\t\t\tsetParams({ file: read.path });\n\t\t\t}\n\t\t\trevealInTree(read.path);\n\t\t\tfilesPaneStore.update(sessionId, { file: read.path });\n\t\t} catch (err) {\n\t\t\tif (mine === fileSeq) shown = { path, error: err instanceof Error ? err.message : String(err) };\n\t\t}\n\t}\n\n\t/**\n\t * What the file was last read for: its path and the line asked. A link\n\t * that names the open file again (after Claude edited it, say) reads it\n\t * afresh rather than scrolling stale text; showing the pane again does not.\n\t */\n\tlet fileReadFor: string | null = null;\n\t$effect(() => {\n\t\tconst path = wantedFile;\n\t\tif (!path || !active) return;\n\t\tconst key = `${path}\\0${params.line ?? ''}`;\n\t\tif (key === fileReadFor) return;\n\t\tfileReadFor = key;\n\t\tuntrack(() => void loadFile(path));\n\t});\n\n\t/** Open the directories that hold `path` (inside the root), so the tree shows where it is. */\n\tfunction revealInTree(path: string) {\n\t\tconst missing = ancestors(path).filter((d) => !expanded.has(d));\n\t\tif (missing.length === 0) return;\n\t\tfilesPaneStore.update(sessionId, { expanded: [...expanded, ...missing] });\n\t\tfor (const d of missing) if (!dirs[d]) void loadDir(d);\n\t}\n\n\tconst current = $derived(\n\t\tshown && wantedFile && (shown.path === wantedFile || ('read' in shown && shown.read.path === wantedFile))\n\t\t\t? shown\n\t\t\t: null\n\t);\n\tconst read = $derived(current && 'read' in current ? current.read : null);\n\tconst openPath = $derived(read?.path ?? wantedFile);\n\n\tfunction openFile(path: string, line?: number) {\n\t\tsetParams({ file: path, line: line ? String(line) : null }, { push: true });\n\t}\n\n\tfunction closeFile() {\n\t\tfilesPaneStore.update(sessionId, { file: undefined });\n\t\tsetParams({ file: null, line: null });\n\t}\n\n\t/** Markdown opens rendered; this flips the open file to its source. */\n\tlet mdSource = $state(false);\n\tconst markdown = $derived(read?.kind === 'text' && isMarkdown(read.path));\n\tconst rendered = $derived(markdown && !mdSource && wantedLine === null);\n\n\tconst lines = $derived(read?.kind === 'text' ? read.text.replace(/\\n$/, '').split('\\n') : []);\n\tlet tokens = $state<ThemedToken[][] | null>(null);\n\t$effect(() => {\n\t\ttokens = null;\n\t\tif (read?.kind !== 'text' || rendered) return;\n\t\tconst { text, path } = read;\n\t\tlet stale = false;\n\t\tvoid highlightFile(text, shikiLanguage(path)).then((t) => {\n\t\t\tif (!stale) tokens = t;\n\t\t});\n\t\treturn () => (stale = true);\n\t});\n\n\t/** Lines are drawn in blocks the browser may skip laying out while off screen. */\n\tconst CHUNK = 200;\n\tconst chunks = $derived(\n\t\tArray.from({ length: Math.ceil(lines.length / CHUNK) }, (_, i) => i * CHUNK)\n\t);\n\n\tlet codeEl = $state<HTMLElement | null>(null);\n\t$effect(() => {\n\t\tconst line = wantedLine;\n\t\tif (!line || !codeEl || lines.length === 0) return;\n\t\tvoid tokens;\n\t\trequestAnimationFrame(() =>\n\t\t\tcodeEl?.querySelector(`[data-line=\"${line}\"]`)?.scrollIntoView({ block: 'center' })\n\t\t);\n\t});\n\n\tfunction pickLine(n: number) {\n\t\tsetParams({ line: wantedLine === n ? null : String(n) });\n\t}\n\n\tasync function copyPath() {\n\t\tif (!openPath) return;\n\t\tconst text = wantedLine ? `${openPath}:${wantedLine}` : openPath;\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\ttoast.success('Path copied', { description: text });\n\t\t} catch {\n\t\t\ttoast.error('Could not copy the path');\n\t\t}\n\t}\n\n\t/**\n\t * Claude Code reads an `@path` from the session's cwd, which may sit below\n\t * the root this pane lists from: the path is made relative to the cwd, or\n\t * left absolute when the cwd is not inside the root.\n\t */\n\tfunction mentionOpen() {\n\t\tif (!openPath || !root) return;\n\t\tconst abs = `${root}/${openPath}`;\n\t\tconst cwd = session?.cwd ?? root;\n\t\tmention(`@${cwd === root ? openPath : displayPath(abs, cwd)}`);\n\t}\n\n\tfunction formatSize(bytes: number): string {\n\t\tif (bytes < 1024) return `${bytes} B`;\n\t\tif (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n\t\treturn `${(bytes / 1024 / 1024).toFixed(1)} MB`;\n\t}\n\n\t// ── quick open ───────────────────────────────────────────────────────\n\n\tlet query = $state('');\n\tlet allFiles = $state<string[] | null>(null);\n\tlet listError = $state<string | null>(null);\n\tlet listing = false;\n\tlet picked = $state(0);\n\n\tasync function loadAll() {\n\t\tif (allFiles || listing || !api) return;\n\t\tlisting = true;\n\t\tlistError = null;\n\t\ttry {\n\t\t\tconst res = await fetch(`${api}/list`);\n\t\t\tconst body = await res.json();\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tallFiles = (body as { files: string[] }).files;\n\t\t} catch (err) {\n\t\t\tlistError = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tlisting = false;\n\t\t}\n\t}\n\n\tconst results = $derived(query.trim() && allFiles ? fuzzyFilter(query, allFiles) : []);\n\t$effect(() => {\n\t\tvoid results;\n\t\tpicked = 0;\n\t});\n\n\tfunction openResult(path: string) {\n\t\tquery = '';\n\t\topenFile(path);\n\t}\n\n\tfunction onQueryKey(e: KeyboardEvent) {\n\t\tif (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n\t\t\te.preventDefault();\n\t\t\tconst n = results.length;\n\t\t\tif (n) picked = (picked + (e.key === 'ArrowDown' ? 1 : n - 1)) % n;\n\t\t\tdocument.querySelector(`[data-result=\"${picked}\"]`)?.scrollIntoView({ block: 'nearest' });\n\t\t} else if (e.key === 'Enter' && results[picked]) {\n\t\t\te.preventDefault();\n\t\t\topenResult(results[picked]);\n\t\t} else if (e.key === 'Escape' && query) {\n\t\t\te.preventDefault();\n\t\t\te.stopPropagation();\n\t\t\tquery = '';\n\t\t}\n\t}\n\n\t// ── header actions ───────────────────────────────────────────────────\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t...(repo\n\t\t\t\t? [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ticon: showIgnored ? 'mdi:eye-outline' : 'mdi:eye-off-outline',\n\t\t\t\t\t\t\tlabel: showIgnored ? 'Hide ignored files' : 'Show ignored files',\n\t\t\t\t\t\t\tpressed: showIgnored,\n\t\t\t\t\t\t\trun: toggleIgnored\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t: []),\n\t\t\t{\n\t\t\t\ticon: 'mdi:refresh',\n\t\t\t\tlabel: 'Reload',\n\t\t\t\tdisabled: !sessionId,\n\t\t\t\trun: () => {\n\t\t\t\t\tallFiles = null;\n\t\t\t\t\tif (query.trim()) void loadAll();\n\t\t\t\t\treloadTree();\n\t\t\t\t\tif (wantedFile) void loadFile(wantedFile);\n\t\t\t\t}\n\t\t\t}\n\t\t]);\n\t});\n</script>\n\n{#snippet tree(dir: string, depth: number)}\n\t{@const d = dirs[dir]}\n\t{#if d === 'loading' || d === undefined}\n\t\t<div class=\"note\" style:--depth={depth}>Loading…</div>\n\t{:else if 'error' in d}\n\t\t<div class=\"note err\" style:--depth={depth}>{d.error}</div>\n\t{:else}\n\t\t{#each d.entries as entry (entry.path)}\n\t\t\t{@render node(entry, depth)}\n\t\t{/each}\n\t\t{#if d.entries.length === 0}\n\t\t\t<div class=\"note\" style:--depth={depth}>{d.hidden ? `${d.hidden} ignored` : 'Empty'}</div>\n\t\t{/if}\n\t{/if}\n{/snippet}\n\n{#snippet node(entry: FileEntry, depth: number)}\n\t{#if entry.type === 'dir'}\n\t\t{@const open = expanded.has(entry.path)}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"item dir\"\n\t\t\tclass:ignored={entry.ignored}\n\t\t\tstyle:--depth={depth}\n\t\t\taria-expanded={open}\n\t\t\ttitle={entry.path}\n\t\t\tonclick={() => setExpanded(entry.path, !open)}\n\t\t>\n\t\t\t<iconify-icon class=\"chev\" class:open icon=\"mdi:chevron-right\"></iconify-icon>\n\t\t\t<iconify-icon class=\"ico\" icon={open ? 'mdi:folder-open-outline' : 'mdi:folder-outline'}></iconify-icon>\n\t\t\t<span class=\"name\">{entry.name}</span>\n\t\t\t{#if entry.link}<iconify-icon class=\"link\" icon=\"mdi:link-variant\"></iconify-icon>{/if}\n\t\t</button>\n\t\t{#if open}{@render tree(entry.path, depth + 1)}{/if}\n\t{:else}\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclass=\"item file\"\n\t\t\tclass:ignored={entry.ignored}\n\t\t\tclass:on={openPath === entry.path}\n\t\t\taria-current={openPath === entry.path ? 'true' : undefined}\n\t\t\tstyle:--depth={depth}\n\t\t\ttitle={entry.path}\n\t\t\tonclick={() => openFile(entry.path)}\n\t\t>\n\t\t\t<span class=\"chev\"></span>\n\t\t\t<iconify-icon class=\"ico\" icon=\"mdi:file-outline\"></iconify-icon>\n\t\t\t<span class=\"name\">{entry.name}</span>\n\t\t\t{#if entry.link}<iconify-icon class=\"link\" icon=\"mdi:link-variant\"></iconify-icon>{/if}\n\t\t</button>\n\t{/if}\n{/snippet}\n\n<div class=\"files\" class:picked={!!wantedFile}>\n\t<nav aria-label=\"Project files\">\n\t\t{#if repo}\n\t\t\t<div class=\"search\">\n\t\t\t\t<iconify-icon icon=\"mdi:magnify\"></iconify-icon>\n\t\t\t\t<Input\n\t\t\t\t\tbind:value={query}\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tplaceholder=\"Go to file…\"\n\t\t\t\t\taria-label=\"Go to file\"\n\t\t\t\t\tautocomplete=\"off\"\n\t\t\t\t\tspellcheck={false}\n\t\t\t\t\tonfocus={loadAll}\n\t\t\t\t\tonkeydown={onQueryKey}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t{/if}\n\t\t<div class=\"list\">\n\t\t\t{#if query.trim()}\n\t\t\t\t{#if listError}\n\t\t\t\t\t<div class=\"note err\">{listError}</div>\n\t\t\t\t{:else if !allFiles}\n\t\t\t\t\t<div class=\"note\">Loading…</div>\n\t\t\t\t{:else if results.length === 0}\n\t\t\t\t\t<div class=\"note\">No file matches.</div>\n\t\t\t\t{:else}\n\t\t\t\t\t{#each results as path, i (path)}\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclass=\"item result\"\n\t\t\t\t\t\t\tclass:on={i === picked}\n\t\t\t\t\t\t\tdata-result={i}\n\t\t\t\t\t\t\ttitle={path}\n\t\t\t\t\t\t\tonclick={() => openResult(path)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"name\">{path.split('/').pop()}</span>\n\t\t\t\t\t\t\t<span class=\"dirname\"><bdi>{path.split('/').slice(0, -1).join('/')}</bdi></span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t{/each}\n\t\t\t\t{/if}\n\t\t\t{:else}\n\t\t\t\t{#if root}\n\t\t\t\t\t<div class=\"root\" title={root}>{root.split('/').pop() || root}</div>\n\t\t\t\t{/if}\n\t\t\t\t{@render tree('', 0)}\n\t\t\t\t{#if rootListing && !showIgnored && rootListing.hidden > 0}\n\t\t\t\t\t<button type=\"button\" class=\"more\" onclick={toggleIgnored}>\n\t\t\t\t\t\t+ {rootListing.hidden} ignored at the top level (show)\n\t\t\t\t\t</button>\n\t\t\t\t{/if}\n\t\t\t{/if}\n\t\t</div>\n\t</nav>\n\n\t{#if wantedFile}\n\t\t<section class=\"viewer\" aria-label=\"File\">\n\t\t\t<div class=\"vhead\">\n\t\t\t\t<button type=\"button\" class=\"icon back\" aria-label=\"Back to files\" onclick={closeFile}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:arrow-left\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<span class=\"path\" title={openPath}><bdi>{openPath}</bdi></span>\n\t\t\t\t{#if read}<span class=\"dim size\">{formatSize(read.size)}</span>{/if}\n\t\t\t\t{#if markdown}\n\t\t\t\t\t<div class=\"seg\" role=\"group\" aria-label=\"Markdown view\">\n\t\t\t\t\t\t<Toggle\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tbind:pressed={() => rendered, (on) => {\n\t\t\t\t\t\t\t\tif (on) {\n\t\t\t\t\t\t\t\t\tmdSource = false;\n\t\t\t\t\t\t\t\t\tsetParams({ line: null });\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}}>Preview</Toggle\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<Toggle size=\"sm\" bind:pressed={() => !rendered, (on) => on && (mdSource = true)}>Source</Toggle>\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t\t<button type=\"button\" class=\"icon\" title=\"Copy path\" aria-label=\"Copy path\" onclick={copyPath}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclass=\"icon\"\n\t\t\t\t\ttitle=\"Mention in composer\"\n\t\t\t\t\taria-label=\"Mention in composer\"\n\t\t\t\t\tonclick={mentionOpen}\n\t\t\t\t>\n\t\t\t\t\t<iconify-icon icon=\"mdi:at\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t\t<button type=\"button\" class=\"icon wide-only\" title=\"Close file\" aria-label=\"Close file\" onclick={closeFile}>\n\t\t\t\t\t<iconify-icon icon=\"mdi:close\"></iconify-icon>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t{#if read?.kind === 'text' && read.truncated}\n\t\t\t\t<div class=\"banner\">Truncated at 1 MB: showing the first {formatSize(read.shown)} of {formatSize(read.size)}.</div>\n\t\t\t{/if}\n\t\t\t{#if !current}\n\t\t\t\t<p class=\"msg\">Loading…</p>\n\t\t\t{:else if 'error' in current}\n\t\t\t\t<p class=\"msg\" class:err={!current.binary}>\n\t\t\t\t\t{current.binary ? 'Binary file; not shown.' : current.error}\n\t\t\t\t</p>\n\t\t\t{:else if read?.kind === 'image'}\n\t\t\t\t<div class=\"image\">\n\t\t\t\t\t<img src=\"{api}/read?{new URLSearchParams({ path: read.path, raw: '1' })}\" alt={read.path} />\n\t\t\t\t</div>\n\t\t\t{:else if rendered && read?.kind === 'text'}\n\t\t\t\t<!-- eslint-disable-next-line svelte/no-at-html-tags -- markdown output with raw HTML escaped -->\n\t\t\t\t<div class=\"md markdown\">{@html renderMarkdown(read.text)}</div>\n\t\t\t{:else if lines.length === 0}\n\t\t\t\t<p class=\"msg\">Empty file.</p>\n\t\t\t{:else}\n\t\t\t\t<div class=\"code\" bind:this={codeEl} style:--gutter=\"{String(lines.length).length + 1}ch\">\n\t\t\t\t\t{#each chunks as start (start)}\n\t\t\t\t\t\t<div class=\"chunk\" style:--rows={Math.min(CHUNK, lines.length - start)}>\n\t\t\t\t\t\t\t{#each lines.slice(start, start + CHUNK) as text, j (j)}\n\t\t\t\t\t\t\t\t{@const n = start + j + 1}\n\t\t\t\t\t\t\t\t<div class=\"ln\" class:hl={wantedLine === n} data-line={n}>\n\t\t\t\t\t\t\t\t\t<button type=\"button\" class=\"no\" tabindex=\"-1\" onclick={() => pickLine(n)}>{n}</button>\n\t\t\t\t\t\t\t\t\t<span class=\"src\"\n\t\t\t\t\t\t\t\t\t\t>{#if tokens?.[n - 1]}{#each tokens[n - 1] as t, k (k)}<span style:color={t.color}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>{t.content}</span\n\t\t\t\t\t\t\t\t\t\t\t\t>{/each}{:else}{text}{/if}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{/each}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t{/each}\n\t\t\t\t</div>\n\t\t\t{/if}\n\t\t</section>\n\t{/if}\n</div>\n\n<style>\n\t.files {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tcontainer-type: inline-size;\n\t\tfont-size: 13px;\n\t\tcolor: #d6d3d1;\n\t}\n\tnav {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.picked nav {\n\t\tflex: none;\n\t\twidth: min(22rem, 46%);\n\t\tborder-right: 1px solid #222;\n\t}\n\t.search {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 8px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tcolor: #78716c;\n\t\tflex: none;\n\t}\n\t.search :global(input) {\n\t\theight: 32px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tbackground: #1a1a1a;\n\t\tborder-color: #2a2a2a;\n\t}\n\t.list {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\toverflow: auto;\n\t\tpadding: 6px 6px 16px;\n\t}\n\t.root {\n\t\tpadding: 4px 8px 6px;\n\t\tcolor: #78716c;\n\t\tfont-size: 11px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.item {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\twidth: 100%;\n\t\tmin-height: 28px;\n\t\tpadding: 0 8px 0 calc(4px + var(--depth, 0) * 14px);\n\t\tborder: 0;\n\t\tborder-radius: 6px;\n\t\tbackground: transparent;\n\t\tcolor: #d6d3d1;\n\t\tfont: inherit;\n\t\ttext-align: left;\n\t\tcursor: pointer;\n\t}\n\t.item:hover {\n\t\tbackground: #1a1a1a;\n\t}\n\t.item.on {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.item.ignored {\n\t\tcolor: #6b6560;\n\t}\n\t.chev {\n\t\tflex: none;\n\t\twidth: 14px;\n\t\tcolor: #78716c;\n\t\ttransition: transform 0.12s;\n\t}\n\t.chev.open {\n\t\ttransform: rotate(90deg);\n\t}\n\t.ico {\n\t\tflex: none;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 14px;\n\t}\n\t.dir .ico {\n\t\tcolor: #93c5fd;\n\t}\n\t.ignored .ico {\n\t\tcolor: inherit;\n\t\topacity: 0.6;\n\t}\n\t.link {\n\t\tflex: none;\n\t\tcolor: #78716c;\n\t\tfont-size: 12px;\n\t}\n\t.name {\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t}\n\t.result {\n\t\tgap: 10px;\n\t\tpadding-left: 8px;\n\t}\n\t.result .name {\n\t\tflex: none;\n\t\tmax-width: 60%;\n\t}\n\t.dirname {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t\tcolor: #78716c;\n\t}\n\t.note {\n\t\tpadding: 5px 8px 5px calc(26px + var(--depth, 0) * 14px);\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n\t.more {\n\t\tborder: 0;\n\t\tbackground: none;\n\t\tpadding: 9px 8px 4px;\n\t\tmin-height: 32px;\n\t\tcolor: #78716c;\n\t\tfont: inherit;\n\t\tfont-size: 11.5px;\n\t\tcursor: pointer;\n\t\ttext-align: left;\n\t}\n\t.more:hover {\n\t\tcolor: #d6d3d1;\n\t}\n\t.viewer {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n\t.vhead {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmin-height: 44px;\n\t\tpadding: 6px 8px 6px 14px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.path {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdirection: rtl;\n\t\ttext-align: left;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tcolor: #e7e5e4;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.size {\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t}\n\t.icon {\n\t\tflex: none;\n\t\twidth: 30px;\n\t\theight: 30px;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tborder: 0;\n\t\tborder-radius: 7px;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-size: 15px;\n\t\tcursor: pointer;\n\t}\n\t.icon:hover {\n\t\tbackground: #1f1f1f;\n\t\tcolor: #f5f5f4;\n\t}\n\t.back {\n\t\tdisplay: none;\n\t\tmargin-left: -8px;\n\t}\n\t.seg {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 2px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 26px;\n\t\tfont-size: 12px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.banner {\n\t\tflex: none;\n\t\tpadding: 6px 14px;\n\t\tbackground: #2a2110;\n\t\tcolor: #fcd34d;\n\t\tfont-size: 12px;\n\t\tborder-bottom: 1px solid #3a2e14;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t\tcolor: #78716c;\n\t}\n\t.msg.err {\n\t\tcolor: #f87171;\n\t}\n\t.image {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 16px;\n\t\tbackground:\n\t\t\trepeating-conic-gradient(#161616 0 25%, #1c1c1c 0 50%) 0 0 / 16px 16px;\n\t}\n\t.image img {\n\t\tmax-width: 100%;\n\t\theight: auto;\n\t\tdisplay: block;\n\t\tmargin: 0 auto;\n\t}\n\t.md {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 16px 20px 32px;\n\t\tfont-size: 14px;\n\t\tline-height: 1.6;\n\t}\n\t/* A document, not a reply: its headings stand out more than the transcript's. */\n\t.md :global(h1) {\n\t\tfont-size: 1.45em;\n\t\tmargin-top: 4px;\n\t}\n\t.md :global(h2) {\n\t\tfont-size: 1.2em;\n\t\tmargin-top: 20px;\n\t}\n\t.md :global(h3) {\n\t\tfont-size: 1.05em;\n\t}\n\t.code {\n\t\tflex: 1;\n\t\toverflow: auto;\n\t\tpadding: 6px 0 24px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t\tline-height: 1.65;\n\t}\n\t.chunk {\n\t\twidth: max-content;\n\t\tmin-width: 100%;\n\t\tcontent-visibility: auto;\n\t\tcontain-intrinsic-size: auto calc(var(--rows) * 1.65em);\n\t}\n\t.ln {\n\t\tdisplay: flex;\n\t\tcolor: #c9d1d9;\n\t}\n\t.ln.hl {\n\t\tbackground: #2a2a1a;\n\t}\n\t.no {\n\t\tflex: none;\n\t\twidth: calc(var(--gutter) + 1ch);\n\t\tpadding: 0 1.5ch 0 0;\n\t\tborder: 0;\n\t\tbackground: none;\n\t\ttext-align: right;\n\t\tcolor: #57534e;\n\t\tfont: inherit;\n\t\tcursor: pointer;\n\t\tuser-select: none;\n\t}\n\t.no:hover,\n\t.hl .no {\n\t\tcolor: #d6d3d1;\n\t}\n\t.src {\n\t\twhite-space: pre;\n\t\tpadding-right: 14px;\n\t}\n\n\t/* Too narrow for both: the tree, or the open file with a way back. */\n\t@container (max-width: 38rem) {\n\t\t.picked nav {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.back {\n\t\t\tdisplay: inline-flex;\n\t\t}\n\t\t.wide-only {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n\t@media (pointer: coarse) {\n\t\t.item,\n\t\t.more {\n\t\t\tmin-height: 40px;\n\t\t}\n\t\t.icon {\n\t\t\twidth: 40px;\n\t\t\theight: 40px;\n\t\t}\n\t}\n</style>\n","/** A hostname or bound address that only this machine can reach. */\nexport function isLoopback(host: string): boolean {\n\tconst h = host.replace(/^\\[|\\]$/g, '').toLowerCase();\n\treturn h === 'localhost' || h.endsWith('.localhost') || h === '::1' || /^(::ffff:)?127\\./.test(h);\n}\n","/**\n * The Web pane's logic, apart from the component: which URL a choice names,\n * and how a URL can be shown from the device the page is open on.\n *\n * claude-mux is usually reached over HTTPS through tailscale serve, so an\n * `http://` page cannot be framed (mixed content), and a `localhost` URL means\n * the phone itself when opened on the phone. A dev server on this machine is\n * therefore framed through its tailscale serve HTTPS mapping when it has one,\n * and otherwise offered in a new tab with the command that would map it.\n */\nimport { isLoopback } from '$shared/utils/loopback.js';\nimport type { DevServer, WebInfo } from '$shared/server/web-preview.js';\n\nexport type { DevServer, FrameCheck, WebInfo } from '$shared/server/web-preview.js';\n\n/** The named choices; anything else in `?url=` is a URL typed by hand. */\nexport type WebChoice = 'prod' | 'dev';\n\n/**\n * The URL a choice names. `dev` falls back to the first dev server found\n * running in the project when `.claude-mux.json` names none.\n */\nexport function choiceUrl(choice: string, info: Pick<WebInfo, 'urls' | 'detected'> | null): string | null {\n\tif (choice === 'prod') return info?.urls.prod ?? null;\n\tif (choice === 'dev') return info?.urls.dev ?? info?.detected[0]?.url ?? null;\n\treturn choice;\n}\n\n/** A URL typed into the bar, given a scheme when it has none. Null when it will not parse. */\nexport function normalizeTyped(text: string): string | null {\n\tconst t = text.trim();\n\tif (!t) return null;\n\tconst hasScheme = /^[a-z][a-z0-9+.-]*:\\/\\//i.test(t);\n\ttry {\n\t\tlet u = new URL(hasScheme ? t : `http://${t}`);\n\t\t// Without a scheme, only this machine is assumed to speak plain HTTP.\n\t\tif (!hasScheme && !pointsHere(u)) u = new URL(`https://${t}`);\n\t\treturn u.protocol === 'http:' || u.protocol === 'https:' ? u.href : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\n/** A URL that points at the machine claude-mux runs on. */\nfunction pointsHere(u: URL): boolean {\n\treturn isLoopback(u.hostname) || u.hostname === '0.0.0.0';\n}\n\nfunction portOf(u: URL): number {\n\treturn Number(u.port || (u.protocol === 'https:' ? 443 : 80));\n}\n\nexport type Embed =\n\t| {\n\t\t\tkind: 'frame';\n\t\t\tsrc: string;\n\t }\n\t| {\n\t\t\tkind: 'card';\n\t\t\t/** Why it cannot be framed from here. */\n\t\t\treason: string;\n\t\t\t/** The URL that opens it in a tab of its own. */\n\t\t\topen: string;\n\t\t\t/** The command that would make it embeddable. */\n\t\t\tcommand?: string;\n\t };\n\nexport interface EmbedContext {\n\t/** Where this page is open: `location`. */\n\tpage: { protocol: string; hostname: string };\n\tserves: WebInfo['serves'];\n\tdetected: DevServer[];\n}\n\n/** How `target` can be shown in the pane from the page in `ctx`. */\nexport function resolveEmbed(target: string, ctx: EmbedContext): Embed {\n\tconst u = new URL(target);\n\tconst pageSecure = ctx.page.protocol === 'https:';\n\tif (!pointsHere(u)) {\n\t\tif (pageSecure && u.protocol === 'http:') {\n\t\t\treturn {\n\t\t\t\tkind: 'card',\n\t\t\t\treason: 'This page is served over HTTPS, and browsers will not frame a plain-HTTP page inside it.',\n\t\t\t\topen: u.href\n\t\t\t};\n\t\t}\n\t\treturn { kind: 'frame', src: u.href };\n\t}\n\n\tconst port = portOf(u);\n\tconst served = ctx.serves[port];\n\tif (served) {\n\t\treturn { kind: 'frame', src: `${served}${u.pathname}${u.search}${u.hash}` };\n\t}\n\t// Opened on the machine itself, localhost is the same machine, and browsers treat it as secure.\n\tif (isLoopback(ctx.page.hostname)) {\n\t\treturn { kind: 'frame', src: u.href.replace('//0.0.0.0', '//localhost') };\n\t}\n\n\t// Whatever name the device reached claude-mux by reaches this machine's other ports too.\n\tconst remote = new URL(u.href);\n\tremote.hostname = ctx.page.hostname;\n\tconst card = { kind: 'card' as const, open: remote.href, command: `tailscale serve --bg --https=${port} http://localhost:${port}` };\n\tif (ctx.detected.find((d) => d.port === port)?.loopbackOnly) {\n\t\treturn {\n\t\t\t...card,\n\t\t\treason: `The server on port ${port} listens on 127.0.0.1 only, so nothing off this machine reaches it. Map it with tailscale serve, or restart it bound to 0.0.0.0.`\n\t\t};\n\t}\n\tif (pageSecure && remote.protocol === 'http:') {\n\t\treturn {\n\t\t\t...card,\n\t\t\treason: `Port ${port} has no tailscale serve HTTPS mapping, and this page, served over HTTPS, cannot frame plain HTTP.`\n\t\t};\n\t}\n\treturn { kind: 'frame', src: remote.href };\n}\n","import { createPersisted } from './persisted';\n\nconst persisted = createPersisted<Record<string, string>>('claude-mux-web-pane', {});\n\n/**\n * The URL the Web pane last showed, per session id: `prod`, `dev`, or a URL\n * typed by hand. The pane reopens it when the page's URL names none.\n */\nclass WebPaneStore {\n\tprivate state = $state<Record<string, string>>(persisted.load());\n\n\tget(id: string | null): string | null {\n\t\treturn (id && this.state[id]) || null;\n\t}\n\n\tset(id: string | null, url: string): void {\n\t\tif (!id || this.state[id] === url) return;\n\t\tthis.state[id] = url;\n\t\tpersisted.save(this.state);\n\t}\n}\n\nexport const webPaneStore = new WebPaneStore();\n","<script lang=\"ts\">\n\t/**\n\t * The project's site in a frame: the prod or dev URL `.claude-mux.json`\n\t * names, a dev server found running inside the project, or a URL typed into\n\t * the bar. The URL holds the choice (`?url=prod|dev|<url>`), and the last\n\t * one persists per session.\n\t *\n\t * A URL on this machine is framed through its tailscale serve mapping when\n\t * it has one, so the phone reaches it too; one that cannot be framed from\n\t * here (mixed content, X-Frame-Options, CSP frame-ancestors) gets a card\n\t * that opens it in a tab of its own instead of a blank frame. Discovery is\n\t * polled only while the pane is showing.\n\t */\n\timport { untrack } from 'svelte';\n\timport { toast } from 'svelte-sonner';\n\timport type { PaneBodyProps } from '$lib/side-panel/panes';\n\timport { Toggle } from '$lib/components/ui/toggle';\n\timport { Input } from '$lib/components/ui/input';\n\timport { Button } from '$lib/components/ui/button';\n\timport {\n\t\tchoiceUrl,\n\t\tnormalizeTyped,\n\t\tresolveEmbed,\n\t\ttype FrameCheck,\n\t\ttype WebChoice,\n\t\ttype WebInfo\n\t} from '$lib/side-panel/web';\n\timport { webPaneStore } from '$lib/stores/webPane.svelte';\n\n\tlet { session, params, setParams, setActions, active }: PaneBodyProps = $props();\n\n\t/** How often discovery runs while the pane is showing. */\n\tconst POLL_MS = 5_000;\n\tconst CONFIG_SAMPLE = `{ \"urls\": { \"prod\": \"https://…\", \"dev\": \"http://localhost:5173\" } }`;\n\n\tconst sessionId = $derived(session?.id ?? null);\n\n\t// ── discovery ────────────────────────────────────────────────────────\n\n\tlet info = $state<WebInfo | null>(null);\n\tlet infoError = $state<string | null>(null);\n\tlet infoSeq = 0;\n\n\tasync function loadInfo(id: string) {\n\t\tconst mine = ++infoSeq;\n\t\ttry {\n\t\t\tconst res = await fetch(`/api/sessions/${encodeURIComponent(id)}/web`);\n\t\t\tconst body = await res.json();\n\t\t\tif (mine !== infoSeq) return;\n\t\t\tif (!res.ok) throw new Error(body.error ?? `HTTP ${res.status}`);\n\t\t\tinfo = body as WebInfo;\n\t\t\tinfoError = null;\n\t\t} catch (err) {\n\t\t\tif (mine === infoSeq) infoError = err instanceof Error ? err.message : String(err);\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tconst id = sessionId;\n\t\tif (!id || !active) return;\n\t\tuntrack(() => void loadInfo(id));\n\t\tconst timer = setInterval(() => {\n\t\t\tif (document.visibilityState === 'visible') void loadInfo(id);\n\t\t}, POLL_MS);\n\t\treturn () => clearInterval(timer);\n\t});\n\n\t// ── the choice ───────────────────────────────────────────────────────\n\n\tconst devConfigured = $derived(!!info?.urls.dev);\n\t/** What to show when neither the URL nor this browser names anything. */\n\tconst fallback = $derived<WebChoice | null>(\n\t\tdevConfigured || info?.detected.length ? 'dev' : info?.urls.prod ? 'prod' : null\n\t);\n\tconst choice = $derived(params.url ?? fallback);\n\tconst target = $derived(choice ? choiceUrl(choice, info) : null);\n\n\t// No URL in the address: put the one last shown here back.\n\tlet restored = false;\n\t$effect(() => {\n\t\tif (!active || restored || !sessionId) return;\n\t\trestored = true;\n\t\tconst last = untrack(() => webPaneStore.get(sessionId));\n\t\tif (!params.url && last) setParams({ url: last });\n\t});\n\n\t$effect(() => {\n\t\tif (params.url) webPaneStore.set(sessionId, params.url);\n\t});\n\n\t/**\n\t * The choices shown before this one, newest last, for Back. A frame on\n\t * another origin keeps its own history out of reach, so Back steps\n\t * through what was picked here rather than through the page's links.\n\t */\n\tlet trail = $state<string[]>([]);\n\n\tfunction choose(next: string) {\n\t\tif (next === choice) return;\n\t\tif (choice) trail = [...trail, choice];\n\t\tsetParams({ url: next });\n\t}\n\n\tfunction goBack() {\n\t\tconst prev = trail.at(-1);\n\t\tif (!prev) return;\n\t\ttrail = trail.slice(0, -1);\n\t\tsetParams({ url: prev });\n\t}\n\n\t// ── the bar ──────────────────────────────────────────────────────────\n\n\tlet typed = $state('');\n\t$effect(() => {\n\t\ttyped = target ?? '';\n\t});\n\n\tfunction submitTyped(e: SubmitEvent) {\n\t\te.preventDefault();\n\t\tconst url = normalizeTyped(typed);\n\t\tif (!url) {\n\t\t\ttoast.error('Not an http(s) URL', { description: typed });\n\t\t\treturn;\n\t\t}\n\t\tconst named = (['prod', 'dev'] as const).find((c) => {\n\t\t\tconst configured = choiceUrl(c, info);\n\t\t\treturn configured !== null && normalizeTyped(configured) === url;\n\t\t});\n\t\tchoose(named ?? url);\n\t}\n\n\t// ── what is drawn ────────────────────────────────────────────────────\n\n\tconst embed = $derived.by(() => {\n\t\tif (!target || !info) return null;\n\t\ttry {\n\t\t\treturn resolveEmbed(target, { page: location, serves: info.serves, detected: info.detected });\n\t\t} catch {\n\t\t\treturn 'invalid' as const;\n\t\t}\n\t});\n\tconst frameSrc = $derived(embed !== 'invalid' && embed?.kind === 'frame' ? embed.src : null);\n\tconst openUrl = $derived(\n\t\tembed === 'invalid' ? null : embed ? (embed.kind === 'frame' ? embed.src : embed.open) : target\n\t);\n\n\t/** The frame check for the frame's URL; until it lands the frame is not drawn. */\n\tlet check = $state<{ src: string; result: FrameCheck } | null>(null);\n\t$effect(() => {\n\t\tconst src = frameSrc;\n\t\tif (!src) return;\n\t\tlet stale = false;\n\t\tconst q = new URLSearchParams({ url: src, origin: location.origin });\n\t\tfetch(`/api/web/frame?${q}`)\n\t\t\t.then((res) => res.json() as Promise<FrameCheck>)\n\t\t\t.catch((err): FrameCheck => ({ embeddable: null, reason: String(err) }))\n\t\t\t.then((result) => {\n\t\t\t\tif (!stale) check = { src, result };\n\t\t\t});\n\t\treturn () => (stale = true);\n\t});\n\tconst verdict = $derived(check && check.src === frameSrc ? check.result : null);\n\t/** Why the target is shown as a card rather than framed, or null to frame it. */\n\tconst blocked = $derived.by((): { reason: string; open: string; command?: string } | null => {\n\t\tif (embed === 'invalid') return null;\n\t\tif (embed?.kind === 'card') return embed;\n\t\tif (embed && verdict?.embeddable === false) {\n\t\t\treturn { reason: `The site forbids framing. ${verdict.reason}`, open: embed.src };\n\t\t}\n\t\treturn null;\n\t});\n\n\tlet reloads = $state(0);\n\n\tfunction reload() {\n\t\tif (frameSrc) reloads++;\n\t\tif (sessionId) void loadInfo(sessionId);\n\t}\n\n\tasync function copy(text: string) {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\ttoast.success('Copied', { description: text });\n\t\t} catch {\n\t\t\ttoast.error('Could not copy');\n\t\t}\n\t}\n\n\t$effect(() => {\n\t\tsetActions([\n\t\t\t{ icon: 'mdi:arrow-left', label: 'Back', disabled: trail.length === 0, run: goBack },\n\t\t\t{ icon: 'mdi:refresh', label: 'Reload', disabled: !sessionId, run: reload },\n\t\t\t{\n\t\t\t\ticon: 'mdi:open-in-new',\n\t\t\t\tlabel: 'Open in new tab',\n\t\t\t\tdisabled: !openUrl,\n\t\t\t\trun: () => openUrl && window.open(openUrl, '_blank', 'noopener,noreferrer')\n\t\t\t}\n\t\t]);\n\t});\n\n\tfunction hostLabel(url: string): string {\n\t\ttry {\n\t\t\treturn new URL(url).host;\n\t\t} catch {\n\t\t\treturn url;\n\t\t}\n\t}\n</script>\n\n<div class=\"web\">\n\t<form class=\"bar\" onsubmit={submitTyped}>\n\t\t<div class=\"seg\" role=\"group\" aria-label=\"Site\">\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={!info?.urls.prod}\n\t\t\t\ttitle={info?.urls.prod ?? 'No prod URL in .claude-mux.json'}\n\t\t\t\tbind:pressed={() => choice === 'prod', (on) => on && choose('prod')}>Prod</Toggle\n\t\t\t>\n\t\t\t<Toggle\n\t\t\t\tsize=\"sm\"\n\t\t\t\tdisabled={!devConfigured && !info?.detected.length}\n\t\t\t\ttitle={info?.urls.dev ?? (info?.detected.length ? 'A dev server found running in the project' : 'No dev server found')}\n\t\t\t\tbind:pressed={() =>\n\t\t\t\t\tchoice === 'dev' || (!devConfigured && !!info?.detected.some((d) => d.url === choice)),\n\t\t\t\t(on) => on && choose('dev')}>Dev</Toggle\n\t\t\t>\n\t\t</div>\n\t\t<Input\n\t\t\tbind:value={typed}\n\t\t\tclass=\"url\"\n\t\t\ttype=\"text\"\n\t\t\tinputmode=\"url\"\n\t\t\tplaceholder=\"Type a URL…\"\n\t\t\taria-label=\"URL\"\n\t\t\tautocomplete=\"off\"\n\t\t\tspellcheck={false}\n\t\t/>\n\t</form>\n\n\t{#if info && !devConfigured && info.detected.length > 0}\n\t\t<div class=\"detected\">\n\t\t\t<span class=\"label\">Detected dev servers</span>\n\t\t\t{#each info.detected as server, i (server.port)}\n\t\t\t\t<Toggle\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\tclass=\"chip\"\n\t\t\t\t\ttitle={`${server.process} (pid ${server.pid}) · ${server.url}`}\n\t\t\t\t\tbind:pressed={() => target === server.url, (on) => on && choose(i === 0 ? 'dev' : server.url)}\n\t\t\t\t>\n\t\t\t\t\t<span class=\"dot\"></span>:{server.port}\n\t\t\t\t\t<span class=\"proc\">{server.process}</span>\n\t\t\t\t\t{#if server.loopbackOnly}<iconify-icon icon=\"mdi:lock-outline\" title=\"127.0.0.1 only\"></iconify-icon>{/if}\n\t\t\t\t</Toggle>\n\t\t\t{/each}\n\t\t</div>\n\t{/if}\n\n\t<div class=\"view\">\n\t\t{#if infoError && !info}\n\t\t\t<p class=\"msg err\">{infoError}</p>\n\t\t{:else if !info && !params.url}\n\t\t\t<p class=\"msg dim\">Looking for the project's URLs…</p>\n\t\t{:else if !target}\n\t\t\t<div class=\"empty\">\n\t\t\t\t<iconify-icon icon=\"mdi:web-off\"></iconify-icon>\n\t\t\t\t{#if choice === 'prod'}\n\t\t\t\t\t<h3>No prod URL</h3>\n\t\t\t\t\t<p>Name one as <code>urls.prod</code> in <code>.claude-mux.json</code> at the repo root.</p>\n\t\t\t\t{:else if choice === 'dev'}\n\t\t\t\t\t<h3>No dev server running</h3>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tNothing inside <code>{info?.root}</code> is serving HTML. Start the dev server, or name one as\n\t\t\t\t\t\t<code>urls.dev</code> in <code>.claude-mux.json</code>.\n\t\t\t\t\t</p>\n\t\t\t\t{:else}\n\t\t\t\t\t<h3>Nothing to show yet</h3>\n\t\t\t\t\t<p>Type a URL above, start a dev server in the project, or commit a <code>.claude-mux.json</code>:</p>\n\t\t\t\t\t<pre>{CONFIG_SAMPLE}</pre>\n\t\t\t\t{/if}\n\t\t\t\t{#if info?.configError}<p class=\"err\">.claude-mux.json: {info.configError}</p>{/if}\n\t\t\t</div>\n\t\t{:else if embed === 'invalid'}\n\t\t\t<p class=\"msg err\">Not a URL: {target}</p>\n\t\t{:else if !embed}\n\t\t\t<p class=\"msg dim\">Resolving {target}…</p>\n\t\t{:else if blocked}\n\t\t\t{@const command = blocked.command}\n\t\t\t<div class=\"empty card\">\n\t\t\t\t<iconify-icon icon=\"mdi:application-brackets-outline\"></iconify-icon>\n\t\t\t\t<h3>Can't show {hostLabel(blocked.open)} here</h3>\n\t\t\t\t<p>{blocked.reason}</p>\n\t\t\t\t<Button href={blocked.open} target=\"_blank\" rel=\"noopener noreferrer\" size=\"sm\">\n\t\t\t\t\t<iconify-icon icon=\"mdi:open-in-new\"></iconify-icon> Open in new tab\n\t\t\t\t</Button>\n\t\t\t\t{#if command}\n\t\t\t\t\t<p class=\"dim\">To show it here, map the port over HTTPS on this machine:</p>\n\t\t\t\t\t<div class=\"cmd\">\n\t\t\t\t\t\t<code>{command}</code>\n\t\t\t\t\t\t<Button variant=\"ghost\" size=\"icon-sm\" title=\"Copy command\" aria-label=\"Copy command\" onclick={() => copy(command)}>\n\t\t\t\t\t\t\t<iconify-icon icon=\"mdi:content-copy\"></iconify-icon>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t{/if}\n\t\t\t</div>\n\t\t{:else if frameSrc && !verdict}\n\t\t\t<p class=\"msg dim\">Checking {hostLabel(frameSrc)}…</p>\n\t\t{:else if frameSrc}\n\t\t\t{#key `${frameSrc}\\0${reloads}`}\n\t\t\t\t<iframe src={frameSrc} title=\"Web preview\" allow=\"clipboard-read; clipboard-write; fullscreen\"></iframe>\n\t\t\t{/key}\n\t\t{/if}\n\t</div>\n</div>\n\n<style>\n\t.web {\n\t\theight: 100%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tmin-width: 0;\n\t\tcolor: #d6d3d1;\n\t\tfont-size: 13px;\n\t}\n\t.bar {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tpadding: 8px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\tflex: none;\n\t}\n\t.seg {\n\t\tdisplay: inline-flex;\n\t\tgap: 2px;\n\t\tpadding: 3px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\tflex: none;\n\t}\n\t.seg :global([data-slot='toggle']) {\n\t\tcolor: #a8a29e;\n\t\theight: 28px;\n\t}\n\t.seg :global([data-slot='toggle'][data-state='on']) {\n\t\tbackground: #e7e5e4;\n\t\tcolor: #0b0b0b;\n\t}\n\t.bar :global(.url) {\n\t\tflex: 1;\n\t\tmin-width: 0;\n\t\theight: 34px;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\t.detected {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 7px 10px;\n\t\tborder-bottom: 1px solid #222;\n\t\toverflow-x: auto;\n\t\tflex: none;\n\t\tfont-size: 11.5px;\n\t\tscrollbar-width: thin;\n\t}\n\t.label {\n\t\tcolor: #78716c;\n\t\tfont-size: 10.5px;\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\twhite-space: nowrap;\n\t\tmargin-right: 2px;\n\t}\n\t.detected :global(.chip) {\n\t\tflex: none;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 5px;\n\t\theight: 26px;\n\t\tpadding: 0 9px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: transparent;\n\t\tcolor: #a8a29e;\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 11.5px;\n\t}\n\t.detected :global(.chip[data-state='on']) {\n\t\tborder-color: #3f3f46;\n\t\tbackground: #232326;\n\t\tcolor: #f5f5f4;\n\t}\n\t.dot {\n\t\twidth: 6px;\n\t\theight: 6px;\n\t\tborder-radius: 50%;\n\t\tbackground: #34d399;\n\t}\n\t.proc {\n\t\tcolor: #78716c;\n\t}\n\t.view {\n\t\tflex: 1;\n\t\tmin-height: 0;\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t}\n\tiframe {\n\t\tflex: 1;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: 0;\n\t\tbackground: #fff;\n\t}\n\t.msg {\n\t\tmargin: 0;\n\t\tpadding: 16px 18px;\n\t}\n\t.empty {\n\t\tmargin: auto;\n\t\tmax-width: 420px;\n\t\tpadding: 24px 20px;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\t\tgap: 10px;\n\t\ttext-align: center;\n\t\tline-height: 1.5;\n\t}\n\t.empty > iconify-icon {\n\t\tfont-size: 30px;\n\t\tcolor: #57534e;\n\t}\n\t.empty h3 {\n\t\tmargin: 0;\n\t\tfont-size: 14px;\n\t\tfont-weight: 600;\n\t\tcolor: #e7e5e4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.empty p {\n\t\tmargin: 0;\n\t\tcolor: #a8a29e;\n\t}\n\tcode,\n\tpre {\n\t\tfont-family: var(--font-mono);\n\t\tfont-size: 12px;\n\t}\n\tpre {\n\t\tmargin: 0;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 6px;\n\t\tbackground: #1a1a1a;\n\t\twhite-space: pre-wrap;\n\t\tcolor: #a8a29e;\n\t\ttext-align: left;\n\t}\n\t.cmd {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmax-width: 100%;\n\t\tpadding: 6px 6px 6px 10px;\n\t\tborder-radius: 6px;\n\t\tborder: 1px solid #2a2a2a;\n\t\tbackground: #1a1a1a;\n\t\ttext-align: left;\n\t}\n\t.cmd code {\n\t\tcolor: #e7e5e4;\n\t\toverflow-wrap: anywhere;\n\t}\n\t.dim {\n\t\tcolor: #78716c;\n\t}\n\t.err {\n\t\tcolor: #f87171;\n\t}\n</style>\n","/**\n * The pane kinds the side panel can show. A pane registers here: its kind\n * (the `?panel=` value), icon, label, the key that toggles it, the URL params\n * it owns, its body component, and when it cannot apply. Its header actions\n * come from the body itself, through `setActions`, since they usually depend\n * on what the body is showing.\n */\nimport type { Component } from 'svelte';\nimport type { Session } from '$lib/stores/sessions.svelte';\nimport type { ChangesInfo } from '$shared/types/ws-messages.js';\nimport ProjectPane from '$lib/components/side-panel/ProjectPane.svelte';\nimport ChangesPane from '$lib/components/side-panel/ChangesPane.svelte';\nimport FilesPane from '$lib/components/side-panel/FilesPane.svelte';\nimport WebPane from '$lib/components/side-panel/WebPane.svelte';\nimport { IS_MAC } from '$lib/constants';\n\nexport interface PaneAction {\n\ticon: string;\n\tlabel: string;\n\trun: () => void;\n\t/** For an action that toggles, whether it is on. */\n\tpressed?: boolean;\n\tdisabled?: boolean;\n}\n\nexport interface PaneBodyProps {\n\tsession: Session | null;\n\ttarget: string;\n\t/** The params this pane owns, as the URL has them. */\n\tparams: Record<string, string>;\n\t/** Change this pane's params; a null value removes one. Replaces the history entry unless `push`. */\n\tsetParams: (own: Record<string, string | null>, opts?: { push?: boolean }) => void;\n\t/** The actions the panel header draws beside the pane's title. */\n\tsetActions: (actions: PaneAction[]) => void;\n\t/** The pane is the one showing; a hidden pane stays mounted but may idle. */\n\tactive: boolean;\n\t/** Put `text` into the session's composer, at the end of the draft. */\n\tmention: (text: string) => void;\n}\n\nexport interface PaneDef {\n\tkind: string;\n\tlabel: string;\n\ticon: string;\n\t/** The letter that, with Alt+Shift, toggles this pane. */\n\tkey: string;\n\t/** The query params this pane owns besides `panel`. */\n\tparams: readonly string[];\n\tbody: Component<PaneBodyProps>;\n\t/** Why the pane cannot apply to this session, or null when it can. */\n\tunavailable?: (session: Session | null) => string | null;\n\t/** Lines added and removed, drawn on the pane's toggle while non-zero. */\n\tcount?: (session: Session | null) => ChangesInfo | null;\n}\n\nexport const PANES: readonly PaneDef[] = [\n\t{\n\t\tkind: 'changes',\n\t\tlabel: 'Changes',\n\t\ticon: 'mdi:plus-minus-variant',\n\t\tkey: 'C',\n\t\tparams: ['file', 'turn', 'source'],\n\t\tbody: ChangesPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session'),\n\t\tcount: (s) => s?.changes ?? null\n\t},\n\t{\n\t\tkind: 'files',\n\t\tlabel: 'Files',\n\t\ticon: 'mdi:file-tree-outline',\n\t\tkey: 'F',\n\t\tparams: ['file', 'line'],\n\t\tbody: FilesPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'web',\n\t\tlabel: 'Web',\n\t\ticon: 'mdi:web',\n\t\tkey: 'W',\n\t\tparams: ['url'],\n\t\tbody: WebPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t},\n\t{\n\t\tkind: 'project',\n\t\tlabel: 'Project',\n\t\ticon: 'mdi:folder-information-outline',\n\t\tkey: 'P',\n\t\tparams: [],\n\t\tbody: ProjectPane,\n\t\tunavailable: (s) => (s ? null : 'Not a Claude session')\n\t}\n];\n\nexport const PANE_KINDS = PANES.map((p) => p.kind);\n/** Every param any pane owns, which switching panes clears. */\nexport const PANE_PARAMS = [...new Set(PANES.flatMap((p) => p.params))];\n\nexport function paneDef(kind: string | null): PaneDef | null {\n\treturn PANES.find((p) => p.kind === kind) ?? null;\n}\n\n/** How Alt+Shift+`letter` is written for this keyboard. */\nfunction altShift(letter: string): string {\n\treturn IS_MAC ? `⌥⇧${letter}` : `Alt Shift ${letter}`;\n}\n\n/** How the keys that toggle a pane are written for this keyboard. */\nexport function paneKeys(def: PaneDef): string {\n\treturn altShift(def.key);\n}\n/** Toggles maximize. */\nconst MAXIMIZE_KEY = 'M';\nexport const MAXIMIZE_KEYS = altShift(MAXIMIZE_KEY);\n/** Closes the panel, or reopens the pane last shown. */\nexport const CLOSE_KEYS = IS_MAC ? '⌘\\\\' : 'Ctrl \\\\';\n\n/** The pane an Alt+Shift+letter press names, or 'maximize'. */\nexport function panelKeyAction(e: KeyboardEvent): PaneDef | 'maximize' | 'toggle' | null {\n\tif ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && e.code === 'Backslash') return 'toggle';\n\tif (!e.altKey || !e.shiftKey || e.ctrlKey || e.metaKey) return null;\n\tif (e.code === `Key${MAXIMIZE_KEY}`) return 'maximize';\n\treturn PANES.find((p) => e.code === `Key${p.key}`) ?? null;\n}\n","import { browser } from '$app/environment';\nimport type { TmuxPane } from '$lib/types/tmux';\n\nconst POLL_INTERVAL_MS = 5000;\n\nfunction panesEqual(a: TmuxPane[], b: TmuxPane[]): boolean {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst x = a[i];\n\t\tconst y = b[i];\n\t\tif (x.target !== y.target || x.command !== y.command || x.cwd !== y.cwd || x.session !== y.session) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nclass TmuxPanesStore {\n\tpanes = $state<TmuxPane[]>([]);\n\tloaded = $state(false);\n\n\tprivate interval: ReturnType<typeof setInterval> | null = null;\n\tprivate subscribers = 0;\n\tprivate pending = false;\n\n\tprivate fetchPanes = async () => {\n\t\tif (this.pending) return;\n\t\tthis.pending = true;\n\t\ttry {\n\t\t\tconst res = await fetch('/api/tmux/panes');\n\t\t\tconst next: TmuxPane[] = await res.json();\n\t\t\tif (!panesEqual(this.panes, next)) this.panes = next;\n\t\t\tthis.loaded = true;\n\t\t} catch {\n\t\t\t// Keep existing panes; don't flip `loaded` so consumers don't render stale-dead state on transient failures\n\t\t} finally {\n\t\t\tthis.pending = false;\n\t\t}\n\t};\n\n\tprivate start() {\n\t\tif (this.interval == null) this.interval = setInterval(this.fetchPanes, POLL_INTERVAL_MS);\n\t}\n\n\tprivate stop() {\n\t\tif (this.interval != null) {\n\t\t\tclearInterval(this.interval);\n\t\t\tthis.interval = null;\n\t\t}\n\t}\n\n\tprivate onVis = () => {\n\t\tif (document.hidden) this.stop();\n\t\telse {\n\t\t\tthis.fetchPanes();\n\t\t\tthis.start();\n\t\t}\n\t};\n\n\tsubscribe(): () => void {\n\t\tif (!browser) return () => {};\n\t\tthis.subscribers++;\n\t\tif (this.subscribers === 1) {\n\t\t\tthis.fetchPanes();\n\t\t\tthis.start();\n\t\t\tdocument.addEventListener('visibilitychange', this.onVis);\n\t\t}\n\t\treturn () => {\n\t\t\tthis.subscribers--;\n\t\t\tif (this.subscribers === 0) {\n\t\t\t\tthis.stop();\n\t\t\t\tdocument.removeEventListener('visibilitychange', this.onVis);\n\t\t\t}\n\t\t};\n\t}\n}\n\nexport const tmuxPanesStore = new TmuxPanesStore();\n","import { createPersisted } from './persisted';\n\nconst PREVIEW_LEN = 32;\nconst SAVE_DEBOUNCE_MS = 250;\nconst persisted = createPersisted<Record<string, string>>('claude-mux-drafts', {});\n\nclass DraftsStore {\n\tprivate state = $state<Record<string, string>>(persisted.load());\n\tprivate flushTimer: ReturnType<typeof setTimeout> | null = null;\n\n\tget(target: string | null): string {\n\t\tif (!target) return '';\n\t\treturn this.state[target] ?? '';\n\t}\n\n\tset(target: string | null, text: string): void {\n\t\tif (!target) return;\n\t\tconst cur = this.state[target] ?? '';\n\t\tif (text === cur) return;\n\t\tif (text === '') delete this.state[target];\n\t\telse this.state[target] = text;\n\t\tthis.scheduleFlush();\n\t}\n\n\thas(target: string | null): boolean {\n\t\treturn !!target && (this.state[target]?.length ?? 0) > 0;\n\t}\n\n\tpreview(target: string | null): string {\n\t\tconst text = this.get(target);\n\t\tif (!text) return '';\n\t\tconst flat = text.replace(/\\s+/g, ' ').trim();\n\t\treturn flat.length > PREVIEW_LEN ? flat.slice(0, PREVIEW_LEN - 1) + '…' : flat;\n\t}\n\n\t// Coalesce keystrokes: localStorage writes serialize the whole map, so per-key\n\t// JSON.stringify is wasteful when the user is typing quickly.\n\tprivate scheduleFlush(): void {\n\t\tif (this.flushTimer !== null) return;\n\t\tthis.flushTimer = setTimeout(() => {\n\t\t\tthis.flushTimer = null;\n\t\t\tpersisted.save(this.state);\n\t\t}, SAVE_DEBOUNCE_MS);\n\t}\n}\n\nexport const draftsStore = new DraftsStore();\n","// File attachments staged for the next send, kept per target the way drafts\n// are (see docs/adr/0001, 0002). In memory only: a chip holds the File and a\n// blob URL, neither of which survives a reload.\nexport type AttachmentStatus = 'uploading' | 'ready' | 'failed';\nexport interface Attachment {\n\tlocalId: string;\n\tfile: File;\n\tname: string;\n\tsize: number;\n\tmime: string;\n\tstatus: AttachmentStatus;\n\tpath?: string;\n\terror?: string;\n\tthumb?: string;\n\tabort?: AbortController;\n}\n\nconst NONE: Attachment[] = [];\n\nfunction release(chip: Attachment): void {\n\tchip.abort?.abort();\n\tif (chip.thumb) URL.revokeObjectURL(chip.thumb);\n}\n\nclass AttachmentsStore {\n\tprivate state = $state<Record<string, Attachment[]>>({});\n\n\tget(target: string | null): Attachment[] {\n\t\tif (!target) return NONE;\n\t\treturn this.state[target] ?? NONE;\n\t}\n\n\tcount(target: string | null): number {\n\t\treturn this.get(target).length;\n\t}\n\n\tadd(target: string | null, chip: Attachment): void {\n\t\tif (!target) return;\n\t\tthis.state[target] = [...this.get(target), chip];\n\t}\n\n\t/** Patch a chip in its own target's list; a no-op once it has been removed. */\n\tpatch(target: string, localId: string, changes: Partial<Attachment>): void {\n\t\tconst list = this.state[target];\n\t\tif (!list?.some((a) => a.localId === localId)) return;\n\t\tthis.state[target] = list.map((a) => (a.localId === localId ? { ...a, ...changes } : a));\n\t}\n\n\t/** Drop one chip, aborting its upload and revoking its blob URL. */\n\tremove(target: string | null, localId: string): Attachment | undefined {\n\t\tconst list = target ? this.state[target] : undefined;\n\t\tconst chip = list?.find((a) => a.localId === localId);\n\t\tif (!target || !list || !chip) return undefined;\n\t\trelease(chip);\n\t\tconst rest = list.filter((a) => a.localId !== localId);\n\t\tif (rest.length) this.state[target] = rest;\n\t\telse delete this.state[target];\n\t\treturn chip;\n\t}\n\n\tclear(target: string | null): void {\n\t\tconst list = target ? this.state[target] : undefined;\n\t\tif (!target || !list) return;\n\t\tlist.forEach(release);\n\t\tdelete this.state[target];\n\t}\n}\n\nexport const attachmentsStore = new AttachmentsStore();\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: AlertDialogPrimitive.RootProps = $props();\n</script>\n\n<AlertDialogPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: AlertDialogPrimitive.PortalProps = $props();\n</script>\n\n<AlertDialogPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.TitleProps = $props();\n</script>\n\n<AlertDialogPrimitive.Title\n\tbind:ref\n\tdata-slot=\"alert-dialog-title\"\n\tclass={cn(\"text-lg font-semibold\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { buttonVariants } from \"$lib/components/ui/button/index.js\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.ActionProps = $props();\n</script>\n\n<AlertDialogPrimitive.Action\n\tbind:ref\n\tdata-slot=\"alert-dialog-action\"\n\tclass={cn(buttonVariants(), className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { buttonVariants } from \"$lib/components/ui/button/index.js\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.CancelProps = $props();\n</script>\n\n<AlertDialogPrimitive.Cancel\n\tbind:ref\n\tdata-slot=\"alert-dialog-cancel\"\n\tclass={cn(buttonVariants({ variant: \"outline\" }), className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"alert-dialog-footer\"\n\tclass={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"alert-dialog-header\"\n\tclass={cn(\"flex flex-col gap-2 text-center sm:text-start\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.OverlayProps = $props();\n</script>\n\n<AlertDialogPrimitive.Overlay\n\tbind:ref\n\tdata-slot=\"alert-dialog-overlay\"\n\tclass={cn(\n\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-(--z-modal) bg-black/50\",\n\t\tclassName\n\t)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport AlertDialogPortal from \"./alert-dialog-portal.svelte\";\n\timport AlertDialogOverlay from \"./alert-dialog-overlay.svelte\";\n\timport { cn, type WithoutChild, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tportalProps,\n\t\t...restProps\n\t}: WithoutChild<AlertDialogPrimitive.ContentProps> & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof AlertDialogPortal>>;\n\t} = $props();\n</script>\n\n<AlertDialogPortal {...portalProps}>\n\t<AlertDialogOverlay />\n\t<AlertDialogPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"alert-dialog-content\"\n\t\tclass={cn(\n\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-(--z-modal) grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t/>\n</AlertDialogPortal>\n","<script lang=\"ts\">\n\timport { AlertDialog as AlertDialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: AlertDialogPrimitive.DescriptionProps = $props();\n</script>\n\n<AlertDialogPrimitive.Description\n\tbind:ref\n\tdata-slot=\"alert-dialog-description\"\n\tclass={cn(\"text-muted-foreground text-sm\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: DialogPrimitive.RootProps = $props();\n</script>\n\n<DialogPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: DialogPrimitive.PortalProps = $props();\n</script>\n\n<DialogPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.TitleProps = $props();\n</script>\n\n<DialogPrimitive.Title\n\tbind:ref\n\tdata-slot=\"dialog-title\"\n\tclass={cn(\"text-lg leading-none font-semibold\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"dialog-footer\"\n\tclass={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport type { HTMLAttributes } from \"svelte/elements\";\n\timport { cn, type WithElementRef } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tchildren,\n\t\t...restProps\n\t}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();\n</script>\n\n<div\n\tbind:this={ref}\n\tdata-slot=\"dialog-header\"\n\tclass={cn(\"flex flex-col gap-2 text-center sm:text-start\", className)}\n\t{...restProps}\n>\n\t{@render children?.()}\n</div>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.OverlayProps = $props();\n</script>\n\n<DialogPrimitive.Overlay\n\tbind:ref\n\tdata-slot=\"dialog-overlay\"\n\tclass={cn(\n\t\t\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-(--z-modal) bg-black/50\",\n\t\tclassName\n\t)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * ---\n *\n * The MIT License (MIT) (for portions derived from Feather)\n *\n * Copyright (c) 2013-2023 Cole Bemis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\nimport Icon from '../Icon.svelte';\nlet props = $props();\nconst iconNode = [[\"path\", { \"d\": \"M18 6 6 18\" }], [\"path\", { \"d\": \"m6 6 12 12\" }]];\n/**\n * @component @name X\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTggNiA2IDE4IiAvPgogIDxwYXRoIGQ9Im02IDYgMTIgMTIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/x\n * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {FunctionalComponent} Svelte component\n *\n */\n</script>\n\n<Icon name=\"x\" {...props} iconNode={iconNode}>\n {@render props.children?.()}\n</Icon>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport DialogPortal from \"./dialog-portal.svelte\";\n\timport XIcon from \"@lucide/svelte/icons/x\";\n\timport type { Snippet } from \"svelte\";\n\timport * as Dialog from \"./index.js\";\n\timport { cn, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tportalProps,\n\t\tchildren,\n\t\tshowCloseButton = true,\n\t\t...restProps\n\t}: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof DialogPortal>>;\n\t\tchildren: Snippet;\n\t\tshowCloseButton?: boolean;\n\t} = $props();\n</script>\n\n<DialogPortal {...portalProps}>\n\t<Dialog.Overlay />\n\t<DialogPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"dialog-content\"\n\t\tclass={cn(\n\t\t\t\"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-(--z-modal) grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t>\n\t\t{@render children?.()}\n\t\t{#if showCloseButton}\n\t\t\t<DialogPrimitive.Close\n\t\t\t\tclass=\"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\"\n\t\t\t>\n\t\t\t\t<XIcon />\n\t\t\t\t<span class=\"sr-only\">Close</span>\n\t\t\t</DialogPrimitive.Close>\n\t\t{/if}\n\t</DialogPrimitive.Content>\n</DialogPortal>\n","<script lang=\"ts\">\n\timport { Dialog as DialogPrimitive } from \"bits-ui\";\n\timport { cn } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: DialogPrimitive.DescriptionProps = $props();\n</script>\n\n<DialogPrimitive.Description\n\tbind:ref\n\tdata-slot=\"dialog-description\"\n\tclass={cn(\"text-muted-foreground text-sm\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\n\tlet { open = $bindable(false), ...restProps }: PopoverPrimitive.RootProps = $props();\n</script>\n\n<PopoverPrimitive.Root bind:open {...restProps} />\n","<script lang=\"ts\">\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\n\tlet { ...restProps }: PopoverPrimitive.PortalProps = $props();\n</script>\n\n<PopoverPrimitive.Portal {...restProps} />\n","<script lang=\"ts\">\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\timport PopoverPortal from \"./popover-portal.svelte\";\n\timport { cn, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\timport type { ComponentProps } from \"svelte\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\tsideOffset = 4,\n\t\talign = \"center\",\n\t\tportalProps,\n\t\t...restProps\n\t}: PopoverPrimitive.ContentProps & {\n\t\tportalProps?: WithoutChildrenOrChild<ComponentProps<typeof PopoverPortal>>;\n\t} = $props();\n</script>\n\n<PopoverPortal {...portalProps}>\n\t<PopoverPrimitive.Content\n\t\tbind:ref\n\t\tdata-slot=\"popover-content\"\n\t\t{sideOffset}\n\t\t{align}\n\t\tclass={cn(\n\t\t\t\"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-(--z-floating) w-72 origin-(--bits-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden\",\n\t\t\tclassName\n\t\t)}\n\t\t{...restProps}\n\t/>\n</PopoverPortal>\n","<script lang=\"ts\">\n\timport { cn } from \"$lib/utils.js\";\n\timport { Popover as PopoverPrimitive } from \"bits-ui\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tclass: className,\n\t\t...restProps\n\t}: PopoverPrimitive.TriggerProps = $props();\n</script>\n\n<PopoverPrimitive.Trigger\n\tbind:ref\n\tdata-slot=\"popover-trigger\"\n\tclass={cn(\"\", className)}\n\t{...restProps}\n/>\n","<script lang=\"ts\">\n\timport { untrack } from 'svelte';\n\timport * as Dialog from '$lib/components/ui/dialog';\n\timport { Button } from '$lib/components/ui/button';\n\timport { Input } from '$lib/components/ui/input';\n\timport { sessionStore } from '$lib/stores/sessions.svelte';\n\n\tinterface Props {\n\t\t/** The session to rename; `null` keeps the dialog closed. */\n\t\tsessionId: string | null;\n\t\tonClose: () => void;\n\t}\n\n\tlet { sessionId, onClose }: Props = $props();\n\n\t// Looked up rather than passed in, so the dialog reads the live session\n\t// instead of a snapshot frozen at the moment the row was clicked.\n\tconst session = $derived(sessionId ? sessionStore.sessionById.get(sessionId) ?? null : null);\n\n\tlet value = $state('');\n\tlet inputEl = $state<HTMLInputElement | null>(null);\n\t/**\n\t * The kill arms before it fires. On a phone this dialog is the long-press\n\t * menu — the only place a pane can be killed at all, since the row's kill\n\t * switch needs a hover to appear — so it sits next to a text field a thumb\n\t * is already aiming at, and one stray tap must not end a session.\n\t */\n\tlet killArmed = $state(false);\n\n\t// Seed the field once per opening. The name is read untracked so a rename\n\t// arriving back over the WebSocket cannot overwrite what is being typed.\n\t$effect(() => {\n\t\tif (sessionId) {\n\t\t\tvalue = untrack(() => session?.display_name ?? '');\n\t\t\tkillArmed = false;\n\t\t}\n\t});\n\n\tconst TOP_MARGIN_PX = 16;\n\t/** Below this share of the layout viewport, the shortfall is the keyboard. */\n\tconst KEYBOARD_RATIO = 0.75;\n\n\t/**\n\t * The dialog is `position: fixed`, which anchors it to the layout viewport —\n\t * on a phone the on-screen keyboard then covers it, and the focused field\n\t * sits behind the keys. Pinning it to the top of `visualViewport` instead\n\t * keeps it in sight as the keyboard opens and closes.\n\t *\n\t * Android resizes the layout viewport along with the keyboard, so the default\n\t * centring already lands above it and there is nothing to correct. iOS Safari\n\t * does not, and supports neither `env(keyboard-inset-height)` nor\n\t * `interactive-widget`, which is why this is done in script.\n\t */\n\tlet positionStyle = $state<string | undefined>(undefined);\n\n\t$effect(() => {\n\t\tconst vv = window.visualViewport;\n\t\tif (!sessionId || !vv) return;\n\t\t// Assigning the same string is a no-op in Svelte, so the per-frame `scroll`\n\t\t// events an opening keyboard produces cost nothing extra. Reading\n\t\t// `positionStyle` here to compare would make this effect depend on its own\n\t\t// output and re-subscribe the listeners on every change.\n\t\tconst sync = () => {\n\t\t\t// `translate` (not `transform`) is what centres the panel, so the vertical\n\t\t\t// half of it has to be cancelled here or the panel rides off the top.\n\t\t\tpositionStyle =\n\t\t\t\tvv.height < window.innerHeight * KEYBOARD_RATIO\n\t\t\t\t\t? `top: ${vv.offsetTop + TOP_MARGIN_PX}px; translate: -50% 0;`\n\t\t\t\t\t: undefined;\n\t\t};\n\t\tsync();\n\t\tvv.addEventListener('resize', sync);\n\t\tvv.addEventListener('scroll', sync);\n\t\treturn () => {\n\t\t\tvv.removeEventListener('resize', sync);\n\t\t\tvv.removeEventListener('scroll', sync);\n\t\t\tpositionStyle = undefined;\n\t\t};\n\t});\n\n\tasync function commit() {\n\t\tconst target = session;\n\t\tconst next = value.trim();\n\t\tonClose();\n\t\tif (!target || next === (target.display_name ?? '')) return;\n\t\ttry {\n\t\t\tawait fetch(`/api/sessions/${encodeURIComponent(target.id)}/rename`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ name: next || null })\n\t\t\t});\n\t\t} catch {\n\t\t\t// watcher will reconcile\n\t\t}\n\t}\n\n\tasync function kill() {\n\t\tconst target = session;\n\t\tif (!target) return;\n\t\tif (!killArmed) {\n\t\t\tkillArmed = true;\n\t\t\treturn;\n\t\t}\n\t\tonClose();\n\t\ttry {\n\t\t\tawait fetch(`/api/sessions/${encodeURIComponent(target.id)}/kill`, {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\tbody: JSON.stringify({ pid: target.pid, tmux_target: target.tmux_target })\n\t\t\t});\n\t\t} catch {\n\t\t\t// watcher will reconcile\n\t\t}\n\t}\n\n\tfunction onKeydown(e: KeyboardEvent) {\n\t\tif (e.key === 'Enter') {\n\t\t\te.preventDefault();\n\t\t\tvoid commit();\n\t\t}\n\t}\n</script>\n\n<Dialog.Root open={session !== null} onOpenChange={(open) => { if (!open) onClose(); }}>\n\t<Dialog.Content\n\t\tclass=\"max-w-sm\"\n\t\tstyle={positionStyle}\n\t\tonOpenAutoFocus={(e) => {\n\t\t\t// bits-ui focuses the panel itself; the point of this dialog is to type\n\t\t\t// straight away, so hand focus to the field instead.\n\t\t\te.preventDefault();\n\t\t\tinputEl?.focus();\n\t\t\tinputEl?.select();\n\t\t}}\n\t>\n\t\t<Dialog.Header>\n\t\t\t<Dialog.Title>Rename session</Dialog.Title>\n\t\t\t<Dialog.Description>\n\t\t\t\tAlso sent to the agent as <code>/rename</code>, once its pane is back at a prompt. Leave\n\t\t\t\tblank to fall back to the tmux target.\n\t\t\t</Dialog.Description>\n\t\t</Dialog.Header>\n\t\t<Input\n\t\t\tbind:ref={inputEl}\n\t\t\tbind:value\n\t\t\tonkeydown={onKeydown}\n\t\t\tclass=\"font-mono\"\n\t\t\ttype=\"text\"\n\t\t\tplaceholder={session?.tmux_target ?? session?.id ?? 'session name'}\n\t\t\taria-label=\"Session name\"\n\t\t\tautocomplete=\"off\"\n\t\t\tautocapitalize=\"off\"\n\t\t\tspellcheck=\"false\"\n\t\t\tenterkeyhint=\"done\"\n\t\t\tmaxlength={120}\n\t\t/>\n\t\t<Dialog.Footer>\n\t\t\t<Button\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tclass=\"min-h-11 text-destructive hover:text-destructive sm:mr-auto\"\n\t\t\t\tonclick={kill}\n\t\t\t>\n\t\t\t\t{killArmed ? 'Confirm kill' : 'Kill session'}\n\t\t\t</Button>\n\t\t\t<Button variant=\"ghost\" class=\"min-h-11\" onclick={onClose}>Cancel</Button>\n\t\t\t<Button class=\"min-h-11\" onclick={commit}>Rename</Button>\n\t\t</Dialog.Footer>\n\t</Dialog.Content>\n</Dialog.Root>\n","export interface FuzzyMatch {\n /** Higher is better. */\n score: number;\n /** Indices of the characters in `text` that the query matched. */\n positions: number[];\n}\n\n/**\n * Subsequence fuzzy match with the matched character positions.\n * Prefers: prefix match, matches at word boundaries, contiguous runs, shorter names.\n * Returns null when the query is not a subsequence of the text.\n * Pass `wantPositions: false` when only the score is used — it skips collecting them.\n */\nexport function fuzzyMatch(text: string, q: string, wantPositions = true): FuzzyMatch | null {\n if (!q) return { score: 0, positions: [] };\n const t = text.toLowerCase();\n const needle = q.toLowerCase();\n // Fast path: substring\n const idx = t.indexOf(needle);\n if (idx !== -1) {\n const positions = wantPositions\n ? Array.from({ length: needle.length }, (_, i) => idx + i)\n : [];\n return { score: 1000 - idx * 5 - t.length, positions };\n }\n const positions: number[] = [];\n let score = 0;\n let ti = 0;\n let prev = -2;\n for (let qi = 0; qi < needle.length; qi++) {\n const ch = needle[qi];\n const found = t.indexOf(ch, ti);\n if (found === -1) return null;\n score += found === prev + 1 ? 10 : 1;\n if (found === 0 || /[^a-z0-9]/.test(t[found - 1] ?? \"\")) score += 5;\n if (wantPositions) positions.push(found);\n prev = found;\n ti = found + 1;\n }\n return { score: score - t.length * 0.1, positions };\n}\n\n/** Score only — skips collecting match positions. Higher is better; null = no match. */\nexport function fuzzyScore(text: string, q: string): number | null {\n return fuzzyMatch(text, q, false)?.score ?? null;\n}\n\n/** Split `text` into alternating plain/matched runs for highlighting. */\nexport function highlightRuns(text: string, positions: number[]): { text: string; hit: boolean }[] {\n if (positions.length === 0) return [{ text, hit: false }];\n const runs: { text: string; hit: boolean }[] = [];\n let cut = 0;\n for (let i = 0; i < positions.length; ) {\n // positions is ascending, so a run of matched chars is one slice\n const from = positions[i];\n let to = from;\n while (i + 1 < positions.length && positions[i + 1] === to + 1) {\n to = positions[++i];\n }\n i++;\n if (from > cut) runs.push({ text: text.slice(cut, from), hit: false });\n runs.push({ text: text.slice(from, to + 1), hit: true });\n cut = to + 1;\n }\n if (cut < text.length) runs.push({ text: text.slice(cut), hit: false });\n return runs;\n}\n\n/**\n * Ranking shared by the web command list and spoken-command resolution: a\n * fuzzy match on the name (boosted so any name hit beats any description\n * hit), else a substring match on the description — substring only, because\n * a subsequence over long prose matches everything. Lives here rather than\n * beside the command scanner so the browser bundle never sees \"fs\".\n */\nexport function scoreCommand(\n cmd: { name: string; description: string },\n query: string\n): number | null {\n const nameScore = fuzzyScore(cmd.name, query);\n if (nameScore != null) return nameScore + 500;\n const descIdx = query ? cmd.description.toLowerCase().indexOf(query.toLowerCase()) : -1;\n return descIdx === -1 ? null : 100 - descIdx * 0.5;\n}\n","<script lang=\"ts\">/**\n * @license @lucide/svelte v0.561.0 - ISC\n *\n * ISC License\n *\n * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025.\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * ---\n *\n * The MIT License (MIT) (for portions derived from Feather)\n *\n * Copyright (c) 2013-2023 Cole Bemis\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n *\n */\nimport Icon from '../Icon.svelte';\nlet props = $props();\nconst iconNode = [[\"path\", { \"d\": \"M5 12h14\" }]];\n/**\n * @component @name Minus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAxMmgxNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/minus\n * @see https://lucide.dev/guide/packages/lucide-svelte - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {FunctionalComponent} Svelte component\n *\n */\n</script>\n\n<Icon name=\"minus\" {...props} iconNode={iconNode}>\n {@render props.children?.()}\n</Icon>\n","<script lang=\"ts\">\n\timport { Checkbox as CheckboxPrimitive } from \"bits-ui\";\n\timport CheckIcon from \"@lucide/svelte/icons/check\";\n\timport MinusIcon from \"@lucide/svelte/icons/minus\";\n\timport { cn, type WithoutChildrenOrChild } from \"$lib/utils.js\";\n\n\tlet {\n\t\tref = $bindable(null),\n\t\tchecked = $bindable(false),\n\t\tindeterminate = $bindable(false),\n\t\tclass: className,\n\t\t...restProps\n\t}: WithoutChildrenOrChild<CheckboxPrimitive.RootProps> = $props();\n</script>\n\n<CheckboxPrimitive.Root\n\tbind:ref\n\tdata-slot=\"checkbox\"\n\tclass={cn(\n\t\t\"border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive peer flex size-4 shrink-0 items-center justify-center rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50\",\n\t\tclassName\n\t)}\n\tbind:checked\n\tbind:indeterminate\n\t{...restProps}\n>\n\t{#snippet children({ checked, indeterminate })}\n\t\t<div data-slot=\"checkbox-indicator\" class=\"text-current transition-none\">\n\t\t\t{#if checked}\n\t\t\t\t<CheckIcon class=\"size-3.5\" />\n\t\t\t{:else if indeterminate}\n\t\t\t\t<MinusIcon class=\"size-3.5\" />\n\t\t\t{/if}\n\t\t</div>\n\t{/snippet}\n</CheckboxPrimitive.Root>\n","export type ChordAction = {\n\tlabel: string;\n\ticon: string;\n\trun: () => void;\n\tdanger?: boolean;\n\tflashing?: boolean;\n\tvariant?: 'destructive' | 'secondary';\n};\n\nfunction sameShape(a: ChordAction[], b: ChordAction[]): boolean {\n\tif (a.length !== b.length) return false;\n\tfor (let i = 0; i < a.length; i++) {\n\t\tconst x = a[i];\n\t\tconst y = b[i];\n\t\tif (\n\t\t\tx.label !== y.label ||\n\t\t\tx.icon !== y.icon ||\n\t\t\tx.danger !== y.danger ||\n\t\t\tx.variant !== y.variant ||\n\t\t\tx.flashing !== y.flashing\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}\n\nclass SidebarActionsStore {\n\tactions: ChordAction[] = $state([]);\n\n\tset(actions: ChordAction[]): void {\n\t\tif (sameShape(this.actions, actions)) return;\n\t\tthis.actions = actions;\n\t}\n\n\tclear(): void {\n\t\tif (this.actions.length === 0) return;\n\t\tthis.actions = [];\n\t}\n}\n\nexport const sidebarActionsStore = new SidebarActionsStore();\n"],"file":"9UhVHDNs.js"}