@hienlh/ppm 0.2.21 → 0.4.0

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 (58) hide show
  1. package/CHANGELOG.md +53 -3
  2. package/dist/web/assets/chat-tab-mOQXOUVI.js +6 -0
  3. package/dist/web/assets/code-editor-CRgH4vbS.js +1 -0
  4. package/dist/web/assets/diff-viewer-D3qUDVXh.js +4 -0
  5. package/dist/web/assets/git-graph-D1SOZKP7.js +1 -0
  6. package/dist/web/assets/index-C_yeSRZ0.css +2 -0
  7. package/dist/web/assets/index-CgNJBFj4.js +21 -0
  8. package/dist/web/assets/input-AESbQWjx.js +41 -0
  9. package/dist/web/assets/markdown-renderer-BwjbbSR0.js +59 -0
  10. package/dist/web/assets/settings-store-DWYkr_a3.js +1 -0
  11. package/dist/web/assets/settings-tab-C-UYksUh.js +1 -0
  12. package/dist/web/assets/tab-store-B1wzyDLQ.js +1 -0
  13. package/dist/web/assets/{terminal-tab-BEFAYT4S.js → terminal-tab-BeFf07MH.js} +1 -1
  14. package/dist/web/assets/use-monaco-theme-Bb9W0CI2.js +11 -0
  15. package/dist/web/index.html +7 -5
  16. package/dist/web/sw.js +1 -1
  17. package/package.json +1 -1
  18. package/src/providers/claude-agent-sdk.ts +83 -10
  19. package/src/server/index.ts +81 -1
  20. package/src/server/ws/chat.ts +10 -0
  21. package/src/types/api.ts +3 -3
  22. package/src/types/chat.ts +3 -3
  23. package/src/web/app.tsx +11 -3
  24. package/src/web/components/chat/chat-history-bar.tsx +231 -0
  25. package/src/web/components/chat/chat-tab.tsx +19 -66
  26. package/src/web/components/chat/message-list.tsx +4 -114
  27. package/src/web/components/chat/tool-cards.tsx +54 -14
  28. package/src/web/components/editor/code-editor.tsx +26 -39
  29. package/src/web/components/editor/diff-viewer.tsx +0 -21
  30. package/src/web/components/layout/command-palette.tsx +145 -15
  31. package/src/web/components/layout/draggable-tab.tsx +2 -0
  32. package/src/web/components/layout/editor-panel.tsx +44 -5
  33. package/src/web/components/layout/sidebar.tsx +53 -7
  34. package/src/web/components/layout/tab-bar.tsx +30 -48
  35. package/src/web/components/settings/ai-settings-section.tsx +28 -19
  36. package/src/web/components/settings/settings-tab.tsx +24 -21
  37. package/src/web/components/shared/markdown-renderer.tsx +223 -0
  38. package/src/web/components/ui/scroll-area.tsx +2 -2
  39. package/src/web/hooks/use-chat.ts +78 -83
  40. package/src/web/hooks/use-global-keybindings.ts +30 -2
  41. package/src/web/stores/panel-store.ts +2 -9
  42. package/src/web/stores/settings-store.ts +12 -2
  43. package/src/web/styles/globals.css +14 -4
  44. package/dist/web/assets/chat-tab-C_U7EwM9.js +0 -6
  45. package/dist/web/assets/code-editor-DuarTBEe.js +0 -1
  46. package/dist/web/assets/columns-2-DFQ3yid7.js +0 -1
  47. package/dist/web/assets/diff-viewer-sBWBgb7U.js +0 -4
  48. package/dist/web/assets/git-graph-fOKEZiot.js +0 -1
  49. package/dist/web/assets/index-3zt5mBwZ.css +0 -2
  50. package/dist/web/assets/index-CaUQy3Zs.js +0 -21
  51. package/dist/web/assets/input-CTnwfHVN.js +0 -41
  52. package/dist/web/assets/marked.esm-DhBtkBa8.js +0 -59
  53. package/dist/web/assets/settings-tab-C5aWMqIA.js +0 -1
  54. package/dist/web/assets/use-monaco-theme-BxaccPmI.js +0 -11
  55. /package/dist/web/assets/{api-client-BCjah751.js → api-client-BsHoRDAn.js} +0 -0
  56. /package/dist/web/assets/{copy-B-kLwqzg.js → copy-BNk4Z75P.js} +0 -0
  57. /package/dist/web/assets/{external-link-Dim3NH6h.js → external-link-CrtbmtJ6.js} +0 -0
  58. /package/dist/web/assets/{utils-B-_GCz7E.js → utils-bntUtdc7.js} +0 -0
@@ -1,41 +0,0 @@
1
- import{a as e,i as t,r as n,t as r}from"./jsx-runtime-BFALxl05.js";import{r as i,t as a}from"./utils-B-_GCz7E.js";var o=t((e=>{var t=n();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.4`})),s=t(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=o()})),c=e(n(),1);function l(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function u(...e){return t=>{let n=!1,r=e.map(e=>{let r=l(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():l(e[t],null)}}}}function d(...e){return c.useCallback(u(...e),e)}var f=r();function p(e){let t=h(e),n=c.forwardRef((e,n)=>{let{children:r,...i}=e,a=c.Children.toArray(r),o=a.find(v);if(o){let e=o.props.children,r=a.map(t=>t===o?c.Children.count(e)>1?c.Children.only(null):c.isValidElement(e)?e.props.children:null:t);return(0,f.jsx)(t,{...i,ref:n,children:c.isValidElement(e)?c.cloneElement(e,void 0,r):null})}return(0,f.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var m=p(`Slot`);function h(e){let t=c.forwardRef((e,t)=>{let{children:n,...r}=e;if(c.isValidElement(n)){let e=b(n),i=y(r,n.props);return n.type!==c.Fragment&&(i.ref=t?u(t,e):e),c.cloneElement(n,i)}return c.Children.count(n)>1?c.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var g=Symbol(`radix.slottable`);function _(e){let t=({children:e})=>(0,f.jsx)(f.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=g,t}function v(e){return c.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===g}function y(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function b(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var x=e(s(),1),S=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=p(`Primitive.${t}`),r=c.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,f.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function C(e,t){e&&x.flushSync(()=>e.dispatchEvent(t))}function w(e,t){let n=c.createContext(t),r=e=>{let{children:t,...r}=e,i=c.useMemo(()=>r,Object.values(r));return(0,f.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=c.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function T(e,t=[]){let n=[];function r(t,r){let i=c.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,l=c.useMemo(()=>o,Object.values(o));return(0,f.jsx)(s.Provider,{value:l,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,l=c.useContext(s);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>c.createContext(e));return function(n){let r=n?.[e]||t;return c.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,E(i,...t)]}function E(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function ee(e){let t=e+`CollectionProvider`,[n,r]=T(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=c.useRef(null),a=c.useRef(new Map).current;return(0,f.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,l=p(s),u=c.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,f.jsx)(l,{ref:d(t,a(s,n).collectionRef),children:r})});u.displayName=s;let m=e+`CollectionItemSlot`,h=`data-radix-collection-item`,g=p(m),_=c.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=c.useRef(null),s=d(t,o),l=a(m,n);return c.useEffect(()=>(l.itemMap.set(o,{ref:o,...i}),()=>void l.itemMap.delete(o))),(0,f.jsx)(g,{[h]:``,ref:s,children:r})});_.displayName=m;function v(t){let n=a(e+`CollectionConsumer`,t);return c.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:u,ItemSlot:_},v,r]}typeof window<`u`&&window.document&&window.document.createElement;function D(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var O=globalThis?.document?c.useLayoutEffect:()=>{},k=c.useInsertionEffect||O;function A({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=j({defaultProp:t,onChange:n}),s=e!==void 0,l=s?e:i;{let t=c.useRef(e!==void 0);c.useEffect(()=>{let e=t.current;if(e!==s){let t=e?`controlled`:`uncontrolled`,n=s?`controlled`:`uncontrolled`;console.warn(`${r} is changing from ${t} to ${n}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,r])}return[l,c.useCallback(t=>{if(s){let n=M(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function j({defaultProp:e,onChange:t}){let[n,r]=c.useState(e),i=c.useRef(n),a=c.useRef(t);return k(()=>{a.current=t},[t]),c.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function M(e){return typeof e==`function`}var N=c.useId||(()=>void 0),te=0;function ne(e){let[t,n]=c.useState(N());return O(()=>{e||n(e=>e??String(te++))},[e]),e||(t?`radix-${t}`:``)}var re=c.createContext(void 0);function ie(e){let t=c.useContext(re);return e||t||`ltr`}function P(e){let t=c.useRef(e);return c.useEffect(()=>{t.current=e}),c.useMemo(()=>(...e)=>t.current?.(...e),[])}function F(e,t=globalThis?.document){let n=P(e);c.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var ae=`DismissableLayer`,oe=`dismissableLayer.update`,se=`dismissableLayer.pointerDownOutside`,ce=`dismissableLayer.focusOutside`,le,ue=c.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),de=c.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...l}=e,u=c.useContext(ue),[p,m]=c.useState(null),h=p?.ownerDocument??globalThis?.document,[,g]=c.useState({}),_=d(t,e=>m(e)),v=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=v.indexOf(y),x=p?v.indexOf(p):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,w=x>=b,T=me(e=>{let t=e.target,n=[...u.branches].some(e=>e.contains(t));!w||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},h),E=he(e=>{let t=e.target;[...u.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},h);return F(e=>{x===u.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},h),c.useEffect(()=>{if(p)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(le=h.body.style.pointerEvents,h.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),ge(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=le)}},[p,h,n,u]),c.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),ge())},[p,u]),c.useEffect(()=>{let e=()=>g({});return document.addEventListener(oe,e),()=>document.removeEventListener(oe,e)},[]),(0,f.jsx)(S.div,{...l,ref:_,style:{pointerEvents:C?w?`auto`:`none`:void 0,...e.style},onFocusCapture:D(e.onFocusCapture,E.onFocusCapture),onBlurCapture:D(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:D(e.onPointerDownCapture,T.onPointerDownCapture)})});de.displayName=ae;var fe=`DismissableLayerBranch`,pe=c.forwardRef((e,t)=>{let n=c.useContext(ue),r=c.useRef(null),i=d(t,r);return c.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,f.jsx)(S.div,{...e,ref:i})});pe.displayName=fe;function me(e,t=globalThis?.document){let n=P(e),r=c.useRef(!1),i=c.useRef(()=>{});return c.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){_e(se,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function he(e,t=globalThis?.document){let n=P(e),r=c.useRef(!1);return c.useEffect(()=>{let e=e=>{e.target&&!r.current&&_e(ce,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ge(){let e=new CustomEvent(oe);document.dispatchEvent(e)}function _e(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?C(i,a):i.dispatchEvent(a)}var ve=`focusScope.autoFocusOnMount`,ye=`focusScope.autoFocusOnUnmount`,be={bubbles:!1,cancelable:!0},xe=`FocusScope`,Se=c.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,l]=c.useState(null),u=P(i),p=P(a),m=c.useRef(null),h=d(t,e=>l(e)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let e=function(e){if(g.paused||!s)return;let t=e.target;s.contains(t)?m.current=t:I(m.current,{select:!0})},t=function(e){if(g.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||I(m.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&I(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,g.paused]),c.useEffect(()=>{if(s){ke.add(g);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(ve,be);s.addEventListener(ve,u),s.dispatchEvent(t),t.defaultPrevented||(Ce(Me(Te(s)),{select:!0}),document.activeElement===e&&I(s))}return()=>{s.removeEventListener(ve,u),setTimeout(()=>{let t=new CustomEvent(ye,be);s.addEventListener(ye,p),s.dispatchEvent(t),t.defaultPrevented||I(e??document.body,{select:!0}),s.removeEventListener(ye,p),ke.remove(g)},0)}}},[s,u,p,g]);let _=c.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=we(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&I(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&I(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,f.jsx)(S.div,{tabIndex:-1,...o,ref:h,onKeyDown:_})});Se.displayName=xe;function Ce(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(I(r,{select:t}),document.activeElement!==n)return}function we(e){let t=Te(e);return[Ee(t,e),Ee(t.reverse(),e)]}function Te(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ee(e,t){for(let n of e)if(!De(n,{upTo:t}))return n}function De(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Oe(e){return e instanceof HTMLInputElement&&`select`in e}function I(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Oe(e)&&t&&e.select()}}var ke=Ae();function Ae(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=je(e,t),e.unshift(t)},remove(t){e=je(e,t),e[0]?.resume()}}}function je(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Me(e){return e.filter(e=>e.tagName!==`A`)}var Ne=`Portal`,Pe=c.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=c.useState(!1);O(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?x.createPortal((0,f.jsx)(S.div,{...r,ref:t}),o):null});Pe.displayName=Ne;var Fe=0;function Ie(){c.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Le()),document.body.insertAdjacentElement(`beforeend`,e[1]??Le()),Fe++,()=>{Fe===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Fe--}},[])}function Le(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var L=function(){return L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},L.apply(this,arguments)};function Re(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ze(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Be=`right-scroll-bar-position`,Ve=`width-before-scroll-bar`,He=`with-scroll-bars-hidden`,Ue=`--removed-body-scroll-bar-size`;function We(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Ge(e,t){var n=(0,c.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ke=typeof window<`u`?c.useLayoutEffect:c.useEffect,qe=new WeakMap;function Je(e,t){var n=Ge(t||null,function(t){return e.forEach(function(e){return We(e,t)})});return Ke(function(){var t=qe.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||We(e,null)}),i.forEach(function(e){r.has(e)||We(e,a)})}qe.set(n,e)},[e]),n}function Ye(e){return e}function Xe(e,t){t===void 0&&(t=Ye);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ze(e){e===void 0&&(e={});var t=Xe(null);return t.options=L({async:!0,ssr:!1},e),t}var Qe=function(e){var t=e.sideCar,n=Re(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return c.createElement(r,L({},n))};Qe.isSideCarExport=!0;function $e(e,t){return e.useMedium(t),Qe}var et=Ze(),tt=function(){},nt=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:tt,onWheelCapture:tt,onTouchMoveCapture:tt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,l=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Re(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=Je([n,t]),w=L(L({},x),i);return c.createElement(c.Fragment,null,d&&c.createElement(S,{sideCar:et,removeScrollBar:u,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?c.cloneElement(c.Children.only(s),L(L({},w),{ref:C})):c.createElement(y,L({},w,{className:l,ref:C}),s))});nt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},nt.classNames={fullWidth:Ve,zeroRight:Be};var rt,it=function(){if(rt)return rt;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function at(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=it();return t&&e.setAttribute(`nonce`,t),e}function ot(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function st(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var ct=function(){var e=0,t=null;return{add:function(n){e==0&&(t=at())&&(ot(t,n),st(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},lt=function(){var e=ct();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ut=function(){var e=lt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},dt={left:0,top:0,right:0,gap:0},ft=function(e){return parseInt(e||``,10)||0},pt=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[ft(n),ft(r),ft(i)]},mt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return dt;var t=pt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},ht=ut(),gt=`data-scroll-locked`,_t=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
- .${He} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${gt}] {
7
- overflow: hidden ${r};
8
- overscroll-behavior: contain;
9
- ${[t&&`position: relative ${r};`,n===`margin`&&`
10
- padding-left: ${i}px;
11
- padding-top: ${a}px;
12
- padding-right: ${o}px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: ${s}px ${r};
16
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
- }
18
-
19
- .${Be} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${Ve} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${Be} .${Be} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${Ve} .${Ve} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${gt}] {
36
- ${Ue}: ${s}px;
37
- }
38
- `},vt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},yt=function(){c.useEffect(function(){return document.body.setAttribute(gt,(vt()+1).toString()),function(){var e=vt()-1;e<=0?document.body.removeAttribute(gt):document.body.setAttribute(gt,e.toString())}},[])},bt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;yt();var a=c.useMemo(function(){return mt(i)},[i]);return c.createElement(ht,{styles:_t(a,!t,i,n?``:`!important`)})},xt=!1;if(typeof window<`u`)try{var St=Object.defineProperty({},`passive`,{get:function(){return xt=!0,!0}});window.addEventListener(`test`,St,St),window.removeEventListener(`test`,St,St)}catch{xt=!1}var Ct=xt?{passive:!1}:!1,wt=function(e){return e.tagName===`TEXTAREA`},Tt=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!wt(e)&&n[t]===`visible`)},Et=function(e){return Tt(e,`overflowY`)},Dt=function(e){return Tt(e,`overflowX`)},Ot=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),jt(e,r)){var i=Mt(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},kt=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},At=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},jt=function(e,t){return e===`v`?Et(t):Dt(t)},Mt=function(e,t){return e===`v`?kt(t):At(t)},Nt=function(e,t){return e===`h`&&t===`rtl`?-1:1},Pt=function(e,t,n,r,i){var a=Nt(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Mt(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&jt(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Ft=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},It=function(e){return[e.deltaX,e.deltaY]},Lt=function(e){return e&&`current`in e?e.current:e},Rt=function(e,t){return e[0]===t[0]&&e[1]===t[1]},zt=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},Bt=0,Vt=[];function Ht(e){var t=c.useRef([]),n=c.useRef([0,0]),r=c.useRef(),i=c.useState(Bt++)[0],a=c.useState(ut)[0],o=c.useRef(e);c.useEffect(function(){o.current=e},[e]),c.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ze([e.lockRef.current],(e.shards||[]).map(Lt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=c.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ft(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Ot(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Ot(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Pt(h,t,e,h===`h`?s:c,!0)},[]),l=c.useCallback(function(e){var n=e;if(!(!Vt.length||Vt[Vt.length-1]!==a)){var r=`deltaY`in n?It(n):Ft(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Rt(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Lt).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),u=c.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Ut(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=c.useCallback(function(e){n.current=Ft(e),r.current=void 0},[]),f=c.useCallback(function(t){u(t.type,It(t),t.target,s(t,e.lockRef.current))},[]),p=c.useCallback(function(t){u(t.type,Ft(t),t.target,s(t,e.lockRef.current))},[]);c.useEffect(function(){return Vt.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,l,Ct),document.addEventListener(`touchmove`,l,Ct),document.addEventListener(`touchstart`,d,Ct),function(){Vt=Vt.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,l,Ct),document.removeEventListener(`touchmove`,l,Ct),document.removeEventListener(`touchstart`,d,Ct)}},[]);var m=e.removeScrollBar,h=e.inert;return c.createElement(c.Fragment,null,h?c.createElement(a,{styles:zt(i)}):null,m?c.createElement(bt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Ut(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Wt=$e(et,Ht),Gt=c.forwardRef(function(e,t){return c.createElement(nt,L({},e,{ref:t,sideCar:Wt}))});Gt.classNames=nt.classNames;var Kt=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},qt=new WeakMap,Jt=new WeakMap,Yt={},Xt=0,Zt=function(e){return e&&(e.host||Zt(e.parentNode))},Qt=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Zt(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},$t=function(e,t,n,r){var i=Qt(t,Array.isArray(e)?e:[e]);Yt[n]||(Yt[n]=new WeakMap);var a=Yt[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(qt.get(e)||0)+1,l=(a.get(e)||0)+1;qt.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Jt.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Xt++,function(){o.forEach(function(e){var t=qt.get(e)-1,i=a.get(e)-1;qt.set(e,t),a.set(e,i),t||(Jt.has(e)||e.removeAttribute(r),Jt.delete(e)),i||e.removeAttribute(n)}),Xt--,Xt||(qt=new WeakMap,qt=new WeakMap,Jt=new WeakMap,Yt={})}},en=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Kt(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),$t(r,i,n,`aria-hidden`)):function(){return null}};function tn(e){let[t,n]=c.useState(void 0);return O(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var nn=[`top`,`right`,`bottom`,`left`],R=Math.min,z=Math.max,rn=Math.round,an=Math.floor,B=e=>({x:e,y:e}),on={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function sn(e,t,n){return z(e,R(t,n))}function V(e,t){return typeof e==`function`?e(t):e}function H(e){return e.split(`-`)[0]}function U(e){return e.split(`-`)[1]}function cn(e){return e===`x`?`y`:`x`}function ln(e){return e===`y`?`height`:`width`}function W(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function un(e){return cn(W(e))}function dn(e,t,n){n===void 0&&(n=!1);let r=U(e),i=un(e),a=ln(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=bn(o)),[o,bn(o)]}function fn(e){let t=bn(e);return[pn(e),t,pn(t)]}function pn(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var mn=[`left`,`right`],hn=[`right`,`left`],gn=[`top`,`bottom`],_n=[`bottom`,`top`];function vn(e,t,n){switch(e){case`top`:case`bottom`:return n?t?hn:mn:t?mn:hn;case`left`:case`right`:return t?gn:_n;default:return[]}}function yn(e,t,n,r){let i=U(e),a=vn(H(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(pn)))),a}function bn(e){let t=H(e);return on[t]+e.slice(t.length)}function xn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Sn(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:xn(e)}function Cn(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function wn(e,t,n){let{reference:r,floating:i}=e,a=W(t),o=un(t),s=ln(o),c=H(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(U(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function Tn(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=V(t,e),p=Sn(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Cn(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Cn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var En=50,Dn=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Tn},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=wn(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<En&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=wn(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},On=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=V(e,t)||{};if(l==null)return{};let d=Sn(u),f={x:n,y:r},p=un(i),m=ln(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=R(d[_],T),ee=R(d[v],T),D=E,O=C-h[m]-ee,k=C/2-h[m]/2+w,A=sn(D,k,O),j=!c.arrow&&U(i)!=null&&k!==A&&a.reference[m]/2-(k<D?E:ee)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),kn=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=V(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=H(r),_=W(o),v=H(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[bn(o)]:fn(o)),x=p!==`none`;!d&&x&&b.push(...yn(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=dn(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==W(t))||T.every(e=>W(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=W(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function An(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function jn(e){return nn.some(t=>e[t]>=0)}var Mn=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=V(e,t);switch(i){case`referenceHidden`:{let e=An(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:jn(e)}}}case`escaped`:{let e=An(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:jn(e)}}}default:return{}}}}},Nn=new Set([`left`,`top`]);async function Pn(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=H(n),s=U(n),c=W(n)===`y`,l=Nn.has(o)?-1:1,u=a&&c?-1:1,d=V(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fn=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Pn(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},In=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=V(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=W(H(i)),p=cn(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=sn(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=sn(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ln=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=V(e,t),u={x:n,y:r},d=W(i),f=cn(d),p=u[f],m=u[d],h=V(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Nn.has(H(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Rn=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=V(e,t),u=await o.detectOverflow(t,l),d=H(i),f=U(i),p=W(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=R(h-u[g],v),x=R(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=z(u.left,0),t=z(u.right,0),n=z(u.top,0),r=z(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:z(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:z(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function zn(){return typeof window<`u`}function G(e){return Bn(e)?(e.nodeName||``).toLowerCase():`#document`}function K(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){return((Bn(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Bn(e){return zn()?e instanceof Node||e instanceof K(e).Node:!1}function J(e){return zn()?e instanceof Element||e instanceof K(e).Element:!1}function Y(e){return zn()?e instanceof HTMLElement||e instanceof K(e).HTMLElement:!1}function Vn(e){return!zn()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof K(e).ShadowRoot}function Hn(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Un(e){return/^(table|td|th)$/.test(G(e))}function Wn(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Gn=/transform|translate|scale|rotate|perspective|filter/,Kn=/paint|layout|strict|content/,X=e=>!!e&&e!==`none`,qn;function Jn(e){let t=J(e)?Z(e):e;return X(t.transform)||X(t.translate)||X(t.scale)||X(t.rotate)||X(t.perspective)||!Xn()&&(X(t.backdropFilter)||X(t.filter))||Gn.test(t.willChange||``)||Kn.test(t.contain||``)}function Yn(e){let t=Q(e);for(;Y(t)&&!Zn(t);){if(Jn(t))return t;if(Wn(t))return null;t=Q(t)}return null}function Xn(){return qn??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),qn}function Zn(e){return/^(html|body|#document)$/.test(G(e))}function Z(e){return K(e).getComputedStyle(e)}function Qn(e){return J(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if(G(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Vn(e)&&e.host||q(e);return Vn(t)?t.host:t}function $n(e){let t=Q(e);return Zn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Y(t)&&Hn(t)?t:$n(t)}function er(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=$n(e),i=r===e.ownerDocument?.body,a=K(r);if(i){let e=tr(a);return t.concat(a,a.visualViewport||[],Hn(r)?r:[],e&&n?er(e):[])}else return t.concat(r,er(r,[],n))}function tr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nr(e){let t=Z(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Y(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=rn(n)!==a||rn(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function rr(e){return J(e)?e:e.contextElement}function ir(e){let t=rr(e);if(!Y(t))return B(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=nr(t),o=(a?rn(n.width):n.width)/r,s=(a?rn(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ar=B(0);function or(e){let t=K(e);return!Xn()||!t.visualViewport?ar:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sr(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==K(e)?!1:t}function $(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=rr(e),o=B(1);t&&(r?J(r)&&(o=ir(r)):o=ir(e));let s=sr(a,n,r)?or(a):B(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=K(a),t=r&&J(r)?K(r):r,n=e,i=tr(n);for(;i&&r&&t!==n;){let e=ir(i),t=i.getBoundingClientRect(),r=Z(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=K(i),i=tr(n)}}return Cn({width:u,height:d,x:c,y:l})}function cr(e,t){let n=Qn(e).scrollLeft;return t?t.left+n:$(q(e)).left+n}function lr(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-cr(e,n),y:n.top+t.scrollTop}}function ur(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=q(r),s=t?Wn(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=B(1),u=B(0),d=Y(r);if((d||!d&&!a)&&((G(r)!==`body`||Hn(o))&&(c=Qn(r)),d)){let e=$(r);l=ir(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?lr(o,c):B(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function dr(e){return Array.from(e.getClientRects())}function fr(e){let t=q(e),n=Qn(e),r=e.ownerDocument.body,i=z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+cr(e),s=-n.scrollTop;return Z(r).direction===`rtl`&&(o+=z(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var pr=25;function mr(e,t){let n=K(e),r=q(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Xn();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=cr(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=pr&&(a-=o)}else l<=pr&&(a+=l);return{width:a,height:o,x:s,y:c}}function hr(e,t){let n=$(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Y(e)?ir(e):B(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function gr(e,t,n){let r;if(t===`viewport`)r=mr(e,n);else if(t===`document`)r=fr(q(e));else if(J(t))r=hr(t,n);else{let n=or(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Cn(r)}function _r(e,t){let n=Q(e);return n===t||!J(n)||Zn(n)?!1:Z(n).position===`fixed`||_r(n,t)}function vr(e,t){let n=t.get(e);if(n)return n;let r=er(e,[],!1).filter(e=>J(e)&&G(e)!==`body`),i=null,a=Z(e).position===`fixed`,o=a?Q(e):e;for(;J(o)&&!Zn(o);){let t=Z(o),n=Jn(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Hn(o)&&!n&&_r(e,o))?r=r.filter(e=>e!==o):i=t,o=Q(o)}return t.set(e,r),r}function yr(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Wn(t)?[]:vr(t,this._c):[].concat(n),r],o=gr(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=gr(t,a[e],i);s=z(n.top,s),c=R(n.right,c),l=R(n.bottom,l),u=z(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function br(e){let{width:t,height:n}=nr(e);return{width:t,height:n}}function xr(e,t,n){let r=Y(t),i=q(t),a=n===`fixed`,o=$(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=B(0);function l(){c.x=cr(i)}if(r||!r&&!a)if((G(t)!==`body`||Hn(i))&&(s=Qn(t)),r){let e=$(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?lr(i,s):B(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Sr(e){return Z(e).position===`static`}function Cr(e,t){if(!Y(e)||Z(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function wr(e,t){let n=K(e);if(Wn(e))return n;if(!Y(e)){let t=Q(e);for(;t&&!Zn(t);){if(J(t)&&!Sr(t))return t;t=Q(t)}return n}let r=Cr(e,t);for(;r&&Un(r)&&Sr(r);)r=Cr(r,t);return r&&Zn(r)&&Sr(r)&&!Jn(r)?n:r||Yn(e)||n}var Tr=async function(e){let t=this.getOffsetParent||wr,n=this.getDimensions,r=await n(e.floating);return{reference:xr(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Er(e){return Z(e).direction===`rtl`}var Dr={convertOffsetParentRelativeRectToViewportRelativeRect:ur,getDocumentElement:q,getClippingRect:yr,getOffsetParent:wr,getElementRects:Tr,getClientRects:dr,getDimensions:br,getScale:ir,isElement:J,isRTL:Er};function Or(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kr(e,t){let n=null,r,i=q(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=an(d),h=an(i.clientWidth-(u+f)),g=an(i.clientHeight-(d+p)),_=an(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:z(0,R(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Or(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ar(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=rr(e),u=i||a?[...l?er(l):[],...t?er(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?kr(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$(e):null;c&&g();function g(){let t=$(e);h&&!Or(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var jr=Fn,Mr=In,Nr=kn,Pr=Rn,Fr=Mn,Ir=On,Lr=Ln,Rr=(e,t,n)=>{let r=new Map,i={platform:Dr,...n},a={...i.platform,_c:r};return Dn(e,t,{...i,platform:a})},zr=typeof document<`u`?c.useLayoutEffect:function(){};function Br(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Br(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Br(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Vr(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hr(e,t){let n=Vr(e);return Math.round(t*n)/n}function Ur(e){let t=c.useRef(e);return zr(()=>{t.current=e}),t}function Wr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,f]=c.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=c.useState(r);Br(p,r)||m(r);let[h,g]=c.useState(null),[_,v]=c.useState(null),y=c.useCallback(e=>{e!==w.current&&(w.current=e,g(e))},[]),b=c.useCallback(e=>{e!==T.current&&(T.current=e,v(e))},[]),S=a||h,C=o||_,w=c.useRef(null),T=c.useRef(null),E=c.useRef(d),ee=l!=null,D=Ur(l),O=Ur(i),k=Ur(u),A=c.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Rr(w.current,T.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Br(E.current,t)&&(E.current=t,x.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);zr(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let j=c.useRef(!1);zr(()=>(j.current=!0,()=>{j.current=!1}),[]),zr(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(D.current)return D.current(S,C,A);A()}},[S,C,A,D,ee]);let M=c.useMemo(()=>({reference:w,floating:T,setReference:y,setFloating:b}),[y,b]),N=c.useMemo(()=>({reference:S,floating:C}),[S,C]),te=c.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Hr(N.floating,d.x),r=Hr(N.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Vr(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,d.x,d.y]);return c.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:te}),[d,A,M,N,te])}var Gr=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Ir({element:r.current,padding:i}).fn(n):r?Ir({element:r,padding:i}).fn(n):{}}}},Kr=(e,t)=>{let n=jr(e);return{name:n.name,fn:n.fn,options:[e,t]}},qr=(e,t)=>{let n=Mr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jr=(e,t)=>({fn:Lr(e).fn,options:[e,t]}),Yr=(e,t)=>{let n=Nr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xr=(e,t)=>{let n=Pr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zr=(e,t)=>{let n=Fr(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qr=(e,t)=>{let n=Gr(e);return{name:n.name,fn:n.fn,options:[e,t]}},$r=`Arrow`,ei=c.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,f.jsx)(S.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,f.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});ei.displayName=$r;var ti=ei,ni=`Popper`,[ri,ii]=T(ni),[ai,oi]=ri(ni),si=e=>{let{__scopePopper:t,children:n}=e,[r,i]=c.useState(null);return(0,f.jsx)(ai,{scope:t,anchor:r,onAnchorChange:i,children:n})};si.displayName=ni;var ci=`PopperAnchor`,li=c.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=oi(ci,n),o=c.useRef(null),s=d(t,o),l=c.useRef(null);return c.useEffect(()=>{let e=l.current;l.current=r?.current||o.current,e!==l.current&&a.onAnchorChange(l.current)}),r?null:(0,f.jsx)(S.div,{...i,ref:s})});li.displayName=ci;var ui=`PopperContent`,[di,fi]=ri(ui),pi=c.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=oi(ui,n),[b,x]=c.useState(null),C=d(t,e=>x(e)),[w,T]=c.useState(null),E=tn(w),ee=E?.width??0,D=E?.height??0,k=r+(a===`center`?``:`-`+a),A=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},j=Array.isArray(u)?u:[u],M=j.length>0,N={padding:A,boundary:j.filter(_i),altBoundary:M},{refs:te,floatingStyles:ne,placement:re,isPositioned:ie,middlewareData:F}=Wr({strategy:`fixed`,placement:k,whileElementsMounted:(...e)=>Ar(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[Kr({mainAxis:i+D,alignmentAxis:o}),l&&qr({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?Jr():void 0,...N}),l&&Yr({...N}),Xr({...N,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),w&&Qr({element:w,padding:s}),vi({arrowWidth:ee,arrowHeight:D}),h&&Zr({strategy:`referenceHidden`,...N})]}),[ae,oe]=yi(re),se=P(_);O(()=>{ie&&se?.()},[ie,se]);let ce=F.arrow?.x,le=F.arrow?.y,ue=F.arrow?.centerOffset!==0,[de,fe]=c.useState();return O(()=>{b&&fe(window.getComputedStyle(b).zIndex)},[b]),(0,f.jsx)(`div`,{ref:te.setFloating,"data-radix-popper-content-wrapper":``,style:{...ne,transform:ie?ne.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[F.transformOrigin?.x,F.transformOrigin?.y].join(` `),...F.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,f.jsx)(di,{scope:n,placedSide:ae,onArrowChange:T,arrowX:ce,arrowY:le,shouldHideArrow:ue,children:(0,f.jsx)(S.div,{"data-side":ae,"data-align":oe,...v,ref:C,style:{...v.style,animation:ie?void 0:`none`}})})})});pi.displayName=ui;var mi=`PopperArrow`,hi={top:`bottom`,right:`left`,bottom:`top`,left:`right`},gi=c.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=fi(mi,n),a=hi[i.placedSide];return(0,f.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,f.jsx)(ti,{...r,ref:t,style:{...r.style,display:`block`}})})});gi.displayName=mi;function _i(e){return e!==null}var vi=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=yi(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function yi(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var bi=si,xi=li,Si=pi,Ci=gi;function wi(e,[t,n]){return Math.min(n,Math.max(t,e))}var Ti=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Ei=i,Di=((e,t)=>n=>{if(t?.variants==null)return Ei(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Ti(t)||Ti(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Ei(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/90`,destructive:`bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40`,outline:`border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,xs:`h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`,"icon-xs":`size-6 rounded-md [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-8`,"icon-lg":`size-10`}},defaultVariants:{variant:`default`,size:`default`}});function Oi({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){return(0,f.jsx)(r?m:`button`,{"data-slot":`button`,"data-variant":t,"data-size":n,className:a(Di({variant:t,size:n,className:e})),...i})}function ki({className:e,type:t,...n}){return(0,f.jsx)(`input`,{type:t,"data-slot":`input`,className:a(`h-9 w-full min-w-0 rounded-lg border border-border bg-surface px-3 py-2 text-base md:text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`selection:bg-primary selection:text-primary-foreground`,`file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground`,`aria-invalid:border-destructive`,e),...n})}export{s as A,T as C,_ as D,p as E,u as O,w as S,C as T,ne as _,Ci as a,D as b,ii as c,Ie as d,Pe as f,ie as g,P as h,xi as i,d as k,en as l,de as m,Oi as n,Si as o,Se as p,wi as r,bi as s,ki as t,Gt as u,A as v,S as w,ee as x,O as y};
@@ -1,59 +0,0 @@
1
- import{n as e}from"./jsx-runtime-BFALxl05.js";var t=e(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]);function n(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var r=n();function i(e){r=e}var a={exec:()=>null};function o(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(c.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var s=(()=>{try{return!0}catch{return!1}})(),c={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},l=/^(?:[ \t]*(?:\n|$))+/,u=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,d=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,f=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,p=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,m=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,h=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,g=o(h).replace(/bull/g,m).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),ee=o(h).replace(/bull/g,m).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),_=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,te=/^[^\n]+/,v=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ne=o(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,v).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),re=o(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,m).getRegex(),y=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,b=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ie=o(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,b).replace(`tag`,y).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=o(_).replace(`hr`,f).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex(),S={blockquote:o(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,x).getRegex(),code:u,def:ne,fences:d,heading:p,hr:f,html:ie,lheading:g,list:re,newline:l,paragraph:x,table:a,text:te},C=o(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,f).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex(),ae={...S,lheading:ee,table:C,paragraph:o(_).replace(`hr`,f).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,C).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,y).getRegex()},oe={...S,html:o(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,b).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:a,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:o(_).replace(`hr`,f).replace(`heading`,` *#{1,6} *[^
2
- ]`).replace(`lheading`,g).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},se=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ce=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,w=/^( {2,}|\\)\n(?!\s*$)/,le=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,T=/[\p{P}\p{S}]/u,E=/[\s\p{P}\p{S}]/u,D=/[^\s\p{P}\p{S}]/u,ue=o(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,E).getRegex(),O=/(?!~)[\p{P}\p{S}]/u,de=/(?!~)[\s\p{P}\p{S}]/u,fe=/(?:[^\s\p{P}\p{S}]|~)/u,k=/(?![*_])[\p{P}\p{S}]/u,pe=/(?![*_])[\s\p{P}\p{S}]/u,me=/(?:[^\s\p{P}\p{S}]|[*_])/u,he=o(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,s?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),A=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ge=o(A,`u`).replace(/punct/g,T).getRegex(),_e=o(A,`u`).replace(/punct/g,O).getRegex(),j=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,ve=o(j,`gu`).replace(/notPunctSpace/g,D).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),ye=o(j,`gu`).replace(/notPunctSpace/g,fe).replace(/punctSpace/g,de).replace(/punct/g,O).getRegex(),be=o(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,D).replace(/punctSpace/g,E).replace(/punct/g,T).getRegex(),xe=o(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,k).getRegex(),Se=o(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,me).replace(/punctSpace/g,pe).replace(/punct/g,k).getRegex(),Ce=o(/\\(punct)/,`gu`).replace(/punct/g,T).getRegex(),we=o(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Te=o(b).replace(`(?:-->|$)`,`-->`).getRegex(),Ee=o(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Te).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,De=o(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,M).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),N=o(/^!?\[(label)\]\[(ref)\]/).replace(`label`,M).replace(`ref`,v).getRegex(),P=o(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,v).getRegex(),Oe=o(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,N).replace(`nolink`,P).getRegex(),F=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,I={_backpedal:a,anyPunctuation:Ce,autolink:we,blockSkip:he,br:w,code:ce,del:a,delLDelim:a,delRDelim:a,emStrongLDelim:ge,emStrongRDelimAst:ve,emStrongRDelimUnd:be,escape:se,link:De,nolink:P,punctuation:ue,reflink:N,reflinkSearch:Oe,tag:Ee,text:le,url:a},ke={...I,link:o(/^!?\[(label)\]\((.*?)\)/).replace(`label`,M).getRegex(),reflink:o(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,M).getRegex()},L={...I,emStrongRDelimAst:ye,emStrongLDelim:_e,delLDelim:xe,delRDelim:Se,url:o(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,F).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:o(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,F).getRegex()},Ae={...L,br:o(w).replace(`{2,}`,`*`).getRegex(),text:o(L.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},R={normal:S,gfm:ae,pedantic:oe},z={normal:I,gfm:L,breaks:Ae,pedantic:ke},je={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},B=e=>je[e];function V(e,t){if(t){if(c.escapeTest.test(e))return e.replace(c.escapeReplace,B)}else if(c.escapeTestNoEncode.test(e))return e.replace(c.escapeReplaceNoEncode,B);return e}function H(e){try{e=encodeURI(e).replace(c.percentDecode,`%`)}catch{return null}return e}function U(e,t){let n=e.replace(c.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(c.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(c.slashPipe,`|`);return n}function W(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Me(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Ne(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function G(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function Pe(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
3
- `).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
4
- `)}var K=class{options;rules;lexer;constructor(e){this.options=e||r}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:W(e,`
5
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Pe(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=W(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:W(t[0],`
6
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=W(t[0],`
7
- `).split(`
8
- `),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
9
- `),c=s.replace(this.rules.other.blockquoteSetextReplace,`
10
- $1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
11
- ${s}`:s,r=r?`${r}
12
- ${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
13
- `+e.join(`
14
- `),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
15
- `+e.join(`
16
- `),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
17
- `);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Ne(t[2].split(`
18
- `,1)[0],t[1].length),l=e.split(`
19
- `,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
20
- `,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
21
- `,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
22
- `+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
23
- `+l}u=!l.trim(),r+=p+`
24
- `,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=U(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
25
- `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(U(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
26
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=W(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Me(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),G(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return G(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},q=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new K,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:c,block:R.normal,inline:z.normal};this.options.pedantic?(t.block=R.pedantic,t.inline=z.pedantic):this.options.gfm&&(t.block=R.gfm,this.options.breaks?t.inline=z.breaks:t.inline=z.gfm),this.tokenizer.rules=t}static get rules(){return{block:R,inline:z}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(c.carriageReturn,`
27
- `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(c.tabCharGlobal,` `).replace(c.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
28
- `:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
29
- `)?``:`
30
- `)+r.raw,n.text+=`
31
- `+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
32
- `)?``:`
33
- `)+r.raw,n.text+=`
34
- `+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
35
- `)?``:`
36
- `)+r.raw,a.text+=`
37
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
38
- `)?``:`
39
- `)+r.raw,n.text+=`
40
- `+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},J=class{options;parser;constructor(e){this.options=e||r}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(c.notSpaceStart)?.[0],i=e.replace(c.endingNewline,``)+`
41
- `;return r?`<pre><code class="language-`+V(r)+`">`+(n?i:V(i,!0))+`</code></pre>
42
- `:`<pre><code>`+(n?i:V(i,!0))+`</code></pre>
43
- `}blockquote({tokens:e}){return`<blockquote>
44
- ${this.parser.parse(e)}</blockquote>
45
- `}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
46
- `}hr(e){return`<hr>
47
- `}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
48
- `+r+`</`+i+`>
49
- `}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
50
- `}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
51
- `}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
52
- <thead>
53
- `+t+`</thead>
54
- `+r+`</table>
55
- `}tablerow({text:e}){return`<tr>
56
- ${e}</tr>
57
- `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
58
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${V(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=H(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+V(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=H(e);if(i===null)return V(n);e=i;let a=`<img src="${e}" alt="${V(n)}"`;return t&&(a+=` title="${V(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:V(e.text)}},Y=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},X=class e{options;renderer;textRenderer;constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new J,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Y}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Z=class{options;block;constructor(e){this.options=e||r}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?q.lex:q.lexInline}provideParser(){return this.block?X.parse:X.parseInline}},Q=new class{defaults=n();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=X;Renderer=J;TextRenderer=Y;Lexer=q;Tokenizer=K;Hooks=Z;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new J(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new K(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Z;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];Z.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&Z.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return q.lex(e,t??this.defaults)}parser(e,t){return X.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer():e?q.lex:q.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser():e?X.parse:X.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer():e?q.lex:q.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser():e?X.parse:X.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
59
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+V(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,i($.defaults),$},$.getDefaults=n,$.defaults=r,$.use=function(...e){return Q.use(...e),$.defaults=Q.defaults,i($.defaults),$},$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=X,$.parser=X.parse,$.Renderer=J,$.TextRenderer=Y,$.Lexer=q,$.lexer=q.lex,$.Tokenizer=K,$.Hooks=Z,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,X.parse,q.lex;export{t as n,$ as t};
@@ -1 +0,0 @@
1
- import{a as e,n as t,r as n,t as r}from"./jsx-runtime-BFALxl05.js";import{A as i,C as a,E as o,_ as s,a as c,b as l,c as u,d,f,g as p,h as m,i as h,k as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as ee,v as T,w as E,x as D,y as O}from"./input-CTnwfHVN.js";import{n as k,t as A}from"./api-client-BCjah751.js";import{t as j}from"./utils-B-_GCz7E.js";import{F as M,M as te,P as N,g as P,h as ne}from"./index-CaUQy3Zs.js";var F=t(`bell-off`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742`,key:`178tsu`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05`,key:`1hqiys`}]]),I=t(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),L=t(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),R=t(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),z=t(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),B=e(n(),1);function re(e){let t=B.useRef({value:e,previous:e});return B.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var V=r(),ie=`Label`,ae=B.forwardRef((e,t)=>(0,V.jsx)(E.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));ae.displayName=ie;var oe=ae,se=e(i(),1),ce=[` `,`Enter`,`ArrowUp`,`ArrowDown`],le=[` `,`Enter`],H=`Select`,[U,W,ue]=D(H),[G,de]=a(H,[ue,u]),K=u(),[fe,q]=G(H),[pe,me]=G(H),he=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:c,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:m,required:h,form:g}=e,_=K(t),[v,y]=B.useState(null),[b,x]=B.useState(null),[S,w]=B.useState(!1),ee=p(u),[E,D]=T({prop:r,defaultProp:i??!1,onChange:a,caller:H}),[O,k]=T({prop:o,defaultProp:c,onChange:l,caller:H}),A=B.useRef(null),j=v?g||!!v.closest(`form`):!0,[M,te]=B.useState(new Set),N=Array.from(M).map(e=>e.props.value).join(`;`);return(0,V.jsx)(C,{..._,children:(0,V.jsxs)(fe,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:w,contentId:s(),value:O,onValueChange:k,open:E,onOpenChange:D,dir:ee,triggerPointerDownPosRef:A,disabled:m,children:[(0,V.jsx)(U.Provider,{scope:t,children:(0,V.jsx)(pe,{scope:e.__scopeSelect,onNativeOptionAdd:B.useCallback(e=>{te(t=>new Set(t).add(e))},[]),onNativeOptionRemove:B.useCallback(e=>{te(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),j?(0,V.jsxs)(at,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:O,onChange:e=>k(e.target.value),disabled:m,form:g,children:[O===void 0?(0,V.jsx)(`option`,{value:``}):null,Array.from(M)]},N):null]})})};he.displayName=H;var ge=`SelectTrigger`,_e=B.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=K(n),o=q(ge,n),s=o.disabled||r,c=g(t,o.onTriggerChange),u=W(n),d=B.useRef(`touch`),[f,p,m]=st(e=>{let t=u().filter(e=>!e.disabled),n=ct(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),_=e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,V.jsx)(h,{asChild:!0,...a,children:(0,V.jsx)(E.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":ot(o.value)?``:void 0,...i,ref:c,onClick:l(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&_(e)}),onPointerDown:l(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:l(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&ce.includes(e.key)&&(_(),e.preventDefault())})})})});_e.displayName=ge;var ve=`SelectValue`,ye=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=q(ve,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=g(t,c.onValueNodeChange);return O(()=>{l(u)},[l,u]),(0,V.jsx)(E.span,{...s,ref:d,style:{pointerEvents:`none`},children:ot(c.value)?(0,V.jsx)(V.Fragment,{children:o}):a})});ye.displayName=ve;var be=`SelectIcon`,xe=B.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,V.jsx)(E.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});xe.displayName=be;var Se=`SelectPortal`,Ce=e=>(0,V.jsx)(f,{asChild:!0,...e});Ce.displayName=Se;var J=`SelectContent`,we=B.forwardRef((e,t)=>{let n=q(J,e.__scopeSelect),[r,i]=B.useState();if(O(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?se.createPortal((0,V.jsx)(Te,{scope:e.__scopeSelect,children:(0,V.jsx)(U.Slot,{scope:e.__scopeSelect,children:(0,V.jsx)(`div`,{children:e.children})})}),t):null}return(0,V.jsx)(Oe,{...e,ref:t})});we.displayName=J;var Y=10,[Te,X]=G(J),Ee=`SelectContentImpl`,De=o(`SelectContent.RemoveScroll`),Oe=B.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:y,hideWhenDetached:b,avoidCollisions:S,...C}=e,w=q(J,n),[T,E]=B.useState(null),[D,O]=B.useState(null),k=g(t,e=>E(e)),[A,j]=B.useState(null),[M,te]=B.useState(null),N=W(n),[P,ne]=B.useState(!1),F=B.useRef(!1);B.useEffect(()=>{if(T)return _(T)},[T]),d();let I=B.useCallback(e=>{let[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&D&&(D.scrollTop=0),n===r&&D&&(D.scrollTop=D.scrollHeight),n?.focus(),document.activeElement!==i))return},[N,D]),L=B.useCallback(()=>I([A,T]),[I,A,T]);B.useEffect(()=>{P&&L()},[P,L]);let{onOpenChange:R,triggerPointerDownPosRef:z}=w;B.useEffect(()=>{if(T){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():T.contains(n.target)||R(!1),document.removeEventListener(`pointermove`,t),z.current=null};return z.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[T,R,z]),B.useEffect(()=>{let e=()=>R(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[R]);let[re,ie]=st(e=>{let t=N().filter(e=>!e.disabled),n=ct(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ae=B.useCallback((e,t,n)=>{let r=!F.current&&!n;(w.value!==void 0&&w.value===t||r)&&(j(e),r&&(F.current=!0))},[w.value]),oe=B.useCallback(()=>T?.focus(),[T]),se=B.useCallback((e,t,n)=>{let r=!F.current&&!n;(w.value!==void 0&&w.value===t||r)&&te(e)},[w.value]),ce=r===`popper`?Me:Ae,le=ce===Me?{side:s,sideOffset:c,align:u,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:y,hideWhenDetached:b,avoidCollisions:S}:{};return(0,V.jsx)(Te,{scope:n,content:T,viewport:D,onViewportChange:O,itemRefCallback:ae,selectedItem:A,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:L,selectedItemText:M,position:r,isPositioned:P,searchRef:re,children:(0,V.jsx)(ee,{as:De,allowPinchZoom:!0,children:(0,V.jsx)(x,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:l(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,V.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,V.jsx)(ce,{role:`listbox`,id:w.contentId,"data-state":w.open?`open`:`closed`,dir:w.dir,onContextMenu:e=>e.preventDefault(),...C,...le,onPlaced:()=>ne(!0),ref:k,style:{display:`flex`,flexDirection:`column`,outline:`none`,...C.style},onKeyDown:l(C.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>I(t)),e.preventDefault()}})})})})})})});Oe.displayName=Ee;var ke=`SelectItemAlignedPosition`,Ae=B.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=q(J,n),o=X(J,n),[s,c]=B.useState(null),[l,u]=B.useState(null),d=g(t,e=>u(e)),f=W(n),p=B.useRef(!1),m=B.useRef(!0),{viewport:h,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,b=B.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&_&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Y,d=S(a,[Y,Math.max(Y,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Y,d=S(a,[Y,Math.max(Y,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Y*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),g=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+g+u+b+y,C=Math.min(_.offsetHeight*5,x),w=window.getComputedStyle(h),ee=parseInt(w.paddingTop,10),T=parseInt(w.paddingBottom,10),E=e.top+e.height/2-Y,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=m+g+k,j=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?ee:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Y}px 0`,s.style.minHeight=C+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,_,v,a.dir,r]);O(()=>b(),[b]);let[x,C]=B.useState();return O(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]),(0,V.jsx)(Ne,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:B.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]),children:(0,V.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,V.jsx)(E.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});Ae.displayName=ke;var je=`SelectPopperPosition`,Me=B.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=K(n);return(0,V.jsx)(b,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});Me.displayName=je;var[Ne,Pe]=G(J,{}),Fe=`SelectViewport`,Ie=B.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=X(Fe,n),o=Pe(Fe,n),s=g(t,a.onViewportChange),c=B.useRef(0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,V.jsx)(U.Slot,{scope:n,children:(0,V.jsx)(E.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:l(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});Ie.displayName=Fe;var Le=`SelectGroup`,[Re,ze]=G(Le),Be=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=s();return(0,V.jsx)(Re,{scope:n,id:i,children:(0,V.jsx)(E.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});Be.displayName=Le;var Ve=`SelectLabel`,He=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=ze(Ve,n);return(0,V.jsx)(E.div,{id:i.id,...r,ref:t})});He.displayName=Ve;var Z=`SelectItem`,[Ue,We]=G(Z),Ge=B.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,c=q(Z,n),u=X(Z,n),d=c.value===r,[f,p]=B.useState(a??``),[m,h]=B.useState(!1),_=g(t,e=>u.itemRefCallback?.(e,r,i)),v=s(),y=B.useRef(`touch`),b=()=>{i||(c.onValueChange(r),c.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,V.jsx)(Ue,{scope:n,value:r,disabled:i,textId:v,isSelected:d,onItemTextChange:B.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,V.jsx)(U.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,V.jsx)(E.div,{role:`option`,"aria-labelledby":v,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:_,onFocus:l(o.onFocus,()=>h(!0)),onBlur:l(o.onBlur,()=>h(!1)),onClick:l(o.onClick,()=>{y.current!==`mouse`&&b()}),onPointerUp:l(o.onPointerUp,()=>{y.current===`mouse`&&b()}),onPointerDown:l(o.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:l(o.onPointerMove,e=>{y.current=e.pointerType,i?u.onItemLeave?.():y.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:l(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:l(o.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(le.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});Ge.displayName=Z;var Q=`SelectItemText`,Ke=B.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=q(Q,n),s=X(Q,n),c=We(Q,n),l=me(Q,n),[u,d]=B.useState(null),f=g(t,e=>d(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=u?.textContent,m=B.useMemo(()=>(0,V.jsx)(`option`,{value:c.value,disabled:c.disabled,children:p},c.value),[c.disabled,c.value,p]),{onNativeOptionAdd:h,onNativeOptionRemove:_}=l;return O(()=>(h(m),()=>_(m)),[h,_,m]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(E.span,{id:c.textId,...a,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?se.createPortal(a.children,o.valueNode):null]})});Ke.displayName=Q;var qe=`SelectItemIndicator`,Je=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return We(qe,n).isSelected?(0,V.jsx)(E.span,{"aria-hidden":!0,...r,ref:t}):null});Je.displayName=qe;var Ye=`SelectScrollUpButton`,Xe=B.forwardRef((e,t)=>{let n=X(Ye,e.__scopeSelect),r=Pe(Ye,e.__scopeSelect),[i,a]=B.useState(!1),o=g(t,r.onScrollButtonChange);return O(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)($e,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Xe.displayName=Ye;var Ze=`SelectScrollDownButton`,Qe=B.forwardRef((e,t)=>{let n=X(Ze,e.__scopeSelect),r=Pe(Ze,e.__scopeSelect),[i,a]=B.useState(!1),o=g(t,r.onScrollButtonChange);return O(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,V.jsx)($e,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Qe.displayName=Ze;var $e=B.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=X(`SelectScrollButton`,n),o=B.useRef(null),s=W(n),c=B.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return B.useEffect(()=>()=>c(),[c]),O(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,V.jsx)(E.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:l(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:l(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:l(i.onPointerLeave,()=>{c()})})}),et=`SelectSeparator`,tt=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,V.jsx)(E.div,{"aria-hidden":!0,...r,ref:t})});tt.displayName=et;var nt=`SelectArrow`,rt=B.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=K(n),a=q(nt,n),o=X(nt,n);return a.open&&o.position===`popper`?(0,V.jsx)(c,{...i,...r,ref:t}):null});rt.displayName=nt;var it=`SelectBubbleInput`,at=B.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=B.useRef(null),a=g(r,i),o=re(t);return B.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,V.jsx)(E.select,{...n,style:{...ne,...n.style},ref:a,defaultValue:t})});at.displayName=it;function ot(e){return e===``||e===void 0}function st(e){let t=m(e),n=B.useRef(``),r=B.useRef(0),i=B.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=B.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return B.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function ct(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=lt(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function lt(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var ut=he,dt=_e,ft=ye,pt=xe,mt=Ce,ht=we,gt=Ie,_t=Ge,vt=Ke,yt=Je,bt=Xe,xt=Qe,St=`Separator`,Ct=`horizontal`,wt=[`horizontal`,`vertical`],Tt=B.forwardRef((e,t)=>{let{decorative:n,orientation:r=Ct,...i}=e,a=Et(r)?r:Ct,o=a===`vertical`?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,V.jsx)(E.div,{"data-orientation":a,...s,...i,ref:t})});Tt.displayName=St;function Et(e){return wt.includes(e)}var Dt=Tt;function Ot({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,V.jsx)(Dt,{"data-slot":`separator`,decorative:n,orientation:t,className:j(`shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function $({className:e,...t}){return(0,V.jsx)(oe,{"data-slot":`label`,className:j(`flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function kt({...e}){return(0,V.jsx)(ut,{"data-slot":`select`,...e})}function At({...e}){return(0,V.jsx)(ft,{"data-slot":`select-value`,...e})}function jt({className:e,size:t=`default`,children:n,...r}){return(0,V.jsxs)(dt,{"data-slot":`select-trigger`,"data-size":t,className:j(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...r,children:[n,(0,V.jsx)(pt,{asChild:!0,children:(0,V.jsx)(N,{className:`size-4 opacity-50`})})]})}function Mt({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,V.jsx)(mt,{children:(0,V.jsxs)(ht,{"data-slot":`select-content`,className:j(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,...i,children:[(0,V.jsx)(Pt,{}),(0,V.jsx)(gt,{className:j(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,V.jsx)(Ft,{})]})})}function Nt({className:e,children:t,...n}){return(0,V.jsxs)(_t,{"data-slot":`select-item`,className:j(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,V.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,V.jsx)(yt,{children:(0,V.jsx)(M,{className:`size-4`})})}),(0,V.jsx)(vt,{children:t})]})}function Pt({className:e,...t}){return(0,V.jsx)(bt,{"data-slot":`select-scroll-up-button`,className:j(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,V.jsx)(te,{className:`size-4`})})}function Ft({className:e,...t}){return(0,V.jsx)(xt,{"data-slot":`select-scroll-down-button`,className:j(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,V.jsx)(N,{className:`size-4`})})}function It(){return A.get(`/api/settings/ai`)}function Lt(e){return A.put(`/api/settings/ai`,e)}var Rt=[{value:`claude-sonnet-4-6`,label:`Claude Sonnet 4.6`},{value:`claude-opus-4-6`,label:`Claude Opus 4.6`},{value:`claude-haiku-4-5`,label:`Claude Haiku 4.5`}],zt=[{value:`low`,label:`Low`},{value:`medium`,label:`Medium`},{value:`high`,label:`High`},{value:`max`,label:`Max`}];function Bt(){let[e,t]=(0,B.useState)(null),[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(0);(0,B.useEffect)(()=>{It().then(t).catch(e=>a(e.message))},[]);let c=e?.default_provider??`claude`,l=e?.providers[c],u=async(n,i)=>{if(e){r(!0),a(null);try{t(await Lt({providers:{[c]:{[n]:i}}})),s(e=>e+1)}catch(e){a(e.message)}finally{r(!1)}}};return e?(0,V.jsxs)(`div`,{className:`space-y-4`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`AI Provider`}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-model`,children:`Model`}),(0,V.jsxs)(kt,{value:l?.model??`claude-sonnet-4-6`,onValueChange:e=>u(`model`,e),children:[(0,V.jsx)(jt,{id:`ai-model`,className:`w-full`,children:(0,V.jsx)(At,{})}),(0,V.jsx)(Mt,{children:Rt.map(e=>(0,V.jsx)(Nt,{value:e.value,children:e.label},e.value))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-effort`,children:`Effort`}),(0,V.jsxs)(kt,{value:l?.effort??`high`,onValueChange:e=>u(`effort`,e),children:[(0,V.jsx)(jt,{id:`ai-effort`,className:`w-full`,children:(0,V.jsx)(At,{})}),(0,V.jsx)(Mt,{children:zt.map(e=>(0,V.jsx)(Nt,{value:e.value,children:e.label},e.value))})]})]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-max-turns`,children:`Max Turns (1-500)`}),(0,V.jsx)(w,{id:`ai-max-turns`,type:`number`,min:1,max:500,defaultValue:l?.max_turns??100,onBlur:e=>{let t=parseInt(e.target.value);isNaN(t)||u(`max_turns`,t)}},`turns-${o}`)]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-budget`,children:`Max Budget (USD)`}),(0,V.jsx)(w,{id:`ai-budget`,type:`number`,step:.1,min:.01,max:50,defaultValue:l?.max_budget_usd??``,placeholder:`No limit`,onBlur:e=>{let t=parseFloat(e.target.value);u(`max_budget_usd`,isNaN(t)?void 0:t)}},`budget-${o}`)]}),(0,V.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,V.jsx)($,{htmlFor:`ai-thinking`,children:`Thinking Budget (tokens)`}),(0,V.jsx)(w,{id:`ai-thinking`,type:`number`,min:0,defaultValue:l?.thinking_budget_tokens??``,placeholder:`Disabled`,onBlur:e=>{let t=parseInt(e.target.value);u(`thinking_budget_tokens`,isNaN(t)?void 0:t)}},`thinking-${o}`)]})]}),n&&(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`Saving...`}),i&&(0,V.jsx)(`p`,{className:`text-xs text-red-500`,children:i})]}):(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`AI Provider`}),(0,V.jsx)(`p`,{className:`text-sm text-text-subtle`,children:i?`Error: ${i}`:`Loading...`})]})}function Vt(e){let t=(e+`=`.repeat((4-e.length%4)%4)).replace(/-/g,`+`).replace(/_/g,`/`),n=atob(t);return Uint8Array.from(n,e=>e.charCodeAt(0))}function Ht(){let[e,t]=(0,B.useState)(`default`),[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{`Notification`in window&&t(Notification.permission),r(localStorage.getItem(`ppm-push-subscribed`)===`true`)},[]),{permission:e,isSubscribed:n,loading:i,subscribe:(0,B.useCallback)(async()=>{a(!0);try{let e=await Notification.requestPermission();if(t(e),e!==`granted`)return;let n={},i=k();i&&(n.Authorization=`Bearer ${i}`);let a=await(await fetch(`/api/push/vapid-key`,{headers:n})).json();if(!a.ok)throw Error(a.error||`Failed to get VAPID key`);let o=await(await navigator.serviceWorker.ready).pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Vt(a.data.publicKey).buffer});await fetch(`/api/push/subscribe`,{method:`POST`,headers:{...n,"Content-Type":`application/json`},body:JSON.stringify(o.toJSON())}),r(!0),localStorage.setItem(`ppm-push-subscribed`,`true`)}catch(e){console.error(`[push] Subscribe failed:`,e)}finally{a(!1)}},[]),unsubscribe:(0,B.useCallback)(async()=>{a(!0);try{let e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();if(e){let t={"Content-Type":`application/json`},n=k();n&&(t.Authorization=`Bearer ${n}`),await fetch(`/api/push/subscribe`,{method:`DELETE`,headers:t,body:JSON.stringify({endpoint:e.endpoint})}),await e.unsubscribe()}r(!1),localStorage.removeItem(`ppm-push-subscribed`)}catch(e){console.error(`[push] Unsubscribe failed:`,e)}finally{a(!1)}},[])}}var Ut=[{value:`light`,label:`Light`,icon:z},{value:`dark`,label:`Dark`,icon:R},{value:`system`,label:`System`,icon:L}],Wt=`PushManager`in window&&`serviceWorker`in navigator,Gt=/iPhone|iPad/.test(navigator.userAgent)&&!window.matchMedia(`(display-mode: standalone)`).matches;function Kt(){let{theme:e,setTheme:t}=P(),{permission:n,isSubscribed:r,loading:i,subscribe:a,unsubscribe:o}=Ht();return(0,V.jsxs)(`div`,{className:`h-full p-4 space-y-6 overflow-auto max-w-lg`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Settings`}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`Theme`}),(0,V.jsx)(`div`,{className:`flex gap-2`,children:Ut.map(n=>{let r=n.icon;return(0,V.jsxs)(y,{variant:e===n.value?`default`:`outline`,size:`lg`,onClick:()=>t(n.value),className:j(`flex-1 gap-2`,e===n.value&&`ring-2 ring-primary`),children:[(0,V.jsx)(r,{className:`size-4`}),n.label]},n.value)})})]}),(0,V.jsx)(Ot,{}),(0,V.jsx)(Bt,{}),(0,V.jsx)(Ot,{}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`Notifications`}),Wt?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r?(0,V.jsx)(I,{className:`size-4`}):(0,V.jsx)(F,{className:`size-4`}),(0,V.jsx)(`span`,{className:`text-sm`,children:`Push notifications`})]}),(0,V.jsx)(y,{variant:r?`default`:`outline`,size:`sm`,disabled:i||n===`denied`,onClick:()=>r?o():a(),children:i?`...`:r?`On`:`Off`})]}),n===`denied`&&(0,V.jsx)(`p`,{className:`text-xs text-destructive`,children:`Notifications blocked. Enable in browser settings.`}),Gt&&(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`On iOS, install PPM to Home Screen for push notifications.`})]}):(0,V.jsx)(`p`,{className:`text-sm text-text-subtle`,children:`Push notifications are not supported in this browser.`})]}),(0,V.jsx)(Ot,{}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium text-text-secondary`,children:`About`}),(0,V.jsx)(`p`,{className:`text-sm text-text-secondary`,children:`PPM — Personal Project Manager`}),(0,V.jsx)(`p`,{className:`text-xs text-text-subtle`,children:`A mobile-first web IDE for managing your projects.`})]})]})}export{Kt as SettingsTab};
@@ -1,11 +0,0 @@
1
- import{a as e,n as t,r as n}from"./jsx-runtime-BFALxl05.js";import{g as r}from"./index-CaUQy3Zs.js";var i=t(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]);function a(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){if(Array.isArray(e))return e}function s(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function l(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?u(Object(n),!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function f(e,t){if(e==null)return{};var n,r,i=p(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function p(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function m(e,t){return o(e)||c(e,t)||_(e,t)||l()}function h(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function g(e){var t=h(e,`string`);return typeof t==`symbol`?t:t+``}function _(e,t){if(e){if(typeof e==`string`)return a(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?y(Object(n),!0).forEach(function(t){v(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}}function S(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function C(e){return{}.toString.call(e).includes(`Object`)}function w(e){return!Object.keys(e).length}function T(e){return typeof e==`function`}function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function D(e,t){return C(t)||M(`changeType`),Object.keys(t).some(function(t){return!E(e,t)})&&M(`changeField`),t}function O(e){T(e)||M(`selectorType`)}function k(e){T(e)||C(e)||M(`handlerType`),C(e)&&Object.values(e).some(function(e){return!T(e)})&&M(`handlersType`)}function A(e){e||M(`initialIsRequired`),C(e)||M(`initialType`),w(e)&&M(`initialContent`)}function j(e,t){throw Error(e[t]||e.default)}var M=S(j)({initialIsRequired:`initial state is required`,initialType:`initial state should be an object`,initialContent:`initial state shouldn't be an empty object`,handlerType:`handler should be an object or a function`,handlersType:`all handlers should be a functions`,selectorType:`selector should be a function`,changeType:`provided value of changes should be an object`,changeField:`it seams you want to change a field in the state which is not specified in the "initial" state`,default:"an unknown error accured in `state-local` package"}),N={changes:D,selector:O,handler:k,initial:A};function P(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};N.initial(e),N.handler(t);var n={current:e},r=S(ee)(n,t),i=S(I)(n),a=S(N.changes)(e),o=S(F)(n);function s(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(e){return e};return N.selector(e),e(n.current)}function c(e){x(r,i,a,o)(e)}return[s,c]}function F(e,t){return T(t)?t(e.current):t}function I(e,t){return e.current=b(b({},e.current),t),t}function ee(e,t,n){return T(t)?t(e.current):Object.keys(n).forEach(function(n){return t[n]?.call(t,e.current[n])}),n}var te={create:P},ne={paths:{vs:`https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs`}};function re(e){return function t(){var n=this,r=[...arguments];return r.length>=e.length?e.apply(this,r):function(){var e=[...arguments];return t.apply(n,[].concat(r,e))}}}function ie(e){return{}.toString.call(e).includes(`Object`)}function ae(e){return e||ce(`configIsRequired`),ie(e)||ce(`configType`),e.urls?(oe(),{paths:{vs:e.urls.monacoBase}}):e}function oe(){console.warn(L.deprecation)}function se(e,t){throw Error(e[t]||e.default)}var L={configIsRequired:`the configuration object is required`,configType:`the configuration object should be an object`,default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
3
- You are using deprecated way of configuration.
4
-
5
- Instead of using
6
- monaco.config({ urls: { monacoBase: '...' } })
7
- use
8
- monaco.config({ paths: { vs: '...' } })
9
-
10
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
11
- `},ce=re(se)(L),le={config:ae},ue=function(){var e=[...arguments];return function(t){return e.reduceRight(function(e,t){return t(e)},t)}};function R(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],R(e[n],t[n]))}),d(d({},e),t)}var de={type:`cancelation`,msg:`operation is manually canceled`};function z(e){var t=!1,n=new Promise(function(n,r){e.then(function(e){return t?r(de):n(e)}),e.catch(r)});return n.cancel=function(){return t=!0},n}var fe=[`monaco`],B=m(te.create({config:ne,isInitialized:!1,resolve:null,reject:null,monaco:null}),2),V=B[0],H=B[1];function pe(e){var t=le.config(e),n=t.monaco,r=f(t,fe);H(function(e){return{config:R(e.config,r),monaco:n}})}function me(){var e=V(function(e){return{monaco:e.monaco,isInitialized:e.isInitialized,resolve:e.resolve}});if(!e.isInitialized){if(H({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),z(W);if(window.monaco&&window.monaco.editor)return U(window.monaco),e.resolve(window.monaco),z(W);ue(he,_e)(ve)}return z(W)}function he(e){return document.body.appendChild(e)}function ge(e){var t=document.createElement(`script`);return e&&(t.src=e),t}function _e(e){var t=V(function(e){return{config:e.config,reject:e.reject}}),n=ge(`${t.config.paths.vs}/loader.js`);return n.onload=function(){return e()},n.onerror=t.reject,n}function ve(){var e=V(function(e){return{config:e.config,resolve:e.resolve,reject:e.reject}}),t=window.require;t.config(e.config),t([`vs/editor/editor.main`],function(t){var n=t.m||t;U(n),e.resolve(n)},function(t){e.reject(t)})}function U(e){V().monaco||H({monaco:e})}function ye(){return V(function(e){return e.monaco})}var W=new Promise(function(e,t){return H({resolve:e,reject:t})}),G={config:pe,init:me,__getMonacoInstance:ye},K=e(n(),1),q={wrapper:{display:`flex`,position:`relative`,textAlign:`initial`},fullWidth:{width:`100%`},hide:{display:`none`}},be={container:{display:`flex`,height:`100%`,width:`100%`,justifyContent:`center`,alignItems:`center`}};function xe({children:e}){return K.createElement(`div`,{style:be.container},e)}var Se=xe;function Ce({width:e,height:t,isEditorReady:n,loading:r,_ref:i,className:a,wrapperProps:o}){return K.createElement(`section`,{style:{...q.wrapper,width:e,height:t},...o},!n&&K.createElement(Se,null,r),K.createElement(`div`,{ref:i,style:{...q.fullWidth,...!n&&q.hide},className:a}))}var J=(0,K.memo)(Ce);function we(e){(0,K.useEffect)(e,[])}var Te=we;function Ee(e,t,n=!0){let r=(0,K.useRef)(!0);(0,K.useEffect)(r.current||!n?()=>{r.current=!1}:e,t)}var Y=Ee;function X(){}function Z(e,t,n,r){return De(e,r)||Oe(e,t,n,r)}function De(e,t){return e.editor.getModel(Q(e,t))}function Oe(e,t,n,r){return e.editor.createModel(t,n,r?Q(e,r):void 0)}function Q(e,t){return e.Uri.parse(t)}function ke({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:i,originalModelPath:a,modifiedModelPath:o,keepCurrentOriginalModel:s=!1,keepCurrentModifiedModel:c=!1,theme:l=`light`,loading:u=`Loading...`,options:d={},height:f=`100%`,width:p=`100%`,className:m,wrapperProps:h={},beforeMount:g=X,onMount:_=X}){let[v,y]=(0,K.useState)(!1),[b,x]=(0,K.useState)(!0),S=(0,K.useRef)(null),C=(0,K.useRef)(null),w=(0,K.useRef)(null),T=(0,K.useRef)(_),E=(0,K.useRef)(g),D=(0,K.useRef)(!1);Te(()=>{let e=G.init();return e.then(e=>(C.current=e)&&x(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>S.current?A():e.cancel()}),Y(()=>{if(S.current&&C.current){let t=S.current.getOriginalEditor(),i=Z(C.current,e||``,r||n||`text`,a||``);i!==t.getModel()&&t.setModel(i)}},[a],v),Y(()=>{if(S.current&&C.current){let e=S.current.getModifiedEditor(),r=Z(C.current,t||``,i||n||`text`,o||``);r!==e.getModel()&&e.setModel(r)}},[o],v),Y(()=>{let e=S.current.getModifiedEditor();e.getOption(C.current.editor.EditorOption.readOnly)?e.setValue(t||``):t!==e.getValue()&&(e.executeEdits(``,[{range:e.getModel().getFullModelRange(),text:t||``,forceMoveMarkers:!0}]),e.pushUndoStop())},[t],v),Y(()=>{S.current?.getModel()?.original.setValue(e||``)},[e],v),Y(()=>{let{original:e,modified:t}=S.current.getModel();C.current.editor.setModelLanguage(e,r||n||`text`),C.current.editor.setModelLanguage(t,i||n||`text`)},[n,r,i],v),Y(()=>{C.current?.editor.setTheme(l)},[l],v),Y(()=>{S.current?.updateOptions(d)},[d],v);let O=(0,K.useCallback)(()=>{if(!C.current)return;E.current(C.current);let s=Z(C.current,e||``,r||n||`text`,a||``),c=Z(C.current,t||``,i||n||`text`,o||``);S.current?.setModel({original:s,modified:c})},[n,t,i,e,r,a,o]),k=(0,K.useCallback)(()=>{!D.current&&w.current&&(S.current=C.current.editor.createDiffEditor(w.current,{automaticLayout:!0,...d}),O(),C.current?.editor.setTheme(l),y(!0),D.current=!0)},[d,l,O]);(0,K.useEffect)(()=>{v&&T.current(S.current,C.current)},[v]),(0,K.useEffect)(()=>{!b&&!v&&k()},[b,v,k]);function A(){let e=S.current?.getModel();s||e?.original?.dispose(),c||e?.modified?.dispose(),S.current?.dispose()}return K.createElement(J,{width:p,height:f,isEditorReady:v,loading:u,_ref:w,className:m,wrapperProps:h})}var Ae=(0,K.memo)(ke);function je(e){let t=(0,K.useRef)();return(0,K.useEffect)(()=>{t.current=e},[e]),t.current}var Me=je,$=new Map;function Ne({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:i,path:a,theme:o=`light`,line:s,loading:c=`Loading...`,options:l={},overrideServices:u={},saveViewState:d=!0,keepCurrentModel:f=!1,width:p=`100%`,height:m=`100%`,className:h,wrapperProps:g={},beforeMount:_=X,onMount:v=X,onChange:y,onValidate:b=X}){let[x,S]=(0,K.useState)(!1),[C,w]=(0,K.useState)(!0),T=(0,K.useRef)(null),E=(0,K.useRef)(null),D=(0,K.useRef)(null),O=(0,K.useRef)(v),k=(0,K.useRef)(_),A=(0,K.useRef)(),j=(0,K.useRef)(r),M=Me(a),N=(0,K.useRef)(!1),P=(0,K.useRef)(!1);Te(()=>{let e=G.init();return e.then(e=>(T.current=e)&&w(!1)).catch(e=>e?.type!==`cancelation`&&console.error(`Monaco initialization: error:`,e)),()=>E.current?I():e.cancel()}),Y(()=>{let o=Z(T.current,e||r||``,t||i||``,a||n||``);o!==E.current?.getModel()&&(d&&$.set(M,E.current?.saveViewState()),E.current?.setModel(o),d&&E.current?.restoreViewState($.get(a)))},[a],x),Y(()=>{E.current?.updateOptions(l)},[l],x),Y(()=>{!E.current||r===void 0||(E.current.getOption(T.current.editor.EditorOption.readOnly)?E.current.setValue(r):r!==E.current.getValue()&&(P.current=!0,E.current.executeEdits(``,[{range:E.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),E.current.pushUndoStop(),P.current=!1))},[r],x),Y(()=>{let e=E.current?.getModel();e&&i&&T.current?.editor.setModelLanguage(e,i)},[i],x),Y(()=>{s!==void 0&&E.current?.revealLine(s)},[s],x),Y(()=>{T.current?.editor.setTheme(o)},[o],x);let F=(0,K.useCallback)(()=>{if(!(!D.current||!T.current)&&!N.current){k.current(T.current);let c=a||n,f=Z(T.current,r||e||``,t||i||``,c||``);E.current=T.current?.editor.create(D.current,{model:f,automaticLayout:!0,...l},u),d&&E.current.restoreViewState($.get(c)),T.current.editor.setTheme(o),s!==void 0&&E.current.revealLine(s),S(!0),N.current=!0}},[e,t,n,r,i,a,l,u,d,o,s]);(0,K.useEffect)(()=>{x&&O.current(E.current,T.current)},[x]),(0,K.useEffect)(()=>{!C&&!x&&F()},[C,x,F]),j.current=r,(0,K.useEffect)(()=>{x&&y&&(A.current?.dispose(),A.current=E.current?.onDidChangeModelContent(e=>{P.current||y(E.current.getValue(),e)}))},[x,y]),(0,K.useEffect)(()=>{if(x){let e=T.current.editor.onDidChangeMarkers(e=>{let t=E.current.getModel()?.uri;if(t&&e.find(e=>e.path===t.path)){let e=T.current.editor.getModelMarkers({resource:t});b?.(e)}});return()=>{e?.dispose()}}return()=>{}},[x,b]);function I(){A.current?.dispose(),f?d&&$.set(a,E.current.saveViewState()):E.current.getModel()?.dispose(),E.current.dispose()}return K.createElement(J,{width:p,height:m,isEditorReady:x,loading:c,_ref:D,className:h,wrapperProps:g})}var Pe=(0,K.memo)(Ne);function Fe(){let e=r(e=>e.theme),t=()=>e===`dark`?`vs-dark`:e===`light`?`light`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`vs-dark`:`light`,[n,i]=(0,K.useState)(t);return(0,K.useEffect)(()=>{if(i(t()),e===`system`){let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>i(e.matches?`vs-dark`:`light`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)}},[e]),n}export{i,Pe as n,Ae as r,Fe as t};