@inkeep/open-knowledge 0.61.2 → 0.61.3

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 (137) hide show
  1. package/dist/{acp-harness-probe-Bc-CWfz4.mjs → acp-harness-probe-t1lJvQ4a.mjs} +2 -2
  2. package/dist/cli.mjs +11 -11
  3. package/dist/constants-D3GZn-dk.mjs +2 -0
  4. package/dist/{fs-traced-1KTQL4h-.mjs → fs-traced-2B_-YK-g.mjs} +6 -6
  5. package/dist/fs-traced-DjggEXdh.mjs +1 -0
  6. package/dist/{git-handle-BnzI58ud.mjs → git-handle-CdQzaja5.mjs} +2 -2
  7. package/dist/git-handle-Clxj9fr-.mjs +1 -0
  8. package/dist/index.mjs +161 -161
  9. package/dist/{init-DDW2aJXW.mjs → init-5SqrHOkp.mjs} +3 -3
  10. package/dist/init-C7HKweMR.mjs +1 -0
  11. package/dist/{launch-json-removal-J6AggXic.mjs → launch-json-removal-DM5PCMXP.mjs} +2 -2
  12. package/dist/{loader-D_NNhPbU.mjs → loader-DsWNpxDe.mjs} +2 -2
  13. package/dist/loader-Osy-rk3T.mjs +1 -0
  14. package/dist/md-manager-DbxE4WzN.mjs +2 -0
  15. package/dist/{open-browser-CB0sbYH4.mjs → open-browser-xN9OlX1t.mjs} +2 -2
  16. package/dist/parse-worker.mjs +1 -1
  17. package/dist/preview-DAuizf4r.mjs +1 -0
  18. package/dist/{preview-46yeY8SC.mjs → preview-DMJ3NAED.mjs} +2 -2
  19. package/dist/public/assets/{ActivityModeContent-rkVFPeGI.js → ActivityModeContent-Cn-W_Pc9.js} +1 -1
  20. package/dist/public/assets/{AgentDiffPane-UM3yi_Jj.js → AgentDiffPane-fqyn3qqK.js} +1 -1
  21. package/dist/public/assets/{AgentThreadClientBinder-DbKx5B2j.js → AgentThreadClientBinder-BUL6vwPz.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-SvCCpq_g.js → CodeMirrorPropInput-ZXKkJFOY.js} +1 -1
  23. package/dist/public/assets/{DocumentContext-BrlDlUx7.js → DocumentContext-CuOcLr_j.js} +7 -7
  24. package/dist/public/assets/{EditorModeToggle-Coj-pKbp.js → EditorModeToggle-rmR5bMw6.js} +1 -1
  25. package/dist/public/assets/{EnableSyncConfirmDialog-CMQPWKxH.js → EnableSyncConfirmDialog-IKFvLJ0s.js} +1 -1
  26. package/dist/public/assets/{ExcalidrawDocEditor-Ct_C78n1.js → ExcalidrawDocEditor-DUdD1MdF.js} +1 -1
  27. package/dist/public/assets/FeedbackForm-DzgyNjac.js +1 -0
  28. package/dist/public/assets/{GraphPanel-C4IPsveQ.js → GraphPanel-BdYMWZaF.js} +1 -1
  29. package/dist/public/assets/{ImportSkillDialog-BUIlH24A.js → ImportSkillDialog-Cf9s-UGN.js} +1 -1
  30. package/dist/public/assets/{LintConfigEditor-Q1gGaOab.js → LintConfigEditor-DkncZJhY.js} +1 -1
  31. package/dist/public/assets/ManagedArtifactProperties-EYfMUx3g.js +1 -0
  32. package/dist/public/assets/ManagedArtifactProperties-mqQVguq0.js +1 -0
  33. package/dist/public/assets/{MermaidDocEditor-DBbbNWFO.js → MermaidDocEditor-DLpabb88.js} +1 -1
  34. package/dist/public/assets/{PropertyDisplayRow-DfLhrMek.js → PropertyDisplayRow-CPeDXIFD.js} +1 -1
  35. package/dist/public/assets/{ReportBugDialogBody-D5SrIAvZ.js → ReportBugDialogBody-CCniAzNT.js} +1 -1
  36. package/dist/public/assets/{SchemaConfigEditor-CkKt8e-E.js → SchemaConfigEditor-_uHnWU3w.js} +1 -1
  37. package/dist/public/assets/{SessionsHost-DxbKcTfw.js → SessionsHost-DXGYsgWh.js} +2 -2
  38. package/dist/public/assets/{SettingsDialogBody-BaPG44Cx.js → SettingsDialogBody-75kVL106.js} +5 -5
  39. package/dist/public/assets/{ShareBranchSwitchDialog-BvkvEHCc.js → ShareBranchSwitchDialog-DgbDAJil.js} +1 -1
  40. package/dist/public/assets/{ShareReceiveDialog-C9KNKynH.js → ShareReceiveDialog-DmClGCLD.js} +1 -1
  41. package/dist/public/assets/{ShareReceiveMissDialog-CwqxBbfk.js → ShareReceiveMissDialog-DAxO28Lj.js} +1 -1
  42. package/dist/public/assets/{SkillCostValue-BvB_BW1x.js → SkillCostValue-zpzjADcj.js} +1 -1
  43. package/dist/public/assets/{SkillEditBanner-D0gTinuX.js → SkillEditBanner-BCRYQ3e4.js} +1 -1
  44. package/dist/public/assets/{SkillInstallMenu-Cb7qSrC0.js → SkillInstallMenu-QQXII2hZ.js} +1 -1
  45. package/dist/public/assets/{SkillOriginInline-IRuhZu-j.js → SkillOriginInline-BoAKWsbK.js} +1 -1
  46. package/dist/public/assets/{SkillToolbarControls-6i3dV6vs.js → SkillToolbarControls-ovUDGFiC.js} +1 -1
  47. package/dist/public/assets/{SlidesToolbarControls-D5EykdNJ.js → SlidesToolbarControls-BBIxMkk8.js} +1 -1
  48. package/dist/public/assets/{SourceEditor-p9dgTOkJ.js → SourceEditor-fE2VSQ8J.js} +1 -1
  49. package/dist/public/assets/{TerminalPanel-cl3V5Lv6.js → TerminalPanel-Cy4HfKYz.js} +1 -1
  50. package/dist/public/assets/{TerminalWindowApp-BoxazHdg.js → TerminalWindowApp-C6AUY1UG.js} +1 -1
  51. package/dist/public/assets/{TextDocEditor-DOoM8Kxy.js → TextDocEditor-dLRRDXfg.js} +1 -1
  52. package/dist/public/assets/{ThreadView-BxvEDVSr.js → ThreadView-D9Fbdpxf.js} +1 -1
  53. package/dist/public/assets/{TimelineDiffPane-BPuM41-O.js → TimelineDiffPane-DNnhFpvU.js} +1 -1
  54. package/dist/public/assets/{agent-diff-store-D7oOrlOa.js → agent-diff-store-CZQtUCXL.js} +1 -1
  55. package/dist/public/assets/auth-state-cache-CvhGKn1-.js +11 -0
  56. package/dist/public/assets/{client-version-DPop7QlO.js → client-version-CaChkiCH.js} +1 -1
  57. package/dist/public/assets/{comment-chips-BSXPyCs1.js → comment-chips-DVNORTJ8.js} +1 -1
  58. package/dist/public/assets/config-provider-oAAIxoES.js +5 -0
  59. package/dist/public/assets/{dist-YRM6aCj22.js → dist-DKOit9IV2.js} +192 -192
  60. package/dist/public/assets/{doc-paths-DHGjMfMc.js → doc-paths-DqOWEocR.js} +1 -1
  61. package/dist/public/assets/{documents-events-Dh2E-mNH.js → documents-events-CswIH8-8.js} +1 -1
  62. package/dist/public/assets/{file-tree-adapter-8KZtqBfU.js → file-tree-adapter-Ye2De3V1.js} +1 -1
  63. package/dist/public/assets/{file-tree-utils-mm4DWltG.js → file-tree-utils-DeewwZEM.js} +1 -1
  64. package/dist/public/assets/{folder-config-api-ReDuYJ0J.js → folder-config-api-DzbfltNv.js} +1 -1
  65. package/dist/public/assets/i18n-Ds_Fl5Hd.js +1 -0
  66. package/dist/public/assets/index-TaCyw6y_.js +2098 -0
  67. package/dist/public/assets/{lint-config-client-DDlKZf1J.js → lint-config-client-Dwop4dqP.js} +1 -1
  68. package/dist/public/assets/{markdownlint-rule-browser-Cn61TsP6.js → markdownlint-rule-browser-DH858hZX.js} +1 -1
  69. package/dist/public/assets/navigation-targets-jpdo1ZgU.js +1 -0
  70. package/dist/public/assets/{open-managed-artifact-tab-DI0a5-3C.js → open-managed-artifact-tab-CgNN9QbB.js} +1 -1
  71. package/dist/public/assets/{pending-receive-nav-store-BQWmsZRi.js → pending-receive-nav-store-fsDdvtOj.js} +1 -1
  72. package/dist/public/assets/{progress-DKgTQ0Qz.js → progress-CHBPaNjc.js} +1 -1
  73. package/dist/public/assets/{prop-types-aV6oiD-U.js → prop-types-Cw5N-nOD.js} +1 -1
  74. package/dist/public/assets/{receive-store-D1fi7HMJ.js → receive-store-DFDJ0T_F.js} +1 -1
  75. package/dist/public/assets/{selection-context-4KGHvsgP.js → selection-context-CS5s5L53.js} +1 -1
  76. package/dist/public/assets/{skill-actions-BndTKw4P.js → skill-actions-CONIft3w.js} +1 -1
  77. package/dist/public/assets/{skill-scope-TpOVvXXj.js → skill-scope-C_bc3f6T.js} +1 -1
  78. package/dist/public/assets/{skills-api-Ci4vZCl_.js → skills-api-B3AiUodv.js} +1 -1
  79. package/dist/public/assets/{src-Dyjlw1SL.js → src-Dn75jB9p.js} +1 -1
  80. package/dist/public/assets/{tag-pill-input-ltY20AtL.js → tag-pill-input-BFR_8nvj.js} +1 -1
  81. package/dist/public/assets/{target-navigation-intent-Bq0cHa0H.js → target-navigation-intent-5nit-2Ve.js} +1 -1
  82. package/dist/public/assets/{terminal-cli-display-MwCkMfQx.js → terminal-cli-display-DQFap0a9.js} +1 -1
  83. package/dist/public/assets/{terminal-launch-events-cj2KCTDl.js → terminal-launch-events-DxtBCSNL.js} +1 -1
  84. package/dist/public/assets/{terminal-telemetry-ElOB2Hsl.js → terminal-telemetry-Cq512ASb.js} +1 -1
  85. package/dist/public/assets/typing-burst-detector-Bhy83GCZ.js +8 -0
  86. package/dist/public/assets/{uninstall-CJfdIccl.js → uninstall-VS8HkqWd.js} +1 -1
  87. package/dist/public/assets/{use-activity-panel-AklD6yAB.js → use-activity-panel-BPQcffqO.js} +1 -1
  88. package/dist/public/assets/{use-apply-config-color-theme-zpd8fyW1.js → use-apply-config-color-theme-DT9ZBAuW.js} +1 -1
  89. package/dist/public/assets/{use-collab-url-BIoe0OLV.js → use-collab-url-CaC2gD2v.js} +1 -1
  90. package/dist/public/assets/{use-live-xterm-theme-BgtSx-n3.js → use-live-xterm-theme-xXp1UYmJ.js} +1 -1
  91. package/dist/public/assets/{use-open-skill-CLhiKLe2.js → use-open-skill-DdfCbjRH.js} +1 -1
  92. package/dist/public/assets/{use-popular-skills-CSwbHrqM.js → use-popular-skills-DRwm43Dp.js} +1 -1
  93. package/dist/public/assets/{use-settings-route-BuFQqdtV.js → use-settings-route-BGxa3SPN.js} +1 -1
  94. package/dist/public/assets/{use-skill-origin-CbbiS8DZ.js → use-skill-origin-CnlwuiEX.js} +1 -1
  95. package/dist/public/assets/{use-terminal-enabled-GezhypT9.js → use-terminal-enabled-B3CRPNAH.js} +1 -1
  96. package/dist/public/assets/{use-timeline-entry-diff-DyOMjIES.js → use-timeline-entry-diff-Cta4x9Tk.js} +1 -1
  97. package/dist/public/assets/{use-workspace-C3C8xAY5.js → use-workspace-CQYB3HLR.js} +1 -1
  98. package/dist/public/index.html +45 -45
  99. package/dist/public/uninstall.html +3 -3
  100. package/dist/{repair-launch-json-CEDu8wqf.mjs → repair-launch-json-Ul9-Kphl.mjs} +2 -2
  101. package/dist/{repair-mcp-configs-Bf5i53AU.mjs → repair-mcp-configs-DI9-mCNA.mjs} +2 -2
  102. package/dist/repair-skills-C4NosCCh.mjs +1 -0
  103. package/dist/{repair-skills-Cs-CbtpF.mjs → repair-skills-DySL7Lc9.mjs} +2 -2
  104. package/dist/{resolve-project-root-BD_5TDzP.mjs → resolve-project-root-BDV317uB.mjs} +2 -2
  105. package/dist/{server-lock-DCzdk2Up.mjs → server-lock-BFHu2BWp.mjs} +2 -2
  106. package/dist/server-lock-DzPLyikk.mjs +1 -0
  107. package/dist/{skill-teardown-TMX-h8on.mjs → skill-teardown-DTg2NyL3.mjs} +2 -2
  108. package/dist/{sleep-DXvB05wr.mjs → sleep-DhRrtbfG.mjs} +6 -6
  109. package/dist/src-B9XENgF4.mjs +357 -0
  110. package/dist/{src-D28v5dI-.mjs → src-BMc6VYxR.mjs} +1 -1
  111. package/dist/{src-BUvdZk4h.mjs → src-BpAtKjdr.mjs} +3 -3
  112. package/dist/src-C49kugTg.mjs +1 -0
  113. package/dist/{src-vJKK8Bgd.mjs → src-C8z0M4Ib.mjs} +71 -71
  114. package/dist/start-De77XKSr.mjs +1 -0
  115. package/dist/{start-oZSin_Cq.mjs → start-R7eR24jP.mjs} +3 -3
  116. package/package.json +5 -5
  117. package/dist/constants-DwCeIiph.mjs +0 -2
  118. package/dist/fs-traced-Dak_kryQ.mjs +0 -1
  119. package/dist/git-handle-M-kQfBzM.mjs +0 -1
  120. package/dist/init-BF-FV5qg.mjs +0 -1
  121. package/dist/loader-CnYTkLbq.mjs +0 -1
  122. package/dist/md-manager-C7XAJMWr.mjs +0 -2
  123. package/dist/preview-DCrZ6Og7.mjs +0 -1
  124. package/dist/public/assets/FeedbackForm-CYAmtIjK.js +0 -1
  125. package/dist/public/assets/ManagedArtifactProperties-B4xOs3fA.js +0 -1
  126. package/dist/public/assets/ManagedArtifactProperties-DUIo-gDU.js +0 -1
  127. package/dist/public/assets/auth-state-cache-1gTw3GkH.js +0 -11
  128. package/dist/public/assets/config-provider-CYqYSyJg.js +0 -5
  129. package/dist/public/assets/i18n-BQpXlvfY.js +0 -1
  130. package/dist/public/assets/index-dbxZtLCX.js +0 -2098
  131. package/dist/public/assets/navigation-targets-CFQds_7M.js +0 -1
  132. package/dist/public/assets/typing-burst-detector-kXx1cN6a.js +0 -8
  133. package/dist/repair-skills-Bn47U59J.mjs +0 -1
  134. package/dist/server-lock-CV9U-jz6.mjs +0 -1
  135. package/dist/src-DUFkX7vo.mjs +0 -1
  136. package/dist/src-Dm-FGyIz.mjs +0 -357
  137. package/dist/start-CuUojA75.mjs +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./index-TaCyw6y_.js";export{e as FeedbackForm};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./useQuery-ZeEDLtxh.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./compiler-runtime-BfE3aGVn.js";import{t as l}from"./utils-CPqDy6Hr.js";import{t as u}from"./overlay-layers-Bj-TVfKw.js";import{t as d}from"./button-CA0dewJJ.js";import{i as f,n as p,t as m}from"./tooltip-DPvMEqsq.js";import{n as h,t as g}from"./toggle-group-BlEg4yJE.js";import{H as _,Mo as v,St as y,Z as b,ko as x,mt as S,pt as C,qr as w}from"./dist-YRM6aCj22.js";import{t as T}from"./dist-BgXDUIPy.js";import{_ as E}from"./documents-events-Dh2E-mNH.js";import{t as D}from"./createLucideIcon-CAkY8Blx.js";import{t as ee}from"./arrow-up-right-CXMA4cr5.js";import{i as te,o as ne,s as re,t as O}from"./prop-types-aV6oiD-U.js";import{n as k,t as ie}from"./target-navigation-intent-Bq0cHa0H.js";import{t as ae}from"./triangle-alert-CJVfCxE0.js";import{f as oe}from"./doc-paths-DHGjMfMc.js";import{n as se}from"./external-link-Dzk3biRr.js";import{a as ce,c as le,i as ue,n as de,r as fe,s as pe,t as me}from"./panel-DNPki55m.js";import{t as he}from"./ordinal-Bq2DRwIk.js";import{n as ge,t as A}from"./min-Ql-sNLj-.js";import{C as _e,S as ve,_ as ye,b as j,g as be,n as xe,r as Se,t as Ce,v as we,w as Te,x as Ee,y as De}from"./src-BJDBXEob.js";import{t as Oe}from"./colors-BIZ_qOvP.js";import{t as ke}from"./isObject-Cpi_qscz.js";import{n as M,t as N}from"./now-MQcmaMyW.js";var Ae=D(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),je=D(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]);function Me(e,n){let r=0;if(n===void 0)for(let n of e)(n=+n)&&(r+=n);else{let i=-1;for(let a of e)(a=+n(a,++i,e))&&(r+=a)}return r}var Ne=e=>()=>e;function Pe(e,{sourceEvent:n,subject:r,target:i,identifier:a,active:o,x:s,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}Pe.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Fe(e){return!e.ctrlKey&&!e.button}function Ie(){return this.parentNode}function P(e,n){return n??{x:e.x,y:e.y}}function F(){return navigator.maxTouchPoints||`ontouchstart`in this}function Le(){var e=Fe,n=Ie,r=P,i=F,a={},o=Te(`start`,`drag`,`end`),s=0,c,l,u,d,f=0;function p(e){e.on(`mousedown.drag`,m).filter(i).on(`touchstart.drag`,_).on(`touchmove.drag`,v,De).on(`touchend.drag touchcancel.drag`,y).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function m(r,i){if(!(d||!e.call(this,r,i))){var a=b(this,n.call(this,r,i),r,i,`mouse`);a&&(_e(r.view).on(`mousemove.drag`,h,j).on(`mouseup.drag`,g,j),be(r.view),Ee(r),u=!1,c=r.clientX,l=r.clientY,a(`start`,r))}}function h(e){if(we(e),!u){var n=e.clientX-c,r=e.clientY-l;u=n*n+r*r>f}a.mouse(`drag`,e)}function g(e){_e(e.view).on(`mousemove.drag mouseup.drag`,null),ye(e.view,u),we(e),a.mouse(`end`,e)}function _(r,i){if(e.call(this,r,i)){var a=r.changedTouches,o=n.call(this,r,i),s=a.length,c,l;for(c=0;c<s;++c)(l=b(this,o,r,i,a[c].identifier,a[c]))&&(Ee(r),l(`start`,r,a[c]))}}function v(e){var n=e.changedTouches,r=n.length,i,o;for(i=0;i<r;++i)(o=a[n[i].identifier])&&(we(e),o(`drag`,e,n[i]))}function y(e){var n=e.changedTouches,r=n.length,i,o;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),i=0;i<r;++i)(o=a[n[i].identifier])&&(Ee(e),o(`end`,e,n[i]))}function b(e,n,i,c,l,u){var d=o.copy(),f=ve(u||i,n),m,h,g;if((g=r.call(e,new Pe(`beforestart`,{sourceEvent:i,target:p,identifier:l,active:s,x:f[0],y:f[1],dx:0,dy:0,dispatch:d}),c))!=null)return m=g.x-f[0]||0,h=g.y-f[1]||0,function r(i,o,u){var _=f,v;switch(i){case`start`:a[l]=r,v=s++;break;case`end`:delete a[l],--s;case`drag`:f=ve(u||o,n),v=s;break}d.call(i,e,new Pe(i,{sourceEvent:o,subject:g,target:p,identifier:l,active:v,x:f[0]+m,y:f[1]+h,dx:f[0]-_[0],dy:f[1]-_[1],dispatch:d}),c)}}return p.filter=function(n){return arguments.length?(e=typeof n==`function`?n:Ne(!!n),p):e},p.container=function(e){return arguments.length?(n=typeof e==`function`?e:Ne(e),p):n},p.subject=function(e){return arguments.length?(r=typeof e==`function`?e:Ne(e),p):r},p.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Ne(!!e),p):i},p.on=function(){var e=o.on.apply(o,arguments);return e===o?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}function Re(e){let n=+this._x.call(null,e),r=+this._y.call(null,e);return ze(this.cover(n,r),n,r,e)}function ze(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var a,o=e._root,s={data:i},c=e._x0,l=e._y0,u=e._x1,d=e._y1,f,p,m,h,g,_,v,y;if(!o)return e._root=s,e;for(;o.length;)if((g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p,a=o,!(o=o[v=_<<1|g]))return a[v]=s,e;if(m=+e._x.call(null,o.data),h=+e._y.call(null,o.data),n===m&&r===h)return s.next=o,a?a[v]=s:e._root=s,e;do a=a?a[v]=[,,,,]:e._root=[,,,,],(g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p;while((v=_<<1|g)==(y=(h>=p)<<1|m>=f));return a[y]=o,a[v]=s,e}function I(e){var n,r,i=e.length,a,o,s=Array(i),c=Array(i),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,n=e[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=a,c[r]=o,a<l&&(l=a),a>d&&(d=a),o<u&&(u=o),o>f&&(f=o));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<i;++r)ze(this,s[r],c[r],e[r]);return this}function Be(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,a=this._x1,o=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,o=(i=Math.floor(n))+1;else{for(var s=a-r||1,c=this._root,l,u;r>e||e>=a||i>n||n>=o;)switch(u=(n<i)<<1|e<r,l=[,,,,],l[u]=c,c=l,s*=2,u){case 0:a=r+s,o=i+s;break;case 1:r=a-s,o=i+s;break;case 2:a=r+s,i=o-s;break;case 3:r=a-s,i=o-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=i,this._x1=a,this._y1=o,this}function Ve(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function He(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function L(e,n,r,i,a){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=a}function Ue(e,n,r){var i,a=this._x0,o=this._y0,s,c,l,u,d=this._x1,f=this._y1,p=[],m=this._root,h,g;for(m&&p.push(new L(m,a,o,d,f)),r==null?r=1/0:(a=e-r,o=n-r,d=e+r,f=n+r,r*=r);h=p.pop();)if(!(!(m=h.node)||(s=h.x0)>d||(c=h.y0)>f||(l=h.x1)<a||(u=h.y1)<o))if(m.length){var _=(s+l)/2,v=(c+u)/2;p.push(new L(m[3],_,v,l,u),new L(m[2],s,v,_,u),new L(m[1],_,c,l,v),new L(m[0],s,c,_,v)),(g=(n>=v)<<1|e>=_)&&(h=p[p.length-1],p[p.length-1]=p[p.length-1-g],p[p.length-1-g]=h)}else{var y=e-+this._x.call(null,m.data),b=n-+this._y.call(null,m.data),x=y*y+b*b;if(x<r){var S=Math.sqrt(r=x);a=e-S,o=n-S,d=e+S,f=n+S,i=m.data}}return i}function We(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._y0,l=this._x1,u=this._y1,d,f,p,m,h,g,_,v;if(!r)return this;if(r.length)for(;;){if((h=d>=(p=(s+l)/2))?s=p:l=p,(g=f>=(m=(c+u)/2))?c=m:u=m,n=r,!(r=r[_=g<<1|h]))return this;if(!r.length)break;(n[_+1&3]||n[_+2&3]||n[_+3&3])&&(i=n,v=_)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[_]=o:delete n[_],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=o,this)}function Ge(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Ke(){return this._root}function qe(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Je(e){var n=[],r,i=this._root,a,o,s,c,l;for(i&&n.push(new L(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.y0,c=r.x1,l=r.y1)&&i.length){var u=(o+c)/2,d=(s+l)/2;(a=i[3])&&n.push(new L(a,u,d,c,l)),(a=i[2])&&n.push(new L(a,o,d,u,l)),(a=i[1])&&n.push(new L(a,u,s,c,d)),(a=i[0])&&n.push(new L(a,o,s,u,d))}return this}function Ye(e){var n=[],r=[],i;for(this._root&&n.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.y0,l=i.x1,u=i.y1,d=(s+l)/2,f=(c+u)/2;(o=a[0])&&n.push(new L(o,s,c,d,f)),(o=a[1])&&n.push(new L(o,d,c,l,f)),(o=a[2])&&n.push(new L(o,s,f,d,u)),(o=a[3])&&n.push(new L(o,d,f,l,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Xe(e){return e[0]}function Ze(e){return arguments.length?(this._x=e,this):this._x}function Qe(e){return e[1]}function $e(e){return arguments.length?(this._y=e,this):this._y}function et(e,n,r){var i=new tt(n??Xe,r??Qe,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function tt(e,n,r,i,a,o){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=a,this._y1=o,this._root=void 0}function nt(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var R=et.prototype=tt.prototype;R.copy=function(){var e=new tt(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=nt(n),e;for(r=[{source:n,target:e._root=[,,,,]}];n=r.pop();)for(var a=0;a<4;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=[,,,,]}):n.target[a]=nt(i));return e},R.add=Re,R.addAll=I,R.cover=Be,R.data=Ve,R.extent=He,R.find=Ue,R.remove=We,R.removeAll=Ge,R.root=Ke,R.size=qe,R.visit=Je,R.visitAfter=Ye,R.x=Ze,R.y=$e;var z=Oe(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`),B=n(),V=e(r(),1),rt=c(),it=`Expected a function`,at=Math.max,ot=Math.min;function st(e,n,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(it);n=M(n)||0,ke(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?at(M(r.maxWait)||0,n):o,p=`trailing`in r?!!r.trailing:p);function m(n){var r=i,o=a;return i=a=void 0,u=n,s=e.apply(o,r),s}function h(e){return u=e,c=setTimeout(v,n),d?m(e):s}function g(e){var r=e-l,i=e-u,a=n-r;return f?ot(a,o-i):a}function _(e){var r=e-l,i=e-u;return l===void 0||r>=n||r<0||f&&i>=o}function v(){var e=N();if(_(e))return y(e);c=setTimeout(v,g(e))}function y(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function b(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function x(){return c===void 0?s:y(N())}function S(){var e=N(),r=_(e);if(i=arguments,a=this,l=e,r){if(c===void 0)return h(l);if(f)return clearTimeout(c),c=setTimeout(v,n),m(l)}return c===void 0&&(c=setTimeout(v,n)),s}return S.cancel=b,S.flush=x,S}var H=`Expected a function`;function ct(e,n,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(H);return ke(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),st(e,n,{leading:i,maxWait:n,trailing:a})}var lt=[`#60a5fa`,`#a78bfa`,`#34d399`,`#f472b6`,`#fb923c`,`#22d3ee`,`#c084fc`,`#4ade80`,`#f87171`,`#eab308`,`#ec4899`,`#06b67f`,`#8b5cf6`,`#f43f5e`,`#0ea5e9`,`#a855f7`],ut=[`#1e40af`,`#6b21a8`,`#166534`,`#9f1239`,`#9a3412`,`#164e63`,`#581c87`,`#166534`,`#991b1b`,`#854d0e`,`#831843`,`#0f766e`,`#312e81`,`#9f1239`,`#0c4a6e`,`#6b21a8`];function dt(e){let n=2;for(let r=0;r<e.length;r++)n=Math.imul(n^e.charCodeAt(r),1540483477),n^=n>>>13,n=Math.imul(n,1540483477),n^=n>>>15;return n>>>0}function ft(e,n){let r=n?lt:ut;return r[dt(e)%r.length]}var U={fullscreen:{maxEntries:10,containerClassName:`bottom-3 left-3 gap-1 rounded-lg px-3 py-2 text-xs`,titleClassName:`mb-1.5`,rowClassName:`gap-2`,swatchClassName:`size-2.5`,labelClassName:`max-w-[140px]`,overflowClassName:`pl-[18px]`},docked:{maxEntries:6,containerClassName:`bottom-2 left-2 gap-0.5 rounded-md px-2 py-1.5 text-[11px]`,titleClassName:`mb-1`,rowClassName:`gap-1.5`,swatchClassName:`size-2`,labelClassName:`max-w-[112px]`,overflowClassName:`pl-[14px]`}};function pt(e){return U[e]}function W(e){let n=(0,rt.c)(6),{clusters:r,variant:a}=e,o=a===void 0?`fullscreen`:a,{resolvedTheme:c}=s(),u=c===`dark`,d,f;if(n[0]!==r||n[1]!==u||n[2]!==o){f=Symbol.for(`react.early_return_sentinel`);bb0:{let e=pt(o);if(r.length===0){f=null;break bb0}let a=r.slice(0,e.maxEntries),s=r.length-a.length,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(i,{id:`kmKqZg`}),n[5]=c):c=n[5],d=(0,B.jsxs)(`div`,{className:l(`pointer-events-none absolute z-10 flex flex-col backdrop-blur-sm`,e.containerClassName,u?`bg-black/70 text-gray-200`:`bg-white/80 text-gray-800 ring-1 ring-black/5`),children:[(0,B.jsx)(`div`,{className:l(`font-medium`,e.titleClassName,u?`text-slate-300`:`text-slate-700`),children:c}),a.map(n=>(0,B.jsxs)(`div`,{className:l(`flex items-center`,e.rowClassName),children:[(0,B.jsx)(`span`,{className:l(`inline-block shrink-0 rounded-full`,e.swatchClassName),style:{backgroundColor:ft(n,u)}}),(0,B.jsx)(`span`,{className:l(`truncate`,e.labelClassName),children:n})]},n)),s>0&&(0,B.jsx)(`div`,{className:l(`text-muted-foreground`,e.overflowClassName),children:(0,B.jsx)(i,{id:`lrhetp`,values:{overflow:s}})})]})}n[0]=r,n[1]=u,n[2]=o,n[3]=d,n[4]=f}else d=n[3],f=n[4];return f===Symbol.for(`react.early_return_sentinel`)?d:f}function mt(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function ht(e,n,r){return n=Et(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function gt(e,n){return yt(e)||mt(e,n)||xt(e,n)||wt()}function _t(e){return vt(e)||bt(e)||xt(e)||Ct()}function vt(e){if(Array.isArray(e))return St(e)}function yt(e){if(Array.isArray(e))return e}function bt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function xt(e,n){if(e){if(typeof e==`string`)return St(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Array.from(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return St(e,n)}}function St(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Ct(){throw TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./useQuery-ZeEDLtxh.js";import{n as s}from"./dist-PQ5KMVDh.js";import{t as c}from"./compiler-runtime-BfE3aGVn.js";import{t as l}from"./utils-CPqDy6Hr.js";import{t as u}from"./overlay-layers-Bj-TVfKw.js";import{t as d}from"./button-CA0dewJJ.js";import{i as f,n as p,t as m}from"./tooltip-DPvMEqsq.js";import{n as h,t as g}from"./toggle-group-BlEg4yJE.js";import{H as _,Mo as v,St as y,Z as b,ko as x,mt as S,pt as C,qr as w}from"./dist-DKOit9IV2.js";import{t as T}from"./dist-BgXDUIPy.js";import{_ as E}from"./documents-events-CswIH8-8.js";import{t as D}from"./createLucideIcon-CAkY8Blx.js";import{t as ee}from"./arrow-up-right-CXMA4cr5.js";import{i as te,o as ne,s as re,t as O}from"./prop-types-Cw5N-nOD.js";import{n as k,t as ie}from"./target-navigation-intent-5nit-2Ve.js";import{t as ae}from"./triangle-alert-CJVfCxE0.js";import{f as oe}from"./doc-paths-DqOWEocR.js";import{n as se}from"./external-link-Dzk3biRr.js";import{a as ce,c as le,i as ue,n as de,r as fe,s as pe,t as me}from"./panel-DNPki55m.js";import{t as he}from"./ordinal-Bq2DRwIk.js";import{n as ge,t as A}from"./min-Ql-sNLj-.js";import{C as _e,S as ve,_ as ye,b as j,g as be,n as xe,r as Se,t as Ce,v as we,w as Te,x as Ee,y as De}from"./src-BJDBXEob.js";import{t as Oe}from"./colors-BIZ_qOvP.js";import{t as ke}from"./isObject-Cpi_qscz.js";import{n as M,t as N}from"./now-MQcmaMyW.js";var Ae=D(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),je=D(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]);function Me(e,n){let r=0;if(n===void 0)for(let n of e)(n=+n)&&(r+=n);else{let i=-1;for(let a of e)(a=+n(a,++i,e))&&(r+=a)}return r}var Ne=e=>()=>e;function Pe(e,{sourceEvent:n,subject:r,target:i,identifier:a,active:o,x:s,y:c,dx:l,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:r,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}Pe.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Fe(e){return!e.ctrlKey&&!e.button}function Ie(){return this.parentNode}function P(e,n){return n??{x:e.x,y:e.y}}function F(){return navigator.maxTouchPoints||`ontouchstart`in this}function Le(){var e=Fe,n=Ie,r=P,i=F,a={},o=Te(`start`,`drag`,`end`),s=0,c,l,u,d,f=0;function p(e){e.on(`mousedown.drag`,m).filter(i).on(`touchstart.drag`,_).on(`touchmove.drag`,v,De).on(`touchend.drag touchcancel.drag`,y).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function m(r,i){if(!(d||!e.call(this,r,i))){var a=b(this,n.call(this,r,i),r,i,`mouse`);a&&(_e(r.view).on(`mousemove.drag`,h,j).on(`mouseup.drag`,g,j),be(r.view),Ee(r),u=!1,c=r.clientX,l=r.clientY,a(`start`,r))}}function h(e){if(we(e),!u){var n=e.clientX-c,r=e.clientY-l;u=n*n+r*r>f}a.mouse(`drag`,e)}function g(e){_e(e.view).on(`mousemove.drag mouseup.drag`,null),ye(e.view,u),we(e),a.mouse(`end`,e)}function _(r,i){if(e.call(this,r,i)){var a=r.changedTouches,o=n.call(this,r,i),s=a.length,c,l;for(c=0;c<s;++c)(l=b(this,o,r,i,a[c].identifier,a[c]))&&(Ee(r),l(`start`,r,a[c]))}}function v(e){var n=e.changedTouches,r=n.length,i,o;for(i=0;i<r;++i)(o=a[n[i].identifier])&&(we(e),o(`drag`,e,n[i]))}function y(e){var n=e.changedTouches,r=n.length,i,o;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),i=0;i<r;++i)(o=a[n[i].identifier])&&(Ee(e),o(`end`,e,n[i]))}function b(e,n,i,c,l,u){var d=o.copy(),f=ve(u||i,n),m,h,g;if((g=r.call(e,new Pe(`beforestart`,{sourceEvent:i,target:p,identifier:l,active:s,x:f[0],y:f[1],dx:0,dy:0,dispatch:d}),c))!=null)return m=g.x-f[0]||0,h=g.y-f[1]||0,function r(i,o,u){var _=f,v;switch(i){case`start`:a[l]=r,v=s++;break;case`end`:delete a[l],--s;case`drag`:f=ve(u||o,n),v=s;break}d.call(i,e,new Pe(i,{sourceEvent:o,subject:g,target:p,identifier:l,active:v,x:f[0]+m,y:f[1]+h,dx:f[0]-_[0],dy:f[1]-_[1],dispatch:d}),c)}}return p.filter=function(n){return arguments.length?(e=typeof n==`function`?n:Ne(!!n),p):e},p.container=function(e){return arguments.length?(n=typeof e==`function`?e:Ne(e),p):n},p.subject=function(e){return arguments.length?(r=typeof e==`function`?e:Ne(e),p):r},p.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:Ne(!!e),p):i},p.on=function(){var e=o.on.apply(o,arguments);return e===o?p:e},p.clickDistance=function(e){return arguments.length?(f=(e=+e)*e,p):Math.sqrt(f)},p}function Re(e){let n=+this._x.call(null,e),r=+this._y.call(null,e);return ze(this.cover(n,r),n,r,e)}function ze(e,n,r,i){if(isNaN(n)||isNaN(r))return e;var a,o=e._root,s={data:i},c=e._x0,l=e._y0,u=e._x1,d=e._y1,f,p,m,h,g,_,v,y;if(!o)return e._root=s,e;for(;o.length;)if((g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p,a=o,!(o=o[v=_<<1|g]))return a[v]=s,e;if(m=+e._x.call(null,o.data),h=+e._y.call(null,o.data),n===m&&r===h)return s.next=o,a?a[v]=s:e._root=s,e;do a=a?a[v]=[,,,,]:e._root=[,,,,],(g=n>=(f=(c+u)/2))?c=f:u=f,(_=r>=(p=(l+d)/2))?l=p:d=p;while((v=_<<1|g)==(y=(h>=p)<<1|m>=f));return a[y]=o,a[v]=s,e}function I(e){var n,r,i=e.length,a,o,s=Array(i),c=Array(i),l=1/0,u=1/0,d=-1/0,f=-1/0;for(r=0;r<i;++r)isNaN(a=+this._x.call(null,n=e[r]))||isNaN(o=+this._y.call(null,n))||(s[r]=a,c[r]=o,a<l&&(l=a),a>d&&(d=a),o<u&&(u=o),o>f&&(f=o));if(l>d||u>f)return this;for(this.cover(l,u).cover(d,f),r=0;r<i;++r)ze(this,s[r],c[r],e[r]);return this}function Be(e,n){if(isNaN(e=+e)||isNaN(n=+n))return this;var r=this._x0,i=this._y0,a=this._x1,o=this._y1;if(isNaN(r))a=(r=Math.floor(e))+1,o=(i=Math.floor(n))+1;else{for(var s=a-r||1,c=this._root,l,u;r>e||e>=a||i>n||n>=o;)switch(u=(n<i)<<1|e<r,l=[,,,,],l[u]=c,c=l,s*=2,u){case 0:a=r+s,o=i+s;break;case 1:r=a-s,o=i+s;break;case 2:a=r+s,i=o-s;break;case 3:r=a-s,i=o-s;break}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=i,this._x1=a,this._y1=o,this}function Ve(){var e=[];return this.visit(function(n){if(!n.length)do e.push(n.data);while(n=n.next)}),e}function He(e){return arguments.length?this.cover(+e[0][0],+e[0][1]).cover(+e[1][0],+e[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function L(e,n,r,i,a){this.node=e,this.x0=n,this.y0=r,this.x1=i,this.y1=a}function Ue(e,n,r){var i,a=this._x0,o=this._y0,s,c,l,u,d=this._x1,f=this._y1,p=[],m=this._root,h,g;for(m&&p.push(new L(m,a,o,d,f)),r==null?r=1/0:(a=e-r,o=n-r,d=e+r,f=n+r,r*=r);h=p.pop();)if(!(!(m=h.node)||(s=h.x0)>d||(c=h.y0)>f||(l=h.x1)<a||(u=h.y1)<o))if(m.length){var _=(s+l)/2,v=(c+u)/2;p.push(new L(m[3],_,v,l,u),new L(m[2],s,v,_,u),new L(m[1],_,c,l,v),new L(m[0],s,c,_,v)),(g=(n>=v)<<1|e>=_)&&(h=p[p.length-1],p[p.length-1]=p[p.length-1-g],p[p.length-1-g]=h)}else{var y=e-+this._x.call(null,m.data),b=n-+this._y.call(null,m.data),x=y*y+b*b;if(x<r){var S=Math.sqrt(r=x);a=e-S,o=n-S,d=e+S,f=n+S,i=m.data}}return i}function We(e){if(isNaN(d=+this._x.call(null,e))||isNaN(f=+this._y.call(null,e)))return this;var n,r=this._root,i,a,o,s=this._x0,c=this._y0,l=this._x1,u=this._y1,d,f,p,m,h,g,_,v;if(!r)return this;if(r.length)for(;;){if((h=d>=(p=(s+l)/2))?s=p:l=p,(g=f>=(m=(c+u)/2))?c=m:u=m,n=r,!(r=r[_=g<<1|h]))return this;if(!r.length)break;(n[_+1&3]||n[_+2&3]||n[_+3&3])&&(i=n,v=_)}for(;r.data!==e;)if(a=r,!(r=r.next))return this;return(o=r.next)&&delete r.next,a?(o?a.next=o:delete a.next,this):n?(o?n[_]=o:delete n[_],(r=n[0]||n[1]||n[2]||n[3])&&r===(n[3]||n[2]||n[1]||n[0])&&!r.length&&(i?i[v]=r:this._root=r),this):(this._root=o,this)}function Ge(e){for(var n=0,r=e.length;n<r;++n)this.remove(e[n]);return this}function Ke(){return this._root}function qe(){var e=0;return this.visit(function(n){if(!n.length)do++e;while(n=n.next)}),e}function Je(e){var n=[],r,i=this._root,a,o,s,c,l;for(i&&n.push(new L(i,this._x0,this._y0,this._x1,this._y1));r=n.pop();)if(!e(i=r.node,o=r.x0,s=r.y0,c=r.x1,l=r.y1)&&i.length){var u=(o+c)/2,d=(s+l)/2;(a=i[3])&&n.push(new L(a,u,d,c,l)),(a=i[2])&&n.push(new L(a,o,d,u,l)),(a=i[1])&&n.push(new L(a,u,s,c,d)),(a=i[0])&&n.push(new L(a,o,s,u,d))}return this}function Ye(e){var n=[],r=[],i;for(this._root&&n.push(new L(this._root,this._x0,this._y0,this._x1,this._y1));i=n.pop();){var a=i.node;if(a.length){var o,s=i.x0,c=i.y0,l=i.x1,u=i.y1,d=(s+l)/2,f=(c+u)/2;(o=a[0])&&n.push(new L(o,s,c,d,f)),(o=a[1])&&n.push(new L(o,d,c,l,f)),(o=a[2])&&n.push(new L(o,s,f,d,u)),(o=a[3])&&n.push(new L(o,d,f,l,u))}r.push(i)}for(;i=r.pop();)e(i.node,i.x0,i.y0,i.x1,i.y1);return this}function Xe(e){return e[0]}function Ze(e){return arguments.length?(this._x=e,this):this._x}function Qe(e){return e[1]}function $e(e){return arguments.length?(this._y=e,this):this._y}function et(e,n,r){var i=new tt(n??Xe,r??Qe,NaN,NaN,NaN,NaN);return e==null?i:i.addAll(e)}function tt(e,n,r,i,a,o){this._x=e,this._y=n,this._x0=r,this._y0=i,this._x1=a,this._y1=o,this._root=void 0}function nt(e){for(var n={data:e.data},r=n;e=e.next;)r=r.next={data:e.data};return n}var R=et.prototype=tt.prototype;R.copy=function(){var e=new tt(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root,r,i;if(!n)return e;if(!n.length)return e._root=nt(n),e;for(r=[{source:n,target:e._root=[,,,,]}];n=r.pop();)for(var a=0;a<4;++a)(i=n.source[a])&&(i.length?r.push({source:i,target:n.target[a]=[,,,,]}):n.target[a]=nt(i));return e},R.add=Re,R.addAll=I,R.cover=Be,R.data=Ve,R.extent=He,R.find=Ue,R.remove=We,R.removeAll=Ge,R.root=Ke,R.size=qe,R.visit=Je,R.visitAfter=Ye,R.x=Ze,R.y=$e;var z=Oe(`a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928`),B=n(),V=e(r(),1),rt=c(),it=`Expected a function`,at=Math.max,ot=Math.min;function st(e,n,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(it);n=M(n)||0,ke(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?at(M(r.maxWait)||0,n):o,p=`trailing`in r?!!r.trailing:p);function m(n){var r=i,o=a;return i=a=void 0,u=n,s=e.apply(o,r),s}function h(e){return u=e,c=setTimeout(v,n),d?m(e):s}function g(e){var r=e-l,i=e-u,a=n-r;return f?ot(a,o-i):a}function _(e){var r=e-l,i=e-u;return l===void 0||r>=n||r<0||f&&i>=o}function v(){var e=N();if(_(e))return y(e);c=setTimeout(v,g(e))}function y(e){return c=void 0,p&&i?m(e):(i=a=void 0,s)}function b(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function x(){return c===void 0?s:y(N())}function S(){var e=N(),r=_(e);if(i=arguments,a=this,l=e,r){if(c===void 0)return h(l);if(f)return clearTimeout(c),c=setTimeout(v,n),m(l)}return c===void 0&&(c=setTimeout(v,n)),s}return S.cancel=b,S.flush=x,S}var H=`Expected a function`;function ct(e,n,r){var i=!0,a=!0;if(typeof e!=`function`)throw TypeError(H);return ke(r)&&(i=`leading`in r?!!r.leading:i,a=`trailing`in r?!!r.trailing:a),st(e,n,{leading:i,maxWait:n,trailing:a})}var lt=[`#60a5fa`,`#a78bfa`,`#34d399`,`#f472b6`,`#fb923c`,`#22d3ee`,`#c084fc`,`#4ade80`,`#f87171`,`#eab308`,`#ec4899`,`#06b67f`,`#8b5cf6`,`#f43f5e`,`#0ea5e9`,`#a855f7`],ut=[`#1e40af`,`#6b21a8`,`#166534`,`#9f1239`,`#9a3412`,`#164e63`,`#581c87`,`#166534`,`#991b1b`,`#854d0e`,`#831843`,`#0f766e`,`#312e81`,`#9f1239`,`#0c4a6e`,`#6b21a8`];function dt(e){let n=2;for(let r=0;r<e.length;r++)n=Math.imul(n^e.charCodeAt(r),1540483477),n^=n>>>13,n=Math.imul(n,1540483477),n^=n>>>15;return n>>>0}function ft(e,n){let r=n?lt:ut;return r[dt(e)%r.length]}var U={fullscreen:{maxEntries:10,containerClassName:`bottom-3 left-3 gap-1 rounded-lg px-3 py-2 text-xs`,titleClassName:`mb-1.5`,rowClassName:`gap-2`,swatchClassName:`size-2.5`,labelClassName:`max-w-[140px]`,overflowClassName:`pl-[18px]`},docked:{maxEntries:6,containerClassName:`bottom-2 left-2 gap-0.5 rounded-md px-2 py-1.5 text-[11px]`,titleClassName:`mb-1`,rowClassName:`gap-1.5`,swatchClassName:`size-2`,labelClassName:`max-w-[112px]`,overflowClassName:`pl-[14px]`}};function pt(e){return U[e]}function W(e){let n=(0,rt.c)(6),{clusters:r,variant:a}=e,o=a===void 0?`fullscreen`:a,{resolvedTheme:c}=s(),u=c===`dark`,d,f;if(n[0]!==r||n[1]!==u||n[2]!==o){f=Symbol.for(`react.early_return_sentinel`);bb0:{let e=pt(o);if(r.length===0){f=null;break bb0}let a=r.slice(0,e.maxEntries),s=r.length-a.length,c;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,B.jsx)(i,{id:`kmKqZg`}),n[5]=c):c=n[5],d=(0,B.jsxs)(`div`,{className:l(`pointer-events-none absolute z-10 flex flex-col backdrop-blur-sm`,e.containerClassName,u?`bg-black/70 text-gray-200`:`bg-white/80 text-gray-800 ring-1 ring-black/5`),children:[(0,B.jsx)(`div`,{className:l(`font-medium`,e.titleClassName,u?`text-slate-300`:`text-slate-700`),children:c}),a.map(n=>(0,B.jsxs)(`div`,{className:l(`flex items-center`,e.rowClassName),children:[(0,B.jsx)(`span`,{className:l(`inline-block shrink-0 rounded-full`,e.swatchClassName),style:{backgroundColor:ft(n,u)}}),(0,B.jsx)(`span`,{className:l(`truncate`,e.labelClassName),children:n})]},n)),s>0&&(0,B.jsx)(`div`,{className:l(`text-muted-foreground`,e.overflowClassName),children:(0,B.jsx)(i,{id:`lrhetp`,values:{overflow:s}})})]})}n[0]=r,n[1]=u,n[2]=o,n[3]=d,n[4]=f}else d=n[3],f=n[4];return f===Symbol.for(`react.early_return_sentinel`)?d:f}function mt(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function ht(e,n,r){return n=Et(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function gt(e,n){return yt(e)||mt(e,n)||xt(e,n)||wt()}function _t(e){return vt(e)||bt(e)||xt(e)||Ct()}function vt(e){if(Array.isArray(e))return St(e)}function yt(e){if(Array.isArray(e))return e}function bt(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function xt(e,n){if(e){if(typeof e==`string`)return St(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`)return Array.from(e);if(r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return St(e,n)}}function St(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Ct(){throw TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wt(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tt(e,n){if(typeof e!=`object`||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n||`default`);if(typeof i!=`object`)return i;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(n===`string`?String:Number)(e)}function Et(e){var n=Tt(e,`string`);return typeof n==`symbol`?n:String(n)}var Dt=function(e,n){var r=new Set(n);return Object.assign.apply(Object,[{}].concat(_t(Object.entries(e).filter(function(e){var n=gt(e,1)[0];return!r.has(n)}).map(function(e){var n=gt(e,2),r=n[0],i=n[1];return ht({},r,i)}))))};function Ot(e,{wrapperElementType:n=`div`,nodeMapper:r=e=>e,methodNames:i=[],initPropNames:a=[]}={}){return(0,V.forwardRef)((o,s)=>{let c=(0,V.useRef)(),l=(0,V.useMemo)(()=>e(Object.fromEntries(a.filter(e=>o.hasOwnProperty(e)).map(e=>[e,o[e]]))),[]);kt(()=>{l(r(c.current))},V.useLayoutEffect),kt(()=>l._destructor instanceof Function?l._destructor:void 0);let u=(0,V.useCallback)((e,...n)=>l[e]instanceof Function?l[e](...n):void 0,[l]),d=(0,V.useRef)({});return Object.keys(Dt(o,[...i,...a])).filter(e=>d.current[e]!==o[e]).forEach(e=>u(e,o[e])),d.current=o,(0,V.useImperativeHandle)(s,()=>Object.fromEntries(i.map(e=>[e,(...n)=>u(e,...n)])),[u]),V.createElement(n,{ref:c})})}function kt(e,n=V.useEffect){let r=(0,V.useRef)(),i=(0,V.useRef)(!1),a=(0,V.useRef)(!1),[o,s]=(0,V.useState)(0);i.current&&(a.current=!0),n(()=>(i.current||=(r.current=e(),!0),s(e=>e+1),()=>{a.current&&=(r.current&&r.current(),r.current=void 0,i.current=!1,!1)}),[])}var At=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:1024**(e-1)},Out:function(e){return e===1?1:1-2**(-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-(2**(10*(e-1)))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:2**(-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*2**(10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*2**(-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var n=1.70158;return e===1?1:e*e*((n+1)*e-n)},Out:function(e){var n=1.70158;return e===0?0:--e*e*((n+1)*e+n)+1},InOut:function(e){var n=1.70158*1.525;return(e*=2)<1?.5*(e*e*((n+1)*e-n)):.5*((e-=2)*e*((n+1)*e+n)+2)}}),Bounce:Object.freeze({In:function(e){return 1-At.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?At.Bounce.In(e*2)*.5:At.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<2**-52?2**-52:e,e=e>1e4?1e4:e,{In:function(n){return n**+e},Out:function(n){return 1-(1-n)**e},InOut:function(n){return n<.5?(n*2)**e/2:(1-(2-n*2)**e)/2+.5}}}}),jt=function(){return performance.now()},Mt=function(){function e(){var e=[...arguments];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,e)}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map(function(n){return e._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(var i=0,a=n;i<a.length;i++){var o=a[i];(e=o._group)==null||e.remove(o),o._group=this,this._tweens[o.getId()]=o,this._tweensAddedDuringUpdate[o.getId()]=o}},e.prototype.remove=function(){for(var e=[...arguments],n=0,r=e;n<r.length;n++){var i=r[n];i._group=void 0,delete this._tweens[i.getId()],delete this._tweensAddedDuringUpdate[i.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(e){return!e.isPlaying()})},e.prototype.update=function(e,n){e===void 0&&(e=jt()),n===void 0&&(n=!0);var r=Object.keys(this._tweens);if(r.length!==0)for(;r.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<r.length;i++){var a=this._tweens[r[i]],o=!n;a&&a.update(e,o)===!1&&!n&&this.remove(a)}r=Object.keys(this._tweensAddedDuringUpdate)}},e}(),Nt={Linear:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),o=Nt.Utils.Linear;return n<0?o(e[0],e[1],i):n>1?o(e[r],e[r-1],r-i):o(e[a],e[a+1>r?r:a+1],i-a)},Bezier:function(e,n){for(var r=0,i=e.length-1,a=Math.pow,o=Nt.Utils.Bernstein,s=0;s<=i;s++)r+=a(1-n,i-s)*a(n,s)*e[s]*o(i,s);return r},CatmullRom:function(e,n){var r=e.length-1,i=r*n,a=Math.floor(i),o=Nt.Utils.CatmullRom;return e[0]===e[r]?(n<0&&(a=Math.floor(i=r*(1+n))),o(e[(a-1+r)%r],e[a],e[(a+1)%r],e[(a+2)%r],i-a)):n<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):n>1?e[r]-(o(e[r],e[r],e[r-1],e[r-1],i-r)-e[r]):o(e[a?a-1:0],e[a],e[r<a+1?r:a+1],e[r<a+2?r:a+2],i-a)},Utils:{Linear:function(e,n,r){return(n-e)*r+e},Bernstein:function(e,n){var r=Nt.Utils.Factorial;return r(e)/r(n)/r(e-n)},Factorial:(function(){var e=[1];return function(n){var r=1;if(e[n])return e[n];for(var i=n;i>1;i--)r*=i;return e[n]=r,r}})(),CatmullRom:function(e,n,r,i,a){var o=(r-e)*.5,s=(i-n)*.5,c=a*a,l=a*c;return(2*n-2*r+o+s)*l+(-3*n+3*r-2*o-s)*c+o*a+n}}},Pt=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Ft=new Mt,It=function(){function e(e,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=At.Linear.None,this._interpolationFunction=Nt.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=Pt.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=e,typeof n==`object`?(this._group=n,n.add(this)):n===!0&&(this._group=Ft,Ft.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,n){if(n===void 0&&(n=1e3),this._isPlaying)throw Error(`Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.`);return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(e){return e===void 0&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return e===void 0&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,n){if(e===void 0&&(e=jt()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var r in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var a in this._valuesEnd)i[a]=this._valuesEnd[a];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,n,r,i,a){for(var o in r){var s=e[o],c=Array.isArray(s),l=c?`array`:typeof s,u=!c&&Array.isArray(r[o]);if(!(l===`undefined`||l===`function`)){if(u){var d=r[o];if(d.length===0)continue;for(var f=[s],p=0,m=d.length;p<m;p+=1){var h=this._handleRelativeValue(s,d[p]);if(isNaN(h)){u=!1,console.warn(`Found invalid interpolation list. Skipping.`);break}f.push(h)}u&&(r[o]=f)}if((l===`object`||c)&&s&&!u){n[o]=c?[]:{};var g=s;for(var _ in g)n[o][_]=g[_];i[o]=c?[]:{};var d=r[o];if(!this._isDynamic){var v={};for(var _ in d)v[_]=d[_];r[o]=d=v}this._setupProperties(g,n[o],d,i[o],a)}else (n[o]===void 0||a)&&(n[o]=s),c||(n[o]*=1),u?i[o]=r[o].slice().reverse():i[o]=n[o]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(e){return e===void 0&&(e=jt()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=e,this)},e.prototype.resume=function(e){return e===void 0&&(e=jt()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var e=0,n=this._chainedTweens.length;e<n;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return e?(e.add(this),this):(console.warn(`tween.group() without args has been removed, use group.add(tween) instead.`),this)},e.prototype.remove=function(){var e;return(e=this._group)==null||e.remove(this),this},e.prototype.delay=function(e){return e===void 0&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return e===void 0&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return e===void 0&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return e===void 0&&(e=At.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return e===void 0&&(e=Nt.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){return this._chainedTweens=[...arguments],this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(n,r){var i=this;if(n===void 0&&(n=jt()),r===void 0&&(r=e.autoStartOnUpdate),this._isPaused)return!0;var a;if(!this._goToEnd&&!this._isPlaying)if(r)this.start(n,!0);else return!1;if(this._goToEnd=!1,n<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var o=n-this._startTime,s=this._duration+(this._repeatDelayTime??this._delayTime),c=this._duration+this._repeat*s,l=function(){if(i._duration===0||o>c)return 1;var e=o-Math.trunc(o/s)*s,n=Math.min(e/i._duration,1);return n===0&&o===i._duration?1:n}(),u=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),this._duration===0||o>=this._duration)if(this._repeat>0){var d=Math.min(Math.trunc((o-this._duration)/s)+1,this._repeat);for(a in isFinite(this._repeat)&&(this._repeat-=d),this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[a]==`string`&&(this._valuesStartRepeat[a]=this._valuesStartRepeat[a]+parseFloat(this._valuesEnd[a])),this._yoyo&&this._swapEndStartRepeatValues(a),this._valuesStart[a]=this._valuesStartRepeat[a];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*d,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var f=0,p=this._chainedTweens.length;f<p;f++)this._chainedTweens[f].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,n,r,i){for(var a in r)if(n[a]!==void 0){var o=n[a]||0,s=r[a];!Array.isArray(e[a])&&Array.isArray(s)?e[a]=this._interpolationFunction(s,i):typeof s==`object`&&s?this._updateProperties(e[a],o,s,i):(s=this._handleRelativeValue(o,s),typeof s==`number`&&(e[a]=o+(s-o)*i))}},e.prototype._handleRelativeValue=function(e,n){return typeof n==`string`?n.charAt(0)===`+`||n.charAt(0)===`-`?e+parseFloat(n):parseFloat(n):n},e.prototype._swapEndStartRepeatValues=function(e){var n=this._valuesStartRepeat[e],r=this._valuesEnd[e];typeof r==`string`?this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(r):this._valuesStartRepeat[e]=this._valuesEnd[e],this._valuesEnd[e]=n},e.autoStartOnUpdate=!1,e}();Pt.nextId;var Lt=Ft;Lt.getAll.bind(Lt),Lt.removeAll.bind(Lt),Lt.add.bind(Lt),Lt.remove.bind(Lt),Lt.update.bind(Lt);function Rt(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function zt(e){if(Array.isArray(e))return e}function Bt(e,n){if(!(e instanceof n))throw TypeError(`Cannot call a class as a function`)}function Vt(e,n,r){return Object.defineProperty(e,`prototype`,{writable:!1}),e}function Ht(e,n){var r=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r!=null){var i,a,o,s,c=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,n!==0)for(;!(l=(i=o.call(r)).done)&&(c.push(i.value),c.length!==n);l=!0);}catch(e){u=!0,a=e}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw a}}return c}}function Ut(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wt(e,n){return zt(e)||Ht(e,n)||Gt(e,n)||Ut()}function Gt(e,n){if(e){if(typeof e==`string`)return Rt(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rt(e,n):void 0}}var Kt=Vt(function e(n,r){var i=r.default,a=i===void 0?null:i,o=r.triggerUpdate,s=o===void 0?!0:o,c=r.onChange,l=c===void 0?function(e,n){}:c;Bt(this,e),this.name=n,this.defaultVal=a,this.triggerUpdate=s,this.onChange=l});function qt(e){var n=e.stateInit,r=n===void 0?function(){return{}}:n,i=e.props,a=i===void 0?{}:i,o=e.methods,s=o===void 0?{}:o,c=e.aliases,l=c===void 0?{}:c,u=e.init,d=u===void 0?function(){}:u,f=e.update,p=f===void 0?function(){}:f,m=Object.keys(a).map(function(e){return new Kt(e,a[e])});return function e(){var n=[...arguments],i=!!(this instanceof e&&this.constructor),a=i?n.shift():void 0,o=n[0],c=o===void 0?{}:o,u=Object.assign({},r instanceof Function?r(c):r,{initialised:!1}),f={};function h(e){return g(e,c),_(),h}var g=function(e,n){d.call(h,e,u,n),u.initialised=!0},_=st(function(){u.initialised&&(p.call(h,u,f),f={})},1);return m.forEach(function(e){h[e.name]=n(e);function n(e){var n=e.name,r=e.triggerUpdate,i=r===void 0?!1:r,a=e.onChange,o=a===void 0?function(e,n){}:a,s=e.defaultVal,c=s===void 0?null:s;return function(e){var r=u[n];if(!arguments.length)return r;var a=e===void 0?c:e;return u[n]=a,o.call(h,a,u,r),!f.hasOwnProperty(n)&&(f[n]=r),i&&_(),h}}}),Object.keys(s).forEach(function(e){h[e]=function(){var n,r=[...arguments];return(n=s[e]).call.apply(n,[h,u].concat(r))}}),Object.entries(l).forEach(function(e){var n=Wt(e,2),r=n[0];return h[r]=h[n[1]]}),h.resetProps=function(){return m.forEach(function(e){h[e.name](e.defaultVal)}),h},h.resetProps(),u._rerender=_,i&&a&&h(a),h}}var G=(function(e){return typeof e==`function`?e:typeof e==`string`?function(n){return n[e]}:function(n){return e}});function Jt(e){"@babel/helpers - typeof";return Jt=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Jt(e)}var Yt=/^\s+/,Xt=/\s+$/;function K(e,n){if(e||=``,n||={},e instanceof K)return e;if(!(this instanceof K))return new K(e,n);var r=Zt(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||r.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}K.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),n=e.r/255,r=e.g/255,i=e.b/255,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4;return .2126*a+.7152*o+.0722*s},setAlpha:function(e){return this._a=Sn(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=tn(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=tn(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?`hsv(`+n+`, `+r+`%, `+i+`%)`:`hsva(`+n+`, `+r+`%, `+i+`%, `+this._roundA+`)`},toHsl:function(){var e=$t(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=$t(this._r,this._g,this._b),n=Math.round(e.h*360),r=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?`hsl(`+n+`, `+r+`%, `+i+`%)`:`hsla(`+n+`, `+r+`%, `+i+`%, `+this._roundA+`)`},toHex:function(e){return rn(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return an(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(q(this._r,255)*100)+`%`,g:Math.round(q(this._g,255)*100)+`%`,b:Math.round(q(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(q(this._r,255)*100)+`%, `+Math.round(q(this._g,255)*100)+`%, `+Math.round(q(this._b,255)*100)+`%)`:`rgba(`+Math.round(q(this._r,255)*100)+`%, `+Math.round(q(this._g,255)*100)+`%, `+Math.round(q(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:bn[rn(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var n=`#`+on(this._r,this._g,this._b,this._a),r=n,i=this._gradientType?`GradientType = 1, `:``;if(e){var a=K(e);r=`#`+on(a._r,a._g,a._b,a._a)}return`progid:DXImageTransform.Microsoft.gradient(`+i+`startColorstr=`+n+`,endColorstr=`+r+`)`},toString:function(e){var n=!!e;e||=this._format;var r=!1,i=this._a<1&&this._a>=0;return!n&&i&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(r=this.toRgbString()),e===`prgb`&&(r=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(r=this.toHexString()),e===`hex3`&&(r=this.toHexString(!0)),e===`hex4`&&(r=this.toHex8String(!0)),e===`hex8`&&(r=this.toHex8String()),e===`name`&&(r=this.toName()),e===`hsl`&&(r=this.toHslString()),e===`hsv`&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return K(this.toString())},_applyModification:function(e,n){var r=e.apply(null,[this].concat([].slice.call(n)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(un,arguments)},brighten:function(){return this._applyModification(dn,arguments)},darken:function(){return this._applyModification(fn,arguments)},desaturate:function(){return this._applyModification(sn,arguments)},saturate:function(){return this._applyModification(cn,arguments)},greyscale:function(){return this._applyModification(ln,arguments)},spin:function(){return this._applyModification(pn,arguments)},_applyCombination:function(e,n){return e.apply(null,[this].concat([].slice.call(n)))},analogous:function(){return this._applyCombination(_n,arguments)},complement:function(){return this._applyCombination(mn,arguments)},monochromatic:function(){return this._applyCombination(vn,arguments)},splitcomplement:function(){return this._applyCombination(gn,arguments)},triad:function(){return this._applyCombination(hn,[3])},tetrad:function(){return this._applyCombination(hn,[4])}},K.fromRatio=function(e,n){if(Jt(e)==`object`){var r={};for(var i in e)e.hasOwnProperty(i)&&(i===`a`?r[i]=e[i]:r[i]=On(e[i]));e=r}return K(e,n)};function Zt(e){var n={r:0,g:0,b:0},r=1,i=null,a=null,o=null,s=!1,c=!1;return typeof e==`string`&&(e=Nn(e)),Jt(e)==`object`&&(Mn(e.r)&&Mn(e.g)&&Mn(e.b)?(n=Qt(e.r,e.g,e.b),s=!0,c=String(e.r).substr(-1)===`%`?`prgb`:`rgb`):Mn(e.h)&&Mn(e.s)&&Mn(e.v)?(i=On(e.s),a=On(e.v),n=nn(e.h,i,a),s=!0,c=`hsv`):Mn(e.h)&&Mn(e.s)&&Mn(e.l)&&(i=On(e.s),o=On(e.l),n=en(e.h,i,o),s=!0,c=`hsl`),e.hasOwnProperty(`a`)&&(r=e.a)),r=Sn(r),{ok:s,format:e.format||c,r:Math.min(255,Math.max(n.r,0)),g:Math.min(255,Math.max(n.g,0)),b:Math.min(255,Math.max(n.b,0)),a:r}}function Qt(e,n,r){return{r:q(e,255)*255,g:q(n,255)*255,b:q(r,255)*255}}function $t(e,n,r){e=q(e,255),n=q(n,255),r=q(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),o,s,c=(i+a)/2;if(i==a)o=s=0;else{var l=i-a;switch(s=c>.5?l/(2-i-a):l/(i+a),i){case e:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-e)/l+2;break;case r:o=(e-n)/l+4;break}o/=6}return{h:o,s,l:c}}function en(e,n,r){var i,a,o;e=q(e,360),n=q(n,100),r=q(r,100);function s(e,n,r){return r<0&&(r+=1),r>1&&--r,r<1/6?e+(n-e)*6*r:r<1/2?n:r<2/3?e+(n-e)*(2/3-r)*6:e}if(n===0)i=a=o=r;else{var c=r<.5?r*(1+n):r+n-r*n,l=2*r-c;i=s(l,c,e+1/3),a=s(l,c,e),o=s(l,c,e-1/3)}return{r:i*255,g:a*255,b:o*255}}function tn(e,n,r){e=q(e,255),n=q(n,255),r=q(r,255);var i=Math.max(e,n,r),a=Math.min(e,n,r),o,s,c=i,l=i-a;if(s=i===0?0:l/i,i==a)o=0;else{switch(i){case e:o=(n-r)/l+(n<r?6:0);break;case n:o=(r-e)/l+2;break;case r:o=(e-n)/l+4;break}o/=6}return{h:o,s,v:c}}function nn(e,n,r){e=q(e,360)*6,n=q(n,100),r=q(r,100);var i=Math.floor(e),a=e-i,o=r*(1-n),s=r*(1-a*n),c=r*(1-(1-a)*n),l=i%6,u=[r,s,o,o,c,r][l],d=[c,r,r,s,o,o][l],f=[o,o,c,r,r,s][l];return{r:u*255,g:d*255,b:f*255}}function rn(e,n,r,i){var a=[Dn(Math.round(e).toString(16)),Dn(Math.round(n).toString(16)),Dn(Math.round(r).toString(16))];return i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join(``)}function an(e,n,r,i,a){var o=[Dn(Math.round(e).toString(16)),Dn(Math.round(n).toString(16)),Dn(Math.round(r).toString(16)),Dn(kn(i))];return a&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join(``)}function on(e,n,r,i){return[Dn(kn(i)),Dn(Math.round(e).toString(16)),Dn(Math.round(n).toString(16)),Dn(Math.round(r).toString(16))].join(``)}K.equals=function(e,n){return!e||!n?!1:K(e).toRgbString()==K(n).toRgbString()},K.random=function(){return K.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function sn(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.s-=n/100,r.s=Cn(r.s),K(r)}function cn(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.s+=n/100,r.s=Cn(r.s),K(r)}function ln(e){return K(e).desaturate(100)}function un(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.l+=n/100,r.l=Cn(r.l),K(r)}function dn(e,n){n=n===0?0:n||10;var r=K(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(n/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(n/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(n/100)))),K(r)}function fn(e,n){n=n===0?0:n||10;var r=K(e).toHsl();return r.l-=n/100,r.l=Cn(r.l),K(r)}function pn(e,n){var r=K(e).toHsl(),i=(r.h+n)%360;return r.h=i<0?360+i:i,K(r)}function mn(e){var n=K(e).toHsl();return n.h=(n.h+180)%360,K(n)}function hn(e,n){if(isNaN(n)||n<=0)throw Error(`Argument to polyad must be a positive number`);for(var r=K(e).toHsl(),i=[K(e)],a=360/n,o=1;o<n;o++)i.push(K({h:(r.h+o*a)%360,s:r.s,l:r.l}));return i}function gn(e){var n=K(e).toHsl(),r=n.h;return[K(e),K({h:(r+72)%360,s:n.s,l:n.l}),K({h:(r+216)%360,s:n.s,l:n.l})]}function _n(e,n,r){n||=6,r||=30;var i=K(e).toHsl(),a=360/r,o=[K(e)];for(i.h=(i.h-(a*n>>1)+720)%360;--n;)i.h=(i.h+a)%360,o.push(K(i));return o}function vn(e,n){n||=6;for(var r=K(e).toHsv(),i=r.h,a=r.s,o=r.v,s=[],c=1/n;n--;)s.push(K({h:i,s:a,v:o})),o=(o+c)%1;return s}K.mix=function(e,n,r){r=r===0?0:r||50;var i=K(e).toRgb(),a=K(n).toRgb(),o=r/100;return K({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},K.readability=function(e,n){var r=K(e),i=K(n);return(Math.max(r.getLuminance(),i.getLuminance())+.05)/(Math.min(r.getLuminance(),i.getLuminance())+.05)},K.isReadable=function(e,n,r){var i=K.readability(e,n),a,o=!1;switch(a=Pn(r),a.level+a.size){case`AAsmall`:case`AAAlarge`:o=i>=4.5;break;case`AAlarge`:o=i>=3;break;case`AAAsmall`:o=i>=7;break}return o},K.mostReadable=function(e,n,r){var i=null,a=0,o,s,c,l;r||={},s=r.includeFallbackColors,c=r.level,l=r.size;for(var u=0;u<n.length;u++)o=K.readability(e,n[u]),o>a&&(a=o,i=K(n[u]));return K.isReadable(e,i,{level:c,size:l})||!s?i:(r.includeFallbackColors=!1,K.mostReadable(e,[`#fff`,`#000`],r))};var yn=K.names={aliceblue:`f0f8ff`,antiquewhite:`faebd7`,aqua:`0ff`,aquamarine:`7fffd4`,azure:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`000`,blanchedalmond:`ffebcd`,blue:`00f`,blueviolet:`8a2be2`,brown:`a52a2a`,burlywood:`deb887`,burntsienna:`ea7e5d`,cadetblue:`5f9ea0`,chartreuse:`7fff00`,chocolate:`d2691e`,coral:`ff7f50`,cornflowerblue:`6495ed`,cornsilk:`fff8dc`,crimson:`dc143c`,cyan:`0ff`,darkblue:`00008b`,darkcyan:`008b8b`,darkgoldenrod:`b8860b`,darkgray:`a9a9a9`,darkgreen:`006400`,darkgrey:`a9a9a9`,darkkhaki:`bdb76b`,darkmagenta:`8b008b`,darkolivegreen:`556b2f`,darkorange:`ff8c00`,darkorchid:`9932cc`,darkred:`8b0000`,darksalmon:`e9967a`,darkseagreen:`8fbc8f`,darkslateblue:`483d8b`,darkslategray:`2f4f4f`,darkslategrey:`2f4f4f`,darkturquoise:`00ced1`,darkviolet:`9400d3`,deeppink:`ff1493`,deepskyblue:`00bfff`,dimgray:`696969`,dimgrey:`696969`,dodgerblue:`1e90ff`,firebrick:`b22222`,floralwhite:`fffaf0`,forestgreen:`228b22`,fuchsia:`f0f`,gainsboro:`dcdcdc`,ghostwhite:`f8f8ff`,gold:`ffd700`,goldenrod:`daa520`,gray:`808080`,green:`008000`,greenyellow:`adff2f`,grey:`808080`,honeydew:`f0fff0`,hotpink:`ff69b4`,indianred:`cd5c5c`,indigo:`4b0082`,ivory:`fffff0`,khaki:`f0e68c`,lavender:`e6e6fa`,lavenderblush:`fff0f5`,lawngreen:`7cfc00`,lemonchiffon:`fffacd`,lightblue:`add8e6`,lightcoral:`f08080`,lightcyan:`e0ffff`,lightgoldenrodyellow:`fafad2`,lightgray:`d3d3d3`,lightgreen:`90ee90`,lightgrey:`d3d3d3`,lightpink:`ffb6c1`,lightsalmon:`ffa07a`,lightseagreen:`20b2aa`,lightskyblue:`87cefa`,lightslategray:`789`,lightslategrey:`789`,lightsteelblue:`b0c4de`,lightyellow:`ffffe0`,lime:`0f0`,limegreen:`32cd32`,linen:`faf0e6`,magenta:`f0f`,maroon:`800000`,mediumaquamarine:`66cdaa`,mediumblue:`0000cd`,mediumorchid:`ba55d3`,mediumpurple:`9370db`,mediumseagreen:`3cb371`,mediumslateblue:`7b68ee`,mediumspringgreen:`00fa9a`,mediumturquoise:`48d1cc`,mediumvioletred:`c71585`,midnightblue:`191970`,mintcream:`f5fffa`,mistyrose:`ffe4e1`,moccasin:`ffe4b5`,navajowhite:`ffdead`,navy:`000080`,oldlace:`fdf5e6`,olive:`808000`,olivedrab:`6b8e23`,orange:`ffa500`,orangered:`ff4500`,orchid:`da70d6`,palegoldenrod:`eee8aa`,palegreen:`98fb98`,paleturquoise:`afeeee`,palevioletred:`db7093`,papayawhip:`ffefd5`,peachpuff:`ffdab9`,peru:`cd853f`,pink:`ffc0cb`,plum:`dda0dd`,powderblue:`b0e0e6`,purple:`800080`,rebeccapurple:`663399`,red:`f00`,rosybrown:`bc8f8f`,royalblue:`4169e1`,saddlebrown:`8b4513`,salmon:`fa8072`,sandybrown:`f4a460`,seagreen:`2e8b57`,seashell:`fff5ee`,sienna:`a0522d`,silver:`c0c0c0`,skyblue:`87ceeb`,slateblue:`6a5acd`,slategray:`708090`,slategrey:`708090`,snow:`fffafa`,springgreen:`00ff7f`,steelblue:`4682b4`,tan:`d2b48c`,teal:`008080`,thistle:`d8bfd8`,tomato:`ff6347`,turquoise:`40e0d0`,violet:`ee82ee`,wheat:`f5deb3`,white:`fff`,whitesmoke:`f5f5f5`,yellow:`ff0`,yellowgreen:`9acd32`},bn=K.hexNames=xn(yn);function xn(e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[e[r]]=r);return n}function Sn(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function q(e,n){Tn(e)&&(e=`100%`);var r=En(e);return e=Math.min(n,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*n,10)/100),Math.abs(e-n)<1e-6?1:e%n/parseFloat(n)}function Cn(e){return Math.min(1,Math.max(0,e))}function wn(e){return parseInt(e,16)}function Tn(e){return typeof e==`string`&&e.indexOf(`.`)!=-1&&parseFloat(e)===1}function En(e){return typeof e==`string`&&e.indexOf(`%`)!=-1}function Dn(e){return e.length==1?`0`+e:``+e}function On(e){return e<=1&&(e=e*100+`%`),e}function kn(e){return Math.round(parseFloat(e)*255).toString(16)}function An(e){return wn(e)/255}var jn=function(){var e=`(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)`,n=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`,r=`[\\s|\\(]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)[,|\\s]+(`+e+`)\\s*\\)?`;return{CSS_UNIT:new RegExp(e),rgb:RegExp(`rgb`+n),rgba:RegExp(`rgba`+r),hsl:RegExp(`hsl`+n),hsla:RegExp(`hsla`+r),hsv:RegExp(`hsv`+n),hsva:RegExp(`hsva`+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Mn(e){return!!jn.CSS_UNIT.exec(e)}function Nn(e){e=e.replace(Yt,``).replace(Xt,``).toLowerCase();var n=!1;if(yn[e])e=yn[e],n=!0;else if(e==`transparent`)return{r:0,g:0,b:0,a:0,format:`name`};var r;return(r=jn.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=jn.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=jn.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=jn.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=jn.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=jn.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=jn.hex8.exec(e))?{r:wn(r[1]),g:wn(r[2]),b:wn(r[3]),a:An(r[4]),format:n?`name`:`hex8`}:(r=jn.hex6.exec(e))?{r:wn(r[1]),g:wn(r[2]),b:wn(r[3]),format:n?`name`:`hex`}:(r=jn.hex4.exec(e))?{r:wn(r[1]+``+r[1]),g:wn(r[2]+``+r[2]),b:wn(r[3]+``+r[3]),a:An(r[4]+``+r[4]),format:n?`name`:`hex8`}:(r=jn.hex3.exec(e))?{r:wn(r[1]+``+r[1]),g:wn(r[2]+``+r[2]),b:wn(r[3]+``+r[3]),format:n?`name`:`hex`}:!1}function Pn(e){var n,r;return e||={level:`AA`,size:`small`},n=(e.level||`AA`).toUpperCase(),r=(e.size||`small`).toLowerCase(),n!==`AA`&&n!==`AAA`&&(n=`AA`),r!==`small`&&r!==`large`&&(r=`small`),{level:n,size:r}}function Fn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function In(e){if(Array.isArray(e))return Fn(e)}function Ln(e,n,r){if(typeof e==`function`?e===n:e.has(n))return arguments.length<3?n:r;throw TypeError(`Private element is not present on this object`)}function Rn(e,n){if(n.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function zn(e,n){if(!(e instanceof n))throw TypeError(`Cannot call a class as a function`)}function Bn(e,n){return e.get(Ln(e,n))}function Vn(e,n,r){Rn(e,n),n.set(e,r)}function Hn(e,n,r){return e.set(Ln(e,n),r),r}function Un(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,`value`in i&&(i.writable=!0),Object.defineProperty(e,Yn(i.key),i)}}function Wn(e,n,r){return n&&Un(e.prototype,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Gn(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Kn(){throw TypeError(`Invalid attempt to spread non-iterable instance.
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Ln as n}from"./DocumentContext-BrlDlUx7.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./useQuery-ZeEDLtxh.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{t as l}from"./button-CA0dewJJ.js";import{t as u}from"./label-Bbz2bT-a.js";import{a as ee,i as d,n as f,o as p,r as m,s as h,t as g}from"./select-fWSYgcDA.js";import{n as _,t as v}from"./radio-group-BsZGGl8l.js";import{po as y}from"./dist-YRM6aCj22.js";import{n as b}from"./dist-DTX2HxC82.js";import{t as x}from"./dist-BgXDUIPy.js";import{t as S}from"./createLucideIcon-CAkY8Blx.js";import{t as te}from"./git-branch-BEl3Boky.js";import{o as C}from"./use-open-skill-CLhiKLe2.js";import{t as ne}from"./spinner-DmibE6UV.js";import{n as re,t as w}from"./use-popular-skills-CSwbHrqM.js";import{f as T,t as ie}from"./skill-scope-TpOVvXXj.js";import{t as ae}from"./input-DikXDeKw.js";import{a as oe,c as E,i as se,n as ce,o as le,s as D,t as O}from"./dialog-DD-GTVf9.js";import{N as ue,c as k,f as de,i as A,k as fe}from"./skills-api-Ci4vZCl_.js";import{n as j,r as pe,t as M}from"./input-group-DroArAL7.js";import{i as N,n as P,r as F,t as I}from"./tabs-BuseO5Xi.js";var L=S(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),R=e(r(),1),me=s();function he(e){let t=(0,me.c)(9),n=e===void 0?!0:e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`skills`,`openknowledge`],t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i={queryKey:r,enabled:n,staleTime:3e5,queryFn:z},t[1]=n,t[2]=i);let{data:a,isPending:s,isError:c}=o(i),l;t[3]===a?l=t[4]:(l=a??[],t[3]=a,t[4]=l);let u;return t[5]!==c||t[6]!==s||t[7]!==l?(u={skills:l,isPending:s,failed:c},t[5]=c,t[6]=s,t[7]=l,t[8]=u):u=t[8],u}async function z(){let[e,t]=await Promise.all([A(y),k(y)]);if(!e.ok)throw Error(e.error);let n=new Map((t.ok?t.results:[]).map(V));return(e.skills??[]).map(e=>({id:`${y}/${e.name}`,name:e.name,source:y,description:e.description??``,installs:n.get(e.name)??null,publisher:`inkeep/open-knowledge-skills`.split(`/`)[0]??null})).sort(B)}function B(e,t){return(t.installs??-1)-(e.installs??-1)}function V(e){return[e.name,e.installs]}var H=t(),ge=[{label:{id:`f8fH8W`},query:`design`},{label:{id:`-ySLQJ`},query:`git`},{label:{id:`qIJIrD`},query:`test`},{label:{id:`8Uv5e6`},query:`agent`},{label:{id:`UDb2YD`},query:`react`},{label:{id:`TbjyhA`},query:`docs`},{label:{id:`9wQrUU`},query:`refactor`},{label:{id:`HKH-W-`},query:`data`},{label:{id:`43qzxu`},query:`devops`},{label:{id:`a3LDKx`},query:`security`}];function U(e){let t=(0,me.c)(68),{scope:r,onNavigate:o}=e,{_:s}=a(),[c,u]=(0,R.useState)(``),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=[],t[0]=_):_=t[0];let[v,y]=(0,R.useState)(_),[b,x]=(0,R.useState)(!1),[S,te]=(0,R.useState)(`idle`),[C,ne]=(0,R.useState)(`installs`),[T,ie]=(0,R.useState)(!1),{skills:ae}=w(),{skills:oe,isPending:E,failed:se}=he(T),ce,le;t[1]===c?(ce=t[2],le=t[3]):(ce=()=>{let e=c.trim();if(e.length<2){y([]),te(`idle`);return}let t=!1;te(`searching`);let n=setTimeout(()=>{fe(e).then(e=>{if(!t){if(!e.ok){te(`error`),y([]),x(!1);return}y(e.results),x(e.degraded),te(`idle`)}})},300);return()=>{t=!0,clearTimeout(n)}},le=[c],t[1]=c,t[2]=ce,t[3]=le),(0,R.useEffect)(ce,le);let D;t[4]===c?D=t[5]:(D=c.trim(),t[4]=c,t[5]=D);let O=D,ue;t[6]!==v||t[7]!==C?(ue=C===`installs`?[...v].sort(W):v,t[6]=v,t[7]=C,t[8]=ue):ue=t[8];let k=ue,de;t[9]!==o||t[10]!==r?(de=e=>(0,H.jsx)(re,{scope:r,onNavigate:o,...e}),t[9]=o,t[10]=r,t[11]=de):de=t[11];let A=de,N;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,H.jsx)(j,{align:`inline-start`,children:(0,H.jsx)(n,{"aria-hidden":`true`})}),t[12]=N):N=t[12];let P;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{u(e.target.value),ie(!1)},t[13]=P):P=t[13];let F;t[14]===s?F=t[15]:(F=s({id:`BlLxpG`}),t[14]=s,t[15]=F);let I;t[16]===s?I=t[17]:(I=s({id:`BlLxpG`}),t[16]=s,t[17]=I);let L;t[18]!==c||t[19]!==I||t[20]!==F?(L=(0,H.jsxs)(M,{className:`h-9 flex-1`,children:[N,(0,H.jsx)(pe,{value:c,onChange:P,placeholder:F,"aria-label":I})]}),t[18]=c,t[19]=I,t[20]=F,t[21]=L):L=t[21];let z;t[22]!==s||t[23]!==O.length||t[24]!==v||t[25]!==C||t[26]!==S?(z=O.length>=2&&S===`idle`&&v.length>0?(0,H.jsxs)(g,{value:C,onValueChange:e=>ne(e),children:[(0,H.jsx)(p,{className:`h-9! w-40 shrink-0`,"aria-label":s({id:`eUFXS1`}),children:(0,H.jsx)(h,{})}),(0,H.jsx)(f,{children:(0,H.jsxs)(m,{children:[(0,H.jsx)(ee,{children:s({id:`_HgF9q`})}),(0,H.jsx)(d,{value:`relevance`,children:s({id:`7dZnmw`})}),(0,H.jsx)(d,{value:`installs`,children:s({id:`tc65fD`})})]})})]}):null,t[22]=s,t[23]=O.length,t[24]=v,t[25]=C,t[26]=S,t[27]=z):z=t[27];let B;t[28]!==L||t[29]!==z?(B=(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[L,z]}),t[28]=L,t[29]=z,t[30]=B):B=t[30];let V;t[31]===s?V=t[32]:(V=s({id:`LzM_ga`}),t[31]=s,t[32]=V);let U=T?`secondary`:`outline`,ve,G;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>{ie(_e),u(``)},G=(0,H.jsx)(i,{id:`1ruosn`}),t[33]=ve,t[34]=G):(ve=t[33],G=t[34]);let K;t[35]!==T||t[36]!==U?(K=(0,H.jsx)(l,{variant:U,size:`sm`,"aria-pressed":T,className:`h-6 shrink-0 rounded-full data-[active=true]:border-foreground/30`,"data-active":T,onClick:ve,children:G}),t[35]=T,t[36]=U,t[37]=K):K=t[37];let q;t[38]!==s||t[39]!==c?(q=ge.map(e=>{let t=c.trim().split(/\s+/).filter(Boolean),n=t.includes(e.query);return(0,H.jsx)(l,{variant:n?`secondary`:`outline`,size:`sm`,"aria-pressed":n,className:`h-6 shrink-0 rounded-full data-[active=true]:border-foreground/30`,"data-active":n,onClick:()=>{ie(!1),u((n?t.filter(t=>t!==e.query):[...t,e.query]).join(` `))},children:s(e.label)},e.query)}),t[38]=s,t[39]=c,t[40]=q):q=t[40];let J;t[41]!==V||t[42]!==K||t[43]!==q?(J=(0,H.jsxs)(`div`,{role:`group`,"aria-label":V,className:`flex shrink-0 gap-2 overflow-x-auto scroll-fade-mask-x [scrollbar-width:none]`,children:[K,q]}),t[41]=V,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==b||t[46]!==O.length?(Y=b&&O.length>=2?(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:(0,H.jsx)(i,{id:`MBKkUy`})}):null,t[45]=b,t[46]=O.length,t[47]=Y):Y=t[47];let X;t[48]!==s||t[49]!==A||t[50]!==oe||t[51]!==se||t[52]!==E||t[53]!==ae||t[54]!==O.length||t[55]!==v||t[56]!==T||t[57]!==k||t[58]!==S?(X=T?se?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`SFEWV6`})}):A({results:oe,pending:E,label:(0,H.jsx)(i,{id:`1ruosn`}),loadingLabel:s({id:`QGWzup`}),testId:`skills-openknowledge`}):O.length<2?ae.length>0?A({results:ae,label:(0,H.jsx)(i,{id:`gL_sdV`}),loadingLabel:s({id:`JDHcCM`})}):null:S===`error`?(0,H.jsx)(`p`,{className:`text-sm text-destructive`,children:(0,H.jsx)(i,{id:`yg_6wQ`})}):S===`idle`&&v.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`8t9T3-`})}):A({results:k,pending:S===`searching`,loadingLabel:s({id:`WRNXKp`})}),t[48]=s,t[49]=A,t[50]=oe,t[51]=se,t[52]=E,t[53]=ae,t[54]=O.length,t[55]=v,t[56]=T,t[57]=k,t[58]=S,t[59]=X):X=t[59];let Z;t[60]===X?Z=t[61]:(Z=(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto subtle-scrollbar scroll-fade-mask`,children:X}),t[60]=X,t[61]=Z);let Q;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,H.jsx)(`p`,{className:`-mb-3.5 shrink-0 text-center text-[11px] text-muted-foreground/80`,children:(0,H.jsx)(i,{id:`fg1U4e`,components:{0:(0,H.jsx)(`a`,{href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-foreground`})}})}),t[62]=Q):Q=t[62];let $;return t[63]!==B||t[64]!==J||t[65]!==Y||t[66]!==Z?($=(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[B,J,Y,Z,Q]}),t[63]=B,t[64]=J,t[65]=Y,t[66]=Z,t[67]=$):$=t[67],$}function _e(e){return!e}function W(e,t){return(t.installs??-1)-(e.installs??-1)}function ve(e,t){t.alreadyImported?b.success(e===`upload`?x._({id:`tA2-xC`,values:{0:t.name}}):x._({id:`8AjnFz`,values:{0:t.name}})):t.collisionRenamedFrom?b.success(e===`upload`?x._({id:`EPGePE`,values:{0:t.name,1:t.collisionRenamedFrom}}):x._({id:`C0Ciaj`,values:{0:t.name,1:t.collisionRenamedFrom}})):b.success(e===`upload`?x._({id:`Pg83C9`,values:{0:t.name}}):x._({id:`qFKsNl`,values:{0:t.name}}));for(let e of t.warnings??[])b.warning(e)}var G=`flex items-start justify-between gap-3 rounded-md border p-3 text-sm font-normal transition-colors cursor-pointer`;function K(e){let t=(0,me.c)(122),{defaultScope:n,onOpenChange:r,onImported:o}=e,{_:s}=a(),ee=(0,R.useId)(),m=(0,R.useId)(),y=(0,R.useId)(),x=(0,R.useId)(),S=(0,R.useId)(),re=T(),[w,oe]=(0,R.useState)(n),[E,se]=(0,R.useState)(`remote`),[D,O]=(0,R.useState)(``),[k,fe]=(0,R.useState)(``),[j,pe]=(0,R.useState)(null),[M,N]=(0,R.useState)(!1),[P,F]=(0,R.useState)(null),[I,he]=(0,R.useState)(!1),[z,B]=(0,R.useState)(!1),V=(0,R.useRef)(null),ge,U;t[0]===E?(ge=t[1],U=t[2]):(ge=()=>{let e=V.current;e&&(E===`folder`?(e.setAttribute(`webkitdirectory`,``),e.setAttribute(`directory`,``)):(e.removeAttribute(`webkitdirectory`),e.removeAttribute(`directory`)))},U=[E],t[0]=E,t[1]=ge,t[2]=U),(0,R.useEffect)(ge,U);let _e;t[3]===D?_e=t[4]:(_e=D.trim(),t[3]=D,t[4]=_e);let W=_e,K=E===`zip`||E===`folder`,X=j?.[0]?.webkitRelativePath?.split(`/`)[0]??``,Z,Q;t[5]!==K||t[6]!==W?(Z=()=>{if(K||W===``){F(null),he(!1),B(!1),fe(``);return}let e=!1,t=new AbortController;he(!0),B(!1);let n=setTimeout(()=>{A(W,t.signal).then(t=>{if(!e){if(he(!1),!t.ok){F(null),fe(``),B(!0);return}B(!1),F(t.skills),fe(t.skills.length>1?t.skills[0].name:``)}})},500);return()=>{e=!0,t.abort(),clearTimeout(n)}},Q=[W,K],t[5]=K,t[6]=W,t[7]=Z,t[8]=Q):(Z=t[7],Q=t[8]),(0,R.useEffect)(Z,Q);let $=!M&&(K?j!==null&&j.length>0:W!==``),ye;t[9]!==s||t[10]!==$||t[11]!==j||t[12]!==K||t[13]!==o||t[14]!==r||t[15]!==w||t[16]!==k||t[17]!==E||t[18]!==W?(ye=async function(){if(!$)return;if(N(!0),K&&j!==null){let e=new FormData;if(E===`zip`)e.append(`file`,j[0]);else for(let t of Array.from(j))e.append(`files`,t,t.webkitRelativePath||t.name);let t=await ue(e,w);if(N(!1),!t.ok){b.error(s({id:`Z8nach`,values:{0:t.error}}));return}ve(`upload`,t),o({scope:w,name:t.name}),r(!1);return}let e=await de({source:W,...k.trim()===``?{}:{skill:k.trim()},scope:w});if(N(!1),!e.ok){if(e.skills&&e.skills.length>1){F(e.skills.map(Y)),fe(e.skills[0]),b.info(s({id:`iYUTsI`}));return}b.error(s({id:`kfL8BJ`,values:{0:e.error}}));return}ve(`import`,e),o({scope:w,name:e.name}),r(!1)},t[9]=s,t[10]=$,t[11]=j,t[12]=K,t[13]=o,t[14]=r,t[15]=w,t[16]=k,t[17]=E,t[18]=W,t[19]=ye):ye=t[19];let be=ye,xe=ce,Se;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,H.jsx)(i,{id:`aBgwis`}),t[20]=Se):Se=t[20];let Ce;t[21]===x?Ce=t[22]:(Ce=(0,H.jsx)(u,{htmlFor:x,children:Se}),t[21]=x,t[22]=Ce);let we;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>oe(e),t[23]=we):we=t[23];let Te;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,H.jsx)(h,{}),t[24]=Te):Te=t[24];let Ee;t[25]===x?Ee=t[26]:(Ee=(0,H.jsx)(p,{id:x,className:`w-full`,children:Te}),t[25]=x,t[26]=Ee);let De;t[27]===re?De=t[28]:(De=ie.map(e=>(0,H.jsx)(d,{value:e,children:re[e]},e)),t[27]=re,t[28]=De);let Oe;t[29]===De?Oe=t[30]:(Oe=(0,H.jsx)(f,{children:De}),t[29]=De,t[30]=Oe);let ke;t[31]!==w||t[32]!==Ee||t[33]!==Oe?(ke=(0,H.jsxs)(g,{value:w,onValueChange:we,children:[Ee,Oe]}),t[31]=w,t[32]=Ee,t[33]=Oe,t[34]=ke):ke=t[34];let Ae;t[35]!==ke||t[36]!==Ce?(Ae=(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ce,ke]}),t[35]=ke,t[36]=Ce,t[37]=Ae):Ae=t[37];let je;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,H.jsx)(i,{id:`wdxz7K`}),t[38]=je):je=t[38];let Me;t[39]===m?Me=t[40]:(Me=(0,H.jsx)(u,{id:m,children:je}),t[39]=m,t[40]=Me);let Ne;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=e=>{se(e),pe(null)},t[41]=Ne):Ne=t[41];let Pe=`${m}-remote`,Fe=E===`remote`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,Ie;t[42]===Fe?Ie=t[43]:(Ie=c(G,Fe),t[42]=Fe,t[43]=Ie);let Le;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(te,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,H.jsx)(i,{id:`qlAIQ1`})]}),t[44]=Le):Le=t[44];let Re;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,H.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[Le,(0,H.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`9m4D_h`})})]}),t[45]=Re):Re=t[45];let ze=`${m}-remote`,Be;t[46]===ze?Be=t[47]:(Be=(0,H.jsx)(_,{id:ze,value:`remote`,className:`mt-0.5`}),t[46]=ze,t[47]=Be);let Ve;t[48]!==Pe||t[49]!==Ie||t[50]!==Be?(Ve=(0,H.jsxs)(u,{htmlFor:Pe,className:Ie,children:[Re,Be]}),t[48]=Pe,t[49]=Ie,t[50]=Be,t[51]=Ve):Ve=t[51];let He=`${m}-zip`,Ue=E===`zip`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,We;t[52]===Ue?We=t[53]:(We=c(G,Ue),t[52]=Ue,t[53]=We);let Ge;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(L,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,H.jsx)(i,{id:`Fr8JGg`})]}),t[54]=Ge):Ge=t[54];let Ke;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,H.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[Ge,(0,H.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`hQjvzi`})})]}),t[55]=Ke):Ke=t[55];let qe=`${m}-zip`,Je;t[56]===qe?Je=t[57]:(Je=(0,H.jsx)(_,{id:qe,value:`zip`,className:`mt-0.5`}),t[56]=qe,t[57]=Je);let Ye;t[58]!==He||t[59]!==We||t[60]!==Je?(Ye=(0,H.jsxs)(u,{htmlFor:He,className:We,children:[Ke,Je]}),t[58]=He,t[59]=We,t[60]=Je,t[61]=Ye):Ye=t[61];let Xe=`${m}-folder`,Ze=E===`folder`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,Qe;t[62]===Ze?Qe=t[63]:(Qe=c(G,Ze),t[62]=Ze,t[63]=Qe);let $e;t[64]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(C,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,H.jsx)(i,{id:`kNqMMd`})]}),t[64]=$e):$e=t[64];let et;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,H.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[$e,(0,H.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`UPWItY`})})]}),t[65]=et):et=t[65];let tt=`${m}-folder`,nt;t[66]===tt?nt=t[67]:(nt=(0,H.jsx)(_,{id:tt,value:`folder`,className:`mt-0.5`}),t[66]=tt,t[67]=nt);let rt;t[68]!==Xe||t[69]!==Qe||t[70]!==nt?(rt=(0,H.jsxs)(u,{htmlFor:Xe,className:Qe,children:[et,nt]}),t[68]=Xe,t[69]=Qe,t[70]=nt,t[71]=rt):rt=t[71];let it;t[72]!==E||t[73]!==m||t[74]!==Ve||t[75]!==Ye||t[76]!==rt?(it=(0,H.jsxs)(v,{value:E,onValueChange:Ne,"aria-labelledby":m,className:`grid-cols-1 gap-2 sm:grid-cols-3 mb-2`,children:[Ve,Ye,rt]}),t[72]=E,t[73]=m,t[74]=Ve,t[75]=Ye,t[76]=rt,t[77]=it):it=t[77];let at=K?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ae,{ref:V,id:S,"aria-label":s(E===`zip`?{id:`wErce0`}:{id:`VJaBca`}),type:`file`,"data-testid":`skill-upload-input`,accept:E===`zip`?`.zip,.skill`:void 0,onChange:e=>pe(e.target.files),className:`sr-only`},E),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>V.current?.click(),children:E===`zip`?(0,H.jsx)(i,{id:`-yPBXI`}):(0,H.jsx)(i,{id:`TgZOXj`})}),(0,H.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,"data-testid":`skill-upload-filename`,children:j&&j.length>0?E===`folder`?j.length===1?s({id:`BGtzlf`,values:{uploadFolderName:X}}):s({id:`K7NMEc`,values:{0:j.length,uploadFolderName:X}}):j[0].name:(0,H.jsx)(i,{id:`hqCwRf`})})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ae,{id:ee,"aria-label":s({id:`cLP0Lf`}),"data-testid":`skill-import-source-input`,value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Enter`&&be()},placeholder:s({id:`gv5w9J`}),className:`font-mono`}),I||z||P&&P.length===1?(0,H.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:I?(0,H.jsx)(i,{id:`K4G55s`}):z?(0,H.jsx)(i,{id:`XgqUOy`}):P&&P.length===1?(0,H.jsx)(i,{id:`WpE38V`,values:{0:P[0].name}}):null}):null]}),ot;t[78]!==Me||t[79]!==it||t[80]!==at?(ot=(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Me,it,at]}),t[78]=Me,t[79]=it,t[80]=at,t[81]=ot):ot=t[81];let st;t[82]!==P||t[83]!==K||t[84]!==k||t[85]!==y?(st=!K&&P&&P.length>1?(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(u,{htmlFor:y,children:(0,H.jsx)(i,{id:`FCMaBz`})}),(0,H.jsxs)(g,{value:k,onValueChange:fe,children:[(0,H.jsx)(p,{id:y,size:`sm`,className:`w-full`,"data-testid":`skill-import-pick`,children:(0,H.jsx)(h,{})}),(0,H.jsx)(f,{children:P.map(J)})]}),(0,H.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`xtJgSe`})})]}):null,t[82]=P,t[83]=K,t[84]=k,t[85]=y,t[86]=st):st=t[86];let ct;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,H.jsx)(`p`,{className:`font-medium text-xs font-mono text-muted-foreground/80 uppercase tracking-wider`,children:(0,H.jsx)(i,{id:`DWJtEo`})}),t[87]=ct):ct=t[87];let lt;t[88]===w?lt=t[89]:(lt=(0,H.jsx)(`li`,{children:w===`project`?(0,H.jsx)(i,{id:`rucNcu`,components:{0:(0,H.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em] text-foreground/80`})}}):(0,H.jsx)(i,{id:`vjW-SM`,components:{0:(0,H.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em] text-foreground/80`})}})}),t[88]=w,t[89]=lt);let ut,dt;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,H.jsx)(`li`,{children:(0,H.jsx)(i,{id:`tqQBwN`})}),dt=(0,H.jsx)(`li`,{children:(0,H.jsx)(i,{id:`QB-moX`})}),t[90]=ut,t[91]=dt):(ut=t[90],dt=t[91]);let ft;t[92]===lt?ft=t[93]:(ft=(0,H.jsxs)(`div`,{role:`note`,className:`space-y-3`,"data-testid":`skill-import-disclosure`,children:[ct,(0,H.jsxs)(`ul`,{className:`list-disc space-y-2.5 pl-4 text-sm text-muted-foreground marker:text-muted-foreground/50`,children:[lt,ut,dt]})]}),t[92]=lt,t[93]=ft);let pt;t[94]!==xe||t[95]!==Ae||t[96]!==ot||t[97]!==st||t[98]!==ft?(pt=(0,H.jsxs)(xe,{className:`flex flex-col gap-6`,children:[Ae,ot,st,ft]}),t[94]=xe,t[95]=Ae,t[96]=ot,t[97]=st,t[98]=ft,t[99]=pt):pt=t[99];let mt;t[100]===r?mt=t[101]:(mt=()=>r(!1),t[100]=r,t[101]=mt);let ht;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,H.jsx)(i,{id:`dEgA5A`}),t[102]=ht):ht=t[102];let gt;t[103]!==M||t[104]!==mt?(gt=(0,H.jsx)(l,{variant:`outline`,className:`font-mono uppercase`,onMouseDown:q,onClick:mt,disabled:M,children:ht}),t[103]=M,t[104]=mt,t[105]=gt):gt=t[105];let _t=K?`skill-upload-button`:`skill-import-button`,vt;t[106]===be?vt=t[107]:(vt=()=>void be(),t[106]=be,t[107]=vt);let yt=!$,bt;t[108]!==M||t[109]!==K?(bt=M?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ne,{"aria-hidden":`true`,className:`size-4`}),K?(0,H.jsx)(i,{id:`_eguJc`}):(0,H.jsx)(i,{id:`RqSvT0`})]}):K?(0,H.jsx)(i,{id:`ONWvwQ`}):(0,H.jsx)(i,{id:`l3s5ri`}),t[108]=M,t[109]=K,t[110]=bt):bt=t[110];let xt;t[111]!==_t||t[112]!==vt||t[113]!==yt||t[114]!==bt?(xt=(0,H.jsx)(l,{"data-testid":_t,onClick:vt,disabled:yt,children:bt}),t[111]=_t,t[112]=vt,t[113]=yt,t[114]=bt,t[115]=xt):xt=t[115];let St;t[116]!==gt||t[117]!==xt?(St=(0,H.jsxs)(le,{children:[gt,xt]}),t[116]=gt,t[117]=xt,t[118]=St):St=t[118];let Ct;return t[119]!==pt||t[120]!==St?(Ct=(0,H.jsxs)(H.Fragment,{children:[pt,St]}),t[119]=pt,t[120]=St,t[121]=Ct):Ct=t[121],Ct}function q(e){return e.preventDefault()}function J(e){return(0,H.jsx)(d,{value:e.name,children:e.name},e.name)}function Y(e){return{name:e,description:null}}function X(e){let t=(0,me.c)(21),{defaultScope:n,open:r,onOpenChange:a,defaultTab:o,onImported:s}=e,c=o===void 0?`skills-sh`:o,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,H.jsx)(E,{children:(0,H.jsx)(i,{id:`GBQjiV`})}),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,H.jsxs)(D,{children:[l,(0,H.jsx)(oe,{className:`sr-only`,children:(0,H.jsx)(i,{id:`qTcVwj`})})]}),t[1]=u):u=t[1];let ee;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,H.jsx)(N,{variant:`line`,value:`skills-sh`,children:(0,H.jsx)(i,{id:`8tjQCz`})}),t[2]=ee):ee=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,H.jsxs)(F,{variant:`line`,className:`w-full justify-start gap-4 border-b p-0`,children:[ee,(0,H.jsx)(N,{variant:`line`,value:`upload`,children:(0,H.jsx)(i,{id:`ONWvwQ`})})]}),t[3]=d):d=t[3];let f;t[4]===a?f=t[5]:(f=()=>a(!1),t[4]=a,t[5]=f);let p;t[6]!==n||t[7]!==f?(p=(0,H.jsx)(P,{value:`skills-sh`,className:`h-[62vh] min-h-0 flex-none`,children:(0,H.jsx)(U,{scope:n,onNavigate:f})}),t[6]=n,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==n||t[10]!==s||t[11]!==a?(m=(0,H.jsx)(P,{value:`upload`,className:`mt-3 flex min-h-0 flex-1 flex-col gap-6`,children:(0,H.jsx)(K,{defaultScope:n,onOpenChange:a,onImported:s})}),t[9]=n,t[10]=s,t[11]=a,t[12]=m):m=t[12];let h;t[13]!==c||t[14]!==p||t[15]!==m?(h=(0,H.jsxs)(se,{className:`flex max-h-[85vh] flex-col gap-4 sm:max-w-4xl`,children:[u,(0,H.jsxs)(I,{defaultValue:c,className:`flex min-h-0 flex-1 flex-col gap-3`,children:[d,p,m]})]}),t[13]=c,t[14]=p,t[15]=m,t[16]=h):h=t[16];let g;return t[17]!==a||t[18]!==r||t[19]!==h?(g=(0,H.jsx)(O,{open:r,onOpenChange:a,children:h}),t[17]=a,t[18]=r,t[19]=h,t[20]=g):g=t[20],g}export{X as ImportSkillDialog};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Ln as n}from"./DocumentContext-CuOcLr_j.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./useQuery-ZeEDLtxh.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{t as l}from"./button-CA0dewJJ.js";import{t as u}from"./label-Bbz2bT-a.js";import{a as ee,i as d,n as f,o as p,r as m,s as h,t as g}from"./select-fWSYgcDA.js";import{n as _,t as v}from"./radio-group-BsZGGl8l.js";import{po as y}from"./dist-DKOit9IV2.js";import{n as b}from"./dist-DTX2HxC82.js";import{t as x}from"./dist-BgXDUIPy.js";import{t as S}from"./createLucideIcon-CAkY8Blx.js";import{t as te}from"./git-branch-BEl3Boky.js";import{o as C}from"./use-open-skill-DdfCbjRH.js";import{t as ne}from"./spinner-DmibE6UV.js";import{n as re,t as w}from"./use-popular-skills-DRwm43Dp.js";import{f as T,t as ie}from"./skill-scope-C_bc3f6T.js";import{t as ae}from"./input-DikXDeKw.js";import{a as oe,c as E,i as se,n as ce,o as le,s as D,t as O}from"./dialog-DD-GTVf9.js";import{N as ue,c as k,f as de,i as A,k as fe}from"./skills-api-B3AiUodv.js";import{n as j,r as pe,t as M}from"./input-group-DroArAL7.js";import{i as N,n as P,r as F,t as I}from"./tabs-BuseO5Xi.js";var L=S(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),R=e(r(),1),me=s();function he(e){let t=(0,me.c)(9),n=e===void 0?!0:e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`skills`,`openknowledge`],t[0]=r):r=t[0];let i;t[1]===n?i=t[2]:(i={queryKey:r,enabled:n,staleTime:3e5,queryFn:z},t[1]=n,t[2]=i);let{data:a,isPending:s,isError:c}=o(i),l;t[3]===a?l=t[4]:(l=a??[],t[3]=a,t[4]=l);let u;return t[5]!==c||t[6]!==s||t[7]!==l?(u={skills:l,isPending:s,failed:c},t[5]=c,t[6]=s,t[7]=l,t[8]=u):u=t[8],u}async function z(){let[e,t]=await Promise.all([A(y),k(y)]);if(!e.ok)throw Error(e.error);let n=new Map((t.ok?t.results:[]).map(V));return(e.skills??[]).map(e=>({id:`${y}/${e.name}`,name:e.name,source:y,description:e.description??``,installs:n.get(e.name)??null,publisher:`inkeep/open-knowledge-skills`.split(`/`)[0]??null})).sort(B)}function B(e,t){return(t.installs??-1)-(e.installs??-1)}function V(e){return[e.name,e.installs]}var H=t(),ge=[{label:{id:`f8fH8W`},query:`design`},{label:{id:`-ySLQJ`},query:`git`},{label:{id:`qIJIrD`},query:`test`},{label:{id:`8Uv5e6`},query:`agent`},{label:{id:`UDb2YD`},query:`react`},{label:{id:`TbjyhA`},query:`docs`},{label:{id:`9wQrUU`},query:`refactor`},{label:{id:`HKH-W-`},query:`data`},{label:{id:`43qzxu`},query:`devops`},{label:{id:`a3LDKx`},query:`security`}];function U(e){let t=(0,me.c)(68),{scope:r,onNavigate:o}=e,{_:s}=a(),[c,u]=(0,R.useState)(``),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_=[],t[0]=_):_=t[0];let[v,y]=(0,R.useState)(_),[b,x]=(0,R.useState)(!1),[S,te]=(0,R.useState)(`idle`),[C,ne]=(0,R.useState)(`installs`),[T,ie]=(0,R.useState)(!1),{skills:ae}=w(),{skills:oe,isPending:E,failed:se}=he(T),ce,le;t[1]===c?(ce=t[2],le=t[3]):(ce=()=>{let e=c.trim();if(e.length<2){y([]),te(`idle`);return}let t=!1;te(`searching`);let n=setTimeout(()=>{fe(e).then(e=>{if(!t){if(!e.ok){te(`error`),y([]),x(!1);return}y(e.results),x(e.degraded),te(`idle`)}})},300);return()=>{t=!0,clearTimeout(n)}},le=[c],t[1]=c,t[2]=ce,t[3]=le),(0,R.useEffect)(ce,le);let D;t[4]===c?D=t[5]:(D=c.trim(),t[4]=c,t[5]=D);let O=D,ue;t[6]!==v||t[7]!==C?(ue=C===`installs`?[...v].sort(W):v,t[6]=v,t[7]=C,t[8]=ue):ue=t[8];let k=ue,de;t[9]!==o||t[10]!==r?(de=e=>(0,H.jsx)(re,{scope:r,onNavigate:o,...e}),t[9]=o,t[10]=r,t[11]=de):de=t[11];let A=de,N;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,H.jsx)(j,{align:`inline-start`,children:(0,H.jsx)(n,{"aria-hidden":`true`})}),t[12]=N):N=t[12];let P;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>{u(e.target.value),ie(!1)},t[13]=P):P=t[13];let F;t[14]===s?F=t[15]:(F=s({id:`BlLxpG`}),t[14]=s,t[15]=F);let I;t[16]===s?I=t[17]:(I=s({id:`BlLxpG`}),t[16]=s,t[17]=I);let L;t[18]!==c||t[19]!==I||t[20]!==F?(L=(0,H.jsxs)(M,{className:`h-9 flex-1`,children:[N,(0,H.jsx)(pe,{value:c,onChange:P,placeholder:F,"aria-label":I})]}),t[18]=c,t[19]=I,t[20]=F,t[21]=L):L=t[21];let z;t[22]!==s||t[23]!==O.length||t[24]!==v||t[25]!==C||t[26]!==S?(z=O.length>=2&&S===`idle`&&v.length>0?(0,H.jsxs)(g,{value:C,onValueChange:e=>ne(e),children:[(0,H.jsx)(p,{className:`h-9! w-40 shrink-0`,"aria-label":s({id:`eUFXS1`}),children:(0,H.jsx)(h,{})}),(0,H.jsx)(f,{children:(0,H.jsxs)(m,{children:[(0,H.jsx)(ee,{children:s({id:`_HgF9q`})}),(0,H.jsx)(d,{value:`relevance`,children:s({id:`7dZnmw`})}),(0,H.jsx)(d,{value:`installs`,children:s({id:`tc65fD`})})]})})]}):null,t[22]=s,t[23]=O.length,t[24]=v,t[25]=C,t[26]=S,t[27]=z):z=t[27];let B;t[28]!==L||t[29]!==z?(B=(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[L,z]}),t[28]=L,t[29]=z,t[30]=B):B=t[30];let V;t[31]===s?V=t[32]:(V=s({id:`LzM_ga`}),t[31]=s,t[32]=V);let U=T?`secondary`:`outline`,ve,G;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ve=()=>{ie(_e),u(``)},G=(0,H.jsx)(i,{id:`1ruosn`}),t[33]=ve,t[34]=G):(ve=t[33],G=t[34]);let K;t[35]!==T||t[36]!==U?(K=(0,H.jsx)(l,{variant:U,size:`sm`,"aria-pressed":T,className:`h-6 shrink-0 rounded-full data-[active=true]:border-foreground/30`,"data-active":T,onClick:ve,children:G}),t[35]=T,t[36]=U,t[37]=K):K=t[37];let q;t[38]!==s||t[39]!==c?(q=ge.map(e=>{let t=c.trim().split(/\s+/).filter(Boolean),n=t.includes(e.query);return(0,H.jsx)(l,{variant:n?`secondary`:`outline`,size:`sm`,"aria-pressed":n,className:`h-6 shrink-0 rounded-full data-[active=true]:border-foreground/30`,"data-active":n,onClick:()=>{ie(!1),u((n?t.filter(t=>t!==e.query):[...t,e.query]).join(` `))},children:s(e.label)},e.query)}),t[38]=s,t[39]=c,t[40]=q):q=t[40];let J;t[41]!==V||t[42]!==K||t[43]!==q?(J=(0,H.jsxs)(`div`,{role:`group`,"aria-label":V,className:`flex shrink-0 gap-2 overflow-x-auto scroll-fade-mask-x [scrollbar-width:none]`,children:[K,q]}),t[41]=V,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==b||t[46]!==O.length?(Y=b&&O.length>=2?(0,H.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:(0,H.jsx)(i,{id:`MBKkUy`})}):null,t[45]=b,t[46]=O.length,t[47]=Y):Y=t[47];let X;t[48]!==s||t[49]!==A||t[50]!==oe||t[51]!==se||t[52]!==E||t[53]!==ae||t[54]!==O.length||t[55]!==v||t[56]!==T||t[57]!==k||t[58]!==S?(X=T?se?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`SFEWV6`})}):A({results:oe,pending:E,label:(0,H.jsx)(i,{id:`1ruosn`}),loadingLabel:s({id:`QGWzup`}),testId:`skills-openknowledge`}):O.length<2?ae.length>0?A({results:ae,label:(0,H.jsx)(i,{id:`gL_sdV`}),loadingLabel:s({id:`JDHcCM`})}):null:S===`error`?(0,H.jsx)(`p`,{className:`text-sm text-destructive`,children:(0,H.jsx)(i,{id:`yg_6wQ`})}):S===`idle`&&v.length===0?(0,H.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`8t9T3-`})}):A({results:k,pending:S===`searching`,loadingLabel:s({id:`WRNXKp`})}),t[48]=s,t[49]=A,t[50]=oe,t[51]=se,t[52]=E,t[53]=ae,t[54]=O.length,t[55]=v,t[56]=T,t[57]=k,t[58]=S,t[59]=X):X=t[59];let Z;t[60]===X?Z=t[61]:(Z=(0,H.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto subtle-scrollbar scroll-fade-mask`,children:X}),t[60]=X,t[61]=Z);let Q;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,H.jsx)(`p`,{className:`-mb-3.5 shrink-0 text-center text-[11px] text-muted-foreground/80`,children:(0,H.jsx)(i,{id:`fg1U4e`,components:{0:(0,H.jsx)(`a`,{href:`https://skills.sh`,target:`_blank`,rel:`noreferrer`,className:`underline hover:text-foreground`})}})}),t[62]=Q):Q=t[62];let $;return t[63]!==B||t[64]!==J||t[65]!==Y||t[66]!==Z?($=(0,H.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[B,J,Y,Z,Q]}),t[63]=B,t[64]=J,t[65]=Y,t[66]=Z,t[67]=$):$=t[67],$}function _e(e){return!e}function W(e,t){return(t.installs??-1)-(e.installs??-1)}function ve(e,t){t.alreadyImported?b.success(e===`upload`?x._({id:`tA2-xC`,values:{0:t.name}}):x._({id:`8AjnFz`,values:{0:t.name}})):t.collisionRenamedFrom?b.success(e===`upload`?x._({id:`EPGePE`,values:{0:t.name,1:t.collisionRenamedFrom}}):x._({id:`C0Ciaj`,values:{0:t.name,1:t.collisionRenamedFrom}})):b.success(e===`upload`?x._({id:`Pg83C9`,values:{0:t.name}}):x._({id:`qFKsNl`,values:{0:t.name}}));for(let e of t.warnings??[])b.warning(e)}var G=`flex items-start justify-between gap-3 rounded-md border p-3 text-sm font-normal transition-colors cursor-pointer`;function K(e){let t=(0,me.c)(122),{defaultScope:n,onOpenChange:r,onImported:o}=e,{_:s}=a(),ee=(0,R.useId)(),m=(0,R.useId)(),y=(0,R.useId)(),x=(0,R.useId)(),S=(0,R.useId)(),re=T(),[w,oe]=(0,R.useState)(n),[E,se]=(0,R.useState)(`remote`),[D,O]=(0,R.useState)(``),[k,fe]=(0,R.useState)(``),[j,pe]=(0,R.useState)(null),[M,N]=(0,R.useState)(!1),[P,F]=(0,R.useState)(null),[I,he]=(0,R.useState)(!1),[z,B]=(0,R.useState)(!1),V=(0,R.useRef)(null),ge,U;t[0]===E?(ge=t[1],U=t[2]):(ge=()=>{let e=V.current;e&&(E===`folder`?(e.setAttribute(`webkitdirectory`,``),e.setAttribute(`directory`,``)):(e.removeAttribute(`webkitdirectory`),e.removeAttribute(`directory`)))},U=[E],t[0]=E,t[1]=ge,t[2]=U),(0,R.useEffect)(ge,U);let _e;t[3]===D?_e=t[4]:(_e=D.trim(),t[3]=D,t[4]=_e);let W=_e,K=E===`zip`||E===`folder`,X=j?.[0]?.webkitRelativePath?.split(`/`)[0]??``,Z,Q;t[5]!==K||t[6]!==W?(Z=()=>{if(K||W===``){F(null),he(!1),B(!1),fe(``);return}let e=!1,t=new AbortController;he(!0),B(!1);let n=setTimeout(()=>{A(W,t.signal).then(t=>{if(!e){if(he(!1),!t.ok){F(null),fe(``),B(!0);return}B(!1),F(t.skills),fe(t.skills.length>1?t.skills[0].name:``)}})},500);return()=>{e=!0,t.abort(),clearTimeout(n)}},Q=[W,K],t[5]=K,t[6]=W,t[7]=Z,t[8]=Q):(Z=t[7],Q=t[8]),(0,R.useEffect)(Z,Q);let $=!M&&(K?j!==null&&j.length>0:W!==``),ye;t[9]!==s||t[10]!==$||t[11]!==j||t[12]!==K||t[13]!==o||t[14]!==r||t[15]!==w||t[16]!==k||t[17]!==E||t[18]!==W?(ye=async function(){if(!$)return;if(N(!0),K&&j!==null){let e=new FormData;if(E===`zip`)e.append(`file`,j[0]);else for(let t of Array.from(j))e.append(`files`,t,t.webkitRelativePath||t.name);let t=await ue(e,w);if(N(!1),!t.ok){b.error(s({id:`Z8nach`,values:{0:t.error}}));return}ve(`upload`,t),o({scope:w,name:t.name}),r(!1);return}let e=await de({source:W,...k.trim()===``?{}:{skill:k.trim()},scope:w});if(N(!1),!e.ok){if(e.skills&&e.skills.length>1){F(e.skills.map(Y)),fe(e.skills[0]),b.info(s({id:`iYUTsI`}));return}b.error(s({id:`kfL8BJ`,values:{0:e.error}}));return}ve(`import`,e),o({scope:w,name:e.name}),r(!1)},t[9]=s,t[10]=$,t[11]=j,t[12]=K,t[13]=o,t[14]=r,t[15]=w,t[16]=k,t[17]=E,t[18]=W,t[19]=ye):ye=t[19];let be=ye,xe=ce,Se;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,H.jsx)(i,{id:`aBgwis`}),t[20]=Se):Se=t[20];let Ce;t[21]===x?Ce=t[22]:(Ce=(0,H.jsx)(u,{htmlFor:x,children:Se}),t[21]=x,t[22]=Ce);let we;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(we=e=>oe(e),t[23]=we):we=t[23];let Te;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,H.jsx)(h,{}),t[24]=Te):Te=t[24];let Ee;t[25]===x?Ee=t[26]:(Ee=(0,H.jsx)(p,{id:x,className:`w-full`,children:Te}),t[25]=x,t[26]=Ee);let De;t[27]===re?De=t[28]:(De=ie.map(e=>(0,H.jsx)(d,{value:e,children:re[e]},e)),t[27]=re,t[28]=De);let Oe;t[29]===De?Oe=t[30]:(Oe=(0,H.jsx)(f,{children:De}),t[29]=De,t[30]=Oe);let ke;t[31]!==w||t[32]!==Ee||t[33]!==Oe?(ke=(0,H.jsxs)(g,{value:w,onValueChange:we,children:[Ee,Oe]}),t[31]=w,t[32]=Ee,t[33]=Oe,t[34]=ke):ke=t[34];let Ae;t[35]!==ke||t[36]!==Ce?(Ae=(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Ce,ke]}),t[35]=ke,t[36]=Ce,t[37]=Ae):Ae=t[37];let je;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,H.jsx)(i,{id:`wdxz7K`}),t[38]=je):je=t[38];let Me;t[39]===m?Me=t[40]:(Me=(0,H.jsx)(u,{id:m,children:je}),t[39]=m,t[40]=Me);let Ne;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=e=>{se(e),pe(null)},t[41]=Ne):Ne=t[41];let Pe=`${m}-remote`,Fe=E===`remote`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,Ie;t[42]===Fe?Ie=t[43]:(Ie=c(G,Fe),t[42]=Fe,t[43]=Ie);let Le;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(Le=(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(te,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,H.jsx)(i,{id:`qlAIQ1`})]}),t[44]=Le):Le=t[44];let Re;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Re=(0,H.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[Le,(0,H.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`9m4D_h`})})]}),t[45]=Re):Re=t[45];let ze=`${m}-remote`,Be;t[46]===ze?Be=t[47]:(Be=(0,H.jsx)(_,{id:ze,value:`remote`,className:`mt-0.5`}),t[46]=ze,t[47]=Be);let Ve;t[48]!==Pe||t[49]!==Ie||t[50]!==Be?(Ve=(0,H.jsxs)(u,{htmlFor:Pe,className:Ie,children:[Re,Be]}),t[48]=Pe,t[49]=Ie,t[50]=Be,t[51]=Ve):Ve=t[51];let He=`${m}-zip`,Ue=E===`zip`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,We;t[52]===Ue?We=t[53]:(We=c(G,Ue),t[52]=Ue,t[53]=We);let Ge;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(L,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,H.jsx)(i,{id:`Fr8JGg`})]}),t[54]=Ge):Ge=t[54];let Ke;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=(0,H.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[Ge,(0,H.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`hQjvzi`})})]}),t[55]=Ke):Ke=t[55];let qe=`${m}-zip`,Je;t[56]===qe?Je=t[57]:(Je=(0,H.jsx)(_,{id:qe,value:`zip`,className:`mt-0.5`}),t[56]=qe,t[57]=Je);let Ye;t[58]!==He||t[59]!==We||t[60]!==Je?(Ye=(0,H.jsxs)(u,{htmlFor:He,className:We,children:[Ke,Je]}),t[58]=He,t[59]=We,t[60]=Je,t[61]=Ye):Ye=t[61];let Xe=`${m}-folder`,Ze=E===`folder`?`border-primary bg-primary/5`:`border-border hover:bg-muted/40`,Qe;t[62]===Ze?Qe=t[63]:(Qe=c(G,Ze),t[62]=Ze,t[63]=Qe);let $e;t[64]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,H.jsxs)(`span`,{className:`flex items-center gap-2 font-medium`,children:[(0,H.jsx)(C,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,H.jsx)(i,{id:`kNqMMd`})]}),t[64]=$e):$e=t[64];let et;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,H.jsxs)(`span`,{className:`flex flex-col gap-0.5`,children:[$e,(0,H.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`UPWItY`})})]}),t[65]=et):et=t[65];let tt=`${m}-folder`,nt;t[66]===tt?nt=t[67]:(nt=(0,H.jsx)(_,{id:tt,value:`folder`,className:`mt-0.5`}),t[66]=tt,t[67]=nt);let rt;t[68]!==Xe||t[69]!==Qe||t[70]!==nt?(rt=(0,H.jsxs)(u,{htmlFor:Xe,className:Qe,children:[et,nt]}),t[68]=Xe,t[69]=Qe,t[70]=nt,t[71]=rt):rt=t[71];let it;t[72]!==E||t[73]!==m||t[74]!==Ve||t[75]!==Ye||t[76]!==rt?(it=(0,H.jsxs)(v,{value:E,onValueChange:Ne,"aria-labelledby":m,className:`grid-cols-1 gap-2 sm:grid-cols-3 mb-2`,children:[Ve,Ye,rt]}),t[72]=E,t[73]=m,t[74]=Ve,t[75]=Ye,t[76]=rt,t[77]=it):it=t[77];let at=K?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ae,{ref:V,id:S,"aria-label":s(E===`zip`?{id:`wErce0`}:{id:`VJaBca`}),type:`file`,"data-testid":`skill-upload-input`,accept:E===`zip`?`.zip,.skill`:void 0,onChange:e=>pe(e.target.files),className:`sr-only`},E),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(l,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>V.current?.click(),children:E===`zip`?(0,H.jsx)(i,{id:`-yPBXI`}):(0,H.jsx)(i,{id:`TgZOXj`})}),(0,H.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,"data-testid":`skill-upload-filename`,children:j&&j.length>0?E===`folder`?j.length===1?s({id:`BGtzlf`,values:{uploadFolderName:X}}):s({id:`K7NMEc`,values:{0:j.length,uploadFolderName:X}}):j[0].name:(0,H.jsx)(i,{id:`hqCwRf`})})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ae,{id:ee,"aria-label":s({id:`cLP0Lf`}),"data-testid":`skill-import-source-input`,value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Enter`&&be()},placeholder:s({id:`gv5w9J`}),className:`font-mono`}),I||z||P&&P.length===1?(0,H.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:I?(0,H.jsx)(i,{id:`K4G55s`}):z?(0,H.jsx)(i,{id:`XgqUOy`}):P&&P.length===1?(0,H.jsx)(i,{id:`WpE38V`,values:{0:P[0].name}}):null}):null]}),ot;t[78]!==Me||t[79]!==it||t[80]!==at?(ot=(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[Me,it,at]}),t[78]=Me,t[79]=it,t[80]=at,t[81]=ot):ot=t[81];let st;t[82]!==P||t[83]!==K||t[84]!==k||t[85]!==y?(st=!K&&P&&P.length>1?(0,H.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,H.jsx)(u,{htmlFor:y,children:(0,H.jsx)(i,{id:`FCMaBz`})}),(0,H.jsxs)(g,{value:k,onValueChange:fe,children:[(0,H.jsx)(p,{id:y,size:`sm`,className:`w-full`,"data-testid":`skill-import-pick`,children:(0,H.jsx)(h,{})}),(0,H.jsx)(f,{children:P.map(J)})]}),(0,H.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,H.jsx)(i,{id:`xtJgSe`})})]}):null,t[82]=P,t[83]=K,t[84]=k,t[85]=y,t[86]=st):st=t[86];let ct;t[87]===Symbol.for(`react.memo_cache_sentinel`)?(ct=(0,H.jsx)(`p`,{className:`font-medium text-xs font-mono text-muted-foreground/80 uppercase tracking-wider`,children:(0,H.jsx)(i,{id:`DWJtEo`})}),t[87]=ct):ct=t[87];let lt;t[88]===w?lt=t[89]:(lt=(0,H.jsx)(`li`,{children:w===`project`?(0,H.jsx)(i,{id:`rucNcu`,components:{0:(0,H.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em] text-foreground/80`})}}):(0,H.jsx)(i,{id:`vjW-SM`,components:{0:(0,H.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-[0.9em] text-foreground/80`})}})}),t[88]=w,t[89]=lt);let ut,dt;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(ut=(0,H.jsx)(`li`,{children:(0,H.jsx)(i,{id:`tqQBwN`})}),dt=(0,H.jsx)(`li`,{children:(0,H.jsx)(i,{id:`QB-moX`})}),t[90]=ut,t[91]=dt):(ut=t[90],dt=t[91]);let ft;t[92]===lt?ft=t[93]:(ft=(0,H.jsxs)(`div`,{role:`note`,className:`space-y-3`,"data-testid":`skill-import-disclosure`,children:[ct,(0,H.jsxs)(`ul`,{className:`list-disc space-y-2.5 pl-4 text-sm text-muted-foreground marker:text-muted-foreground/50`,children:[lt,ut,dt]})]}),t[92]=lt,t[93]=ft);let pt;t[94]!==xe||t[95]!==Ae||t[96]!==ot||t[97]!==st||t[98]!==ft?(pt=(0,H.jsxs)(xe,{className:`flex flex-col gap-6`,children:[Ae,ot,st,ft]}),t[94]=xe,t[95]=Ae,t[96]=ot,t[97]=st,t[98]=ft,t[99]=pt):pt=t[99];let mt;t[100]===r?mt=t[101]:(mt=()=>r(!1),t[100]=r,t[101]=mt);let ht;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,H.jsx)(i,{id:`dEgA5A`}),t[102]=ht):ht=t[102];let gt;t[103]!==M||t[104]!==mt?(gt=(0,H.jsx)(l,{variant:`outline`,className:`font-mono uppercase`,onMouseDown:q,onClick:mt,disabled:M,children:ht}),t[103]=M,t[104]=mt,t[105]=gt):gt=t[105];let _t=K?`skill-upload-button`:`skill-import-button`,vt;t[106]===be?vt=t[107]:(vt=()=>void be(),t[106]=be,t[107]=vt);let yt=!$,bt;t[108]!==M||t[109]!==K?(bt=M?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(ne,{"aria-hidden":`true`,className:`size-4`}),K?(0,H.jsx)(i,{id:`_eguJc`}):(0,H.jsx)(i,{id:`RqSvT0`})]}):K?(0,H.jsx)(i,{id:`ONWvwQ`}):(0,H.jsx)(i,{id:`l3s5ri`}),t[108]=M,t[109]=K,t[110]=bt):bt=t[110];let xt;t[111]!==_t||t[112]!==vt||t[113]!==yt||t[114]!==bt?(xt=(0,H.jsx)(l,{"data-testid":_t,onClick:vt,disabled:yt,children:bt}),t[111]=_t,t[112]=vt,t[113]=yt,t[114]=bt,t[115]=xt):xt=t[115];let St;t[116]!==gt||t[117]!==xt?(St=(0,H.jsxs)(le,{children:[gt,xt]}),t[116]=gt,t[117]=xt,t[118]=St):St=t[118];let Ct;return t[119]!==pt||t[120]!==St?(Ct=(0,H.jsxs)(H.Fragment,{children:[pt,St]}),t[119]=pt,t[120]=St,t[121]=Ct):Ct=t[121],Ct}function q(e){return e.preventDefault()}function J(e){return(0,H.jsx)(d,{value:e.name,children:e.name},e.name)}function Y(e){return{name:e,description:null}}function X(e){let t=(0,me.c)(21),{defaultScope:n,open:r,onOpenChange:a,defaultTab:o,onImported:s}=e,c=o===void 0?`skills-sh`:o,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,H.jsx)(E,{children:(0,H.jsx)(i,{id:`GBQjiV`})}),t[0]=l):l=t[0];let u;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,H.jsxs)(D,{children:[l,(0,H.jsx)(oe,{className:`sr-only`,children:(0,H.jsx)(i,{id:`qTcVwj`})})]}),t[1]=u):u=t[1];let ee;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,H.jsx)(N,{variant:`line`,value:`skills-sh`,children:(0,H.jsx)(i,{id:`8tjQCz`})}),t[2]=ee):ee=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,H.jsxs)(F,{variant:`line`,className:`w-full justify-start gap-4 border-b p-0`,children:[ee,(0,H.jsx)(N,{variant:`line`,value:`upload`,children:(0,H.jsx)(i,{id:`ONWvwQ`})})]}),t[3]=d):d=t[3];let f;t[4]===a?f=t[5]:(f=()=>a(!1),t[4]=a,t[5]=f);let p;t[6]!==n||t[7]!==f?(p=(0,H.jsx)(P,{value:`skills-sh`,className:`h-[62vh] min-h-0 flex-none`,children:(0,H.jsx)(U,{scope:n,onNavigate:f})}),t[6]=n,t[7]=f,t[8]=p):p=t[8];let m;t[9]!==n||t[10]!==s||t[11]!==a?(m=(0,H.jsx)(P,{value:`upload`,className:`mt-3 flex min-h-0 flex-1 flex-col gap-6`,children:(0,H.jsx)(K,{defaultScope:n,onOpenChange:a,onImported:s})}),t[9]=n,t[10]=s,t[11]=a,t[12]=m):m=t[12];let h;t[13]!==c||t[14]!==p||t[15]!==m?(h=(0,H.jsxs)(se,{className:`flex max-h-[85vh] flex-col gap-4 sm:max-w-4xl`,children:[u,(0,H.jsxs)(I,{defaultValue:c,className:`flex min-h-0 flex-1 flex-col gap-3`,children:[d,p,m]})]}),t[13]=c,t[14]=p,t[15]=m,t[16]=h):h=t[16];let g;return t[17]!==a||t[18]!==r||t[19]!==h?(g=(0,H.jsx)(O,{open:r,onOpenChange:a,children:h}),t[17]=a,t[18]=r,t[19]=h,t[20]=g):g=t[20],g}export{X as ImportSkillDialog};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{r as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{d as r}from"./lint-config-client-DDlKZf1J.js";import{i,r as a,t as o}from"./EditorModeToggle-Coj-pKbp.js";import{t as s}from"./markdownlint-rule-browser-Cn61TsP6.js";import{t as c}from"./useLintConfigViewMode-BHa7i7v4.js";var l=n(),u=e();function d(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function f(e){let n=(0,l.c)(30),{assetPath:f}=e,{_:p}=t(),[m,h]=c(),{data:g}=r(),_=(g?.configFile??null)===f,v=!_||m===`source`,y;n[0]===f?y=n[1]:(y=f.split(`/`).pop()??f,n[0]=f,n[1]=y);let b=y,x;n[2]===b?x=n[3]:(x=b.includes(`.`)?(b.split(`.`).pop()??``).toLowerCase():``,n[2]=b,n[3]=x);let S=x,C;n[4]===f?C=n[5]:(C=(0,u.jsx)(a,{entry:{kind:`asset`,path:f},className:`shrink-0 border-b bg-background px-3 py-1.5`}),n[4]=f,n[5]=C);let w;n[6]===h?w=n[7]:(w=e=>h(e===`source`?`source`:`rules`),n[6]=h,n[7]=w);let T=!_,E;n[8]===p?E=n[9]:(E=p({id:`4EZrJN`}),n[8]=p,n[9]=E);let D;n[10]===p?D=n[11]:(D=p({id:`wdxz7K`}),n[10]=p,n[11]=D);let O;n[12]===p?O=n[13]:(O=p({id:`EeUucb`}),n[12]=p,n[13]=O);let k;n[14]!==v||n[15]!==w||n[16]!==T||n[17]!==E||n[18]!==D||n[19]!==O?(k=(0,u.jsx)(`div`,{className:`flex shrink-0 items-center justify-center border-b bg-background py-2`,children:(0,u.jsx)(o,{isSourceMode:v,onModeChange:w,wysiwygDisabled:T,wysiwygLabel:E,sourceLabel:D,wysiwygDisabledReason:O})}),n[14]=v,n[15]=w,n[16]=T,n[17]=E,n[18]=D,n[19]=O,n[20]=k):k=n[20];let A;n[21]!==f||n[22]!==S||n[23]!==b||n[24]!==v?(A=v?(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,u.jsx)(i,{src:d(f),assetPath:f,fileName:b,extension:S},f)}):(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,u.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,u.jsx)(s,{hideConfigSourceNote:!0})})}),n[21]=f,n[22]=S,n[23]=b,n[24]=v,n[25]=A):A=n[25];let j;return n[26]!==A||n[27]!==C||n[28]!==k?(j=(0,u.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-lint-config-editor":``,children:[C,k,A]}),n[26]=A,n[27]=C,n[28]=k,n[29]=j):j=n[29],j}export{f as LintConfigEditor};
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{r as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{d as r}from"./lint-config-client-Dwop4dqP.js";import{i,r as a,t as o}from"./EditorModeToggle-rmR5bMw6.js";import{t as s}from"./markdownlint-rule-browser-DH858hZX.js";import{t as c}from"./useLintConfigViewMode-BHa7i7v4.js";var l=n(),u=e();function d(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function f(e){let n=(0,l.c)(30),{assetPath:f}=e,{_:p}=t(),[m,h]=c(),{data:g}=r(),_=(g?.configFile??null)===f,v=!_||m===`source`,y;n[0]===f?y=n[1]:(y=f.split(`/`).pop()??f,n[0]=f,n[1]=y);let b=y,x;n[2]===b?x=n[3]:(x=b.includes(`.`)?(b.split(`.`).pop()??``).toLowerCase():``,n[2]=b,n[3]=x);let S=x,C;n[4]===f?C=n[5]:(C=(0,u.jsx)(a,{entry:{kind:`asset`,path:f},className:`shrink-0 border-b bg-background px-3 py-1.5`}),n[4]=f,n[5]=C);let w;n[6]===h?w=n[7]:(w=e=>h(e===`source`?`source`:`rules`),n[6]=h,n[7]=w);let T=!_,E;n[8]===p?E=n[9]:(E=p({id:`4EZrJN`}),n[8]=p,n[9]=E);let D;n[10]===p?D=n[11]:(D=p({id:`wdxz7K`}),n[10]=p,n[11]=D);let O;n[12]===p?O=n[13]:(O=p({id:`EeUucb`}),n[12]=p,n[13]=O);let k;n[14]!==v||n[15]!==w||n[16]!==T||n[17]!==E||n[18]!==D||n[19]!==O?(k=(0,u.jsx)(`div`,{className:`flex shrink-0 items-center justify-center border-b bg-background py-2`,children:(0,u.jsx)(o,{isSourceMode:v,onModeChange:w,wysiwygDisabled:T,wysiwygLabel:E,sourceLabel:D,wysiwygDisabledReason:O})}),n[14]=v,n[15]=w,n[16]=T,n[17]=E,n[18]=D,n[19]=O,n[20]=k):k=n[20];let A;n[21]!==f||n[22]!==S||n[23]!==b||n[24]!==v?(A=v?(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,u.jsx)(i,{src:d(f),assetPath:f,fileName:b,extension:S},f)}):(0,u.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-6`,children:(0,u.jsx)(`div`,{className:`mx-auto w-full max-w-3xl`,children:(0,u.jsx)(s,{hideConfigSourceNote:!0})})}),n[21]=f,n[22]=S,n[23]=b,n[24]=v,n[25]=A):A=n[25];let j;return n[26]!==A||n[27]!==C||n[28]!==k?(j=(0,u.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-background`,"data-lint-config-editor":``,children:[C,k,A]}),n[26]=A,n[27]=C,n[28]=k,n[29]=j):j=n[29],j}export{f as LintConfigEditor};
@@ -0,0 +1 @@
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{D as n,Pn as r,S as i,a,at as o,dt as s,fr as c,hr as l,jn as u,or as d,x as f,yr as p}from"./DocumentContext-CuOcLr_j.js";import{t as m}from"./react-f2sANaYj.js";import{n as h,r as g}from"./dist-Nvb76hAm.js";import{t as _}from"./compiler-runtime-BfE3aGVn.js";import{i as v}from"./local-menu-action-bus-aAi23OVU.js";import{t as y}from"./utils-CPqDy6Hr.js";import{t as b}from"./button-CA0dewJJ.js";import{n as x,r as S,t as C}from"./collapsible-COrqeoHr.js";import{i as w,n as T,o as E,s as D,t as O}from"./select-fWSYgcDA.js";import{Ci as k,Co as A,Li as j,Lo as M,No as N,Ri as P,So as F,Ss as I,To as L,Uo as R,Vo as z,Y as B,Yt as V,gn as H,jo as U,jt as W,ni as G,pr as K,wi as q,wo as J}from"./dist-DKOit9IV2.js";import{n as Y}from"./dist-DTX2HxC82.js";import{t as X}from"./createLucideIcon-CAkY8Blx.js";import{a as ee,c as te,d as ne,f as re,h as ie,i as ae,l as oe,m as se,n as ce,o as le,p as ue,r as de,s as fe,t as pe,u as me,v as he}from"./PropertyDisplayRow-CPeDXIFD.js";import{t as ge}from"./chevron-right-BVvjaUfh.js";import{o as _e,r as ve}from"./folder-config-api-DzbfltNv.js";import{h as ye,i as be}from"./comment-chips-DVNORTJ8.js";import{t as xe}from"./trash-2-BVoWHmfV.js";import{t as Se}from"./triangle-alert-CJVfCxE0.js";import{t as Ce}from"./x-wQUDJS55.js";import{S as we,f as Te}from"./doc-paths-DqOWEocR.js";import{s as Ee}from"./skill-scope-C_bc3f6T.js";import{t as De}from"./input-DikXDeKw.js";import{K as Oe,d as ke,v as Ae}from"./navigation-targets-jpdo1ZgU.js";import{t as je}from"./badge-Cl2jI51n.js";import{i as Me,n as Ne,r as Pe,t as Fe}from"./popover-C7NTz6uK.js";import{F as Ie,y as Le}from"./skills-api-B3AiUodv.js";import{a as Re,l as ze,r as Be,t as Ve}from"./selection-context-CS5s5L53.js";import{l as He}from"./lint-config-client-Dwop4dqP.js";import{_ as Ue,a as We,d as Ge,f as Ke,g as qe,h as Je,i as Ye,o as Xe,s as Ze,t as Qe,u as $e}from"./sortable.esm-DK-jMveF.js";import{t as et}from"./textarea-BoMa_3jF.js";import{t as tt}from"./SkillCostValue-zpzjADcj.js";var nt=X(`folder-git-2`,[[`path`,{d:`M18 19a5 5 0 0 1-5-5v8`,key:`sz5oeg`}],[`path`,{d:`M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v5`,key:`1w6njk`}],[`circle`,{cx:`13`,cy:`12`,r:`2`,key:`1j92g6`}],[`circle`,{cx:`20`,cy:`19`,r:`2`,key:`1obnsp`}]]),rt=X(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),it=X(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),at=X(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),Z=_(),Q=e(m(),1),$=t(),ot=Object.defineProperty,st=(e,t)=>{for(var n in t)ot(e,n,{get:t[n],enumerable:!0})},ct={};st(ct,{ActiveEmoji:()=>Jn,Empty:()=>qn,List:()=>Un,Loading:()=>Gn,Root:()=>Tn,Search:()=>En,SkinTone:()=>Yn,SkinToneSelector:()=>Wn,Viewport:()=>On});var lt=`'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'Android Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', EmojiSymbols, sans-serif`,ut=[`none`,`light`,`medium-light`,`medium`,`medium-dark`,`dark`];function dt(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ft=2,pt=null;function mt(e){try{pt??=document.createElement(`canvas`).getContext(`2d`,{willReadFrequently:!0})}catch{}if(!pt||(queueMicrotask(()=>{pt&&=null}),pt.canvas.width=ft,pt.canvas.height=ft,pt.font=`2px ${lt}`,pt.textBaseline=`middle`,pt.measureText(e).width>=ft*2))return!1;pt.fillStyle=`#00f`,pt.fillText(e,0,0);let t=pt.getImageData(0,0,ft,ft).data;pt.clearRect(0,0,ft,ft),pt.fillStyle=`#f00`,pt.fillText(e,0,0);let n=pt.getImageData(0,0,ft,ft).data;for(let e=0;e<ft*ft*4;e+=4)if(t[e]!==n[e]||t[e+1]!==n[e+1]||t[e+2]!==n[e+2])return!1;return!0}function ht(e,t,n){try{let r=e.getItem(t);if(!r)throw Error(`No value found for "${t}".`);return n(JSON.parse(r))}catch{return null}}function gt(e,t,n){e.setItem(t,JSON.stringify(n))}function _t(e){return t=>t===void 0?void 0:e(t)}function vt(e){return t=>t===null?null:e(t)}function yt(e){if(typeof e!=`string`)throw Error();return e}function bt(e){if(typeof e!=`number`)throw Error();return e}function xt(e){if(typeof e!=`boolean`)throw Error();return e}function St(e){return t=>{if(typeof t!=`object`||!t)throw Error();let n={};for(let r in e){let i=t[r];i===void 0&&e[r](void 0),n[r]=e[r](i)}return n}}function Ct(e){return t=>{if(!Array.isArray(t))throw Error();return t.length>0&&e(t[0]),t}}var wt=(e,t)=>`${e}/${t}/data.json`,Tt=(e,t)=>`${e}/${t}/messages.json`,Et=`bn.da.de.en-gb.en.es-mx.es.et.fi.fr.hi.hu.it.ja.ko.lt.ms.nb.nl.pl.pt.ru.sv.th.uk.vi.zh-hant.zh`.split(`.`),Dt=`en`,Ot=e=>`frimousse/data/${e}`,kt=`frimousse/metadata`;async function At(e,t){try{return(await fetch(e,{method:`HEAD`,signal:t})).headers.get(`etag`)}catch{return null}}async function jt(e,t,n){let[{emojis:r,emojisEtag:i},{messages:a,messagesEtag:o}]=await Promise.all([fetch(wt(e,t),{signal:n}).then(async e=>({emojis:await e.json(),emojisEtag:e.headers.get(`etag`)})),fetch(Tt(e,t),{signal:n}).then(async e=>({messages:await e.json(),messagesEtag:e.headers.get(`etag`)}))]);return{emojis:r,messages:a,emojisEtag:i,messagesEtag:o}}async function Mt(e,t,n){let[r,i]=await Promise.all([At(wt(e,t),n),At(Tt(e,t),n)]);return{emojisEtag:r,messagesEtag:i}}function Nt(e){return e.skins?e.skins.filter(e=>typeof e.tone==`number`).reduce((e,t)=>{let n=ut[t.tone];return e[n]=t.emoji,e},{}):void 0}async function Pt(e,t,n){let{emojis:r,emojisEtag:i,messages:a,messagesEtag:o}=await jt(e,t,n),s=a.subgroups.find(e=>e.key===`country-flag`||e.key===`subdivision-flag`),c=a.groups.filter(e=>e.key!==`component`),l=r.filter(e=>`group`in e),u=c.map(e=>({index:e.order,label:dt(e.message)})),d=a.skinTones.reduce((e,t)=>(e[t.key]=dt(t.message),e),{}),f={locale:t,emojis:l.map(e=>({emoji:e.emoji,category:e.group,version:e.version,label:dt(e.label),tags:e.tags??[],countryFlag:s&&e.subgroup===s.order||void 0,skins:Nt(e)})),categories:u,skinTones:d};return gt(localStorage,Ot(t),{data:f,metadata:{emojisEtag:i,messagesEtag:o}}),f}function Ft(e,t){let n=new Map;for(let t of e)n.has(t.version)||n.set(t.version,t.emoji);let r=[...n.keys()].sort((e,t)=>t-e),i=r[0]??0,a=mt(`🇪🇺`);if(typeof t==`number`)return{emojiVersion:t,countryFlags:a};for(let e of r)if(mt(n.get(e)))return{emojiVersion:e,countryFlags:a};return{emojiVersion:i,countryFlags:a}}var It=St({emojiVersion:bt,countryFlags:xt}),Lt=St({data:St({locale:yt,emojis:Ct(St({emoji:yt,category:bt,label:yt,version:bt,tags:Ct(yt),countryFlag:_t(xt),skins:_t(St({light:yt,"medium-light":yt,medium:yt,"medium-dark":yt,dark:yt}))})),categories:Ct(St({index:bt,label:yt})),skinTones:St({light:yt,"medium-light":yt,medium:yt,"medium-dark":yt,dark:yt})}),metadata:St({emojisEtag:vt(yt),messagesEtag:vt(yt)})});async function Rt({locale:e,emojiVersion:t,emojibaseUrl:n,signal:r}){let i=typeof n==`string`?n:`https://cdn.jsdelivr.net/npm/emojibase-data@${typeof t==`number`?Math.floor(t):`latest`}`,a=ht(sessionStorage,kt,It),o=ht(localStorage,Ot(e),Lt),s;if(!o)s=await Pt(i,e,r);else if(a)s=o.data;else try{let{emojisEtag:t,messagesEtag:n}=await Mt(i,e,r);s=!t||!n||t!==o.metadata.emojisEtag||n!==o.metadata.messagesEtag?await Pt(i,e,r):o.data}catch{s=o.data}return a??=Ft(s.emojis,t),gt(sessionStorage,kt,a),{locale:e,emojis:s.emojis.filter(e=>{let t=e.version<=a.emojiVersion;return e.countryFlag?t&&a.countryFlags:t}),categories:s.categories,skinTones:s.skinTones}}function zt(e){return Et.includes(e)?e:(console.warn(`Locale "${e}" is not supported, using "${Dt}" instead.`),Dt)}function Bt(e){return ut.includes(e)?e:(console.warn(`Skin tone "${e}" is not valid, using "none" instead.`),`none`)}function Vt(e,t){let n=[];if(t<=0)return n;for(let r=0,i=e.length;r<i;r+=t)n.push(e.slice(r,r+t));return n}function Ht(e,t){if(!t)return e;let n=t.toLowerCase().trim(),r=new WeakMap;return e.filter(e=>{let t=0;e.label.toLowerCase().includes(n)&&(t+=10);for(let r of e.tags)r.toLowerCase().includes(n)&&(t+=1);return t>0?(r.set(e,t),!0):!1}).sort((e,t)=>(r.get(t)??0)-(r.get(e)??0))}function Ut(e,t,n,r){let i=Ht(e.emojis,r),a=[],o=[],s=[],c={},l=0,u=0;for(let e of i)c[e.category]||(c[e.category]=[]),c[e.category].push({emoji:n&&n!==`none`&&e.skins?e.skins[n]:e.emoji,label:e.label});for(let n of e.categories){let e=c[n.index];if(!e||e.length===0)continue;let r=Vt(Array.from(e),t).map(e=>({categoryIndex:l,emojis:e}));a.push(...r),o.push({label:n.label,rowsCount:r.length,startRowIndex:u}),s.push(u),l++,u+=r.length}return{count:i.length,categories:o,categoriesStartRowIndices:s,rows:a,skinTones:e.skinTones}}function Wt(e){let t={},n=null,r=null,i=new Set,a=()=>{if(n){t=n,n=null;for(let e of i)e(t)}r=null},o=()=>n??t,s=e=>{n??=t,Object.assign(n,typeof e==`function`?e(o()):e),r||=requestAnimationFrame(a)};return t=e(s,o),{get:o,set:s,subscribe:e=>(i.add(e),()=>i.delete(e))}}function Gt(e){let[t]=(0,Q.useState)(e);return t}function Kt(e){let t=(0,Q.createContext)(null);return{useStore:()=>{let n=(0,Q.useContext)(t);if(!n)throw Error(e);return n},Provider:({store:e,children:n})=>(0,$.jsx)(t.Provider,{value:e,children:n})}}function qt(e,t,n=Object.is){let[r,i]=(0,Q.useState)(()=>t(e.get()));return(0,Q.useEffect)(()=>e.subscribe(()=>{let r=t(e.get());i(e=>n(e,r)?e:r)}),[e,t,n]),(0,Q.useDebugValue)(r),r}function Jt(e,t,n){return qt(e,(0,Q.useCallback)(e=>e[t],[t]),n)}var Yt=2;function Xt(e,t,n,r,i){let a=0;return Wt((o,s)=>({locale:t,columns:n,sticky:r,skinTone:i,onEmojiSelect:e,data:null,search:``,interaction:`none`,activeColumnIndex:0,activeRowIndex:0,rowHeight:null,categoryHeaderHeight:null,viewportWidth:null,viewportHeight:null,viewportCurrentCategoryIndex:null,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0,rootRef:null,searchRef:null,viewportRef:null,listRef:null,updateViewportState:e=>{let t=s(),n=e?.data??t.data,r=e?.categoryHeaderHeight??t.categoryHeaderHeight,i=e?.rowHeight??t.rowHeight,c=e?.viewportHeight??t.viewportHeight;if(!n||n.rows.length===0||!r||!i||!c)return o({...e,viewportStartCategoryIndex:0,viewportStartRowIndex:0,viewportEndRowIndex:0});let l=0,u=0;for(let e of n.categories)if(u++*r+e.startRowIndex*i<a)l+=r;else break;let d=n.categories.length*r+n.rows.length*i,f=Math.floor(Yt*i/2),p=Math.ceil(Yt*i/2),m=Math.min(a-l-f,d-c),h=m+c+p,g=Math.max(0,Math.floor(m/i)),_=Math.min(n.rows.length-1,Math.ceil(h/i)),v=n.rows[g]?.categoryIndex;return o(v===void 0&&e?e:{...e,viewportStartCategoryIndex:v,viewportStartRowIndex:g,viewportEndRowIndex:_})},onDataChange:e=>{s().updateViewportState({data:e,activeColumnIndex:0,activeRowIndex:0})},onSearchChange:e=>{o({search:e,interaction:e?`keyboard`:`none`})},onActiveEmojiChange:(e,t,n)=>{if(o({interaction:e,activeColumnIndex:t,activeRowIndex:n}),e!==`keyboard`)return;let{listRef:r,viewportRef:i,sticky:c,rowHeight:l,viewportHeight:u,categoryHeaderHeight:d}=s(),f=r?.current,p=i?.current;if(!f||!p||!l||!d||!u)return;let m=n;m===0&&p.scrollTo({top:0,behavior:`instant`});let h=f.querySelector(`[aria-rowindex="${m}"]`);if(!(h instanceof HTMLElement))return;let g=h.offsetTop,_=getComputedStyle(h),v=Number.parseFloat(_.scrollMarginTop),y=Number.parseFloat(_.scrollMarginBottom),b=a+v;c&&g<a+u/2&&(b+=d);let x=b+u-y;(g<b||g+l>x)&&p.scrollTo({top:Math.max(g<b+d?g-Math.max(c?d:0,v):g-u+l+y,0),behavior:`instant`})},onActiveEmojiReset:()=>{o({interaction:`none`,activeColumnIndex:0,activeRowIndex:0})},onRowHeightChange:e=>{s().updateViewportState({rowHeight:e})},onCategoryHeaderHeightChange:e=>{s().updateViewportState({categoryHeaderHeight:e})},onViewportSizeChange:(e,t)=>{s().updateViewportState({viewportWidth:e,viewportHeight:t})},onViewportScroll:e=>{a=e,s().updateViewportState()}}))}var{useStore:Zt,Provider:Qt}=Kt(`EmojiPicker.Root is missing.`);function $t(e){return e.search}function en(e){return e.interaction===`none`?void 0:e.data?.rows[e.activeRowIndex]?.emojis[e.activeColumnIndex]}function tn(e){return e.data===void 0||typeof e.data?.count==`number`&&e.data.count===0}function nn(e){return e.data===null||e.viewportHeight===null||e.rowHeight===null||e.categoryHeaderHeight===null}function rn(e){return e.data?.rows.length}function an(e){return e.data?.categories.length}function on(e){return e.data?.categoriesStartRowIndices}function sn(e){return e.data?.skinTones}function cn(e,t){return e?.emoji===t?.emoji}function ln(e,t){return e?.categoryIndex!==t?.categoryIndex||e?.emojis.length!==t?.emojis.length?!1:!!e?.emojis.every((e,n)=>cn(e,t?.emojis[n]))}var un=`‍`,dn=/\p{Emoji_Modifier_Base}/u,fn=/\uFE0F$/,pn=/\u{1F3FB}|\u{1F3FC}|\u{1F3FD}|\u{1F3FE}|\u{1F3FF}/gu,mn={light:`🏻`,"medium-light":`🏼`,medium:`🏽`,"medium-dark":`🏾`,dark:`🏿`};function hn(e,t){if(!e.split(un).some(e=>dn.test(e)))return e;let n=e.split(un).map(e=>e.replace(pn,``)).join(un);return t===`none`?n:n.split(un).map((e,n,r)=>{let i=r.length>1;return!dn.test(e)||i&&e===`🤝`?e:e.replace(fn,``)+mn[t]}).join(un)}function gn(e){return ut.map(t=>({skinTone:t,emoji:hn(e,t)}))}function _n(){return(0,Q.useDeferredValue)(qt(Zt(),en,cn))}function vn(e=`✋`){let t=Zt(),n=Jt(t,`skinTone`),r=(0,Q.useMemo)(()=>gn(e),[e]);return[n,(0,Q.useCallback)(e=>{t.set({skinTone:e})},[]),r]}function yn(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;let n=Object.keys(e),r=Object.keys(t);return n.length===r.length?n.every(n=>n in t&&e[n]===t[n]):!1}function bn(...e){}function xn(e,t){let n=null;if(typeof window.requestIdleCallback==`function`)n=window.requestIdleCallback(e,t);else{let r=Date.now();n=window.setTimeout(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,(t?.timeout??50)-(Date.now()-r))})},10)}return()=>{typeof window.cancelIdleCallback==`function`?window.cancelIdleCallback(n):window.clearTimeout(n)}}var Sn=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function Cn(e){let t=(0,Q.useRef)(e);return Sn(()=>{t.current=e}),(0,Q.useCallback)((...e)=>t.current(...e),[])}function wn({emojiVersion:e,emojibaseUrl:t}){let[n,r]=(0,Q.useState)(void 0),i=Zt(),a=Jt(i,`locale`),o=Jt(i,`columns`),s=Jt(i,`skinTone`),c=Jt(i,`search`);return(0,Q.useEffect)(()=>{let n=new AbortController,i=n.signal;return Rt({locale:a,emojiVersion:e,emojibaseUrl:t,signal:i}).then(e=>{r(e)}).catch(e=>{i.aborted||console.error(e)}),()=>{n.abort()}},[e,t,a]),(0,Q.useEffect)(()=>{if(n)return xn(()=>{i.get().onDataChange(Ut(n,o,s,c))},{timeout:100})},[n,o,s,c]),null}var Tn=(0,Q.forwardRef)(({locale:e=`en`,columns:t=9,skinTone:n=`none`,onEmojiSelect:r=bn,emojiVersion:i,emojibaseUrl:a,onFocusCapture:o,onBlurCapture:s,children:c,style:l,sticky:u=!0,...d},f)=>{let p=Cn(r),m=Gt(()=>Xt(p,zt(e),t,u,Bt(n))),[h,g]=(0,Q.useState)(!1),_=(0,Q.useRef)(null),v=(0,Q.useCallback)(e=>{e&&(_.current=e,m.set({rootRef:_}))},[]);Sn(()=>{m.set({locale:zt(e)})},[e]),Sn(()=>{m.set({columns:t})},[t]),Sn(()=>{m.set({sticky:u})},[u]),Sn(()=>{m.set({skinTone:Bt(n)})},[n]);let y=(0,Q.useCallback)(e=>{o?.(e);let{searchRef:t,viewportRef:n}=m.get(),r=e.target===t?.current||e.target.hasAttribute(`frimousse-search`),i=e.target===n?.current||e.target.hasAttribute(`frimousse-viewport`);e.isDefaultPrevented()||(g(r||i),e.isDefaultPrevented()||(g(r||i),i?m.get().onActiveEmojiChange(`keyboard`,0,0):r&&m.get().search===``&&m.set({interaction:`none`})))},[o]),b=(0,Q.useCallback)(e=>{s?.(e),!e.isDefaultPrevented()&&!e.currentTarget.contains(e.relatedTarget)&&g(!1)},[s]);return Sn(()=>{h||m.get().onActiveEmojiReset()},[h]),(0,Q.useImperativeHandle)(f,()=>_.current),(0,Q.useEffect)(()=>{if(!h)return;function e(e){if(e.defaultPrevented||!e.key.startsWith(`Arrow`)&&e.key!==`Enter`)return;let{data:t,onEmojiSelect:n,onActiveEmojiChange:r,interaction:i,activeColumnIndex:a,activeRowIndex:o}=m.get();if(e.key===`Enter`){let t=en(m.get());t&&(e.preventDefault(),n(t))}if(e.key.startsWith(`Arrow`)){let n=a,s=o;if(e.preventDefault(),i!==`none`){if(t?.rows&&t.rows.length>0)switch(e.key){case`ArrowLeft`:if(n===0){let e=s-1,r=t.rows[e];r&&(s=e,n=r.emojis.length-1)}else --n;break;case`ArrowRight`:if(n===t.rows[s].emojis.length-1){let e=s+1;t.rows[e]&&(s=e,n=0)}else n+=1;break;case`ArrowUp`:{let e=t.rows[s-1];e&&(--s,e.emojis[n]||(n=e.emojis.length-1));break}case`ArrowDown`:{let e=t.rows[s+1];e&&(s+=1,e.emojis[n]||(n=e.emojis.length-1));break}}r(`keyboard`,n,s)}else r(`keyboard`,0,0)}}return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[h]),Sn(()=>{let e=null,t=null,n=null,r=null,i=m.subscribe(i=>{_.current&&(e!==i.viewportWidth&&(e=i.viewportWidth,_.current.style.setProperty(`--frimousse-viewport-width`,`${i.viewportWidth}px`)),t!==i.viewportHeight&&(t=i.viewportHeight,_.current.style.setProperty(`--frimousse-viewport-height`,`${i.viewportHeight}px`)),n!==i.rowHeight&&(n=i.rowHeight,_.current.style.setProperty(`--frimousse-row-height`,`${i.rowHeight}px`)),r!==i.categoryHeaderHeight&&(r=i.categoryHeaderHeight,_.current.style.setProperty(`--frimousse-category-header-height`,`${i.categoryHeaderHeight}px`)))}),{viewportWidth:a,viewportHeight:o,rowHeight:s,categoryHeaderHeight:c}=m.get();return a&&_.current.style.setProperty(`--frimousse-viewport-width`,`${a}px`),o&&_.current.style.setProperty(`--frimousse-viewport-height`,`${o}px`),s&&_.current.style.setProperty(`--frimousse-row-height`,`${s}px`),c&&_.current.style.setProperty(`--frimousse-category-header-height`,`${c}px`),i},[]),(0,$.jsx)(`div`,{"data-focused":h?``:void 0,"frimousse-root":``,onBlurCapture:b,onFocusCapture:y,...d,ref:v,style:{"--frimousse-emoji-font":lt,...l},children:(0,$.jsxs)(Qt,{store:m,children:[(0,$.jsx)(wn,{emojiVersion:i,emojibaseUrl:a}),c]})})}),En=(0,Q.forwardRef)(({value:e,defaultValue:t,onChange:n,...r},i)=>{let a=Zt(),o=(0,Q.useRef)(null),s=(0,Q.useCallback)(e=>{e&&(o.current=e,a.set({searchRef:o}))},[]),c=typeof e==`string`,l=(0,Q.useRef)(c);(0,Q.useEffect)(()=>{l.current=c},[c]),Sn(()=>{a.set({search:typeof e==`string`?e:typeof t==`string`?t:``})},[]),Sn(()=>{typeof e==`string`&&a.get().onSearchChange(e)},[e]);let u=(0,Q.useCallback)(e=>{n?.(e),e.isDefaultPrevented()||a.get().onSearchChange(e.target.value)},[n]);return(0,Q.useImperativeHandle)(i,()=>o.current),(0,$.jsx)(`input`,{autoCapitalize:`off`,autoComplete:`off`,autoCorrect:`off`,enterKeyHint:`done`,"frimousse-search":``,placeholder:`Search…`,spellCheck:!1,type:`search`,...r,defaultValue:t,onChange:u,ref:s,value:e})}),Dn=(0,Q.memo)(()=>{let e=_n();return e?(0,$.jsx)(`div`,{"aria-live":`polite`,style:{border:0,clip:`rect(0, 0, 0, 0)`,height:1,margin:-1,overflow:`hidden`,padding:0,position:`absolute`,whiteSpace:`nowrap`,width:1,wordWrap:`normal`},children:e.label}):null}),On=(0,Q.forwardRef)(({children:e,onScroll:t,onKeyDown:n,style:r,...i},a)=>{let o=Zt(),s=(0,Q.useRef)(null),c=(0,Q.useCallback)(e=>{e&&(s.current=e,o.set({viewportRef:s}))},[]),l=qt(o,rn),u=qt(o,an),d=(0,Q.useCallback)(e=>{t?.(e),o.get().onViewportScroll(e.currentTarget.scrollTop)},[t]);return Sn(()=>{if(!s.current)return;let e=new ResizeObserver(([e])=>{let t=e?.borderBoxSize[0]?.inlineSize??0,n=e?.borderBoxSize[0]?.blockSize??0,{onViewportSizeChange:r,viewportHeight:i,viewportWidth:a}=o.get();(i!==n||a!==t)&&r(t,n)});return e.observe(s.current),o.get().onViewportSizeChange(s.current.offsetWidth,s.current.clientHeight),()=>{e.disconnect()}},[]),(0,Q.useImperativeHandle)(a,()=>s.current),(0,$.jsxs)(`div`,{"frimousse-viewport":``,...i,onScroll:d,ref:c,style:{position:`relative`,boxSizing:`border-box`,contain:`layout paint`,containIntrinsicSize:typeof l==`number`&&typeof u==`number`?`var(--frimousse-viewport-width, auto) calc(${l} * var(--frimousse-row-height) + ${u} * var(--frimousse-category-header-height))`:void 0,overflowY:`auto`,overscrollBehavior:`contain`,scrollbarGutter:`stable`,willChange:`scroll-position`,...r},children:[(0,$.jsx)(Dn,{}),e]})});function kn(e,t,n){return{emoji:{...e,isActive:n},role:`gridcell`,"aria-colindex":t,"aria-selected":n||void 0,"aria-label":e.label,"data-active":n?``:void 0,"frimousse-emoji":``,style:{fontFamily:`var(--frimousse-emoji-font)`},tabIndex:-1}}function An(e,t=!1){return{role:t?void 0:`row`,"aria-rowindex":t?void 0:e,"frimousse-row":``,style:{contain:t?void 0:`content`,height:t?void 0:`var(--frimousse-row-height)`,display:`flex`}}}function jn(e,t){return{"frimousse-category":``,style:{contain:`content`,top:t?`calc(${e} * var(--frimousse-category-header-height) + ${t.startRowIndex} * var(--frimousse-row-height))`:void 0,height:t?`calc(var(--frimousse-category-header-height) + ${t.rowsCount} * var(--frimousse-row-height))`:void 0,width:`100%`,pointerEvents:`none`,position:`absolute`}}}function Mn(e,t=!1,n=!0){return{category:e,"frimousse-category-header":``,style:{contain:t?void 0:`layout paint`,height:t?void 0:`var(--frimousse-category-header-height)`,pointerEvents:`auto`,position:n?`sticky`:void 0,top:0}}}function Nn(e,t,n,r){return{"frimousse-list-sizer":``,style:{position:`relative`,boxSizing:`border-box`,height:`calc(${e} * var(--frimousse-row-height) + ${t} * var(--frimousse-category-header-height))`,paddingTop:`calc(${n} * var(--frimousse-row-height) + ${r} * var(--frimousse-category-header-height))`}}}function Pn(e,t,n){return{"aria-colcount":e,"aria-rowcount":t,"frimousse-list":``,style:{"--frimousse-list-columns":e,...n},role:`grid`}}function Fn(e){e.preventDefault()}var In=(0,Q.memo)(({Emoji:e,emoji:t,columnIndex:n,rowIndex:r})=>{let i=Zt(),a=qt(i,e=>en(e)?.emoji===t.emoji),o=(0,Q.useCallback)(()=>{i.get().onEmojiSelect(t)},[t]),s=(0,Q.useCallback)(()=>{i.get().onActiveEmojiChange(`pointer`,n,r)},[n,r]),c=(0,Q.useCallback)(()=>{i.get().onActiveEmojiReset()},[]);return(0,$.jsx)(e,{...kn(t,n,a),onClick:o,onPointerDown:Fn,onPointerEnter:s,onPointerLeave:c})}),Ln=(0,Q.memo)(({Row:e,Emoji:t,rowIndex:n})=>{let r=qt(Zt(),e=>e.data?.rows[n],ln);return r?(0,$.jsx)(e,{...An(n),children:r.emojis.map((e,r)=>(0,$.jsx)(In,{Emoji:t,columnIndex:r,emoji:e,rowIndex:n},e.label))}):null}),Rn=(0,Q.memo)(({CategoryHeader:e,categoryIndex:t})=>{let n=Zt(),r=qt(n,e=>e.data?.categories[t],yn),i=Jt(n,`sticky`);return r?(0,$.jsx)(`div`,{...jn(t,r),children:(0,$.jsx)(e,{...Mn({label:r.label},!1,i)})}):null}),zn=(0,Q.memo)(({CategoryHeader:e,Row:t,Emoji:n})=>{let r=(0,Q.useRef)(null),i=Zt(),a=Jt(i,`columns`),o=(0,Q.useMemo)(()=>Array(a).fill({emoji:`🙂`,label:``}),[a]),s=(0,Q.useMemo)(()=>({label:`Category`}),[]),c=(0,Q.useRef)(null),l=(0,Q.useRef)(null);return Sn(()=>{let e=r.current?.parentElement?.parentElement;if(!e||!c.current||!l.current)return;let t=new ResizeObserver(e=>{for(let t of e){let e=t.contentRect.height,{onRowHeightChange:n,onCategoryHeaderHeightChange:r,rowHeight:a,categoryHeaderHeight:o}=i.get();t.target===c.current&&a!==e&&n(e),t.target===l.current&&o!==e&&r(e)}});t.observe(e),t.observe(c.current),t.observe(l.current);let{onRowHeightChange:n,onCategoryHeaderHeightChange:a}=i.get();return n(c.current.clientHeight),a(l.current.clientHeight),()=>{t.disconnect()}},[]),(0,$.jsxs)(`div`,{"aria-hidden":!0,ref:r,style:{height:0,visibility:`hidden`},children:[(0,$.jsx)(`div`,{"frimousse-row-sizer":``,ref:c,children:(0,$.jsx)(t,{...An(-1,!0),children:o.map((e,t)=>(0,$.jsx)(n,{...kn(e,t,!1)},t))})}),(0,$.jsx)(`div`,{...jn(-1),children:(0,$.jsx)(`div`,{"frimousse-category-header-sizer":``,ref:l,children:(0,$.jsx)(e,{...Mn(s,!0)})})})]})});function Bn({category:e,...t}){return(0,$.jsx)(`div`,{...t,children:e.label})}function Vn({emoji:e,...t}){return(0,$.jsx)(`button`,{type:`button`,...t,children:e.emoji})}function Hn({...e}){return(0,$.jsx)(`div`,{...e})}var Un=(0,Q.forwardRef)(({style:e,components:t,...n},r)=>{let i=Zt(),a=(0,Q.useRef)(null),o=(0,Q.useCallback)(e=>{e&&(a.current=e,i.set({listRef:a}))},[]),s=t?.CategoryHeader??Bn,c=t?.Emoji??Vn,l=t?.Row??Hn,u=Jt(i,`columns`),d=Jt(i,`viewportStartRowIndex`),f=Jt(i,`viewportEndRowIndex`),p=qt(i,rn),m=qt(i,on,yn),h=(0,Q.useMemo)(()=>m?.filter(e=>e<d).length??0,[m,d]),g=m?.length??0;return(0,Q.useImperativeHandle)(r,()=>a.current),!p||!m||g===0?(0,$.jsx)(`div`,{...Pn(u,0,e),...n,children:(0,$.jsx)(`div`,{...Nn(0,0,0,0),children:(0,$.jsx)(zn,{CategoryHeader:s,Emoji:c,Row:l})})}):(0,$.jsx)(`div`,{...Pn(u,p,e),...n,ref:o,children:(0,$.jsxs)(`div`,{...Nn(p,g,d,h),children:[(0,$.jsx)(zn,{CategoryHeader:s,Emoji:c,Row:l}),Array.from({length:f-d+1},(e,t)=>{let n=d+t;return(0,$.jsxs)(Q.Fragment,{children:[m.indexOf(n)>=0&&(0,$.jsx)(`div`,{style:{height:`var(--frimousse-category-header-height)`}}),(0,$.jsx)(Ln,{Emoji:c,Row:l,rowIndex:n})]},n)}),Array.from({length:g},(e,t)=>(0,$.jsx)(Rn,{CategoryHeader:s,categoryIndex:t},t))]})})}),Wn=(0,Q.forwardRef)(({emoji:e,onClick:t,"aria-label":n=`Change skin tone`,...r},i)=>{let a=qt(Zt(),sn,yn),[o,s,c]=vn(e),l=(0,Q.useMemo)(()=>Math.max(0,c.findIndex(e=>e.skinTone===o)),[o,c]),u=c[l],d=c[(l+1)%c.length].skinTone,f=o===`none`?void 0:a?.[o],p=d===`none`?void 0:a?.[d],m=(0,Q.useCallback)(e=>{t?.(e),e.isDefaultPrevented()||s(d)},[t,s,d]);return(0,$.jsx)(`button`,{type:`button`,...r,"aria-label":n+(p?` (${p})`:``),"aria-live":`polite`,"aria-valuetext":f,"frimousse-skin-tone-selector":``,onClick:m,ref:i,children:u.emoji})});function Gn({children:e,...t}){return qt(Zt(),nn)?(0,$.jsx)(`span`,{"frimousse-loading":``,...t,children:e}):null}function Kn({children:e}){return e({search:qt(Zt(),$t)})}function qn({children:e,...t}){return qt(Zt(),tn)?(0,$.jsx)(`span`,{"frimousse-empty":``,...t,children:typeof e==`function`?(0,$.jsx)(Kn,{children:e}):e}):null}function Jn({children:e}){return e({emoji:_n()})}function Yn({children:e,emoji:t}){let[n,r,i]=vn(t);return e({skinTone:n,setSkinTone:r,skinToneVariations:i})}Tn.displayName=`EmojiPicker.Root`,En.displayName=`EmojiPicker.Search`,On.displayName=`EmojiPicker.Viewport`,Un.displayName=`EmojiPicker.List`,Gn.displayName=`EmojiPicker.Loading`,qn.displayName=`EmojiPicker.Empty`,Wn.displayName=`EmojiPicker.SkinToneSelector`,Jn.displayName=`EmojiPicker.ActiveEmoji`,Yn.displayName=`EmojiPicker.SkinTone`;var Xn={CategoryHeader:({category:e,...t})=>(0,$.jsx)(`div`,{...t,className:`bg-popover px-3 pt-3 pb-1.5 font-medium text-muted-foreground text-xs`,children:e.label}),Row:({children:e,...t})=>(0,$.jsx)(`div`,{...t,className:`scroll-my-1.5 px-1.5`,children:e}),Emoji:({emoji:e,...t})=>(0,$.jsx)(`button`,{type:`button`,...t,className:`flex size-8 items-center justify-center rounded-md text-lg data-[active]:bg-accent`,children:e.emoji})};function Zn(e){let t=(0,Z.c)(11),{onSelect:n}=e,{_:r}=g(),i;t[0]===n?i=t[1]:(i=e=>{let{emoji:t}=e;return n(t)},t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`EarrCe`}),t[2]=r,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,$.jsx)(ct.Search,{className:`z-10 mx-2 mt-2 rounded-md border bg-background px-2.5 py-2 text-sm outline-none focus-visible:ring-2 focus-visible:ring-ring`,placeholder:a,autoFocus:!0}),t[4]=a,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,$.jsx)(ct.Loading,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,$.jsx)(h,{id:`yQE2r9`})}),t[6]=s):s=t[6];let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsxs)(ct.Viewport,{className:`relative flex-1 overscroll-contain outline-none`,children:[s,(0,$.jsx)(ct.Empty,{className:`absolute inset-0 flex items-center justify-center text-muted-foreground text-sm`,children:(0,$.jsx)(h,{id:`z1uNN0`})}),(0,$.jsx)(ct.List,{className:`select-none pb-1.5`,components:Xn})]}),t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==o?(l=(0,$.jsxs)(ct.Root,{className:`isolate flex h-[326px] w-[320px] flex-col bg-popover text-popover-foreground`,onEmojiSelect:i,children:[o,c]}),t[8]=i,t[9]=o,t[10]=l):l=t[10],l}var Qn=300;function $n(e,t){let n=(0,Z.c)(7),r;n[0]===t?r=n[1]:(r=t?.enabled?JSON.stringify(t):null,n[0]=t,n[1]=r);let i=r,a;n[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=[],n[2]=a):a=n[2];let[o,s]=(0,Q.useState)(a),c,l;return n[3]!==i||n[4]!==e?(c=()=>{if(!e||i===null){s(er);return}let t=JSON.parse(i),n=e.document.getText(`source`),r=null,a=!1,o=e.configuration.name,c=()=>void G(n.toString(),t,o).then(e=>{a||s(e)}).catch(e=>{a||console.warn(`[lint] lintDocument failed`,e)}),l=()=>{r&&clearTimeout(r),r=setTimeout(c,Qn)};return c(),n.observe(l),()=>{a=!0,r&&clearTimeout(r),n.unobserve(l)}},l=[e,i],n[3]=i,n[4]=e,n[5]=c,n[6]=l):(c=n[5],l=n[6]),(0,Q.useEffect)(c,l),o}function er(e){return e.length===0?e:[]}function tr(e,t){return t===``?!0:e.name.toLowerCase().includes(t.trim().toLowerCase())}var nr=-1;function rr(e){let t=(0,Z.c)(74),{rowId:n,value:r,suggestions:i,inputRef:a,autoFocus:o,error:s,errorId:c,onChange:l,onPick:u,onCommit:d,onCancel:f}=e,{_:p}=g(),m=`${(0,Q.useId)()}-fields`,_;t[0]!==o||t[1]!==i.length?(_=()=>o&&i.length>0,t[0]=o,t[1]=i.length,t[2]=_):_=t[2];let[v,y]=(0,Q.useState)(_),[b,x]=(0,Q.useState)(nr),S,C;if(t[3]!==i||t[4]!==r){let e;t[7]===r?e=t[8]:(e=e=>tr(e,r),t[7]=r,t[8]=e),S=i.filter(e);let n;t[9]===r?n=t[10]:(n=e=>e.name===r.trim(),t[9]=r,t[10]=n),C=S.some(n),t[3]=i,t[4]=r,t[5]=S,t[6]=C}else S=t[5],C=t[6];let w=C,T=v&&S.length>0&&!w,[E,D]=(0,Q.useState)(r);r!==E&&(D(r),x(nr));let O=T&&b!==nr?S[Math.min(b,S.length-1)]:void 0,k;t[11]===u?k=t[12]:(k=function(e){u(e),y(!1)},t[11]=u,t[12]=k);let A=k,j;t[13]!==O||t[14]!==w||t[15]!==S||t[16]!==b||t[17]!==T||t[18]!==m||t[19]!==f||t[20]!==d||t[21]!==A?(j=function(e){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(S.length===0||w)return;e.preventDefault();let t=e.key===`ArrowDown`?1:-1,n=t===1?0:S.length-1;if(!T){y(!0),x(n);return}let r=b===nr?n:(b+t+S.length)%S.length;x(r);let i=S[r];i&&document.getElementById(`${m}-${i.name}`)?.scrollIntoView?.({block:`nearest`});return}if(e.key===`Enter`){if(e.preventDefault(),O){A(O);return}y(!1),d();return}e.key===`Escape`&&(e.preventDefault(),T?y(!1):f())},t[13]=O,t[14]=w,t[15]=S,t[16]=b,t[17]=T,t[18]=m,t[19]=f,t[20]=d,t[21]=A,t[22]=j):j=t[22];let M=j,N;t[23]===p?N=t[24]:(N=p({id:`56xUL1`}),t[23]=p,t[24]=N);let P;t[25]===p?P=t[26]:(P=p({id:`CXj9C-`}),t[25]=p,t[26]=P);let F=s?!0:void 0,I=i.length>0?`combobox`:void 0,L=i.length>0?T:void 0,R=T?m:void 0,z=i.length>0?`list`:void 0,B=O?`${m}-${O.name}`:void 0,V;t[27]!==l||t[28]!==i.length?(V=e=>{l(e.target.value),i.length>0&&y(!0)},t[27]=l,t[28]=i.length,t[29]=V):V=t[29];let H;t[30]===i.length?H=t[31]:(H=()=>{i.length>0&&y(!0)},t[30]=i.length,t[31]=H);let U;t[32]!==o||t[33]!==c||t[34]!==M||t[35]!==a||t[36]!==n||t[37]!==R||t[38]!==z||t[39]!==B||t[40]!==V||t[41]!==H||t[42]!==N||t[43]!==P||t[44]!==F||t[45]!==I||t[46]!==L||t[47]!==r?(U=(0,$.jsx)(Ne,{asChild:!0,children:(0,$.jsx)(De,{ref:a,"data-testid":`add-property-name-input`,"data-key":n,type:`text`,value:r,autoFocus:o,placeholder:N,"aria-label":P,"aria-invalid":F,"aria-describedby":c,role:I,"aria-expanded":L,"aria-controls":R,"aria-autocomplete":z,"aria-activedescendant":B,onChange:V,onFocus:H,onKeyDown:M,className:`h-7 w-32 border-transparent bg-transparent px-2 text-sm shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm @max-[26rem]/prow:w-auto @max-[26rem]/prow:flex-1`})}),t[32]=o,t[33]=c,t[34]=M,t[35]=a,t[36]=n,t[37]=R,t[38]=z,t[39]=B,t[40]=V,t[41]=H,t[42]=N,t[43]=P,t[44]=F,t[45]=I,t[46]=L,t[47]=r,t[48]=U):U=t[48];let W;t[49]===a?W=t[50]:(W=e=>{let t=e.detail.originalEvent.target;t instanceof Node&&a.current?.contains(t)&&e.preventDefault()},t[49]=a,t[50]=W);let G;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(`div`,{"aria-hidden":!0,className:`px-2 py-1 text-[10px] font-medium text-muted-foreground uppercase tracking-wide`,children:(0,$.jsx)(h,{id:`bYUIzq`})}),t[51]=G):G=t[51];let K;t[52]===p?K=t[53]:(K=p({id:`bYUIzq`}),t[52]=p,t[53]=K);let q;if(t[54]!==O?.name||t[55]!==S||t[56]!==m||t[57]!==A){let e;t[59]!==O?.name||t[60]!==m||t[61]!==A?(e=(e,t)=>{let n=oe[e.type],r=e.name===O?.name;return(0,$.jsxs)(`div`,{id:`${m}-${e.name}`,role:`option`,"aria-selected":r,"data-testid":`add-property-field-suggestion`,"data-key":e.name,onMouseDown:t=>{t.preventDefault(),A(e)},onMouseEnter:()=>x(t),className:`flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm ${r?`bg-accent text-accent-foreground`:``}`,children:[(0,$.jsx)(n,{"aria-hidden":!0,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,$.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,$.jsx)(`span`,{className:`truncate`,children:e.name}),e.description?(0,$.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:e.description}):null]}),e.required?(0,$.jsx)(je,{variant:`gray`,className:`ms-auto shrink-0 text-2xs`,children:(0,$.jsx)(h,{id:`sW5OjU`})}):null]},e.name)},t[59]=O?.name,t[60]=m,t[61]=A,t[62]=e):e=t[62],q=S.map(e),t[54]=O?.name,t[55]=S,t[56]=m,t[57]=A,t[58]=q}else q=t[58];let J;t[63]!==m||t[64]!==K||t[65]!==q?(J=(0,$.jsx)(`div`,{id:m,role:`listbox`,"aria-label":K,children:q}),t[63]=m,t[64]=K,t[65]=q,t[66]=J):J=t[66];let Y;t[67]!==W||t[68]!==J?(Y=(0,$.jsxs)(Pe,{align:`start`,sideOffset:2,onOpenAutoFocus:ar,onCloseAutoFocus:ir,onInteractOutside:W,className:`w-64 max-h-64 overflow-y-auto p-1`,children:[G,J]}),t[67]=W,t[68]=J,t[69]=Y):Y=t[69];let X;return t[70]!==T||t[71]!==U||t[72]!==Y?(X=(0,$.jsxs)(Fe,{open:T,onOpenChange:y,children:[U,Y]}),t[70]=T,t[71]=U,t[72]=Y,t[73]=X):X=t[73],X}function ir(e){return e.preventDefault()}function ar(e){return e.preventDefault()}var or=(0,Q.createContext)(null);function sr(e){let t=(0,Z.c)(3),{binding:n,children:r}=e,i;return t[0]!==n||t[1]!==r?(i=(0,$.jsx)(or,{value:n,children:r}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function cr(){return(0,Q.use)(or)}function lr(e,t,n){if(e.code===`WRITE_ERROR`)return e.detail;let r=K(e);return r[t]?r[t]:e.issues[0]?.message??n}var ur=(0,Q.createContext)(null);function dr(e){let t=(0,Z.c)(3),{docName:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,$.jsx)(ur,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function fr(){return(0,Q.use)(ur)}var pr=/^(TEXTAREA|INPUT)$/;function mr(e){let t=document.activeElement;if(!(t instanceof HTMLElement)||!pr.test(t.tagName))return null;let n=e.closest(`[data-testid="property-row"]`);return n===null||!n.contains(t)?null:t}function hr(e){let t=mr(e);if(t===null)return null;let{selectionStart:n,selectionEnd:r}=t;if(n===null||r===null||n===r)return null;let i=t.value.slice(n,r).trim();return i===``?null:i}function gr(e){let t=(0,Z.c)(70),{propertyKey:n,propertyPath:r}=e,i;t[0]===r?i=t[1]:(i=r===void 0?[]:r,t[0]=r,t[1]=i);let a=i,{_:o}=g(),s=fr(),[c,l]=(0,Q.useState)(!1),[u,f]=(0,Q.useState)(``),[p,m]=(0,Q.useState)(null),_,v,y,x,S,C,w,T,E,D,O,k,A;if(t[2]!==o||t[3]!==s||t[4]!==u||t[5]!==c||t[6]!==n||t[7]!==a||t[8]!==p){C=Symbol.for(`react.early_return_sentinel`);bb0:{x=be(n,a);let e;if(t[22]!==s||t[23]!==u||t[24]!==n||t[25]!==a||t[26]!==p?(e=function(){let e=u.trim();e.length===0||s===null||(d({docName:s,propertyKey:n,propertyPath:[...a],quote:p??void 0,body:e}),f(``),l(!1))},t[22]=s,t[23]=u,t[24]=n,t[25]=a,t[26]=p,t[27]=e):e=t[27],S=e,s===null){C=null;break bb0}y=Fe,k=c,t[28]===Symbol.for(`react.memo_cache_sentinel`)?(A=e=>{l(e),e||(f(``),m(null))},t[28]=A):A=t[28],v=Me,O=!0,_=b,w=`button`,T=`property-comment-button`,E=x,D=o({id:`CxVk-w`,values:{address:x}})}t[2]=o,t[3]=s,t[4]=u,t[5]=c,t[6]=n,t[7]=a,t[8]=p,t[9]=_,t[10]=v,t[11]=y,t[12]=x,t[13]=S,t[14]=C,t[15]=w,t[16]=T,t[17]=E,t[18]=D,t[19]=O,t[20]=k,t[21]=A}else _=t[9],v=t[10],y=t[11],x=t[12],S=t[13],C=t[14],w=t[15],T=t[16],E=t[17],D=t[18],O=t[19],k=t[20],A=t[21];if(C!==Symbol.for(`react.early_return_sentinel`))return C;let j;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(j=e=>m(hr(e.currentTarget)),t[29]=j):j=t[29];let M;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(at,{className:`size-3.5`}),t[30]=M):M=t[30];let N;t[31]!==_||t[32]!==w||t[33]!==T||t[34]!==E||t[35]!==D?(N=(0,$.jsx)(_,{type:w,"data-testid":T,"data-key":E,"aria-label":D,onPointerDown:j,variant:`ghost`,size:`icon-sm`,className:`flex shrink-0 items-center justify-center rounded text-muted-foreground/0 hover:bg-muted hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:text-muted-foreground`,children:M}),t[31]=_,t[32]=w,t[33]=T,t[34]=E,t[35]=D,t[36]=N):N=t[36];let P;t[37]!==v||t[38]!==N||t[39]!==O?(P=(0,$.jsx)(v,{asChild:O,children:N}),t[37]=v,t[38]=N,t[39]=O,t[40]=P):P=t[40];let F;t[41]!==x||t[42]!==p?(F=p===null?(0,$.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,children:(0,$.jsx)(h,{id:`bwy8Y7`,values:{address:x},components:{0:(0,$.jsx)(`span`,{className:`font-mono`})}})}):(0,$.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,$.jsx)(`p`,{className:`truncate text-[11px] text-muted-foreground`,children:(0,$.jsx)(h,{id:`IgN3LY`,values:{address:x},components:{0:(0,$.jsx)(`span`,{className:`font-mono`})}})}),(0,$.jsx)(`p`,{className:`line-clamp-2 rounded border-l-2 border-muted-foreground/40 bg-muted/40 px-2 py-1 font-mono text-[11px] text-muted-foreground`,"data-testid":`property-comment-quote`,children:p})]}),t[41]=x,t[42]=p,t[43]=F):F=t[43];let I;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(I=e=>f(e.target.value),t[44]=I):I=t[44];let L;t[45]===S?L=t[46]:(L=e=>{if(e.key===`Escape`){l(!1);return}e.key!==`Enter`||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),S())},t[45]=S,t[46]=L);let R;t[47]===o?R=t[48]:(R=o({id:`vYOUOk`}),t[47]=o,t[48]=R);let z;t[49]!==u||t[50]!==L||t[51]!==R?(z=(0,$.jsx)(et,{autoFocus:!0,value:u,onChange:I,onKeyDown:L,placeholder:R,className:`min-h-16 resize-none text-sm`}),t[49]=u,t[50]=L,t[51]=R,t[52]=z):z=t[52];let B;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(b,{size:`sm`,variant:`ghost`,onClick:()=>l(!1),children:(0,$.jsx)(h,{id:`dEgA5A`})}),t[53]=B):B=t[53];let V;t[54]===u?V=t[55]:(V=u.trim(),t[54]=u,t[55]=V);let H=V.length===0,U;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(h,{id:`hqVQbT`}),t[56]=U):U=t[56];let W;t[57]!==S||t[58]!==H?(W=(0,$.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5`,children:[B,(0,$.jsx)(b,{size:`sm`,onClick:S,disabled:H,children:U})]}),t[57]=S,t[58]=H,t[59]=W):W=t[59];let G;t[60]!==F||t[61]!==z||t[62]!==W?(G=(0,$.jsxs)(Pe,{align:`end`,className:`flex w-80 flex-col gap-2 p-3`,children:[F,z,W]}),t[60]=F,t[61]=z,t[62]=W,t[63]=G):G=t[63];let K;return t[64]!==y||t[65]!==P||t[66]!==G||t[67]!==k||t[68]!==A?(K=(0,$.jsxs)(y,{open:k,onOpenChange:A,children:[P,G]}),t[64]=y,t[65]=P,t[66]=G,t[67]=k,t[68]=A,t[69]=K):K=t[69],K}function _r(e){let t=(0,Z.c)(75),{keyName:n,value:r,path:i,depth:a}=e,o=a===void 0?0:a,{_:s}=g(),c=cr(),[l,u]=(0,Q.useState)(o===0),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(null),_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(_={},t[0]=_):_=t[0];let[y,w]=(0,Q.useState)(_),T;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(T={},t[1]=T):T=t[1];let[E,D]=(0,Q.useState)(T),O=Object.entries(r),k;t[2]!==s||t[3]!==n||t[4]!==l?(k=s(l?{id:`J3HzPL`,values:{keyName:n}}:{id:`yUxR-Q`,values:{keyName:n}}),t[2]=s,t[3]=n,t[4]=l,t[5]=k):k=t[5];let j=k,M=c===null,N;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e){w(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},t[6]=N):N=t[6];let P=N,I;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e,t){w(n=>({...n,[e]:t})),D(t=>({...t,[e]:(t[e]??0)+1}))},t[7]=I):I=t[7];let L=I,R;t[8]===i?R=t[9]:(R=function(e){return[...i,e]},t[8]=i,t[9]=R);let z=R,B=function(e,t){if(!c)return;P(e);let n=c.patchPath(z(e),t);n.ok||L(e,lr(n.error,e,s({id:`4g19V6`})))},V=function(e){if(!c)return;P(e);let t=c.deletePath(z(e));t.ok||L(e,lr(t.error,e,s({id:`gbHcbI`})))},H=function(e,t){if(!c)return;let n=r[e];if(n===void 0)return;let i=re(n,t);F(n,i)||B(e,i)},U=function(e){f({key:e,draft:e,error:null})},W=function(e){f(t=>t&&{...t,draft:e,error:null})},G=function(){f(null)},K=function(){if(!d||!c)return;let e=d.draft.trim();if(!e){f(null);return}if(e===d.key){f(null);return}if(Object.hasOwn(r,e)){f({...d,error:s({id:`njU86j`,values:{trimmed:e}})});return}let t=c.renamePath(z(d.key),e);if(t.ok){P(d.key),f(null);return}let n=lr(t.error,e,s({id:`2ryd91`}));f({...d,error:n})},q;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(q=function(){m({name:``,type:`text`,value:``,error:null})},t[10]=q):q=t[10];let J=q,Y;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(Y=function(e){m(t=>t&&{...t,name:e,error:null})},t[11]=Y):Y=t[11];let X=Y,te;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(te=function(e){m(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):ee[e];return{...t,type:e,value:n,error:null}})},t[12]=te):te=t[12];let ne=te,ie;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(ie=function(e){m(t=>t&&{...t,value:e})},t[13]=ie):ie=t[13];let ae=ie,oe;t[14]!==s||t[15]!==p||t[16]!==c||t[17]!==i||t[18]!==z||t[19]!==r?(oe=function(){if(!p||!c)return;let e=p.name.trim();if(!e){m({...p,error:s({id:`8_brI5`})});return}if(e===`frontmatter`&&i.length===0){m({...p,error:s({id:`dURmlQ`})});return}if(Object.hasOwn(r,e)){m({...p,error:s({id:`njU86j`,values:{trimmed:e}})});return}let t=c.patchPath(z(e),p.value);if(t.ok){m(null);return}let n=lr(t.error,e,s({id:`OJeiSH`}));m({...p,error:n})},t[14]=s,t[15]=p,t[16]=c,t[17]=i,t[18]=z,t[19]=r,t[20]=oe):oe=t[20];let se=oe,ce;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ce=function(){m(null)},t[21]=ce):ce=t[21];let le=ce,ue;t[22]===i?ue=t[23]:(ue=function(e,t){return`${i.join(`.`)}::${e}::${t}`},t[22]=i,t[23]=ue);let de=ue,fe=function(e){if(!c)return;let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=O.map(vr),a=r.map((e,t)=>de(e,t)),o=a.indexOf(t),l=a.indexOf(n);if(o<0||l<0)return;let u=r.slice(),[d]=u.splice(o,1);if(!d)return;u.splice(l,0,d);let f=c.reorderPath(i,u);if(f.ok){P(d);return}L(d,lr(f.error,d,s({id:`eKThTQ`})))},pe;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(pe={activationConstraint:{distance:4}},t[24]=pe):pe=t[24];let me;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(me={coordinateGetter:Ye},t[25]=me):me=t[25];let he=qe(Je(Ge,pe),Je($e,me)),_e=new Map;for(let[e]of O)_e.set(e,(_e.get(e)??0)+1);let ve=M||void 0,ye=C,be=l?`true`:`false`,xe;t[26]===l?xe=t[27]:(xe=(0,$.jsx)(ge,{"data-expanded":l,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 ease-out data-[expanded=true]:rotate-90`}),t[26]=l,t[27]=xe);let Se=O.length===0?(0,$.jsx)(h,{id:`QOINDn`}):(0,$.jsx)(h,{id:`s0J_k9`,values:{0:O.length}}),Ce;t[28]===Se?Ce=t[29]:(Ce=(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:Se}),t[28]=Se,t[29]=Ce);let we;t[30]!==n||t[31]!==be||t[32]!==xe||t[33]!==Ce||t[34]!==j?(we=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`object-widget-trigger`,"data-key":n,"data-state-open":be,"aria-label":j,className:`h-7 w-full justify-start gap-1 px-2 font-normal hover:bg-muted`,children:[xe,Ce]})}),t[30]=n,t[31]=be,t[32]=xe,t[33]=Ce,t[34]=j,t[35]=we):we=t[35];let Te=x,Ee=Ze,De=Ke,Oe=Qe,ke=O.map((e,t)=>{let[n]=e;return de(n,t)}),Ae=Xe,je=O.map((e,t)=>{let[n,r]=e,i=A(r),a=d?.key===n?d:null,o=(_e.get(n)??0)>1,s=z(n);return(0,$.jsx)(Ar,{sortableId:M?void 0:de(n,t),keyName:n,value:r,declared:i,error:y[n]??null,resetCounter:E[n]??0,isDuplicate:o,path:s,rename:M?void 0:{state:a,onBegin:()=>U(n),onChangeDraft:W,onCommit:K,onCancel:G},onCommit:e=>B(n,e),onChangeType:e=>H(n,e),onRemove:M?void 0:()=>V(n),actionSlot:(0,$.jsx)(gr,{propertyKey:String(s[0]),propertyPath:s.slice(1)})},`${n}-${t}`)}),Me;t[36]!==Oe||t[37]!==ke||t[38]!==Ae||t[39]!==je?(Me=(0,$.jsx)(Oe,{items:ke,strategy:Ae,children:je}),t[36]=Oe,t[37]=ke,t[38]=Ae,t[39]=je,t[40]=Me):Me=t[40];let Ne;t[41]!==Ee||t[42]!==fe||t[43]!==he||t[44]!==De||t[45]!==Me?(Ne=(0,$.jsx)(Ee,{sensors:he,collisionDetection:De,onDragEnd:fe,children:Me}),t[41]=Ee,t[42]=fe,t[43]=he,t[44]=De,t[45]=Me,t[46]=Ne):Ne=t[46];let Pe;t[47]!==s||t[48]!==p||t[49]!==J||t[50]!==le||t[51]!==X||t[52]!==ne||t[53]!==ae||t[54]!==se||t[55]!==n||t[56]!==M?(Pe=M?null:p?(0,$.jsx)(Lr,{draft:p,onChangeName:X,onChangeType:ne,onChangeValue:ae,onCommit:se,onCancel:le}):(0,$.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}),(0,$.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`object-widget-add-trigger`,"data-key":n,onClick:J,"aria-label":s({id:`CmeH9S`,values:{keyName:n}}),className:`flex items-center gap-1.5 rounded px-2 py-1 text-xs font-medium hover:bg-muted/50 hover:text-foreground`,children:[(0,$.jsx)(v,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(h,{id:`m16xKo`})})]})]}),t[47]=s,t[48]=p,t[49]=J,t[50]=le,t[51]=X,t[52]=ne,t[53]=ae,t[54]=se,t[55]=n,t[56]=M,t[57]=Pe):Pe=t[57];let Fe;t[58]!==n||t[59]!==Ne||t[60]!==Pe?(Fe=(0,$.jsxs)(`div`,{"data-testid":`object-widget-children`,"data-key":n,className:`mt-0.5 ml-2 border-l border-border/60 pl-2`,children:[Ne,Pe]}),t[58]=n,t[59]=Ne,t[60]=Pe,t[61]=Fe):Fe=t[61];let Ie;t[62]!==Te||t[63]!==Fe?(Ie=(0,$.jsx)(Te,{className:`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,children:Fe}),t[62]=Te,t[63]=Fe,t[64]=Ie):Ie=t[64];let Le;t[65]!==ye||t[66]!==l||t[67]!==we||t[68]!==Ie?(Le=(0,$.jsxs)(ye,{open:l,onOpenChange:u,children:[we,Ie]}),t[65]=ye,t[66]=l,t[67]=we,t[68]=Ie,t[69]=Le):Le=t[69];let Re;return t[70]!==o||t[71]!==n||t[72]!==ve||t[73]!==Le?(Re=(0,$.jsx)(`div`,{"data-testid":`object-widget`,"data-key":n,"data-depth":o,"data-read-only":ve,className:`w-full min-w-0`,children:Le}),t[70]=o,t[71]=n,t[72]=ve,t[73]=Le,t[74]=Re):Re=t[74],Re}function vr(e){let[t]=e;return t}function yr(e){let t=(0,Z.c)(86),{keyName:n,value:r,path:i,depth:a}=e,o=a===void 0?0:a,{_:s}=g(),c=cr(),[l,u]=(0,Q.useState)(o===0),d;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d={},t[0]=d):d=t[0];let[f,p]=(0,Q.useState)(d),[m,_]=(0,Q.useState)(null),y;t[1]!==s||t[2]!==n||t[3]!==l?(y=s(l?{id:`J3HzPL`,values:{keyName:n}}:{id:`yUxR-Q`,values:{keyName:n}}),t[1]=s,t[2]=n,t[3]=l,t[4]=y):y=t[4];let w=y,T=c===null,E;t[5]===i?E=t[6]:(E=function(e){return[...i,e]},t[5]=i,t[6]=E);let D=E,O;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){p(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},t[7]=O):O=t[7];let k=O,A;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e,t){p(n=>({...n,[e]:t}))},t[8]=A):A=t[8];let j=A,M;t[9]!==s||t[10]!==c||t[11]!==i||t[12]!==D||t[13]!==r.length?(M=function(e){if(!c)return;k(e);let t=r.length<=1?c.deletePath(i):c.deletePath(D(e));if(t.ok){p({});return}j(e,lr(t.error,String(e),s({id:`OdmsFg`})))},t[9]=s,t[10]=c,t[11]=i,t[12]=D,t[13]=r.length,t[14]=M):M=t[14];let N=M,P;t[15]!==s||t[16]!==c||t[17]!==D||t[18]!==r.length?(P=function(){if(!c)return;_(null);let e=c.patchPath(D(r.length),{});e.ok||_(lr(e.error,String(r.length),s({id:`ztKII6`})))},t[15]=s,t[16]=c,t[17]=D,t[18]=r.length,t[19]=P):P=t[19];let F=P,I;t[20]===i?I=t[21]:(I=function(e){return`${i.join(`.`)}::item::${e}`},t[20]=i,t[21]=I);let L=I,R;t[22]!==s||t[23]!==c||t[24]!==i||t[25]!==L||t[26]!==r?(R=function(e){if(!c)return;let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let a=r.map((e,t)=>L(t)),o=a.indexOf(t),l=a.indexOf(n);if(o<0||l<0)return;let u=r.map(br),[d]=u.splice(o,1);if(d===void 0)return;u.splice(l,0,d);let f=c.reorderSeqPath(i,u);if(f.ok){p({});return}j(o,lr(f.error,String(o),s({id:`eKThTQ`})))},t[22]=s,t[23]=c,t[24]=i,t[25]=L,t[26]=r,t[27]=R):R=t[27];let z=R,B;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(B={activationConstraint:{distance:4}},t[28]=B):B=t[28];let V;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(V={coordinateGetter:Ye},t[29]=V):V=t[29];let H=qe(Je(Ge,B),Je($e,V)),U=T||void 0,W=l?`true`:`false`,G;t[30]===l?G=t[31]:(G=(0,$.jsx)(ge,{"data-expanded":l,"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 ease-out data-[expanded=true]:rotate-90`}),t[30]=l,t[31]=G);let K;t[32]===r.length?K=t[33]:(K=(0,$.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:r.length===0?(0,$.jsx)(h,{id:`QOINDn`}):(0,$.jsx)(h,{id:`6ki7F2`,values:{0:r.length}})}),t[32]=r.length,t[33]=K);let q;t[34]!==n||t[35]!==W||t[36]!==G||t[37]!==K||t[38]!==w?(q=(0,$.jsx)(S,{asChild:!0,children:(0,$.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`array-of-objects-widget-trigger`,"data-key":n,"data-state-open":W,"aria-label":w,className:`h-7 w-full justify-start gap-1 px-2 font-normal hover:bg-muted`,children:[G,K]})}),t[34]=n,t[35]=W,t[36]=G,t[37]=K,t[38]=w,t[39]=q):q=t[39];let J;if(t[40]!==L||t[41]!==r){let e;t[43]===L?e=t[44]:(e=(e,t)=>L(t),t[43]=L,t[44]=e),J=r.map(e),t[40]=L,t[41]=r,t[42]=J}else J=t[42];let Y;if(t[45]!==f||t[46]!==n||t[47]!==D||t[48]!==T||t[49]!==N||t[50]!==L||t[51]!==r){let e;t[53]!==f||t[54]!==n||t[55]!==D||t[56]!==T||t[57]!==N||t[58]!==L?(e=(e,t)=>(0,$.jsx)(xr,{sortableId:T?void 0:L(t),arrayKey:n,index:t,value:e,path:D(t),error:f[t]??null,onRemove:T?void 0:()=>N(t)},t),t[53]=f,t[54]=n,t[55]=D,t[56]=T,t[57]=N,t[58]=L,t[59]=e):e=t[59],Y=r.map(e),t[45]=f,t[46]=n,t[47]=D,t[48]=T,t[49]=N,t[50]=L,t[51]=r,t[52]=Y}else Y=t[52];let X;t[60]!==J||t[61]!==Y?(X=(0,$.jsx)(Qe,{items:J,strategy:Xe,children:Y}),t[60]=J,t[61]=Y,t[62]=X):X=t[62];let ee;t[63]!==z||t[64]!==H||t[65]!==X?(ee=(0,$.jsx)(Ze,{sensors:H,collisionDetection:Ke,onDragEnd:z,children:X}),t[63]=z,t[64]=H,t[65]=X,t[66]=ee):ee=t[66];let te;t[67]!==s||t[68]!==m||t[69]!==F||t[70]!==n||t[71]!==T?(te=T?null:(0,$.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}),(0,$.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`array-of-objects-widget-add-trigger`,"data-key":n,onClick:F,"aria-label":s({id:`cEoyWz`,values:{keyName:n}}),className:`flex items-center gap-1.5 rounded px-2 py-1 text-xs font-medium hover:bg-muted/50 hover:text-foreground`,children:[(0,$.jsx)(v,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(h,{id:`NQ8llq`})})]}),m?(0,$.jsx)(`span`,{role:`alert`,"data-testid":`array-of-objects-add-error`,"data-key":n,className:`text-[10px] text-destructive`,children:m}):null]}),t[67]=s,t[68]=m,t[69]=F,t[70]=n,t[71]=T,t[72]=te):te=t[72];let ne;t[73]!==n||t[74]!==ee||t[75]!==te?(ne=(0,$.jsx)(x,{className:`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,children:(0,$.jsxs)(`div`,{"data-testid":`array-of-objects-widget-children`,"data-key":n,className:`mt-0.5 ml-2 border-l border-border/60 pl-2`,children:[ee,te]})}),t[73]=n,t[74]=ee,t[75]=te,t[76]=ne):ne=t[76];let re;t[77]!==l||t[78]!==q||t[79]!==ne?(re=(0,$.jsxs)(C,{open:l,onOpenChange:u,children:[q,ne]}),t[77]=l,t[78]=q,t[79]=ne,t[80]=re):re=t[80];let ie;return t[81]!==o||t[82]!==n||t[83]!==U||t[84]!==re?(ie=(0,$.jsx)(`div`,{"data-testid":`array-of-objects-widget`,"data-key":n,"data-depth":o,"data-read-only":U,className:`w-full min-w-0`,children:re}),t[81]=o,t[82]=n,t[83]=U,t[84]=re,t[85]=ie):ie=t[85],ie}function br(e,t){return t}function xr(e){let t=(0,Z.c)(15),{sortableId:n,arrayKey:r,index:i,value:a,path:o,error:s,onRemove:c}=e;if(n){let e;return t[0]!==r||t[1]!==s||t[2]!==i||t[3]!==c||t[4]!==o||t[5]!==n||t[6]!==a?(e=(0,$.jsx)(Sr,{sortableId:n,arrayKey:r,index:i,value:a,path:o,error:s,onRemove:c}),t[0]=r,t[1]=s,t[2]=i,t[3]=c,t[4]=o,t[5]=n,t[6]=a,t[7]=e):e=t[7],e}let l;return t[8]!==r||t[9]!==s||t[10]!==i||t[11]!==c||t[12]!==o||t[13]!==a?(l=(0,$.jsx)(Cr,{arrayKey:r,index:i,value:a,path:o,error:s,onRemove:c}),t[8]=r,t[9]=s,t[10]=i,t[11]=c,t[12]=o,t[13]=a,t[14]=l):l=t[14],l}function Sr(e){let t=(0,Z.c)(35),{sortableId:n,arrayKey:r,index:i,value:a,path:o,error:s,onRemove:c}=e,{_:l}=g(),u;t[0]===n?u=t[1]:(u={id:n},t[0]=n,t[1]=u);let{attributes:d,listeners:f,setNodeRef:p,transform:m,transition:h,isDragging:_}=We(u),v;t[2]===m?v=t[3]:(v=Ue.Transform.toString(m),t[2]=m,t[3]=v);let y=_?.5:void 0,x=_?1:void 0,S;t[4]!==v||t[5]!==y||t[6]!==x||t[7]!==h?(S={transform:v,transition:h,opacity:y,zIndex:x},t[4]=v,t[5]=y,t[6]=x,t[7]=h,t[8]=S):S=t[8];let C=S,w=i+1,T;t[9]!==l||t[10]!==w?(T=l({id:`OLIKgw`,values:{0:w}}),t[9]=l,t[10]=w,t[11]=T):T=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(_e,{className:`size-3.5`}),t[12]=E):E=t[12];let D;t[13]!==r||t[14]!==d||t[15]!==i||t[16]!==f||t[17]!==T?(D=(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`array-item-drag-handle`,"data-key":r,"data-index":i,"aria-label":T,...d,...f,className:`h-7 w-4 shrink-0 cursor-grab touch-none px-0 text-muted-foreground/0 hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing group-hover:text-muted-foreground/60`,children:E}),t[13]=r,t[14]=d,t[15]=i,t[16]=f,t[17]=T,t[18]=D):D=t[18];let O=D,k=_||void 0,A=s??void 0,j;t[19]!==r||t[20]!==O||t[21]!==s||t[22]!==i||t[23]!==c||t[24]!==o||t[25]!==a?(j=(0,$.jsx)(wr,{dragHandle:O,arrayKey:r,index:i,value:a,path:o,error:s,onRemove:c}),t[19]=r,t[20]=O,t[21]=s,t[22]=i,t[23]=c,t[24]=o,t[25]=a,t[26]=j):j=t[26];let M;return t[27]!==r||t[28]!==i||t[29]!==p||t[30]!==C||t[31]!==k||t[32]!==A||t[33]!==j?(M=(0,$.jsx)(`div`,{ref:p,style:C,className:`group mt-1 rounded border border-border/40 p-1`,"data-testid":`array-item`,"data-key":r,"data-index":i,"data-dragging":k,"data-error":A,children:j}),t[27]=r,t[28]=i,t[29]=p,t[30]=C,t[31]=k,t[32]=A,t[33]=j,t[34]=M):M=t[34],M}function Cr(e){let t=(0,Z.c)(12),{arrayKey:n,index:r,value:i,path:a,error:o,onRemove:s}=e,c=o??void 0,l;t[0]!==n||t[1]!==o||t[2]!==r||t[3]!==s||t[4]!==a||t[5]!==i?(l=(0,$.jsx)(wr,{dragHandle:null,arrayKey:n,index:r,value:i,path:a,error:o,onRemove:s}),t[0]=n,t[1]=o,t[2]=r,t[3]=s,t[4]=a,t[5]=i,t[6]=l):l=t[6];let u;return t[7]!==n||t[8]!==r||t[9]!==c||t[10]!==l?(u=(0,$.jsx)(`div`,{className:`group mt-1 rounded border border-border/40 p-1`,"data-testid":`array-item`,"data-key":n,"data-index":r,"data-error":c,children:l}),t[7]=n,t[8]=r,t[9]=c,t[10]=l,t[11]=u):u=t[11],u}function wr(e){let t=(0,Z.c)(28),{dragHandle:n,arrayKey:r,index:i,value:a,path:o,error:s,onRemove:c}=e,{_:l}=g(),u=i+1,d;t[0]!==l||t[1]!==u?(d=l({id:`y_5CE8`,values:{0:u}}),t[0]=l,t[1]=u,t[2]=d):d=t[2];let f=d,p;t[3]!==r||t[4]!==i||t[5]!==f?(p=(0,$.jsx)(`span`,{"data-testid":`array-item-label`,"data-key":r,"data-index":i,className:`flex-1 truncate text-xs font-medium text-muted-foreground`,children:f}),t[3]=r,t[4]=i,t[5]=f,t[6]=p):p=t[6];let m;t[7]!==l||t[8]!==r||t[9]!==i||t[10]!==c?(m=c?(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`array-item-remove`,"data-key":r,"data-index":i,"aria-label":l({id:`mU3j1b`,values:{0:i+1}}),onClick:c,className:`shrink-0 rounded text-muted-foreground/0 hover:bg-muted hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:text-muted-foreground`,children:(0,$.jsx)(xe,{className:`size-3.5`})}):null,t[7]=l,t[8]=r,t[9]=i,t[10]=c,t[11]=m):m=t[11];let h;t[12]!==n||t[13]!==p||t[14]!==m?(h=(0,$.jsxs)(`div`,{className:`flex items-center gap-1`,children:[n,p,m]}),t[12]=n,t[13]=p,t[14]=m,t[15]=h):h=t[15];let _=`${r}[${i}]`,v;t[16]!==o||t[17]!==_||t[18]!==a?(v=(0,$.jsx)(`div`,{className:`mt-0.5`,children:(0,$.jsx)(_r,{keyName:_,value:a,path:o,depth:0})}),t[16]=o,t[17]=_,t[18]=a,t[19]=v):v=t[19];let y;t[20]!==r||t[21]!==s||t[22]!==i?(y=s?(0,$.jsx)(`div`,{role:`alert`,"data-testid":`array-item-error`,"data-key":r,"data-index":i,className:`pl-2 text-[10px] text-destructive`,children:s}):null,t[20]=r,t[21]=s,t[22]=i,t[23]=y):y=t[23];let x;return t[24]!==h||t[25]!==v||t[26]!==y?(x=(0,$.jsxs)($.Fragment,{children:[h,v,y]}),t[24]=h,t[25]=v,t[26]=y,t[27]=x):x=t[27],x}function Tr(e){let t=(0,Z.c)(50),{keyName:n,value:r,onCommit:a}=e,{_:o}=g(),[s,c]=(0,Q.useState)(r),l=(0,Q.useRef)(!1),u=(0,Q.useRef)(!1),[d,f]=(0,Q.useState)(!1),p,m;t[0]===r?(p=t[1],m=t[2]):(p=()=>{l.current||c(r)},m=[r],t[0]=r,t[1]=p,t[2]=m),(0,Q.useEffect)(p,m);let h;t[3]===s?h=t[4]:(h=i(s),t[3]=s,t[4]=h);let _=h,v;t[5]===o?v=t[6]:(v=o({id:`We7h2I`}),t[5]=o,t[6]=v);let b;t[7]!==o||t[8]!==n?(b=o({id:`1EcCom`,values:{keyName:n}}),t[7]=o,t[8]=n,t[9]=b):b=t[9];let x,S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>c(e.target.value),S=()=>{l.current=!0},t[10]=x,t[11]=S):(x=t[10],S=t[11]);let C,w;t[12]!==s||t[13]!==a||t[14]!==r?(C=()=>{if(l.current=!1,u.current){u.current=!1;return}s!==r&&a(s)},w=e=>{e.key===`Enter`&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey?(e.preventDefault(),s!==r&&a(s),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),u.current=!0,c(r),e.currentTarget.blur())},t[12]=s,t[13]=a,t[14]=r,t[15]=C,t[16]=w):(C=t[15],w=t[16]);let T;t[17]!==s||t[18]!==n||t[19]!==v||t[20]!==b||t[21]!==C||t[22]!==w?(T=(0,$.jsx)(`input`,{type:`text`,"data-testid":`page-icon-widget`,"data-key":n,value:s,placeholder:v,"aria-label":b,className:`flex-1 min-h-7 border-transparent bg-transparent px-2 py-1 text-sm leading-tight shadow-none outline-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:outline-none focus-visible:ring-0 rounded-sm dark:bg-transparent dark:focus-visible:bg-muted`,onChange:x,onFocus:S,onBlur:C,onKeyDown:w}),t[17]=s,t[18]=n,t[19]=v,t[20]=b,t[21]=C,t[22]=w,t[23]=T):T=t[23];let E;t[24]!==o||t[25]!==n?(E=o({id:`bBcFK_`,values:{keyName:n}}),t[24]=o,t[25]=n,t[26]=E):E=t[26];let D=_.kind,O=_.kind===`unsupported`&&`text-muted-foreground/60`,k;t[27]===O?k=t[28]:(k=y(`flex h-7 w-7 flex-none items-center justify-center rounded-sm text-base transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,O),t[27]=O,t[28]=k);let A;t[29]===_?A=t[30]:(A=(0,$.jsx)(Dr,{resolved:_}),t[29]=_,t[30]=A);let j;t[31]!==_.kind||t[32]!==E||t[33]!==k||t[34]!==A?(j=(0,$.jsx)(Me,{asChild:!0,children:(0,$.jsx)(`button`,{type:`button`,"aria-label":E,"data-testid":`page-icon-preview`,"data-kind":D,className:k,children:A})}),t[31]=_.kind,t[32]=E,t[33]=k,t[34]=A,t[35]=j):j=t[35];let M;t[36]===o?M=t[37]:(M=o({id:`pFPzHA`}),t[36]=o,t[37]=M);let N;t[38]===a?N=t[39]:(N=(0,$.jsx)(Zn,{onSelect:e=>{c(e),a(e),f(!1)}}),t[38]=a,t[39]=N);let P;t[40]!==M||t[41]!==N?(P=(0,$.jsx)(Pe,{className:`w-auto p-0`,align:`end`,"aria-label":M,children:N}),t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;t[43]!==d||t[44]!==j||t[45]!==P?(F=(0,$.jsxs)(Fe,{open:d,onOpenChange:f,children:[j,P]}),t[43]=d,t[44]=j,t[45]=P,t[46]=F):F=t[46];let I;return t[47]!==T||t[48]!==F?(I=(0,$.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[T,F]}),t[47]=T,t[48]=F,t[49]=I):I=t[49],I}function Er(e){let t=(0,Z.c)(74),{keyName:r,value:i,onCommit:a}=e,{_:s}=g(),[c,l]=(0,Q.useState)(i),[d,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(!1),_=(0,Q.useRef)(null),v=(0,Q.useRef)(!1),x=(0,Q.useRef)(!1),S=(0,Q.useRef)(!0),C,w;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>(S.current=!0,()=>{S.current=!1}),w=[],t[0]=C,t[1]=w):(C=t[0],w=t[1]),(0,Q.useEffect)(C,w);let T,E;t[2]===i?(T=t[3],E=t[4]):(T=()=>{v.current||l(i)},E=[i],t[2]=i,t[3]=T,t[4]=E),(0,Q.useEffect)(T,E);let D;t[5]===c?D=t[6]:(D=f(c),t[5]=c,t[6]=D);let O=D,k;t[7]!==s||t[8]!==a?(k=async function(e){p(null),h(!0);try{let t=await n(e,R);if(!S.current)return;l(t.url),a(t.url),h(!1)}catch(e){let t=e;if(!S.current)return;p(t instanceof o?t.message:s({id:`vZVeFG`})),h(!1)}},t[7]=s,t[8]=a,t[9]=k):k=t[9];let A=k,j;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){_.current?.click()},t[10]=j):j=t[10];let M=j,N;t[11]===a?N=t[12]:(N=function(){l(``),a(``),p(null)},t[11]=a,t[12]=N);let P=N,F;t[13]===s?F=t[14]:(F=s({id:`4zGlN_`}),t[13]=s,t[14]=F);let I;t[15]!==s||t[16]!==r?(I=s({id:`1EcCom`,values:{keyName:r}}),t[15]=s,t[16]=r,t[17]=I):I=t[17];let L,z;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(L=e=>l(e.target.value),z=()=>{v.current=!0},t[18]=L,t[19]=z):(L=t[18],z=t[19]);let B,V;t[20]!==c||t[21]!==a||t[22]!==i?(B=()=>{if(v.current=!1,x.current){x.current=!1;return}c!==i&&a(c)},V=e=>{e.key===`Enter`&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey?(e.preventDefault(),c!==i&&a(c),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),x.current=!0,l(i),e.currentTarget.blur())},t[20]=c,t[21]=a,t[22]=i,t[23]=B,t[24]=V):(B=t[23],V=t[24]);let H;t[25]!==c||t[26]!==r||t[27]!==I||t[28]!==B||t[29]!==V||t[30]!==F?(H=(0,$.jsx)(`input`,{type:`text`,"data-testid":`page-cover-widget`,"data-key":r,value:c,placeholder:F,"aria-label":I,className:`flex-1 min-h-7 border-transparent bg-transparent px-2 py-1 text-sm leading-tight shadow-none outline-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:outline-none focus-visible:ring-0 rounded-sm dark:bg-transparent dark:focus-visible:bg-muted`,onChange:L,onFocus:z,onBlur:B,onKeyDown:V}),t[25]=c,t[26]=r,t[27]=I,t[28]=B,t[29]=V,t[30]=F,t[31]=H):H=t[31];let U;t[32]!==s||t[33]!==r||t[34]!==m?(U=s(m?{id:`rFw02Q`,values:{keyName:r}}:{id:`Yi0VMG`,values:{keyName:r}}),t[32]=s,t[33]=r,t[34]=m,t[35]=U):U=t[35];let W;t[36]===m?W=t[37]:(W=m?(0,$.jsx)(u,{className:`size-4 animate-pulse`}):(0,$.jsx)(it,{className:`size-4`}),t[36]=m,t[37]=W);let G;t[38]!==U||t[39]!==W||t[40]!==m?(G=(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":U,disabled:m,onClick:M,"data-testid":`page-cover-upload`,children:W}),t[38]=U,t[39]=W,t[40]=m,t[41]=G):G=t[41];let K;t[42]!==s||t[43]!==r?(K=s({id:`P6gXB-`,values:{keyName:r}}),t[42]=s,t[43]=r,t[44]=K):K=t[44];let q=O.kind,J=O.kind===`unsupported`&&`text-muted-foreground/60`,Y;t[45]===J?Y=t[46]:(Y=y(`flex h-7 w-12 flex-none items-center justify-center overflow-hidden rounded-sm text-xs transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,J),t[45]=J,t[46]=Y);let X;t[47]===O?X=t[48]:(X=(0,$.jsx)(Or,{resolved:O}),t[47]=O,t[48]=X);let ee;t[49]!==O.kind||t[50]!==K||t[51]!==Y||t[52]!==X?(ee=(0,$.jsx)(`button`,{type:`button`,"aria-label":K,"data-testid":`page-cover-preview`,"data-kind":q,onClick:M,className:Y,children:X}),t[49]=O.kind,t[50]=K,t[51]=Y,t[52]=X,t[53]=ee):ee=t[53];let te;t[54]!==s||t[55]!==P||t[56]!==c||t[57]!==r||t[58]!==O.kind?(te=O.kind!==`unsupported`&&c!==``?(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":s({id:`aaE55D`,values:{keyName:r}}),onClick:P,"data-testid":`page-cover-clear`,children:(0,$.jsx)(Ce,{className:`size-4`})}):null,t[54]=s,t[55]=P,t[56]=c,t[57]=r,t[58]=O.kind,t[59]=te):te=t[59];let ne;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ne=R.join(`,`),t[60]=ne):ne=t[60];let re;t[61]===A?re=t[62]:(re=(0,$.jsx)(`input`,{ref:_,type:`file`,accept:ne,className:`hidden`,"aria-hidden":!0,tabIndex:-1,onChange:e=>{let t=e.target.files?.[0];e.currentTarget.value=``,t&&A(t)}}),t[61]=A,t[62]=re);let ie;t[63]!==H||t[64]!==G||t[65]!==ee||t[66]!==te||t[67]!==re?(ie=(0,$.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[H,G,ee,te,re]}),t[63]=H,t[64]=G,t[65]=ee,t[66]=te,t[67]=re,t[68]=ie):ie=t[68];let ae;t[69]===d?ae=t[70]:(ae=d?(0,$.jsx)(`div`,{className:`text-destructive text-xs`,role:`alert`,children:d}):null,t[69]=d,t[70]=ae);let oe;return t[71]!==ie||t[72]!==ae?(oe=(0,$.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[ie,ae]}),t[71]=ie,t[72]=ae,t[73]=oe):oe=t[73],oe}function Dr(e){let t=(0,Z.c)(5),{resolved:n}=e;if(n.kind===`emoji`){let e;return t[0]===n.value?e=t[1]:(e=(0,$.jsx)(`span`,{children:n.value}),t[0]=n.value,t[1]=e),e}if(n.kind===`url`||n.kind===`path`){let e;return t[2]===n.value?e=t[3]:(e=(0,$.jsx)(`img`,{src:n.value,alt:``,className:`h-full w-full rounded-md object-cover`,draggable:!1,referrerPolicy:`no-referrer`}),t[2]=n.value,t[3]=e),e}let i;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,$.jsx)(r,{className:`size-4`,"aria-hidden":!0}),t[4]=i):i=t[4],i}function Or(e){let t=(0,Z.c)(3),{resolved:n}=e;if(n.kind===`url`||n.kind===`path`){let e;return t[0]===n.value?e=t[1]:(e=(0,$.jsx)(`img`,{src:n.value,alt:``,className:`h-full w-full object-cover`,draggable:!1,referrerPolicy:`no-referrer`}),t[0]=n.value,t[1]=e),e}let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,$.jsx)(it,{className:`size-4`,"aria-hidden":!0}),t[2]=r):r=t[2],r}var kr=[`__add__`];function Ar(e){let t=(0,Z.c)(32),{keyName:n,value:r,declared:i,enumConstraint:a,error:o,resetCounter:s,sortableId:c,rename:l,isDuplicate:u,badge:d,isPlaceholder:f,path:p,onCommit:m,onChangeType:h,onRemove:_,actionSlot:v}=e,y=s===void 0?0:s,x=u===void 0?!1:u,S=f===void 0?!1:f,{_:C}=g(),w;t[0]===r?w=t[1]:(w=se(r),t[0]=r,t[1]=w);let T=w,E;t[2]!==n||t[3]!==p?(E=p??[n],t[2]=n,t[3]=p,t[4]=E):E=t[4];let D=E,O;t[5]!==C||t[6]!==v||t[7]!==d||t[8]!==i||t[9]!==a||t[10]!==o||t[11]!==T||t[12]!==x||t[13]!==S||t[14]!==n||t[15]!==h||t[16]!==m||t[17]!==_||t[18]!==l||t[19]!==y||t[20]!==D||t[21]!==r?(O=e=>(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-1 @max-[26rem]/prow:flex-wrap`,children:[e,(0,$.jsx)(`div`,{className:`flex items-center gap-1`,"data-testid":`property-row-identity`,children:S?(0,$.jsx)(Ir,{keyName:n,type:i}):(0,$.jsxs)($.Fragment,{children:[T?(0,$.jsx)(Nr,{keyName:n,type:i}):(0,$.jsx)(ne,{keyName:n,type:i,onChangeType:h}),(0,$.jsx)(`div`,{className:`w-32 shrink-0 @max-[26rem]/prow:w-auto`,children:l?.state?(0,$.jsx)(Pr,{keyName:n,draft:l.state.draft,error:l.state.error,onChangeDraft:l.onChangeDraft,onCommit:l.onCommit,onCancel:l.onCancel}):(0,$.jsx)(Fr,{keyName:n,onBegin:l?.onBegin,disabled:!l})})]})}),x?(0,$.jsx)(`span`,{"data-testid":`property-duplicate-marker`,"data-key":n,title:C({id:`outYNy`,values:{keyName:n}}),className:`flex size-4 items-center justify-center text-amber-600`,children:(0,$.jsx)(Se,{className:`size-3.5`})}):null,(0,$.jsx)(`div`,{className:`min-w-0 flex-1 @max-[26rem]/prow:order-last @max-[26rem]/prow:mt-0.5 @max-[26rem]/prow:basis-full @max-[26rem]/prow:pl-[3.25rem]`,children:a&&!T&&!a.multi?(0,$.jsx)(Vr,{keyName:n,value:r,values:a.values,onCommit:m},`widget-${y}`):a&&!T&&a.multi?(0,$.jsx)(Ur,{keyName:n,value:r,values:a.values,onCommit:m},`widget-${y}`):(0,$.jsx)(Rr,{keyName:n,value:r,widgetType:i,path:D,onCommit:m},`widget-${y}`)}),d?(0,$.jsx)(`div`,{className:`shrink-0 min-h-7 flex items-center`,children:d}):null,v,_?(0,$.jsx)(b,{type:`button`,"data-testid":`property-remove-button`,"data-key":n,"aria-label":C({id:`6VqW-1`,values:{keyName:n}}),onClick:_,variant:`ghost`,size:`icon-sm`,className:`flex shrink-0 items-center justify-center rounded text-muted-foreground/0 hover:bg-muted hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:text-muted-foreground`,children:(0,$.jsx)(xe,{className:`size-3.5`})}):null]}),o?(0,$.jsx)(`div`,{role:`alert`,"data-testid":`property-error`,"data-key":n,className:`pl-9 text-[10px] text-destructive @max-[26rem]/prow:pl-[3.25rem]`,children:o}):null]}),t[5]=C,t[6]=v,t[7]=d,t[8]=i,t[9]=a,t[10]=o,t[11]=T,t[12]=x,t[13]=S,t[14]=n,t[15]=h,t[16]=m,t[17]=_,t[18]=l,t[19]=y,t[20]=D,t[21]=r,t[22]=O):O=t[22];let k;return t[23]!==i||t[24]!==o||t[25]!==T||t[26]!==x||t[27]!==S||t[28]!==n||t[29]!==c||t[30]!==O?(k=(0,$.jsx)(jr,{sortableId:c,keyName:n,declared:i,error:o,isDuplicate:x,isPlaceholder:S,isComplex:T,children:O}),t[23]=i,t[24]=o,t[25]=T,t[26]=x,t[27]=S,t[28]=n,t[29]=c,t[30]=O,t[31]=k):k=t[31],k}function jr(e){let t=(0,Z.c)(20),{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,isPlaceholder:s,isComplex:c,children:l}=e;if(n){let e;return t[0]!==l||t[1]!==i||t[2]!==a||t[3]!==c||t[4]!==o||t[5]!==r||t[6]!==n?(e=(0,$.jsx)(Mr,{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,isComplex:c,children:l}),t[0]=l,t[1]=i,t[2]=a,t[3]=c,t[4]=o,t[5]=r,t[6]=n,t[7]=e):e=t[7],e}let u;t[8]===s?u=t[9]:(u=s?(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}):null,t[8]=s,t[9]=u);let d=u,f=a??void 0,p=o||void 0,m=c||void 0,h;t[10]!==l||t[11]!==d?(h=l(d),t[10]=l,t[11]=d,t[12]=h):h=t[12];let g;return t[13]!==i||t[14]!==r||t[15]!==f||t[16]!==p||t[17]!==m||t[18]!==h?(g=(0,$.jsx)(`div`,{className:`group @container/prow py-0.5`,"data-testid":`property-row`,"data-key":r,"data-widget-type":i,"data-error":f,"data-duplicate":p,"data-complex-value":m,children:h}),t[13]=i,t[14]=r,t[15]=f,t[16]=p,t[17]=m,t[18]=h,t[19]=g):g=t[19],g}function Mr(e){let t=(0,Z.c)(31),{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,isComplex:s,children:c}=e,{_:l}=g(),u;t[0]===n?u=t[1]:(u={id:n},t[0]=n,t[1]=u);let{attributes:d,listeners:f,setNodeRef:p,transform:m,transition:h,isDragging:_}=We(u),v;t[2]===m?v=t[3]:(v=Ue.Transform.toString(m),t[2]=m,t[3]=v);let y=_?.5:void 0,x=_?1:void 0,S;t[4]!==v||t[5]!==y||t[6]!==x||t[7]!==h?(S={transform:v,transition:h,opacity:y,zIndex:x},t[4]=v,t[5]=y,t[6]=x,t[7]=h,t[8]=S):S=t[8];let C=S,w;t[9]!==l||t[10]!==r?(w=l({id:`Am78jY`,values:{keyName:r}}),t[9]=l,t[10]=r,t[11]=w):w=t[11];let T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,$.jsx)(_e,{className:`size-3.5`}),t[12]=T):T=t[12];let E;t[13]!==d||t[14]!==r||t[15]!==f||t[16]!==w?(E=(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`property-drag-handle`,"data-key":r,"aria-label":w,...d,...f,className:`h-7 w-4 shrink-0 cursor-grab touch-none px-0 text-muted-foreground/0 hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing group-hover:text-muted-foreground/60`,children:T}),t[13]=d,t[14]=r,t[15]=f,t[16]=w,t[17]=E):E=t[17];let D=E,O=a??void 0,k=o||void 0,A=s||void 0,j=_||void 0,M;t[18]!==c||t[19]!==D?(M=c(D),t[18]=c,t[19]=D,t[20]=M):M=t[20];let N;return t[21]!==i||t[22]!==r||t[23]!==p||t[24]!==C||t[25]!==k||t[26]!==A||t[27]!==j||t[28]!==M||t[29]!==O?(N=(0,$.jsx)(`div`,{ref:p,style:C,className:`group @container/prow py-0.5`,"data-testid":`property-row`,"data-key":r,"data-widget-type":i,"data-error":O,"data-duplicate":k,"data-complex-value":A,"data-dragging":j,children:M}),t[21]=i,t[22]=r,t[23]=p,t[24]=C,t[25]=k,t[26]=A,t[27]=j,t[28]=M,t[29]=O,t[30]=N):N=t[30],N}function Nr(e){let t=(0,Z.c)(10),{keyName:n,type:r}=e,{_:i}=g(),a=oe[r],o;t[0]!==i||t[1]!==n?(o=i({id:`STTOnz`,values:{keyName:n}}),t[0]=i,t[1]=n,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,$.jsx)(a,{className:`size-3.5`,"aria-hidden":`true`}),t[3]=a,t[4]=s);let c;return t[5]!==n||t[6]!==o||t[7]!==s||t[8]!==r?(c=(0,$.jsx)(`span`,{role:`img`,"data-testid":`type-icon-static`,"data-key":n,"data-type":r,"aria-label":o,className:`flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground`,children:s}),t[5]=n,t[6]=o,t[7]=s,t[8]=r,t[9]=c):c=t[9],c}function Pr(e){let t=(0,Z.c)(23),{keyName:n,draft:r,error:i,onChangeDraft:a,onCommit:o,onCancel:s}=e,{_:c}=g(),l=i?`property-rename-error-${n}`:void 0,u;t[0]!==c||t[1]!==n?(u=c({id:`Rx5ReQ`,values:{keyName:n}}),t[0]=c,t[1]=n,t[2]=u):u=t[2];let d=i?!0:void 0,f;t[3]===a?f=t[4]:(f=e=>a(e.target.value),t[3]=a,t[4]=f);let p;t[5]!==s||t[6]!==o?(p=e=>{e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),s())},t[5]=s,t[6]=o,t[7]=p):p=t[7];let m;t[8]!==r||t[9]!==l||t[10]!==n||t[11]!==o||t[12]!==u||t[13]!==d||t[14]!==f||t[15]!==p?(m=(0,$.jsx)(De,{"data-testid":`property-name-rename-input`,"data-key":n,type:`text`,value:r,autoFocus:!0,"aria-label":u,"aria-invalid":d,"aria-describedby":l,onChange:f,onBlur:o,onKeyDown:p,className:`h-7 border-transparent bg-transparent dark:bg-transparent px-2 text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[8]=r,t[9]=l,t[10]=n,t[11]=o,t[12]=u,t[13]=d,t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;t[17]!==i||t[18]!==l?(h=i?(0,$.jsx)(`div`,{id:l,"data-testid":`property-name-rename-error`,className:`text-[10px] text-destructive`,children:i}):null,t[17]=i,t[18]=l,t[19]=h):h=t[19];let _;return t[20]!==m||t[21]!==h?(_=(0,$.jsxs)(`div`,{children:[m,h]}),t[20]=m,t[21]=h,t[22]=_):_=t[22],_}function Fr(e){let t=(0,Z.c)(4),{keyName:n,onBegin:r,disabled:i}=e,a;return t[0]!==i||t[1]!==n||t[2]!==r?(a=(0,$.jsx)(b,{type:`button`,variant:`ghost`,"data-testid":`property-name-button`,"data-key":n,onClick:r,disabled:i,className:`block h-7 w-full truncate px-2 py-0.5 text-left text-sm rounded-sm font-normal text-muted-foreground hover:bg-transparent hover:text-foreground disabled:opacity-100 disabled:cursor-default`,children:n}),t[0]=i,t[1]=n,t[2]=r,t[3]=a):a=t[3],a}function Ir(e){let t=(0,Z.c)(10),{keyName:n,type:r}=e,i=oe[r],a;t[0]===i?a=t[1]:(a=(0,$.jsx)(i,{className:`size-3.5`}),t[0]=i,t[1]=a);let o;t[2]!==n||t[3]!==a?(o=(0,$.jsx)(`span`,{"aria-hidden":!0,"data-testid":`property-placeholder-icon`,"data-key":n,className:`flex h-7 w-7 shrink-0 items-center justify-center text-muted-foreground/60`,children:a}),t[2]=n,t[3]=a,t[4]=o):o=t[4];let s;t[5]===n?s=t[6]:(s=(0,$.jsx)(`div`,{className:`w-32 shrink-0 @max-[26rem]/prow:w-auto`,children:(0,$.jsx)(`span`,{"data-testid":`property-placeholder-name`,"data-key":n,className:`block h-7 truncate px-2 py-1.5 text-sm leading-tight text-muted-foreground/60`,children:n})}),t[5]=n,t[6]=s);let c;return t[7]!==o||t[8]!==s?(c=(0,$.jsxs)($.Fragment,{children:[o,s]}),t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Lr(e){let t=(0,Z.c)(58),{draft:n,onChangeName:r,onChangeType:i,onChangeValue:a,onCommit:o,onCancel:s,rowId:c,autoFocus:l,enumConstraint:u,fieldSuggestions:d,onPickField:f}=e,p=c===void 0?`__add__`:c,m=l===void 0?`name`:l,_;t[0]===d?_=t[1]:(_=d===void 0?[]:d,t[0]=d,t[1]=_);let v=_,{_:y}=g(),x=n.error?`add-property-error-${p}`:void 0,S=(0,Q.useRef)(null),C=(0,Q.useRef)(null),w=m===`value`,T=(0,Q.useRef)(!1),E,D;t[2]===w?(E=t[3],D=t[4]):(E=()=>{!w||T.current||(T.current=!0,(C.current?.querySelector(`input:not([type="hidden"]), select, textarea, button, [tabindex]:not([tabindex="-1"])`))?.focus())},D=[w],t[2]=w,t[3]=E,t[4]=D),(0,Q.useEffect)(E,D);let O;t[5]!==r||t[6]!==i||t[7]!==f?(O=function(e){if(f){f(e);return}r(e.name),i(e.type)},t[5]=r,t[6]=i,t[7]=f,t[8]=O):O=t[8];let k=O,A;t[9]!==n.name||t[10]!==n.value?(A=n.name.trim()===``||L(n.value),t[9]=n.name,t[10]=n.value,t[11]=A):A=t[11];let j=A,M;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{e.preventDefault(),S.current?.focus()},t[12]=M):M=t[12];let N;t[13]!==n.type||t[14]!==i?(N=(0,$.jsx)(ne,{keyName:`__add__`,type:n.type,onChangeType:i,onCloseAutoFocus:M}),t[13]=n.type,t[14]=i,t[15]=N):N=t[15];let P=m===`name`,F=n.error!==null,I;t[16]!==n.name||t[17]!==x||t[18]!==v||t[19]!==k||t[20]!==s||t[21]!==r||t[22]!==o||t[23]!==p||t[24]!==P||t[25]!==F?(I=(0,$.jsx)(rr,{rowId:p,value:n.name,suggestions:v,inputRef:S,autoFocus:P,error:F,errorId:x,onChange:r,onPick:k,onCommit:o,onCancel:s}),t[16]=n.name,t[17]=x,t[18]=v,t[19]=k,t[20]=s,t[21]=r,t[22]=o,t[23]=p,t[24]=P,t[25]=F,t[26]=I):I=t[26];let R;t[27]!==n.type||t[28]!==n.value||t[29]!==u||t[30]!==a||t[31]!==o?(R=(0,$.jsx)(`div`,{ref:C,className:`min-w-0 flex-1 @max-[26rem]/prow:order-last @max-[26rem]/prow:mt-0.5 @max-[26rem]/prow:basis-full @max-[26rem]/prow:pl-[2rem]`,children:u&&!u.multi?(0,$.jsx)(Vr,{keyName:`__add__`,value:n.value,values:u.values,onCommit:a}):u?(0,$.jsx)(Ur,{keyName:`__add__`,value:n.value,values:u.values,onCommit:a}):(0,$.jsx)(Rr,{keyName:`__add__`,value:n.value,widgetType:n.type,path:kr,onCommit:a,onSubmit:o})}),t[27]=n.type,t[28]=n.value,t[29]=u,t[30]=a,t[31]=o,t[32]=R):R=t[32];let z;t[33]===o?z=t[34]:(z=()=>o(),t[33]=o,t[34]=z);let B;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,$.jsx)(h,{id:`m16xKo`}),t[35]=B):B=t[35];let V;t[36]!==j||t[37]!==z?(V=(0,$.jsx)(b,{type:`button`,"data-testid":`add-property-commit`,onClick:z,disabled:j,size:`sm`,className:`rounded bg-primary text-xs text-primary-foreground hover:bg-primary/90`,children:B}),t[36]=j,t[37]=z,t[38]=V):V=t[38];let H;t[39]===y?H=t[40]:(H=y({id:`dEgA5A`}),t[39]=y,t[40]=H);let U;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(Ce,{className:`size-3.5`}),t[41]=U):U=t[41];let W;t[42]!==s||t[43]!==H?(W=(0,$.jsx)(b,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`add-property-cancel`,onClick:s,"aria-label":H,className:`rounded px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground`,children:U}),t[42]=s,t[43]=H,t[44]=W):W=t[44];let G;t[45]!==N||t[46]!==I||t[47]!==R||t[48]!==V||t[49]!==W?(G=(0,$.jsxs)(`div`,{className:`flex items-start gap-1 @max-[26rem]/prow:flex-wrap`,children:[N,I,R,V,W]}),t[45]=N,t[46]=I,t[47]=R,t[48]=V,t[49]=W,t[50]=G):G=t[50];let K;t[51]!==n.error||t[52]!==x?(K=n.error?(0,$.jsx)(`div`,{id:x,role:`alert`,"data-testid":`add-property-error`,className:`mt-0.5 pl-7 text-[10px] text-destructive`,children:n.error}):null,t[51]=n.error,t[52]=x,t[53]=K):K=t[53];let q;return t[54]!==p||t[55]!==G||t[56]!==K?(q=(0,$.jsxs)(`div`,{className:`mt-1 rounded border border-dashed bg-background/40 p-1 @container/prow`,"data-testid":`add-property-row`,"data-key":p,children:[G,K]}),t[54]=p,t[55]=G,t[56]=K,t[57]=q):q=t[57],q}function Rr(e){let t=(0,Z.c)(48),{keyName:n,value:r,widgetType:i,path:a,onCommit:o,onSubmit:s}=e;if(n===`icon`){let e=typeof r==`string`?r:``,i;return t[0]!==n||t[1]!==o||t[2]!==e?(i=(0,$.jsx)(Tr,{keyName:n,value:e,onCommit:o}),t[0]=n,t[1]=o,t[2]=e,t[3]=i):i=t[3],i}if(n===`cover`||n===`banner`){let e=typeof r==`string`?r:``,i;return t[4]!==n||t[5]!==o||t[6]!==e?(i=(0,$.jsx)(Er,{keyName:n,value:e,onCommit:o}),t[4]=n,t[5]=o,t[6]=e,t[7]=i):i=t[7],i}if(ie(r)){let e=a.length-1,i;return t[8]!==n||t[9]!==a||t[10]!==e||t[11]!==r?(i=(0,$.jsx)(_r,{keyName:n,value:r,path:a,depth:e}),t[8]=n,t[9]=a,t[10]=e,t[11]=r,t[12]=i):i=t[12],i}if(ue(r)){let e=a.length-1,i;return t[13]!==n||t[14]!==a||t[15]!==e||t[16]!==r?(i=(0,$.jsx)(yr,{keyName:n,value:r,path:a,depth:e}),t[13]=n,t[14]=a,t[15]=e,t[16]=r,t[17]=i):i=t[17],i}if(se(r)){let e;return t[18]!==n||t[19]!==r?(e=(0,$.jsx)(ae,{keyName:n,value:r}),t[18]=n,t[19]=r,t[20]=e):e=t[20],e}if(i===`list`){let e;t[21]===r?e=t[22]:(e=Array.isArray(r)?r.filter(zr):[],t[21]=r,t[22]=e);let i=e,a;return t[23]!==i||t[24]!==n||t[25]!==o?(a=(0,$.jsx)(fe,{keyName:n,value:i,onCommit:o}),t[23]=i,t[24]=n,t[25]=o,t[26]=a):a=t[26],a}if(i===`boolean`){let e=typeof r==`boolean`?r:!1,i;return t[27]!==e||t[28]!==n||t[29]!==o?(i=(0,$.jsx)(de,{keyName:n,value:e,onCommit:o}),t[27]=e,t[28]=n,t[29]=o,t[30]=i):i=t[30],i}if(i===`number`){let e=typeof r==`number`?r:0,i;return t[31]!==n||t[32]!==e||t[33]!==o||t[34]!==s?(i=(0,$.jsx)(te,{keyName:n,value:e,onCommit:o,onSubmit:s}),t[31]=n,t[32]=e,t[33]=o,t[34]=s,t[35]=i):i=t[35],i}if(i===`date`){let e=typeof r==`string`?r:``,i;return t[36]!==n||t[37]!==o||t[38]!==s||t[39]!==e?(i=(0,$.jsx)(le,{keyName:n,value:e,onCommit:o,onSubmit:s}),t[36]=n,t[37]=o,t[38]=s,t[39]=e,t[40]=i):i=t[40],i}let c;t[41]===r?c=t[42]:(c=typeof r==`string`?r:Array.isArray(r)?r.join(`, `):String(r),t[41]=r,t[42]=c);let l=c,u;return t[43]!==n||t[44]!==o||t[45]!==s||t[46]!==l?(u=(0,$.jsx)(me,{keyName:n,value:l,onCommit:o,onSubmit:s}),t[43]=n,t[44]=o,t[45]=s,t[46]=l,t[47]=u):u=t[47],u}function zr(e){return typeof e==`string`}function Br(e){let t=(0,Z.c)(6),{source:n,target:r}=e,i=r===void 0?`frontmatter.yml`:r,{_:a}=g(),o=n===``?`.ok/${i}`:`${n}/.ok/${i}`,s;t[0]!==a||t[1]!==o?(s=a({id:`4buZWd`,values:{path:o}}),t[0]=a,t[1]=o,t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,$.jsx)(h,{id:`j9Vqvc`}),t[3]=c):c=t[3];let l;return t[4]===s?l=t[5]:(l=(0,$.jsx)(je,{variant:`gray`,"data-testid":`property-inherited-badge`,title:s,className:`text-2xs`,children:c}),t[4]=s,t[5]=l),l}function Vr(e){let t=(0,Z.c)(25),{keyName:n,value:r,values:i,onCommit:a}=e,{_:o}=g(),s=typeof r==`string`?r:``,c;t[0]!==s||t[1]!==i?(c=s!==``&&!i.includes(s)?[s,...i]:i,t[0]=s,t[1]=i,t[2]=c):c=t[2];let l=c,u;t[3]===a?u=t[4]:(u=e=>a(e),t[3]=a,t[4]=u);let d;t[5]!==o||t[6]!==n?(d=o({id:`CwOXMT`,values:{keyName:n}}),t[5]=o,t[6]=n,t[7]=d):d=t[7];let f;t[8]===o?f=t[9]:(f=o({id:`jL3gox`}),t[8]=o,t[9]=f);let p;t[10]===f?p=t[11]:(p=(0,$.jsx)(D,{placeholder:f}),t[10]=f,t[11]=p);let m;t[12]!==n||t[13]!==d||t[14]!==p?(m=(0,$.jsx)(E,{className:`h-7 w-full`,"aria-label":d,"data-testid":`property-enum-select`,"data-key":n,children:p}),t[12]=n,t[13]=d,t[14]=p,t[15]=m):m=t[15];let h;t[16]===l?h=t[17]:(h=l.map(Hr),t[16]=l,t[17]=h);let _;t[18]===h?_=t[19]:(_=(0,$.jsx)(T,{children:h}),t[18]=h,t[19]=_);let v;return t[20]!==s||t[21]!==u||t[22]!==m||t[23]!==_?(v=(0,$.jsxs)(O,{value:s,onValueChange:u,children:[m,_]}),t[20]=s,t[21]=u,t[22]=m,t[23]=_,t[24]=v):v=t[24],v}function Hr(e){return(0,$.jsx)(w,{value:e,children:e},e)}function Ur(e){let t=(0,Z.c)(9),{keyName:n,value:r,values:i,onCommit:a}=e,{_:o}=g(),s;if(t[0]!==o||t[1]!==n||t[2]!==a||t[3]!==r||t[4]!==i){let e=Array.isArray(r)?r.filter(Wr):[],c=e.filter(e=>!i.includes(e)),l=t=>{a(e.includes(t)?e.filter(e=>e!==t):[...e,t])},u;t[6]!==o||t[7]!==n?(u=o({id:`idni-S`,values:{keyName:n}}),t[6]=o,t[7]=n,t[8]=u):u=t[8],s=(0,$.jsx)(`fieldset`,{className:`m-0 flex min-h-7 flex-wrap items-center gap-1 border-0 p-0`,"aria-label":u,"data-testid":`property-enum-multi`,"data-key":n,children:[...i,...c].map(t=>{let n=e.includes(t);return(0,$.jsx)(b,{type:`button`,size:`sm`,variant:n?`secondary`:`outline`,"aria-pressed":n,className:`h-6 px-2 text-xs`,onClick:()=>l(t),"data-testid":`property-enum-option-${t}`,children:t},t)})}),t[0]=o,t[1]=n,t[2]=a,t[3]=r,t[4]=i,t[5]=s}else s=t[5];return s}function Wr(e){return typeof e==`string`}var Gr=(0,Q.createContext)(null);function Kr(e){let t=(0,Z.c)(7),{children:n}=e,[r,i]=(0,Q.useState)(qr),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{i(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},t[0]=a):a=t[0];let o=a,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},t[1]=s):s=t[1];let c=s,l;t[2]===r?l=t[3]:(l={addPropertySignal:r,requestAddProperty:o,clearAddProperty:c},t[2]=r,t[3]=l);let u=l,d;return t[4]!==n||t[5]!==u?(d=(0,$.jsx)(Gr,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function qr(){return new Map}function Jr(){let e=(0,Q.use)(Gr);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}function Yr(e){let t=[],n=[],r=new Set,i=new Set;for(let a of e){if(!I(a))continue;if(a.frontmatterScope!==`missing`){if(i.has(a.message))continue;i.add(a.message),n.push(a);continue}let e=a.frontmatterProperty;if(e!==void 0&&e!==``){if(r.has(e))continue;r.add(e)}t.push(a)}return{missing:t,invalid:n}}function Xr(e,t){let n=(0,Z.c)(7),r;n[0]===t?r=n[1]:(r=t?.enabled===!0&&B.some(e=>e.frontmatter!==void 0&&t.plugins[e.id]?.enabled===!0),n[0]=t,n[1]=r);let i=r,a;n[2]!==i||n[3]!==t?(a=i&&t?j(t):null,n[2]=i,n[3]=t,n[4]=a):a=n[4];let o=$n(e,a),s;return n[5]===o?s=n[6]:(s=o.filter(I),n[5]=o,n[6]=s),s}function Zr(e,t){let n=(0,Z.c)(3),r;return n[0]!==e||n[1]!==t?(r=()=>Ve(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2],(0,Q.useSyncExternalStore)(ze,r)}function Qr(e){let t=document.activeElement;if(t&&e.contains(t)&&typeof t.value==`string`){let{selectionStart:e,selectionEnd:n,value:r}=t;if(e!=null&&n!=null&&n>e&&typeof r==`string`)return r.slice(e,n)}let n=typeof window<`u`?window.getSelection():null;if(!n||n.isCollapsed||n.rangeCount===0)return``;let r=n.getRangeAt(0),i=r.commonAncestorContainer.nodeType===Node.ELEMENT_NODE?r.commonAncestorContainer:r.commonAncestorContainer.parentElement;return!i||!e.contains(i)?``:n.toString()}function $r(e,t){let n=(0,Z.c)(4),r,i;n[0]!==e||n[1]!==t?(r=()=>{if(typeof document>`u`||t===``)return;let n=()=>{let n=e.current;if(!n)return;let r=Qr(n);Be(t,`frontmatter`,r===``?null:Re(r,t))};return document.addEventListener(`selectionchange`,n),()=>{document.removeEventListener(`selectionchange`,n),Be(t,`frontmatter`,null)}},i=[e,t],n[0]=e,n[1]=t,n[2]=r,n[3]=i):(r=n[2],i=n[3]),(0,Q.useEffect)(r,i)}var ei=`[data-testid="property-row"]`;function ti(e){if(e.target.kind!==`property`)return null;let{key:t,path:n}=e.target;return n.length===0?t:String(n[n.length-1])}function ni(e,t,n){let r=[];for(let i of e){if(i.status!==`open`||ti(i)!==t)continue;if(i.anchor===null){r.push({threadId:i.id,start:0,end:n.length});continue}let e=ye(n,i.anchor.quote,i.anchor.start,i.anchor.end);e!==null&&r.push({threadId:i.id,start:e.start,end:e.end})}return r}function ri(e,t,n,r){let i=null;for(let a of ni(e,t,n))r<a.start||r>a.end||(i===null||a.end-a.start<i.end-i.start)&&(i=a);return i?.threadId??null}function ii(e){return!(e instanceof HTMLElement)||!(e instanceof HTMLTextAreaElement)&&!(e instanceof HTMLInputElement)||e.closest(ei)===null?null:e}function ai(e){return e.closest(ei)?.getAttribute(`data-key`)??null}function oi(e){try{return e.selectionStart}catch{return null}}function si(e,t){let n=(0,Z.c)(4),r,i;n[0]!==e||n[1]!==t?(r=()=>{if(t===``)return;let n=e.current;if(n===null)return;let r=e=>{let n=ii(e.target);if(n===null)return;let r=ai(n);if(r===null)return;let i=oi(n);if(i===null)return;let a=ri(p(t),r,n.value,i);if(a!==null){c(a);return}l()!==null&&c(null)};return n.addEventListener(`click`,r),()=>{n.removeEventListener(`click`,r)}},i=[e,t],n[0]=e,n[1]=t,n[2]=r,n[3]=i):(r=n[2],i=n[3]),(0,Q.useEffect)(r,i)}var ci=`ok-properties-collapsed-v1`,li=!1;function ui(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var di=null,fi=new Set;function pi(){let e=ui();if(!e)return li;try{let t=e.getItem(ci);return t===`true`?!0:t===`false`?!1:li}catch{return li}}function mi(){return di===null&&(di=pi()),di}function hi(e){let t=ui();if(t)try{t.setItem(ci,e?`true`:`false`)}catch{}}function gi(){for(let e of fi)e()}function _i(){return mi()}function vi(e){mi()!==e&&(di=e,hi(e),gi())}function yi(e){return fi.add(e),()=>{fi.delete(e)}}function bi(){let e=(0,Z.c)(2),t=(0,Q.useSyncExternalStore)(yi,_i,xi),n;return e[0]===t?n=e[1]:(n=[t,vi],e[0]=t,e[1]=n),n}function xi(){return li}function Si(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ci(e){return!Array.isArray(e)||e.length===0?null:e.every(e=>typeof e==`string`)?e:null}function wi(e){let t=Ci(e.enum);if(t)return{values:t,multi:!1};if(e.type===`array`&&Si(e.items)){let t=Ci(e.items.enum);if(t)return{values:t,multi:!0}}return null}function Ti(e,t){let n=new Map,r=new Set,i=P(e,t);for(let{schema:e}of i){let t=Si(e.properties)?e.properties:{};for(let[e,i]of Object.entries(t)){if(!Si(i))continue;let t=wi(i);if(!t||r.has(e))continue;let a=n.get(e);if(a===void 0){n.set(e,t);continue}if(a.multi!==t.multi){n.delete(e),r.add(e);continue}let o=a.values.filter(e=>t.values.includes(e));o.length===0?(n.delete(e),r.add(e)):n.set(e,{values:o,multi:a.multi})}}return n}function Ei(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Di(e){return Array.isArray(e.required)?e.required.filter(e=>typeof e==`string`):[]}function Oi(e){let t=e.type;if(typeof t!=`string`)return null;switch(t){case`string`:return e.format===`date`?`date`:`text`;case`number`:case`integer`:return`number`;case`boolean`:return`boolean`;case`array`:return`list`;case`object`:return`object`;default:return null}}var ki=new Set([`string`,`number`,`integer`,`boolean`]),Ai=[`anyOf`,`oneOf`,`allOf`,`not`];function ji(e){if(e.type===`array`){let t=Ei(e.items)?e.items.type:void 0;return typeof t!=`string`||ki.has(t)}return typeof e.type==`string`?!0:!Ai.some(t=>t in e)}function Mi(e,t){let n=new Map,r=P(e,t),i=new Set(r.flatMap(({schema:e})=>Di(e))),a=new Set;function o(e,t,r){let o=n.get(e);if(o===void 0){n.set(e,{type:t,required:i.has(e),...r===void 0?{}:{description:r}});return}let s={...o,...o.description===void 0&&r!==void 0?{description:r}:{}};t!==null&&!a.has(e)&&(o.type===null?s.type=t:t!==o.type&&(a.add(e),s.type=`text`)),n.set(e,s)}for(let{schema:e}of r){let t=Ei(e.properties)?e.properties:{};for(let[e,n]of Object.entries(t)){if(!Ei(n))continue;let t=typeof n.description==`string`&&n.description!==``?n.description:void 0;if(!ji(n)){i.has(e)&&o(e,null,t);continue}o(e,Oi(n),t)}}for(let e of i)o(e,null);return new Map([...n].map(([e,t])=>[e,{type:t.type??`text`,required:t.required,...t.description===void 0?{}:{description:t.description}}]))}function Ni(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=q(t);return{map:n,keys:k(t),parseError:r}}function Pi(e){let t=(0,Z.c)(79),{provider:n,reservedKeys:r,identitySlot:i}=e,{_:a}=g(),o;t[0]===r?o=t[1]:(o=r??[],t[0]=r,t[1]=o);let c;t[2]===o?c=t[3]:(c=new Set(o),t[2]=o,t[3]=c);let l=c,[u,d]=(0,Q.useState)(null),f;t[4]===n?f=t[5]:(f=()=>Ni(n),t[4]=n,t[5]=f);let[p,m]=(0,Q.useState)(f),_,y;t[6]===n?(_=t[7],y=t[8]):(_=()=>{let e=s(H(n),n.configuration.name??``);d(e),m(e.current());let t=e.subscribe(e=>{m(e)});return()=>{t(),e.dispose(),d(t=>t===e?null:t)}},y=[n],t[6]=n,t[7]=_,t[8]=y),(0,Q.useEffect)(_,y);let x=p.map,S=p.keys,C=p.parseError,[w,T]=bi(),E;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(E={},t[9]=E):E=t[9];let[D,O]=(0,Q.useState)(E),k;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(k=[],t[10]=k):k=t[10];let[j,M]=(0,Q.useState)(k),[N,P]=(0,Q.useState)(null),I=(0,Q.useRef)(0),[R,z]=(0,Q.useState)(null),B;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(B={},t[11]=B):B=t[11];let[V,U]=(0,Q.useState)(B),W;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(W={},t[12]=W):W=t[12];let[G,q]=(0,Q.useState)(W),J=n.configuration.name??``,{data:Y}=He(J===``?null:J),X=Ti(Y?.effective??null,J),{invalid:te,missing:ne}=Yr(Xr(n,Y?.effective??null)),ie=Mi(Y?.effective??null,J),ae=(0,Q.useRef)(null);$r(ae,J),si(ae,J);let oe;t[13]!==a||t[14]!==u?(oe=function(e){if(!u)return{ok:!1,error:a({id:`9zb2WA`})};let t=u.patch(e);if(t.ok)return{ok:!0};if(t.error.code===`WRITE_ERROR`)return console.warn(`[PropertyPanel] binding write error:`,t.error.detail),{ok:!1,error:t.error.detail};let n=K(t.error);return{ok:!1,error:t.error.issues[0]?.message??a({id:`8fRyLo`}),fieldErrors:Object.keys(n).length>0?n:void 0}},t[13]=a,t[14]=u,t[15]=oe):oe=t[15];let se=oe,le;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(le=function(e){U(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},t[16]=le):le=t[16];let ue=le,de;t[17]===a?de=t[18]:(de=function(e,t){if(e.ok)return;let n=e.error??a({id:`4g19V6`}),r=e.fieldErrors??{};U(e=>{let i={...e};for(let e of t)i[e]=r[e]??n;return i}),q(e=>{let n={...e};for(let e of t)n[e]=(n[e]??0)+1;return n})},t[17]=a,t[18]=de);let fe=de,pe;t[19]!==se||t[20]!==fe?(pe=function(e,t){ue(e),fe(se({[e]:t}),[e])},t[19]=se,t[20]=fe,t[21]=pe):pe=t[21];let me=pe,he;t[22]!==se||t[23]!==fe?(he=function(e){ue(e),fe(se({[e]:null}),[e])},t[22]=se,t[23]=fe,t[24]=he):he=t[24];let ge=he,_e;t[25]!==a||t[26]!==u?(_e=function(e,t){if(!u)return{ok:!1,error:a({id:`9zb2WA`})};if(e===t)return{ok:!0};let n=u.rename(e,t);if(n.ok)return{ok:!0};if(n.error.code===`WRITE_ERROR`)return{ok:!1,error:n.error.detail};let r=K(n.error);return{ok:!1,error:n.error.issues[0]?.message??a({id:`I1gRhX`}),fieldErrors:Object.keys(r).length>0?r:void 0}},t[25]=a,t[26]=u,t[27]=_e):_e=t[27];let ve=_e,ye;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(ye=function(e,t){return`${e} ${t}`},t[28]=ye):ye=t[28];let be=ye,xe;t[29]!==u||t[30]!==S?(xe=function(e){if(!u)return;let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=S.map((e,t)=>be(e,t)),i=r.indexOf(t),a=r.indexOf(n);if(i<0||a<0)return;let o=S.slice(),[s]=o.splice(i,1);if(!s)return;o.splice(a,0,s);let c=u.reorder(o);c.ok||console.warn(`[PropertyPanel] reorder failed:`,c.error)},t[29]=u,t[30]=S,t[31]=xe):xe=t[31];let Ce=xe,we;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(we={activationConstraint:{distance:4}},t[32]=we):we=t[32];let Te;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(Te={coordinateGetter:Ye},t[33]=Te):Te=t[33];let Ee=qe(Je(Ge,we),Je($e,Te)),De;t[34]!==me||t[35]!==x?(De=function(e,t){let n=x[e];if(n===void 0)return;O(n=>({...n,[e]:t}));let r=re(n,t);(!Object.hasOwn(x,e)||!F(n,r))&&me(e,r)},t[34]=me,t[35]=x,t[36]=De):De=t[36];let Oe=De,ke;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(ke=function(e){return e===`date`?new Date().toISOString().slice(0,10):ee[e]},t[37]=ke):ke=t[37];let Ae=ke,je=function(){return I.current+=1,{id:`blank-${I.current}`,name:``,type:`text`,value:``,error:null,focusField:`name`}},Me=function(){let e=[];for(let t of ne){let n=t.frontmatterProperty;if(n===void 0||n===``||Object.hasOwn(x,n)||l.has(n))continue;let r=`staged-${n}`,i=j.find(e=>e.id===r);if(i){e.push(i);continue}let a=ie.get(n)?.type??`text`;e.push({id:r,name:n,type:a,value:ee[a],error:null,focusField:`value`})}return e},Ne;t[38]===T?Ne=t[39]:(Ne=function(e){M(e),P(e[0]?.id??null),T(!1)},t[38]=T,t[39]=Ne);let Pe=Ne,Fe=function(){Pe([je()])},Ie=function(){let e=Me();Pe(e.length>0?e:[je()])},{addPropertySignal:Le,clearAddProperty:Re}=Jr(),ze;t[40]!==Le||t[41]!==J?(ze=Le.get(J)??0,t[40]=Le,t[41]=J,t[42]=ze):ze=t[42];let Be=ze,Ve;t[43]===Be?Ve=t[44]:(Ve=[Be],t[43]=Be,t[44]=Ve),(0,Q.useEffect)(()=>{Be>0&&Ie()},Ve);let Ue,We;t[45]!==Re||t[46]!==J?(Ue=()=>()=>Re(J),We=[J,Re],t[45]=Re,t[46]=J,t[47]=Ue,t[48]=We):(Ue=t[47],We=t[48]),(0,Q.useEffect)(Ue,We);let et;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(et=function(e,t){M(n=>n.map(n=>n.id===e?t(n):n))},t[49]=et):et=t[49];let tt=et,nt;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(nt=function(e,t){tt(e,e=>({...e,type:t,value:Ae(t),error:null}))},t[50]=nt):nt=t[50];let rt=nt,it;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(it=function(e,t){tt(e,e=>({...e,value:t}))},t[51]=it):it=t[51];let at=it,ot;t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ot=function(e,t){tt(e,e=>({...e,name:t,error:null}))},t[52]=ot):ot=t[52];let st=ot,ct;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(ct=function(e,t){tt(e,e=>({...e,name:t.name,type:t.type,value:Ae(t.type),error:null}))},t[53]=ct):ct=t[53];let lt=ct,ut;t[54]!==a||t[55]!==j||t[56]!==se||t[57]!==x?(ut=function(e,t){let n=j.find(t=>t.id===e);if(!n)return;let r=t??n.value,i=t=>tt(e,e=>({...e,value:r,error:t})),o=n.name.trim();if(!o){i(a({id:`8_brI5`}));return}if(L(r)){i(a({id:`hXUWyd`}));return}if(o===`frontmatter`){i(a({id:`dURmlQ`}));return}if(Object.hasOwn(x,o)){i(a({id:`njU86j`,values:{trimmed:o}}));return}let s=se({[o]:r});if(s.ok){M(t=>t.filter(t=>t.id!==e));return}i(s.fieldErrors?.[o]??s.error??a({id:`OJeiSH`}))},t[54]=a,t[55]=j,t[56]=se,t[57]=x,t[58]=ut):ut=t[58];let dt=ut,ft;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(ft=function(e){M(t=>t.filter(t=>t.id!==e))},t[59]=ft):ft=t[59];let pt=ft,mt;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(mt=function(e){z({key:e,draft:e,error:null})},t[60]=mt):mt=t[60];let ht=mt,gt;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(gt=function(e){z(t=>t&&{...t,draft:e,error:null})},t[61]=gt):gt=t[61];let _t=gt,vt;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(vt=function(){z(null)},t[62]=vt):vt=t[62];let yt=vt,bt;t[63]!==a||t[64]!==x||t[65]!==ve||t[66]!==R?(bt=function(){if(!R)return;let e=R.draft.trim();if(!e){z(null);return}if(e===R.key){z(null);return}if(e===`frontmatter`){z({...R,error:a({id:`dURmlQ`})});return}if(Object.hasOwn(x,e)){z({...R,error:a({id:`njU86j`,values:{trimmed:e}})});return}let t=ve(R.key,e);if(t.ok){O(t=>{if(!Object.hasOwn(t,R.key))return t;let n={...t};return n[e]=n[R.key],delete n[R.key],n}),ue(R.key),z(null);return}let n=t.fieldErrors?.[e]??t.fieldErrors?.[R.key]??t.error??a({id:`2ryd91`});z({...R,error:n})},t[63]=a,t[64]=x,t[65]=ve,t[66]=R,t[67]=bt):bt=t[67];let xt=bt,St;t[68]!==x||t[69]!==S?(St=S.length>0?S:Object.keys(x),t[68]=x,t[69]=S,t[70]=St):St=t[70];let Ct;t[71]===l?Ct=t[72]:(Ct=e=>!l.has(e),t[71]=l,t[72]=Ct);let wt=St.filter(Ct),Tt=new Map;for(let e of wt)Tt.set(e,(Tt.get(e)??0)+1);if(wt.length===0&&j.length===0&&!C&&!i&&te.length===0)return null;let Et=[...ie].filter(e=>{let[t]=e;return!Object.hasOwn(x,t)&&!l.has(t)}).map(zi),Dt=function(e){let t=new Set(j.filter(t=>t.id!==e).map(Ri).filter(Li));return t.size===0?Et:Et.filter(e=>!t.has(e.name))},Ot;t[73]===Symbol.for(`react.memo_cache_sentinel`)?(Ot=(0,$.jsx)(h,{id:`l_UFPv`}),t[73]=Ot):Ot=t[73];let kt;t[74]===T?kt=t[75]:(kt=e=>T(!e),t[74]=T,t[75]=kt);let At;t[76]===C?At=t[77]:(At=C?(0,$.jsxs)(`div`,{role:`alert`,"data-testid":`property-panel-yaml-error`,className:`mb-1 ml-(--prop-drag-gutter) flex items-start gap-1.5 rounded border border-destructive/30 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive`,children:[(0,$.jsx)(Se,{className:`size-3.5 shrink-0 mt-0.5`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(h,{id:`zaXlhf`}),(0,$.jsx)(`span`,{className:`block text-[10px] opacity-80`,children:C})]})]}):null,t[76]=C,t[77]=At);let jt;return t[78]===Symbol.for(`react.memo_cache_sentinel`)?(jt=(e,t)=>be(e,t),t[78]=jt):jt=t[78],(0,$.jsx)(sr,{binding:u,children:(0,$.jsx)(dr,{docName:J===``?null:J,children:(0,$.jsxs)(ce,{ref:ae,title:Ot,count:wt.length,problemCount:te.length,problemMessages:te.map(Ii),testId:`property-panel`,className:`pt-4`,contentClassName:`[--prop-drag-gutter:1.375rem] -ml-(--prop-drag-gutter)`,open:!w,onOpenChange:kt,children:[At,i,(0,$.jsx)(Ze,{sensors:Ee,collisionDetection:Ke,onDragEnd:Ce,children:(0,$.jsx)(Qe,{items:wt.map(jt),strategy:Xe,children:wt.map((e,t)=>{let n=x[e];if(n===void 0)return null;let r=D[e]??A(n),i=R?.key===e?R:null,a=(Tt.get(e)??0)>1;return(0,$.jsx)(Ar,{sortableId:be(e,t),keyName:e,value:n,declared:r,enumConstraint:X.get(e),error:V[e]??null,resetCounter:G[e]??0,isDuplicate:a,rename:{state:i,onBegin:()=>ht(e),onChangeDraft:_t,onCommit:xt,onCancel:yt},onCommit:t=>me(e,t),onChangeType:t=>Oe(e,t),onRemove:()=>ge(e),actionSlot:(0,$.jsx)(gr,{propertyKey:e})},`${e}-${t}`)})})}),!l.has(`tags`)&&!Object.hasOwn(x,`tags`)?(0,$.jsx)(Ar,{keyName:`tags`,value:[],declared:`list`,enumConstraint:X.get(`tags`),error:V.tags??null,resetCounter:G.tags??0,isPlaceholder:!0,onCommit:e=>me(`tags`,e),onChangeType:Fi},`virtual-tags`):null,j.length>0?(0,$.jsx)(`div`,{className:`ml-(--prop-drag-gutter)`,children:j.map(e=>(0,$.jsx)(Lr,{rowId:e.id,draft:e,autoFocus:e.id===N?e.focusField:`none`,enumConstraint:X.get(e.name.trim()),fieldSuggestions:Dt(e.id),onChangeName:t=>st(e.id,t),onChangeType:t=>rt(e.id,t),onChangeValue:t=>at(e.id,t),onPickField:t=>lt(e.id,t),onCommit:t=>dt(e.id,t),onCancel:()=>pt(e.id)},e.id))}):(0,$.jsxs)(`div`,{className:`mt-1 flex items-center gap-1`,children:[(0,$.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}),(0,$.jsxs)(b,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:Fe,"aria-label":a({id:`F-NRCj`}),className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,$.jsx)(v,{className:`size-3.5`}),(0,$.jsx)(`span`,{children:(0,$.jsx)(h,{id:`m16xKo`})})]})]})]})})})}function Fi(){}function Ii(e){return e.message}function Li(e){return e!==``}function Ri(e){return e.name.trim()}function zi(e){let[t,n]=e;return{name:t,...n}}var Bi=[`name`],Vi=[];function Hi(e,t){if(t.length===0)return e;let n=new Set(t);return e.filter(e=>e.frontmatterProperty===void 0||!n.has(e.frontmatterProperty))}function Ui(e){let t=(0,Z.c)(40),{provider:n,scope:r,name:i,onRename:a,nameError:o,onNameDraftChange:s,nameEditable:c}=e,l=c===void 0?!0:c,{_:u}=g(),d=(0,Q.useId)(),f=Ie(),p=f.status===`ready`?f.data.find(e=>e.scope===r&&e.name===i):void 0,[m,_]=(0,Q.useState)(i),v,y;t[0]===i?(v=t[1],y=t[2]):(v=()=>_(i),y=[i],t[0]=i,t[1]=v,t[2]=y),(0,Q.useEffect)(v,y);let b,x;t[3]===m?(b=t[4],x=t[5]):(x=m.trim(),b=x!==``&&!W.test(x),t[3]=m,t[4]=b,t[5]=x);let S=b,C;t[6]!==i||t[7]!==S||t[8]!==a||t[9]!==x?(C=function(){a&&(S||x===``||x===i||a(x))},t[6]=i,t[7]=S,t[8]=a,t[9]=x,t[10]=C):C=t[10];let w=C,T=S||!!o,E=pe,D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(he,{className:`size-3.5`}),t[11]=D):D=t[11];let O;t[12]===u?O=t[13]:(O=u({id:`XmJfZT`}),t[12]=u,t[13]=O);let k=!l,A;t[14]===s?A=t[15]:(A=e=>{let t=e.target.value;_(t),s?.(t)},t[14]=s,t[15]=A);let j=T?`${d}-error`:void 0,M;t[16]!==w||t[17]!==m||t[18]!==d||t[19]!==T||t[20]!==j||t[21]!==k||t[22]!==A?(M=(0,$.jsx)(De,{id:d,"data-testid":`skill-name-input`,value:m,readOnly:k,onChange:A,onBlur:w,onKeyDown:Gi,"aria-invalid":T,"aria-describedby":j,className:`h-7 rounded-sm border-transparent bg-transparent px-2 font-mono text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 dark:bg-transparent`}),t[16]=w,t[17]=m,t[18]=d,t[19]=T,t[20]=j,t[21]=k,t[22]=A,t[23]=M):M=t[23];let N=T?(0,$.jsx)(`p`,{id:`${d}-error`,className:`px-1 pt-0.5 text-[11px] text-destructive`,children:o||(0,$.jsx)(h,{id:`A50vr3`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`})}})}):x?(0,$.jsxs)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:[(0,$.jsx)(h,{id:`NErvOX`}),` `,p&&x===i?Ee(p).map(Wi):p?(0,$.jsx)(`code`,{className:`font-mono`,children:`${p.path.replace(/\/SKILL\.mdx?$/i,``).split(`/`).slice(0,-1).join(`/`)}/${x}`}):(0,$.jsx)(h,{id:`tA0b9E`})]}):(0,$.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,$.jsx)(h,{id:`1hvhf0`})}),P;t[24]!==E||t[25]!==d||t[26]!==M||t[27]!==N||t[28]!==D||t[29]!==O?(P=(0,$.jsxs)(E,{icon:D,label:O,htmlFor:d,children:[M,N]}),t[24]=E,t[25]=d,t[26]=M,t[27]=N,t[28]=D,t[29]=O,t[30]=P):P=t[30];let F=P,I;t[31]!==u||t[32]!==p?(I=p?.size?(0,$.jsx)(pe,{icon:(0,$.jsx)(rt,{className:`size-3.5`}),label:u({id:`WOr-hW`}),children:(0,$.jsx)(tt,{size:p.size})}):null,t[31]=u,t[32]=p,t[33]=I):I=t[33];let L=I,R;t[34]!==F||t[35]!==L?(R=(0,$.jsxs)($.Fragment,{children:[F,L]}),t[34]=F,t[35]=L,t[36]=R):R=t[36];let z;return t[37]!==n||t[38]!==R?(z=(0,$.jsx)(Pi,{provider:n,reservedKeys:Bi,identitySlot:R}),t[37]=n,t[38]=R,t[39]=z):z=t[39],z}function Wi(e,t){return(0,$.jsxs)(`span`,{children:[t>0?`, `:null,(0,$.jsx)(`code`,{className:`font-mono`,children:e.dir}),e.symlink?(0,$.jsxs)(`span`,{className:`italic`,children:[` `,(0,$.jsx)(h,{id:`VmXASo`})]}):null]},e.dir)}function Gi(e){e.key===`Enter`&&e.currentTarget.blur()}function Ki(e,t){let n=e.current().map[t];return typeof n==`string`?n:``}function qi(e,t){let n=(0,Z.c)(15),[r,i]=(0,Q.useState)(null),a;n[0]!==t||n[1]!==e?(a=()=>{let n=H(e),r=Ki(n,t);return n.dispose(),r},n[0]=t,n[1]=e,n[2]=a):a=n[2];let[o,c]=(0,Q.useState)(a),l=(0,Q.useRef)(!1),u,d;n[3]!==t||n[4]!==e?(u=()=>{let n=s(H(e),e.configuration.name??``);i(n),c(Ki(n,t));let r=n.subscribe(()=>{l.current||c(Ki(n,t))});return()=>{r(),n.dispose(),i(e=>e===n?null:e)}},d=[e,t],n[3]=t,n[4]=e,n[5]=u,n[6]=d):(u=n[5],d=n[6]),(0,Q.useEffect)(u,d);let f;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{l.current=!0},n[7]=f):f=n[7];let p;n[8]!==r||n[9]!==t||n[10]!==o?(p=()=>{l.current=!1,r&&o!==Ki(r,t)&&r.patch({[t]:o})},n[8]=r,n[9]=t,n[10]=o,n[11]=p):p=n[11];let m;return n[12]!==p||n[13]!==o?(m={value:o,setValue:c,onFocus:f,onBlur:p},n[12]=p,n[13]=o,n[14]=m):m=n[14],m}function Ji(e){let t=(0,Z.c)(76),{provider:n,name:r,folder:i,onRename:a,nameError:o}=e,{_:s}=g(),c=(0,Q.useId)(),l=(0,Q.useId)(),u=(0,Q.useId)(),d=(0,Q.useId)(),f=qi(n,`title`),p=qi(n,`description`),[m,_]=(0,Q.useState)(r),v,y;t[0]===r?(v=t[1],y=t[2]):(v=()=>_(r),y=[r],t[0]=r,t[1]=v,t[2]=y),(0,Q.useEffect)(v,y);let b,x;t[3]===m?(b=t[4],x=t[5]):(x=m.trim(),b=x!==``&&!V.test(x),t[3]=m,t[4]=b,t[5]=x);let S=b,C;t[6]!==r||t[7]!==S||t[8]!==a||t[9]!==x?(C=function(){a&&(S||x===``||x===r||a(x))},t[6]=r,t[7]=S,t[8]=a,t[9]=x,t[10]=C):C=t[10];let w=C,T=S||!!o,E;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,$.jsx)(h,{id:`l_UFPv`}),t[11]=E):E=t[11];let D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,$.jsx)(nt,{className:`size-3.5`}),t[12]=D):D=t[12];let O;t[13]===s?O=t[14]:(O=s({id:`ugoTXs`}),t[13]=s,t[14]=O);let k=i||`/`,A;t[15]!==d||t[16]!==k?(A=(0,$.jsx)(De,{id:d,value:k,readOnly:!0,className:`h-8 border-input bg-transparent px-2 font-mono text-muted-foreground shadow-none`}),t[15]=d,t[16]=k,t[17]=A):A=t[17];let j;t[18]!==d||t[19]!==O||t[20]!==A?(j=(0,$.jsx)(pe,{icon:D,label:O,htmlFor:d,children:A}),t[18]=d,t[19]=O,t[20]=A,t[21]=j):j=t[21];let M;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,$.jsx)(he,{className:`size-3.5`}),t[22]=M):M=t[22];let N;t[23]===s?N=t[24]:(N=s({id:`XmJfZT`}),t[23]=s,t[24]=N);let P;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(P=e=>_(e.target.value),t[25]=P):P=t[25];let F;t[26]!==w||t[27]!==m||t[28]!==c||t[29]!==T?(F=(0,$.jsx)(De,{id:c,"data-testid":`template-name-input`,value:m,onChange:P,onBlur:w,onKeyDown:Yi,"aria-invalid":T,className:`h-8 border-input bg-transparent px-2 font-mono shadow-none focus-visible:bg-muted/30`}),t[26]=w,t[27]=m,t[28]=c,t[29]=T,t[30]=F):F=t[30];let I;t[31]!==o||t[32]!==T?(I=T?(0,$.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-destructive`,children:o||(0,$.jsx)(h,{id:`lI0Td2`,components:{0:(0,$.jsx)(`code`,{className:`font-mono`}),1:(0,$.jsx)(`code`,{className:`font-mono`})}})}):(0,$.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,$.jsx)(h,{id:`QfFBdJ`})}),t[31]=o,t[32]=T,t[33]=I):I=t[33];let L;t[34]!==c||t[35]!==N||t[36]!==F||t[37]!==I?(L=(0,$.jsxs)(pe,{icon:M,label:N,htmlFor:c,children:[F,I]}),t[34]=c,t[35]=N,t[36]=F,t[37]=I,t[38]=L):L=t[38];let R;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,$.jsx)(he,{className:`size-3.5`}),t[39]=R):R=t[39];let z;t[40]===s?z=t[41]:(z=s({id:`q7F5am`}),t[40]=s,t[41]=z);let B;t[42]===f?B=t[43]:(B=e=>f.setValue(e.target.value),t[42]=f,t[43]=B);let H;t[44]!==B||t[45]!==f.onBlur||t[46]!==f.onFocus||t[47]!==f.value||t[48]!==l?(H=(0,$.jsx)(De,{id:l,"data-testid":`template-title-input`,value:f.value,onChange:B,onFocus:f.onFocus,onBlur:f.onBlur,className:`h-8 border-input bg-transparent px-2 shadow-none focus-visible:bg-muted/30`}),t[44]=B,t[45]=f.onBlur,t[46]=f.onFocus,t[47]=f.value,t[48]=l,t[49]=H):H=t[49];let U;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,$.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,$.jsx)(h,{id:`5e1Dri`})}),t[50]=U):U=t[50];let W;t[51]!==z||t[52]!==H||t[53]!==l?(W=(0,$.jsxs)(pe,{icon:R,label:z,htmlFor:l,children:[H,U]}),t[51]=z,t[52]=H,t[53]=l,t[54]=W):W=t[54];let G;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,$.jsx)(he,{className:`size-3.5`}),t[55]=G):G=t[55];let K;t[56]===s?K=t[57]:(K=s({id:`eTsJYJ`}),t[56]=s,t[57]=K);let q;t[58]===p?q=t[59]:(q=e=>p.setValue(e.target.value),t[58]=p,t[59]=q);let J;t[60]!==p.onBlur||t[61]!==p.onFocus||t[62]!==p.value||t[63]!==u||t[64]!==q?(J=(0,$.jsx)(et,{id:u,"data-testid":`template-description-input`,value:p.value,onChange:q,onFocus:p.onFocus,onBlur:p.onBlur,className:`min-h-16 resize-none border-input bg-transparent px-2 py-1.5 shadow-none focus-visible:bg-muted/30`}),t[60]=p.onBlur,t[61]=p.onFocus,t[62]=p.value,t[63]=u,t[64]=q,t[65]=J):J=t[65];let Y;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,$.jsx)(`p`,{className:`px-1 pt-0.5 text-[11px] text-muted-foreground`,children:(0,$.jsx)(h,{id:`sFhaTJ`})}),t[66]=Y):Y=t[66];let X;t[67]!==u||t[68]!==K||t[69]!==J?(X=(0,$.jsxs)(pe,{icon:G,label:K,htmlFor:u,children:[J,Y]}),t[67]=u,t[68]=K,t[69]=J,t[70]=X):X=t[70];let ee;return t[71]!==j||t[72]!==L||t[73]!==W||t[74]!==X?(ee=(0,$.jsxs)(ce,{title:E,className:`pt-4 pb-2`,children:[j,L,W,X]}),t[71]=j,t[72]=L,t[73]=W,t[74]=X,t[75]=ee):ee=t[75],ee}function Yi(e){e.key===`Enter`&&e.currentTarget.blur()}function Xi(e){let t=(0,Z.c)(22),{docName:n,provider:r}=e,i;t[0]===n?i=t[1]:(i=U(n),t[0]=n,t[1]=i);let a=i;if(a?.kind===`skill`){if(a.rel!==null){let e;return t[2]===r?e=t[3]:(e=(0,$.jsx)(Pi,{provider:r}),t[2]=r,t[3]=e),e}let e;return t[4]!==a.name||t[5]!==a.scope||t[6]!==r?(e=(0,$.jsx)($i,{provider:r,scope:a.scope,name:a.name}),t[4]=a.name,t[5]=a.scope,t[6]=r,t[7]=e):e=t[7],e}let o;t[8]===n?o=t[9]:(o=Oe(n),t[8]=n,t[9]=o);let s=o;if(s){let e;return t[10]!==s||t[11]!==r?(e=(0,$.jsx)($i,{provider:r,scope:`project`,name:s}),t[10]=s,t[11]=r,t[12]=e):e=t[12],e}let c;t[13]===n?c=t[14]:(c=N(n),t[13]=n,t[14]=c);let l=c;if(l){let e;return t[15]!==n||t[16]!==l.folder||t[17]!==l.name||t[18]!==r?(e=(0,$.jsx)(ea,{provider:r,docName:n,folder:l.folder,name:l.name}),t[15]=n,t[16]=l.folder,t[17]=l.name,t[18]=r,t[19]=e):e=t[19],e}if(J(n)){let e;return t[20]===r?e=t[21]:(e=(0,$.jsx)(Pi,{provider:r}),t[20]=r,t[21]=e),e}return null}function Zi(){let e=(0,Z.c)(6),{openTarget:t,closeDocument:n,setSkillsSidebar:r,activeDocName:i,openTabs:o}=a(),s;return e[0]!==i||e[1]!==n||e[2]!==o||e[3]!==t||e[4]!==r?(s=(e,a)=>{if(e===a)return;Ae(a)&&r(!0);let s={kind:`doc`,target:a,docName:a};i===e?(t(s,{tabBehavior:`replace-active`}),we(Te(a))):o.some(t=>ke(t)===e)&&(t(s),n(e))},e[0]=i,e[1]=n,e[2]=o,e[3]=t,e[4]=r,e[5]=s):s=e[5],s}function Qi(){let e=(0,Z.c)(3),{_:t}=g(),n=Zi(),r;return e[0]!==t||e[1]!==n?(r=async(e,r)=>{let i=await Le({scope:e.scope,fromName:e.name,toName:r});if(!i.ok)return Y.error(t({id:`zKxoPm`,values:{0:e.name,1:i.error}})),i;Y.success(t({id:`B6NpZ7`,values:{next:r}}));let a=e.scope===`project`&&i.to!==void 0?`${i.to.replace(/\/+$/,``)}/SKILL`:M(e.scope,r);return n(e.scope===`project`&&i.to!==void 0?`${i.to.split(`/`).slice(0,-1).join(`/`)}/${e.name}/SKILL`:M(e.scope,e.name),a),i},e[0]=t,e[1]=n,e[2]=r):r=e[2],r}function $i(e){let t=(0,Z.c)(10),{provider:n,scope:r,name:i}=e,a=Qi(),[o,s]=(0,Q.useState)(null),c;t[0]!==i||t[1]!==a||t[2]!==r?(c=async function(e){s(null);let t=await a({scope:r,name:i},e);t.ok||s(t.error)},t[0]=i,t[1]=a,t[2]=r,t[3]=c):c=t[3];let l=c,u;return t[4]!==l||t[5]!==i||t[6]!==n||t[7]!==o||t[8]!==r?(u=(0,$.jsx)(Ui,{provider:n,scope:r,name:i,onRename:l,nameError:o}),t[4]=l,t[5]=i,t[6]=n,t[7]=o,t[8]=r,t[9]=u):u=t[9],u}function ea(e){let t=(0,Z.c)(12),{provider:n,docName:r,folder:i,name:a}=e,{_:o}=g(),s=Zi(),[c,l]=(0,Q.useState)(null),u;t[0]!==o||t[1]!==r||t[2]!==i||t[3]!==a||t[4]!==s?(u=async function(e){l(null);let t=await ve({fromFolder:i,fromName:a,toFolder:i,toName:e});if(!t.ok){l(t.error),Y.error(o({id:`gk_-qj`,values:{0:t.error}}));return}Y.success(o({id:`YKLP_-`})),s(r,z(i,e))},t[0]=o,t[1]=r,t[2]=i,t[3]=a,t[4]=s,t[5]=u):u=t[5];let d=u,f;return t[6]!==i||t[7]!==d||t[8]!==a||t[9]!==n||t[10]!==c?(f=(0,$.jsx)(Ji,{provider:n,name:a,folder:i,onRename:d,nameError:c}),t[6]=i,t[7]=d,t[8]=a,t[9]=n,t[10]=c,t[11]=f):f=t[11],f}export{Zn as _,Bi as a,Zr as c,Kr as d,Jr as f,$n as g,Br as h,Vi as i,Yr as l,Ar as m,Zi as n,Hi as o,Lr as p,Qi as r,Pi as s,Xi as t,Xr as u,rt as v};
@@ -0,0 +1 @@
1
+ import{t as e}from"./ManagedArtifactProperties-EYfMUx3g.js";export{e as ManagedArtifactProperties};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./overlay-layers-Bj-TVfKw.js";import{n as s,w as c}from"./CodeMirrorPropInput-SvCCpq_g.js";import{t as l}from"./Mermaid-D6W1JO-s.js";import{g as u}from"./config-provider-CYqYSyJg.js";import{P as d,Z as f,kt as p}from"./dist-SEJoL7zW.js";import{t as m}from"./cm-theme-Cv1HvKYn.js";import{t as h}from"./dist-DwHSSQIa2.js";import{t as g}from"./src-Dyjlw1SL.js";var _=a(),v=e(n(),1),y=t(),b=m({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),x=m({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function S(e,t,n){let r=e.toString();if(r===t)return;let i=0,a=Math.min(r.length,t.length);for(;i<a&&r[i]===t[i];)i+=1;let o=r.length,s=t.length;for(;o>i&&s>i&&r[o-1]===t[s-1];)--o,--s;let c=()=>{o>i&&e.delete(i,o-i),s>i&&e.insert(i,t.slice(i,s))},l=e.doc;l?l.transact(c,n):c()}function C(e){let t=(0,_.c)(7),{ytext:n,provider:r,undoManager:a}=e,o=(0,v.useRef)(null),{resolvedTheme:l}=i(),u,m;t[0]!==r||t[1]!==l||t[2]!==a||t[3]!==n?(u=()=>{let e=o.current;if(!e)return;let t=l===`dark`?b:x,i=new f({state:p.create({doc:n.toString(),extensions:[h,g(n,r.awareness,{undoManager:a}),c(),d(s),f.lineWrapping,f.theme({"&":{height:`100%`}}),t]}),parent:e});return()=>i.destroy()},m=[n,r,l,a],t[0]=r,t[1]=l,t[2]=a,t[3]=n,t[4]=u,t[5]=m):(u=t[4],m=t[5]),(0,v.useEffect)(u,m);let S;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,y.jsx)(`div`,{ref:o,className:`h-full min-h-0 overflow-auto`}),t[6]=S):S=t[6],S}var w=Symbol(`mermaid-diagram-edit`);function T(e){let t=(0,_.c)(28),{provider:n,isSourceMode:i}=e,{_:a}=r(),s;t[0]===n.document?s=t[1]:(s=n.document.getText(`source`),t[0]=n.document,t[1]=s);let c=s,d;t[2]===c?d=t[3]:(d=()=>c.toString(),t[2]=c,t[3]=d);let[f,p]=(0,v.useState)(d),m,h;t[4]===c?(m=t[5],h=t[6]):(m=()=>{let e=()=>p(c.toString());return c.observe(e),e(),()=>c.unobserve(e)},h=[c],t[4]=c,t[5]=m,t[6]=h),(0,v.useEffect)(m,h);let g;t[7]===c?g=t[8]:(g=()=>new u(c,{trackedOrigins:new Set([w])}),t[7]=c,t[8]=g);let[b]=(0,v.useState)(g),x;t[9]===c?x=t[10]:(x={canEdit:!0,commitChart:e=>S(c,e,w)},t[9]=c,t[10]=x);let T=x,E,D;t[11]!==i||t[12]!==b?(E=()=>{if(i)return;let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`||o())return;let t=e.target;if(t instanceof HTMLElement){let e=t.tagName;if(e===`INPUT`||e===`TEXTAREA`||t.isContentEditable)return}e.preventDefault(),e.shiftKey?b.redo():b.undo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[i,b],t[11]=i,t[12]=b,t[13]=E,t[14]=D):(E=t[13],D=t[14]),(0,v.useEffect)(E,D);let O;t[15]===a?O=t[16]:(O=a({id:`8PifYj`}),t[15]=a,t[16]=O);let k=i?`source`:`diagram`,A;t[17]!==T||t[18]!==i||t[19]!==n||t[20]!==f||t[21]!==b||t[22]!==c?(A=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:i?(0,y.jsx)(C,{ytext:c,provider:n,undoManager:b}):(0,y.jsx)(`div`,{className:`flex h-full min-h-0 flex-col p-3`,children:(0,y.jsx)(l,{chart:f,editBinding:T,className:`min-h-0 flex-1`})})}),t[17]=T,t[18]=i,t[19]=n,t[20]=f,t[21]=b,t[22]=c,t[23]=A):A=t[23];let j;return t[24]!==k||t[25]!==A||t[26]!==O?(j=(0,y.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":O,"data-mermaid-doc-editor":``,"data-mermaid-doc-editor-mode":k,children:A}),t[24]=k,t[25]=A,t[26]=O,t[27]=j):j=t[27],j}export{T as MermaidDocEditor,S as replaceYText};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{r}from"./dist-Nvb76hAm.js";import{n as i}from"./dist-PQ5KMVDh.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./overlay-layers-Bj-TVfKw.js";import{n as s,w as c}from"./CodeMirrorPropInput-ZXKkJFOY.js";import{t as l}from"./Mermaid-D6W1JO-s.js";import{g as u}from"./config-provider-oAAIxoES.js";import{P as d,Z as f,kt as p}from"./dist-SEJoL7zW.js";import{t as m}from"./cm-theme-Cv1HvKYn.js";import{t as h}from"./dist-DwHSSQIa2.js";import{t as g}from"./src-Dn75jB9p.js";var _=a(),v=e(n(),1),y=t(),b=m({dark:!0,background:`var(--background)`,gutterBackground:`var(--muted)`}),x=m({dark:!1,background:`var(--background)`,gutterBackground:`var(--muted)`});function S(e,t,n){let r=e.toString();if(r===t)return;let i=0,a=Math.min(r.length,t.length);for(;i<a&&r[i]===t[i];)i+=1;let o=r.length,s=t.length;for(;o>i&&s>i&&r[o-1]===t[s-1];)--o,--s;let c=()=>{o>i&&e.delete(i,o-i),s>i&&e.insert(i,t.slice(i,s))},l=e.doc;l?l.transact(c,n):c()}function C(e){let t=(0,_.c)(7),{ytext:n,provider:r,undoManager:a}=e,o=(0,v.useRef)(null),{resolvedTheme:l}=i(),u,m;t[0]!==r||t[1]!==l||t[2]!==a||t[3]!==n?(u=()=>{let e=o.current;if(!e)return;let t=l===`dark`?b:x,i=new f({state:p.create({doc:n.toString(),extensions:[h,g(n,r.awareness,{undoManager:a}),c(),d(s),f.lineWrapping,f.theme({"&":{height:`100%`}}),t]}),parent:e});return()=>i.destroy()},m=[n,r,l,a],t[0]=r,t[1]=l,t[2]=a,t[3]=n,t[4]=u,t[5]=m):(u=t[4],m=t[5]),(0,v.useEffect)(u,m);let S;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,y.jsx)(`div`,{ref:o,className:`h-full min-h-0 overflow-auto`}),t[6]=S):S=t[6],S}var w=Symbol(`mermaid-diagram-edit`);function T(e){let t=(0,_.c)(28),{provider:n,isSourceMode:i}=e,{_:a}=r(),s;t[0]===n.document?s=t[1]:(s=n.document.getText(`source`),t[0]=n.document,t[1]=s);let c=s,d;t[2]===c?d=t[3]:(d=()=>c.toString(),t[2]=c,t[3]=d);let[f,p]=(0,v.useState)(d),m,h;t[4]===c?(m=t[5],h=t[6]):(m=()=>{let e=()=>p(c.toString());return c.observe(e),e(),()=>c.unobserve(e)},h=[c],t[4]=c,t[5]=m,t[6]=h),(0,v.useEffect)(m,h);let g;t[7]===c?g=t[8]:(g=()=>new u(c,{trackedOrigins:new Set([w])}),t[7]=c,t[8]=g);let[b]=(0,v.useState)(g),x;t[9]===c?x=t[10]:(x={canEdit:!0,commitChart:e=>S(c,e,w)},t[9]=c,t[10]=x);let T=x,E,D;t[11]!==i||t[12]!==b?(E=()=>{if(i)return;let e=e=>{if(!(e.metaKey||e.ctrlKey)||e.key.toLowerCase()!==`z`||o())return;let t=e.target;if(t instanceof HTMLElement){let e=t.tagName;if(e===`INPUT`||e===`TEXTAREA`||t.isContentEditable)return}e.preventDefault(),e.shiftKey?b.redo():b.undo()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},D=[i,b],t[11]=i,t[12]=b,t[13]=E,t[14]=D):(E=t[13],D=t[14]),(0,v.useEffect)(E,D);let O;t[15]===a?O=t[16]:(O=a({id:`8PifYj`}),t[15]=a,t[16]=O);let k=i?`source`:`diagram`,A;t[17]!==T||t[18]!==i||t[19]!==n||t[20]!==f||t[21]!==b||t[22]!==c?(A=(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:i?(0,y.jsx)(C,{ytext:c,provider:n,undoManager:b}):(0,y.jsx)(`div`,{className:`flex h-full min-h-0 flex-col p-3`,children:(0,y.jsx)(l,{chart:f,editBinding:T,className:`min-h-0 flex-1`})})}),t[17]=T,t[18]=i,t[19]=n,t[20]=f,t[21]=b,t[22]=c,t[23]=A):A=t[23];let j;return t[24]!==k||t[25]!==A||t[26]!==O?(j=(0,y.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":O,"data-mermaid-doc-editor":``,"data-mermaid-doc-editor-mode":k,children:A}),t[24]=k,t[25]=A,t[26]=O,t[27]=j):j=t[27],j}export{T as MermaidDocEditor,S as replaceYText};