lantern-harness 0.1.8 → 0.1.10

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 (183) hide show
  1. package/CHANGELOG.md +106 -0
  2. package/README.md +7 -7
  3. package/builtin/session/lh-fs.mjs +32 -14
  4. package/cli/server.mjs +2 -0
  5. package/config/app.defaults.json +1 -0
  6. package/dist/500.html +258 -22
  7. package/dist/_astro/Base.BOY6F0mi.css +1 -0
  8. package/dist/_astro/Base.astro_astro_type_script_index_0_lang.C30xtpc6.js +1 -0
  9. package/dist/_astro/CaseExecBoard.Dttqp0wg.js +1 -0
  10. package/dist/_astro/CaseGenerateApp.DqW_nWMc.js +9 -0
  11. package/dist/_astro/CasesLibrary.8aMUUGp_.js +1 -0
  12. package/dist/_astro/ChatApp.BLxf0h1d.js +219 -0
  13. package/dist/_astro/ColumnResize.BEkEW7qw.js +1 -0
  14. package/dist/_astro/{ConfirmDialog.CBVsDJ8f.js → ConfirmDialog.BZzZWDci.js} +1 -1
  15. package/dist/_astro/{DashboardBoard.Bd3eUPwZ.js → DashboardBoard.CkSbhEDI.js} +3 -3
  16. package/dist/_astro/DatePicker.Bkl71M49.js +1 -0
  17. package/dist/_astro/DocsFileBrowser.MKVCfZrE.js +1 -0
  18. package/dist/_astro/DocsPager.DJY4foYL.js +1 -0
  19. package/dist/_astro/{DrawerField.CWMLhcPX.js → DrawerField.CHRg77LG.js} +1 -1
  20. package/dist/_astro/{ExcelFieldTags.B_XMwNNx.js → ExcelFieldTags.DXMeaDa5.js} +4 -4
  21. package/dist/_astro/KnowledgeLibrary.B-p1aoQN.js +1 -0
  22. package/dist/_astro/NamePromptDialog.Wa9O530a.js +1 -0
  23. package/dist/_astro/NavLibraries.C6LImMO_.js +1 -0
  24. package/dist/_astro/OverflowHint.D6v4Uj2N.js +1 -0
  25. package/dist/_astro/PluginsPage.-97n3x2U.js +39 -0
  26. package/dist/_astro/PluginsPage.DkmRPfbU.js +1 -0
  27. package/dist/_astro/PmBugsBoard.CMT4-eoB.js +1 -0
  28. package/dist/_astro/PmIterationsBoard.BQM_dzdZ.js +1 -0
  29. package/dist/_astro/PmProjectDetail.CzU80pat.js +1 -0
  30. package/dist/_astro/PmProjectsBoard.Cxsa7SYQ.js +1 -0
  31. package/dist/_astro/PmRequirementsBoard.4_JMDDN0.js +1 -0
  32. package/dist/_astro/PmRequirementsBoard.B8HL07cw.js +1 -0
  33. package/dist/_astro/PmShared.Ca2Ao7v_.js +1 -0
  34. package/dist/_astro/PromptsLibrary.C9BcIxKK.js +1 -0
  35. package/dist/_astro/ReportsPage.Fh5DRKLT.js +1 -0
  36. package/dist/_astro/RequirementsLibrary.CBkuWE8X.js +1 -0
  37. package/dist/_astro/SearchableSelect.DnjoSslK.js +1 -0
  38. package/dist/_astro/SelectDropdown.CuuDHa8s.js +1 -0
  39. package/dist/_astro/SettingsDialog.CJvBRcs9.js +1 -0
  40. package/dist/_astro/SlideOverDrawer.B7B5Wu8I.js +1 -0
  41. package/dist/_astro/{SpaceSwitcher.BEJo5KFi.js → SpaceSwitcher.BVQLt_tL.js} +2 -2
  42. package/dist/_astro/TagSelect.CuN5RdF4.js +1 -0
  43. package/dist/_astro/TasksBoard.Bu-fpIZ7.js +1 -0
  44. package/dist/_astro/TemplatesLibrary.DSylQGlN.js +1 -0
  45. package/dist/_astro/TestStatsBoard.CPyKW4wc.js +1 -0
  46. package/dist/_astro/Toast.R8_2OWRX.js +1 -0
  47. package/dist/_astro/TodosBoard.8kvRTEW-.js +1 -0
  48. package/dist/_astro/UiAutoBoard.DFTiDqCp.js +9 -0
  49. package/dist/_astro/active-element-history.CED-m1Zp.js +1 -0
  50. package/dist/_astro/app-config.BUPzGl9f.js +1 -0
  51. package/dist/_astro/{client.Be_SakrB.js → client.BHNTqLjv.js} +3 -3
  52. package/dist/_astro/dialog.BAPTk9a_.js +1 -0
  53. package/dist/_astro/hydrate-cache.BXX604Bw.js +1 -0
  54. package/dist/_astro/i18n.BGPnP1Bg.js +7 -0
  55. package/dist/_astro/index.astro_astro_type_script_index_0_lang.LPL9mPQY.js +1 -0
  56. package/dist/_astro/jsx-runtime.DUg_B_vD.js +1 -0
  57. package/dist/_astro/{lib.DJNDi_Ht.js → lib.CgXLzMMd.js} +15 -15
  58. package/dist/_astro/listbox.C96OCanh.js +1 -0
  59. package/dist/_astro/markdown-client.DRva7DS9.js +58 -0
  60. package/dist/_astro/menu.IPWdRoNM.js +1 -0
  61. package/dist/_astro/{open-docs-in-session.B0ZdZNj2.js → open-docs-in-session.CyFNgh1I.js} +1 -1
  62. package/dist/_astro/{plugins.D5ypJIXn.js → plugins.C2BMfzv1.js} +1 -1
  63. package/dist/_astro/{pm.BsnTv63L.js → pm.CagBA-ht.js} +4 -4
  64. package/dist/_astro/{portal.Cm9XlIPf.js → portal.C0hAhXDF.js} +2 -2
  65. package/dist/_astro/prompts-meta.Bua-j14I.js +2 -0
  66. package/dist/_astro/react-dom.DLW9pGCF.js +1 -0
  67. package/dist/_astro/{react-dom.CqAxpHMt.js → react.Blvh0GOs.js} +1 -1
  68. package/dist/_astro/report-prompt.CAfZ6RIo.js +1 -0
  69. package/dist/_astro/{settings.CnDCvwnQ.js → settings.Ceefeil5.js} +2 -2
  70. package/dist/_astro/{spaces-client.Cai2tHEI.js → spaces-client.BocUabwy.js} +1 -1
  71. package/dist/_astro/ui-auto-prompt.CX8fju7r.js +3 -0
  72. package/dist/_astro/ui-auto.BmC9JJ_X.js +1 -0
  73. package/dist/_astro/update.CvfIVwnq.js +1 -0
  74. package/dist/_astro/use-text-value.DBQvHeNl.js +1 -0
  75. package/dist/_astro/use-tree-walker.DFU2AaAP.js +1 -0
  76. package/dist/_astro/useListAnim.BoerpmsB.js +1 -0
  77. package/dist/_astro/{view-prefs.HCowOWXL.js → view-prefs.BEAZRcxF.js} +1 -1
  78. package/dist/case-exec/index.html +458 -22
  79. package/dist/cases/generate/index.html +258 -22
  80. package/dist/cases/library/index.html +458 -22
  81. package/dist/dashboard/index.html +458 -22
  82. package/dist/docs/changelog/index.html +389 -23
  83. package/dist/docs/install/index.html +258 -22
  84. package/dist/docs/manual/index.html +324 -27
  85. package/dist/index.html +2 -281
  86. package/dist/knowledge/index.html +458 -22
  87. package/dist/knowledge//345/212/237/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213/347/274/226/345/206/231/350/247/204/350/214/203/index.html +258 -22
  88. package/dist/plugins/index.html +258 -22
  89. package/dist/pm/bugs/index.html +458 -22
  90. package/dist/pm/iterations/index.html +458 -22
  91. package/dist/pm/projects/detail/index.html +458 -22
  92. package/dist/pm/projects/index.html +458 -22
  93. package/dist/pm/requirements/index.html +458 -22
  94. package/dist/prompts/index.html +458 -22
  95. package/dist/reports/index.html +458 -22
  96. package/dist/requirements/index.html +458 -22
  97. package/dist/tasks/index.html +458 -22
  98. package/dist/templates/index.html +458 -22
  99. package/dist/templates//345/212/237/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212//345/212/237/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +258 -22
  100. package/dist/templates//346/200/247/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212//346/200/247/350/203/275/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +258 -22
  101. package/dist/templates//346/200/247/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213//346/200/247/350/203/275/346/265/213/350/257/225/347/224/250/344/276/213/346/250/241/346/235/277/index.html +258 -22
  102. package/dist/templates//346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212//346/216/245/345/217/243/346/265/213/350/257/225/346/212/245/345/221/212/346/250/241/346/235/277/index.html +258 -22
  103. package/dist/templates//350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/347/224/250/344/276/213//350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/347/224/250/344/276/213/346/250/241/346/235/277/index.html +258 -22
  104. package/dist/test-automation/index.html +717 -0
  105. package/dist/test-stats/index.html +458 -22
  106. package/dist/todos/index.html +458 -22
  107. package/dist/workbench/index.html +517 -0
  108. package/docs//346/223/215/344/275/234/346/211/213/345/206/214.md +85 -34
  109. package/lh-plugins/lh-project-docs.mjs +14 -0
  110. package/lh-plugins/lh-uiauto.mjs +2296 -0
  111. package/lh-plugins/plugin-prompts.mjs +200 -0
  112. package/lh-plugins/storage-domain.mjs +13 -0
  113. package/lh-plugins/uiauto-adapters/index.mjs +57 -0
  114. package/lh-plugins/uiauto-adapters/playwright.mjs +215 -0
  115. package/lh-plugins/uiauto-adapters/pytest.mjs +151 -0
  116. package/lh-plugins/uiauto-adapters/selenium.mjs +163 -0
  117. package/lh-plugins/uiauto-adapters/shared.mjs +371 -0
  118. package/lh-plugins/uiauto-adapters/tasks.mjs +369 -0
  119. package/lh-plugins/uiauto-argv-guard.cjs +41 -0
  120. package/lh-plugins/uiauto-explorer/apps.mjs +332 -0
  121. package/lh-plugins/uiauto-explorer/diff.mjs +159 -0
  122. package/lh-plugins/uiauto-explorer/emit-files.mjs +506 -0
  123. package/lh-plugins/uiauto-explorer/emit-python.mjs +160 -0
  124. package/lh-plugins/uiauto-explorer/emit-ts.mjs +118 -0
  125. package/lh-plugins/uiauto-explorer/emit.mjs +15 -0
  126. package/lh-plugins/uiauto-explorer/ir.mjs +114 -0
  127. package/lh-plugins/uiauto-explorer/locators.mjs +267 -0
  128. package/lh-plugins/uiauto-explorer/merge.mjs +235 -0
  129. package/lh-plugins/uiauto-explorer/plan.mjs +165 -0
  130. package/lh-plugins/uiauto-explorer/runner.mjs +370 -0
  131. package/lh-plugins/uiauto-explorer/sessions.mjs +1373 -0
  132. package/lh-plugins/uiauto-explorer/snapshot.mjs +492 -0
  133. package/lh-plugins/uiauto-prompt.mjs +122 -0
  134. package/lh-plugins/uiauto-report.mjs +111 -0
  135. package/package.json +1 -1
  136. package/dist/_astro/Base.DjIEQkT7.css +0 -1
  137. package/dist/_astro/Base.astro_astro_type_script_index_0_lang.D0snmAJ_.js +0 -1
  138. package/dist/_astro/CaseExecBoard.BAV4EE3o.js +0 -1
  139. package/dist/_astro/CaseGenerateApp.Bz4ryNJG.js +0 -9
  140. package/dist/_astro/CasesLibrary.BPifyHUA.js +0 -1
  141. package/dist/_astro/ChatApp.DLo31SYZ.js +0 -276
  142. package/dist/_astro/ColumnResize.Bs6GL3DJ.js +0 -1
  143. package/dist/_astro/DatePicker.CMfX7F6z.js +0 -1
  144. package/dist/_astro/DocsFileBrowser.D3cKurQE.js +0 -1
  145. package/dist/_astro/DocsPager.rzu4mnzw.js +0 -1
  146. package/dist/_astro/KnowledgeLibrary.B0sO4QR1.js +0 -1
  147. package/dist/_astro/NamePromptDialog.Dl5kSnQI.js +0 -1
  148. package/dist/_astro/NavLibraries.Cvg3wery.js +0 -1
  149. package/dist/_astro/OverflowHint.lzmplP5j.js +0 -1
  150. package/dist/_astro/PluginsPage.DIltPILi.js +0 -39
  151. package/dist/_astro/PluginsPage.uvmSuXzi.js +0 -1
  152. package/dist/_astro/PmBugsBoard.CiaIhCHv.js +0 -1
  153. package/dist/_astro/PmIterationsBoard.H67QwKFw.js +0 -1
  154. package/dist/_astro/PmProjectDetail.DqDoIg8a.js +0 -1
  155. package/dist/_astro/PmProjectsBoard.nOC1Hugt.js +0 -1
  156. package/dist/_astro/PmRequirementsBoard.BPjZ7khP.js +0 -1
  157. package/dist/_astro/PmRequirementsBoard.CanxvcKg.js +0 -1
  158. package/dist/_astro/PmShared.CZnXaUq-.js +0 -1
  159. package/dist/_astro/PromptsLibrary.DU9EuSim.js +0 -1
  160. package/dist/_astro/ReportsPage.Cr88iz8c.js +0 -1
  161. package/dist/_astro/RequirementsLibrary.BwriF8F0.js +0 -1
  162. package/dist/_astro/SearchableSelect.Ctg8V1Z1.js +0 -1
  163. package/dist/_astro/SelectDropdown.Buv7rQJ_.js +0 -1
  164. package/dist/_astro/SettingsDialog.DEgsVfaL.js +0 -1
  165. package/dist/_astro/SlideOverDrawer.TPbGEoWn.js +0 -1
  166. package/dist/_astro/TagSelect.u8DTop7v.js +0 -1
  167. package/dist/_astro/TasksBoard.BZi_GBPG.js +0 -1
  168. package/dist/_astro/TemplatesLibrary.T4K9jUex.js +0 -1
  169. package/dist/_astro/TestStatsBoard.Dd1Kcmx6.js +0 -1
  170. package/dist/_astro/TodosBoard.C4yd_JFb.js +0 -1
  171. package/dist/_astro/active-element-history.CeefGkFQ.js +0 -1
  172. package/dist/_astro/app-config.DKMxjv3g.js +0 -1
  173. package/dist/_astro/dialog.DXHznyjD.js +0 -1
  174. package/dist/_astro/i18n.BXeGGutk.js +0 -7
  175. package/dist/_astro/jsx-runtime.BUXbF_vF.js +0 -1
  176. package/dist/_astro/listbox.Di-t5U37.js +0 -1
  177. package/dist/_astro/menu.Bkluqxic.js +0 -1
  178. package/dist/_astro/prompts-meta.F4wwkjUA.js +0 -2
  179. package/dist/_astro/report-prompt.Cmw4XzfY.js +0 -1
  180. package/dist/_astro/update.DXCPfU4a.js +0 -1
  181. package/dist/_astro/use-text-value.BuY0Cm1z.js +0 -1
  182. package/dist/_astro/use-tree-walker.CfTHFX43.js +0 -1
  183. package/dist/_astro/useListAnim.CpGB1cft.js +0 -1
@@ -0,0 +1 @@
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{C as n,D as r,E as i,S as a,T as o,_ as s,a as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C,w,x as T,y as E}from"./use-text-value.DBQvHeNl.js";import{t as D}from"./react-dom.DLW9pGCF.js";import{$ as O,A as k,B as A,C as ee,E as j,F as M,I as N,J as P,L as F,M as I,N as L,P as te,Q as R,S as ne,T as re,V as z,Z as B,_t as ie,c as V,d as ae,dt as H,et as U,f as oe,ft as se,h as ce,ht as le,it as W,k as ue,lt as de,m as fe,mt as pe,n as me,nt as G,o as he,ot as ge,p as _e,pt as ve,rt as ye,s as be,st as K,u as xe,ut as q,x as Se}from"./portal.C0hAhXDF.js";var J=e(t(),1),Y=e(D(),1);function Ce(e,t,n){let[r,i]=(0,J.useState)(n),a=e!==void 0,o=(0,J.useRef)(a),s=(0,J.useRef)(!1),c=(0,J.useRef)(!1);return a&&!o.current&&!s.current?(s.current=!0,o.current=a,console.error(`A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.`)):!a&&o.current&&!c.current&&(c.current=!0,o.current=a,console.error(`A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.`)),[a?e:r,H(e=>(a||(0,Y.flushSync)(()=>i(e)),t?.(e)))]}function we(e){let[t]=(0,J.useState)(e);return t}function Te(e={},t=null,n=[]){for(let[r,i]of Object.entries(e))De(n,Ee(t,r),i);return n}function Ee(e,t){return e?e+`[`+t+`]`:t}function De(e,t,n){if(Array.isArray(n))for(let[r,i]of n.entries())De(e,Ee(t,r.toString()),i);else n instanceof Date?e.push([t,n.toISOString()]):typeof n==`boolean`?e.push([t,n?`1`:`0`]):typeof n==`string`?e.push([t,n]):typeof n==`number`?e.push([t,`${n}`]):n==null?e.push([t,``]):ke(n)&&!(0,J.isValidElement)(n)&&Te(n,t,e)}function Oe(e){var t;let n=e?.form??e.closest(`form`);if(n){for(let t of n.elements)if(t!==e&&(t.tagName===`INPUT`&&t.type===`submit`||t.tagName===`BUTTON`&&t.type===`submit`||t.nodeName===`INPUT`&&t.type===`image`)){t.click();return}(t=n.requestSubmit)==null||t.call(n)}}function ke(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}var Ae=(0,J.createContext)(null);function je({children:e}){let t=(0,J.useContext)(Ae);if(!t)return J.createElement(J.Fragment,null,e);let{target:n}=t;return n?(0,Y.createPortal)(J.createElement(J.Fragment,null,e),n):null}function Me({data:e,form:t,disabled:n,onReset:r,overrides:i}){let[a,o]=(0,J.useState)(null),s=pe();return(0,J.useEffect)(()=>{if(r&&a)return s.addEventListener(a,`reset`,r)},[a,t,r]),J.createElement(je,null,J.createElement(Ne,{setForm:o,formId:t}),Te(e).map(([e,r])=>J.createElement(B,{features:R.Hidden,...ge({key:e,as:`input`,type:`hidden`,hidden:!0,readOnly:!0,form:t,disabled:n,name:e,value:r,...i})})))}function Ne({setForm:e,formId:t}){return(0,J.useEffect)(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:J.createElement(B,{features:R.Hidden,as:`input`,type:`hidden`,hidden:!0,readOnly:!0,ref:t=>{if(!t)return;let n=t.closest(`form`);n&&e(n)}})}function Pe(e,t){return e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`&&`id`in e&&`id`in t?e.id===t.id:e===t}function Fe(e=Pe){return(0,J.useCallback)((t,n)=>{if(typeof e==`string`){let r=e;return t?.[r]===n?.[r]}return e(t,n)},[e])}function Ie({children:e,freeze:t},n){let r=Re(t,e);return(0,J.isValidElement)(r)?(0,J.cloneElement)(r,{ref:n}):J.createElement(J.Fragment,null,r)}var Le=J.forwardRef(Ie);function Re(e,t){let[n,r]=(0,J.useState)(t);return!e&&n!==t&&r(t),e?n:t}var ze=Object.defineProperty,Be=(e,t,n)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ve=(e,t,n)=>(Be(e,typeof t==`symbol`?t:t+``,n),n),X=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(X||{}),Z=(e=>(e[e.Single=0]=`Single`,e[e.Multi=1]=`Multi`,e))(Z||{}),He=(e=>(e[e.Pointer=0]=`Pointer`,e[e.Other=1]=`Other`,e))(He||{}),Ue=(e=>(e[e.OpenListbox=0]=`OpenListbox`,e[e.CloseListbox=1]=`CloseListbox`,e[e.GoToOption=2]=`GoToOption`,e[e.Search=3]=`Search`,e[e.ClearSearch=4]=`ClearSearch`,e[e.SelectOption=5]=`SelectOption`,e[e.RegisterOptions=6]=`RegisterOptions`,e[e.UnregisterOptions=7]=`UnregisterOptions`,e[e.SetButtonElement=8]=`SetButtonElement`,e[e.SetOptionsElement=9]=`SetOptionsElement`,e[e.SortOptions=10]=`SortOptions`,e[e.MarkButtonAsMoved=11]=`MarkButtonAsMoved`,e))(Ue||{});function We(e,t=e=>e){let n=e.activeOptionIndex===null?null:e.options[e.activeOptionIndex],r=Se(t(e.options.slice()),e=>e.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{options:r,activeOptionIndex:i}}var Ge={1(e){if(e.dataRef.current.disabled||e.listboxState===1)return e;let t=e.buttonElement?b.Tracked(_(e.buttonElement)):e.buttonPositionState;return{...e,activeOptionIndex:null,pendingFocus:{focus:c.Nothing},listboxState:1,__demoMode:!1,buttonPositionState:t}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,i=e.options.findIndex(e=>r(e.dataRef.current.value));return i!==-1&&(n=i),{...e,frozenValue:!1,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1,buttonPositionState:b.Idle}},2(e,t){if(e.dataRef.current.disabled||e.listboxState===1)return e;let n={...e,searchQuery:``,activationTrigger:t.trigger??1,__demoMode:!1};if(t.focus===c.Nothing)return{...n,activeOptionIndex:null};if(t.focus===c.Specific)return{...n,activeOptionIndex:e.options.findIndex(e=>e.id===t.id)};if(t.focus===c.Previous){let r=e.activeOptionIndex;if(r!==null){let i=e.options[r].dataRef.current.domRef,a=v(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(a!==null){let t=e.options[a].dataRef.current.domRef;if(i.current?.previousElementSibling===t.current||t.current?.previousElementSibling===null)return{...n,activeOptionIndex:a}}}}else if(t.focus===c.Next){let r=e.activeOptionIndex;if(r!==null){let i=e.options[r].dataRef.current.domRef,a=v(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(a!==null){let t=e.options[a].dataRef.current.domRef;if(i.current?.nextElementSibling===t.current||t.current?.nextElementSibling===null)return{...n,activeOptionIndex:a}}}}let r=We(e),i=v(t,{resolveItems:()=>r.options,resolveActiveIndex:()=>r.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...n,...r,activeOptionIndex:i}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=+(e.searchQuery===``),r=e.searchQuery+t.value.toLowerCase(),i=(e.activeOptionIndex===null?e.options:e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n))).find(e=>!e.dataRef.current.disabled&&e.dataRef.current.textValue?.startsWith(r)),a=i?e.options.indexOf(i):-1;return a===-1||a===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:a,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===``?e:{...e,searchQuery:``}},5(e){return e.dataRef.current.mode===0?{...e,frozenValue:!0}:{...e}},6:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==c.Nothing&&(r=v(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:t}=e.dataRef.current;if(t){let e=n.findIndex(e=>t?.(e.dataRef.current.value));e!==-1&&(r=e)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:c.Nothing},pendingShouldSort:!0}},7:(e,t)=>{let n=e.options,r=[],i=new Set(t.options);for(let[e,t]of n.entries())if(i.has(t.id)&&(r.push(e),i.delete(t.id),i.size===0))break;if(r.length>0){n=n.slice();for(let e of r.reverse())n.splice(e,1)}return{...e,options:n,activationTrigger:1}},8:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},9:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element},10:e=>e.pendingShouldSort?{...e,...We(e),pendingShouldSort:!1}:e,11(e){return e.buttonPositionState.kind===`Tracked`?{...e,buttonPositionState:b.Moved}:e}},Ke=class e extends M{constructor(e){super(e),Ve(this,`actions`,{onChange:e=>{let{onChange:t,compare:n,mode:r,value:i}=this.state.dataRef.current;return K(r,{0:()=>t?.(e),1:()=>{let r=i.slice(),a=r.findIndex(t=>n(t,e));return a===-1?r.push(e):r.splice(a,1),t?.(r)}})},registerOption:N(()=>{let e=[],t=new Set;return[(n,r)=>{t.has(r)||(t.add(r),e.push({id:n,dataRef:r}))},()=>(t.clear(),this.send({type:6,options:e.splice(0)}))]}),unregisterOption:N(()=>{let e=[];return[t=>e.push(t),()=>{this.send({type:7,options:e.splice(0)})}]}),goToOption:N(()=>{let e=null;return[(t,n)=>{e={type:2,...t,trigger:n}},()=>e&&this.send(e)]}),closeListbox:()=>{this.send({type:1})},openListbox:e=>{this.send({type:0,focus:e})},selectActiveOption:()=>{var e;if(this.state.activeOptionIndex!==null){let{dataRef:e}=this.state.options[this.state.activeOptionIndex];this.actions.selectOption(e.current.value)}else this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(e=this.state.buttonElement)==null||e.focus({preventScroll:!0}))},selectOption:e=>{this.send({type:5,value:e})},search:e=>{this.send({type:3,value:e})},clearSearch:()=>{this.send({type:4})},setButtonElement:e=>{this.send({type:8,element:e})},setOptionsElement:e=>{this.send({type:9,element:e})}}),Ve(this,`selectors`,{activeDescendantId(e){var t;let n=e.activeOptionIndex,r=e.options;return n===null||(t=r[n])==null?void 0:t.id},isActive(e,t){let n=e.activeOptionIndex,r=e.options;return n!==null&&r[n]?.id===t},hasFrozenValue(e){return e.frozenValue},shouldScrollIntoView(e,t){return e.__demoMode||e.listboxState!==0||e.activationTrigger===0?!1:this.isActive(e,t)},didButtonMove(e){return e.buttonPositionState.kind===`Moved`}}),this.on(6,()=>{requestAnimationFrame(()=>{this.send({type:10})})});{let e=this.state.id,t=te.get(null);this.disposables.add(t.on(L.Push,n=>{!t.selectors.isTop(n,e)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}this.disposables.group(e=>{this.on(1,t=>{t.buttonElement&&(e.dispose(),e.add(m(t.buttonElement,t.buttonPositionState,()=>{this.send({type:11})})))})}),this.on(5,(e,t)=>{var n;this.actions.onChange(t.value),this.state.dataRef.current.mode===0&&(this.actions.closeListbox(),(n=this.state.buttonElement)==null||n.focus({preventScroll:!0}))})}static new({id:t,__demoMode:n=!1}){return new e({id:t,dataRef:{current:{}},listboxState:+!n,options:[],searchQuery:``,activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:c.Nothing},frozenValue:!1,__demoMode:n,buttonPositionState:b.Idle})}reduce(e,t){return K(t.type,Ge,e,t)}},qe=(0,J.createContext)(null);function Je(e){let t=(0,J.useContext)(qe);if(t===null){let t=Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Ye),t}return t}function Ye({id:e,__demoMode:t=!1}){let n=(0,J.useMemo)(()=>Ke.new({id:e,__demoMode:t}),[]);return he(()=>n.dispose()),n}var Q=(0,J.createContext)(null);Q.displayName=`ListboxDataContext`;function $(e){let t=(0,J.useContext)(Q);if(t===null){let t=Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,$),t}return t}var Xe=J.Fragment;function Ze(e,t){let n=(0,O.useId)(),r=de(),{value:i,defaultValue:o,form:s,name:c,onChange:l,by:u,invalid:d=!1,disabled:f=r||!1,horizontal:p=!1,multiple:m=!1,__demoMode:h=!1,...g}=e,_=p?`horizontal`:`vertical`,v=z(t),y=we(o),[b=m?[]:void 0,S]=Ce(i,l,y),C=Ye({id:n,__demoMode:h}),w=(0,J.useRef)({static:!1,hold:!1}),T=(0,J.useRef)(new Map),E=Fe(u),D=(0,J.useCallback)(e=>K(k.mode,{[Z.Multi]:()=>b.some(t=>E(t,e)),[Z.Single]:()=>E(b,e)}),[b]),k=q({value:b,disabled:f,invalid:d,mode:m?Z.Multi:Z.Single,orientation:_,onChange:S,compare:E,isSelected:D,optionsPropsRef:w,listRef:T});ve(()=>{C.state.dataRef.current=k},[k]);let A=I(C,e=>e.listboxState),j=te.get(null),M=I(j,(0,J.useCallback)(e=>j.selectors.isTop(e,n),[j,n])),[N,P]=I(C,e=>[e.buttonElement,e.optionsElement]);ce(M,[N,P],(e,t)=>{C.send({type:Ue.CloseListbox}),ne(t,ee.Loose)||(e.preventDefault(),N?.focus())});let F=q({open:A===X.Open,disabled:f,invalid:d,value:b}),[L,R]=a({inherit:!0}),re={ref:v},B=(0,J.useCallback)(()=>{if(y!==void 0)return S?.(y)},[S,y]),ie=G();return J.createElement(R,{value:L,props:{htmlFor:N?.id},slot:{open:A===X.Open,disabled:f}},J.createElement(x,null,J.createElement(qe.Provider,{value:C},J.createElement(Q.Provider,{value:k},J.createElement(be,{value:K(A,{[X.Open]:V.Open,[X.Closed]:V.Closed})},c!=null&&b!=null&&J.createElement(Me,{disabled:f,data:{[c]:b},form:s,onReset:B}),ie({ourProps:re,theirProps:g,slot:F,defaultTag:Xe,name:`Listbox`}))))))}var Qe=`button`;function $e(e,t){let n=(0,O.useId)(),a=w(),d=$(`Listbox.Button`),m=Je(`Listbox.Button`),{id:h=a||`headlessui-listbox-button-${n}`,disabled:_=d.disabled||!1,autoFocus:v=!1,...y}=e,b=z(t,l(),m.actions.setButtonElement),x=u(),[S,C,E]=I(m,e=>[e.listboxState,e.buttonElement,e.optionsElement]),D=S===X.Open;p(D,{trigger:C,action:(0,J.useCallback)(e=>{if(C!=null&&C.contains(e.target))return f.Ignore;let t=e.target.closest(`[role="option"]:not([data-disabled])`);return P(t)?f.Select(t):E!=null&&E.contains(e.target)?f.Ignore:f.Close},[C,E]),close:m.actions.closeListbox,select:m.actions.selectActiveOption});let k=H(e=>{switch(e.key){case F.Enter:Oe(e.currentTarget);break;case F.Space:case F.ArrowDown:e.preventDefault(),m.actions.openListbox({focus:d.value?c.Nothing:c.First});break;case F.ArrowUp:e.preventDefault(),m.actions.openListbox({focus:d.value?c.Nothing:c.Last})}}),ee=H(e=>{switch(e.key){case F.Space:e.preventDefault()}}),j=s(e=>{var t;m.state.listboxState===X.Open?((0,Y.flushSync)(()=>m.actions.closeListbox()),(t=m.state.buttonElement)==null||t.focus({preventScroll:!0})):(e.preventDefault(),m.actions.openListbox({focus:c.Nothing}))}),M=H(e=>e.preventDefault()),N=T([h]),L=A(),{isFocusVisible:te,focusProps:R}=r({autoFocus:v}),{isHovered:ne,hoverProps:re}=i({isDisabled:_}),{pressed:B,pressProps:ie}=o({disabled:_}),V=q({open:S===X.Open,active:B||S===X.Open,disabled:_,invalid:d.invalid,value:d.value,hover:ne,focus:te,autofocus:v}),ae=I(m,e=>e.listboxState===X.Open),U=ye(x(),{ref:b,id:h,type:g(e,C),"aria-haspopup":`listbox`,"aria-controls":E?.id,"aria-expanded":ae,"aria-labelledby":N,"aria-describedby":L,disabled:_||void 0,autoFocus:v,onKeyDown:k,onKeyUp:ee,onKeyPress:M},j,R,re,ie);return G()({ourProps:U,theirProps:y,slot:V,defaultTag:Qe,name:`Listbox.Button`})}var et=(0,J.createContext)(!1),tt=`div`,nt=U.RenderStrategy|U.Static;function rt(e,t){let n=(0,O.useId)(),{id:r=`headlessui-listbox-options-${n}`,anchor:i,portal:a=!1,modal:o=!0,transition:s=!1,...l}=e,u=d(i),[f,p]=(0,J.useState)(null);u&&(a=!0);let m=$(`Listbox.Options`),g=Je(`Listbox.Options`),[_,v,y,b]=I(g,e=>[e.listboxState,e.buttonElement,e.optionsElement,e.__demoMode]),x=fe(v),S=fe(y),w=xe(),[T,D]=ae(s,f,w===null?_===X.Open:(w&V.Open)===V.Open);ue(T,v,g.actions.closeListbox);let A=!b&&o&&_===X.Open;_e(A,S);let ee=!b&&o&&_===X.Open;k(ee,{allowed:(0,J.useCallback)(()=>[v,y],[v,y])});let M=!I(g,g.selectors.didButtonMove)&&T,N=Re(I(g,g.selectors.hasFrozenValue)&&!e.static,m.value),P=(0,J.useCallback)(e=>m.compare(N,e),[m.compare,N]),L=I(g,e=>{var t;if(u==null||!((t=u?.to)!=null&&t.includes(`selection`)))return null;let n=e.options.findIndex(e=>P(e.dataRef.current.value));return n===-1&&(n=0),n}),te=(()=>{if(u==null)return;if(L===null)return{...u,inner:void 0};let e=Array.from(m.listRef.current.values());return{...u,inner:{listRef:{current:e},index:L}}})(),[R,ne]=h(te),B=C(),U=z(t,u?R:null,g.actions.setOptionsElement,p),se=pe();(0,J.useEffect)(()=>{let e=y;e&&_===X.Open&&(ie(e)||e==null||e.focus({preventScroll:!0}))},[_,y]);let ce=H(e=>{var t;switch(se.dispose(),e.key){case F.Space:if(g.state.searchQuery!==``)return e.preventDefault(),e.stopPropagation(),g.actions.search(e.key);case F.Enter:e.preventDefault(),e.stopPropagation(),g.actions.selectActiveOption();break;case K(m.orientation,{vertical:F.ArrowDown,horizontal:F.ArrowRight}):return e.preventDefault(),e.stopPropagation(),g.actions.goToOption({focus:c.Next});case K(m.orientation,{vertical:F.ArrowUp,horizontal:F.ArrowLeft}):return e.preventDefault(),e.stopPropagation(),g.actions.goToOption({focus:c.Previous});case F.Home:case F.PageUp:return e.preventDefault(),e.stopPropagation(),g.actions.goToOption({focus:c.First});case F.End:case F.PageDown:return e.preventDefault(),e.stopPropagation(),g.actions.goToOption({focus:c.Last});case F.Escape:e.preventDefault(),e.stopPropagation(),(0,Y.flushSync)(()=>g.actions.closeListbox()),(t=g.state.buttonElement)==null||t.focus({preventScroll:!0});return;case F.Tab:e.preventDefault(),e.stopPropagation(),(0,Y.flushSync)(()=>g.actions.closeListbox()),re(g.state.buttonElement,e.shiftKey?j.Previous:j.Next);break;default:e.key.length===1&&(g.actions.search(e.key),se.setTimeout(()=>g.actions.clearSearch(),350))}}),le=I(g,e=>e.buttonElement?.id),W=q({open:_===X.Open}),de=ye(u?B():{},{id:r,ref:U,"aria-activedescendant":I(g,g.selectors.activeDescendantId),"aria-multiselectable":m.mode===Z.Multi||void 0,"aria-labelledby":le,"aria-orientation":m.orientation,onKeyDown:ce,role:`listbox`,tabIndex:_===X.Open?0:void 0,style:{...l.style,...ne,"--button-width":E(T,v,!0).width},...oe(D)}),he=G(),ge=(0,J.useMemo)(()=>m.mode===Z.Multi?m:{...m,isSelected:P},[m,P]);return J.createElement(me,{enabled:a?e.static||T:!1,ownerDocument:x},J.createElement(Q.Provider,{value:ge},he({ourProps:de,theirProps:l,slot:W,defaultTag:tt,features:nt,visible:M,name:`Listbox.Options`})))}var it=`div`;function at(e,t){let n=(0,O.useId)(),{id:r=`headlessui-listbox-option-${n}`,disabled:i=!1,value:a,...o}=e,s=(0,J.useContext)(et)===!0,l=$(`Listbox.Option`),u=Je(`Listbox.Option`),d=I(u,e=>u.selectors.isActive(e,r)),f=l.isSelected(a),p=(0,J.useRef)(null),m=S(p),h=se({disabled:i,value:a,domRef:p,get textValue(){return m()}}),g=z(t,p,e=>{e?l.listRef.current.set(r,e):l.listRef.current.delete(r)}),_=I(u,e=>u.selectors.shouldScrollIntoView(e,r));ve(()=>{if(_)return le().requestAnimationFrame(()=>{var e,t;(t=(e=p.current)?.scrollIntoView)==null||t.call(e,{block:`nearest`})})},[_,p]),ve(()=>{if(!s)return u.actions.registerOption(r,h),()=>u.actions.unregisterOption(r)},[h,r,s]);let v=H(e=>{if(i)return e.preventDefault();u.actions.selectOption(a)}),b=H(()=>{if(i)return u.actions.goToOption({focus:c.Nothing});u.actions.goToOption({focus:c.Specific,id:r})}),x=y(),C=H(e=>x.update(e)),w=H(e=>{x.wasMoved(e)&&(i||d&&u.state.activationTrigger===He.Pointer||u.actions.goToOption({focus:c.Specific,id:r},He.Pointer))}),T=H(e=>{x.wasMoved(e)&&(i||d&&u.state.activationTrigger===He.Pointer&&u.actions.goToOption({focus:c.Nothing}))}),E=q({active:d,focus:d,selected:f,disabled:i,selectedOption:f&&s}),D=s?{}:{id:r,ref:g,role:`option`,tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0||void 0,"aria-selected":f,disabled:void 0,onClick:v,onFocus:b,onPointerEnter:C,onMouseEnter:C,onPointerMove:w,onMouseMove:w,onPointerLeave:T,onMouseLeave:T},k=G();return!f&&s?null:k({ourProps:D,theirProps:o,slot:E,defaultTag:it,name:`Listbox.Option`})}var ot=J.Fragment;function st(e,t){let{options:n,placeholder:r,...i}=e,a={ref:z(t)},o=$(`ListboxSelectedOption`),s=q({}),c=o.value===void 0||o.value===null||o.mode===Z.Multi&&Array.isArray(o.value)&&o.value.length===0,l=G();return J.createElement(et.Provider,{value:!0},l({ourProps:a,theirProps:{...i,children:J.createElement(J.Fragment,null,r&&c?r:n)},slot:s,defaultTag:ot,name:`ListboxSelectedOption`}))}var ct=W(Ze),lt=W($e),ut=n,dt=W(rt),ft=W(at),pt=W(st),mt=Object.assign(ct,{Button:lt,Label:ut,Options:dt,Option:ft,SelectedOption:pt});export{Le as a,Me as c,lt as i,we as l,ft as n,Re as o,mt as r,Fe as s,dt as t,Ce as u};
@@ -0,0 +1,58 @@
1
+ function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var t=e();function n(e){t=e}var r={exec:()=>null};function i(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(a.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var a={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`)},o=/^(?:[ \t]*(?:\n|$))+/,s=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,c=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,l=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,u=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,d=/(?:[*+-]|\d{1,9}[.)])/,f=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,p=i(f).replace(/bull/g,d).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ee=i(f).replace(/bull/g,d).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),te=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ne=/^[^\n]+/,m=/(?!\s*\])(?:\\.|[^\[\]\\])+/,re=i(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,m).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ie=i(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,d).getRegex(),h=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,g=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ae=i(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,g).replace(`tag`,h).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),_=i(te).replace(`hr`,l).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,h).getRegex(),oe={blockquote:i(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,_).getRegex(),code:s,def:re,fences:c,heading:u,hr:l,html:ae,lheading:p,list:ie,newline:o,paragraph:_,table:r,text:ne},se=i(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,l).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,h).getRegex(),ce={...oe,lheading:ee,table:se,paragraph:i(te).replace(`hr`,l).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,se).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,h).getRegex()},v={...oe,html:i(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,g).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:r,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:i(te).replace(`hr`,l).replace(`heading`,` *#{1,6} *[^
2
+ ]`).replace(`lheading`,p).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},y=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,le=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ue=/^( {2,}|\\)\n(?!\s*$)/,de=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,fe=/[\p{P}\p{S}]/u,b=/[\s\p{P}\p{S}]/u,pe=/[^\s\p{P}\p{S}]/u,me=i(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,b).getRegex(),he=/(?!~)[\p{P}\p{S}]/u,ge=/(?!~)[\s\p{P}\p{S}]/u,_e=/(?:[^\s\p{P}\p{S}]|~)/u,ve=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ye=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,be=i(ye,`u`).replace(/punct/g,fe).getRegex(),x=i(ye,`u`).replace(/punct/g,he).getRegex(),xe=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Se=i(xe,`gu`).replace(/notPunctSpace/g,pe).replace(/punctSpace/g,b).replace(/punct/g,fe).getRegex(),Ce=i(xe,`gu`).replace(/notPunctSpace/g,_e).replace(/punctSpace/g,ge).replace(/punct/g,he).getRegex(),we=i(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,pe).replace(/punctSpace/g,b).replace(/punct/g,fe).getRegex(),Te=i(/\\(punct)/,`gu`).replace(/punct/g,fe).getRegex(),Ee=i(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),De=i(g).replace(`(?:-->|$)`,`-->`).getRegex(),Oe=i(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,De).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ke=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,S=i(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace(`label`,ke).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ae=i(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ke).replace(`ref`,m).getRegex(),C=i(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,m).getRegex(),je={_backpedal:r,anyPunctuation:Te,autolink:Ee,blockSkip:ve,br:ue,code:le,del:r,emStrongLDelim:be,emStrongRDelimAst:Se,emStrongRDelimUnd:we,escape:y,link:S,nolink:C,punctuation:me,reflink:Ae,reflinkSearch:i(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ae).replace(`nolink`,C).getRegex(),tag:Oe,text:de,url:r},w={...je,link:i(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ke).getRegex(),reflink:i(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ke).getRegex()},T={...je,emStrongRDelimAst:Ce,emStrongLDelim:x,url:i(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Me={...T,br:i(ue).replace(`{2,}`,`*`).getRegex(),text:i(T.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},E={normal:oe,gfm:ce,pedantic:v},Ne={normal:je,gfm:T,breaks:Me,pedantic:w},Pe={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},Fe=e=>Pe[e];function D(e,t){if(t){if(a.escapeTest.test(e))return e.replace(a.escapeReplace,Fe)}else if(a.escapeTestNoEncode.test(e))return e.replace(a.escapeReplaceNoEncode,Fe);return e}function O(e){try{e=encodeURI(e).replace(a.percentDecode,`%`)}catch{return null}return e}function k(e,t){let n=e.replace(a.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(a.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(a.slashPipe,`|`);return n}function A(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Ie(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Le(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Re(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
3
+ `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
4
+ `)}var ze=class{options;rules;lexer;constructor(e){this.options=e||t}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:A(e,`
5
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Re(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=A(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:A(t[0],`
6
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=A(t[0],`
7
+ `).split(`
8
+ `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
9
+ `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
10
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
11
+ ${s}`:s,r=r?`${r}
12
+ ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
13
+ `+e.join(`
14
+ `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
15
+ `+e.join(`
16
+ `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
17
+ `)}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
18
+ `,1)[0].replace(this.rules.other.listReplaceTabs,e=>` `.repeat(3*e.length)),l=e.split(`
19
+ `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
20
+ `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d);for(;e;){let f=e.split(`
21
+ `,1)[0],p;if(l=f,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),p=l):p=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||t.test(l)||n.test(l))break;if(p.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
22
+ `+p.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
23
+ `+l}!u&&!l.trim()&&(u=!0),r+=f+`
24
+ `,e=e.substring(f.length+1),c=p.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=this.rules.other.listIsTask.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(this.rules.other.listReplaceTask,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=k(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
25
+ `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(k(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
26
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=A(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Ie(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Le(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Le(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},j=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new ze,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:a,block:E.normal,inline:Ne.normal};this.options.pedantic?(n.block=E.pedantic,n.inline=Ne.pedantic):this.options.gfm&&(n.block=E.gfm,n.inline=this.options.breaks?Ne.breaks:Ne.gfm),this.tokenizer.rules=n}static get rules(){return{block:E,inline:Ne}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(a.carriageReturn,`
27
+ `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(a.tabCharGlobal,` `).replace(a.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
28
+ `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
29
+ `+r.raw,n.text+=`
30
+ `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if((r=this.tokenizer.fences(e))||(r=this.tokenizer.heading(e))||(r=this.tokenizer.hr(e))||(r=this.tokenizer.blockquote(e))||(r=this.tokenizer.list(e))||(r=this.tokenizer.html(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=`
31
+ `+r.raw,n.text+=`
32
+ `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if((r=this.tokenizer.table(e))||(r=this.tokenizer.lheading(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=`
33
+ `+r.raw,a.text+=`
34
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=`
35
+ `+r.raw,n.text+=`
36
+ `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a=``;for(;e;){i||(a=``),i=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if((r=this.tokenizer.escape(e))||(r=this.tokenizer.tag(e))||(r=this.tokenizer.link(e))){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if((r=this.tokenizer.emStrong(e,n,a))||(r=this.tokenizer.codespan(e))||(r=this.tokenizer.br(e))||(r=this.tokenizer.del(e))||(r=this.tokenizer.autolink(e))||!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(o)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(a=r.raw.slice(-1)),i=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r)}else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},M=class{options;parser;constructor(e){this.options=e||t}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(a.notSpaceStart)?.[0],i=e.replace(a.endingNewline,``)+`
37
+ `;return r?`<pre><code class="language-`+D(r)+`">`+(n?i:D(i,!0))+`</code></pre>
38
+ `:`<pre><code>`+(n?i:D(i,!0))+`</code></pre>
39
+ `}blockquote({tokens:e}){return`<blockquote>
40
+ ${this.parser.parse(e)}</blockquote>
41
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
42
+ `}hr(e){return`<hr>
43
+ `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
44
+ `+r+`</`+i+`>
45
+ `}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+D(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `,escaped:!0}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
46
+ `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
47
+ `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
48
+ <thead>
49
+ `+t+`</thead>
50
+ `+r+`</table>
51
+ `}tablerow({text:e}){return`<tr>
52
+ ${e}</tr>
53
+ `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
54
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${D(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=O(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+D(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=O(e);if(i===null)return D(n);e=i;let a=`<img src="${e}" alt="${n}"`;return t&&(a+=` title="${D(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:D(e.text)}},Be=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},N=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new M,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Be}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
55
+ `+this.renderer.text(i);n+=t?this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o,escaped:!0}]}):o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Ve=class{options;block;constructor(e){this.options=e||t}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?j.lex:j.lexInline}provideParser(){return this.block?N.parse:N.parseInline}},He=class{defaults=e();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=N;Renderer=M;TextRenderer=Be;Lexer=j;Tokenizer=ze;Hooks=Ve;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new M(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ze(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Ve;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Ve.passThroughHooks.has(n)?e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return j.lex(e,t??this.defaults)}parser(e,t){return N.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(t==null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let o=i.hooks?i.hooks.provideLexer():e?j.lex:j.lexInline,s=i.hooks?i.hooks.provideParser():e?N.parse:N.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(e=>o(e,i)).then(e=>i.hooks?i.hooks.processAllTokens(e):e).then(e=>i.walkTokens?Promise.all(this.walkTokens(e,i.walkTokens)).then(()=>e):e).then(e=>s(e,i)).then(e=>i.hooks?i.hooks.postprocess(e):e).catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let e=o(t,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let n=s(e,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
56
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+D(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},P=new He;function F(e,t){return P.parse(e,t)}F.options=F.setOptions=function(e){return P.setOptions(e),F.defaults=P.defaults,n(F.defaults),F},F.getDefaults=e,F.defaults=t,F.use=function(...e){return P.use(...e),F.defaults=P.defaults,n(F.defaults),F},F.walkTokens=function(e,t){return P.walkTokens(e,t)},F.parseInline=P.parseInline,F.Parser=N,F.parser=N.parse,F.Renderer=M,F.TextRenderer=Be,F.Lexer=j,F.lexer=j.lex,F.Tokenizer=ze,F.Hooks=Ve,F.parse=F,F.options,F.setOptions,F.use,F.walkTokens,F.parseInline,N.parse,j.lex;function I(e,t){this.v=e,this.k=t}function L(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function R(e){if(Array.isArray(e))return e}function Ue(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function We(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
57
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ge(e,t){return R(e)||Ue(e,t)||Ke(e,t)||We()}function Ke(e,t){if(e){if(typeof e==`string`)return L(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?L(e,t):void 0}}function qe(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof I;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}qe.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},qe.prototype.next=function(e){return this._invoke(`next`,e)},qe.prototype.throw=function(e){return this._invoke(`throw`,e)},qe.prototype.return=function(e){return this._invoke(`return`,e)};var Je=Object.entries,Ye=Object.setPrototypeOf,Xe=Object.isFrozen,z=Object.getPrototypeOf,B=Object.getOwnPropertyDescriptor,V=Object.freeze,H=Object.seal,Ze=Object.create,Qe=typeof Reflect<`u`&&Reflect,$e=Qe.apply,et=Qe.construct;V||=function(e){return e},H||=function(e){return e},$e||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},et||=function(e){return new e(...[...arguments].slice(1))};var U=q(Array.prototype.forEach);Array.prototype.indexOf;var tt=q(Array.prototype.lastIndexOf),nt=q(Array.prototype.pop),rt=q(Array.prototype.push),it=q(Array.prototype.slice),at=q(Array.prototype.splice),ot=Array.isArray,st=xt(Set),ct=q(Set.prototype.add),lt=q(Set.prototype.has),ut=q(String.prototype.toLowerCase),dt=q(String.prototype.toString),ft=q(String.prototype.match),pt=q(String.prototype.replace),mt=q(String.prototype.indexOf),ht=q(String.prototype.trim),gt=q(Number.prototype.toString),_t=q(Boolean.prototype.toString),vt=typeof BigInt>`u`?null:q(BigInt.prototype.toString),yt=typeof Symbol>`u`?null:q(Symbol.prototype.toString),W=q(Object.prototype.hasOwnProperty),bt=q(Object.prototype.toString),G=q(RegExp.prototype.test),K=xt(TypeError);function q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return $e(e,t,n)}}function xt(e){return function(){return et(e,[...arguments])}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ut;if(Ye&&Ye(e,null),!ot(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Xe(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Y(e){for(let t=0;t<e.length;t++)W(e,t)||(e[t]=null);return e}function X(e){let t=Ze(null);for(let r of Je(e)){var n=Ge(r,2);let i=n[0],a=n[1];W(e,i)&&(t[i]=ot(a)?Y(a):a&&typeof a==`object`&&a.constructor===Object?X(a):a)}return t}function St(e){switch(typeof e){case`string`:return e;case`number`:return gt(e);case`boolean`:return _t(e);case`bigint`:return vt?vt(e):`0`;case`symbol`:return yt?yt(e):`Symbol()`;case`undefined`:return bt(e);case`function`:case`object`:{if(e===null)return bt(e);let t=e,n=Z(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:bt(e)}return bt(e)}default:return bt(e)}}function Z(e,t){for(;e!==null;){let n=B(e,t);if(n){if(n.get)return q(n.get);if(typeof n.value==`function`)return q(n.value)}e=z(e)}function n(){return null}return n}function Ct(e,t){for(;e!==null;){let n=B(e,t);if(n)return n.get?q(n.get):null;e=z(e)}return null}function wt(e){try{return G(e,``),!0}catch{return!1}}var Tt=V(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Et=V(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Dt=V([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Ot=V([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),kt=V(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),At=V([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),jt=V([`#text`]),Mt=V(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Nt=V(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Pt=V(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Ft=V([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),It=H(/{{[\w\W]*|^[\w\W]*}}/g),Lt=H(/<%[\w\W]*|^[\w\W]*%>/g),Rt=H(/\${[\w\W]*/g),zt=H(/^data-[\-\w.\u00B7-\uFFFF]+$/),Bt=H(/^aria-[\-\w]+$/),Vt=H(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ht=H(/^(?:\w+script|data):/i),Ut=H(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wt=H(/^html$/i),Gt=H(/^[a-z][.\w]*(-[.\w]+)+$/i),Kt=H(/<[/\w!]/g),qt=H(/<[/\w]/g),Jt=H(/<\/no(script|embed|frames)/i),Yt=H(/\/>/i),Q={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Xt=V(J({},[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`])),Zt=function(){return typeof window>`u`?null:window},Qt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},$t=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},en=function(e,t,n,r){return W(e,t)&&ot(e[t])?J(r.base?X(r.base):{},e[t],r.transform):n},tn=function(e,t,n){let r=W(e,t)?e[t]:void 0;return r&&typeof r==`object`?X(r):n()};function nn(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zt(),t=e=>nn(e);if(t.version=`3.4.17`,t.removed=[],!e||!e.document||e.document.nodeType!==Q.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Z(d,`cloneNode`),p=Z(d,`remove`),ee=Z(d,`removeAttributeNode`),te=Z(d,`nextSibling`),ne=Z(d,`childNodes`),m=Z(d,`parentNode`),re=Z(d,`shadowRoot`),ie=Z(d,`attributes`),h=o&&o.prototype?Z(o.prototype,`nodeType`):null,g=o&&o.prototype?Z(o.prototype,`nodeName`):null,ae=o&&o.prototype?Z(o.prototype,`ownerDocument`):null,_=function(e){return h?h(e):e.nodeType},oe=function(e){return g?g(e):e.nodeName},se=Ct(d,`namespaceURI`),ce=function(e){return se?se(e):e.namespaceURI};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,y=``,le,ue=!1,de=0,fe=function(){if(de>0)throw K(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},b=function(e){fe(),de++;try{return v.createHTML(e)}finally{de--}},pe=function(e){fe(),de++;try{return v.createScriptURL(e)}finally{de--}},me=function(){return ue||=(le=Qt(u,i),!0),le},he=n,ge=he.implementation,_e=he.createNodeIterator,ve=he.createDocumentFragment,ye=he.getElementsByTagName,be=r.importNode,x=$t();t.isSupported=typeof Je==`function`&&typeof m==`function`&&ge&&ge.createHTMLDocument!==void 0;let xe=It,Se=Lt,Ce=Rt,we=zt,Te=Bt,Ee=Ht,De=Ut,Oe=Gt,ke=Vt,S=null,Ae=J({},[...Tt,...Et,...Dt,...kt,...jt]),C=null,je=J({},[...Mt,...Nt,...Pt,...Ft]),w=Object.seal(Ze(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),T=null,Me=null,E=Object.seal(Ze(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Ne=!0,Pe=!0,Fe=!1,D=!0,O=!1,k=!0,A=!1,Ie=!1,Le=null,Re=null,ze=!1,j=!1,M=!1,Be=!1,N=!0,Ve=!1,He=`user-content-`,P=!0,F=!1,I=null,L={},R=null,Ue=J({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),We=null,Ge=J({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ke=null,qe=J({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,Xe=`http://www.w3.org/2000/svg`,z=`http://www.w3.org/1999/xhtml`,B=z,Qe=!1,$e=null,et=J({},[Ye,Xe,z],dt),gt=V([`mi`,`mo`,`mn`,`ms`,`mtext`]),_t=J({},gt),vt=V([`annotation-xml`]),yt=J({},vt),bt=J({},[`title`,`style`,`font`,`a`,`script`]),q=null,xt=[`application/xhtml+xml`,`text/html`],Y=null,rn=null,an=n.createElement(`form`),on=function(e){return e instanceof RegExp||e instanceof Function},sn=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(rn&&rn===e)return;(!e||typeof e!=`object`)&&(e={}),e=X(e),q=xt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Y=q===`application/xhtml+xml`?dt:ut,S=en(e,`ALLOWED_TAGS`,Ae,{transform:Y}),C=en(e,`ALLOWED_ATTR`,je,{transform:Y}),$e=en(e,`ALLOWED_NAMESPACES`,et,{transform:dt}),Ke=en(e,`ADD_URI_SAFE_ATTR`,qe,{transform:Y,base:qe}),We=en(e,`ADD_DATA_URI_TAGS`,Ge,{transform:Y,base:Ge}),R=en(e,`FORBID_CONTENTS`,Ue,{transform:Y}),T=en(e,`FORBID_TAGS`,X({}),{transform:Y}),Me=en(e,`FORBID_ATTR`,X({}),{transform:Y}),L=W(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?X(e.USE_PROFILES):e.USE_PROFILES:!1,Ne=e.ALLOW_ARIA_ATTR!==!1,Pe=e.ALLOW_DATA_ATTR!==!1,Fe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,D=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,O=e.SAFE_FOR_TEMPLATES||!1,k=e.SAFE_FOR_XML!==!1,A=e.WHOLE_DOCUMENT||!1,j=e.RETURN_DOM||!1,M=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,ze=e.FORCE_BODY||!1,N=e.SANITIZE_DOM!==!1,Ve=e.SANITIZE_NAMED_PROPS||!1,P=e.KEEP_CONTENT!==!1,F=e.IN_PLACE||!1,ke=wt(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Vt,B=typeof e.NAMESPACE==`string`?e.NAMESPACE:z,_t=tn(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>J({},gt)),yt=tn(e,`HTML_INTEGRATION_POINTS`,()=>J({},vt));let t=tn(e,`CUSTOM_ELEMENT_HANDLING`,()=>Ze(null));if(w=Ze(null),W(t,`tagNameCheck`)&&on(t.tagNameCheck)&&(w.tagNameCheck=t.tagNameCheck),W(t,`attributeNameCheck`)&&on(t.attributeNameCheck)&&(w.attributeNameCheck=t.attributeNameCheck),W(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(w.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),H(w),O&&(Pe=!1),M&&(j=!0),L&&(S=J({},jt),C=Ze(null),L.html===!0&&(J(S,Tt),J(C,Mt)),L.svg===!0&&(J(S,Et),J(C,Nt),J(C,Ft)),L.svgFilters===!0&&(J(S,Dt),J(C,Nt),J(C,Ft)),L.mathMl===!0&&(J(S,kt),J(C,Pt),J(C,Ft))),E.tagCheck=null,E.attributeCheck=null,W(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?E.tagCheck=e.ADD_TAGS:ot(e.ADD_TAGS)&&(S===Ae&&(S=X(S)),J(S,e.ADD_TAGS,Y))),W(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?E.attributeCheck=e.ADD_ATTR:ot(e.ADD_ATTR)&&(C===je&&(C=X(C)),J(C,e.ADD_ATTR,Y))),W(e,`ADD_FORBID_CONTENTS`)&&ot(e.ADD_FORBID_CONTENTS)&&(R===Ue&&(R=X(R)),J(R,e.ADD_FORBID_CONTENTS,Y)),P&&(S[`#text`]=!0),A&&J(S,[`html`,`head`,`body`]),S.table&&(J(S,[`tbody`]),delete T.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw K(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw K(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=v;v=e.TRUSTED_TYPES_POLICY;try{y=b(``)}catch(e){throw v=t,e}}else e.TRUSTED_TYPES_POLICY===null?(v=void 0,y=``):(v===void 0&&(v=me()),v&&typeof y==`string`&&(y=b(``)));V&&V(e),rn=e},cn=J({},[...Et,...Dt,...Ot]),ln=J({},[...kt,...At]),un=function(e,t,n){return t.namespaceURI===z?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||_t[n]):!!cn[e]},dn=function(e,t,n){return t.namespaceURI===z?e===`math`:t.namespaceURI===Xe?e===`math`&&yt[n]:!!ln[e]},fn=function(e,t,n){return t.namespaceURI===Xe&&!yt[n]||t.namespaceURI===Ye&&!_t[n]?!1:!ln[e]&&(bt[e]||!cn[e])},pn=function(e){let t=ce(e),n=ut(oe(e)),r=m(e),i,a;return r&&_(r)===Q.element?(i={namespaceURI:ce(r)},a=ut(oe(r))):(i={namespaceURI:B},a=`template`),$e[t]?t===Xe?un(n,i,a):t===Ye?dn(n,i,a):t===z?fn(n,i,a):!!(q===`application/xhtml+xml`&&$e[t]):!1},mn=function(e){rt(t.removed,{element:e});try{m(e).removeChild(e)}catch{if(p(e),!m(e))throw K(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},hn=function(e,t,n){try{ee(e,t)}catch{try{e.removeAttribute(n)}catch{}}},gn=function(e){bn(e);let t=ne(e);t&&U(it(t),e=>{try{p(e)}catch{}});let n=_(e)===Q.element?ie(e):null;if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&hn(e,r,i)}},_n=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}rt(t.removed,{attribute:r||null,from:n});try{r?ee(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(j||M)try{mn(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},vn=function(e){let t=ie(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||C[Y(i)]||hn(e,r,i)}},yn=function(e,t){let n=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=[e];for(;r.length>0;){let e=r.pop();if(t(e)===!1)continue;if(n&&_(e)===Q.element){let t=re(e);Fn(t)&&r.push(t)}let i=ne(e);if(i)for(let e=i.length-1;e>=0;--e)r.push(i[e])}},bn=function(e){yn(e,e=>{_(e)===Q.element&&vn(e)})},xn=function(e){let t=[];return yn(e,e=>{t.push(e)},!0),t},Sn=function(e,t){let n=st();U(xn(e),e=>{_(e)===Q.element&&ct(n,e)}),U(t,e=>{_(e)===Q.element&&!lt(n,e)&&vn(e)})},Cn=function(e,n){let r=!1;return U(t.removed,t=>{t.element&&(r||=t.element===e,bn(t.element))}),Sn(e,n),r},wn=function(e,t){let n=I,r=null,i=()=>(r||(r=st(),U(t,e=>{ct(r,e)})),r);for(let t=0;;t++){let r=xn(e),a=[e],o=!1;if(U(r,e=>{_(e)===Q.documentFragment?rt(a,e):!o&&!lt(n,e)&&(o=lt(i(),e))}),!o)return;if(t>=8)throw K(`the tree kept changing during in-place sanitization; refusing to return it`);U(a,(t,n)=>{Tn(t,n>0,e,i())})}},Tn=function(e,t,n,r){let i=An(e),a;for(;a=i.nextNode();)lt(r,a)&&!lt(I,a)&&(t&&$(x.uponSanitizeShadowNode,a,null),Hn(a,n),Yn(a,n),Fn(a.content)&&Xn(a.content))},En=function(e){I&&ct(I,e)},Dn=function(e,t){return k?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},On=function(e){k&&yn(e,e=>{let t=_(e);if(t===Q.processingInstruction||t===Q.comment&&G(qt,e.data)){try{p(e)}catch{}return!1}if(t===Q.element){let t=e,n=Y(oe(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Dn(`for`,n)&&t.removeAttribute(`for`)}catch{}}return!0})},kn=function(e){let t=null,r=null;if(ze)e=`<remove></remove>`+e;else{let t=ft(e,/^[\r\n\t ]+/);r=t&&t[0]}q===`application/xhtml+xml`&&B===z&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?b(e):e;if(B===z)try{t=new l().parseFromString(i,q)}catch{}if(!t||!t.documentElement){t=ge.createDocument(B,`template`,null);try{t.documentElement.innerHTML=Qe?y:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),B===z?ye.call(t,A?`html`:`body`)[0]:A?t.documentElement:a},An=function(e){let t=ae?ae(e):e.ownerDocument;return _e.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},jn=function(e){return e=pt(e,xe,` `),e=pt(e,Se,` `),e=pt(e,Ce,` `),e},Mn=function(e){Nn(e);let t=e.querySelectorAll?.call(e,`template`);t&&U(t,e=>{Fn(e.content)&&Mn(e.content)})},Nn=function(e){e.normalize();let t=ae?ae(e):e.ownerDocument,n=_e.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=jn(r.data),r=n.nextNode()},Pn=function(e){let t=g?g(e):null;return typeof t!=`string`||Y(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==ie(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==h(e)||e.childNodes!==ne(e)},Fn=function(e){if(!h||typeof e!=`object`||!e)return!1;try{return h(e)===Q.documentFragment}catch{return!1}},In=function(e){if(!h||typeof e!=`object`||!e)return!1;try{return typeof h(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&U(e,e=>{e.call(t,n,r,rn)})}let Ln=function(e,t){return!!(k&&e.hasChildNodes()&&!In(e.firstElementChild)&&G(Kt,e.textContent)&&G(Kt,e.innerHTML)||k&&Xt[t]&&_(e)===Q.element&&ce(e)===z&&(In(e.firstElementChild)||typeof e.textContent==`string`&&G(Kt,e.textContent))||e.nodeType===Q.processingInstruction||k&&e.nodeType===Q.comment&&G(qt,e.data))},Rn=function(e,t){return e instanceof RegExp?G(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},zn=function(e,t,n){if(!T[t]&&Gn(t)&&Rn(w.tagNameCheck,t))return!1;if(P&&!R[t]&&!R[ut(t)]){let t=m(e),r=ne(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,te(e))}}}return mn(e),!0},Bn=function(e,t,n,r){return e.length===0?t:t===n||t===r?X(t):t},Vn=function(e,t){return e===t||m(e)!==null?!1:(F&&bn(e),!0)},Hn=function(e,n){if(En(e),$(x.beforeSanitizeElements,e,null),Vn(e,n))return!0;if(Pn(e))return mn(e),!0;let r=Y(oe(e));if(S=Bn(x.uponSanitizeElement,S,Ae,Le),$(x.uponSanitizeElement,e,{tagName:r,allowedTags:S}),Vn(e,n))return!0;if(Ln(e,r))return mn(e),!0;if(T[r]||!(E.tagCheck instanceof Function&&E.tagCheck(r))&&!S[r]){let t=zn(e,r,n);return t===!1&&($(x.afterSanitizeElements,e,null),Vn(e,n))?!0:t}if(_(e)===Q.element&&!pn(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&G(Jt,e.innerHTML))return mn(e),!0;if(O&&e.nodeType===Q.text){let n=jn(e.textContent);e.textContent!==n&&(rt(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(x.afterSanitizeElements,e,null),Vn(e,n)},Un=function(e,t,r){if(Me[t]||Dn(t,e)||N&&(t===`id`||t===`name`)&&(r in n||r in an))return!1;let i=C[t]||E.attributeCheck instanceof Function&&E.attributeCheck(t,e);return Pe&&G(we,t)||Ne&&G(Te,t)?!0:i?Ke[t]||G(ke,pt(r,De,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&mt(r,`data:`)===0&&We[e]||Fe&&!G(Ee,pt(r,De,``))?!0:!r:Gn(e)&&Rn(w.tagNameCheck,e)&&Rn(w.attributeNameCheck,t,e)||t===`is`&&w.allowCustomizedBuiltInElements&&Rn(w.tagNameCheck,r)},Wn=J({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Gn=function(e){return!Wn[ut(e)]&&G(Oe,e)},Kn=function(e,t,n,r){if(v&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return b(r);case`TrustedScriptURL`:return pe(r)}return r},qn=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Pn(e)||(mn(e),!1)}catch{return _n(t,e),!1}},Jn=function(e,t){return k&&G(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,t)?!0:ut(e)===`attributename`&&ft(t,`href`)!==null},Yn=function(e,n){if($(x.beforeSanitizeAttributes,e,null),Vn(e,n))return;let r=e.attributes;if(!r||Pn(e))return;C=Bn(x.uponSanitizeAttribute,C,je,Re);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0},a=r.length,o=Y(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=Y(s),d=l,f=s===`value`?d:ht(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,$(x.uponSanitizeAttribute,e,i),f=i.attrValue,Ve&&(u===`id`||u===`name`)&&mt(f,He)!==0&&(_n(s,e,n),f=He+f,p=!0),Jn(s,f)?_n(s,e,n):i.forceKeepAttr||(i.keepAttr?!D&&G(Yt,f)?_n(s,e,n):(O&&(f=jn(f)),Un(o,u,f)?(f=Kn(o,u,c,f),f!==d&&qn(e,s,c,f)&&p&&nt(t.removed)):_n(s,e,n)):_n(s,e,n))}$(x.afterSanitizeAttributes,e,null),Vn(e,n)},Xn=function(e){let t=null,n=An(e);for($(x.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(x.uponSanitizeShadowNode,t,null),Hn(t,e),Yn(t,e),Fn(t.content)&&Xn(t.content),_(t)===Q.element){let e=re(t);Fn(e)&&(Zn(e),Xn(e))}O&&Nn(e),$(x.afterSanitizeShadowDOM,e,null)},Zn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Xn(e.shadow);continue}let n=e.node,r=_(n)===Q.element,i=ne(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=g?g(n):null;if(typeof e==`string`&&Y(e)===`template`){let e=n.content;Fn(e)&&t.push({node:e,shadow:null})}}if(r){let e=re(n);Fn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Qe=!e,Qe&&(e=`<!-->`),typeof e!=`string`&&!In(e)&&(e=St(e),typeof e!=`string`))throw K(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ie?(S=Le,C=Re):sn(n),(x.uponSanitizeElement.length>0||x.uponSanitizeAttribute.length>0)&&(S=X(S)),x.uponSanitizeAttribute.length>0&&(C=X(C)),t.removed=[];let c=F&&typeof e!=`string`&&In(e),l=[],u=I;if(c){On(e);let t=oe(e);if(typeof t==`string`){let n=Y(t);if(!S[n]||T[n])throw gn(e),K(`root node is forbidden and cannot be sanitized in-place`)}if(Pn(e))throw gn(e),K(`root node is clobbered and cannot be sanitized in-place`);l=xn(e),I=st()}else if(In(e))i=kn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===Q.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Zn(i);else{if(!j&&!O&&!A&&e.indexOf(`<`)===-1)return v&&Be?b(e):e;if(i=kn(e),!i)return j?null:Be?y:``}i&&ze&&mn(i.firstChild);let d=c?e:i;try{c&&Zn(e);let t=An(d);for(;o=t.nextNode();)Hn(o,d),Yn(o,d),Fn(o.content)&&Xn(o.content);c&&wn(e,l)}catch(t){throw c&&(gn(e),Cn(e,l)),t}finally{I=u}if(c){if(Cn(e,l))throw K(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return O&&Mn(e),e}if(j){if(O&&Mn(i),M)for(s=ve.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(C.shadowroot||C.shadowrootmode)&&(s=be.call(r,s,!0)),s}let f=A?i.outerHTML:i.innerHTML;return A&&S[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&G(Wt,i.ownerDocument.doctype.name)&&(f=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
58
+ `+f),O&&(f=jn(f)),v&&Be?b(f):f},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};sn(e),Ie=!0,Le=S,Re=C},t.clearConfig=function(){rn=null,Ie=!1,Le=null,Re=null,v=le,y=``},t.isValidAttribute=function(e,t,n){rn||sn({});let r=Y(e),i=Y(t);return typeof n==`string`&&(Jn(t,n)||!D&&G(Yt,n))?!1:Un(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&W(x,e)&&rt(x[e],t)},t.removeHook=function(e,t){if(W(x,e)){if(t!==void 0){let n=tt(x[e],t);return n===-1?void 0:at(x[e],n,1)[0]}return nt(x[e])}},t.removeHooks=function(e){W(x,e)&&(x[e]=[])},t.removeAllHooks=function(){x=$t()},t}var rn=nn();function an(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#39;`)}var on=new He({renderer:{code({text:e,lang:t,escaped:n}){return`<div class="code-block"><div class="code-block-head"><span>${an((t??``).trim().split(/\s+/)[0]||`代码块`)}</span><button type="button" data-copy-code>复制</button></div><pre><code>${n?e:an(e)}</code></pre></div>`},link(e){return`<a href="${an(e.href||``)}"${e.title?` title="${an(e.title)}"`:``} target="_blank" rel="noopener noreferrer">${this.parser.parseInline(e.tokens??[])}</a>`}}});function sn(e){let t=on.parse(e,{async:!1});return rn.sanitize(t,{ADD_ATTR:[`target`]})}export{sn as t};
@@ -0,0 +1 @@
1
+ import{s as e,t}from"./react.Blvh0GOs.js";import{D as n,E as r,S as i,T as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,l as h,m as g,n as _,o as v,p as y,r as b,s as x,t as S,u as C,y as w}from"./use-text-value.DBQvHeNl.js";import{t as T}from"./react-dom.DLW9pGCF.js";import{$ as E,A as D,C as O,E as k,F as A,I as j,J as M,L as N,M as P,N as F,P as I,R as L,S as R,T as ee,V as z,_t as te,c as B,d as ne,dt as V,et as H,f as re,h as ie,ht as U,it as W,k as ae,m as oe,mt as se,n as ce,nt as G,o as le,p as ue,pt as K,rt as de,s as fe,st as pe,u as me,ut as q,w as he,x as ge}from"./portal.C0hAhXDF.js";import{t as _e}from"./use-tree-walker.DFU2AaAP.js";var J=e(t(),1),Y=e(T(),1),ve=Object.defineProperty,ye=(e,t,n)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,be=(e,t,n)=>(ye(e,typeof t==`symbol`?t:t+``,n),n),X=(e=>(e[e.Open=0]=`Open`,e[e.Closed=1]=`Closed`,e))(X||{}),Z=(e=>(e[e.Pointer=0]=`Pointer`,e[e.Other=1]=`Other`,e))(Z||{}),Q=(e=>(e[e.OpenMenu=0]=`OpenMenu`,e[e.CloseMenu=1]=`CloseMenu`,e[e.GoToItem=2]=`GoToItem`,e[e.Search=3]=`Search`,e[e.ClearSearch=4]=`ClearSearch`,e[e.RegisterItems=5]=`RegisterItems`,e[e.UnregisterItems=6]=`UnregisterItems`,e[e.SetButtonElement=7]=`SetButtonElement`,e[e.SetItemsElement=8]=`SetItemsElement`,e[e.SortItems=9]=`SortItems`,e[e.MarkButtonAsMoved=10]=`MarkButtonAsMoved`,e))(Q||{});function xe(e,t=e=>e){let n=e.activeItemIndex===null?null:e.items[e.activeItemIndex],r=ge(t(e.items.slice()),e=>e.dataRef.current.domRef.current),i=n?r.indexOf(n):null;return i===-1&&(i=null),{items:r,activeItemIndex:i}}var Se={1(e){if(e.menuState===1)return e;let t=e.buttonElement?b.Tracked(_(e.buttonElement)):e.buttonPositionState;return{...e,activeItemIndex:null,pendingFocus:{focus:s.Nothing},menuState:1,buttonPositionState:t}},0(e,t){return e.menuState===0?e:{...e,__demoMode:!1,pendingFocus:t.focus,menuState:0,buttonPositionState:b.Idle}},2:(e,t)=>{if(e.menuState===1)return e;let n={...e,searchQuery:``,activationTrigger:t.trigger??1,__demoMode:!1};if(t.focus===s.Nothing)return{...n,activeItemIndex:null};if(t.focus===s.Specific)return{...n,activeItemIndex:e.items.findIndex(e=>e.id===t.id)};if(t.focus===s.Previous){let r=e.activeItemIndex;if(r!==null){let i=e.items[r].dataRef.current.domRef,a=v(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(a!==null){let t=e.items[a].dataRef.current.domRef;if(i.current?.previousElementSibling===t.current||t.current?.previousElementSibling===null)return{...n,activeItemIndex:a}}}}else if(t.focus===s.Next){let r=e.activeItemIndex;if(r!==null){let i=e.items[r].dataRef.current.domRef,a=v(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(a!==null){let t=e.items[a].dataRef.current.domRef;if(i.current?.nextElementSibling===t.current||t.current?.nextElementSibling===null)return{...n,activeItemIndex:a}}}}let r=xe(e),i=v(t,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...n,...r,activeItemIndex:i}},3:(e,t)=>{let n=+(e.searchQuery===``),r=e.searchQuery+t.value.toLowerCase(),i=(e.activeItemIndex===null?e.items:e.items.slice(e.activeItemIndex+n).concat(e.items.slice(0,e.activeItemIndex+n))).find(e=>e.dataRef.current.textValue?.startsWith(r)&&!e.dataRef.current.disabled),a=i?e.items.indexOf(i):-1;return a===-1||a===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:a,activationTrigger:1}},4(e){return e.searchQuery===``?e:{...e,searchQuery:``,searchActiveItemIndex:null}},5:(e,t)=>{let n=e.items.concat(t.items.map(e=>e)),r=e.activeItemIndex;return e.pendingFocus.focus!==s.Nothing&&(r=v(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled})),{...e,items:n,activeItemIndex:r,pendingFocus:{focus:s.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.items,r=[],i=new Set(t.items);for(let[e,t]of n.entries())if(i.has(t.id)&&(r.push(e),i.delete(t.id),i.size===0))break;if(r.length>0){n=n.slice();for(let e of r.reverse())n.splice(e,1)}return{...e,items:n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element},9:e=>e.pendingShouldSort?{...e,...xe(e),pendingShouldSort:!1}:e,10(e){return e.buttonPositionState.kind===`Tracked`?{...e,buttonPositionState:b.Moved}:e}},Ce=class e extends A{constructor(e){super(e),be(this,`actions`,{registerItem:j(()=>{let e=[],t=new Set;return[(n,r)=>{t.has(r)||(t.add(r),e.push({id:n,dataRef:r}))},()=>(t.clear(),this.send({type:5,items:e.splice(0)}))]}),unregisterItem:j(()=>{let e=[];return[t=>e.push(t),()=>this.send({type:6,items:e.splice(0)})]})}),be(this,`selectors`,{activeDescendantId(e){var t;let n=e.activeItemIndex,r=e.items;return n===null||(t=r[n])==null?void 0:t.id},isActive(e,t){let n=e.activeItemIndex,r=e.items;return n!==null&&r[n]?.id===t},shouldScrollIntoView(e,t){return e.__demoMode||e.menuState!==0||e.activationTrigger===0?!1:this.isActive(e,t)},didButtonMove(e){return e.buttonPositionState.kind===`Moved`}}),this.on(5,()=>{this.disposables.requestAnimationFrame(()=>{this.send({type:9})})});{let e=this.state.id,t=I.get(null);this.disposables.add(t.on(F.Push,n=>{!t.selectors.isTop(n,e)&&this.state.menuState===0&&this.send({type:1})})),this.on(0,()=>t.actions.push(e)),this.on(1,()=>t.actions.pop(e))}this.disposables.group(e=>{this.on(1,t=>{t.buttonElement&&(e.dispose(),e.add(m(t.buttonElement,t.buttonPositionState,()=>{this.send({type:10})})))})})}static new({id:t,__demoMode:n=!1}){return new e({id:t,__demoMode:n,menuState:+!n,buttonElement:null,itemsElement:null,items:[],searchQuery:``,activeItemIndex:null,activationTrigger:1,pendingShouldSort:!1,pendingFocus:{focus:s.Nothing},buttonPositionState:b.Idle})}reduce(e,t){return pe(t.type,Se,e,t)}},we=(0,J.createContext)(null);function $(e){let t=(0,J.useContext)(we);if(t===null){let t=Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Te),t}return t}function Te({id:e,__demoMode:t=!1}){let n=(0,J.useMemo)(()=>Ce.new({id:e,__demoMode:t}),[]);return le(()=>n.dispose()),n}var Ee=J.Fragment;function De(e,t){let n=(0,E.useId)(),{__demoMode:r=!1,...i}=e,a=Te({id:n,__demoMode:r}),[o,s,c]=P(a,e=>[e.menuState,e.itemsElement,e.buttonElement]),l=z(t),u=I.get(null),d=P(u,(0,J.useCallback)(e=>u.selectors.isTop(e,n),[u,n]));ie(d,[c,s],(e,t)=>{var n;a.send({type:Q.CloseMenu}),R(t,O.Loose)||(e.preventDefault(),(n=a.state.buttonElement)==null||n.focus())});let f=V(()=>{a.send({type:Q.CloseMenu})}),p=q({open:o===X.Open,close:f}),m={ref:l},h=G();return J.createElement(x,null,J.createElement(we.Provider,{value:a},J.createElement(fe,{value:pe(o,{[X.Open]:B.Open,[X.Closed]:B.Closed})},h({ourProps:m,theirProps:i,slot:p,defaultTag:Ee,name:`Menu`}))))}var Oe=`button`;function ke(e,t){let i=$(`Menu.Button`),c=(0,E.useId)(),{id:d=`headlessui-menu-button-${c}`,disabled:m=!1,autoFocus:h=!1,..._}=e,v=(0,J.useRef)(null),y=u(),b=z(t,v,l(),V(e=>i.send({type:Q.SetButtonElement,element:e}))),x=V(e=>{switch(e.key){case N.Space:case N.Enter:case N.ArrowDown:e.preventDefault(),e.stopPropagation(),i.send({type:Q.OpenMenu,focus:{focus:s.First}});break;case N.ArrowUp:e.preventDefault(),e.stopPropagation(),i.send({type:Q.OpenMenu,focus:{focus:s.Last}})}}),S=V(e=>{switch(e.key){case N.Space:e.preventDefault()}}),[C,w,T]=P(i,e=>[e.menuState,e.buttonElement,e.itemsElement]),D=C===X.Open;p(D,{trigger:w,action:(0,J.useCallback)(e=>{if(w!=null&&w.contains(e.target))return f.Ignore;let t=e.target.closest(`[role="menuitem"]:not([data-disabled])`);return M(t)?f.Select(t):T!=null&&T.contains(e.target)?f.Ignore:f.Close},[w,T]),close:(0,J.useCallback)(()=>i.send({type:Q.CloseMenu}),[]),select:(0,J.useCallback)(e=>e.click(),[])});let O=o(e=>{var t;m||(C===X.Open?((0,Y.flushSync)(()=>i.send({type:Q.CloseMenu})),(t=v.current)==null||t.focus({preventScroll:!0})):(e.preventDefault(),i.send({type:Q.OpenMenu,focus:{focus:s.Nothing},trigger:Z.Pointer})))}),{isFocusVisible:k,focusProps:A}=n({autoFocus:h}),{isHovered:j,hoverProps:F}=r({isDisabled:m}),{pressed:I,pressProps:L}=a({disabled:m}),R=q({open:C===X.Open,active:I||C===X.Open,disabled:m,hover:j,focus:k,autofocus:h}),ee=de(y(),{ref:b,id:d,type:g(e,v.current),"aria-haspopup":`menu`,"aria-controls":T?.id,"aria-expanded":C===X.Open,disabled:m||void 0,autoFocus:h,onKeyDown:x,onKeyUp:S},O,A,F,L);return G()({ourProps:ee,theirProps:_,slot:R,defaultTag:Oe,name:`Menu.Button`})}var Ae=`div`,je=H.RenderStrategy|H.Static;function Me(e,t){let n=(0,E.useId)(),{id:r=`headlessui-menu-items-${n}`,anchor:i,portal:a=!1,modal:o=!0,transition:c=!1,...l}=e,u=d(i),f=$(`Menu.Items`),[p,m]=h(u),g=C(),[_,v]=(0,J.useState)(null),y=z(t,u?p:null,V(e=>f.send({type:Q.SetItemsElement,element:e})),v),[b,x]=P(f,e=>[e.menuState,e.buttonElement]),S=oe(x),T=oe(_);u&&(a=!0);let O=me(),[A,j]=ne(c,_,O===null?b===X.Open:(O&B.Open)===B.Open);ae(A,x,()=>{f.send({type:Q.CloseMenu})});let M=P(f,e=>e.__demoMode),F=!M&&o&&b===X.Open;ue(F,T);let I=!M&&o&&b===X.Open;D(I,{allowed:(0,J.useCallback)(()=>[x,_],[x,_])});let L=!P(f,f.selectors.didButtonMove)&&A;(0,J.useEffect)(()=>{let e=_;e&&b===X.Open&&(te(e)||e.focus({preventScroll:!0}))},[b,_]),_e(b===X.Open,{container:_,accept(e){return e.getAttribute(`role`)===`menuitem`?NodeFilter.FILTER_REJECT:e.hasAttribute(`role`)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(e){e.setAttribute(`role`,`none`)}});let R=se(),H=V(e=>{var t,n;switch(R.dispose(),e.key){case N.Space:if(f.state.searchQuery!==``)return e.preventDefault(),e.stopPropagation(),f.send({type:Q.Search,value:e.key});case N.Enter:if(e.preventDefault(),e.stopPropagation(),f.state.activeItemIndex!==null){let{dataRef:e}=f.state.items[f.state.activeItemIndex];(t=e.current?.domRef.current)==null||t.click()}f.send({type:Q.CloseMenu}),he(f.state.buttonElement);break;case N.ArrowDown:return e.preventDefault(),e.stopPropagation(),f.send({type:Q.GoToItem,focus:s.Next});case N.ArrowUp:return e.preventDefault(),e.stopPropagation(),f.send({type:Q.GoToItem,focus:s.Previous});case N.Home:case N.PageUp:return e.preventDefault(),e.stopPropagation(),f.send({type:Q.GoToItem,focus:s.First});case N.End:case N.PageDown:return e.preventDefault(),e.stopPropagation(),f.send({type:Q.GoToItem,focus:s.Last});case N.Escape:e.preventDefault(),e.stopPropagation(),(0,Y.flushSync)(()=>f.send({type:Q.CloseMenu})),(n=f.state.buttonElement)==null||n.focus({preventScroll:!0});break;case N.Tab:e.preventDefault(),e.stopPropagation(),(0,Y.flushSync)(()=>f.send({type:Q.CloseMenu})),ee(f.state.buttonElement,e.shiftKey?k.Previous:k.Next);break;default:e.key.length===1&&(f.send({type:Q.Search,value:e.key}),R.setTimeout(()=>f.send({type:Q.ClearSearch}),350))}}),ie=V(e=>{switch(e.key){case N.Space:e.preventDefault()}}),U=q({open:b===X.Open}),W=de(u?g():{},{"aria-activedescendant":P(f,f.selectors.activeDescendantId),"aria-labelledby":P(f,e=>e.buttonElement?.id),id:r,onKeyDown:H,onKeyUp:ie,role:`menu`,tabIndex:b===X.Open?0:void 0,ref:y,style:{...l.style,...m,"--button-width":w(A,x,!0).width},...re(j)}),le=G();return J.createElement(ce,{enabled:a?e.static||A:!1,ownerDocument:S},le({ourProps:W,theirProps:l,slot:U,defaultTag:Ae,features:je,visible:L,name:`Menu.Items`}))}var Ne=J.Fragment;function Pe(e,t){let n=(0,E.useId)(),{id:r=`headlessui-menu-item-${n}`,disabled:a=!1,...o}=e,c=$(`Menu.Item`),l=P(c,e=>c.selectors.isActive(e,r)),u=(0,J.useRef)(null),d=z(t,u),f=P(c,e=>c.selectors.shouldScrollIntoView(e,r));K(()=>{if(f)return U().requestAnimationFrame(()=>{var e,t;(t=(e=u.current)?.scrollIntoView)==null||t.call(e,{block:`nearest`})})},[f,u]);let p=S(u),m=(0,J.useRef)({disabled:a,domRef:u,get textValue(){return p()}});K(()=>{m.current.disabled=a},[m,a]),K(()=>(c.actions.registerItem(r,m),()=>c.actions.unregisterItem(r)),[m,r]);let h=V(()=>{c.send({type:Q.CloseMenu})}),g=V(e=>{if(a)return e.preventDefault();c.send({type:Q.CloseMenu}),he(c.state.buttonElement)}),_=V(()=>{if(a)return c.send({type:Q.GoToItem,focus:s.Nothing});c.send({type:Q.GoToItem,focus:s.Specific,id:r})}),v=y(),b=V(e=>v.update(e)),x=V(e=>{v.wasMoved(e)&&(a||l||c.send({type:Q.GoToItem,focus:s.Specific,id:r,trigger:Z.Pointer}))}),C=V(e=>{v.wasMoved(e)&&(a||l&&c.state.activationTrigger===Z.Pointer&&c.send({type:Q.GoToItem,focus:s.Nothing}))}),[w,T]=i(),[D,O]=L(),k=q({active:l,focus:l,disabled:a,close:h}),A={id:r,ref:d,role:`menuitem`,tabIndex:a===!0?void 0:-1,"aria-disabled":a===!0||void 0,"aria-labelledby":w,"aria-describedby":D,disabled:void 0,onClick:g,onFocus:_,onPointerEnter:b,onMouseEnter:b,onPointerMove:x,onMouseMove:x,onPointerLeave:C,onMouseLeave:C},j=G();return J.createElement(T,null,J.createElement(O,null,j({ourProps:A,theirProps:o,slot:k,defaultTag:Ne,name:`Menu.Item`})))}var Fe=`div`;function Ie(e,t){let[n,r]=i(),a=e,o={ref:t,"aria-labelledby":n,role:`group`},s=G();return J.createElement(r,null,s({ourProps:o,theirProps:a,slot:{},defaultTag:Fe,name:`Menu.Section`}))}var Le=`header`;function Re(e,t){let n=(0,E.useId)(),{id:r=`headlessui-menu-heading-${n}`,...i}=e,a=c();K(()=>a.register(r),[r,a.register]);let o={id:r,ref:t,role:`presentation`,...a.props};return G()({ourProps:o,theirProps:i,slot:{},defaultTag:Le,name:`Menu.Heading`})}var ze=`div`;function Be(e,t){let n=e,r={ref:t,role:`separator`};return G()({ourProps:r,theirProps:n,slot:{},defaultTag:ze,name:`Menu.Separator`})}var Ve=W(De),He=W(ke),Ue=W(Me),We=W(Pe),Ge=W(Ie),Ke=W(Re),qe=W(Be),Je=Object.assign(Ve,{Button:He,Items:Ue,Item:We,Section:Ge,Heading:Ke,Separator:qe});export{Ue as i,We as n,Je as r,He as t};
@@ -1 +1 @@
1
- import{d as e,i as t,p as n}from"./app-config.DKMxjv3g.js";import{o as r}from"./settings.CnDCvwnQ.js";var i=`/__tb_sessions`,a=`tw-chat-sessions`,o=`tw-chat-active-id`,s=`tw-chat-history`,c=`tw-session-rail-open`,l=!1,u=null;function d(){return`s_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function f(e){let t=Date.now();return{id:d(),title:`新对话`,createdAt:t,updatedAt:t,archived:!1,pinned:!1,messages:[],...e}}function p(e){let t=(e.find(e=>e.role===`user`&&(e.content??``).trim())?.content??``).trim().replace(/\s+/g,` `);return t?t.length>24?`${t.slice(0,24)}…`:t:`新对话`}function m(){try{let e=localStorage.getItem(s);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function h(e){if(!e)return null;let t=(Array.isArray(e.sessions)?e.sessions:[]).filter(e=>!e.deleted);return t.length?{sessions:t,activeId:typeof e.activeId==`string`&&t.some(t=>t.id===e.activeId)?e.activeId:t.find(e=>!e.archived)?.id??t[0].id}:null}function g(){return n(a)}function _(){return n(o)}function v(){try{let e=localStorage.getItem(g());return e?h(JSON.parse(e)):null}catch{return null}}function y(e){try{localStorage.setItem(g(),JSON.stringify(e)),localStorage.setItem(_(),e.activeId)}catch{}}function b(){let e=m(),t=f({title:e.length?p(e):`新对话`,messages:e}),n={sessions:[t],activeId:t.id};try{localStorage.removeItem(s)}catch{}return n}async function x(e){let t=e?.preferSessionId?.trim()||``,n=v();try{let e=await fetch(i,{signal:AbortSignal.timeout(2e3)});if(e.ok){let r=await e.json();l=!0;let i=h(r.store??null);if(!i){let e=t&&n?n.sessions.find(e=>e.id===t):void 0;i=e?{sessions:[e],activeId:t}:b(),await C(i)}else if(t&&n&&!i.sessions.some(e=>e.id===t)){let e=n.sessions.find(e=>e.id===t);e?(i={...i,sessions:[e,...i.sessions],activeId:t},await C(i)):y(i)}else t&&i.sessions.some(e=>e.id===t)&&(i={...i,activeId:t}),y(i);return i}}catch{}return l=!1,n??b()}function S(){return v()??b()}async function C(e){if(y(e),l)try{await fetch(i,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({store:e})})}catch{}}function w(e){y(e),u&&clearTimeout(u),u=setTimeout(()=>{u=null,C(e)},320)}async function T(e){u&&=(clearTimeout(u),null),await C(e)}async function E(){if(!l)return null;try{let e=await fetch(i,{signal:AbortSignal.timeout(2e3)});return e.ok?h((await e.json()).store??null):null}catch{return null}}function D(e,t){let n=/<!--tb-schedule:([^>]+)-->/,r=!1,i=e.sessions.map(e=>{let i=t.sessions.find(t=>t.id===e.id);if(!i||!Array.isArray(i.messages))return e;let a=Array.isArray(e.messages)?[...e.messages]:[],o=new Set;for(let e of a){let t=e&&typeof e==`object`&&`content`in e?String(e.content??``):``,r=n.exec(t);r?.[1]&&o.add(r[1]);let i=e&&typeof e==`object`&&`scheduleId`in e?String(e.scheduleId??``):``;i&&o.add(i)}let s=!1;for(let e of i.messages){let t=e&&typeof e==`object`&&`content`in e?String(e.content??``):``,r=n.exec(t);r?.[1]&&!o.has(r[1])&&(a.push(e),o.add(r[1]),s=!0)}return s?(r=!0,{...e,messages:a,updatedAt:Date.now()}):e});return r?{...e,sessions:i}:e}function O(e,t){let n=f({workspacePath:t?.workspacePath,access:t?.access});return{sessions:[n,...e.sessions],activeId:n.id}}function k(e,t,n){return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,workspacePath:n||void 0,updatedAt:Date.now()}:e)}}function A(e,t,n){let r=n.trim()||`未命名`;return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,title:r,updatedAt:Date.now()}:e)}}function j(e,t,n=!0){return{...e,sessions:e.sessions.map(e=>e.id===t?n&&e.archived?{...e,pinned:!0,archived:!1,updatedAt:Date.now()}:{...e,pinned:n,updatedAt:Date.now()}:e)}}function M(e,t){let n=e.sessions.filter(e=>e.id!==t);if(!n.length){let e=f();return{sessions:[e],activeId:e.id}}return{sessions:n,activeId:e.activeId===t?n.find(e=>!e.archived&&!e.deleted)?.id??n[0].id:e.activeId}}function N(e,t,n=!0){let r=e.sessions.map(e=>e.id===t?{...e,archived:n,deleted:!n&&e.deleted,pinned:!n&&e.pinned,updatedAt:Date.now()}:e),i=e.activeId;return n&&i===t&&(i=r.find(e=>!e.archived&&!e.deleted)?.id??r[0].id),{sessions:r,activeId:i}}function P(e,t){return{...e,sessions:e.sessions.map(e=>e.workspacePath===t?{...e,workspacePath:void 0,updatedAt:Date.now()}:e)}}function F(e){return!(e.archived||e.deleted||e.pinned||Array.isArray(e.messages)&&e.messages.length>0)}function I(e,t,n,r){let i=r?.touchUpdatedAt!==!1;return{...e,sessions:e.sessions.map(e=>{if(e.id!==t)return e;let a=r?.touchTitle&&(e.title===`新对话`||!e.title)||e.title===`新对话`?p(n):e.title;return{...e,messages:n.slice(-80),title:a,updatedAt:i?Date.now():e.updatedAt}})}}function L(e,t,n){return I(e,e.activeId,t,n)}function R(e){return Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return t.role!==`assistant`||!Array.isArray(t.activitySteps)||!t.activitySteps.some(e=>e.status===`running`)?e:{...t,activitySteps:t.activitySteps.map(e=>e.status===`running`?{...e,status:`done`}:e)}}):e}function z(e){let t=!1,n=e.sessions.map(e=>{let n=R(e.messages);return n===e.messages?e:(t=!0,{...e,messages:n})});return t?{...e,sessions:n}:e}function B(e,t,n){return{...e,sessions:e.sessions.map(e=>{if(e.id!==t)return e;let r=[...Array.isArray(e.messages)?e.messages:[],n].slice(-80);return{...e,messages:r,updatedAt:Date.now()}})}}function V(e,t,n){return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,...n,updatedAt:Date.now()}:e)}}function H(e,t){return V(e,e.activeId,t)}function U(e,t){return e.sessions.some(e=>e.id===t)?{...e,activeId:t}:e}function W(e){return[...e].sort((e,t)=>{let n=+!!e.pinned,r=+!!t.pinned;return n===r?t.updatedAt-e.updatedAt:r-n})}function G(){try{return localStorage.getItem(n(c))!==`0`}catch{return!0}}function K(e){try{localStorage.setItem(n(c),e?`1`:`0`)}catch{}}function q(t){let n=e();return n?`tb:session-handoff:${n}:${t}`:`tb:session-handoff:${t}`}function J(e){return e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/^\/+/,``)}function Y(e,t,n){return e.sessions.find(e=>{if(t===`cases`){let t=e.caseGen?.linkedCasePath;return!!(t&&J(t)===n)}let r=t===`prompts`?e.promptGen?.linkedPromptPath:e.knowledgeGen?.linkedKnowledgePath;return!!(r&&J(r)===n)})}async function X(e,n){await x().catch(()=>null),await t().catch(()=>null);let i=S(),a=J(n.path),o=Y(i,e,a);if(o||=(i=O(i,{access:r()}),await T(i),i.sessions.find(e=>e.id===i.activeId)),!o)throw Error(`无法创建或定位会话`);try{let e=i.sessions.find(e=>e.id===o.id)??o;sessionStorage.setItem(q(o.id),JSON.stringify({session:e}))}catch{}let s=new URLSearchParams({session:o.id,focusRoot:e,focusPath:a,attachRoot:e,attachPath:a,attachName:n.name});window.location.href=`/?${s.toString()}`}export{p as C,I as D,H as E,V as O,U as S,L as T,K as _,k as a,z as b,E as c,F as d,G as f,A as g,j as h,N as i,T as l,D as m,q as n,O as o,S as p,B as r,M as s,X as t,x as u,w as v,P as w,W as x,R as y};
1
+ import{d as e,i as t,p as n}from"./app-config.BUPzGl9f.js";import{o as r}from"./settings.Ceefeil5.js";var i=`/__tb_sessions`,a=`tw-chat-sessions`,o=`tw-chat-active-id`,s=`tw-chat-history`,c=`tw-session-rail-open`,l=!1,u=null;function d(){return`s_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}function f(e){let t=Date.now();return{id:d(),title:`新对话`,createdAt:t,updatedAt:t,archived:!1,pinned:!1,messages:[],...e}}function p(e){let t=(e.find(e=>e.role===`user`&&(e.content??``).trim())?.content??``).trim().replace(/\s+/g,` `);return t?t.length>24?`${t.slice(0,24)}…`:t:`新对话`}function m(){try{let e=localStorage.getItem(s);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function h(e){if(!e)return null;let t=(Array.isArray(e.sessions)?e.sessions:[]).filter(e=>!e.deleted);return t.length?{sessions:t,activeId:typeof e.activeId==`string`&&t.some(t=>t.id===e.activeId)?e.activeId:t.find(e=>!e.archived)?.id??t[0].id}:null}function g(){return n(a)}function _(){return n(o)}function v(){try{let e=localStorage.getItem(g());return e?h(JSON.parse(e)):null}catch{return null}}function y(e){try{localStorage.setItem(g(),JSON.stringify(e)),localStorage.setItem(_(),e.activeId)}catch{}}function b(){let e=m(),t=f({title:e.length?p(e):`新对话`,messages:e}),n={sessions:[t],activeId:t.id};try{localStorage.removeItem(s)}catch{}return n}async function x(e){let t=e?.preferSessionId?.trim()||``,n=v();try{let e=await fetch(i,{signal:AbortSignal.timeout(2e3)});if(e.ok){let r=await e.json();l=!0;let i=h(r.store??null);if(!i){let e=t&&n?n.sessions.find(e=>e.id===t):void 0;i=e?{sessions:[e],activeId:t}:b(),await C(i)}else if(t&&n&&!i.sessions.some(e=>e.id===t)){let e=n.sessions.find(e=>e.id===t);e?(i={...i,sessions:[e,...i.sessions],activeId:t},await C(i)):y(i)}else t&&i.sessions.some(e=>e.id===t)&&(i={...i,activeId:t}),y(i);return i}}catch{}return l=!1,n??b()}function S(){return v()??b()}async function C(e){if(y(e),l)try{await fetch(i,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({store:e})})}catch{}}function w(e){y(e),u&&clearTimeout(u),u=setTimeout(()=>{u=null,C(e)},320)}async function T(e){u&&=(clearTimeout(u),null),await C(e)}async function E(){if(!l)return null;try{let e=await fetch(i,{signal:AbortSignal.timeout(2e3)});return e.ok?h((await e.json()).store??null):null}catch{return null}}function D(e,t){let n=/<!--tb-schedule:([^>]+)-->/,r=!1,i=e.sessions.map(e=>{let i=t.sessions.find(t=>t.id===e.id);if(!i||!Array.isArray(i.messages))return e;let a=Array.isArray(e.messages)?[...e.messages]:[],o=new Set;for(let e of a){let t=e&&typeof e==`object`&&`content`in e?String(e.content??``):``,r=n.exec(t);r?.[1]&&o.add(r[1]);let i=e&&typeof e==`object`&&`scheduleId`in e?String(e.scheduleId??``):``;i&&o.add(i)}let s=!1;for(let e of i.messages){let t=e&&typeof e==`object`&&`content`in e?String(e.content??``):``,r=n.exec(t);r?.[1]&&!o.has(r[1])&&(a.push(e),o.add(r[1]),s=!0)}return s?(r=!0,{...e,messages:a,updatedAt:Date.now()}):e});return r?{...e,sessions:i}:e}function O(e,t){let n=f({workspacePath:t?.workspacePath,access:t?.access});return{sessions:[n,...e.sessions],activeId:n.id}}function k(e,t,n){return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,workspacePath:n||void 0,updatedAt:Date.now()}:e)}}function A(e,t,n){let r=n.trim()||`未命名`;return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,title:r,updatedAt:Date.now()}:e)}}function j(e,t,n=!0){return{...e,sessions:e.sessions.map(e=>e.id===t?n&&e.archived?{...e,pinned:!0,archived:!1,updatedAt:Date.now()}:{...e,pinned:n,updatedAt:Date.now()}:e)}}function M(e,t){let n=e.sessions.filter(e=>e.id!==t);if(!n.length){let e=f();return{sessions:[e],activeId:e.id}}return{sessions:n,activeId:e.activeId===t?n.find(e=>!e.archived&&!e.deleted)?.id??n[0].id:e.activeId}}function N(e,t,n=!0){let r=e.sessions.map(e=>e.id===t?{...e,archived:n,deleted:!n&&e.deleted,pinned:!n&&e.pinned,updatedAt:Date.now()}:e),i=e.activeId;return n&&i===t&&(i=r.find(e=>!e.archived&&!e.deleted)?.id??r[0].id),{sessions:r,activeId:i}}function P(e,t){return{...e,sessions:e.sessions.map(e=>e.workspacePath===t?{...e,workspacePath:void 0,updatedAt:Date.now()}:e)}}function F(e){return!(e.archived||e.deleted||e.pinned||Array.isArray(e.messages)&&e.messages.length>0)}function I(e,t,n,r){let i=r?.touchUpdatedAt!==!1;return{...e,sessions:e.sessions.map(e=>{if(e.id!==t)return e;let a=r?.touchTitle&&(e.title===`新对话`||!e.title)||e.title===`新对话`?p(n):e.title;return{...e,messages:n.slice(-80),title:a,updatedAt:i?Date.now():e.updatedAt}})}}function L(e,t,n){return I(e,e.activeId,t,n)}function R(e){return Array.isArray(e)?e.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return t.role!==`assistant`||!Array.isArray(t.activitySteps)||!t.activitySteps.some(e=>e.status===`running`)?e:{...t,activitySteps:t.activitySteps.map(e=>e.status===`running`?{...e,status:`done`}:e)}}):e}function z(e){let t=!1,n=e.sessions.map(e=>{let n=R(e.messages);return n===e.messages?e:(t=!0,{...e,messages:n})});return t?{...e,sessions:n}:e}function B(e,t,n){return{...e,sessions:e.sessions.map(e=>{if(e.id!==t)return e;let r=[...Array.isArray(e.messages)?e.messages:[],n].slice(-80);return{...e,messages:r,updatedAt:Date.now()}})}}function V(e,t,n){return{...e,sessions:e.sessions.map(e=>e.id===t?{...e,...n,updatedAt:Date.now()}:e)}}function H(e,t){return V(e,e.activeId,t)}function U(e,t){return e.sessions.some(e=>e.id===t)?{...e,activeId:t}:e}function W(e){return[...e].sort((e,t)=>{let n=+!!e.pinned,r=+!!t.pinned;return n===r?t.updatedAt-e.updatedAt:r-n})}function G(){try{return localStorage.getItem(n(c))!==`0`}catch{return!0}}function K(e){try{localStorage.setItem(n(c),e?`1`:`0`)}catch{}}function q(t){let n=e();return n?`tb:session-handoff:${n}:${t}`:`tb:session-handoff:${t}`}function J(e){return e.replace(/\\/g,`/`).replace(/^\.\//,``).replace(/^\/+/,``)}function Y(e,t,n){return e.sessions.find(e=>{if(t===`cases`){let t=e.caseGen?.linkedCasePath;return!!(t&&J(t)===n)}let r=t===`prompts`?e.promptGen?.linkedPromptPath:e.knowledgeGen?.linkedKnowledgePath;return!!(r&&J(r)===n)})}async function X(e,n){await x().catch(()=>null),await t().catch(()=>null);let i=S(),a=J(n.path),o=Y(i,e,a);if(o||=(i=O(i,{access:r()}),await T(i),i.sessions.find(e=>e.id===i.activeId)),!o)throw Error(`无法创建或定位会话`);try{let e=i.sessions.find(e=>e.id===o.id)??o;sessionStorage.setItem(q(o.id),JSON.stringify({session:e}))}catch{}let s=new URLSearchParams({session:o.id,focusRoot:e,focusPath:a,attachRoot:e,attachPath:a,attachName:n.name});window.location.href=`/workbench/?${s.toString()}`}export{p as C,I as D,H as E,V as O,U as S,L as T,K as _,k as a,z as b,E as c,F as d,G as f,A as g,j as h,N as i,T as l,D as m,q as n,O as o,S as p,B as r,M as s,X as t,x as u,w as v,P as w,W as x,R as y};
@@ -1 +1 @@
1
- import{r as e,t,u as n}from"./app-config.DKMxjv3g.js";var r=[`内容库`,`生成能力`,`记忆与检索`,`待办与效率`,`项目管理`,`测试统计`,`仪表盘`,`开发工具`],i=[{id:`cases`,category:`内容库`,name:`用例管理`,description:`侧栏进入用例库:浏览、搜索、打开与删除用例。关闭后入口隐藏,「生成测试用例」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseGen`,category:`生成能力`,name:`生成测试用例`,description:`在工作台用「/」打开配置:选类型、模板与提示词后生成用例并写入用例库。需同时开启「用例管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`cases`},{id:`prompts`,category:`内容库`,name:`提示词管理`,description:`侧栏进入提示词库:浏览、搜索、打开与删除提示词,并维护当前空间的「默认提示词」。每个空间都需要,因此默认开启且不可关闭;「生成提示词」仍是独立开关。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,alwaysOn:!0},{id:`promptGen`,category:`生成能力`,name:`生成提示词`,description:`用「/」打开配置后对话生成提示词;质检通过后写入提示词库。需同时开启「提示词管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`prompts`},{id:`knowledgeLib`,category:`内容库`,name:`知识库管理`,description:`侧栏进入知识库:浏览、搜索、打开与删除文档。关闭后入口隐藏,「生成知识库」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledgeGen`,category:`生成能力`,name:`生成知识库`,description:`用「/」打开配置后对话生成规范、方法论或环境约定;质检通过后写入知识库。需同时开启「知识库管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`knowledgeLib`},{id:`requirements`,category:`内容库`,name:`需求文档库`,description:`侧栏进入需求文档库:浏览、搜索、上传与整理需求文档。关闭后入口隐藏;磁盘文件仍保留,生成用例时也不再引用。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`templates`,category:`内容库`,name:`测试模板库`,description:`侧栏进入测试模板库:浏览、上传与整理用例 / 报告模板。关闭后入口隐藏;磁盘文件仍保留,生成用例时不再选用模板。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledge`,category:`记忆与检索`,name:`知识库检索`,description:`工作台输入「@」引用知识库与模板文档;发送后由模型按需读取。关闭后 @ 只列工作区文件。`,version:`1.4.0`,requiresDev:!1,defaultEnabled:!1},{id:`memory`,category:`记忆与检索`,name:`会话记忆`,description:`五轨记忆(用户档案 / 全局事实 / 项目关键 / 项目日志 / 每日):待确认、归档与便签,在工作台「记忆」Tab 管理。`,version:`2.0.0`,requiresDev:!0,defaultEnabled:!1},{id:`todos`,category:`待办与效率`,name:`待办事项`,description:`侧栏进入待办事项:按状态 / 紧急程度筛选、行内改状态与手动维护;工作台会话也能通过工具直接记录与更新同一份待办。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`tasks`,category:`待办与效率`,name:`任务管理`,description:`侧栏进入任务列表:按任务池 / 进行中 / 已完成 / 已关闭 / 已取消跟踪任务,并汇总每个任务下关联待办的数量与完成进度。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`reports`,category:`待办与效率`,name:`工作汇报`,description:`打开后在工作台注入「工作汇报提示词」,并把这份提示词写进提示词管理,方便随时修改;关闭时只停用,提示词文件保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`projects`,category:`项目管理`,name:`项目列表`,description:`侧栏进入项目列表:进度 / 规划 / 归档三种状态的项目卡片,汇总每个项目下的迭代、需求与缺陷数量;支持搜索、归档与删除。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`iterations`,category:`项目管理`,name:`迭代管理`,description:`侧栏进入迭代管理:按项目维护迭代的开始 / 截止日期与状态,按日期流逝算进度并标出逾期。需同时开启「项目列表」。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`pmRequirements`,category:`项目管理`,name:`需求管理`,description:`侧栏进入需求管理:按项目 / 迭代维护需求编号、优先级、状态与验收标准;需求挂在项目下,可关联迭代。需同时开启「项目列表」。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`bugs`,category:`项目管理`,name:`缺陷管理`,description:`侧栏进入缺陷管理:按项目 / 迭代 / 需求记录缺陷,含严重程度、状态、重现步骤、期望与实际结果;关闭后入口隐藏,数据仍保留。需同时开启「项目列表」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`testStats`,category:`测试统计`,name:`测试统计`,description:`侧栏进入测试统计:按当前日期与测试统计维度(功能用例 / 自动化用例 / 接口用例 / 测试报告 / 缺陷统计等)记录统计数量,维度可搜索或直接创建。打开开关即在当前空间生成 测试统计/测试统计.json。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseExec`,category:`测试统计`,name:`用例执行统计`,description:`侧栏进入用例执行统计:按项目记录用例总数、待执行与已执行数量,自动计算当前剩余用例与执行比例;项目名称可搜索或直接创建。打开开关即在当前空间生成 用例执行统计/用例执行统计.json。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`dashboard`,category:`仪表盘`,name:`仪表盘`,description:`侧栏进入仪表盘:把当前空间的待办、任务、项目与测试统计聚合成一页(指标卡、倒计时、今日待办、进行中任务、测试统计柱状图、飞书式待办日历)。首次打开是空白画布,需在「编辑组件」里自行添加卡片;待办 / 任务为表格 + 分页。卡片摆在 12 列自由画布上,按住顶部圆点手柄拖位置、拖右下角把手改宽高,挡住相邻卡片时松手把它们挤开或让位;布局按空间记在浏览器本地。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`pluginDev`,category:`开发工具`,name:`插件开发`,description:`用固定提示词开发扩展插件:先评估形态与范围并用选项确认,确认后才改代码,完成后并入「扩展插件」。需要读写项目源码。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0}];function a(e=i){return r.map(t=>({category:t,items:e.filter(e=>e.category===t)})).filter(e=>e.items.length>0)}var o=`tw-plugins-changed`;function s(){let e={};for(let t of i)e[t.id]=t.defaultEnabled;return e}function c(e,t){let n={...e};if(t&&!m(t.id)?.alwaysOn){if(n[t.id]=t.enabled,t.enabled){let e=m(t.id)?.requires;e&&(n[e]=!0)}else for(let e of i)e.requires===t.id&&(n[e.id]=!1)}for(let e of i)e.alwaysOn&&(n[e.id]=!0);for(let e of i)e.requires&&!n[e.requires]&&(n[e.id]=!1);return n}function l(){let t=s(),n=e().plugins??{};for(let e of i)typeof n[e.id]==`boolean`&&(t[e.id]=n[e.id]);return c(t)}function u(e){return l()[e]}function d(e){let t=s();for(let n of i)typeof e[n.id]==`boolean`&&(t[n.id]=e[n.id]);return c(t)}function f(e,r){if(m(e)?.alwaysOn)return l();let i=c(l(),{id:e,enabled:r});return n({plugins:i}),t(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(o,{detail:i})),i}function p(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n??l())};return window.addEventListener(o,t),()=>{window.removeEventListener(o,t)}}function m(e){return i.find(t=>t.id===e)}function h(e){let t=m(e),n=t?.name??e;return t?.requires&&!u(t.requires)?`请先在「我的插件」中启用「${m(t.requires)?.name??t.requires}」`:`请先在「我的插件」中启用「${n}」`}export{p as a,f as c,l as i,a as n,h as o,u as r,d as s,i as t};
1
+ import{r as e,t,u as n}from"./app-config.BUPzGl9f.js";var r=[`内容库`,`生成能力`,`记忆与检索`,`待办与效率`,`项目管理`,`测试统计`,`仪表盘`,`开发工具`],i=[{id:`cases`,category:`内容库`,name:`用例管理`,description:`侧栏进入用例库:浏览、搜索、打开与删除用例。关闭后入口隐藏,「生成测试用例」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseGen`,category:`生成能力`,name:`生成测试用例`,description:`在工作台用「/」打开配置:选类型、模板与提示词后生成用例并写入用例库。需同时开启「用例管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`cases`},{id:`prompts`,category:`内容库`,name:`提示词管理`,description:`侧栏进入提示词库:浏览、搜索、打开与删除提示词,并维护当前空间的「默认提示词」。每个空间都需要,因此默认开启且不可关闭;「生成提示词」仍是独立开关。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!0,alwaysOn:!0},{id:`promptGen`,category:`生成能力`,name:`生成提示词`,description:`用「/」打开配置后对话生成提示词;质检通过后写入提示词库。需同时开启「提示词管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`prompts`},{id:`knowledgeLib`,category:`内容库`,name:`知识库管理`,description:`侧栏进入知识库:浏览、搜索、打开与删除文档。关闭后入口隐藏,「生成知识库」一并关闭;磁盘文件仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledgeGen`,category:`生成能力`,name:`生成知识库`,description:`用「/」打开配置后对话生成规范、方法论或环境约定;质检通过后写入知识库。需同时开启「知识库管理」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0,requires:`knowledgeLib`},{id:`requirements`,category:`内容库`,name:`需求文档库`,description:`侧栏进入需求文档库:浏览、搜索、上传与整理需求文档。关闭后入口隐藏;磁盘文件仍保留,生成用例时也不再引用。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`templates`,category:`内容库`,name:`测试模板库`,description:`侧栏进入测试模板库:浏览、上传与整理用例 / 报告模板。关闭后入口隐藏;磁盘文件仍保留,生成用例时不再选用模板。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`knowledge`,category:`记忆与检索`,name:`知识库检索`,description:`工作台输入「@」引用知识库与模板文档;发送后由模型按需读取。关闭后 @ 只列工作区文件。`,version:`1.4.0`,requiresDev:!1,defaultEnabled:!1},{id:`memory`,category:`记忆与检索`,name:`会话记忆`,description:`五轨记忆(用户档案 / 全局事实 / 项目关键 / 项目日志 / 每日):待确认、归档与便签,在工作台「记忆」Tab 管理。`,version:`2.0.0`,requiresDev:!0,defaultEnabled:!1},{id:`todos`,category:`待办与效率`,name:`待办事项`,description:`侧栏进入待办事项:按状态 / 紧急程度筛选、行内改状态与手动维护;工作台会话也能通过工具直接记录与更新同一份待办。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`tasks`,category:`待办与效率`,name:`任务管理`,description:`侧栏进入任务列表:按任务池 / 进行中 / 已完成 / 已关闭 / 已取消跟踪任务,并汇总每个任务下关联待办的数量与完成进度。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`reports`,category:`待办与效率`,name:`工作汇报`,description:`打开后在工作台注入「工作汇报提示词」,并把这份提示词写进提示词管理,方便随时修改;关闭时只停用,提示词文件保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`projects`,category:`项目管理`,name:`项目列表`,description:`侧栏进入项目列表:进度 / 规划 / 归档三种状态的项目卡片,汇总每个项目下的迭代、需求与缺陷数量;支持搜索、归档与删除。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`iterations`,category:`项目管理`,name:`迭代管理`,description:`侧栏进入迭代管理:按项目维护迭代的开始 / 截止日期与状态,按日期流逝算进度并标出逾期。需同时开启「项目列表」。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`pmRequirements`,category:`项目管理`,name:`需求管理`,description:`侧栏进入需求管理:按项目 / 迭代维护需求编号、优先级、状态与验收标准;需求挂在项目下,可关联迭代。需同时开启「项目列表」。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`bugs`,category:`项目管理`,name:`缺陷管理`,description:`侧栏进入缺陷管理:按项目 / 迭代 / 需求记录缺陷,含严重程度、状态、重现步骤、期望与实际结果;关闭后入口隐藏,数据仍保留。需同时开启「项目列表」。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,requires:`projects`},{id:`testStats`,category:`测试统计`,name:`测试统计`,description:`侧栏进入测试统计:按当前日期与测试统计维度(功能用例 / 自动化用例 / 接口用例 / 测试报告 / 缺陷统计等)记录统计数量,维度可搜索或直接创建。打开开关即在当前空间生成 测试统计/测试统计.json。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`caseExec`,category:`测试统计`,name:`用例执行统计`,description:`侧栏进入用例执行统计:按项目记录用例总数、待执行与已执行数量,自动计算当前剩余用例与执行比例;项目名称可搜索或直接创建。打开开关即在当前空间生成 用例执行统计/用例执行统计.json。关闭后入口隐藏,磁盘数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`uiAuto`,category:`测试统计`,name:`自动化测试`,description:`侧栏进入自动化测试:把已有的 Playwright / pytest / Selenium 项目挂进来(系统原生选目录,自动识别框架),一键运行 / 停止用例(先跑全量),实时看日志,查看 HTML 报告与结构化结果。执行的是目标项目自己的测试命令,不会自动安装依赖或联网。打开开关时在「提示词管理」生成「Playwright提示词.md」(已存在不覆盖,生成页优先用它,插件开启期间不可删除)。关闭后入口隐藏,项目记录与报告仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`dashboard`,category:`仪表盘`,name:`仪表盘`,description:`侧栏进入仪表盘:把当前空间的待办、任务、项目与测试统计聚合成一页(指标卡、倒计时、今日待办、进行中任务、测试统计柱状图、飞书式待办日历)。首次打开是空白画布,需在「编辑组件」里自行添加卡片;待办 / 任务为表格 + 分页。卡片摆在 12 列自由画布上,按住顶部圆点手柄拖位置、拖右下角把手改宽高,挡住相邻卡片时松手把它们挤开或让位;布局按空间记在浏览器本地。关闭后入口隐藏,数据仍保留。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1},{id:`pluginDev`,category:`开发工具`,name:`插件开发`,description:`用固定提示词开发扩展插件:先评估形态与范围并用选项确认,确认后才改代码,完成后并入「扩展插件」。需要读写项目源码。`,version:`0.1.0`,requiresDev:!0,defaultEnabled:!1,hasPanel:!0}];function a(e=i){return r.map(t=>({category:t,items:e.filter(e=>e.category===t)})).filter(e=>e.items.length>0)}var o=`tw-plugins-changed`;function s(){let e={};for(let t of i)e[t.id]=t.defaultEnabled;return e}function c(e,t){let n={...e};if(t&&!m(t.id)?.alwaysOn){if(n[t.id]=t.enabled,t.enabled){let e=m(t.id)?.requires;e&&(n[e]=!0)}else for(let e of i)e.requires===t.id&&(n[e.id]=!1)}for(let e of i)e.alwaysOn&&(n[e.id]=!0);for(let e of i)e.requires&&!n[e.requires]&&(n[e.id]=!1);return n}function l(){let t=s(),n=e().plugins??{};for(let e of i)typeof n[e.id]==`boolean`&&(t[e.id]=n[e.id]);return c(t)}function u(e){return l()[e]}function d(e){let t=s();for(let n of i)typeof e[n.id]==`boolean`&&(t[n.id]=e[n.id]);return c(t)}function f(e,r){if(m(e)?.alwaysOn)return l();let i=c(l(),{id:e,enabled:r});return n({plugins:i}),t(),typeof window<`u`&&window.dispatchEvent(new CustomEvent(o,{detail:i})),i}function p(e){if(typeof window>`u`)return()=>{};let t=t=>{let n=t.detail;e(n??l())};return window.addEventListener(o,t),()=>{window.removeEventListener(o,t)}}function m(e){return i.find(t=>t.id===e)}function h(e){let t=m(e),n=t?.name??e;return t?.requires&&!u(t.requires)?`请先在「我的插件」中启用「${m(t.requires)?.name??t.requires}」`:`请先在「我的插件」中启用「${n}」`}export{l as a,d as c,u as i,f as l,m as n,p as o,a as r,h as s,i as t};
@@ -1,4 +1,4 @@
1
- var e=`/__tb_pm`,t=[`planning`,`in_progress`,`archived`],n=[`planning`,`in_progress`,`done`],r=[`urgent`,`high`,`medium`,`low`],i=[`pending`,`todo`,`in_progress`,`testing`,`done`,`cancelled`],a=[`critical`,`major`,`minor`,`trivial`],o=[`pending`,`todo`,`fixed`,`verifying`,`passed`,`cancelled`],s={planning:`规划中`,in_progress:`进行中`,archived:`已归档`},c={planning:`规划中`,in_progress:`进行中`,done:`已完成`},l={urgent:`紧急`,high:`高`,medium:`中`,low:`低`},u={pending:`待评估`,todo:`待开发`,in_progress:`开发中`,testing:`测试中`,done:`已完成`,cancelled:`已取消`},d={critical:`致命`,major:`严重`,minor:`一般`,trivial:`轻微`},f={pending:`待确认`,todo:`待修复`,fixed:`修复完成`,verifying:`待验证`,passed:`验证通过`,cancelled:`已取消`},p={in_progress:`fixed`,closed:`passed`};function m(e){if(typeof e!=`string`)return``;let t=e.trim();return o.includes(t)?t:p[t]??``}function h(e){return e===`passed`||e===`cancelled`}var g=/^\d{4}-\d{2}-\d{2}$/;function _(e,t=2e3){return typeof e==`string`?e.trim().slice(0,t):``}function v(e){let t=_(e,10);return g.test(t)?t:``}function y(e,t,n){let r=_(e,40);return t.includes(r)?r:n}function b(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,50)){if(!n||typeof n!=`object`)continue;let e=_(n.text,500);e&&t.push({text:e,done:n.done===!0})}return t}function x(e){if(!e||typeof e!=`object`)return null;let n=e,r=_(n.name,200);if(!r)return null;let i=new Date().toISOString();return{id:_(n.id,64)||`pj_${Math.random().toString(16).slice(2,10)}`,name:r,description:_(n.description),status:y(n.status,t,`planning`),createdAt:_(n.createdAt,40)||i,updatedAt:_(n.updatedAt,40)||i}}function S(e){if(!e||typeof e!=`object`)return null;let t=e,r=_(t.name,200);if(!r)return null;let i=new Date().toISOString();return{id:_(t.id,64)||`it_${Math.random().toString(16).slice(2,10)}`,projectId:_(t.projectId,64),name:r,startDate:v(t.startDate),endDate:v(t.endDate),status:y(t.status,n,`planning`),remark:_(t.remark),createdAt:_(t.createdAt,40)||i,updatedAt:_(t.updatedAt,40)||i}}function C(e){if(!e||typeof e!=`object`)return null;let t=e,n=_(t.title,2e3);if(!n)return null;let a=new Date().toISOString();return{id:_(t.id,64)||`rq_${Math.random().toString(16).slice(2,10)}`,autoId:_(t.autoId,20),projectId:_(t.projectId,64),iterationId:_(t.iterationId,64),title:n,priority:y(t.priority,r,`medium`),status:y(t.status,i,`pending`),description:_(t.description),acceptanceCriteria:b(t.acceptanceCriteria),githubIssue:_(t.githubIssue,50),attachment:_(t.attachment),createdAt:_(t.createdAt,40)||a,updatedAt:_(t.updatedAt,40)||a}}function w(e){if(!e||typeof e!=`object`)return null;let t=e,n=_(t.title,200);if(!n)return null;let r=new Date().toISOString();return{id:_(t.id,64)||`bg_${Math.random().toString(16).slice(2,10)}`,autoId:_(t.autoId,20),projectId:_(t.projectId,64),iterationId:_(t.iterationId,64),requirementId:_(t.requirementId,64),title:n,severity:y(t.severity,a,`minor`),status:m(t.status)||`pending`,reproduceSteps:_(t.reproduceSteps),expectedResult:_(t.expectedResult),actualResult:_(t.actualResult),environment:_(t.environment,500),githubIssue:_(t.githubIssue,50),attachment:_(t.attachment),remark:_(t.remark),createdAt:_(t.createdAt,40)||r,updatedAt:_(t.updatedAt,40)||r}}function T(e,t){return Array.isArray(e)?e.map(t).filter(e=>!!e):[]}function E(){return{projects:[],iterations:[],requirements:[],bugs:[]}}function D(e){if(!e||typeof e!=`object`)return E();let t=e;return{projects:T(t.projects,x),iterations:T(t.iterations,S),requirements:T(t.requirements,C),bugs:T(t.bugs,w)}}async function O(t,n){let r=await fetch(e,{method:t,headers:n===void 0?void 0:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw Error(i.error||`HTTP ${r.status}`);return i}async function k(){try{return(await fetch(`${e}?health=1`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}async function A(){return D(await O(`GET`))}async function j(){await A()}function M(e,t){return e===`projects`?x(t):e===`iterations`?S(t):e===`requirements`?C(t):w(t)}async function N(e,t,n){let r=await O(`POST`,{entity:e,items:t,...n});return(Array.isArray(r.items)?r.items:[]).map(t=>M(e,t)).filter(e=>!!e)}async function P(e,t,n){let r=M(e,(await O(`PUT`,{entity:e,id:t,...n})).item);if(!r)throw Error(`更新记录失败`);return r}async function F(e,t){let n=await O(`DELETE`,{entity:e,ids:t});return{removed:Number(n.removed??0),cascaded:Number(n.cascaded??0)}}function I(e){let[t,n,r]=e.split(`-`).map(Number);return Date.UTC(t,(n??1)-1,r??1)}function L(e,t){return!g.test(e)||!g.test(t)?null:Math.round((I(t)-I(e))/864e5)}function R(e=new Date){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function z(e,t=R()){let n=L(e.startDate,e.endDate);if(n===null)return 0;let r=n+1,i=L(e.startDate,t);return i===null?0:Math.min(100,Math.max(0,Math.round((i+1)/r*100)))}function B(e,t=R()){if(e.status===`done`)return null;let n=L(e.endDate,t);return n===null?null:n>0?n:null}function V(e){let t={};for(let n of e.projects)t[n.id]={iterations:0,requirements:0,requirementsDone:0,bugs:0,bugsClosed:0,requirementPercent:0,bugClosedPercent:100};for(let n of e.iterations){let e=t[n.projectId];e&&(e.iterations+=1)}for(let n of e.requirements){let e=t[n.projectId];e&&(e.requirements+=1,n.status===`done`&&(e.requirementsDone+=1))}for(let n of e.bugs){let e=t[n.projectId];e&&(e.bugs+=1,h(n.status)&&(e.bugsClosed+=1))}for(let e of Object.values(t))e.requirementPercent=e.requirements?Math.round(e.requirementsDone/e.requirements*100):0,e.bugClosedPercent=e.bugs?Math.round(e.bugsClosed/e.bugs*100):100;return t}function H(e,t={}){let n=t.status??`all`,r=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.status!==n||r&&!`${e.name} ${e.description}`.toLowerCase().includes(r)))}function U(e,t={}){let n=t.projectId??`all`,r=t.status??`all`,i=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.status!==r||i&&!`${e.name} ${e.remark}`.toLowerCase().includes(i)))}function W(e,t={}){let n=t.projectId??`all`,r=t.iterationId??`all`,i=t.status??`all`,a=t.priority??`all`,o=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.iterationId!==r||i!==`all`&&e.status!==i||a!==`all`&&e.priority!==a||o&&!`${e.autoId} ${e.title} ${e.description}`.toLowerCase().includes(o)))}function G(e,t={}){let n=t.projectId??`all`,r=t.iterationId??`all`,i=t.status??`all`,a=t.severity??`all`,o=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.iterationId!==r||i!==`all`&&e.status!==i||a!==`all`&&e.severity!==a||o&&!`${e.autoId} ${e.title} ${e.reproduceSteps}`.toLowerCase().includes(o)))}function K(e,t){let n=t.trim();if(!n)return``;let r=e.find(e=>e.name===n);if(r)return r.id;let i=n.toLowerCase();return e.find(e=>e.name.toLowerCase()===i)?.id??``}function q(e,t){let n=t.trim();if(!n)return``;let r=n.toLowerCase();return e.find(e=>e.title===n)?.id??e.find(e=>e.title.toLowerCase()===r)?.id??e.find(e=>e.autoId.toLowerCase()===r)?.id??``}function J(e){let t=e.split(`
2
- `).map(e=>e.trim()).find(Boolean);return t?Array.from(t).slice(0,60).join(``):``}function Y(e){return e.split(`
3
- `).map(e=>e.trim()).filter(Boolean).map(e=>({url:e,name:Q(e)}))}function X(e){return e.map(e=>e.url).join(`
4
- `)}function Z(e){try{let t=new URL(e,`http://localhost`).searchParams.get(`p`)??``;return/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(decodeURIComponent(t))}catch{return!1}}function Q(e){try{let t=new URL(e,`http://localhost`),n=t.searchParams.get(`p`),r=n?decodeURIComponent(n):t.pathname;return(r.split(`/`).filter(Boolean).pop()??r).replace(/^\d{10,}-[a-z0-9]+-/,``)}catch{return e}}function $(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode(...t.subarray(e,e+n));return btoa(r)}async function ee(e){if(!e.length)return[];let t=await O(`POST`,{upload:await Promise.all(e.map(async e=>({name:e.name||`attachment`,type:e.type||`application/octet-stream`,data:$(await e.arrayBuffer())})))});return(Array.isArray(t.files)?t.files:[]).map(e=>{let t=e,n=typeof t.url==`string`?t.url:``;return n?{url:n,name:typeof t.name==`string`&&t.name?t.name:Q(n)}:null}).filter(e=>!!e)}async function te(e,t=``){let n=e.filter(Boolean);if(n.length)try{await O(`POST`,t?{cleanup:n,bugId:t}:{cleanup:n})}catch{}}export{Y as A,W as C,B as D,Z as E,ee as F,j as M,R as N,z as O,P,H as S,q as T,E as _,n as a,G as b,s as c,i as d,u as f,F as g,N as h,f as i,V as j,X as k,r as l,te as m,d as n,c as o,J as p,o as r,t as s,a as t,l as u,k as v,K as w,U as x,A as y};
1
+ var e=`/__tb_pm`,t=[`planning`,`in_progress`,`archived`],n=[`planning`,`in_progress`,`done`],r=[`urgent`,`high`,`medium`,`low`],i=[`pending`,`todo`,`in_progress`,`testing`,`done`,`cancelled`],a=[`critical`,`major`,`minor`,`trivial`],o=[`pending`,`todo`,`fixed`,`verifying`,`passed`,`cancelled`],s={planning:`规划中`,in_progress:`进行中`,archived:`已归档`},c={planning:`规划中`,in_progress:`进行中`,done:`已完成`},l={urgent:`紧急`,high:`高`,medium:`中`,low:`低`},u={pending:`待评估`,todo:`待开发`,in_progress:`开发中`,testing:`测试中`,done:`已完成`,cancelled:`已取消`},d={critical:`致命`,major:`严重`,minor:`一般`,trivial:`轻微`},f={pending:`待确认`,todo:`待修复`,fixed:`修复完成`,verifying:`待验证`,passed:`验证通过`,cancelled:`已取消`},p={in_progress:`fixed`,closed:`passed`};function m(e){if(typeof e!=`string`)return``;let t=e.trim();return o.includes(t)?t:p[t]??``}function h(e){return e===`passed`||e===`cancelled`}var g=/^\d{4}-\d{2}-\d{2}$/;function _(e,t=2e3){return typeof e==`string`?e.trim().slice(0,t):``}function v(e){let t=_(e,10);return g.test(t)?t:``}function y(e,t,n){let r=_(e,40);return t.includes(r)?r:n}function b(e){if(!Array.isArray(e))return[];let t=[];for(let n of e.slice(0,50)){if(!n||typeof n!=`object`)continue;let e=_(n.text,500);e&&t.push({text:e,done:n.done===!0})}return t}function x(e){if(!e||typeof e!=`object`)return null;let n=e,r=_(n.name,200);if(!r)return null;let i=new Date().toISOString();return{id:_(n.id,64)||`pj_${Math.random().toString(16).slice(2,10)}`,name:r,description:_(n.description),status:y(n.status,t,`planning`),createdAt:_(n.createdAt,40)||i,updatedAt:_(n.updatedAt,40)||i}}function S(e){if(!e||typeof e!=`object`)return null;let t=e,r=_(t.name,200);if(!r)return null;let i=new Date().toISOString();return{id:_(t.id,64)||`it_${Math.random().toString(16).slice(2,10)}`,projectId:_(t.projectId,64),name:r,startDate:v(t.startDate),endDate:v(t.endDate),status:y(t.status,n,`planning`),remark:_(t.remark),createdAt:_(t.createdAt,40)||i,updatedAt:_(t.updatedAt,40)||i}}function C(e){if(!e||typeof e!=`object`)return null;let t=e,n=_(t.title,2e3);if(!n)return null;let a=new Date().toISOString();return{id:_(t.id,64)||`rq_${Math.random().toString(16).slice(2,10)}`,autoId:_(t.autoId,20),projectId:_(t.projectId,64),iterationId:_(t.iterationId,64),title:n,priority:y(t.priority,r,`medium`),status:y(t.status,i,`pending`),description:_(t.description),acceptanceCriteria:b(t.acceptanceCriteria),githubIssue:_(t.githubIssue,50),attachment:_(t.attachment),createdAt:_(t.createdAt,40)||a,updatedAt:_(t.updatedAt,40)||a}}function w(e){if(!e||typeof e!=`object`)return null;let t=e,n=_(t.title,200);if(!n)return null;let r=new Date().toISOString();return{id:_(t.id,64)||`bg_${Math.random().toString(16).slice(2,10)}`,autoId:_(t.autoId,20),projectId:_(t.projectId,64),iterationId:_(t.iterationId,64),requirementId:_(t.requirementId,64),title:n,severity:y(t.severity,a,`minor`),status:m(t.status)||`pending`,reproduceSteps:_(t.reproduceSteps),expectedResult:_(t.expectedResult),actualResult:_(t.actualResult),environment:_(t.environment,500),githubIssue:_(t.githubIssue,50),attachment:_(t.attachment),remark:_(t.remark),createdAt:_(t.createdAt,40)||r,updatedAt:_(t.updatedAt,40)||r}}function T(e,t){return Array.isArray(e)?e.map(t).filter(e=>!!e):[]}function E(){return{projects:[],iterations:[],requirements:[],bugs:[]}}function D(e){if(!e||typeof e!=`object`)return E();let t=e;return{projects:T(t.projects,x),iterations:T(t.iterations,S),requirements:T(t.requirements,C),bugs:T(t.bugs,w)}}async function O(t,n){let r=await fetch(e,{method:t,headers:n===void 0?void 0:{"Content-Type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw Error(i.error||`HTTP ${r.status}`);return i}async function k(){try{return(await fetch(`${e}?health=1`,{signal:AbortSignal.timeout(1500)})).ok}catch{return!1}}async function A(){return D(await O(`GET`))}async function j(){await A()}function M(e,t){return e===`projects`?x(t):e===`iterations`?S(t):e===`requirements`?C(t):w(t)}async function N(e,t,n){let r=await O(`POST`,{entity:e,items:t,...n});return(Array.isArray(r.items)?r.items:[]).map(t=>M(e,t)).filter(e=>!!e)}async function P(e,t,n){let r=M(e,(await O(`PUT`,{entity:e,id:t,...n})).item);if(!r)throw Error(`更新记录失败`);return r}async function F(e,t){let n=await O(`DELETE`,{entity:e,ids:t});return{removed:Number(n.removed??0),cascaded:Number(n.cascaded??0)}}function I(e){let[t,n,r]=e.split(`-`).map(Number);return Date.UTC(t,(n??1)-1,r??1)}function L(e,t){return!g.test(e)||!g.test(t)?null:Math.round((I(t)-I(e))/864e5)}function R(e=new Date){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function z(e,t=R()){let n=L(e.startDate,e.endDate);if(n===null)return 0;let r=n+1,i=L(e.startDate,t);return i===null?0:Math.min(100,Math.max(0,Math.round((i+1)/r*100)))}function B(e,t=R()){if(e.status===`done`)return null;let n=L(e.endDate,t);return n===null?null:n>0?n:null}function ee(e){let t={};for(let n of e.projects)t[n.id]={iterations:0,requirements:0,requirementsDone:0,bugs:0,bugsClosed:0,requirementPercent:0,bugClosedPercent:100};for(let n of e.iterations){let e=t[n.projectId];e&&(e.iterations+=1)}for(let n of e.requirements){let e=t[n.projectId];e&&(e.requirements+=1,n.status===`done`&&(e.requirementsDone+=1))}for(let n of e.bugs){let e=t[n.projectId];e&&(e.bugs+=1,h(n.status)&&(e.bugsClosed+=1))}for(let e of Object.values(t))e.requirementPercent=e.requirements?Math.round(e.requirementsDone/e.requirements*100):0,e.bugClosedPercent=e.bugs?Math.round(e.bugsClosed/e.bugs*100):100;return t}function V(e,t={}){let n=t.status??`all`,r=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.status!==n||r&&!`${e.name} ${e.description}`.toLowerCase().includes(r)))}function H(e,t={}){let n=t.projectId??`all`,r=t.status??`all`,i=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.status!==r||i&&!`${e.name} ${e.remark}`.toLowerCase().includes(i)))}function U(e,t={}){let n=t.projectId??`all`,r=t.iterationId??`all`,i=t.status??`all`,a=t.priority??`all`,o=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.iterationId!==r||i!==`all`&&e.status!==i||a!==`all`&&e.priority!==a||o&&!`${e.autoId} ${e.title} ${e.description}`.toLowerCase().includes(o)))}function W(e){return[...e].sort((e,t)=>{let n=e.startDate||``,r=t.startDate||``;if(n!==r)return r.localeCompare(n);let i=Date.parse(e.createdAt)||0,a=Date.parse(t.createdAt)||0;return i===a?e.name.localeCompare(t.name,`zh-Hans-CN`,{numeric:!0}):a-i})}function G(e){return[...e].sort((e,t)=>{let n=Date.parse(e.createdAt)||0,r=Date.parse(t.createdAt)||0;return n===r?t.autoId.localeCompare(e.autoId,`zh-Hans-CN`,{numeric:!0}):r-n})}function K(e,t={}){let n=t.projectId??`all`,r=t.iterationId??`all`,i=t.status??`all`,a=t.severity??`all`,o=(t.keyword??``).trim().toLowerCase();return e.filter(e=>!(n!==`all`&&e.projectId!==n||r!==`all`&&e.iterationId!==r||i!==`all`&&e.status!==i||a!==`all`&&e.severity!==a||o&&!`${e.autoId} ${e.title} ${e.reproduceSteps}`.toLowerCase().includes(o)))}function q(e,t){let n=t.trim();if(!n)return``;let r=e.find(e=>e.name===n);if(r)return r.id;let i=n.toLowerCase();return e.find(e=>e.name.toLowerCase()===i)?.id??``}function J(e,t){let n=t.trim();if(!n)return``;let r=n.toLowerCase();return e.find(e=>e.title===n)?.id??e.find(e=>e.title.toLowerCase()===r)?.id??e.find(e=>e.autoId.toLowerCase()===r)?.id??``}function Y(e){let t=e.split(`
2
+ `).map(e=>e.trim()).find(Boolean);return t?Array.from(t).slice(0,60).join(``):``}function X(e){return e.split(`
3
+ `).map(e=>e.trim()).filter(Boolean).map(e=>({url:e,name:$(e)}))}function Z(e){return e.map(e=>e.url).join(`
4
+ `)}function Q(e){try{let t=new URL(e,`http://localhost`).searchParams.get(`p`)??``;return/\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(decodeURIComponent(t))}catch{return!1}}function $(e){try{let t=new URL(e,`http://localhost`),n=t.searchParams.get(`p`),r=n?decodeURIComponent(n):t.pathname;return(r.split(`/`).filter(Boolean).pop()??r).replace(/^\d{10,}-[a-z0-9]+-/,``)}catch{return e}}function te(e){let t=new Uint8Array(e),n=32768,r=``;for(let e=0;e<t.length;e+=n)r+=String.fromCharCode(...t.subarray(e,e+n));return btoa(r)}async function ne(e){if(!e.length)return[];let t=await O(`POST`,{upload:await Promise.all(e.map(async e=>({name:e.name||`attachment`,type:e.type||`application/octet-stream`,data:te(await e.arrayBuffer())})))});return(Array.isArray(t.files)?t.files:[]).map(e=>{let t=e,n=typeof t.url==`string`?t.url:``;return n?{url:n,name:typeof t.name==`string`&&t.name?t.name:$(n)}:null}).filter(e=>!!e)}async function re(e,t=``){let n=e.filter(Boolean);if(n.length)try{await O(`POST`,t?{cleanup:n,bugId:t}:{cleanup:n})}catch{}}export{X as A,U as C,B as D,Q as E,R as F,P as I,ne as L,G as M,W as N,z as O,j as P,V as S,J as T,E as _,n as a,K as b,s as c,i as d,u as f,F as g,N as h,f as i,ee as j,Z as k,r as l,re as m,d as n,c as o,Y as p,o as r,t as s,a as t,l as u,k as v,q as w,H as x,A as y};
@@ -1,5 +1,5 @@
1
- import{c as e,n as t,r as n,t as r}from"./react-dom.CqAxpHMt.js";var i=e(t(),1),a=Object.defineProperty,o=(e,t,n)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,s=(e,t,n)=>(o(e,typeof t==`symbol`?t:t+``,n),n),c=new class{constructor(){s(this,`current`,this.detect()),s(this,`handoffState`,`pending`),s(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}};function l(e){return c.isServer?null:e==null?document:e?.ownerDocument??document}function u(e){return c.isServer?null:e==null?document:(e?.getRootNode)?.call(e)??document}function d(e){return u(e)?.activeElement??null}function f(e){return d(e)===e}function p(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function m(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return p(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=m();return e(t),this.add(()=>t.dispose())},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function h(){let[e]=(0,i.useState)(m);return(0,i.useEffect)(()=>()=>e.dispose(),[e]),e}var g=(e,t)=>{c.isServer?(0,i.useEffect)(e,t):(0,i.useLayoutEffect)(e,t)};function _(e){let t=(0,i.useRef)(e);return g(()=>{t.current=e},[e]),t}var v=function(e){let t=_(e);return i.useCallback((...e)=>t.current(...e),[t])};function ee(e){return(0,i.useMemo)(()=>e,Object.values(e))}var te=(0,i.createContext)(void 0);function ne(){return(0,i.useContext)(te)}function y(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}function b(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,b),r}var re=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(re||{}),ie=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(ie||{});function x(){let e=oe();return(0,i.useCallback)(t=>ae({mergeRefs:e,...t}),[e])}function ae({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=se;let c=ce(t,e);if(a)return S(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return S(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return b(+!e,{0(){return null},1(){return S({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return S(c,n,r,o,s)}function S(e,t={},n,r,a){let{as:o=n,children:s,refName:c=`ref`,...l}=T(e,[`unmount`,`static`]),u=e.ref===void 0?{}:{[c]:e.ref},d=typeof s==`function`?s(t):s;d=de(d),`className`in l&&l.className&&typeof l.className==`function`&&(l.className=l.className(t)),l[`aria-labelledby`]&&l[`aria-labelledby`]===l.id&&(l[`aria-labelledby`]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){f[`data-headlessui-state`]=n.join(` `);for(let e of n)f[`data-${e}`]=``}}if(E(o)&&(Object.keys(w(l)).length>0||Object.keys(w(f)).length>0)){if(!(0,i.isValidElement)(d)||Array.isArray(d)&&d.length>1||fe(d)){if(Object.keys(w(l)).length>0)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(w(l)).concat(Object.keys(w(f))).map(e=>` - ${e}`).join(`
1
+ import{n as e,s as t,t as n}from"./react.Blvh0GOs.js";import{t as r}from"./react-dom.DLW9pGCF.js";var i=t(n(),1),a=Object.defineProperty,o=(e,t,n)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,s=(e,t,n)=>(o(e,typeof t==`symbol`?t:t+``,n),n),c=new class{constructor(){s(this,`current`,this.detect()),s(this,`handoffState`,`pending`),s(this,`currentId`,0)}set(e){this.current!==e&&(this.handoffState=`pending`,this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current===`server`}get isClient(){return this.current===`client`}detect(){return typeof window>`u`||typeof document>`u`?`server`:`client`}handoff(){this.handoffState===`pending`&&(this.handoffState=`complete`)}get isHandoffComplete(){return this.handoffState===`complete`}};function l(e){return c.isServer?null:e==null?document:e?.ownerDocument??document}function u(e){return c.isServer?null:e==null?document:(e?.getRootNode)?.call(e)??document}function d(e){return u(e)?.activeElement??null}function f(e){return d(e)===e}function p(e){typeof queueMicrotask==`function`?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function m(){let e=[],t={addEventListener(e,n,r,i){return e.addEventListener(n,r,i),t.add(()=>e.removeEventListener(n,r,i))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...e){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...e))},setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return p(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=m();return e(t),this.add(()=>t.dispose())},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function h(){let[e]=(0,i.useState)(m);return(0,i.useEffect)(()=>()=>e.dispose(),[e]),e}var g=(e,t)=>{c.isServer?(0,i.useEffect)(e,t):(0,i.useLayoutEffect)(e,t)};function _(e){let t=(0,i.useRef)(e);return g(()=>{t.current=e},[e]),t}var v=function(e){let t=_(e);return i.useCallback((...e)=>t.current(...e),[t])};function ee(e){return(0,i.useMemo)(()=>e,Object.values(e))}var te=(0,i.createContext)(void 0);function ne(){return(0,i.useContext)(te)}function y(...e){return Array.from(new Set(e.flatMap(e=>typeof e==`string`?e.split(` `):[]))).filter(Boolean).join(` `)}function b(e,t,...n){if(e in t){let r=t[e];return typeof r==`function`?r(...n):r}let r=Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(`, `)}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,b),r}var re=(e=>(e[e.None=0]=`None`,e[e.RenderStrategy=1]=`RenderStrategy`,e[e.Static=2]=`Static`,e))(re||{}),ie=(e=>(e[e.Unmount=0]=`Unmount`,e[e.Hidden=1]=`Hidden`,e))(ie||{});function x(){let e=oe();return(0,i.useCallback)(t=>ae({mergeRefs:e,...t}),[e])}function ae({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:a=!0,name:o,mergeRefs:s}){s??=se;let c=ce(t,e);if(a)return S(c,n,r,o,s);let l=i??0;if(l&2){let{static:e=!1,...t}=c;if(e)return S(t,n,r,o,s)}if(l&1){let{unmount:e=!0,...t}=c;return b(+!e,{0(){return null},1(){return S({...t,hidden:!0,style:{display:`none`}},n,r,o,s)}})}return S(c,n,r,o,s)}function S(e,t={},n,r,a){let{as:o=n,children:s,refName:c=`ref`,...l}=T(e,[`unmount`,`static`]),u=e.ref===void 0?{}:{[c]:e.ref},d=typeof s==`function`?s(t):s;d=de(d),`className`in l&&l.className&&typeof l.className==`function`&&(l.className=l.className(t)),l[`aria-labelledby`]&&l[`aria-labelledby`]===l.id&&(l[`aria-labelledby`]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))typeof i==`boolean`&&(e=!0),i===!0&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){f[`data-headlessui-state`]=n.join(` `);for(let e of n)f[`data-${e}`]=``}}if(E(o)&&(Object.keys(w(l)).length>0||Object.keys(w(f)).length>0)){if(!(0,i.isValidElement)(d)||Array.isArray(d)&&d.length>1||fe(d)){if(Object.keys(w(l)).length>0)throw Error([`Passing props on "Fragment"!`,``,`The current component <${r} /> is rendering a "Fragment".`,`However we need to passthrough the following props:`,Object.keys(w(l)).concat(Object.keys(w(f))).map(e=>` - ${e}`).join(`
2
2
  `),``,`You can apply a few solutions:`,['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',`Render a single element as the child so that we can forward the props onto that element.`].map(e=>` - ${e}`).join(`
3
3
  `)].join(`
4
- `))}else{let e=d.props?.className,t=typeof e==`function`?(...t)=>y(e(...t),l.className):y(e,l.className),n=t?{className:t}:{},r=ce(d.props,w(T(l,[`ref`])));for(let e in f)e in r&&delete f[e];return(0,i.cloneElement)(d,Object.assign({},r,f,u,{ref:a(ue(d),u.ref)},n))}}return(0,i.createElement)(o,Object.assign({},T(l,[`ref`]),!E(o)&&u,!E(o)&&f),d)}function oe(){let e=(0,i.useRef)([]),t=(0,i.useCallback)(t=>{for(let n of e.current)n!=null&&(typeof n==`function`?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>e==null))return e.current=n,t}}function se(...e){return e.every(e=>e==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n==`function`?n(t):n.current=t)}}function ce(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>(e?.preventDefault)?.call(e)]);for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function le(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)e?.(...t)}});return t}function C(e){return Object.assign((0,i.forwardRef)(e),{displayName:e.displayName??e.name})}function w(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function T(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function ue(e){return`19.3.0`.split(`.`)[0]>=`19`?e.props.ref:e.ref}function de(e){if(e!=null&&e.$$typeof===Symbol.for(`react.lazy`)){let t=e._payload;if(t!=null&&t.status===`fulfilled`)return de(t.value)}return e}function E(e){return e===i.Fragment||e===Symbol.for(`react.fragment`)}function fe(e){return E(e.type)}var pe=`span`,me=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(me||{});function he(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4||void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return x()({ourProps:i,theirProps:r,slot:{},defaultTag:pe,name:`Hidden`})}var ge=C(he);function _e(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function D(e){return _e(e)&&`tagName`in e}function O(e){return D(e)&&`accessKey`in e}function k(e){return D(e)&&`tabIndex`in e}function ve(e){return D(e)&&`style`in e}function ye(e){return O(e)&&e.nodeName===`IFRAME`}function be(e){return O(e)&&e.nodeName===`INPUT`}function xe(e){return O(e)&&e.nodeName===`LABEL`}function Se(e){return O(e)&&e.nodeName===`FIELDSET`}function Ce(e){return O(e)&&e.nodeName===`LEGEND`}function we(e){return D(e)?e.matches(`a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]`):!1}var A=Symbol();function Te(e,t=!0){return Object.assign(e,{[A]:t})}function j(...e){let t=(0,i.useRef)(e);(0,i.useEffect)(()=>{t.current=e},[e]);let n=v(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[A])?void 0:n}var M=(0,i.createContext)(null);M.displayName=`DescriptionContext`;function N(){let e=(0,i.useContext)(M);if(e===null){let e=Error(`You used a <Description /> component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,N),e}return e}function Ee(){return(0,i.useContext)(M)?.value??void 0}function De(){let[e,t]=(0,i.useState)([]);return[e.length>0?e.join(` `):void 0,(0,i.useMemo)(()=>function(e){let n=v(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),r=(0,i.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return i.createElement(M.Provider,{value:r},e.children)},[t])]}var Oe=`p`;function ke(e,t){let n=(0,i.useId)(),r=ne(),{id:a=`headlessui-description-${n}`,...o}=e,s=N(),c=j(t);g(()=>s.register(a),[a,s.register]);let l=ee({...s.slot,disabled:r||!1}),u={ref:c,...s.props,id:a};return x()({ourProps:u,theirProps:o,slot:l,defaultTag:Oe,name:s.name||`Description`})}var Ae=C(ke),je=Object.assign(Ae,{}),P=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(P||{}),F=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}},Me=Object.defineProperty,Ne=(e,t,n)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pe=(e,t,n)=>(Ne(e,typeof t==`symbol`?t:t+``,n),n),Fe=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},I=(e,t,n)=>(Fe(e,t,`read from private field`),n?n.call(e):t.get(e)),L=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Ie=(e,t,n,r)=>(Fe(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),R,z,B,Le=class{constructor(e){L(this,R,{}),L(this,z,new F(()=>new Set)),L(this,B,new Set),Pe(this,`disposables`,m()),Ie(this,R,e),c.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return I(this,R)}subscribe(e,t){if(c.isServer)return()=>{};let n={selector:e,callback:t,current:e(I(this,R))};return I(this,B).add(n),this.disposables.add(()=>{I(this,B).delete(n)})}on(e,t){return c.isServer?()=>{}:(I(this,z).get(e).add(t),this.disposables.add(()=>{I(this,z).get(e).delete(t)}))}send(e){let t=this.reduce(I(this,R),e);if(t!==I(this,R)){Ie(this,R,t);for(let e of I(this,B)){let t=e.selector(I(this,R));Re(e.current,t)||(e.current=t,e.callback(t))}for(let t of I(this,z).get(e.type))t(I(this,R),e)}}};R=new WeakMap,z=new WeakMap,B=new WeakMap;function Re(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&V(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&V(e.entries(),t.entries()):ze(e)&&ze(t)?V(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function V(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(1)}function ze(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Be(e){let[t,n]=e(),r=m();return(...e)=>{t(...e),r.dispose(),r.microTask(n)}}var Ve=Object.defineProperty,He=(e,t,n)=>t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ue=(e,t,n)=>(He(e,typeof t==`symbol`?t:t+``,n),n),We=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(We||{}),Ge={0(e,t){let n=t.id,r=e.stack,i=e.stack.indexOf(n);if(i!==-1){let t=e.stack.slice();return t.splice(i,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let i=e.stack.slice();return i.splice(r,1),{...e,stack:i}}},Ke=class e extends Le{constructor(){super(...arguments),Ue(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),Ue(this,`selectors`,{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return b(t.type,Ge,e,t)}},qe=new F(()=>Ke.new()),Je=n((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=n.useRef,s=n.useEffect,c=n.useMemo,l=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ye=n(((e,t)=>{t.exports=Je()}))();function Xe(e,t,n=Re){return(0,Ye.useSyncExternalStoreWithSelector)(v(t=>e.subscribe(Ze,t)),v(()=>e.state),v(()=>e.state),v(t),n)}function Ze(e){return e}function H(e,t){let n=(0,i.useId)(),r=qe.get(t),[a,o]=Xe(r,(0,i.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return g(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?!o||a:!1}var U=new Map,W=new Map;function Qe(e){let t=W.get(e)??0;return W.set(e,t+1),t===0&&(U.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0),()=>$e(e)}function $e(e){let t=W.get(e)??1;if(t===1?W.delete(e):W.set(e,t-1),t!==1)return;let n=U.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,U.delete(e))}function et(e,{allowed:t,disallowed:n}={}){let r=H(e,`inert-others`);g(()=>{if(!r)return;let e=m();for(let t of n?.()??[])t&&e.add(Qe(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=l(t);if(!n)continue;let r=t.parentElement;for(;r&&r!==n.body;){for(let t of r.children)i.some(e=>t.contains(e))||e.add(Qe(t));r=r.parentElement}}return e.dispose},[r,t,n])}function tt(e,t,n){let r=_(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,i.useEffect)(()=>{if(!e)return;let n=t===null?null:O(t)?t:t.current;if(!n)return;let i=m();if(typeof ResizeObserver<`u`){let e=new ResizeObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}if(typeof IntersectionObserver<`u`){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}return()=>i.dispose()},[t,r,e])}var G=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),nt=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),K=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(K||{}),rt=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(rt||{}),it=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(it||{});function at(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(G)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function ot(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(nt)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var q=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(q||{});function J(e,t=0){return e!==l(e)?.body&&b(t,{0(){return e.matches(G)},1(){let t=e;for(;t!==null;){if(t.matches(G))return!0;t=t.parentElement}return!1}})}function st(e){m().nextFrame(()=>{let t=d(e);t&&k(t)&&!J(t,0)&&lt(e)})}var ct=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(ct||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0));function lt(e){e?.focus({preventScroll:!0})}var ut=[`textarea`,`input`].join(`,`);function dt(e){return(e?.matches)?.call(e,ut)??!1}function ft(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function pt(e,t,n=e===null?document.body:u(e)){return mt(at(n),t,{relativeTo:e})}function mt(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?u(e[0]):document:u(e),o=Array.isArray(e)?n?ft(e):e:t&64?ot(e):at(e);i.length>0&&o.length>1&&(o=o.filter(e=>!i.some(t=>t!=null&&`current`in t?t?.current===e:t===e))),r??=a?.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),l=t&32?{preventScroll:!0}:{},f=0,p=o.length,m;do{if(f>=p||f+p<=0)return 0;let e=c+f;if(t&16)e=(e+p)%p;else{if(e<0)return 3;if(e>=p)return 1}m=o[e],m?.focus(l),f+=s}while(m!==d(m));return t&6&&dt(m)&&m.select(),2}function ht(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function gt(){return/Android/gi.test(window.navigator.userAgent)}function Y(){return ht()||gt()}function X(e,t,n,r){let a=_(n);(0,i.useEffect)(()=>{if(!e)return;function n(e){a.current(e)}return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r)},[e,t,r])}function _t(e,t,n,r){let a=_(n);(0,i.useEffect)(()=>{if(!e)return;function n(e){a.current(e)}return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r)},[e,t,r])}var vt=30;function yt(e,t,n){let r=_(n),a=(0,i.useCallback)(function(e,n){if(e.defaultPrevented)return;let i=n(e);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let a=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of a)if(t!==null&&(t.contains(i)||e.composed&&e.composedPath().includes(t)))return;return!J(i,q.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),o=(0,i.useRef)(null);X(e,`pointerdown`,e=>{Y()||(o.current=e.composedPath?.call(e)?.[0]||e.target)},!0),X(e,`pointerup`,e=>{if(Y()||!o.current)return;let t=o.current;return o.current=null,a(e,()=>t)},!0);let s=(0,i.useRef)({x:0,y:0});X(e,`touchstart`,e=>{s.current.x=e.touches[0].clientX,s.current.y=e.touches[0].clientY},!0),X(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-s.current.x)>=vt||Math.abs(t.y-s.current.y)>=vt))return a(e,()=>k(e.target)?e.target:null)},!0),_t(e,`blur`,e=>a(e,()=>ye(window.document.activeElement)?window.document.activeElement:null),!0)}var bt=e(r(),1);function xt(...e){return(0,i.useMemo)(()=>l(...e),[...e])}function St(e){return(0,i.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ct(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(e){return r.add(e),()=>r.delete(e)},dispatch(e,...i){let a=t[e].call(n,...i);a&&(n=a,r.forEach(e=>e()))}}}function wt(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,`paddingRight`,`${a}px`)}}}function Tt(){return ht()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!==`auto`){let n=m();n.style(e.documentElement,`scrollBehavior`,`auto`),t.add(()=>t.microTask(()=>n.dispose()))}let n=window.scrollY??window.pageYOffset,i=null;t.addEventListener(e,`click`,t=>{if(k(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);k(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),k(e.target)&&ve(e.target)){if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,`overscrollBehavior`,`contain`)}else n.style(e.target,`touchAction`,`none`)}})}),t.addEventListener(e,`touchmove`,e=>{if(k(e.target)){if(be(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.headlessuiPortal!==``&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.headlessuiPortal===``&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{let e=window.scrollY??window.pageYOffset;n!==e&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function Et(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function Dt(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var Z=Ct(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:m(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=Dt(n.meta),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=Dt(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[Tt(),wt(),Et()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Z.subscribe(()=>{let e=Z.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e=t.get(n.doc)===`hidden`,r=n.count!==0;(r&&!e||!r&&e)&&Z.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&Z.dispatch(`TEARDOWN`,n)}});function Ot(e,t,n=()=>({containers:[]})){let r=St(Z),i=t?r.get(t):void 0,a=i?i.count>0:!1;return g(()=>{if(t&&e)return Z.dispatch(`PUSH`,t,n),()=>Z.dispatch(`POP`,t,n)},[e,t]),a}function kt(e,t,n=()=>[document.body]){Ot(H(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function At(e=0){let[t,n]=(0,i.useState)(e);return{flags:t,setFlag:(0,i.useCallback)(e=>n(e),[]),addFlag:(0,i.useCallback)(e=>n(t=>t|e),[]),hasFlag:(0,i.useCallback)(e=>(t&e)===e,[t]),removeFlag:(0,i.useCallback)(e=>n(t=>t&~e),[]),toggleFlag:(0,i.useCallback)(e=>n(t=>t^e),[])}}typeof process<`u`&&typeof globalThis<`u`&&typeof Element<`u`&&(process==null?void 0:{})?.NODE_ENV===`test`&&(Element==null?void 0:Element.prototype)?.getAnimations===void 0&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.",``,`Example usage:`,"```js",`import { mockAnimationsApi } from 'jsdom-testing-mocks'`,`mockAnimationsApi()`,"```"].join(`
4
+ `))}else{let e=d.props?.className,t=typeof e==`function`?(...t)=>y(e(...t),l.className):y(e,l.className),n=t?{className:t}:{},r=ce(d.props,w(T(l,[`ref`])));for(let e in f)e in r&&delete f[e];return(0,i.cloneElement)(d,Object.assign({},r,f,u,{ref:a(ue(d),u.ref)},n))}}return(0,i.createElement)(o,Object.assign({},T(l,[`ref`]),!E(o)&&u,!E(o)&&f),d)}function oe(){let e=(0,i.useRef)([]),t=(0,i.useCallback)(t=>{for(let n of e.current)n!=null&&(typeof n==`function`?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>e==null))return e.current=n,t}}function se(...e){return e.every(e=>e==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n==`function`?n(t):n.current=t)}}function ce(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t[`aria-disabled`])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>(e?.preventDefault)?.call(e)]);for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||t?.nativeEvent instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function le(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith(`on`)&&typeof r[e]==`function`?(n[e]??(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)e?.(...t)}});return t}function C(e){return Object.assign((0,i.forwardRef)(e),{displayName:e.displayName??e.name})}function w(e){let t=Object.assign({},e);for(let e in t)t[e]===void 0&&delete t[e];return t}function T(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function ue(e){return`19.3.0`.split(`.`)[0]>=`19`?e.props.ref:e.ref}function de(e){if(e!=null&&e.$$typeof===Symbol.for(`react.lazy`)){let t=e._payload;if(t!=null&&t.status===`fulfilled`)return de(t.value)}return e}function E(e){return e===i.Fragment||e===Symbol.for(`react.fragment`)}function fe(e){return E(e.type)}var pe=`span`,me=(e=>(e[e.None=1]=`None`,e[e.Focusable=2]=`Focusable`,e[e.Hidden=4]=`Hidden`,e))(me||{});function he(e,t){let{features:n=1,...r}=e,i={ref:t,"aria-hidden":(n&2)==2?!0:r[`aria-hidden`]??void 0,hidden:(n&4)==4||void 0,style:{position:`fixed`,top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`,...(n&4)==4&&(n&2)!=2&&{display:`none`}}};return x()({ourProps:i,theirProps:r,slot:{},defaultTag:pe,name:`Hidden`})}var ge=C(he);function _e(e){return typeof e!=`object`||!e?!1:`nodeType`in e}function D(e){return _e(e)&&`tagName`in e}function O(e){return D(e)&&`accessKey`in e}function k(e){return D(e)&&`tabIndex`in e}function ve(e){return D(e)&&`style`in e}function ye(e){return O(e)&&e.nodeName===`IFRAME`}function be(e){return O(e)&&e.nodeName===`INPUT`}function xe(e){return O(e)&&e.nodeName===`LABEL`}function Se(e){return O(e)&&e.nodeName===`FIELDSET`}function Ce(e){return O(e)&&e.nodeName===`LEGEND`}function we(e){return D(e)?e.matches(`a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]`):!1}var A=Symbol();function Te(e,t=!0){return Object.assign(e,{[A]:t})}function j(...e){let t=(0,i.useRef)(e);(0,i.useEffect)(()=>{t.current=e},[e]);let n=v(e=>{for(let n of t.current)n!=null&&(typeof n==`function`?n(e):n.current=e)});return e.every(e=>e==null||e?.[A])?void 0:n}var M=(0,i.createContext)(null);M.displayName=`DescriptionContext`;function N(){let e=(0,i.useContext)(M);if(e===null){let e=Error(`You used a <Description /> component, but it is not inside a relevant parent.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,N),e}return e}function Ee(){return(0,i.useContext)(M)?.value??void 0}function De(){let[e,t]=(0,i.useState)([]);return[e.length>0?e.join(` `):void 0,(0,i.useMemo)(()=>function(e){let n=v(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}))),r=(0,i.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return i.createElement(M.Provider,{value:r},e.children)},[t])]}var Oe=`p`;function ke(e,t){let n=(0,i.useId)(),r=ne(),{id:a=`headlessui-description-${n}`,...o}=e,s=N(),c=j(t);g(()=>s.register(a),[a,s.register]);let l=ee({...s.slot,disabled:r||!1}),u={ref:c,...s.props,id:a};return x()({ourProps:u,theirProps:o,slot:l,defaultTag:Oe,name:s.name||`Description`})}var Ae=C(ke),je=Object.assign(Ae,{}),P=(e=>(e.Space=` `,e.Enter=`Enter`,e.Escape=`Escape`,e.Backspace=`Backspace`,e.Delete=`Delete`,e.ArrowLeft=`ArrowLeft`,e.ArrowUp=`ArrowUp`,e.ArrowRight=`ArrowRight`,e.ArrowDown=`ArrowDown`,e.Home=`Home`,e.End=`End`,e.PageUp=`PageUp`,e.PageDown=`PageDown`,e.Tab=`Tab`,e))(P||{}),F=class extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e),this.set(e,t)),t}},Me=Object.defineProperty,Ne=(e,t,n)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pe=(e,t,n)=>(Ne(e,typeof t==`symbol`?t:t+``,n),n),Fe=(e,t,n)=>{if(!t.has(e))throw TypeError(`Cannot `+n)},I=(e,t,n)=>(Fe(e,t,`read from private field`),n?n.call(e):t.get(e)),L=(e,t,n)=>{if(t.has(e))throw TypeError(`Cannot add the same private member more than once`);t instanceof WeakSet?t.add(e):t.set(e,n)},Ie=(e,t,n,r)=>(Fe(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),R,z,B,Le=class{constructor(e){L(this,R,{}),L(this,z,new F(()=>new Set)),L(this,B,new Set),Pe(this,`disposables`,m()),Ie(this,R,e),c.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return I(this,R)}subscribe(e,t){if(c.isServer)return()=>{};let n={selector:e,callback:t,current:e(I(this,R))};return I(this,B).add(n),this.disposables.add(()=>{I(this,B).delete(n)})}on(e,t){return c.isServer?()=>{}:(I(this,z).get(e).add(t),this.disposables.add(()=>{I(this,z).get(e).delete(t)}))}send(e){let t=this.reduce(I(this,R),e);if(t!==I(this,R)){Ie(this,R,t);for(let e of I(this,B)){let t=e.selector(I(this,R));Re(e.current,t)||(e.current=t,e.callback(t))}for(let t of I(this,z).get(e.type))t(I(this,R),e)}}};R=new WeakMap,z=new WeakMap,B=new WeakMap;function Re(e,t){return Object.is(e,t)?!0:typeof e!=`object`||!e||typeof t!=`object`||!t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&V(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&V(e.entries(),t.entries()):ze(e)&&ze(t)?V(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function V(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(1)}function ze(e){if(Object.prototype.toString.call(e)!==`[object Object]`)return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function Be(e){let[t,n]=e(),r=m();return(...e)=>{t(...e),r.dispose(),r.microTask(n)}}var Ve=Object.defineProperty,He=(e,t,n)=>t in e?Ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ue=(e,t,n)=>(He(e,typeof t==`symbol`?t:t+``,n),n),We=(e=>(e[e.Push=0]=`Push`,e[e.Pop=1]=`Pop`,e))(We||{}),Ge={0(e,t){let n=t.id,r=e.stack,i=e.stack.indexOf(n);if(i!==-1){let t=e.stack.slice();return t.splice(i,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let i=e.stack.slice();return i.splice(r,1),{...e,stack:i}}},Ke=class e extends Le{constructor(){super(...arguments),Ue(this,`actions`,{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),Ue(this,`selectors`,{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new e({stack:[]})}reduce(e,t){return b(t.type,Ge,e,t)}},qe=new F(()=>Ke.new()),Je=e((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Ye=e(((e,t)=>{t.exports=Je()}))();function Xe(e,t,n=Re){return(0,Ye.useSyncExternalStoreWithSelector)(v(t=>e.subscribe(Ze,t)),v(()=>e.state),v(()=>e.state),v(t),n)}function Ze(e){return e}function H(e,t){let n=(0,i.useId)(),r=qe.get(t),[a,o]=Xe(r,(0,i.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return g(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?!o||a:!1}var U=new Map,W=new Map;function Qe(e){let t=W.get(e)??0;return W.set(e,t+1),t===0&&(U.set(e,{"aria-hidden":e.getAttribute(`aria-hidden`),inert:e.inert}),e.setAttribute(`aria-hidden`,`true`),e.inert=!0),()=>$e(e)}function $e(e){let t=W.get(e)??1;if(t===1?W.delete(e):W.set(e,t-1),t!==1)return;let n=U.get(e);n&&(n[`aria-hidden`]===null?e.removeAttribute(`aria-hidden`):e.setAttribute(`aria-hidden`,n[`aria-hidden`]),e.inert=n.inert,U.delete(e))}function et(e,{allowed:t,disallowed:n}={}){let r=H(e,`inert-others`);g(()=>{if(!r)return;let e=m();for(let t of n?.()??[])t&&e.add(Qe(t));let i=t?.()??[];for(let t of i){if(!t)continue;let n=l(t);if(!n)continue;let r=t.parentElement;for(;r&&r!==n.body;){for(let t of r.children)i.some(e=>t.contains(e))||e.add(Qe(t));r=r.parentElement}}return e.dispose},[r,t,n])}function tt(e,t,n){let r=_(e=>{let t=e.getBoundingClientRect();t.x===0&&t.y===0&&t.width===0&&t.height===0&&n()});(0,i.useEffect)(()=>{if(!e)return;let n=t===null?null:O(t)?t:t.current;if(!n)return;let i=m();if(typeof ResizeObserver<`u`){let e=new ResizeObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}if(typeof IntersectionObserver<`u`){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),i.add(()=>e.disconnect())}return()=>i.dispose()},[t,r,e])}var G=[`[contentEditable=true]`,`[tabindex]`,`a[href]`,`area[href]`,`button:not([disabled])`,`iframe`,`input:not([disabled])`,`select:not([disabled])`,`details>summary`,`textarea:not([disabled])`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),nt=[`[data-autofocus]`].map(e=>`${e}:not([tabindex='-1'])`).join(`,`),K=(e=>(e[e.First=1]=`First`,e[e.Previous=2]=`Previous`,e[e.Next=4]=`Next`,e[e.Last=8]=`Last`,e[e.WrapAround=16]=`WrapAround`,e[e.NoScroll=32]=`NoScroll`,e[e.AutoFocus=64]=`AutoFocus`,e))(K||{}),rt=(e=>(e[e.Error=0]=`Error`,e[e.Overflow=1]=`Overflow`,e[e.Success=2]=`Success`,e[e.Underflow=3]=`Underflow`,e))(rt||{}),it=(e=>(e[e.Previous=-1]=`Previous`,e[e.Next=1]=`Next`,e))(it||{});function at(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(G)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}function ot(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(nt)).sort((e,t)=>Math.sign((e.tabIndex||2**53-1)-(t.tabIndex||2**53-1)))}var q=(e=>(e[e.Strict=0]=`Strict`,e[e.Loose=1]=`Loose`,e))(q||{});function J(e,t=0){return e!==l(e)?.body&&b(t,{0(){return e.matches(G)},1(){let t=e;for(;t!==null;){if(t.matches(G))return!0;t=t.parentElement}return!1}})}function st(e){m().nextFrame(()=>{let t=d(e);t&&k(t)&&!J(t,0)&&lt(e)})}var ct=(e=>(e[e.Keyboard=0]=`Keyboard`,e[e.Mouse=1]=`Mouse`,e))(ct||{});typeof window<`u`&&typeof document<`u`&&(document.addEventListener(`keydown`,e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible=``)},!0),document.addEventListener(`click`,e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible=``)},!0));function lt(e){e?.focus({preventScroll:!0})}var ut=[`textarea`,`input`].join(`,`);function dt(e){return(e?.matches)?.call(e,ut)??!1}function ft(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),i=t(n);if(r===null||i===null)return 0;let a=r.compareDocumentPosition(i);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function pt(e,t,n=e===null?document.body:u(e)){return mt(at(n),t,{relativeTo:e})}function mt(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?u(e[0]):document:u(e),o=Array.isArray(e)?n?ft(e):e:t&64?ot(e):at(e);i.length>0&&o.length>1&&(o=o.filter(e=>!i.some(t=>t!=null&&`current`in t?t?.current===e:t===e))),r??=a?.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),c=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(r))-1;if(t&4)return Math.max(0,o.indexOf(r))+1;if(t&8)return o.length-1;throw Error(`Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last`)})(),l=t&32?{preventScroll:!0}:{},f=0,p=o.length,m;do{if(f>=p||f+p<=0)return 0;let e=c+f;if(t&16)e=(e+p)%p;else{if(e<0)return 3;if(e>=p)return 1}m=o[e],m?.focus(l),f+=s}while(m!==d(m));return t&6&&dt(m)&&m.select(),2}function ht(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function gt(){return/Android/gi.test(window.navigator.userAgent)}function Y(){return ht()||gt()}function X(e,t,n,r){let a=_(n);(0,i.useEffect)(()=>{if(!e)return;function n(e){a.current(e)}return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r)},[e,t,r])}function _t(e,t,n,r){let a=_(n);(0,i.useEffect)(()=>{if(!e)return;function n(e){a.current(e)}return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r)},[e,t,r])}var vt=30;function yt(e,t,n){let r=_(n),a=(0,i.useCallback)(function(e,n){if(e.defaultPrevented)return;let i=n(e);if(i===null||!i.getRootNode().contains(i)||!i.isConnected)return;let a=function e(t){return typeof t==`function`?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of a)if(t!==null&&(t.contains(i)||e.composed&&e.composedPath().includes(t)))return;return!J(i,q.Loose)&&i.tabIndex!==-1&&e.preventDefault(),r.current(e,i)},[r,t]),o=(0,i.useRef)(null);X(e,`pointerdown`,e=>{Y()||(o.current=e.composedPath?.call(e)?.[0]||e.target)},!0),X(e,`pointerup`,e=>{if(Y()||!o.current)return;let t=o.current;return o.current=null,a(e,()=>t)},!0);let s=(0,i.useRef)({x:0,y:0});X(e,`touchstart`,e=>{s.current.x=e.touches[0].clientX,s.current.y=e.touches[0].clientY},!0),X(e,`touchend`,e=>{let t={x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY};if(!(Math.abs(t.x-s.current.x)>=vt||Math.abs(t.y-s.current.y)>=vt))return a(e,()=>k(e.target)?e.target:null)},!0),_t(e,`blur`,e=>a(e,()=>ye(window.document.activeElement)?window.document.activeElement:null),!0)}var bt=t(r(),1);function xt(...e){return(0,i.useMemo)(()=>l(...e),[...e])}function St(e){return(0,i.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ct(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(e){return r.add(e),()=>r.delete(e)},dispatch(e,...i){let a=t[e].call(n,...i);a&&(n=a,r.forEach(e=>e()))}}}function wt(){let e;return{before({doc:t}){let n=t.documentElement,r=t.defaultView??window;e=Math.max(0,r.innerWidth-n.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),a=Math.max(0,e-i);n.style(r,`paddingRight`,`${a}px`)}}}function Tt(){return ht()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!==`auto`){let n=m();n.style(e.documentElement,`scrollBehavior`,`auto`),t.add(()=>t.microTask(()=>n.dispose()))}let n=window.scrollY??window.pageYOffset,i=null;t.addEventListener(e,`click`,t=>{if(k(t.target))try{let n=t.target.closest(`a`);if(!n)return;let{hash:a}=new URL(n.href),o=e.querySelector(a);k(o)&&!r(o)&&(i=o)}catch{}},!0),t.group(n=>{t.addEventListener(e,`touchstart`,e=>{if(n.dispose(),k(e.target)&&ve(e.target)){if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,`overscrollBehavior`,`contain`)}else n.style(e.target,`touchAction`,`none`)}})}),t.addEventListener(e,`touchmove`,e=>{if(k(e.target)){if(be(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.headlessuiPortal!==``&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.headlessuiPortal===``&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{let e=window.scrollY??window.pageYOffset;n!==e&&window.scrollTo(0,n),i&&i.isConnected&&(i.scrollIntoView({block:`nearest`}),i=null)})})}}:{}}function Et(){return{before({doc:e,d:t}){t.style(e.documentElement,`overflow`,`hidden`)}}}function Dt(e){let t={};for(let n of e)Object.assign(t,n(t));return t}var Z=Ct(()=>new Map,{PUSH(e,t){let n=this.get(e)??{doc:e,count:0,d:m(),meta:new Set,computedMeta:{}};return n.count++,n.meta.add(t),n.computedMeta=Dt(n.meta),this.set(e,n),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=Dt(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta(){return e.computedMeta}},n=[Tt(),wt(),Et()];n.forEach(({before:e})=>e?.(t)),n.forEach(({after:e})=>e?.(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Z.subscribe(()=>{let e=Z.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e=t.get(n.doc)===`hidden`,r=n.count!==0;(r&&!e||!r&&e)&&Z.dispatch(n.count>0?`SCROLL_PREVENT`:`SCROLL_ALLOW`,n),n.count===0&&Z.dispatch(`TEARDOWN`,n)}});function Ot(e,t,n=()=>({containers:[]})){let r=St(Z),i=t?r.get(t):void 0,a=i?i.count>0:!1;return g(()=>{if(t&&e)return Z.dispatch(`PUSH`,t,n),()=>Z.dispatch(`POP`,t,n)},[e,t]),a}function kt(e,t,n=()=>[document.body]){Ot(H(e,`scroll-lock`),t,e=>({containers:[...e.containers??[],n]}))}function At(e=0){let[t,n]=(0,i.useState)(e);return{flags:t,setFlag:(0,i.useCallback)(e=>n(e),[]),addFlag:(0,i.useCallback)(e=>n(t=>t|e),[]),hasFlag:(0,i.useCallback)(e=>(t&e)===e,[t]),removeFlag:(0,i.useCallback)(e=>n(t=>t&~e),[]),toggleFlag:(0,i.useCallback)(e=>n(t=>t^e),[])}}typeof process<`u`&&typeof globalThis<`u`&&typeof Element<`u`&&(process==null?void 0:{})?.NODE_ENV===`test`&&(Element==null?void 0:Element.prototype)?.getAnimations===void 0&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.",``,`Example usage:`,"```js",`import { mockAnimationsApi } from 'jsdom-testing-mocks'`,`mockAnimationsApi()`,"```"].join(`
5
5
  `)),[]});var jt=(e=>(e[e.None=0]=`None`,e[e.Closed=1]=`Closed`,e[e.Enter=2]=`Enter`,e[e.Leave=4]=`Leave`,e))(jt||{});function Mt(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]=``);return t}function Nt(e,t,n,r){let[a,o]=(0,i.useState)(n),{hasFlag:s,addFlag:c,removeFlag:l}=At(e&&a?3:0),u=(0,i.useRef)(!1),d=(0,i.useRef)(!1);return g(()=>{var i;if(e){if(n&&o(!0),!t){n&&c(3);return}return(i=r?.start)==null||i.call(r,n),Pt(t,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(c(3),l(4)):(c(4),l(2)))},run(){d.current?n?(l(3),c(4)):(l(4),c(3)):n?l(1):c(1)},done(){var e;d.current&&Lt(t)||(u.current=!1,l(7),n||o(!1),(e=r?.end)==null||e.call(r,n))}})}},[e,n,t,h()]),e?[a,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Pt(e,{prepare:t,run:n,done:r,inFlight:i}){let a=m();return It(e,{prepare:t,inFlight:i}),a.nextFrame(()=>{n(),a.requestAnimationFrame(()=>{a.add(Ft(e,r))})}),a.dispose}function Ft(e,t){let n=m();if(!e)return n.dispose;let r=!1;n.add(()=>{r=!0});let i=e.getAnimations?.call(e).filter(e=>e instanceof CSSTransition)??[];return i.length===0?(t(),n.dispose):(Promise.allSettled(i.map(e=>e.finished)).then(()=>{r||t()}),n.dispose)}function It(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition=`none`,n(),e.offsetHeight,e.style.transition=r}function Lt(e){return(e.getAnimations?.call(e)??[]).some(e=>e instanceof CSSTransition&&e.playState!==`finished`)}var Q=(0,i.createContext)(null);Q.displayName=`OpenClosedContext`;var Rt=(e=>(e[e.Open=1]=`Open`,e[e.Closed=2]=`Closed`,e[e.Closing=4]=`Closing`,e[e.Opening=8]=`Opening`,e))(Rt||{});function zt(){return(0,i.useContext)(Q)}function Bt({value:e,children:t}){return i.createElement(Q.Provider,{value:e},t)}function Vt({children:e}){return i.createElement(Q.Provider,{value:null},e)}function Ht(e){let t=v(e),n=(0,i.useRef)(!1);(0,i.useEffect)(()=>(n.current=!1,()=>{n.current=!0,p(()=>{n.current&&t()})}),[t])}function Ut(){let e=typeof document>`u`;return`useSyncExternalStore`in i&&(e=>e.useSyncExternalStore)(i)(()=>()=>{},()=>!1,()=>!e)}function Wt(){let e=Ut(),[t,n]=i.useState(c.isHandoffComplete);return t&&c.isHandoffComplete===!1&&n(!1),i.useEffect(()=>{t!==!0&&n(!0)},[t]),i.useEffect(()=>c.handoff(),[]),!e&&t}var Gt=(0,i.createContext)(!1);function Kt(){return(0,i.useContext)(Gt)}function qt(e){return i.createElement(Gt.Provider,{value:e.force},e.children)}function Jt(e){let t=Kt(),n=(0,i.useContext)($t),[r,a]=(0,i.useState)(()=>{if(!t&&n!==null)return n.current??null;if(c.isServer)return null;let r=e?.getElementById(`headlessui-portal-root`);if(r)return r;if(e===null)return null;let i=e.createElement(`div`);return i.setAttribute(`id`,`headlessui-portal-root`),e.body.appendChild(i)});return(0,i.useEffect)(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),(0,i.useEffect)(()=>{t||n!==null&&a(n.current)},[n,a,t]),r}var Yt=i.Fragment,Xt=C(function(e,t){let{ownerDocument:n=null,...r}=e,a=(0,i.useRef)(null),o=j(Te(e=>{a.current=e}),t),s=xt(a.current),c=Jt(n??s),l=(0,i.useContext)($),u=h(),d=Wt(),f=x();return Ht(()=>{var e;c&&c.childNodes.length<=0&&((e=c.parentElement)==null||e.removeChild(c))}),!c||!d?null:(0,bt.createPortal)(i.createElement(`div`,{"data-headlessui-portal":``,ref:e=>{u.dispose(),l&&e&&u.add(l.register(e))}},f({ourProps:{ref:o},theirProps:r,slot:{},defaultTag:Yt,name:`Portal`})),c)});function Zt(e,t){let n=j(t),{enabled:r=!0,ownerDocument:a,...o}=e,s=x();return r?i.createElement(Xt,{...o,ownerDocument:a,ref:n}):s({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Yt,name:`Portal`})}var Qt=i.Fragment,$t=(0,i.createContext)(null);function en(e,t){let{target:n,...r}=e,a={ref:j(t)},o=x();return i.createElement($t.Provider,{value:n},o({ourProps:a,theirProps:r,defaultTag:Qt,name:`Popover.Group`}))}var $=(0,i.createContext)(null);function tn(){let e=(0,i.useContext)($),t=(0,i.useRef)([]),n=v(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=v(n=>{let r=t.current.indexOf(n);r!==-1&&t.current.splice(r,1),e&&e.unregister(n)}),a=(0,i.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,i.useMemo)(()=>function({children:e}){return i.createElement($.Provider,{value:a},e)},[a])]}var nn=C(Zt),rn=C(en),an=Object.assign(nn,{Group:rn});export{i as $,et as A,Ee as B,q as C,mt as D,K as E,Le as F,k as G,Ce as H,Be as I,O as J,be as K,P as L,Xe as M,We as N,lt as O,qe as P,me as Q,De as R,J as S,pt as T,we as U,j as V,Se as W,D as X,_e as Y,ge as Z,X as _,f as _t,Wt as a,E as at,G as b,Rt as c,y as ct,Nt as d,v as dt,re as et,Mt as f,_ as ft,_t as g,p as gt,yt as h,m as ht,qt as i,C as it,H as j,tt as k,Vt as l,ne as lt,xt as m,h as mt,an as n,x as nt,Ht as o,w as ot,kt as p,g as pt,xe as q,tn as r,le as rt,Bt as s,b as st,rn as t,ie as tt,zt as u,ee as ut,Y as v,l as vt,st as w,ft as x,rt as y,je as z};
@@ -0,0 +1,2 @@
1
+ var e=`默认提示词.md`,t=[`空间提示词.md`,`空间默认提示词.md`,`系统提示词.md`,`AI工作台系统提示词.md`],n=`你是 Lantern Harness 的 AI 助手,协助思考、写作、分析、编程与日常工作。
2
+ `,r={"工作汇报提示词.md":`reports`,"Playwright提示词.md":`uiAuto`},i=new Set([e,...t]);function a(e){let t=e.split(`/`).pop()??e;return i.has(t)}function o(e){return r[e.split(`/`).pop()??e]}function s(e,t){let n=o(e);return n&&t?t[n]===!0:!1}function c(e,t){return a(e)||s(e,t)}function l(e){return(e||``).replace(/\\/g,`/`).replace(/^\.\//,``).trim()}function u(e,t){return t?!!t[l(e)]:!1}function d(e,t){let n=e.split(`/`).pop()??e;return a(n)?`system`:o(n)||(t?t[l(e)]??``:``)}function f(e,t){if(a(e))return`默认提示词不可删除`;let n=o(e);return n&&t?.[n]?`插件开启中,这份提示词由插件自带并维护;先在「我的插件」里关闭对应插件再删除`:``}function p(e){return a(e.split(`/`).pop()??e)}export{c as a,l as c,o as d,s as i,f as l,n,u as o,p as r,a as s,e as t,d as u};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./react.Blvh0GOs.js";var n=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return l(e,t,null,n)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.0`})),r=e(((e,t)=>{function r(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()}));export{r as t};