@fgbg/mdocs 1.3.22 → 1.3.24

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 (104) hide show
  1. package/README.md +1 -1
  2. package/agent-skills/changelog/SKILL.md +13 -0
  3. package/agent-skills/getting-started-installation/SKILL.md +8 -2
  4. package/dist/server/agent/Agent/run-pi-agent.js +7 -0
  5. package/dist/server/agent/Agent/run-pi-agent.js.map +1 -1
  6. package/dist/server/agent/Agent/session-manager.js +354 -144
  7. package/dist/server/agent/Agent/session-manager.js.map +1 -1
  8. package/dist/server/agent/Agent/session-manager.queue.test.js +65 -0
  9. package/dist/server/agent/Agent/session-manager.queue.test.js.map +1 -0
  10. package/dist/server/agent/Agent/session-meta-lock.js +73 -0
  11. package/dist/server/agent/Agent/session-meta-lock.js.map +1 -0
  12. package/dist/server/agent/Agent/session-meta-lock.test.js +44 -0
  13. package/dist/server/agent/Agent/session-meta-lock.test.js.map +1 -0
  14. package/dist/server/agent/Agent/session-repair.test.js +40 -0
  15. package/dist/server/agent/Agent/session-repair.test.js.map +1 -0
  16. package/dist/server/agent/Agent/system-prompt.js +3 -3
  17. package/dist/server/agent/Agent/tool-ui-effects.js +41 -0
  18. package/dist/server/agent/Agent/tool-ui-effects.js.map +1 -1
  19. package/dist/server/agent/Agent/tools-documents.js +62 -12
  20. package/dist/server/agent/Agent/tools-documents.js.map +1 -1
  21. package/dist/server/agent/Agent/tools-overwrite.js +1 -1
  22. package/dist/server/agent/Agent/tools-overwrite.js.map +1 -1
  23. package/dist/server/agent/Agent/tools-registry.test.js +16 -0
  24. package/dist/server/agent/Agent/tools-registry.test.js.map +1 -1
  25. package/dist/server/agent/Agent/tools-sheet.js +918 -0
  26. package/dist/server/agent/Agent/tools-sheet.js.map +1 -0
  27. package/dist/server/agent/Agent/tools-sheet.test.js +202 -0
  28. package/dist/server/agent/Agent/tools-sheet.test.js.map +1 -0
  29. package/dist/server/agent/Agent/tools-template.js +4 -1
  30. package/dist/server/agent/Agent/tools-template.js.map +1 -1
  31. package/dist/server/cli/main.js +81 -4
  32. package/dist/server/cli/main.js.map +1 -1
  33. package/dist/server/cli/self-update.js +49 -20
  34. package/dist/server/cli/self-update.js.map +1 -1
  35. package/dist/server/cli/self-update.test.js +21 -2
  36. package/dist/server/cli/self-update.test.js.map +1 -1
  37. package/dist/server/config/index.js +2 -1
  38. package/dist/server/config/index.js.map +1 -1
  39. package/dist/server/documents/document.service.integration.test.js +67 -1
  40. package/dist/server/documents/document.service.integration.test.js.map +1 -1
  41. package/dist/server/documents/document.service.js +80 -5
  42. package/dist/server/documents/document.service.js.map +1 -1
  43. package/dist/server/main.js +6 -0
  44. package/dist/server/main.js.map +1 -1
  45. package/dist/server/routes/documents.routes.js +6 -2
  46. package/dist/server/routes/documents.routes.js.map +1 -1
  47. package/dist/server/search/embedding-model.js +33 -11
  48. package/dist/server/search/embedding-model.js.map +1 -1
  49. package/dist/shared/docPath.js +5 -2
  50. package/dist/shared/docPath.js.map +1 -1
  51. package/dist/shared/file-type-policy.js +15 -0
  52. package/dist/shared/file-type-policy.js.map +1 -1
  53. package/dist/shared/file-type-policy.test.js +17 -1
  54. package/dist/shared/file-type-policy.test.js.map +1 -1
  55. package/dist/shared/file-types.js +2 -0
  56. package/dist/shared/file-types.js.map +1 -1
  57. package/dist/shared/sheetDocument.js +781 -0
  58. package/dist/shared/sheetDocument.js.map +1 -0
  59. package/dist/shared/sheetDocument.test.js +179 -0
  60. package/dist/shared/sheetDocument.test.js.map +1 -0
  61. package/dist/shared/storagePath.js +15 -8
  62. package/dist/shared/storagePath.js.map +1 -1
  63. package/dist/web/assets/AgentChatPanel-NcsMAhWM.js +22 -0
  64. package/dist/web/assets/{AgentSkillFormCard-CzJG8FK4.js → AgentSkillFormCard-B99CncJO.js} +3 -3
  65. package/dist/web/assets/{AiWriteWorkbench-DiSDDAee.js → AiWriteWorkbench-DomEbwzU.js} +6 -6
  66. package/dist/web/assets/{DiagramEditor-NtNY3sZL-DfkpQX3P.js → DiagramEditor-NtNY3sZL-BhsjOCtK.js} +1 -1
  67. package/dist/web/assets/DocChrome-wfHrPEB7.js +11 -0
  68. package/dist/web/assets/DocumentEditor-CCuqHlmF.js +1 -0
  69. package/dist/web/assets/HtmlEditor-g2NNYmv2.js +1 -0
  70. package/dist/web/assets/{MergeView-CbFSN3Bi.js → MergeView-GL7xdFM4.js} +4 -4
  71. package/dist/web/assets/PlaygroundPage-Bb4X1bvp.js +8 -0
  72. package/dist/web/assets/SettingsPage-B4INgMK-.js +1 -0
  73. package/dist/web/assets/SheetEditor-Cka57s62.js +16 -0
  74. package/dist/web/assets/SheetEditor-gXD-sRv2.css +1 -0
  75. package/dist/web/assets/{Toolbar-D9FcRwg3.js → Toolbar-Bk3LKZfg.js} +19 -29
  76. package/dist/web/assets/VisitorPickerModal-zafJ6beK.js +1 -0
  77. package/dist/web/assets/{check-Bf8YbzH7.js → check-BMeXlsHC.js} +1 -1
  78. package/dist/web/assets/{copy-SBghRY2T.js → copy-CCsiKd_j.js} +1 -1
  79. package/dist/web/assets/{diagram-CgEd0hrk.js → diagram-BF8g9yg4.js} +3 -3
  80. package/dist/web/assets/docPlainCharCount-BjBZaoHy.js +11 -0
  81. package/dist/web/assets/{editor-CL03se2B.js → editor-DBWWidi3.js} +1 -1
  82. package/dist/web/assets/file-type-policy-C6Nun42Q.js +1 -0
  83. package/dist/web/assets/index-3B7_9QOQ.js +299 -0
  84. package/dist/web/assets/index-BF754bDB.css +1 -0
  85. package/dist/web/assets/italic-B6bGjo1_.js +11 -0
  86. package/dist/web/assets/{meta2d-1-g23JOU.js → meta2d-DP4Vt_ZE.js} +1 -1
  87. package/dist/web/assets/{meta2dEngine-BD2XbzaV-ulfRZEvk.js → meta2dEngine-BD2XbzaV-9HAADQ7Y.js} +1 -1
  88. package/dist/web/assets/{motion-Dyy8pB0Q.js → motion-BAXVQJfN.js} +1 -1
  89. package/dist/web/assets/{plus-CEapsZwl.js → plus-BD44y7Zf.js} +1 -1
  90. package/dist/web/assets/{react-BkX5Koku.js → react-2y9P8xJn.js} +171 -168
  91. package/dist/web/assets/{react-vendor-BuABiQkA.js → react-vendor-BVS1XoFi.js} +1 -1
  92. package/dist/web/assets/{ui-ZPt_BNBg.js → ui-CEFkTVnG.js} +200 -181
  93. package/dist/web/index.html +6 -6
  94. package/package.json +30 -21
  95. package/dist/web/assets/AgentChatPanel-BZlAgyrV.js +0 -22
  96. package/dist/web/assets/DocChrome-QTGER_Af.js +0 -21
  97. package/dist/web/assets/DocumentEditor-DYSRZnJa.js +0 -1
  98. package/dist/web/assets/HtmlEditor-oDPrhq3o.js +0 -1
  99. package/dist/web/assets/PlaygroundPage-DuMH_V-7.js +0 -8
  100. package/dist/web/assets/SettingsPage-C_RMO-5M.js +0 -1
  101. package/dist/web/assets/VisitorPickerModal-CM13Y6jQ.js +0 -1
  102. package/dist/web/assets/file-type-policy-GUk904tm.js +0 -1
  103. package/dist/web/assets/index-CIgmAX2Q.css +0 -1
  104. package/dist/web/assets/index-Cwy87sZC.js +0 -293
@@ -239,4 +239,4 @@ XID_Continue XIDC
239
239
  XID_Start XIDS`.split(/\s/).map(e=>[bf(e),e])),UI=new Map([["s",bt(383)],[bt(383),"s"]]),BI=new Map([[bt(223),bt(7838)],[bt(107),bt(8490)],[bt(229),bt(8491)],[bt(969),bt(8486)]]),HI=new Map([Xr(453),Xr(456),Xr(459),Xr(498),...Ud(8072,8079),...Ud(8088,8095),...Ud(8104,8111),Xr(8124),Xr(8140),Xr(8188)]),GI=new Map([["alnum",Ee`[\p{Alpha}\p{Nd}]`],["alpha",Ee`\p{Alpha}`],["ascii",Ee`\p{ASCII}`],["blank",Ee`[\p{Zs}\t]`],["cntrl",Ee`\p{Cc}`],["digit",Ee`\p{Nd}`],["graph",Ee`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ee`\p{Lower}`],["print",Ee`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ee`[\p{P}\p{S}]`],["space",Ee`\p{space}`],["upper",Ee`\p{Upper}`],["word",Ee`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ee`\p{AHex}`]]);function $I(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Xr(e){const t=bt(e);return[t.toLowerCase(),t]}function Ud(e,t){return $I(e,t).map(n=>Xr(n))}var e_=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function jI(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};t_(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:vp(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};wl(e,VI,r);const o={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},i={currentFlags:o,prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};wl(e,FI,i);const a={groupsByName:i.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:i.reffedNodesByReferencer};return wl(e,qI,a),e._originMap=i.groupOriginByCopy,e._strategy=r.strategy,e}var VI={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:o}=e;if(o==="repeater"){const i=$n();i.body[0].body.push(Fo({negate:!0,body:r}),ki("Any"));const a=$n();a.body[0].body.push(qw("greedy",0,1/0,i)),n(ut(a,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const o=e.body.filter(i=>i.kind==="flags");for(let i=n+1;i<t.body.length;i++){const a=t.body[i];Yl(r,a,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){var n;if((n=t.get(e))!=null&&n.length){const r=r_(t.get(e));if(r){const o=$n({flags:r});o.body[0].body=e.body,e.body=[ut(o,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:o,remove:i,replaceWith:a},l){const{kind:s,negate:u}=e,{asciiWordBoundaries:f,avoidSubclass:c,supportedGNodes:d,wordIsAscii:h}=l;if(s==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${u?"Y":"y"}"`);if(s==="line_end")a(ut(Fo({body:[fi({body:[pp("string_end")]}),fi({body:[vf(10)]})]}),t));else if(s==="line_start")a(ut(gr(Ee`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(s==="search_start")if(d.has(e))o.flags.sticky=!0,i();else{const y=r[n-1];if(y&&WI(y))a(ut(Fo({negate:!0}),t));else{if(c)throw new Error(Ee`Uses "\G" in a way that requires a subclass`);a(Kr(pp("string_start"),t)),l.strategy="clip_search"}}else if(!(s==="string_end"||s==="string_start"))if(s==="string_end_newline")a(ut(gr(Ee`(?=\n?\z)`),t));else if(s==="word_boundary"){if(!h&&!f){const y=`(?:(?<=${pr})(?!${pr})|(?<!${pr})(?=${pr}))`,v=`(?:(?<=${pr})(?=${pr})|(?<!${pr})(?!${pr}))`;a(ut(gr(u?v:y),t))}}else throw new Error(`Unexpected assertion kind "${s}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Hd(n)&&(n=Bd(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Hd(r)&&(r=Bd(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const r=xu({body:[e]});n(ut(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:o,digitIsAscii:i,spaceIsAscii:a,wordIsAscii:l}){const{kind:s,negate:u,value:f}=e;if(i&&(s==="digit"||f==="digit")){n(Kr(mp("digit",{negate:u}),t));return}if(a&&(s==="space"||f==="space")){n(ut(Gd(gr(II),u),t));return}if(l&&(s==="word"||f==="word")){n(Kr(mp("word",{negate:u}),t));return}if(s==="any")n(Kr(ki("Any"),t));else if(s==="digit")n(Kr(ki("Nd",{negate:u}),t));else if(s!=="dot")if(s==="text_segment"){if(r==="strict")throw new Error(Ee`Use of "\X" requires non-strict accuracy`);const c="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",d=Ee`\p{RI}{2}|${c}(?:\u200D${c})*`;n(ut(gr(Ee`(?>\r\n|${o?Ee`\p{RGI_Emoji}`:d}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(s==="hex")n(Kr(ki("AHex",{negate:u}),t));else if(s==="newline")n(ut(gr(u?`[^
240
240
  ]`:`(?>\r
241
241
  ?|[
242
- \v\f…\u2028\u2029])`),t));else if(s==="posix")if(!o&&(f==="graph"||f==="print")){if(r==="strict")throw new Error(`POSIX class "${f}" requires min target ES2024 or non-strict accuracy`);let c={graph:"!-~",print:" -~"}[f];u&&(c=`\0-${bt(c.codePointAt(0)-1)}${bt(c.codePointAt(2)+1)}-􏿿`),n(ut(gr(`[${c}]`),t))}else n(ut(Gd(gr(GI.get(f)),u),t));else if(s==="property")bm.has(bf(f))||(e.key="sc");else if(s==="space")n(Kr(ki("space",{negate:u}),t));else if(s==="word")n(ut(Gd(gr(pr),u),t));else throw new Error(`Unexpected character set kind "${s}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:o,removeAllPrevSiblings:i,removeAllNextSiblings:a}){const{kind:l,flags:s}=e;if(l==="flags")if(!s.enable&&!s.disable)r();else{const u=$n({flags:s});u.body[0].body=a(),o(ut(u,t),{traverse:!0})}else if(l==="keep"){const u=n.body[0],c=n.body.length===1&&jw(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==c||c.body.length>1)throw new Error(Ee`Uses "\K" in a way that's unsupported`);const d=Fo({behind:!0});d.body[0].body=i(),o(ut(d,t))}else throw new Error(`Unexpected directive kind "${l}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(ut(Fo({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=$n();t.body[0].body.push(e.body),e.body=ut(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,o=!1;for(const i of e.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const a=i_(i.body);a?(r=!0,Array.isArray(a)?n.push(...a):n.push(a)):o=!0}r&&!o&&n.forEach(i=>t.add(i))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Ee`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Hd(n)&&(n=Bd(n,t),e.ref=n)}},FI={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:o}=e;r||n.set(e,[...t.get(o).map(({node:i})=>i)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:o,groupsByName:i,multiplexCapturesToLeftByRef:a,openRefs:l,reffedNodesByReferencer:s}){const u=o.get(e);if(u&&l.has(e.number)){const c=Kr(Lb(e.number),t);s.set(c,l.get(e.number)),n(c);return}l.set(e.number,e),a.set(e.number,[]),e.name&&Yl(a,e.name,[]);const f=a.get(e.name??e.number);for(let c=0;c<f.length;c++){const d=f[c];if(u===d.node||u&&u===d.origin||e===d.origin){f.splice(c,1);break}}if(a.get(e.number).push({node:e,origin:u}),e.name&&a.get(e.name).push({node:e,origin:u}),e.name){const c=Yl(i,e.name,new Map);let d=!1;if(u)d=!0;else for(const h of c.values())if(!h.hasDuplicateNameToRemove){d=!0;break}i.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:d})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=xc(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:o,ref:i}=e;if(o){let f=t;for(;(f=f.parent)&&!(f.type==="CapturingGroup"&&(f.name===i||f.number===i)););r.reffedNodesByReferencer.set(e,f);return}const a=r.subroutineRefMap.get(i),l=i===0,s=l?Lb(0):n_(a,r.groupOriginByCopy,null);let u=s;if(!l){const f=r_(KI(a,d=>d.type==="Group"&&!!d.flags)),c=f?xc(r.globalFlags,f):r.globalFlags;YI(c,r.currentFlags)||(u=$n({flags:QI(c)}),u.body[0].body.push(s))}n(ut(u,t),{traverse:!l})}},qI={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const i=r.reffedNodesByReferencer.get(e).filter(a=>XI(a,e));if(!i.length)n(ut(Fo({negate:!0}),t));else if(i.length>1){const a=$n({atomic:!0,body:i.reverse().map(l=>fi({body:[gp(l.number)]}))});n(ut(a,t))}else e.ref=i[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const o=Fw();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function t_(e){wl(e,{"*"({node:t,parent:n}){t.parent=n}})}function YI(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function XI(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=o_(n.parent);for(const o of r){if(o===n)break;if(o===e||a_(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function n_(e,t,n,r){const o=Array.isArray(e)?[]:{};for(const[i,a]of Object.entries(e))i==="parent"?o.parent=Array.isArray(n)?r:n:a&&typeof a=="object"?o[i]=n_(a,t,o,n):(i==="type"&&a==="CapturingGroup"&&t.set(o,t.get(e)??e),o[i]=a);return o}function Lb(e){const t=Yw(e);return t.isRecursive=!0,t}function KI(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Bd(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function r_(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(o=>{var i,a;(i=r.enable)!=null&&i[o]&&(delete n.disable[o],n.enable[o]=!0),(a=r.disable)!=null&&a[o]&&(n.disable[o]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function QI({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function o_(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function i_(e){const t=e.find(n=>n.kind==="search_start"||JI(n,{negate:!1})||!ZI(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const o=i_(r.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function a_(e,t){const n=o_(e)??[];for(const r of n)if(r===t||a_(r,t))return!0;return!1}function ZI({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function WI(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function JI(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&jw(e.body[0],{type:"Assertion",kind:"search_start"})}function Hd(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function gr(e,t){const r=Vw(e,{...t,unicodePropertyMap:bm}).body;return r.length>1||r[0].body.length>1?$n({body:r}):r[0].body[0]}function Gd(e,t){return e.negate=t,e}function Kr(e,t){return e.parent=t,e}function ut(e,t){return t_(e),e.parent=t,e}function ez(e,t){const n=Ww(t),r=vp(n.target,"ES2024"),o=vp(n.target,"ES2025"),i=n.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let a=null,l=null;if(!o){const h=[e.flags.ignoreCase];wl(e,tz,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(y){h.push(y)},setHasCasedChar(){h.at(-1)?a=!0:l=!0}})}const s={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!l)};let u=e;const f={accuracy:n.accuracy,appliedGlobalFlags:s,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!o&&a&&l),useFlagMods:o,useFlagV:r,verbose:n.verbose};function c(h){return f.lastNode=u,u=h,DI(nz[h.type],`Unexpected node type "${h.type}"`)(h,f,c)}const d={pattern:e.body.map(c).join("|"),flags:c(e.flags),options:{...e.options}};return r||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],f.captureMap.forEach((h,y)=>{h.hidden&&d._hiddenCaptures.push(y),h.transferTo&&Yl(d._captureTransfers,h.transferTo,[]).push(y)}),d}var tz={"*":{enter({node:e},t){if(Db(e)){const n=t.getCurrentModI();t.pushModI(e.flags?xc({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Db(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Sm(bt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),l_(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&e_.has(e.value)&&t.setHasCasedChar()}},nz={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Ee`\B`:Ee`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:o,number:i}=e,a={ignoreCase:t.currentFlags.ignoreCase},l=t.originMap.get(e);return l&&(a.hidden=!0,i>l.number&&(a.transferTo=l.number)),t.captureMap.set(i,a),`(${o?`?<${o}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=bt(e),r=xi(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Sm(n)){const o=Jw(n);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:o,parent:i}=e;let{body:a}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");qn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(Pb)&&(a=[vf(45),...a.filter(u=>!Pb(u))]);const l=()=>`[${o?"^":""}${a.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||qn.bugNestedClassIgnoresNegation)&&!o){const f=a.filter(c=>c.type==="CharacterClass"&&c.kind==="union"&&c.negate);if(f.length){const c=$n(),d=c.body[0];return c.parent=i,d.parent=c,a=a.filter(h=>!f.includes(h)),e.body=a,a.length?(e.parent=d,d.body.push(e)):c.body.pop(),f.forEach(h=>{const y=fi({body:[h]});h.parent=y,y.parent=c,c.body.push(y)}),n(c)}}t.inCharClass=!0;const u=l();return t.inCharClass=!1,u}const s=a[0];if(r==="union"&&!o&&s&&((!t.useFlagV||!t.verbose)&&i.kind==="union"&&!(qn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&i.kind==="intersection"&&a.length===1&&s.type!=="CharacterClassRange"))return a.map(n).join("");if(!t.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},i=xi(n,o),a=xi(r,o),l=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const s=l_(e);lz(s).forEach(f=>{l.add(Array.isArray(f)?`${xi(f[0],o)}-${xi(f[1],o)}`:xi(f,o))})}return`${i}-${a}${[...l].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":Ee`[^\n]`;if(e==="digit")return t?Ee`\D`:Ee`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&e_.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ee`\P`:Ee`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Ee`\W`:Ee`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},o,i){const a=o.currentFlags;n&&(o.currentFlags=xc(a,n));const l=t.map(i).join("|"),s=!o.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?l:`(?${sz(e,n,o.useFlagMods)}${l})`;return o.currentFlags=a,s},LookaroundAssertion({body:e,kind:t,negate:n},r,o){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,n){return n(e.body)+uz(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Ee`\g<${t}&R=${r}>`}},rz=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),oz=new Set(["-","\\","]","^","["]),iz=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Nb=new Map([[9,Ee`\t`],[10,Ee`\n`],[11,Ee`\v`],[12,Ee`\f`],[13,Ee`\r`],[8232,Ee`\u2028`],[8233,Ee`\u2029`],[65279,Ee`\uFEFF`]]),az=new RegExp("^\\p{Cased}$","u");function Sm(e){return az.test(e)}function l_(e,t){const n=!!(t!=null&&t.firstOnly),r=e.min.value,o=e.max.value,i=[];if(r<65&&(o===65535||o>=131071)||r===65536&&o>=131071)return i;for(let a=r;a<=o;a++){const l=bt(a);if(!Sm(l))continue;const s=Jw(l).filter(u=>{const f=u.codePointAt(0);return f<r||f>o});if(s.length&&(i.push(...s),n))break}return i}function xi(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Nb.has(e))return Nb.get(e);if(e<32||e>126&&e<160||e>262143||t&&cz(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const o=n?r?iz:oz:rz,i=bt(e);return(o.has(i)?"\\":"")+i}function lz(e){const t=e.map(o=>o.codePointAt(0)).sort((o,i)=>o-i),n=[];let r=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?r??(r=t[o]):r===null?n.push(t[o]):(n.push([r,t[o]]),r=null);return n}function sz(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:o,disable:i}=t;r=(o!=null&&o.ignoreCase?"i":"")+(o!=null&&o.dotAll?"s":"")+(i?"-":"")+(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")}return`${r}:`}function uz({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function Db({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function cz(e){return e>47&&e<58}function Pb({type:e,value:t}){return e==="Character"&&t===45}var no,vr,Xo,ro,Ko,Xl,bp,wo,fz=(wo=class extends RegExp{constructor(n,r,o){var t=(...lB)=>(super(...lB),Po(this,Xl),Po(this,no,new Map),Po(this,vr,null),Po(this,Xo),Po(this,ro,null),Po(this,Ko,null),z(this,"rawOptions",{}),this);const i=!!(o!=null&&o.lazyCompile);if(n instanceof RegExp){if(o)throw new Error("Cannot provide options when copying a regexp");const a=n;t(a,r),Un(this,Xo,a.source),a instanceof wo&&(Un(this,no,Ft(a,no)),Un(this,ro,Ft(a,ro)),Un(this,Ko,Ft(a,Ko)),this.rawOptions=a.rawOptions)}else{const a={hiddenCaptures:[],strategy:null,transfers:[],...o};t(i?"":n,r),Un(this,Xo,n),Un(this,no,hz(a.hiddenCaptures,a.transfers)),Un(this,Ko,a.strategy),this.rawOptions=o??{}}i||Un(this,vr,this)}get source(){return Ft(this,Xo)||"(?:)"}exec(n){if(!Ft(this,vr)){const{lazyCompile:i,...a}=this.rawOptions;Un(this,vr,new wo(Ft(this,Xo),this.flags,a))}const r=this.global||this.sticky,o=this.lastIndex;if(Ft(this,Ko)==="clip_search"&&r&&o){this.lastIndex=0;const i=Of(this,Xl,bp).call(this,n.slice(o));return i&&(dz(i,o,n,this.hasIndices),this.lastIndex+=o),i}return Of(this,Xl,bp).call(this,n)}},no=new WeakMap,vr=new WeakMap,Xo=new WeakMap,ro=new WeakMap,Ko=new WeakMap,Xl=new WeakSet,bp=function(n){Ft(this,vr).lastIndex=this.lastIndex;const r=Mm(wo.prototype,this,"exec").call(Ft(this,vr),n);if(this.lastIndex=Ft(this,vr).lastIndex,!r||!Ft(this,no).size)return r;const o=[...r];r.length=1;let i;this.hasIndices&&(i=[...r.indices],r.indices.length=1);const a=[0];for(let l=1;l<o.length;l++){const{hidden:s,transferTo:u}=Ft(this,no).get(l)??{};if(s?a.push(null):(a.push(r.length),r.push(o[l]),this.hasIndices&&r.indices.push(i[l])),u&&o[l]!==void 0){const f=a[u];if(!f)throw new Error(`Invalid capture transfer to "${f}"`);if(r[f]=o[l],this.hasIndices&&(r.indices[f]=i[l]),r.groups){Ft(this,ro)||Un(this,ro,pz(this.source));const c=Ft(this,ro).get(u);c&&(r.groups[c]=o[l],this.hasIndices&&(r.indices.groups[c]=i[l]))}}}return r},wo);function dz(e,t,n,r){if(e.index+=t,e.input=n,r){const o=e.indices;for(let a=0;a<o.length;a++){const l=o[a];l&&(o[a]=[l[0]+t,l[1]+t])}const i=o.groups;i&&Object.keys(i).forEach(a=>{const l=i[a];l&&(i[a]=[l[0]+t,l[1]+t])})}}function hz(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,o]of t)for(const i of o)Yl(n,i,{}).transferTo=r;return n}function pz(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,o=0,i;for(;i=t.exec(e);){const{0:a,groups:{capture:l,name:s}}=i;a==="["?r++:r?a==="]"&&r--:l&&(o++,s&&n.set(o,s))}return n}function gz(e,t){const n=mz(e,t);return n.options?new fz(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function mz(e,t){const n=Ww(t),r=Vw(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:bm}),o=jI(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=ez(o,n),a=LI(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),l=MI(a.pattern),s=OI(l.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),u={pattern:s.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const f=s.hiddenCaptures.sort((y,v)=>y-v),c=Array.from(s.captureTransfers),d=o._strategy,h=u.pattern.length>=n.lazyCompileLength;(f.length||c.length||d||h)&&(u.options={...f.length&&{hiddenCaptures:f},...c.length&&{transfers:c},...d&&{strategy:d},...h&&{lazyCompile:h}})}return u}function yz(e,t){return gz(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function s_(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=n=>yz(n,{target:t.target})),{createScanner(n){return new NP(n,t)},createString(n){return{content:n}}}}var Em=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function vz(){return 2147483648}function bz(){return typeof performance<"u"?performance.now():Date.now()}const Sz=(e,t)=>e+(t-e%t)%t;async function Ez(e){let t,n;const r={};function o(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function i(h,y,v){r.HEAPU8.copyWithin(h,y,y+v)}function a(h){try{return t.grow(h-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function l(h){const y=r.HEAPU8.length;h=h>>>0;const v=vz();if(h>v)return!1;for(let E=1;E<=4;E*=2){let m=y*(1+.2/E);m=Math.min(m,h+100663296);const p=Math.min(v,Sz(Math.max(h,m),65536));if(a(p))return!0}return!1}const s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,y,v=1024){const E=y+v;let m=y;for(;h[m]&&!(m>=E);)++m;if(m-y>16&&h.buffer&&s)return s.decode(h.subarray(y,m));let p="";for(;y<m;){let b=h[y++];if(!(b&128)){p+=String.fromCharCode(b);continue}const S=h[y++]&63;if((b&224)===192){p+=String.fromCharCode((b&31)<<6|S);continue}const C=h[y++]&63;if((b&240)===224?b=(b&15)<<12|S<<6|C:b=(b&7)<<18|S<<12|C<<6|h[y++]&63,b<65536)p+=String.fromCharCode(b);else{const w=b-65536;p+=String.fromCharCode(55296|w>>10,56320|w&1023)}}return p}function f(h,y){return h?u(r.HEAPU8,h,y):""}const c={emscripten_get_now:bz,emscripten_memcpy_big:i,emscripten_resize_heap:l,fd_write:()=>0};async function d(){const y=await e({env:c,wasi_snapshot_preview1:c});t=y.memory,o(t.buffer),Object.assign(r,y),r.UTF8ToString=f}return await d(),r}var Cz=Object.defineProperty,Rz=(e,t,n)=>t in e?Cz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,St=(e,t,n)=>Rz(e,typeof t!="symbol"?t+"":t,n);let _t=null;function wz(e){throw new Em(e.UTF8ToString(e.getLastOnigError()))}class Cf{constructor(t){St(this,"utf16Length"),St(this,"utf8Length"),St(this,"utf16Value"),St(this,"utf8Value"),St(this,"utf16OffsetToUtf8"),St(this,"utf8OffsetToUtf16");const n=t.length,r=Cf._utf8ByteLength(t),o=r!==n,i=o?new Uint32Array(n+1):null;o&&(i[n]=r);const a=o?new Uint32Array(r+1):null;o&&(a[r]=n);const l=new Uint8Array(r);let s=0;for(let u=0;u<n;u++){const f=t.charCodeAt(u);let c=f,d=!1;if(f>=55296&&f<=56319&&u+1<n){const h=t.charCodeAt(u+1);h>=56320&&h<=57343&&(c=(f-55296<<10)+65536|h-56320,d=!0)}o&&(i[u]=s,d&&(i[u+1]=s),c<=127?a[s+0]=u:c<=2047?(a[s+0]=u,a[s+1]=u):c<=65535?(a[s+0]=u,a[s+1]=u,a[s+2]=u):(a[s+0]=u,a[s+1]=u,a[s+2]=u,a[s+3]=u)),c<=127?l[s++]=c:c<=2047?(l[s++]=192|(c&1984)>>>6,l[s++]=128|(c&63)>>>0):c<=65535?(l[s++]=224|(c&61440)>>>12,l[s++]=128|(c&4032)>>>6,l[s++]=128|(c&63)>>>0):(l[s++]=240|(c&1835008)>>>18,l[s++]=128|(c&258048)>>>12,l[s++]=128|(c&4032)>>>6,l[s++]=128|(c&63)>>>0),d&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=l,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=a}static _utf8ByteLength(t){let n=0;for(let r=0,o=t.length;r<o;r++){const i=t.charCodeAt(r);let a=i,l=!1;if(i>=55296&&i<=56319&&r+1<o){const s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(a=(i-55296<<10)+65536|s-56320,l=!0)}a<=127?n+=1:a<=2047?n+=2:a<=65535?n+=3:n+=4,l&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Rf=class Zn{constructor(t){if(St(this,"id",++Zn.LAST_ID),St(this,"_onigBinding"),St(this,"content"),St(this,"utf16Length"),St(this,"utf8Length"),St(this,"utf16OffsetToUtf8"),St(this,"utf8OffsetToUtf16"),St(this,"ptr"),!_t)throw new Em("Must invoke loadWasm first.");this._onigBinding=_t,this.content=t;const n=new Cf(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Zn._sharedPtrInUse?(Zn._sharedPtr||(Zn._sharedPtr=_t.omalloc(1e4)),Zn._sharedPtrInUse=!0,_t.HEAPU8.set(n.utf8Value,Zn._sharedPtr),this.ptr=Zn._sharedPtr):this.ptr=n.createString(_t)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Zn._sharedPtr?Zn._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};St(Rf,"LAST_ID",0);St(Rf,"_sharedPtr",0);St(Rf,"_sharedPtrInUse",!1);let u_=Rf;class _z{constructor(t){if(St(this,"_onigBinding"),St(this,"_ptr"),!_t)throw new Em("Must invoke loadWasm first.");const n=[],r=[];for(let l=0,s=t.length;l<s;l++){const u=new Cf(t[l]);n[l]=u.createString(_t),r[l]=u.utf8Length}const o=_t.omalloc(4*t.length);_t.HEAPU32.set(n,o/4);const i=_t.omalloc(4*t.length);_t.HEAPU32.set(r,i/4);const a=_t.createOnigScanner(o,i,t.length);for(let l=0,s=t.length;l<s;l++)_t.ofree(n[l]);_t.ofree(i),_t.ofree(o),a===0&&wz(_t),this._onigBinding=_t,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let o=0;if(typeof r=="number"&&(o=r),typeof t=="string"){t=new u_(t);const i=this._findNextMatchSync(t,n,!1,o);return t.dispose(),i}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,r,o){const i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(a===0)return null;const l=i.HEAPU32;let s=a/4;const u=l[s++],f=l[s++],c=[];for(let d=0;d<f;d++){const h=t.convertUtf8OffsetToUtf16(l[s++]),y=t.convertUtf8OffsetToUtf16(l[s++]);c[d]={start:h,end:y,length:y-h}}return{index:u,captureIndices:c}}}function xz(e){return typeof e.instantiator=="function"}function Tz(e){return typeof e.default=="function"}function Az(e){return typeof e.data<"u"}function Oz(e){return typeof Response<"u"&&e instanceof Response}function Mz(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let eu;function Cm(e){if(eu)return eu;async function t(){_t=await Ez(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),xz(r)?r=await r.instantiator(n):Tz(r)?r=await r.default(n):(Az(r)&&(r=r.data),Oz(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await kz(r)(n):r=await Lz(r)(n):Mz(r)?r=await $d(r)(n):r instanceof WebAssembly.Module?r=await $d(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await $d(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return eu=t(),eu}function $d(e){return t=>WebAssembly.instantiate(e,t)}function kz(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Lz(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let c_;function Nz(e){c_=e}function Dz(){return c_}async function f_(e){return e&&await Cm(e),{createScanner(t){return new _z(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new u_(t)}}}const Pz=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:f_,getDefaultWasmLoader:Dz,loadWasm:Cm,setDefaultWasmLoader:Nz},Symbol.toStringTag,{value:"Module"}));var Iz=HN({});$N(Iz,Pz);const d_=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>V(()=>import("./andromeeda-C4gqWexZ.js"),[])},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>V(()=>import("./aurora-x-D-2ljcwZ.js"),[])},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>V(()=>import("./ayu-dark-DYE7WIF3.js"),[])},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>V(()=>import("./ayu-light-BA47KaF1.js"),[])},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>V(()=>import("./ayu-mirage-32ctXXKs.js"),[])},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>V(()=>import("./catppuccin-frappe-DFWUc33u.js"),[])},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>V(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[])},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>V(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[])},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>V(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[])},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>V(()=>import("./dark-plus-C3mMm8J8.js"),[])},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>V(()=>import("./dracula-BzJJZx-M.js"),[])},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>V(()=>import("./dracula-soft-BXkSAIEj.js"),[])},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>V(()=>import("./everforest-dark-BgDCqdQA.js"),[])},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>V(()=>import("./everforest-light-C8M2exoo.js"),[])},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>V(()=>import("./github-dark-DHJKELXO.js"),[])},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>V(()=>import("./github-dark-default-Cuk6v7N8.js"),[])},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>V(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[])},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>V(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[])},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>V(()=>import("./github-light-DAi9KRSo.js"),[])},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>V(()=>import("./github-light-default-D7oLnXFd.js"),[])},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>V(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[])},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>V(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[])},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>V(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[])},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>V(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[])},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>V(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[])},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>V(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[])},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>V(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[])},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>V(()=>import("./horizon-BUw7H-hv.js"),[])},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:()=>V(()=>import("./horizon-bright-CUuTKBJd.js"),[])},{id:"houston",displayName:"Houston",type:"dark",import:()=>V(()=>import("./houston-DnULxvSX.js"),[])},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>V(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[])},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>V(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[])},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>V(()=>import("./kanagawa-wave-DWedfzmr.js"),[])},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>V(()=>import("./laserwave-DUszq2jm.js"),[])},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>V(()=>import("./light-plus-B7mTdjB0.js"),[])},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>V(()=>import("./material-theme-D5KoaKCx.js"),[])},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>V(()=>import("./material-theme-darker-BfHTSMKl.js"),[])},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>V(()=>import("./material-theme-lighter-B0m2ddpp.js"),[])},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>V(()=>import("./material-theme-ocean-CyktbL80.js"),[])},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>V(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[])},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>V(()=>import("./min-dark-CafNBF8u.js"),[])},{id:"min-light",displayName:"Min Light",type:"light",import:()=>V(()=>import("./min-light-CTRr51gU.js"),[])},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>V(()=>import("./monokai-D4h5O-jR.js"),[])},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>V(()=>import("./night-owl-C39BiMTA.js"),[])},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>V(()=>import("./night-owl-light-CMTm3GFP.js"),[])},{id:"nord",displayName:"Nord",type:"dark",import:()=>V(()=>import("./nord-Ddv68eIx.js"),[])},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>V(()=>import("./one-dark-pro-DVMEJ2y_.js"),[])},{id:"one-light",displayName:"One Light",type:"light",import:()=>V(()=>import("./one-light-C3Wv6jpd.js"),[])},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>V(()=>import("./plastic-3e1v2bzS.js"),[])},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>V(()=>import("./poimandres-CS3Unz2-.js"),[])},{id:"red",displayName:"Red",type:"dark",import:()=>V(()=>import("./red-bN70gL4F.js"),[])},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>V(()=>import("./rose-pine-qdsjHGoJ.js"),[])},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>V(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[])},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>V(()=>import("./rose-pine-moon-D4_iv3hh.js"),[])},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>V(()=>import("./slack-dark-BthQWCQV.js"),[])},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>V(()=>import("./slack-ochin-DqwNpetd.js"),[])},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>V(()=>import("./snazzy-light-Bw305WKR.js"),[])},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>V(()=>import("./solarized-dark-DXbdFlpD.js"),[])},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>V(()=>import("./solarized-light-L9t79GZl.js"),[])},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>V(()=>import("./synthwave-84-CbfX1IO0.js"),[])},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>V(()=>import("./tokyo-night-hegEt444.js"),[])},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>V(()=>import("./vesper-DU1UobuO.js"),[])},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>V(()=>import("./vitesse-black-Bkuqu6BP.js"),[])},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>V(()=>import("./vitesse-dark-D0r3Knsf.js"),[])},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>V(()=>import("./vitesse-light-CVO1_9PV.js"),[])}],h_=Object.fromEntries(d_.map(e=>[e.id,e.import])),wf=[{id:"markdown",name:"Markdown",aliases:["md"],import:()=>V(()=>import("./markdown-CKXSK5AY.js"),[])},{id:"mdx",name:"MDX",import:()=>V(()=>import("./mdx-BWRhHdFl.js"),[])},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>V(()=>import("./javascript-XPxc2APE.js"),[])},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>V(()=>import("./typescript-DttGkNCf.js"),[])},{id:"jsx",name:"JSX",import:()=>V(()=>import("./jsx-BGEKFWBk.js"),[])},{id:"tsx",name:"TSX",import:()=>V(()=>import("./tsx-Dio8iE-N.js"),[])},{id:"html",name:"HTML",import:()=>V(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]))},{id:"css",name:"CSS",import:()=>V(()=>import("./css-CLj8gQPS.js"),[])},{id:"scss",name:"SCSS",import:()=>V(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([3,2]))},{id:"less",name:"Less",import:()=>V(()=>import("./less-C76OjOdF.js"),[])},{id:"vue",name:"Vue",import:()=>V(()=>import("./vue-DMJtu8ND.js"),__vite__mapDeps([4,2,1,5,6,0]))},{id:"svelte",name:"Svelte",import:()=>V(()=>import("./svelte-DR4MIrkg.js"),__vite__mapDeps([7,1,5,2]))},{id:"json",name:"JSON",import:()=>V(()=>import("./json-CjLXzM_z.js"),[])},{id:"jsonc",name:"JSON with Comments",import:()=>V(()=>import("./jsonc-BYi4HS05.js"),[])},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>V(()=>import("./yaml-B92AUxDB.js"),[])},{id:"toml",name:"TOML",import:()=>V(()=>import("./toml-Btlk-g9G.js"),[])},{id:"xml",name:"XML",import:()=>V(()=>import("./xml-DtyAt_xK.js"),__vite__mapDeps([8,9]))},{id:"ini",name:"INI",aliases:["properties"],import:()=>V(()=>import("./ini-DOGW4-0C.js"),[])},{id:"python",name:"Python",aliases:["py"],import:()=>V(()=>import("./python-DgE28U1V.js"),[])},{id:"java",name:"Java",import:()=>V(()=>import("./java-B2AjWfgk.js"),[])},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>V(()=>import("./kotlin-DwKqsDKK.js"),[])},{id:"go",name:"Go",import:()=>V(()=>import("./go-C27-OAKa.js"),[])},{id:"rust",name:"Rust",aliases:["rs"],import:()=>V(()=>import("./rust-DJErdhjk.js"),[])},{id:"c",name:"C",import:()=>V(()=>import("./c-CyUOlKFr.js"),[])},{id:"cpp",name:"C++",aliases:["c++"],import:()=>V(()=>import("./cpp-Bp17OOWP.js"),__vite__mapDeps([10,11,12]))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>V(()=>import("./csharp-DieIJxYJ.js"),[])},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>V(()=>import("./ruby-CM5gBc7p.js"),__vite__mapDeps([13,0,1,2,8,9,12,14,5,15,16,10,11,17,18,19]))},{id:"php",name:"PHP",import:()=>V(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([20,0,1,2,8,9,12,6]))},{id:"swift",name:"Swift",import:()=>V(()=>import("./swift-DjrYMa62.js"),[])},{id:"lua",name:"Lua",import:()=>V(()=>import("./lua-JmSlR1pZ.js"),__vite__mapDeps([18,11]))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>V(()=>import("./shellscript-CE-5zpiL.js"),[])},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>V(()=>import("./shellsession-BhddCRKA.js"),__vite__mapDeps([21,17]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>V(()=>import("./powershell-DdRAnR4Z.js"),[])},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>V(()=>import("./docker-DIG_IqVK.js"),[])},{id:"nginx",name:"Nginx",import:()=>V(()=>import("./nginx-bBKbG2uI.js"),__vite__mapDeps([22,18,11]))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>V(()=>import("./make-s9FKP0VE.js"),[])},{id:"cmake",name:"CMake",import:()=>V(()=>import("./cmake-Cv5ljclQ.js"),[])},{id:"sql",name:"SQL",import:()=>V(()=>import("./sql-CKXjX23X.js"),[])},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>V(()=>import("./graphql-By4-2MiP.js"),__vite__mapDeps([14,1,5,15,16]))},{id:"diff",name:"Diff",import:()=>V(()=>import("./diff-BlzBhZx2.js"),[])},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>V(()=>import("./proto-BZ_yZy5q.js"),[])},{id:"wasm",name:"WebAssembly",import:()=>V(()=>import("./wasm-LUzQYg3H.js"),[])}],p_=wf,g_=Object.fromEntries(wf.map(e=>[e.id,e.import])),zz=Object.fromEntries(wf.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))??[]})),m_={...g_,...zz},Uz=g_,Bz=Object.fromEntries(p_.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.id]))??[]})),y_=OP({langs:m_,themes:h_,engine:s_}),{codeToHtml:Hz,codeToHast:Gz,codeToTokensBase:$z,codeToTokens:jz,codeToTokensWithThemes:Vz,getSingletonHighlighter:Fz,getLastGrammarState:qz}=kP(y_),tU=Object.freeze(Object.defineProperty({__proto__:null,bundledLanguages:m_,bundledLanguagesAlias:Bz,bundledLanguagesBase:Uz,bundledLanguagesInfo:p_,bundledThemes:h_,bundledThemesInfo:d_,codeToHast:Gz,codeToHtml:Hz,codeToTokens:jz,codeToTokensBase:$z,codeToTokensWithThemes:Vz,createCssVariablesTheme:LP,createHighlighter:y_,createJavaScriptRegexEngine:s_,createOnigurumaEngine:f_,getLastGrammarState:qz,getSingletonHighlighter:Fz,getTokenStyleObject:ql,loadWasm:Cm,normalizeTheme:gf,stringifyTokenStyle:Cc,supportedLanguagesInfo:wf},Symbol.toStringTag,{value:"Module"})),v_=g.createContext(void 0);function Do(e){const t=g.useContext(v_);if(t===void 0&&!e)throw new Error(et(47));return t}function Yz(){return{...em(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}const Xz={...tm,disabled:fe(e=>e.disabled),instantType:fe(e=>e.instantType),openMethod:fe(e=>e.openMethod),openChangeReason:fe(e=>e.openChangeReason),modal:fe(e=>e.modal),stickIfOpen:fe(e=>e.stickIfOpen),titleElementId:fe(e=>e.titleElementId),descriptionElementId:fe(e=>e.descriptionElementId),openOnHover:fe(e=>e.openOnHover),closeDelay:fe(e=>e.closeDelay)};class _f extends nf{constructor(n){const r={...Yz(),...n};r.open&&(n==null?void 0:n.mounted)===void 0&&(r.mounted=!0);super(r,{popupRef:g.createRef(),backdropRef:g.createRef(),internalBackdropRef:g.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:g.createRef(),beforeContentFocusGuardRef:g.createRef(),stickIfOpenTimeout:new Xn,triggerElements:new ps},Xz);z(this,"setOpen",(n,r)=>{var f,c;const o=r.reason===yt,i=r.reason===Vn&&r.event.detail===0,a=!n&&(r.reason===ds||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(c=(f=this.context).onOpenChange)==null||c.call(f,n,r),r.isCanceled)return;const l={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested,triggerElement:r.trigger},s=this.state.floatingRootContext.context.events;s==null||s.emit("openchange",l);const u=()=>{var y;const d={open:n,openChangeReason:r.reason},h=((y=r.trigger)==null?void 0:y.id)??null;(h||n)&&(d.activeTriggerId=h,d.activeTriggerElement=r.trigger??null),this.update(d)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(FC,()=>{this.set("stickIfOpen",!1)}),Gt.flushSync(u)):u(),i||a?this.set("instantType",i?"click":"dismiss"):r.reason===Br?this.set("instantType","focus"):this.set("instantType",void 0)});z(this,"disposeEffect",()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(n,r){const o=rn(()=>n??new _f(r)).current;return Mg(o.disposeEffect),o}}function Ib({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:i,modal:a=!1,handle:l,triggerId:s,defaultTriggerId:u=null}=e,f=_f.useStore(l==null?void 0:l.store,{open:n??r,modal:a,activeTriggerId:s!==void 0?s:u});f.useControlledProp("open",n,r),f.useControlledProp("activeTriggerId",s,u);const c=f.useState("open"),d=f.useState("positionerElement"),h=f.useState("payload"),y=f.useState("openChangeReason");f.useContextCallback("onOpenChange",o),f.useContextCallback("onOpenChangeComplete",i);const{openMethod:v,triggerProps:E,reset:m}=XR(c);Wg(f);const{forceUnmount:p}=Jg(c,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null}),m()});qR(c&&a===!0&&y!==yt&&v!=="touch",d),g.useEffect(()=>{c||f.context.stickIfOpenTimeout.clear()},[f,c]);const b=g.useCallback(M=>{const x=xe(M);return x.preventUnmountOnClose=()=>{f.set("preventUnmountingOnClose",!0)},x},[f]),S=g.useCallback(()=>{f.setOpen(!1,b(ui))},[f,b]);g.useImperativeHandle(e.actionsRef,()=>({unmount:p,close:S}),[p,S]);const C=nm({popupStore:f,onOpenChange:f.setOpen}),w=Kg(C,{outsidePressEvent:{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),R=SR(C),{getReferenceProps:_,getFloatingProps:O,getTriggerProps:k}=Da([w,R]),I=g.useMemo(()=>_(E),[_,E]),U=g.useMemo(()=>k(E),[k,E]),A=g.useMemo(()=>O(),[O]);f.useSyncedValues({modal:a,openMethod:v,activeTriggerProps:I,inactiveTriggerProps:U,popupProps:A,floatingRootContext:C,nested:ar()!=null});const N=g.useMemo(()=>({store:f}),[f]);return ee.jsx(v_.Provider,{value:N,children:typeof t=="function"?t({payload:h}):t})}function nU(e){return Do(!0)?ee.jsx(Ib,{props:e}):ee.jsx(jC,{children:ee.jsx(Ib,{props:e})})}const Kz=300,rU=g.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:a=!0,handle:l,payload:s,openOnHover:u=!1,delay:f=Kz,closeDelay:c=0,id:d,...h}=t,y=Do(!0),v=(l==null?void 0:l.store)??(y==null?void 0:y.store);if(!v)throw new Error(et(74));const E=Si(d),m=v.useState("isTriggerActive",E),p=v.useState("floatingRootContext"),b=v.useState("isOpenedByTrigger",E),S=g.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=Zg(E,S,v,{payload:s,disabled:i,openOnHover:u,closeDelay:c}),R=v.useState("openChangeReason"),_=v.useState("stickIfOpen"),O=v.useState("openMethod"),k=rf(p,{enabled:p!=null&&u&&(O!=="touch"||R!==Vn),mouseOnly:!0,move:!1,handleClose:af(),restMs:f,delay:{close:c},triggerElementRef:S,isActiveTrigger:m}),I=Yg(p,{enabled:p!=null,stickIfOpen:_}),U=Da([I]),A=v.useState("triggerProps",w),N=g.useMemo(()=>({disabled:i,open:b}),[i,b]),{getButtonProps:M,buttonRef:x}=ys({disabled:i,native:a}),D=g.useMemo(()=>({open(B){return B&&R===Vn?tp.open(B):im.open(B)}}),[R]),T=He("button",t,{state:N,ref:[x,n,C,S],props:[U.getReferenceProps(),k,A,{[qC]:"",id:E},h,M],stateAttributesMapping:D}),L=g.useRef(null),P=W(B=>{Gt.flushSync(()=>{v.setOpen(!1,xe(Br,B.nativeEvent,B.currentTarget))});const $=UC(L.current);$==null||$.focus()}),q=W(B=>{var ue;const $=v.select("positionerElement");if($&&ni(B,$))(ue=v.context.beforeContentFocusGuardRef.current)==null||ue.focus();else{Gt.flushSync(()=>{v.setOpen(!1,xe(Br,B.nativeEvent,B.currentTarget))});let te=zC(S.current);for(;te!==null&&Re($,te)||te!=null&&te.hasAttribute("aria-hidden");){const ce=te;if(te=Jc(te),te===ce)break}te==null||te.focus()}});return m?ee.jsxs(g.Fragment,{children:[ee.jsx(Fn,{ref:L,onFocus:P}),ee.jsx(g.Fragment,{children:T},E),ee.jsx(Fn,{ref:v.context.triggerFocusTargetRef,onFocus:q})]}):ee.jsx(g.Fragment,{children:T},E)}),b_=g.createContext(void 0);function Qz(){const e=g.useContext(b_);if(e===void 0)throw new Error(et(45));return e}const oU=g.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:i}=Do();return i.useState("mounted")||r?ee.jsx(b_.Provider,{value:r,children:ee.jsx(JC,{ref:n,...o,renderGuards:!1})}):null}),S_=g.createContext(void 0);function E_(){const e=g.useContext(S_);if(!e)throw new Error(et(46));return e}const iU=g.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:a="absolute",side:l="bottom",align:s="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:c="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:y=!1,disableAnchorTracking:v=!1,collisionAvoidance:E=Hg,...m}=t,{store:p}=Do(),b=Qz(),S=Bg(),C=p.useState("floatingRootContext"),w=p.useState("mounted"),R=p.useState("open"),_=p.useState("openChangeReason"),O=p.useState("activeTriggerElement"),k=p.useState("modal"),I=p.useState("positionerElement"),U=p.useState("instantType"),A=p.useState("transitionStatus"),N=g.useRef(null),M=hs(I,!1,!1),x=am({anchor:i,floatingRootContext:C,positionMethod:a,mounted:w,side:l,sideOffset:u,align:s,alignOffset:f,arrowPadding:h,collisionBoundary:c,collisionPadding:d,sticky:y,disableAnchorTracking:v,keepMounted:b,nodeId:S,collisionAvoidance:E,adaptiveOrigin:_R}),D=g.useMemo(()=>{const $={};return R||($.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...x.positionerStyles,...$}}},[R,w,x.positionerStyles]),T=g.useMemo(()=>({props:D,...x}),[D,x]),L=C==null?void 0:C.select("domReferenceElement");ie(()=>{const $=L,ue=N.current;if($&&(N.current=$),ue&&$&&$!==ue){p.set("instantType",void 0);const te=new AbortController;return M(()=>{p.set("instantType","trigger-change")},te.signal),()=>{te.abort()}}},[L,M,p]);const P=g.useMemo(()=>({open:R,side:T.side,align:T.align,anchorHidden:T.anchorHidden,instant:U}),[R,T.side,T.align,T.anchorHidden,U]),q=g.useCallback($=>{p.set("positionerElement",$)},[p]),B=He("div",t,{state:P,props:[T.props,gs(A),m],ref:[n,q],stateAttributesMapping:Vr});return ee.jsxs(S_.Provider,{value:T,children:[w&&k===!0&&_!==yt&&ee.jsx(FR,{ref:p.context.internalBackdropRef,inert:ms(!R),cutout:O}),ee.jsx($C,{id:S,children:B})]})}),Zz={...Vr,...Pa},aU=g.forwardRef(function(t,n){const{className:r,render:o,initialFocus:i,finalFocus:a,...l}=t,{store:s}=Do(),u=E_(),f=IR()!=null,c=sf(),d=s.useState("open"),h=s.useState("openMethod"),y=s.useState("instantType"),v=s.useState("transitionStatus"),E=s.useState("popupProps"),m=s.useState("titleElementId"),p=s.useState("descriptionElementId"),b=s.useState("modal"),S=s.useState("mounted"),C=s.useState("openChangeReason"),w=s.useState("popupElement"),R=s.useState("payload"),_=s.useState("positionerElement"),O=s.useState("activeTriggerElement"),k=s.useState("floatingRootContext");Na({open:d,ref:s.context.popupRef,onComplete(){var B,$;d&&(($=(B=s.context).onOpenChangeComplete)==null||$.call(B,!0))}});const I=s.useState("disabled"),U=s.useState("openOnHover"),A=s.useState("closeDelay");rm(k,{enabled:U&&!I,closeDelay:A});function N(B){return B==="touch"?s.context.popupRef.current:!0}const M=i===void 0?N:i,x=g.useMemo(()=>({open:d,side:u.side,align:u.align,instant:y,transitionStatus:v}),[d,u.side,u.align,y,v]),D=g.useCallback(B=>{s.set("popupElement",B)},[s]);function T(){k.context.events.emit("measure-layout")}function L(B,$){k.context.events.emit("measure-layout-complete",{previousDimensions:B,nextDimensions:$})}const P=g.useCallback(()=>s.context.triggerElements.size>1,[s]);TR({popupElement:w,positionerElement:_,mounted:S,content:R,enabled:P,onMeasureLayout:T,onMeasureLayoutComplete:L,side:u.side,direction:c});const q=He("div",t,{state:x,ref:[n,s.context.popupRef,D],props:[E,{"aria-labelledby":m,"aria-describedby":p,onKeyDown(B){f&&jR.has(B.key)&&B.stopPropagation()}},gs(v),l],stateAttributesMapping:Zz});return ee.jsx(eR,{context:k,openInteractionType:h,modal:b==="trap-focus",disabled:!S||C===yt,initialFocus:M,returnFocus:a,restoreFocus:"popup",previousFocusableElement:at(O)?O:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:q})}),lU=g.forwardRef(function(t,n){const{className:r,render:o,...i}=t,{store:a}=Do(),l=a.useState("open"),{arrowRef:s,side:u,align:f,arrowUncentered:c,arrowStyles:d}=E_(),h=g.useMemo(()=>({open:l,side:u,align:f,uncentered:c}),[l,u,f,c]);return He("div",t,{state:h,ref:[n,s],props:[{style:d,"aria-hidden":!0},i],stateAttributesMapping:Vr})}),Wz={...Vr,...Pa},sU=g.forwardRef(function(t,n){const{className:r,render:o,...i}=t,{store:a}=Do(),l=a.useState("open"),s=a.useState("mounted"),u=a.useState("transitionStatus"),f=a.useState("openChangeReason"),c=g.useMemo(()=>({open:l,transitionStatus:u}),[l,u]);return He("div",t,{state:c,ref:[a.context.backdropRef,n],props:[{role:"presentation",hidden:!s,style:{pointerEvents:f===yt?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:Wz})});let zb=function(e){return e.popupWidth="--popup-width",e.popupHeight="--popup-height",e}({});const Jz={activationDirection:e=>e?{"data-activation-direction":e}:null},uU=g.forwardRef(function(t,n){const{render:r,className:o,children:i,...a}=t,{store:l}=Do(),s=l.useState("activeTriggerElement"),u=l.useState("open"),f=l.useState("floatingRootContext"),c=AR(u?s:null),d=g.useRef(null),[h,y]=g.useState(null),[v,E]=g.useState(null),m=g.useRef(null),p=g.useRef(null),b=hs(m,!0,!1),S=bi(),[C,w]=g.useState(null),[R,_]=g.useState(!1);ie(()=>{const M=m.current;if(!M)return;const x=document.createElement("div");for(const D of Array.from(M.childNodes))x.appendChild(D.cloneNode(!0));d.current=x});const O=W(()=>{var M,x,D;(M=m.current)==null||M.style.setProperty("animation","none"),(x=m.current)==null||x.style.setProperty("transition","none"),(D=p.current)==null||D.style.setProperty("display","none")}),k=W(M=>{var x,D,T;(x=m.current)==null||x.style.removeProperty("animation"),(D=m.current)==null||D.style.removeProperty("transition"),(T=p.current)==null||T.style.removeProperty("display"),C||w(M.previousDimensions)});g.useEffect(()=>(f.context.events.on("measure-layout",O),f.context.events.on("measure-layout-complete",k),()=>{f.context.events.off("measure-layout",O),f.context.events.off("measure-layout-complete",k)}),[f,O,k]);const I=g.useRef(null);ie(()=>{if(s&&c&&s!==c&&I.current!==s&&d.current){y(d.current),_(!0);const M=t3(c,s);E(M),S.request(()=>{S.request(()=>{_(!1),b(()=>{y(null),w(null),d.current=null})})}),I.current=s}},[s,c,h,b,S]);const U=h!=null;let A;U?A=ee.jsxs(g.Fragment,{children:[ee.jsx("div",{"data-previous":!0,inert:ms(!0),ref:p,style:{[zb.popupWidth]:`${C==null?void 0:C.width}px`,[zb.popupHeight]:`${C==null?void 0:C.height}px`,position:"absolute"},"data-ending-style":R?void 0:""},"previous"),ee.jsx("div",{"data-current":!0,ref:m,"data-starting-style":R?"":void 0,children:i},"current")]}):A=ee.jsx("div",{"data-current":!0,ref:m,children:i},"current"),ie(()=>{const M=p.current;!M||!h||M.replaceChildren(...Array.from(h.childNodes))},[h]);const N=g.useMemo(()=>({activationDirection:e3(v),transitioning:U}),[v,U]);return He("div",t,{state:N,ref:n,props:[a,{children:A}],stateAttributesMapping:Jz})});function e3(e){if(e)return`${Ub(e.horizontal,5,"right","left")} ${Ub(e.vertical,5,"down","up")}`}function Ub(e,t,n,r){return e>t?n:e<-t?r:""}function t3(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o={x:n.left+n.width/2,y:n.top+n.height/2},i={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:i.x-o.x,vertical:i.y-o.y}}class n3{constructor(){this.store=new _f}open(t){const n=t?this.store.context.triggerElements.getById(t)??void 0:void 0;if(t&&!n)throw new Error(et(80,t));this.store.setOpen(!0,xe(ui,void 0,n))}close(){this.store.setOpen(!1,xe(ui,void 0,void 0))}get isOpen(){return this.store.state.open}}function cU(){return new n3}let Bb=0;function C_(e){return Bb+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Bb}`}const Rm=g.createContext(void 0);function wm(){const e=g.useContext(Rm);if(!e)throw new Error(et(73));return e}function jd(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const fU=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:i}=t,[a,l]=g.useState([]),[s,u]=g.useState(!1),[f,c]=g.useState(!1),[d,h]=g.useState(null);a.length===0&&(s&&u(!1),f&&c(!1));const y=s||f,v=g.useRef(new Map),E=g.useRef(null),m=g.useRef(!0),p=g.useRef(!1);function b(A){var T,L;const N=en(Xt(E.current));if(!E.current||!Re(E.current,N)||!oc(N))return;const M=a.findIndex(P=>P.id===A);let x=null,D=M+1;for(;D<a.length;){if(a[D].transitionStatus!=="ending"){x=a[D];break}D+=1}if(!x)for(D=M-1;D>=0;){if(a[D].transitionStatus!=="ending"){x=a[D];break}D-=1}x?(L=(T=x.ref)==null?void 0:T.current)==null||L.focus():d==null||d.focus({preventScroll:!0})}const S=W(()=>{p.current||(p.current=!0,v.current.forEach(A=>{if(A.timeout){A.timeout.clear();const N=Date.now()-A.start,M=A.delay-N;A.remaining=M>0?M:0}}))}),C=W(()=>{p.current&&(p.current=!1,v.current.forEach((A,N)=>{A.remaining=A.remaining>0?A.remaining:A.delay,A.timeout??(A.timeout=Xn.create()),A.timeout.start(A.remaining,()=>{v.current.delete(N),A.callback()}),A.start=Date.now()}))}),w=W(A=>{var x;l(D=>{const T=D.map(P=>P.id===A?{...P,transitionStatus:"ending",height:0}:P),L=T.filter(P=>P.transitionStatus!=="ending");return T.map(P=>{if(P.transitionStatus==="ending")return P;const q=L.indexOf(P)>=o;return{...P,limited:q}})});const N=v.current.get(A);N&&N.timeout&&(N.timeout.clear(),v.current.delete(A));const M=a.find(D=>D.id===A);(x=M==null?void 0:M.onClose)==null||x.call(M),b(A),a.length===1&&(u(!1),c(!1))}),R=W(A=>{var M;l(x=>x.filter(D=>D.id!==A));const N=a.find(x=>x.id===A);(M=N==null?void 0:N.onRemove)==null||M.call(N)}),_=W((A,N,M)=>{const x=Date.now(),D=m.current&&!s&&!f,T=D?Xn.create():void 0;T==null||T.start(N,()=>{v.current.delete(A),M()}),v.current.set(A,{timeout:T,start:D?x:0,delay:N,remaining:N,callback:M})}),O=W(A=>{const N=A.id||C_("toast"),M={...A,id:N,transitionStatus:"starting"};l(D=>{const T=[M,...D],L=T.filter(P=>P.transitionStatus!=="ending");if(L.length>o){const P=L.length-o,q=L.slice(-P);return T.map(B=>q.some($=>$.id===B.id)?{...B,limited:!0}:{...B,limited:!1})}return T.map(P=>({...P,limited:!1}))});const x=M.timeout??r;return M.type!=="loading"&&x>0&&_(N,x,()=>w(N)),(s||f||!m.current)&&S(),N}),k=W((A,N)=>{l(M=>M.map(x=>x.id===A?{...x,...N}:x))}),I=W((A,N)=>{const M=jd(N.loading),x=O({...M,type:"loading"}),D=A.then(T=>{const L=jd(N.success,T);k(x,{...L,type:"success"});const P=L.timeout??r;return P>0&&_(x,P,()=>w(x)),(s||f||!m.current)&&S(),T}).catch(T=>{const L=jd(N.error,T);k(x,{...L,type:"error"});const P=L.timeout??r;return P>0&&_(x,P,()=>w(x)),(s||f||!m.current)&&S(),Promise.reject(T)});return{}.hasOwnProperty.call(N,"setPromise")&&N.setPromise(D),D});g.useEffect(function(){return i?i[" subscribe"](({action:M,options:x})=>{const D=x.id;M==="promise"&&x.promise?I(x.promise,x):M==="update"&&D?k(D,x):M==="close"&&D?w(D):O(x)}):void 0},[O,k,_,r,i,I,w]);const U=g.useMemo(()=>({toasts:a,setToasts:l,hovering:s,setHovering:u,focused:f,setFocused:c,expanded:y,add:O,close:w,remove:R,update:k,promise:I,pauseTimers:S,resumeTimers:C,prevFocusElement:d,setPrevFocusElement:h,viewportRef:E,scheduleTimer:_,windowFocusedRef:m}),[O,w,f,s,y,S,d,I,R,C,_,a,k]);return ee.jsx(Rm.Provider,{value:U,children:n})},r3=g.createContext(void 0);let o3=function(e){return e.frontmostHeight="--toast-frontmost-height",e}({});const dU=g.forwardRef(function(t,n){var T;const{render:r,className:o,children:i,...a}=t,{toasts:l,pauseTimers:s,resumeTimers:u,setHovering:f,setFocused:c,viewportRef:d,windowFocusedRef:h,prevFocusElement:y,setPrevFocusElement:v,expanded:E,focused:m}=wm(),p=g.useRef(!1),b=g.useRef(!1),S=l.length,C=((T=l[0])==null?void 0:T.height)??0,w=g.useMemo(()=>l.some(L=>L.transitionStatus==="ending"),[l]);g.useEffect(()=>{if(!d.current)return;function L(q){var B;S!==0&&q.key==="F6"&&q.target!==d.current&&(q.preventDefault(),v(en(Xt(d.current))),(B=d.current)==null||B.focus({preventScroll:!0}),s(),c(!0))}const P=nt(d.current);return P.addEventListener("keydown",L),()=>{P.removeEventListener("keydown",L)}},[s,c,v,S,d]),g.useEffect(()=>{if(!d.current||!S)return;const L=nt(d.current);function P(B){B.target===L&&(h.current=!1,s())}function q(B){if(B.relatedTarget||B.target===L)return;const $=At(B),ue=en(Xt(d.current));(!Re(d.current,$)||!oc(ue))&&u(),setTimeout(()=>{h.current=!0})}return L.addEventListener("blur",P,!0),L.addEventListener("focus",q,!0),()=>{L.removeEventListener("blur",P,!0),L.removeEventListener("focus",q,!0)}},[s,u,d,h,c,S]),g.useEffect(()=>{const L=d.current;if(!L||S===0)return;const P=Xt(L);function q(B){if(B.pointerType!=="touch")return;const $=At(B);Re(L,$)||(u(),f(!1),c(!1))}return P.addEventListener("pointerdown",q,!0),()=>{P.removeEventListener("pointerdown",q,!0)}},[S,u,c,f,d]);function R(L){var P,q,B;d.current&&(p.current=!0,L.relatedTarget===d.current?(B=(q=(P=l[0])==null?void 0:P.ref)==null?void 0:q.current)==null||B.focus():y==null||y.focus({preventScroll:!0}))}function _(L){L.key==="Tab"&&L.shiftKey&&L.target===d.current&&(L.preventDefault(),y==null||y.focus({preventScroll:!0}),u())}g.useEffect(()=>{!h.current||w||!b.current||(u(),f(!1),b.current=!1)},[w,u,f,h]);function O(){s(),f(!0),b.current=!1}function k(){l.some(L=>L.transitionStatus==="ending")?b.current=!0:(u(),f(!1))}function I(){if(p.current){p.current=!1;return}m||oc(Xt(d.current).activeElement)&&(c(!0),s())}function U(L){!m||Re(d.current,L.relatedTarget)||(c(!1),u())}const A={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:O,onMouseMove:O,onMouseLeave:k,onFocus:I,onBlur:U,onKeyDown:_,onClick:I},N=g.useMemo(()=>({expanded:E}),[E]),M=He("div",t,{ref:[n,d],state:N,props:[A,{style:{[o3.frontmostHeight]:C?`${C}px`:void 0}},a,{children:ee.jsxs(g.Fragment,{children:[S>0&&y&&ee.jsx(Fn,{onFocus:R}),i,S>0&&y&&ee.jsx(Fn,{onFocus:R})]})}]}),x=g.useMemo(()=>({viewportRef:d}),[d]),D=g.useMemo(()=>l.filter(L=>L.priority==="high"),[l]);return ee.jsxs(r3.Provider,{value:x,children:[S>0&&y&&ee.jsx(Fn,{onFocus:R}),M,!m&&D.length>0&&ee.jsx("div",{style:Vg,children:D.map(L=>ee.jsxs("div",{role:"alert","aria-atomic":!0,children:[ee.jsx("div",{children:L.title}),ee.jsx("div",{children:L.description})]},L.id))})]})}),R_=g.createContext(void 0);function di(){const e=g.useContext(R_);if(!e)throw new Error(et(66));return e}let Bo=function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e}({});const i3={...Pa,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Za=40,a3=10,Yr=.5,l3=1;function Hb(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function s3(e){const n=window.getComputedStyle(e).transform;let r=0,o=0,i=1;if(n&&n!=="none"){const a=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(a){const l=a[1].split(", ").map(parseFloat);l.length===6?(r=l[4],o=l[5],i=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(r=l[12],o=l[13],i=l[0])}}return{x:r,y:o,scale:i}}const hU=g.forwardRef(function(t,n){var ae;const{toast:r,render:o,className:i,swipeDirection:a=["down","right"],...l}=t,s=((ae=r.positionerProps)==null?void 0:ae.anchor)!==void 0;let u=[];s||(u=Array.isArray(a)?a:[a]);const f=u.length>0,{toasts:c,focused:d,close:h,remove:y,setToasts:v,pauseTimers:E,expanded:m,setHovering:p}=wm(),[b,S]=g.useState(void 0),[C,w]=g.useState(!1),[R,_]=g.useState(!1),[O,k]=g.useState(!1),[I,U]=g.useState({x:0,y:0}),[A,N]=g.useState({x:0,y:0,scale:1}),[M,x]=g.useState(),[D,T]=g.useState(),[L,P]=g.useState(null),q=g.useRef(null),B=g.useRef({x:0,y:0}),$=g.useRef({x:0,y:0,scale:1}),ue=g.useRef(void 0),te=g.useRef(0),ce=g.useRef(!1),oe=g.useRef({x:0,y:0}),J=g.useRef(!1),Se=g.useMemo(()=>c.indexOf(r),[r,c]),Ae=g.useMemo(()=>c.filter(j=>j.transitionStatus!=="ending").indexOf(r),[r,c]),G=g.useMemo(()=>c.slice(0,c.indexOf(r)).reduce((j,Z)=>j+(Z.height||0),0),[c,r]);Na({open:r.transitionStatus!=="ending",ref:q,onComplete(){r.transitionStatus==="ending"&&y(r.id)}});const Y=W((j=!1)=>{const Z=q.current;if(!Z)return;const ye=Z.style.height;Z.style.height="auto";const ge=Z.offsetHeight;Z.style.height=ye;function be(){v(Te=>Te.map(De=>De.id===r.id?{...De,ref:q,height:ge,transitionStatus:void 0}:De))}j?Gt.flushSync(be):be()});ie(Y,[Y]);function ne(j,Z){let ye=j,ge=Z;return!u.includes("left")&&!u.includes("right")?ye=j>0?j**Yr:-(Math.abs(j)**Yr):(!u.includes("right")&&j>0&&(ye=j**Yr),!u.includes("left")&&j<0&&(ye=-(Math.abs(j)**Yr))),!u.includes("up")&&!u.includes("down")?ge=Z>0?Z**Yr:-(Math.abs(Z)**Yr):(!u.includes("down")&&Z>0&&(ge=Z**Yr),!u.includes("up")&&Z<0&&(ge=-(Math.abs(Z)**Yr))),{x:ye,y:ge}}function Ne(j){var ge;if(j.button!==0)return;j.pointerType==="touch"&&E();const Z=At(j.nativeEvent);if(!(Z&&Z.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(ce.current=!1,ue.current=void 0,te.current=0,B.current={x:j.clientX,y:j.clientY},oe.current=B.current,q.current){const be=s3(q.current);$.current=be,N(be),U({x:be.x,y:be.y})}p(!0),w(!0),_(!1),P(null),J.current=!0,(ge=q.current)==null||ge.setPointerCapture(j.pointerId)}}function pe(j){if(!C)return;j.preventDefault(),J.current&&(B.current={x:j.clientX,y:j.clientY},J.current=!1);const{clientY:Z,clientX:ye,movementX:ge,movementY:be}=j;(be<0&&Z>oe.current.y||be>0&&Z<oe.current.y)&&(oe.current={x:oe.current.x,y:Z}),(ge<0&&ye>oe.current.x||ge>0&&ye<oe.current.x)&&(oe.current={x:ye,y:oe.current.y});const Te=ye-B.current.x,De=Z-B.current.y,$t=Z-oe.current.y,ln=ye-oe.current.x;if(!R&&Math.sqrt(Te*Te+De*De)>=l3&&(_(!0),L===null)){const ze=u.includes("left")||u.includes("right"),st=u.includes("up")||u.includes("down");if(ze&&st){const Vt=Math.abs(Te),rt=Math.abs(De);P(Vt>rt?"horizontal":"vertical")}}let he;if(!ue.current)L==="vertical"?De>0?he="down":De<0&&(he="up"):L==="horizontal"?Te>0?he="right":Te<0&&(he="left"):Math.abs(Te)>=Math.abs(De)?he=Te>0?"right":"left":he=De>0?"down":"up",he&&u.includes(he)&&(ue.current=he,te.current=Hb(he,Te,De),S(he));else{const jt=ue.current,ze=Hb(jt,ln,$t);ze>Za?(ce.current=!1,S(jt)):!(u.includes("left")&&u.includes("right"))&&!(u.includes("up")&&u.includes("down"))&&te.current-ze>=a3&&(ce.current=!0)}const Pe=ne(Te,De);let lt=$.current.x,Fr=$.current.y;L==="horizontal"?(u.includes("left")||u.includes("right"))&&(lt+=Pe.x):(L==="vertical"||(u.includes("left")||u.includes("right"))&&(lt+=Pe.x),(u.includes("up")||u.includes("down"))&&(Fr+=Pe.y)),U({x:lt,y:Fr})}function Q(j){var Te;if(!C)return;if(w(!1),_(!1),P(null),(Te=q.current)==null||Te.releasePointerCapture(j.pointerId),ce.current){U({x:A.x,y:A.y}),S(void 0);return}let Z=!1;const ye=I.x-A.x,ge=I.y-A.y;let be;for(const De of u){switch(De){case"right":ye>Za&&(Z=!0,be="right");break;case"left":ye<-Za&&(Z=!0,be="left");break;case"down":ge>Za&&(Z=!0,be="down");break;case"up":ge<-Za&&(Z=!0,be="up");break}if(Z)break}Z?(S(be),k(!0),h(r.id)):(U({x:A.x,y:A.y}),S(void 0))}function K(j){if(j.key==="Escape"){if(!q.current||!Re(q.current,en(Xt(q.current))))return;h(r.id)}}g.useEffect(()=>{if(!f)return;const j=q.current;if(!j)return;function Z(ye){Re(j,ye.target)&&ye.preventDefault()}return j.addEventListener("touchmove",Z,{passive:!1}),()=>{j.removeEventListener("touchmove",Z)}},[f]);function re(){if(!C&&I.x===A.x&&I.y===A.y&&!O)return{[Bo.swipeMovementX]:"0px",[Bo.swipeMovementY]:"0px"};const j=I.x-A.x,Z=I.y-A.y;return{transition:C?"none":void 0,transform:C?`translateX(${I.x}px) translateY(${I.y}px) scale(${A.scale})`:void 0,[Bo.swipeMovementX]:`${j}px`,[Bo.swipeMovementY]:`${Z}px`}}const de=r.priority==="high",me={role:de?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":M,"aria-describedby":D,"aria-hidden":de&&!d?!0:void 0,onPointerDown:f?Ne:void 0,onPointerMove:f?pe:void 0,onPointerUp:f?Q:void 0,onKeyDown:K,inert:ms(r.limited),style:{...re(),[Bo.index]:r.transitionStatus==="ending"?Se:Ae,[Bo.offsetY]:`${G}px`,[Bo.height]:r.height?`${r.height}px`:void 0}},le=g.useMemo(()=>({rootRef:q,toast:r,titleId:M,setTitleId:x,descriptionId:D,setDescriptionId:T,swiping:C,swipeDirection:b,recalculateHeight:Y,index:Se,visibleIndex:Ae,expanded:m}),[r,M,D,C,b,Y,Se,Ae,m]),se=g.useMemo(()=>({transitionStatus:r.transitionStatus,expanded:m,limited:r.limited||!1,type:r.type,swiping:le.swiping,swipeDirection:le.swipeDirection}),[m,r.transitionStatus,r.limited,r.type,le.swiping,le.swipeDirection]),X=He("div",t,{ref:[n,le.rootRef],state:se,stateAttributesMapping:i3,props:[me,l]});return ee.jsx(R_.Provider,{value:le,children:X})}),pU=g.forwardRef(function(t,n){const{render:r,className:o,...i}=t,{visibleIndex:a,expanded:l,recalculateHeight:s}=di(),u=g.useRef(null);ie(()=>{const h=u.current;if(!h||(s(),typeof ResizeObserver!="function"||typeof MutationObserver!="function"))return;const y=new ResizeObserver(()=>s(!0)),v=new MutationObserver(()=>s(!0));return y.observe(h),v.observe(h,{childList:!0,subtree:!0,characterData:!0}),()=>{y.disconnect(),v.disconnect()}},[s]);const f=a>0,c=g.useMemo(()=>({expanded:l,behind:f}),[l,f]);return He("div",t,{ref:[n,u],state:c,props:i})}),gU=g.forwardRef(function(t,n){const{render:r,className:o,id:i,children:a,...l}=t,{toast:s}=di(),u=a??s.description,f=!!u,c=jr(i),{setDescriptionId:d}=di();ie(()=>{if(f)return d(c),()=>{d(void 0)}},[f,c,d]);const h=g.useMemo(()=>({type:s.type}),[s.type]),y=He("p",t,{ref:n,state:h,props:{...l,id:c,children:u}});return f?y:null}),mU=g.forwardRef(function(t,n){const{render:r,className:o,id:i,children:a,...l}=t,{toast:s}=di(),u=a??s.title,f=!!u,c=jr(i),{setTitleId:d}=di();ie(()=>{if(f)return d(c),()=>{d(void 0)}},[f,c,d]);const h=g.useMemo(()=>({type:s.type}),[s.type]),y=He("h2",t,{ref:n,state:h,props:{...l,id:c,children:u}});return f?y:null}),yU=g.forwardRef(function(t,n){const{render:r,className:o,disabled:i,nativeButton:a=!0,...l}=t,{close:s,expanded:u}=wm(),{toast:f}=di(),[c,d]=g.useState(!1),{getButtonProps:h,buttonRef:y}=ys({disabled:i,native:a}),v=g.useMemo(()=>({type:f.type}),[f.type]);return He("button",t,{ref:[n,y],state:v,props:[{"aria-hidden":!u&&!c,onClick(){s(f.id)},onFocus(){d(!0)},onBlur(){d(!1)}},l,h]})}),vU=g.forwardRef(function(t,n){var v;const{render:r,className:o,disabled:i,nativeButton:a=!0,...l}=t,{toast:s}=di(),u=((v=s.actionProps)==null?void 0:v.children)??l.children,f=!!u,{getButtonProps:c,buttonRef:d}=ys({disabled:i,native:a}),h=g.useMemo(()=>({type:s.type}),[s.type]),y=He("button",t,{ref:[n,d],state:h,props:[l,s.actionProps,c,{children:u}]});return f?y:null}),bU=CR;function SU(){const e=g.useContext(Rm);if(!e)throw new Error(et(73));const{toasts:t,add:n,close:r,update:o,promise:i}=e;return g.useMemo(()=>({toasts:t,add:n,close:r,update:o,promise:i}),[t,n,r,o,i])}function EU(){const e=[];function t(n){e.forEach(r=>r(n))}return{" subscribe":function(r){return e.push(r),()=>{const o=e.indexOf(r);o!==-1&&e.splice(o,1)}},add(n){const r=n.id||C_("toast"),o={...n,id:r,transitionStatus:"starting"};return t({action:"add",options:o}),r},close(n){t({action:"close",options:{id:n}})},update(n,r){t({action:"update",options:{...r,id:n}})},promise(n,r){let o=n;return t({action:"promise",options:{...r,promise:n,setPromise(i){o=i}}}),o}}}var u3=typeof document<"u",c3=function(){},Sp=u3?g.useLayoutEffect:c3;const f3={...Ac},d3=f3.useInsertionEffect,h3=d3||(e=>e());function p3(e){const t=g.useRef(()=>{});return h3(()=>{t.current=e}),g.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const g3={...Ac};let Gb=!1,m3=0;const $b=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+m3++;function y3(){const[e,t]=g.useState(()=>Gb?$b():void 0);return Sp(()=>{e==null&&t($b())},[]),g.useEffect(()=>{Gb=!0},[]),e}const v3=g3.useId,b3=v3||y3;function S3(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const E3=g.createContext(null),C3=g.createContext(null),R3=()=>{var e;return((e=g.useContext(E3))==null?void 0:e.id)||null},w3=()=>g.useContext(C3);function _3(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=b3(),i=g.useRef({}),[a]=g.useState(()=>S3()),l=R3()!=null,[s,u]=g.useState(r.reference),f=p3((h,y,v)=>{i.current.openEvent=h?y:void 0,a.emit("openchange",{open:h,event:y,reason:v,nested:l}),n==null||n(h,y,v)}),c=g.useMemo(()=>({setPositionReference:u}),[]),d=g.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return g.useMemo(()=>({dataRef:i,open:t,onOpenChange:f,elements:d,events:a,floatingId:o,refs:c}),[t,f,d,a,o,c])}function CU(e){var t,n;let{elements:r,...o}=e===void 0?{}:e;const{nodeId:i}=o,a=_3({...o,elements:{reference:(t=r==null?void 0:r.reference)!=null?t:null,floating:(n=r==null?void 0:r.floating)!=null?n:null}}),l=o.rootContext||a,s=l.elements,[u,f]=g.useState(null),[c,d]=g.useState(null),y=(s==null?void 0:s.domReference)||u,v=g.useRef(null),E=w3();Sp(()=>{y&&(v.current=y)},[y]);const m=sR({...o,elements:{...s,...c&&{reference:c}}}),p=g.useCallback(R=>{const _=Ie(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(_),m.refs.setReference(_)},[m.refs]),b=g.useCallback(R=>{(Ie(R)||R===null)&&(v.current=R,f(R)),(Ie(m.refs.reference.current)||m.refs.reference.current===null||R!==null&&!Ie(R))&&m.refs.setReference(R)},[m.refs]),S=g.useMemo(()=>({...m.refs,setReference:b,setPositionReference:p,domReference:v}),[m.refs,b,p]),C=g.useMemo(()=>({...m.elements,domReference:y}),[m.elements,y]),w=g.useMemo(()=>({...m,...l,refs:S,elements:C,nodeId:i}),[m,S,C,i,l]);return Sp(()=>{l.dataRef.current.floatingContext=w;const R=E==null?void 0:E.nodesRef.current.find(_=>_.id===i);R&&(R.context=w)}),g.useMemo(()=>({...m,context:w,refs:S,elements:C}),[m,S,C,w])}export{mU as $,ql as A,U_ as B,T3 as C,rU as D,iU as E,aU as F,lU as G,uU as H,oU as I,cU as J,sU as K,cb as L,G3 as M,Mw as N,WD as O,nU as P,hm as Q,r1 as R,Q3 as S,N3 as T,KD as U,E2 as V,C2 as W,eU as X,hU as Y,pU as Z,V as _,Ac as a,yU as a0,gU as a1,vU as a2,EU as a3,fU as a4,bU as a5,dU as a6,SU as a7,O3 as a8,mA as a9,M3 as aa,kA as ab,k3 as ac,uC as ad,AD as ae,mc as af,nP as ag,Ht as ah,sp as ai,ba as aj,gz as ak,Ek as al,wk as am,Ck as an,CU as ao,vk as ap,dk as aq,pk as ar,hk as as,tU as at,Gt as b,A3 as c,P3 as d,I3 as e,z3 as f,L3 as g,D3 as h,B3 as i,ee as j,U3 as k,$3 as l,Hl as m,X3 as n,K3 as o,q3 as p,Y3 as q,g as r,F3 as s,H3 as t,V3 as u,j3 as v,Z3 as w,AN as x,p_ as y,d_ as z};
242
+ \v\f…\u2028\u2029])`),t));else if(s==="posix")if(!o&&(f==="graph"||f==="print")){if(r==="strict")throw new Error(`POSIX class "${f}" requires min target ES2024 or non-strict accuracy`);let c={graph:"!-~",print:" -~"}[f];u&&(c=`\0-${bt(c.codePointAt(0)-1)}${bt(c.codePointAt(2)+1)}-􏿿`),n(ut(gr(`[${c}]`),t))}else n(ut(Gd(gr(GI.get(f)),u),t));else if(s==="property")bm.has(bf(f))||(e.key="sc");else if(s==="space")n(Kr(ki("space",{negate:u}),t));else if(s==="word")n(ut(Gd(gr(pr),u),t));else throw new Error(`Unexpected character set kind "${s}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:o,removeAllPrevSiblings:i,removeAllNextSiblings:a}){const{kind:l,flags:s}=e;if(l==="flags")if(!s.enable&&!s.disable)r();else{const u=$n({flags:s});u.body[0].body=a(),o(ut(u,t),{traverse:!0})}else if(l==="keep"){const u=n.body[0],c=n.body.length===1&&jw(u,{type:"Group"})&&u.body[0].body.length===1?u.body[0]:n;if(t.parent!==c||c.body.length>1)throw new Error(Ee`Uses "\K" in a way that's unsupported`);const d=Fo({behind:!0});d.body[0].body=i(),o(ut(d,t))}else throw new Error(`Unexpected directive kind "${l}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t!=null&&t.extended&&delete t.extended,n!=null&&n.extended&&delete n.extended,t!=null&&t.dotAll&&(n!=null&&n.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(n!=null&&n.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(ut(Fo({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=$n();t.body[0].body.push(e.body),e.body=ut(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,o=!1;for(const i of e.body)if(i.body.length===1&&i.body[0].kind==="search_start")i.body.pop();else{const a=i_(i.body);a?(r=!0,Array.isArray(a)?n.push(...a):n.push(a)):o=!0}r&&!o&&n.forEach(i=>t.add(i))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(Ee`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Hd(n)&&(n=Bd(n,t),e.ref=n)}},FI={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:o}=e;r||n.set(e,[...t.get(o).map(({node:i})=>i)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:o,groupsByName:i,multiplexCapturesToLeftByRef:a,openRefs:l,reffedNodesByReferencer:s}){const u=o.get(e);if(u&&l.has(e.number)){const c=Kr(Lb(e.number),t);s.set(c,l.get(e.number)),n(c);return}l.set(e.number,e),a.set(e.number,[]),e.name&&Yl(a,e.name,[]);const f=a.get(e.name??e.number);for(let c=0;c<f.length;c++){const d=f[c];if(u===d.node||u&&u===d.origin||e===d.origin){f.splice(c,1);break}}if(a.get(e.number).push({node:e,origin:u}),e.name&&a.get(e.name).push({node:e,origin:u}),e.name){const c=Yl(i,e.name,new Map);let d=!1;if(u)d=!0;else for(const h of c.values())if(!h.hasDuplicateNameToRemove){d=!0;break}i.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:d})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=xc(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:o,ref:i}=e;if(o){let f=t;for(;(f=f.parent)&&!(f.type==="CapturingGroup"&&(f.name===i||f.number===i)););r.reffedNodesByReferencer.set(e,f);return}const a=r.subroutineRefMap.get(i),l=i===0,s=l?Lb(0):n_(a,r.groupOriginByCopy,null);let u=s;if(!l){const f=r_(KI(a,d=>d.type==="Group"&&!!d.flags)),c=f?xc(r.globalFlags,f):r.globalFlags;YI(c,r.currentFlags)||(u=$n({flags:QI(c)}),u.body[0].body.push(s))}n(ut(u,t),{traverse:!l})}},qI={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const i=r.reffedNodesByReferencer.get(e).filter(a=>XI(a,e));if(!i.length)n(ut(Fo({negate:!0}),t));else if(i.length>1){const a=$n({atomic:!0,body:i.reverse().map(l=>fi({body:[gp(l.number)]}))});n(ut(a,t))}else e.ref=i[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const o=Fw();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function t_(e){wl(e,{"*"({node:t,parent:n}){t.parent=n}})}function YI(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function XI(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=o_(n.parent);for(const o of r){if(o===n)break;if(o===e||a_(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function n_(e,t,n,r){const o=Array.isArray(e)?[]:{};for(const[i,a]of Object.entries(e))i==="parent"?o.parent=Array.isArray(n)?r:n:a&&typeof a=="object"?o[i]=n_(a,t,o,n):(i==="type"&&a==="CapturingGroup"&&t.set(o,t.get(e)??e),o[i]=a);return o}function Lb(e){const t=Yw(e);return t.isRecursive=!0,t}function KI(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Bd(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function r_(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(o=>{var i,a;(i=r.enable)!=null&&i[o]&&(delete n.disable[o],n.enable[o]=!0),(a=r.disable)!=null&&a[o]&&(n.disable[o]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function QI({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function o_(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function i_(e){const t=e.find(n=>n.kind==="search_start"||JI(n,{negate:!1})||!ZI(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const r of t.body){const o=i_(r.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function a_(e,t){const n=o_(e)??[];for(const r of n)if(r===t||a_(r,t))return!0;return!1}function ZI({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function WI(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function JI(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&jw(e.body[0],{type:"Assertion",kind:"search_start"})}function Hd(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function gr(e,t){const r=Vw(e,{...t,unicodePropertyMap:bm}).body;return r.length>1||r[0].body.length>1?$n({body:r}):r[0].body[0]}function Gd(e,t){return e.negate=t,e}function Kr(e,t){return e.parent=t,e}function ut(e,t){return t_(e),e.parent=t,e}function ez(e,t){const n=Ww(t),r=vp(n.target,"ES2024"),o=vp(n.target,"ES2025"),i=n.rules.recursionLimit;if(!Number.isInteger(i)||i<2||i>20)throw new Error("Invalid recursionLimit; use 2-20");let a=null,l=null;if(!o){const h=[e.flags.ignoreCase];wl(e,tz,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(y){h.push(y)},setHasCasedChar(){h.at(-1)?a=!0:l=!0}})}const s={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!l)};let u=e;const f={accuracy:n.accuracy,appliedGlobalFlags:s,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:u,originMap:e._originMap,recursionLimit:i,useAppliedIgnoreCase:!!(!o&&a&&l),useFlagMods:o,useFlagV:r,verbose:n.verbose};function c(h){return f.lastNode=u,u=h,DI(nz[h.type],`Unexpected node type "${h.type}"`)(h,f,c)}const d={pattern:e.body.map(c).join("|"),flags:c(e.flags),options:{...e.options}};return r||(delete d.options.force.v,d.options.disable.v=!0,d.options.unicodeSetsPlugin=null),d._captureTransfers=new Map,d._hiddenCaptures=[],f.captureMap.forEach((h,y)=>{h.hidden&&d._hiddenCaptures.push(y),h.transferTo&&Yl(d._captureTransfers,h.transferTo,[]).push(y)}),d}var tz={"*":{enter({node:e},t){if(Db(e)){const n=t.getCurrentModI();t.pushModI(e.flags?xc({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Db(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Sm(bt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),l_(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&e_.has(e.value)&&t.setHasCasedChar()}},nz={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Ee`\B`:Ee`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:r,name:o,number:i}=e,a={ignoreCase:t.currentFlags.ignoreCase},l=t.originMap.get(e);return l&&(a.hidden=!0,i>l.number&&(a.transferTo=l.number)),t.captureMap.set(i,a),`(${o?`?<${o}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=bt(e),r=xi(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Sm(n)){const o=Jw(n);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:o,parent:i}=e;let{body:a}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");qn.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(Pb)&&(a=[vf(45),...a.filter(u=>!Pb(u))]);const l=()=>`[${o?"^":""}${a.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||qn.bugNestedClassIgnoresNegation)&&!o){const f=a.filter(c=>c.type==="CharacterClass"&&c.kind==="union"&&c.negate);if(f.length){const c=$n(),d=c.body[0];return c.parent=i,d.parent=c,a=a.filter(h=>!f.includes(h)),e.body=a,a.length?(e.parent=d,d.body.push(e)):c.body.pop(),f.forEach(h=>{const y=fi({body:[h]});h.parent=y,y.parent=c,c.body.push(y)}),n(c)}}t.inCharClass=!0;const u=l();return t.inCharClass=!1,u}const s=a[0];if(r==="union"&&!o&&s&&((!t.useFlagV||!t.verbose)&&i.kind==="union"&&!(qn.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&i.kind==="intersection"&&a.length===1&&s.type!=="CharacterClassRange"))return a.map(n).join("");if(!t.useFlagV&&i.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},i=xi(n,o),a=xi(r,o),l=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const s=l_(e);lz(s).forEach(f=>{l.add(Array.isArray(f)?`${xi(f[0],o)}-${xi(f[1],o)}`:xi(f,o))})}return`${i}-${a}${[...l].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":Ee`[^\n]`;if(e==="digit")return t?Ee`\D`:Ee`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&e_.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?Ee`\P`:Ee`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?Ee`\W`:Ee`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},o,i){const a=o.currentFlags;n&&(o.currentFlags=xc(a,n));const l=t.map(i).join("|"),s=!o.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?l:`(?${sz(e,n,o.useFlagMods)}${l})`;return o.currentFlags=a,s},LookaroundAssertion({body:e,kind:t,negate:n},r,o){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,n){return n(e.body)+uz(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:Ee`\g<${t}&R=${r}>`}},rz=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),oz=new Set(["-","\\","]","^","["]),iz=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Nb=new Map([[9,Ee`\t`],[10,Ee`\n`],[11,Ee`\v`],[12,Ee`\f`],[13,Ee`\r`],[8232,Ee`\u2028`],[8233,Ee`\u2029`],[65279,Ee`\uFEFF`]]),az=new RegExp("^\\p{Cased}$","u");function Sm(e){return az.test(e)}function l_(e,t){const n=!!(t!=null&&t.firstOnly),r=e.min.value,o=e.max.value,i=[];if(r<65&&(o===65535||o>=131071)||r===65536&&o>=131071)return i;for(let a=r;a<=o;a++){const l=bt(a);if(!Sm(l))continue;const s=Jw(l).filter(u=>{const f=u.codePointAt(0);return f<r||f>o});if(s.length&&(i.push(...s),n))break}return i}function xi(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Nb.has(e))return Nb.get(e);if(e<32||e>126&&e<160||e>262143||t&&cz(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const o=n?r?iz:oz:rz,i=bt(e);return(o.has(i)?"\\":"")+i}function lz(e){const t=e.map(o=>o.codePointAt(0)).sort((o,i)=>o-i),n=[];let r=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?r??(r=t[o]):r===null?n.push(t[o]):(n.push([r,t[o]]),r=null);return n}function sz(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:o,disable:i}=t;r=(o!=null&&o.ignoreCase?"i":"")+(o!=null&&o.dotAll?"s":"")+(i?"-":"")+(i!=null&&i.ignoreCase?"i":"")+(i!=null&&i.dotAll?"s":"")}return`${r}:`}function uz({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function Db({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function cz(e){return e>47&&e<58}function Pb({type:e,value:t}){return e==="Character"&&t===45}var no,vr,Xo,ro,Ko,Xl,bp,wo,fz=(wo=class extends RegExp{constructor(n,r,o){var t=(...lB)=>(super(...lB),Po(this,Xl),Po(this,no,new Map),Po(this,vr,null),Po(this,Xo),Po(this,ro,null),Po(this,Ko,null),z(this,"rawOptions",{}),this);const i=!!(o!=null&&o.lazyCompile);if(n instanceof RegExp){if(o)throw new Error("Cannot provide options when copying a regexp");const a=n;t(a,r),Un(this,Xo,a.source),a instanceof wo&&(Un(this,no,Ft(a,no)),Un(this,ro,Ft(a,ro)),Un(this,Ko,Ft(a,Ko)),this.rawOptions=a.rawOptions)}else{const a={hiddenCaptures:[],strategy:null,transfers:[],...o};t(i?"":n,r),Un(this,Xo,n),Un(this,no,hz(a.hiddenCaptures,a.transfers)),Un(this,Ko,a.strategy),this.rawOptions=o??{}}i||Un(this,vr,this)}get source(){return Ft(this,Xo)||"(?:)"}exec(n){if(!Ft(this,vr)){const{lazyCompile:i,...a}=this.rawOptions;Un(this,vr,new wo(Ft(this,Xo),this.flags,a))}const r=this.global||this.sticky,o=this.lastIndex;if(Ft(this,Ko)==="clip_search"&&r&&o){this.lastIndex=0;const i=Of(this,Xl,bp).call(this,n.slice(o));return i&&(dz(i,o,n,this.hasIndices),this.lastIndex+=o),i}return Of(this,Xl,bp).call(this,n)}},no=new WeakMap,vr=new WeakMap,Xo=new WeakMap,ro=new WeakMap,Ko=new WeakMap,Xl=new WeakSet,bp=function(n){Ft(this,vr).lastIndex=this.lastIndex;const r=Mm(wo.prototype,this,"exec").call(Ft(this,vr),n);if(this.lastIndex=Ft(this,vr).lastIndex,!r||!Ft(this,no).size)return r;const o=[...r];r.length=1;let i;this.hasIndices&&(i=[...r.indices],r.indices.length=1);const a=[0];for(let l=1;l<o.length;l++){const{hidden:s,transferTo:u}=Ft(this,no).get(l)??{};if(s?a.push(null):(a.push(r.length),r.push(o[l]),this.hasIndices&&r.indices.push(i[l])),u&&o[l]!==void 0){const f=a[u];if(!f)throw new Error(`Invalid capture transfer to "${f}"`);if(r[f]=o[l],this.hasIndices&&(r.indices[f]=i[l]),r.groups){Ft(this,ro)||Un(this,ro,pz(this.source));const c=Ft(this,ro).get(u);c&&(r.groups[c]=o[l],this.hasIndices&&(r.indices.groups[c]=i[l]))}}}return r},wo);function dz(e,t,n,r){if(e.index+=t,e.input=n,r){const o=e.indices;for(let a=0;a<o.length;a++){const l=o[a];l&&(o[a]=[l[0]+t,l[1]+t])}const i=o.groups;i&&Object.keys(i).forEach(a=>{const l=i[a];l&&(i[a]=[l[0]+t,l[1]+t])})}}function hz(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,o]of t)for(const i of o)Yl(n,i,{}).transferTo=r;return n}function pz(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,o=0,i;for(;i=t.exec(e);){const{0:a,groups:{capture:l,name:s}}=i;a==="["?r++:r?a==="]"&&r--:l&&(o++,s&&n.set(o,s))}return n}function gz(e,t){const n=mz(e,t);return n.options?new fz(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function mz(e,t){const n=Ww(t),r=Vw(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:bm}),o=jI(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),i=ez(o,n),a=LI(i.pattern,{captureTransfers:i._captureTransfers,hiddenCaptures:i._hiddenCaptures,mode:"external"}),l=MI(a.pattern),s=OI(l.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),u={pattern:s.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${i.flags}${i.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const f=s.hiddenCaptures.sort((y,v)=>y-v),c=Array.from(s.captureTransfers),d=o._strategy,h=u.pattern.length>=n.lazyCompileLength;(f.length||c.length||d||h)&&(u.options={...f.length&&{hiddenCaptures:f},...c.length&&{transfers:c},...d&&{strategy:d},...h&&{lazyCompile:h}})}return u}function yz(e,t){return gz(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function s_(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=n=>yz(n,{target:t.target})),{createScanner(n){return new NP(n,t)},createString(n){return{content:n}}}}var Em=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function vz(){return 2147483648}function bz(){return typeof performance<"u"?performance.now():Date.now()}const Sz=(e,t)=>e+(t-e%t)%t;async function Ez(e){let t,n;const r={};function o(h){n=h,r.HEAPU8=new Uint8Array(h),r.HEAPU32=new Uint32Array(h)}function i(h,y,v){r.HEAPU8.copyWithin(h,y,y+v)}function a(h){try{return t.grow(h-n.byteLength+65535>>>16),o(t.buffer),1}catch{}}function l(h){const y=r.HEAPU8.length;h=h>>>0;const v=vz();if(h>v)return!1;for(let E=1;E<=4;E*=2){let m=y*(1+.2/E);m=Math.min(m,h+100663296);const p=Math.min(v,Sz(Math.max(h,m),65536));if(a(p))return!0}return!1}const s=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function u(h,y,v=1024){const E=y+v;let m=y;for(;h[m]&&!(m>=E);)++m;if(m-y>16&&h.buffer&&s)return s.decode(h.subarray(y,m));let p="";for(;y<m;){let b=h[y++];if(!(b&128)){p+=String.fromCharCode(b);continue}const S=h[y++]&63;if((b&224)===192){p+=String.fromCharCode((b&31)<<6|S);continue}const C=h[y++]&63;if((b&240)===224?b=(b&15)<<12|S<<6|C:b=(b&7)<<18|S<<12|C<<6|h[y++]&63,b<65536)p+=String.fromCharCode(b);else{const w=b-65536;p+=String.fromCharCode(55296|w>>10,56320|w&1023)}}return p}function f(h,y){return h?u(r.HEAPU8,h,y):""}const c={emscripten_get_now:bz,emscripten_memcpy_big:i,emscripten_resize_heap:l,fd_write:()=>0};async function d(){const y=await e({env:c,wasi_snapshot_preview1:c});t=y.memory,o(t.buffer),Object.assign(r,y),r.UTF8ToString=f}return await d(),r}var Cz=Object.defineProperty,Rz=(e,t,n)=>t in e?Cz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,St=(e,t,n)=>Rz(e,typeof t!="symbol"?t+"":t,n);let _t=null;function wz(e){throw new Em(e.UTF8ToString(e.getLastOnigError()))}class Cf{constructor(t){St(this,"utf16Length"),St(this,"utf8Length"),St(this,"utf16Value"),St(this,"utf8Value"),St(this,"utf16OffsetToUtf8"),St(this,"utf8OffsetToUtf16");const n=t.length,r=Cf._utf8ByteLength(t),o=r!==n,i=o?new Uint32Array(n+1):null;o&&(i[n]=r);const a=o?new Uint32Array(r+1):null;o&&(a[r]=n);const l=new Uint8Array(r);let s=0;for(let u=0;u<n;u++){const f=t.charCodeAt(u);let c=f,d=!1;if(f>=55296&&f<=56319&&u+1<n){const h=t.charCodeAt(u+1);h>=56320&&h<=57343&&(c=(f-55296<<10)+65536|h-56320,d=!0)}o&&(i[u]=s,d&&(i[u+1]=s),c<=127?a[s+0]=u:c<=2047?(a[s+0]=u,a[s+1]=u):c<=65535?(a[s+0]=u,a[s+1]=u,a[s+2]=u):(a[s+0]=u,a[s+1]=u,a[s+2]=u,a[s+3]=u)),c<=127?l[s++]=c:c<=2047?(l[s++]=192|(c&1984)>>>6,l[s++]=128|(c&63)>>>0):c<=65535?(l[s++]=224|(c&61440)>>>12,l[s++]=128|(c&4032)>>>6,l[s++]=128|(c&63)>>>0):(l[s++]=240|(c&1835008)>>>18,l[s++]=128|(c&258048)>>>12,l[s++]=128|(c&4032)>>>6,l[s++]=128|(c&63)>>>0),d&&u++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=t,this.utf8Value=l,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=a}static _utf8ByteLength(t){let n=0;for(let r=0,o=t.length;r<o;r++){const i=t.charCodeAt(r);let a=i,l=!1;if(i>=55296&&i<=56319&&r+1<o){const s=t.charCodeAt(r+1);s>=56320&&s<=57343&&(a=(i-55296<<10)+65536|s-56320,l=!0)}a<=127?n+=1:a<=2047?n+=2:a<=65535?n+=3:n+=4,l&&r++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const Rf=class Zn{constructor(t){if(St(this,"id",++Zn.LAST_ID),St(this,"_onigBinding"),St(this,"content"),St(this,"utf16Length"),St(this,"utf8Length"),St(this,"utf16OffsetToUtf8"),St(this,"utf8OffsetToUtf16"),St(this,"ptr"),!_t)throw new Em("Must invoke loadWasm first.");this._onigBinding=_t,this.content=t;const n=new Cf(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Zn._sharedPtrInUse?(Zn._sharedPtr||(Zn._sharedPtr=_t.omalloc(1e4)),Zn._sharedPtrInUse=!0,_t.HEAPU8.set(n.utf8Value,Zn._sharedPtr),this.ptr=Zn._sharedPtr):this.ptr=n.createString(_t)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===Zn._sharedPtr?Zn._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};St(Rf,"LAST_ID",0);St(Rf,"_sharedPtr",0);St(Rf,"_sharedPtrInUse",!1);let u_=Rf;class _z{constructor(t){if(St(this,"_onigBinding"),St(this,"_ptr"),!_t)throw new Em("Must invoke loadWasm first.");const n=[],r=[];for(let l=0,s=t.length;l<s;l++){const u=new Cf(t[l]);n[l]=u.createString(_t),r[l]=u.utf8Length}const o=_t.omalloc(4*t.length);_t.HEAPU32.set(n,o/4);const i=_t.omalloc(4*t.length);_t.HEAPU32.set(r,i/4);const a=_t.createOnigScanner(o,i,t.length);for(let l=0,s=t.length;l<s;l++)_t.ofree(n[l]);_t.ofree(i),_t.ofree(o),a===0&&wz(_t),this._onigBinding=_t,this._ptr=a}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,r){let o=0;if(typeof r=="number"&&(o=r),typeof t=="string"){t=new u_(t);const i=this._findNextMatchSync(t,n,!1,o);return t.dispose(),i}return this._findNextMatchSync(t,n,!1,o)}_findNextMatchSync(t,n,r,o){const i=this._onigBinding,a=i.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),o);if(a===0)return null;const l=i.HEAPU32;let s=a/4;const u=l[s++],f=l[s++],c=[];for(let d=0;d<f;d++){const h=t.convertUtf8OffsetToUtf16(l[s++]),y=t.convertUtf8OffsetToUtf16(l[s++]);c[d]={start:h,end:y,length:y-h}}return{index:u,captureIndices:c}}}function xz(e){return typeof e.instantiator=="function"}function Tz(e){return typeof e.default=="function"}function Az(e){return typeof e.data<"u"}function Oz(e){return typeof Response<"u"&&e instanceof Response}function Mz(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let eu;function Cm(e){if(eu)return eu;async function t(){_t=await Ez(async n=>{let r=e;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),xz(r)?r=await r.instantiator(n):Tz(r)?r=await r.default(n):(Az(r)&&(r=r.data),Oz(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await kz(r)(n):r=await Lz(r)(n):Mz(r)?r=await $d(r)(n):r instanceof WebAssembly.Module?r=await $d(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await $d(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return eu=t(),eu}function $d(e){return t=>WebAssembly.instantiate(e,t)}function kz(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Lz(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let c_;function Nz(e){c_=e}function Dz(){return c_}async function f_(e){return e&&await Cm(e),{createScanner(t){return new _z(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new u_(t)}}}const Pz=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:f_,getDefaultWasmLoader:Dz,loadWasm:Cm,setDefaultWasmLoader:Nz},Symbol.toStringTag,{value:"Module"}));var Iz=HN({});$N(Iz,Pz);const d_=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:()=>V(()=>import("./andromeeda-C4gqWexZ.js"),[])},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:()=>V(()=>import("./aurora-x-D-2ljcwZ.js"),[])},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:()=>V(()=>import("./ayu-dark-DYE7WIF3.js"),[])},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:()=>V(()=>import("./ayu-light-BA47KaF1.js"),[])},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:()=>V(()=>import("./ayu-mirage-32ctXXKs.js"),[])},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:()=>V(()=>import("./catppuccin-frappe-DFWUc33u.js"),[])},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:()=>V(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[])},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:()=>V(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[])},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:()=>V(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[])},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:()=>V(()=>import("./dark-plus-C3mMm8J8.js"),[])},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:()=>V(()=>import("./dracula-BzJJZx-M.js"),[])},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:()=>V(()=>import("./dracula-soft-BXkSAIEj.js"),[])},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:()=>V(()=>import("./everforest-dark-BgDCqdQA.js"),[])},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:()=>V(()=>import("./everforest-light-C8M2exoo.js"),[])},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:()=>V(()=>import("./github-dark-DHJKELXO.js"),[])},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:()=>V(()=>import("./github-dark-default-Cuk6v7N8.js"),[])},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:()=>V(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[])},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:()=>V(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[])},{id:"github-light",displayName:"GitHub Light",type:"light",import:()=>V(()=>import("./github-light-DAi9KRSo.js"),[])},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:()=>V(()=>import("./github-light-default-D7oLnXFd.js"),[])},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:()=>V(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[])},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:()=>V(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[])},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:()=>V(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[])},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:()=>V(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[])},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:()=>V(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[])},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:()=>V(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[])},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:()=>V(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[])},{id:"horizon",displayName:"Horizon",type:"dark",import:()=>V(()=>import("./horizon-BUw7H-hv.js"),[])},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:()=>V(()=>import("./horizon-bright-CUuTKBJd.js"),[])},{id:"houston",displayName:"Houston",type:"dark",import:()=>V(()=>import("./houston-DnULxvSX.js"),[])},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:()=>V(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[])},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:()=>V(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[])},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:()=>V(()=>import("./kanagawa-wave-DWedfzmr.js"),[])},{id:"laserwave",displayName:"LaserWave",type:"dark",import:()=>V(()=>import("./laserwave-DUszq2jm.js"),[])},{id:"light-plus",displayName:"Light Plus",type:"light",import:()=>V(()=>import("./light-plus-B7mTdjB0.js"),[])},{id:"material-theme",displayName:"Material Theme",type:"dark",import:()=>V(()=>import("./material-theme-D5KoaKCx.js"),[])},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:()=>V(()=>import("./material-theme-darker-BfHTSMKl.js"),[])},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:()=>V(()=>import("./material-theme-lighter-B0m2ddpp.js"),[])},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:()=>V(()=>import("./material-theme-ocean-CyktbL80.js"),[])},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:()=>V(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[])},{id:"min-dark",displayName:"Min Dark",type:"dark",import:()=>V(()=>import("./min-dark-CafNBF8u.js"),[])},{id:"min-light",displayName:"Min Light",type:"light",import:()=>V(()=>import("./min-light-CTRr51gU.js"),[])},{id:"monokai",displayName:"Monokai",type:"dark",import:()=>V(()=>import("./monokai-D4h5O-jR.js"),[])},{id:"night-owl",displayName:"Night Owl",type:"dark",import:()=>V(()=>import("./night-owl-C39BiMTA.js"),[])},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:()=>V(()=>import("./night-owl-light-CMTm3GFP.js"),[])},{id:"nord",displayName:"Nord",type:"dark",import:()=>V(()=>import("./nord-Ddv68eIx.js"),[])},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:()=>V(()=>import("./one-dark-pro-DVMEJ2y_.js"),[])},{id:"one-light",displayName:"One Light",type:"light",import:()=>V(()=>import("./one-light-C3Wv6jpd.js"),[])},{id:"plastic",displayName:"Plastic",type:"dark",import:()=>V(()=>import("./plastic-3e1v2bzS.js"),[])},{id:"poimandres",displayName:"Poimandres",type:"dark",import:()=>V(()=>import("./poimandres-CS3Unz2-.js"),[])},{id:"red",displayName:"Red",type:"dark",import:()=>V(()=>import("./red-bN70gL4F.js"),[])},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:()=>V(()=>import("./rose-pine-qdsjHGoJ.js"),[])},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:()=>V(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[])},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:()=>V(()=>import("./rose-pine-moon-D4_iv3hh.js"),[])},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:()=>V(()=>import("./slack-dark-BthQWCQV.js"),[])},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:()=>V(()=>import("./slack-ochin-DqwNpetd.js"),[])},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:()=>V(()=>import("./snazzy-light-Bw305WKR.js"),[])},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:()=>V(()=>import("./solarized-dark-DXbdFlpD.js"),[])},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:()=>V(()=>import("./solarized-light-L9t79GZl.js"),[])},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:()=>V(()=>import("./synthwave-84-CbfX1IO0.js"),[])},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:()=>V(()=>import("./tokyo-night-hegEt444.js"),[])},{id:"vesper",displayName:"Vesper",type:"dark",import:()=>V(()=>import("./vesper-DU1UobuO.js"),[])},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:()=>V(()=>import("./vitesse-black-Bkuqu6BP.js"),[])},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:()=>V(()=>import("./vitesse-dark-D0r3Knsf.js"),[])},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:()=>V(()=>import("./vitesse-light-CVO1_9PV.js"),[])}],h_=Object.fromEntries(d_.map(e=>[e.id,e.import])),wf=[{id:"markdown",name:"Markdown",aliases:["md"],import:()=>V(()=>import("./markdown-CKXSK5AY.js"),[])},{id:"mdx",name:"MDX",import:()=>V(()=>import("./mdx-BWRhHdFl.js"),[])},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:()=>V(()=>import("./javascript-XPxc2APE.js"),[])},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:()=>V(()=>import("./typescript-DttGkNCf.js"),[])},{id:"jsx",name:"JSX",import:()=>V(()=>import("./jsx-BGEKFWBk.js"),[])},{id:"tsx",name:"TSX",import:()=>V(()=>import("./tsx-Dio8iE-N.js"),[])},{id:"html",name:"HTML",import:()=>V(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]))},{id:"css",name:"CSS",import:()=>V(()=>import("./css-CLj8gQPS.js"),[])},{id:"scss",name:"SCSS",import:()=>V(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([3,2]))},{id:"less",name:"Less",import:()=>V(()=>import("./less-C76OjOdF.js"),[])},{id:"vue",name:"Vue",import:()=>V(()=>import("./vue-DMJtu8ND.js"),__vite__mapDeps([4,2,1,5,6,0]))},{id:"svelte",name:"Svelte",import:()=>V(()=>import("./svelte-DR4MIrkg.js"),__vite__mapDeps([7,1,5,2]))},{id:"json",name:"JSON",import:()=>V(()=>import("./json-CjLXzM_z.js"),[])},{id:"jsonc",name:"JSON with Comments",import:()=>V(()=>import("./jsonc-BYi4HS05.js"),[])},{id:"yaml",name:"YAML",aliases:["yml"],import:()=>V(()=>import("./yaml-B92AUxDB.js"),[])},{id:"toml",name:"TOML",import:()=>V(()=>import("./toml-Btlk-g9G.js"),[])},{id:"xml",name:"XML",import:()=>V(()=>import("./xml-DtyAt_xK.js"),__vite__mapDeps([8,9]))},{id:"ini",name:"INI",aliases:["properties"],import:()=>V(()=>import("./ini-DOGW4-0C.js"),[])},{id:"python",name:"Python",aliases:["py"],import:()=>V(()=>import("./python-DgE28U1V.js"),[])},{id:"java",name:"Java",import:()=>V(()=>import("./java-B2AjWfgk.js"),[])},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:()=>V(()=>import("./kotlin-DwKqsDKK.js"),[])},{id:"go",name:"Go",import:()=>V(()=>import("./go-C27-OAKa.js"),[])},{id:"rust",name:"Rust",aliases:["rs"],import:()=>V(()=>import("./rust-DJErdhjk.js"),[])},{id:"c",name:"C",import:()=>V(()=>import("./c-CyUOlKFr.js"),[])},{id:"cpp",name:"C++",aliases:["c++"],import:()=>V(()=>import("./cpp-Bp17OOWP.js"),__vite__mapDeps([10,11,12]))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:()=>V(()=>import("./csharp-DieIJxYJ.js"),[])},{id:"ruby",name:"Ruby",aliases:["rb"],import:()=>V(()=>import("./ruby-CM5gBc7p.js"),__vite__mapDeps([13,0,1,2,8,9,12,14,5,15,16,10,11,17,18,19]))},{id:"php",name:"PHP",import:()=>V(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([20,0,1,2,8,9,12,6]))},{id:"swift",name:"Swift",import:()=>V(()=>import("./swift-DjrYMa62.js"),[])},{id:"lua",name:"Lua",import:()=>V(()=>import("./lua-JmSlR1pZ.js"),__vite__mapDeps([18,11]))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:()=>V(()=>import("./shellscript-CE-5zpiL.js"),[])},{id:"shellsession",name:"Shell Session",aliases:["console"],import:()=>V(()=>import("./shellsession-BhddCRKA.js"),__vite__mapDeps([21,17]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:()=>V(()=>import("./powershell-DdRAnR4Z.js"),[])},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:()=>V(()=>import("./docker-DIG_IqVK.js"),[])},{id:"nginx",name:"Nginx",import:()=>V(()=>import("./nginx-bBKbG2uI.js"),__vite__mapDeps([22,18,11]))},{id:"make",name:"Makefile",aliases:["makefile"],import:()=>V(()=>import("./make-s9FKP0VE.js"),[])},{id:"cmake",name:"CMake",import:()=>V(()=>import("./cmake-Cv5ljclQ.js"),[])},{id:"sql",name:"SQL",import:()=>V(()=>import("./sql-CKXjX23X.js"),[])},{id:"graphql",name:"GraphQL",aliases:["gql"],import:()=>V(()=>import("./graphql-By4-2MiP.js"),__vite__mapDeps([14,1,5,15,16]))},{id:"diff",name:"Diff",import:()=>V(()=>import("./diff-BlzBhZx2.js"),[])},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:()=>V(()=>import("./proto-BZ_yZy5q.js"),[])},{id:"wasm",name:"WebAssembly",import:()=>V(()=>import("./wasm-LUzQYg3H.js"),[])}],p_=wf,g_=Object.fromEntries(wf.map(e=>[e.id,e.import])),zz=Object.fromEntries(wf.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.import]))??[]})),m_={...g_,...zz},Uz=g_,Bz=Object.fromEntries(p_.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(n=>[n,e.id]))??[]})),y_=OP({langs:m_,themes:h_,engine:s_}),{codeToHtml:Hz,codeToHast:Gz,codeToTokensBase:$z,codeToTokens:jz,codeToTokensWithThemes:Vz,getSingletonHighlighter:Fz,getLastGrammarState:qz}=kP(y_),tU=Object.freeze(Object.defineProperty({__proto__:null,bundledLanguages:m_,bundledLanguagesAlias:Bz,bundledLanguagesBase:Uz,bundledLanguagesInfo:p_,bundledThemes:h_,bundledThemesInfo:d_,codeToHast:Gz,codeToHtml:Hz,codeToTokens:jz,codeToTokensBase:$z,codeToTokensWithThemes:Vz,createCssVariablesTheme:LP,createHighlighter:y_,createJavaScriptRegexEngine:s_,createOnigurumaEngine:f_,getLastGrammarState:qz,getSingletonHighlighter:Fz,getTokenStyleObject:ql,loadWasm:Cm,normalizeTheme:gf,stringifyTokenStyle:Cc,supportedLanguagesInfo:wf},Symbol.toStringTag,{value:"Module"})),v_=g.createContext(void 0);function Do(e){const t=g.useContext(v_);if(t===void 0&&!e)throw new Error(et(47));return t}function Yz(){return{...em(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}const Xz={...tm,disabled:fe(e=>e.disabled),instantType:fe(e=>e.instantType),openMethod:fe(e=>e.openMethod),openChangeReason:fe(e=>e.openChangeReason),modal:fe(e=>e.modal),stickIfOpen:fe(e=>e.stickIfOpen),titleElementId:fe(e=>e.titleElementId),descriptionElementId:fe(e=>e.descriptionElementId),openOnHover:fe(e=>e.openOnHover),closeDelay:fe(e=>e.closeDelay)};class _f extends nf{constructor(n){const r={...Yz(),...n};r.open&&(n==null?void 0:n.mounted)===void 0&&(r.mounted=!0);super(r,{popupRef:g.createRef(),backdropRef:g.createRef(),internalBackdropRef:g.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:g.createRef(),beforeContentFocusGuardRef:g.createRef(),stickIfOpenTimeout:new Xn,triggerElements:new ps},Xz);z(this,"setOpen",(n,r)=>{var f,c;const o=r.reason===yt,i=r.reason===Vn&&r.event.detail===0,a=!n&&(r.reason===ds||r.reason==null);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(c=(f=this.context).onOpenChange)==null||c.call(f,n,r),r.isCanceled)return;const l={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested,triggerElement:r.trigger},s=this.state.floatingRootContext.context.events;s==null||s.emit("openchange",l);const u=()=>{var y;const d={open:n,openChangeReason:r.reason},h=((y=r.trigger)==null?void 0:y.id)??null;(h||n)&&(d.activeTriggerId=h,d.activeTriggerElement=r.trigger??null),this.update(d)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(FC,()=>{this.set("stickIfOpen",!1)}),Gt.flushSync(u)):u(),i||a?this.set("instantType",i?"click":"dismiss"):r.reason===Br?this.set("instantType","focus"):this.set("instantType",void 0)});z(this,"disposeEffect",()=>this.context.stickIfOpenTimeout.disposeEffect())}static useStore(n,r){const o=rn(()=>n??new _f(r)).current;return Mg(o.disposeEffect),o}}function Ib({props:e}){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:o,onOpenChangeComplete:i,modal:a=!1,handle:l,triggerId:s,defaultTriggerId:u=null}=e,f=_f.useStore(l==null?void 0:l.store,{open:n??r,modal:a,activeTriggerId:s!==void 0?s:u});f.useControlledProp("open",n,r),f.useControlledProp("activeTriggerId",s,u);const c=f.useState("open"),d=f.useState("positionerElement"),h=f.useState("payload"),y=f.useState("openChangeReason");f.useContextCallback("onOpenChange",o),f.useContextCallback("onOpenChangeComplete",i);const{openMethod:v,triggerProps:E,reset:m}=XR(c);Wg(f);const{forceUnmount:p}=Jg(c,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null}),m()});qR(c&&a===!0&&y!==yt&&v!=="touch",d),g.useEffect(()=>{c||f.context.stickIfOpenTimeout.clear()},[f,c]);const b=g.useCallback(M=>{const x=xe(M);return x.preventUnmountOnClose=()=>{f.set("preventUnmountingOnClose",!0)},x},[f]),S=g.useCallback(()=>{f.setOpen(!1,b(ui))},[f,b]);g.useImperativeHandle(e.actionsRef,()=>({unmount:p,close:S}),[p,S]);const C=nm({popupStore:f,onOpenChange:f.setOpen}),w=Kg(C,{outsidePressEvent:{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),R=SR(C),{getReferenceProps:_,getFloatingProps:O,getTriggerProps:k}=Da([w,R]),I=g.useMemo(()=>_(E),[_,E]),U=g.useMemo(()=>k(E),[k,E]),A=g.useMemo(()=>O(),[O]);f.useSyncedValues({modal:a,openMethod:v,activeTriggerProps:I,inactiveTriggerProps:U,popupProps:A,floatingRootContext:C,nested:ar()!=null});const N=g.useMemo(()=>({store:f}),[f]);return ee.jsx(v_.Provider,{value:N,children:typeof t=="function"?t({payload:h}):t})}function nU(e){return Do(!0)?ee.jsx(Ib,{props:e}):ee.jsx(jC,{children:ee.jsx(Ib,{props:e})})}const Kz=300,rU=g.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:a=!0,handle:l,payload:s,openOnHover:u=!1,delay:f=Kz,closeDelay:c=0,id:d,...h}=t,y=Do(!0),v=(l==null?void 0:l.store)??(y==null?void 0:y.store);if(!v)throw new Error(et(74));const E=Si(d),m=v.useState("isTriggerActive",E),p=v.useState("floatingRootContext"),b=v.useState("isOpenedByTrigger",E),S=g.useRef(null),{registerTrigger:C,isMountedByThisTrigger:w}=Zg(E,S,v,{payload:s,disabled:i,openOnHover:u,closeDelay:c}),R=v.useState("openChangeReason"),_=v.useState("stickIfOpen"),O=v.useState("openMethod"),k=rf(p,{enabled:p!=null&&u&&(O!=="touch"||R!==Vn),mouseOnly:!0,move:!1,handleClose:af(),restMs:f,delay:{close:c},triggerElementRef:S,isActiveTrigger:m}),I=Yg(p,{enabled:p!=null,stickIfOpen:_}),U=Da([I]),A=v.useState("triggerProps",w),N=g.useMemo(()=>({disabled:i,open:b}),[i,b]),{getButtonProps:M,buttonRef:x}=ys({disabled:i,native:a}),D=g.useMemo(()=>({open(B){return B&&R===Vn?tp.open(B):im.open(B)}}),[R]),T=He("button",t,{state:N,ref:[x,n,C,S],props:[U.getReferenceProps(),k,A,{[qC]:"",id:E},h,M],stateAttributesMapping:D}),L=g.useRef(null),P=W(B=>{Gt.flushSync(()=>{v.setOpen(!1,xe(Br,B.nativeEvent,B.currentTarget))});const $=UC(L.current);$==null||$.focus()}),q=W(B=>{var ue;const $=v.select("positionerElement");if($&&ni(B,$))(ue=v.context.beforeContentFocusGuardRef.current)==null||ue.focus();else{Gt.flushSync(()=>{v.setOpen(!1,xe(Br,B.nativeEvent,B.currentTarget))});let te=zC(S.current);for(;te!==null&&Re($,te)||te!=null&&te.hasAttribute("aria-hidden");){const ce=te;if(te=Jc(te),te===ce)break}te==null||te.focus()}});return m?ee.jsxs(g.Fragment,{children:[ee.jsx(Fn,{ref:L,onFocus:P}),ee.jsx(g.Fragment,{children:T},E),ee.jsx(Fn,{ref:v.context.triggerFocusTargetRef,onFocus:q})]}):ee.jsx(g.Fragment,{children:T},E)}),b_=g.createContext(void 0);function Qz(){const e=g.useContext(b_);if(e===void 0)throw new Error(et(45));return e}const oU=g.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,{store:i}=Do();return i.useState("mounted")||r?ee.jsx(b_.Provider,{value:r,children:ee.jsx(JC,{ref:n,...o,renderGuards:!1})}):null}),S_=g.createContext(void 0);function E_(){const e=g.useContext(S_);if(!e)throw new Error(et(46));return e}const iU=g.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:a="absolute",side:l="bottom",align:s="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:c="clipping-ancestors",collisionPadding:d=5,arrowPadding:h=5,sticky:y=!1,disableAnchorTracking:v=!1,collisionAvoidance:E=Hg,...m}=t,{store:p}=Do(),b=Qz(),S=Bg(),C=p.useState("floatingRootContext"),w=p.useState("mounted"),R=p.useState("open"),_=p.useState("openChangeReason"),O=p.useState("activeTriggerElement"),k=p.useState("modal"),I=p.useState("positionerElement"),U=p.useState("instantType"),A=p.useState("transitionStatus"),N=g.useRef(null),M=hs(I,!1,!1),x=am({anchor:i,floatingRootContext:C,positionMethod:a,mounted:w,side:l,sideOffset:u,align:s,alignOffset:f,arrowPadding:h,collisionBoundary:c,collisionPadding:d,sticky:y,disableAnchorTracking:v,keepMounted:b,nodeId:S,collisionAvoidance:E,adaptiveOrigin:_R}),D=g.useMemo(()=>{const $={};return R||($.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...x.positionerStyles,...$}}},[R,w,x.positionerStyles]),T=g.useMemo(()=>({props:D,...x}),[D,x]),L=C==null?void 0:C.select("domReferenceElement");ie(()=>{const $=L,ue=N.current;if($&&(N.current=$),ue&&$&&$!==ue){p.set("instantType",void 0);const te=new AbortController;return M(()=>{p.set("instantType","trigger-change")},te.signal),()=>{te.abort()}}},[L,M,p]);const P=g.useMemo(()=>({open:R,side:T.side,align:T.align,anchorHidden:T.anchorHidden,instant:U}),[R,T.side,T.align,T.anchorHidden,U]),q=g.useCallback($=>{p.set("positionerElement",$)},[p]),B=He("div",t,{state:P,props:[T.props,gs(A),m],ref:[n,q],stateAttributesMapping:Vr});return ee.jsxs(S_.Provider,{value:T,children:[w&&k===!0&&_!==yt&&ee.jsx(FR,{ref:p.context.internalBackdropRef,inert:ms(!R),cutout:O}),ee.jsx($C,{id:S,children:B})]})}),Zz={...Vr,...Pa},aU=g.forwardRef(function(t,n){const{className:r,render:o,initialFocus:i,finalFocus:a,...l}=t,{store:s}=Do(),u=E_(),f=IR()!=null,c=sf(),d=s.useState("open"),h=s.useState("openMethod"),y=s.useState("instantType"),v=s.useState("transitionStatus"),E=s.useState("popupProps"),m=s.useState("titleElementId"),p=s.useState("descriptionElementId"),b=s.useState("modal"),S=s.useState("mounted"),C=s.useState("openChangeReason"),w=s.useState("popupElement"),R=s.useState("payload"),_=s.useState("positionerElement"),O=s.useState("activeTriggerElement"),k=s.useState("floatingRootContext");Na({open:d,ref:s.context.popupRef,onComplete(){var B,$;d&&(($=(B=s.context).onOpenChangeComplete)==null||$.call(B,!0))}});const I=s.useState("disabled"),U=s.useState("openOnHover"),A=s.useState("closeDelay");rm(k,{enabled:U&&!I,closeDelay:A});function N(B){return B==="touch"?s.context.popupRef.current:!0}const M=i===void 0?N:i,x=g.useMemo(()=>({open:d,side:u.side,align:u.align,instant:y,transitionStatus:v}),[d,u.side,u.align,y,v]),D=g.useCallback(B=>{s.set("popupElement",B)},[s]);function T(){k.context.events.emit("measure-layout")}function L(B,$){k.context.events.emit("measure-layout-complete",{previousDimensions:B,nextDimensions:$})}const P=g.useCallback(()=>s.context.triggerElements.size>1,[s]);TR({popupElement:w,positionerElement:_,mounted:S,content:R,enabled:P,onMeasureLayout:T,onMeasureLayoutComplete:L,side:u.side,direction:c});const q=He("div",t,{state:x,ref:[n,s.context.popupRef,D],props:[E,{"aria-labelledby":m,"aria-describedby":p,onKeyDown(B){f&&jR.has(B.key)&&B.stopPropagation()}},gs(v),l],stateAttributesMapping:Zz});return ee.jsx(eR,{context:k,openInteractionType:h,modal:b==="trap-focus",disabled:!S||C===yt,initialFocus:M,returnFocus:a,restoreFocus:"popup",previousFocusableElement:at(O)?O:void 0,nextFocusableElement:s.context.triggerFocusTargetRef,beforeContentFocusGuardRef:s.context.beforeContentFocusGuardRef,children:q})}),lU=g.forwardRef(function(t,n){const{className:r,render:o,...i}=t,{store:a}=Do(),l=a.useState("open"),{arrowRef:s,side:u,align:f,arrowUncentered:c,arrowStyles:d}=E_(),h=g.useMemo(()=>({open:l,side:u,align:f,uncentered:c}),[l,u,f,c]);return He("div",t,{state:h,ref:[n,s],props:[{style:d,"aria-hidden":!0},i],stateAttributesMapping:Vr})}),Wz={...Vr,...Pa},sU=g.forwardRef(function(t,n){const{className:r,render:o,...i}=t,{store:a}=Do(),l=a.useState("open"),s=a.useState("mounted"),u=a.useState("transitionStatus"),f=a.useState("openChangeReason"),c=g.useMemo(()=>({open:l,transitionStatus:u}),[l,u]);return He("div",t,{state:c,ref:[a.context.backdropRef,n],props:[{role:"presentation",hidden:!s,style:{pointerEvents:f===yt?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i],stateAttributesMapping:Wz})});let zb=function(e){return e.popupWidth="--popup-width",e.popupHeight="--popup-height",e}({});const Jz={activationDirection:e=>e?{"data-activation-direction":e}:null},uU=g.forwardRef(function(t,n){const{render:r,className:o,children:i,...a}=t,{store:l}=Do(),s=l.useState("activeTriggerElement"),u=l.useState("open"),f=l.useState("floatingRootContext"),c=AR(u?s:null),d=g.useRef(null),[h,y]=g.useState(null),[v,E]=g.useState(null),m=g.useRef(null),p=g.useRef(null),b=hs(m,!0,!1),S=bi(),[C,w]=g.useState(null),[R,_]=g.useState(!1);ie(()=>{const M=m.current;if(!M)return;const x=document.createElement("div");for(const D of Array.from(M.childNodes))x.appendChild(D.cloneNode(!0));d.current=x});const O=W(()=>{var M,x,D;(M=m.current)==null||M.style.setProperty("animation","none"),(x=m.current)==null||x.style.setProperty("transition","none"),(D=p.current)==null||D.style.setProperty("display","none")}),k=W(M=>{var x,D,T;(x=m.current)==null||x.style.removeProperty("animation"),(D=m.current)==null||D.style.removeProperty("transition"),(T=p.current)==null||T.style.removeProperty("display"),C||w(M.previousDimensions)});g.useEffect(()=>(f.context.events.on("measure-layout",O),f.context.events.on("measure-layout-complete",k),()=>{f.context.events.off("measure-layout",O),f.context.events.off("measure-layout-complete",k)}),[f,O,k]);const I=g.useRef(null);ie(()=>{if(s&&c&&s!==c&&I.current!==s&&d.current){y(d.current),_(!0);const M=t3(c,s);E(M),S.request(()=>{S.request(()=>{_(!1),b(()=>{y(null),w(null),d.current=null})})}),I.current=s}},[s,c,h,b,S]);const U=h!=null;let A;U?A=ee.jsxs(g.Fragment,{children:[ee.jsx("div",{"data-previous":!0,inert:ms(!0),ref:p,style:{[zb.popupWidth]:`${C==null?void 0:C.width}px`,[zb.popupHeight]:`${C==null?void 0:C.height}px`,position:"absolute"},"data-ending-style":R?void 0:""},"previous"),ee.jsx("div",{"data-current":!0,ref:m,"data-starting-style":R?"":void 0,children:i},"current")]}):A=ee.jsx("div",{"data-current":!0,ref:m,children:i},"current"),ie(()=>{const M=p.current;!M||!h||M.replaceChildren(...Array.from(h.childNodes))},[h]);const N=g.useMemo(()=>({activationDirection:e3(v),transitioning:U}),[v,U]);return He("div",t,{state:N,ref:n,props:[a,{children:A}],stateAttributesMapping:Jz})});function e3(e){if(e)return`${Ub(e.horizontal,5,"right","left")} ${Ub(e.vertical,5,"down","up")}`}function Ub(e,t,n,r){return e>t?n:e<-t?r:""}function t3(e,t){const n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),o={x:n.left+n.width/2,y:n.top+n.height/2},i={x:r.left+r.width/2,y:r.top+r.height/2};return{horizontal:i.x-o.x,vertical:i.y-o.y}}class n3{constructor(){this.store=new _f}open(t){const n=t?this.store.context.triggerElements.getById(t)??void 0:void 0;if(t&&!n)throw new Error(et(80,t));this.store.setOpen(!0,xe(ui,void 0,n))}close(){this.store.setOpen(!1,xe(ui,void 0,void 0))}get isOpen(){return this.store.state.open}}function cU(){return new n3}let Bb=0;function C_(e){return Bb+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${Bb}`}const Rm=g.createContext(void 0);function wm(){const e=g.useContext(Rm);if(!e)throw new Error(et(73));return e}function jd(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const fU=function(t){const{children:n,timeout:r=5e3,limit:o=3,toastManager:i}=t,[a,l]=g.useState([]),[s,u]=g.useState(!1),[f,c]=g.useState(!1),[d,h]=g.useState(null);a.length===0&&(s&&u(!1),f&&c(!1));const y=s||f,v=g.useRef(new Map),E=g.useRef(null),m=g.useRef(!0),p=g.useRef(!1);function b(A){var T,L;const N=en(Xt(E.current));if(!E.current||!Re(E.current,N)||!oc(N))return;const M=a.findIndex(P=>P.id===A);let x=null,D=M+1;for(;D<a.length;){if(a[D].transitionStatus!=="ending"){x=a[D];break}D+=1}if(!x)for(D=M-1;D>=0;){if(a[D].transitionStatus!=="ending"){x=a[D];break}D-=1}x?(L=(T=x.ref)==null?void 0:T.current)==null||L.focus():d==null||d.focus({preventScroll:!0})}const S=W(()=>{p.current||(p.current=!0,v.current.forEach(A=>{if(A.timeout){A.timeout.clear();const N=Date.now()-A.start,M=A.delay-N;A.remaining=M>0?M:0}}))}),C=W(()=>{p.current&&(p.current=!1,v.current.forEach((A,N)=>{A.remaining=A.remaining>0?A.remaining:A.delay,A.timeout??(A.timeout=Xn.create()),A.timeout.start(A.remaining,()=>{v.current.delete(N),A.callback()}),A.start=Date.now()}))}),w=W(A=>{var x;l(D=>{const T=D.map(P=>P.id===A?{...P,transitionStatus:"ending",height:0}:P),L=T.filter(P=>P.transitionStatus!=="ending");return T.map(P=>{if(P.transitionStatus==="ending")return P;const q=L.indexOf(P)>=o;return{...P,limited:q}})});const N=v.current.get(A);N&&N.timeout&&(N.timeout.clear(),v.current.delete(A));const M=a.find(D=>D.id===A);(x=M==null?void 0:M.onClose)==null||x.call(M),b(A),a.length===1&&(u(!1),c(!1))}),R=W(A=>{var M;l(x=>x.filter(D=>D.id!==A));const N=a.find(x=>x.id===A);(M=N==null?void 0:N.onRemove)==null||M.call(N)}),_=W((A,N,M)=>{const x=Date.now(),D=m.current&&!s&&!f,T=D?Xn.create():void 0;T==null||T.start(N,()=>{v.current.delete(A),M()}),v.current.set(A,{timeout:T,start:D?x:0,delay:N,remaining:N,callback:M})}),O=W(A=>{const N=A.id||C_("toast"),M={...A,id:N,transitionStatus:"starting"};l(D=>{const T=[M,...D],L=T.filter(P=>P.transitionStatus!=="ending");if(L.length>o){const P=L.length-o,q=L.slice(-P);return T.map(B=>q.some($=>$.id===B.id)?{...B,limited:!0}:{...B,limited:!1})}return T.map(P=>({...P,limited:!1}))});const x=M.timeout??r;return M.type!=="loading"&&x>0&&_(N,x,()=>w(N)),(s||f||!m.current)&&S(),N}),k=W((A,N)=>{l(M=>M.map(x=>x.id===A?{...x,...N}:x))}),I=W((A,N)=>{const M=jd(N.loading),x=O({...M,type:"loading"}),D=A.then(T=>{const L=jd(N.success,T);k(x,{...L,type:"success"});const P=L.timeout??r;return P>0&&_(x,P,()=>w(x)),(s||f||!m.current)&&S(),T}).catch(T=>{const L=jd(N.error,T);k(x,{...L,type:"error"});const P=L.timeout??r;return P>0&&_(x,P,()=>w(x)),(s||f||!m.current)&&S(),Promise.reject(T)});return{}.hasOwnProperty.call(N,"setPromise")&&N.setPromise(D),D});g.useEffect(function(){return i?i[" subscribe"](({action:M,options:x})=>{const D=x.id;M==="promise"&&x.promise?I(x.promise,x):M==="update"&&D?k(D,x):M==="close"&&D?w(D):O(x)}):void 0},[O,k,_,r,i,I,w]);const U=g.useMemo(()=>({toasts:a,setToasts:l,hovering:s,setHovering:u,focused:f,setFocused:c,expanded:y,add:O,close:w,remove:R,update:k,promise:I,pauseTimers:S,resumeTimers:C,prevFocusElement:d,setPrevFocusElement:h,viewportRef:E,scheduleTimer:_,windowFocusedRef:m}),[O,w,f,s,y,S,d,I,R,C,_,a,k]);return ee.jsx(Rm.Provider,{value:U,children:n})},r3=g.createContext(void 0);let o3=function(e){return e.frontmostHeight="--toast-frontmost-height",e}({});const dU=g.forwardRef(function(t,n){var T;const{render:r,className:o,children:i,...a}=t,{toasts:l,pauseTimers:s,resumeTimers:u,setHovering:f,setFocused:c,viewportRef:d,windowFocusedRef:h,prevFocusElement:y,setPrevFocusElement:v,expanded:E,focused:m}=wm(),p=g.useRef(!1),b=g.useRef(!1),S=l.length,C=((T=l[0])==null?void 0:T.height)??0,w=g.useMemo(()=>l.some(L=>L.transitionStatus==="ending"),[l]);g.useEffect(()=>{if(!d.current)return;function L(q){var B;S!==0&&q.key==="F6"&&q.target!==d.current&&(q.preventDefault(),v(en(Xt(d.current))),(B=d.current)==null||B.focus({preventScroll:!0}),s(),c(!0))}const P=nt(d.current);return P.addEventListener("keydown",L),()=>{P.removeEventListener("keydown",L)}},[s,c,v,S,d]),g.useEffect(()=>{if(!d.current||!S)return;const L=nt(d.current);function P(B){B.target===L&&(h.current=!1,s())}function q(B){if(B.relatedTarget||B.target===L)return;const $=At(B),ue=en(Xt(d.current));(!Re(d.current,$)||!oc(ue))&&u(),setTimeout(()=>{h.current=!0})}return L.addEventListener("blur",P,!0),L.addEventListener("focus",q,!0),()=>{L.removeEventListener("blur",P,!0),L.removeEventListener("focus",q,!0)}},[s,u,d,h,c,S]),g.useEffect(()=>{const L=d.current;if(!L||S===0)return;const P=Xt(L);function q(B){if(B.pointerType!=="touch")return;const $=At(B);Re(L,$)||(u(),f(!1),c(!1))}return P.addEventListener("pointerdown",q,!0),()=>{P.removeEventListener("pointerdown",q,!0)}},[S,u,c,f,d]);function R(L){var P,q,B;d.current&&(p.current=!0,L.relatedTarget===d.current?(B=(q=(P=l[0])==null?void 0:P.ref)==null?void 0:q.current)==null||B.focus():y==null||y.focus({preventScroll:!0}))}function _(L){L.key==="Tab"&&L.shiftKey&&L.target===d.current&&(L.preventDefault(),y==null||y.focus({preventScroll:!0}),u())}g.useEffect(()=>{!h.current||w||!b.current||(u(),f(!1),b.current=!1)},[w,u,f,h]);function O(){s(),f(!0),b.current=!1}function k(){l.some(L=>L.transitionStatus==="ending")?b.current=!0:(u(),f(!1))}function I(){if(p.current){p.current=!1;return}m||oc(Xt(d.current).activeElement)&&(c(!0),s())}function U(L){!m||Re(d.current,L.relatedTarget)||(c(!1),u())}const A={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:O,onMouseMove:O,onMouseLeave:k,onFocus:I,onBlur:U,onKeyDown:_,onClick:I},N=g.useMemo(()=>({expanded:E}),[E]),M=He("div",t,{ref:[n,d],state:N,props:[A,{style:{[o3.frontmostHeight]:C?`${C}px`:void 0}},a,{children:ee.jsxs(g.Fragment,{children:[S>0&&y&&ee.jsx(Fn,{onFocus:R}),i,S>0&&y&&ee.jsx(Fn,{onFocus:R})]})}]}),x=g.useMemo(()=>({viewportRef:d}),[d]),D=g.useMemo(()=>l.filter(L=>L.priority==="high"),[l]);return ee.jsxs(r3.Provider,{value:x,children:[S>0&&y&&ee.jsx(Fn,{onFocus:R}),M,!m&&D.length>0&&ee.jsx("div",{style:Vg,children:D.map(L=>ee.jsxs("div",{role:"alert","aria-atomic":!0,children:[ee.jsx("div",{children:L.title}),ee.jsx("div",{children:L.description})]},L.id))})]})}),R_=g.createContext(void 0);function di(){const e=g.useContext(R_);if(!e)throw new Error(et(66));return e}let Bo=function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e}({});const i3={...Pa,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},Za=40,a3=10,Yr=.5,l3=1;function Hb(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function s3(e){const n=window.getComputedStyle(e).transform;let r=0,o=0,i=1;if(n&&n!=="none"){const a=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(a){const l=a[1].split(", ").map(parseFloat);l.length===6?(r=l[4],o=l[5],i=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(r=l[12],o=l[13],i=l[0])}}return{x:r,y:o,scale:i}}const hU=g.forwardRef(function(t,n){var ae;const{toast:r,render:o,className:i,swipeDirection:a=["down","right"],...l}=t,s=((ae=r.positionerProps)==null?void 0:ae.anchor)!==void 0;let u=[];s||(u=Array.isArray(a)?a:[a]);const f=u.length>0,{toasts:c,focused:d,close:h,remove:y,setToasts:v,pauseTimers:E,expanded:m,setHovering:p}=wm(),[b,S]=g.useState(void 0),[C,w]=g.useState(!1),[R,_]=g.useState(!1),[O,k]=g.useState(!1),[I,U]=g.useState({x:0,y:0}),[A,N]=g.useState({x:0,y:0,scale:1}),[M,x]=g.useState(),[D,T]=g.useState(),[L,P]=g.useState(null),q=g.useRef(null),B=g.useRef({x:0,y:0}),$=g.useRef({x:0,y:0,scale:1}),ue=g.useRef(void 0),te=g.useRef(0),ce=g.useRef(!1),oe=g.useRef({x:0,y:0}),J=g.useRef(!1),Se=g.useMemo(()=>c.indexOf(r),[r,c]),Ae=g.useMemo(()=>c.filter(j=>j.transitionStatus!=="ending").indexOf(r),[r,c]),G=g.useMemo(()=>c.slice(0,c.indexOf(r)).reduce((j,Z)=>j+(Z.height||0),0),[c,r]);Na({open:r.transitionStatus!=="ending",ref:q,onComplete(){r.transitionStatus==="ending"&&y(r.id)}});const Y=W((j=!1)=>{const Z=q.current;if(!Z)return;const ye=Z.style.height;Z.style.height="auto";const ge=Z.offsetHeight;Z.style.height=ye;function be(){v(Te=>Te.map(De=>De.id===r.id?{...De,ref:q,height:ge,transitionStatus:void 0}:De))}j?Gt.flushSync(be):be()});ie(Y,[Y]);function ne(j,Z){let ye=j,ge=Z;return!u.includes("left")&&!u.includes("right")?ye=j>0?j**Yr:-(Math.abs(j)**Yr):(!u.includes("right")&&j>0&&(ye=j**Yr),!u.includes("left")&&j<0&&(ye=-(Math.abs(j)**Yr))),!u.includes("up")&&!u.includes("down")?ge=Z>0?Z**Yr:-(Math.abs(Z)**Yr):(!u.includes("down")&&Z>0&&(ge=Z**Yr),!u.includes("up")&&Z<0&&(ge=-(Math.abs(Z)**Yr))),{x:ye,y:ge}}function Ne(j){var ge;if(j.button!==0)return;j.pointerType==="touch"&&E();const Z=At(j.nativeEvent);if(!(Z&&Z.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(ce.current=!1,ue.current=void 0,te.current=0,B.current={x:j.clientX,y:j.clientY},oe.current=B.current,q.current){const be=s3(q.current);$.current=be,N(be),U({x:be.x,y:be.y})}p(!0),w(!0),_(!1),P(null),J.current=!0,(ge=q.current)==null||ge.setPointerCapture(j.pointerId)}}function pe(j){if(!C)return;j.preventDefault(),J.current&&(B.current={x:j.clientX,y:j.clientY},J.current=!1);const{clientY:Z,clientX:ye,movementX:ge,movementY:be}=j;(be<0&&Z>oe.current.y||be>0&&Z<oe.current.y)&&(oe.current={x:oe.current.x,y:Z}),(ge<0&&ye>oe.current.x||ge>0&&ye<oe.current.x)&&(oe.current={x:ye,y:oe.current.y});const Te=ye-B.current.x,De=Z-B.current.y,$t=Z-oe.current.y,ln=ye-oe.current.x;if(!R&&Math.sqrt(Te*Te+De*De)>=l3&&(_(!0),L===null)){const ze=u.includes("left")||u.includes("right"),st=u.includes("up")||u.includes("down");if(ze&&st){const Vt=Math.abs(Te),rt=Math.abs(De);P(Vt>rt?"horizontal":"vertical")}}let he;if(!ue.current)L==="vertical"?De>0?he="down":De<0&&(he="up"):L==="horizontal"?Te>0?he="right":Te<0&&(he="left"):Math.abs(Te)>=Math.abs(De)?he=Te>0?"right":"left":he=De>0?"down":"up",he&&u.includes(he)&&(ue.current=he,te.current=Hb(he,Te,De),S(he));else{const jt=ue.current,ze=Hb(jt,ln,$t);ze>Za?(ce.current=!1,S(jt)):!(u.includes("left")&&u.includes("right"))&&!(u.includes("up")&&u.includes("down"))&&te.current-ze>=a3&&(ce.current=!0)}const Pe=ne(Te,De);let lt=$.current.x,Fr=$.current.y;L==="horizontal"?(u.includes("left")||u.includes("right"))&&(lt+=Pe.x):(L==="vertical"||(u.includes("left")||u.includes("right"))&&(lt+=Pe.x),(u.includes("up")||u.includes("down"))&&(Fr+=Pe.y)),U({x:lt,y:Fr})}function Q(j){var Te;if(!C)return;if(w(!1),_(!1),P(null),(Te=q.current)==null||Te.releasePointerCapture(j.pointerId),ce.current){U({x:A.x,y:A.y}),S(void 0);return}let Z=!1;const ye=I.x-A.x,ge=I.y-A.y;let be;for(const De of u){switch(De){case"right":ye>Za&&(Z=!0,be="right");break;case"left":ye<-Za&&(Z=!0,be="left");break;case"down":ge>Za&&(Z=!0,be="down");break;case"up":ge<-Za&&(Z=!0,be="up");break}if(Z)break}Z?(S(be),k(!0),h(r.id)):(U({x:A.x,y:A.y}),S(void 0))}function K(j){if(j.key==="Escape"){if(!q.current||!Re(q.current,en(Xt(q.current))))return;h(r.id)}}g.useEffect(()=>{if(!f)return;const j=q.current;if(!j)return;function Z(ye){Re(j,ye.target)&&ye.preventDefault()}return j.addEventListener("touchmove",Z,{passive:!1}),()=>{j.removeEventListener("touchmove",Z)}},[f]);function re(){if(!C&&I.x===A.x&&I.y===A.y&&!O)return{[Bo.swipeMovementX]:"0px",[Bo.swipeMovementY]:"0px"};const j=I.x-A.x,Z=I.y-A.y;return{transition:C?"none":void 0,transform:C?`translateX(${I.x}px) translateY(${I.y}px) scale(${A.scale})`:void 0,[Bo.swipeMovementX]:`${j}px`,[Bo.swipeMovementY]:`${Z}px`}}const de=r.priority==="high",me={role:de?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":M,"aria-describedby":D,"aria-hidden":de&&!d?!0:void 0,onPointerDown:f?Ne:void 0,onPointerMove:f?pe:void 0,onPointerUp:f?Q:void 0,onKeyDown:K,inert:ms(r.limited),style:{...re(),[Bo.index]:r.transitionStatus==="ending"?Se:Ae,[Bo.offsetY]:`${G}px`,[Bo.height]:r.height?`${r.height}px`:void 0}},le=g.useMemo(()=>({rootRef:q,toast:r,titleId:M,setTitleId:x,descriptionId:D,setDescriptionId:T,swiping:C,swipeDirection:b,recalculateHeight:Y,index:Se,visibleIndex:Ae,expanded:m}),[r,M,D,C,b,Y,Se,Ae,m]),se=g.useMemo(()=>({transitionStatus:r.transitionStatus,expanded:m,limited:r.limited||!1,type:r.type,swiping:le.swiping,swipeDirection:le.swipeDirection}),[m,r.transitionStatus,r.limited,r.type,le.swiping,le.swipeDirection]),X=He("div",t,{ref:[n,le.rootRef],state:se,stateAttributesMapping:i3,props:[me,l]});return ee.jsx(R_.Provider,{value:le,children:X})}),pU=g.forwardRef(function(t,n){const{render:r,className:o,...i}=t,{visibleIndex:a,expanded:l,recalculateHeight:s}=di(),u=g.useRef(null);ie(()=>{const h=u.current;if(!h||(s(),typeof ResizeObserver!="function"||typeof MutationObserver!="function"))return;const y=new ResizeObserver(()=>s(!0)),v=new MutationObserver(()=>s(!0));return y.observe(h),v.observe(h,{childList:!0,subtree:!0,characterData:!0}),()=>{y.disconnect(),v.disconnect()}},[s]);const f=a>0,c=g.useMemo(()=>({expanded:l,behind:f}),[l,f]);return He("div",t,{ref:[n,u],state:c,props:i})}),gU=g.forwardRef(function(t,n){const{render:r,className:o,id:i,children:a,...l}=t,{toast:s}=di(),u=a??s.description,f=!!u,c=jr(i),{setDescriptionId:d}=di();ie(()=>{if(f)return d(c),()=>{d(void 0)}},[f,c,d]);const h=g.useMemo(()=>({type:s.type}),[s.type]),y=He("p",t,{ref:n,state:h,props:{...l,id:c,children:u}});return f?y:null}),mU=g.forwardRef(function(t,n){const{render:r,className:o,id:i,children:a,...l}=t,{toast:s}=di(),u=a??s.title,f=!!u,c=jr(i),{setTitleId:d}=di();ie(()=>{if(f)return d(c),()=>{d(void 0)}},[f,c,d]);const h=g.useMemo(()=>({type:s.type}),[s.type]),y=He("h2",t,{ref:n,state:h,props:{...l,id:c,children:u}});return f?y:null}),yU=g.forwardRef(function(t,n){const{render:r,className:o,disabled:i,nativeButton:a=!0,...l}=t,{close:s,expanded:u}=wm(),{toast:f}=di(),[c,d]=g.useState(!1),{getButtonProps:h,buttonRef:y}=ys({disabled:i,native:a}),v=g.useMemo(()=>({type:f.type}),[f.type]);return He("button",t,{ref:[n,y],state:v,props:[{"aria-hidden":!u&&!c,onClick(){s(f.id)},onFocus(){d(!0)},onBlur(){d(!1)}},l,h]})}),vU=g.forwardRef(function(t,n){var v;const{render:r,className:o,disabled:i,nativeButton:a=!0,...l}=t,{toast:s}=di(),u=((v=s.actionProps)==null?void 0:v.children)??l.children,f=!!u,{getButtonProps:c,buttonRef:d}=ys({disabled:i,native:a}),h=g.useMemo(()=>({type:s.type}),[s.type]),y=He("button",t,{ref:[n,d],state:h,props:[l,s.actionProps,c,{children:u}]});return f?y:null}),bU=CR;function SU(){const e=g.useContext(Rm);if(!e)throw new Error(et(73));const{toasts:t,add:n,close:r,update:o,promise:i}=e;return g.useMemo(()=>({toasts:t,add:n,close:r,update:o,promise:i}),[t,n,r,o,i])}function EU(){const e=[];function t(n){e.forEach(r=>r(n))}return{" subscribe":function(r){return e.push(r),()=>{const o=e.indexOf(r);o!==-1&&e.splice(o,1)}},add(n){const r=n.id||C_("toast"),o={...n,id:r,transitionStatus:"starting"};return t({action:"add",options:o}),r},close(n){t({action:"close",options:{id:n}})},update(n,r){t({action:"update",options:{...r,id:n}})},promise(n,r){let o=n;return t({action:"promise",options:{...r,promise:n,setPromise(i){o=i}}}),o}}}var u3=typeof document<"u",c3=function(){},Sp=u3?g.useLayoutEffect:c3;const f3={...Ac},d3=f3.useInsertionEffect,h3=d3||(e=>e());function p3(e){const t=g.useRef(()=>{});return h3(()=>{t.current=e}),g.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}const g3={...Ac};let Gb=!1,m3=0;const $b=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+m3++;function y3(){const[e,t]=g.useState(()=>Gb?$b():void 0);return Sp(()=>{e==null&&t($b())},[]),g.useEffect(()=>{Gb=!0},[]),e}const v3=g3.useId,b3=v3||y3;function S3(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const E3=g.createContext(null),C3=g.createContext(null),R3=()=>{var e;return((e=g.useContext(E3))==null?void 0:e.id)||null},w3=()=>g.useContext(C3);function _3(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=b3(),i=g.useRef({}),[a]=g.useState(()=>S3()),l=R3()!=null,[s,u]=g.useState(r.reference),f=p3((h,y,v)=>{i.current.openEvent=h?y:void 0,a.emit("openchange",{open:h,event:y,reason:v,nested:l}),n==null||n(h,y,v)}),c=g.useMemo(()=>({setPositionReference:u}),[]),d=g.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return g.useMemo(()=>({dataRef:i,open:t,onOpenChange:f,elements:d,events:a,floatingId:o,refs:c}),[t,f,d,a,o,c])}function CU(e){var t,n;let{elements:r,...o}=e===void 0?{}:e;const{nodeId:i}=o,a=_3({...o,elements:{reference:(t=r==null?void 0:r.reference)!=null?t:null,floating:(n=r==null?void 0:r.floating)!=null?n:null}}),l=o.rootContext||a,s=l.elements,[u,f]=g.useState(null),[c,d]=g.useState(null),y=(s==null?void 0:s.domReference)||u,v=g.useRef(null),E=w3();Sp(()=>{y&&(v.current=y)},[y]);const m=sR({...o,elements:{...s,...c&&{reference:c}}}),p=g.useCallback(R=>{const _=Ie(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(_),m.refs.setReference(_)},[m.refs]),b=g.useCallback(R=>{(Ie(R)||R===null)&&(v.current=R,f(R)),(Ie(m.refs.reference.current)||m.refs.reference.current===null||R!==null&&!Ie(R))&&m.refs.setReference(R)},[m.refs]),S=g.useMemo(()=>({...m.refs,setReference:b,setPositionReference:p,domReference:v}),[m.refs,b,p]),C=g.useMemo(()=>({...m.elements,domReference:y}),[m.elements,y]),w=g.useMemo(()=>({...m,...l,refs:S,elements:C,nodeId:i}),[m,S,C,i,l]);return Sp(()=>{l.dataRef.current.floatingContext=w;const R=E==null?void 0:E.nodesRef.current.find(_=>_.id===i);R&&(R.context=w)}),g.useMemo(()=>({...m,context:w,refs:S,elements:C}),[m,S,C,w])}export{pU as $,ql as A,U_ as B,T3 as C,rU as D,iU as E,aU as F,lU as G,uU as H,oU as I,cU as J,sU as K,cb as L,G3 as M,JD as N,Mw as O,nU as P,WD as Q,r1 as R,Q3 as S,N3 as T,hm as U,KD as V,E2 as W,C2 as X,eU as Y,hU as Z,V as _,Ac as a,mU as a0,yU as a1,gU as a2,vU as a3,EU as a4,fU as a5,bU as a6,dU as a7,SU as a8,O3 as a9,mA as aa,M3 as ab,kA as ac,k3 as ad,uC as ae,AD as af,mc as ag,nP as ah,Ht as ai,sp as aj,ba as ak,gz as al,Ek as am,wk as an,Ck as ao,CU as ap,vk as aq,dk as ar,pk as as,hk as at,tU as au,Gt as b,A3 as c,P3 as d,I3 as e,z3 as f,L3 as g,D3 as h,B3 as i,ee as j,U3 as k,$3 as l,Hl as m,X3 as n,K3 as o,q3 as p,Y3 as q,g as r,F3 as s,H3 as t,V3 as u,j3 as v,Z3 as w,AN as x,p_ as y,d_ as z};