explicai 0.2.0 → 0.2.1
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.
|
@@ -46,7 +46,7 @@ Error generating stack: `+e.message+`
|
|
|
46
46
|
`},ki=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ai=function(){_.useEffect(function(){return document.body.setAttribute(Di,(ki()+1).toString()),function(){var e=ki()-1;e<=0?document.body.removeAttribute(Di):document.body.setAttribute(Di,e.toString())}},[])},ji=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ai();var a=_.useMemo(function(){return Ti(i)},[i]);return _.createElement(Ei,{styles:Oi(a,!t,i,n?``:`!important`)})},Mi=!1;if(typeof window<`u`)try{var Ni=Object.defineProperty({},"passive",{get:function(){return Mi=!0,!0}});window.addEventListener(`test`,Ni,Ni),window.removeEventListener(`test`,Ni,Ni)}catch{Mi=!1}var Pi=Mi?{passive:!1}:!1,Fi=function(e){return e.tagName===`TEXTAREA`},Ii=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Fi(e)&&n[t]===`visible`)},Li=function(e){return Ii(e,`overflowY`)},Ri=function(e){return Ii(e,`overflowX`)},zi=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Hi(e,r)){var i=Ui(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Bi=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Vi=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Hi=function(e,t){return e===`v`?Li(t):Ri(t)},Ui=function(e,t){return e===`v`?Bi(t):Vi(t)},Wi=function(e,t){return e===`h`&&t===`rtl`?-1:1},Gi=function(e,t,n,r,i){var a=Wi(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=Ui(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Hi(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},Ki=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qi=function(e){return[e.deltaX,e.deltaY]},Ji=function(e){return e&&`current`in e?e.current:e},Yi=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Xi=function(e){return`
|
|
47
47
|
.block-interactivity-${e} {pointer-events: none;}
|
|
48
48
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
49
|
-
`},Zi=0,Qi=[];function $i(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Zi++)[0],a=_.useState(xi)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Zr([e.lockRef.current],(e.shards||[]).map(Ji),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ki(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=zi(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=zi(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 Gi(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(Qi.length&&Qi[Qi.length-1]===a){var r=`deltaY`in n?qi(n):Ki(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Yi(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Ji).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ea(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Ki(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,qi(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Ki(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Qi.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Pi),document.addEventListener(`touchmove`,c,Pi),document.addEventListener(`touchstart`,u,Pi),function(){Qi=Qi.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Pi),document.removeEventListener(`touchmove`,c,Pi),document.removeEventListener(`touchstart`,u,Pi)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Xi(i)}):null,p?_.createElement(ji,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ea(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ta=di(fi,$i),na=_.forwardRef(function(e,t){return _.createElement(mi,Yr({},e,{ref:t,sideCar:ta}))});na.classNames=mi.classNames;var ra=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ia=new WeakMap,B=new WeakMap,aa={},oa=0,sa=function(e){return e&&(e.host||sa(e.parentNode))},ca=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=sa(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})},la=function(e,t,n,r){var i=ca(t,Array.isArray(e)?e:[e]);aa[n]||(aa[n]=new WeakMap);var a=aa[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=(ia.get(e)||0)+1,l=(a.get(e)||0)+1;ia.set(e,c),a.set(e,l),o.push(e),c===1&&i&&B.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(),oa++,function(){o.forEach(function(e){var t=ia.get(e)-1,i=a.get(e)-1;ia.set(e,t),a.set(e,i),t||(B.has(e)||e.removeAttribute(r),B.delete(e)),i||e.removeAttribute(n)}),oa--,oa||(ia=new WeakMap,ia=new WeakMap,B=new WeakMap,aa={})}},ua=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ra(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),la(r,i,n,`aria-hidden`)):function(){return null}},da=Object.defineProperty,fa=(e,t)=>da(e,`name`,{value:t,configurable:!0}),pa=`Dialog`,[ma,ha]=Qt(pa),[ga,_a]=ma(pa),va=fa(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),{nodes:l,registry:u}=Dr(),[d,f]=jn({prop:r,defaultProp:i??!1,onChange:a,caller:pa}),[p,m]=_.useState(0),[h,g]=_.useState(0);return(0,R.jsx)(ga,{scope:t,triggerRef:s,contentRef:c,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),ya=`DialogTrigger`,ba=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(ya,n),a=yt(t,i.triggerRef);return(0,R.jsx)(Ut.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":za(i.open),...r,ref:a,onClick:z(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),xa=`DialogPortal`,[Sa,Ca]=ma(xa,{forceMount:void 0}),wa=fa(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=_a(xa,t);return(0,R.jsx)(Sa,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,R.jsx)(zn,{present:n||a.open,children:(0,R.jsx)(Vr,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Ta=`DialogOverlay`,Ea=_.forwardRef(fa(function(e,t){let n=Ca(Ta,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=_a(Ta,e.__scopeDialog);return a.modal?(0,R.jsx)(zn,{present:r||a.open,children:(0,R.jsx)(Oa,{...i,ref:t})}):null},`DialogOverlay`)),Da=St(`DialogOverlay.RemoveScroll`),Oa=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(Ta,n),a=yt(t,pr());return(0,R.jsx)(na,{as:Da,allowPinchZoom:!0,shards:_.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,R.jsx)(Ut.div,{"data-state":za(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ka=`DialogContent`,Aa=_.forwardRef(fa(function(e,t){let n=Ca(ka,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=_a(ka,e.__scopeDialog);return(0,R.jsx)(zn,{present:r||a.open,children:a.modal?(0,R.jsx)(ja,{...i,ref:t}):(0,R.jsx)(Ma,{...i,ref:t})})},`DialogContent`)),ja=_.forwardRef(fa(function(e,t){let n=_a(ka,e.__scopeDialog),r=_.useRef(null),i=yt(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return ua(e)},[]),(0,R.jsx)(Na,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ma=_.forwardRef(fa(function(e,t){let n=_a(ka,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,R.jsx)(Na,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Na=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=_a(ka,n);return qr(),(0,R.jsx)(Er,{registry:l.branchRegistry,children:(0,R.jsx)(wr,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(fr,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Ra(o,l.descriptionId):o,"data-state":za(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Pa=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(`DialogTitle`,n),{setTitleCount:a}=i;return en(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Ut.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Fa=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(`DialogDescription`,n),{setDescriptionCount:a}=i;return en(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Ut.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Ia=`DialogClose`,La=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(Ia,n);return(0,R.jsx)(Ut.button,{type:`button`,...r,ref:t,onClick:z(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Ra(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}fa(Ra,`concatAriaDescribedby`);function za(e){return e?`open`:`closed`}fa(za,`getState`);var Ba=Object.defineProperty,Va=(e,t)=>Ba(e,`name`,{value:t,configurable:!0});function Ha(e){let[t,n]=_.useState(void 0);return en(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Va(Ha,`useSize`);var Ua=[`top`,`right`,`bottom`,`left`],Wa=[`start`,`end`],Ga=Ua.reduce((e,t)=>e.concat(t,t+`-`+Wa[0],t+`-`+Wa[1]),[]),Ka=Math.min,qa=Math.max,Ja=Math.round,Ya=Math.floor,Xa=e=>({x:e,y:e}),Za={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Qa(e,t,n){return qa(e,Ka(t,n))}function $a(e,t){return typeof e==`function`?e(t):e}function eo(e){return e.split(`-`)[0]}function to(e){return e.split(`-`)[1]}function no(e){return e===`x`?`y`:`x`}function ro(e){return e===`y`?`height`:`width`}function io(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ao(e){return no(io(e))}function oo(e,t,n){n===void 0&&(n=!1);let r=to(e),i=ao(e),a=ro(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=go(o)),[o,go(o)]}function so(e){let t=go(e);return[co(e),t,co(t)]}function co(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var lo=[`left`,`right`],uo=[`right`,`left`],fo=[`top`,`bottom`],po=[`bottom`,`top`];function mo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?uo:lo:t?lo:uo;case`left`:case`right`:return t?fo:po;default:return[]}}function ho(e,t,n,r){let i=to(e),a=mo(eo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(co)))),a}function go(e){let t=eo(e);return Za[t]+e.slice(t.length)}function _o(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function vo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_o(e)}function yo(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 bo(e,t,n){let{reference:r,floating:i}=e,a=io(t),o=ao(t),s=ro(o),c=eo(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}}let m=to(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function xo(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}=$a(t,e),p=vo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=yo(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=yo(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 So=50,Co=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bo(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<So&&(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}=bo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},wo=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}=$a(e,t)||{};if(l==null)return{};let d=vo(u),f={x:n,y:r},p=ao(i),m=ro(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=Ka(d[_],T),D=Ka(d[v],T),ee=C-h[m]-D,te=C/2-h[m]/2+w,O=Qa(E,te,ee),k=!c.arrow&&to(i)!=null&&te!==O&&a.reference[m]/2-(te<E?E:D)-h[m]/2<0,A=k?te<E?te-E:te-ee:0;return{[p]:f[p]+A,data:{[p]:O,centerOffset:te-O-A,...k&&{alignmentOffset:A}},reset:k}}});function To(e,t,n){return(e?[...n.filter(t=>to(t)===e),...n.filter(t=>to(t)!==e)]:n.filter(e=>eo(e)===e)).filter(n=>!e||to(n)===e||(t?co(n)!==n:!1))}var Eo=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=Ga,autoAlignment:u=!0,...d}=$a(e,t),f=c!==void 0||l===Ga?To(c||null,u,l):l,p=r.autoPlacement?.index||0,m=f[p];if(m==null)return{};if(i!==m)return{reset:{placement:f[0]}};let h=await a.detectOverflow(t,d),g=oo(m,n,await(a.isRTL==null?void 0:a.isRTL(o.floating))),_=[h[eo(m)],h[g[0]],h[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:m,overflows:_}],y=f[p+1];if(y)return{data:{index:p+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=to(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,to(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:p+1,overflows:v},reset:{placement:x}}}}},Do=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}=$a(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=eo(r),_=io(o),v=eo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[go(o)]:so(o)),x=p!==`none`;!d&&x&&b.push(...ho(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=oo(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`||_===io(t)||T.every(e=>io(e.placement)!==_||e.overflows[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=io(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}if(r!==n)return{reset:{placement:n}}}return{}}}};function Oo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ko(e){return Ua.some(t=>e[t]>=0)}var Ao=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=$a(e,t);switch(i){case`referenceHidden`:{let e=Oo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ko(e)}}}case`escaped`:{let e=Oo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ko(e)}}}default:return{}}}}};function jo(e){let t=Ka(...e.map(e=>e.left)),n=Ka(...e.map(e=>e.top)),r=qa(...e.map(e=>e.right)),i=qa(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Mo(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>yo(jo(e)))}var No=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=$a(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Mo(u),f=yo(jo(u)),p=vo(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(io(n)===`y`){let e=d[0],t=d[d.length-1],r=eo(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return yo({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=eo(n)===`left`,t=qa(...d.map(e=>e.right)),r=Ka(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return yo({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Po=new Set([`left`,`top`]);async function Fo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=eo(n),s=to(n),c=io(n)===`y`,l=Po.has(o)?-1:1,u=a&&c?-1:1,d=$a(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 Io=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 Fo(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}}}}},Lo=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}=$a(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=io(i),p=no(f),m=u[p],h=u[f],g=(e,t)=>Qa(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ro=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}=$a(e,t),u={x:n,y:r},d=io(i),f=no(d),p=u[f],m=u[d],h=$a(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=Po.has(eo(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}}}},zo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=$a(e,t),c=await i.detectOverflow(t,s),l=eo(n),u=to(n),d=io(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ka(p-c[m],g),y=Ka(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*qa(c.left,c.right):S=p-2*qa(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Bo(){return typeof window<`u`}function Vo(e){return Uo(e)?(e.nodeName||``).toLowerCase():`#document`}function Ho(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){return((Uo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Uo(e){return Bo()?e instanceof Node||e instanceof Ho(e).Node:!1}function Wo(e){return Bo()?e instanceof Element||e instanceof Ho(e).Element:!1}function Go(e){return Bo()?e instanceof HTMLElement||e instanceof Ho(e).HTMLElement:!1}function Ko(e){return!Bo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ho(e).ShadowRoot}function qo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=is(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Jo(e){return/^(table|td|th)$/.test(Vo(e))}function Yo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Xo=/transform|translate|scale|rotate|perspective|filter/,Zo=/paint|layout|strict|content/,Qo=e=>!!e&&e!==`none`,$o;function es(e){let t=Wo(e)?is(e):e;return Qo(t.transform)||Qo(t.translate)||Qo(t.scale)||Qo(t.rotate)||Qo(t.perspective)||!ns()&&(Qo(t.backdropFilter)||Qo(t.filter))||Xo.test(t.willChange||``)||Zo.test(t.contain||``)}function ts(e){let t=ss(e);for(;Go(t)&&!rs(t);){if(es(t))return t;if(Yo(t))return null;t=ss(t)}return null}function ns(){return $o??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),$o}function rs(e){return/^(html|body|#document)$/.test(Vo(e))}function is(e){return Ho(e).getComputedStyle(e)}function as(e){return Wo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ss(e){if(Vo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ko(e)&&e.host||V(e);return Ko(t)?t.host:t}function cs(e){let t=ss(e);return rs(t)?(e.ownerDocument||e).body:Go(t)&&qo(t)?t:cs(t)}function ls(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cs(e),i=r===e.ownerDocument?.body,a=Ho(r);if(i){let e=us(a);return t.concat(a,a.visualViewport||[],qo(r)?r:[],e&&n?ls(e):[])}return t.concat(r,ls(r,[],n))}function us(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ds(e){let t=is(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Go(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ja(n)!==a||Ja(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function fs(e){return Wo(e)?e:e.contextElement}function ps(e){let t=fs(e);if(!Go(t))return Xa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ds(t),o=(a?Ja(n.width):n.width)/r,s=(a?Ja(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var ms=Xa(0);function hs(e){let t=Ho(e);return!ns()||!t.visualViewport?ms:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ho(e)}function _s(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=fs(e),o=Xa(1);t&&(r?Wo(r)&&(o=ps(r)):o=ps(e));let s=gs(a,n,r)?hs(a):Xa(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&&r){let e=Ho(a),t=Wo(r)?Ho(r):r,n=e,i=us(n);for(;i&&t!==n;){let e=ps(i),t=i.getBoundingClientRect(),r=is(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=Ho(i),i=us(n)}}return yo({width:u,height:d,x:c,y:l})}function vs(e,t){let n=as(e).scrollLeft;return t?t.left+n:_s(V(e)).left+n}function ys(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vs(e,n),y:n.top+t.scrollTop}}function bs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=V(r),s=t?Yo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Xa(1),u=Xa(0),d=Go(r);if((d||!a)&&((Vo(r)!==`body`||qo(o))&&(c=as(r)),d)){let e=_s(r);l=ps(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ys(o,c):Xa(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 xs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ss(e){let t=as(e),n=e.ownerDocument.body,r=qa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=qa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+vs(e),o=-t.scrollTop;return is(n).direction===`rtl`&&(a+=qa(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Cs=25;function ws(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ho(e),a=V(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ns()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(vs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Cs&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ts(e,t){let n=_s(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ps(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Es(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ws(e,n,t);else if(t===`document`)r=Ss(V(e));else if(Wo(t))r=Ts(t,n);else{let n=hs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yo(r)}function Ds(e,t){let n=t.get(e);if(n)return n;let r=ls(e,[],!1).filter(e=>Wo(e)&&Vo(e)!==`body`),i=null,a=is(e).position===`fixed`,o=a?ss(e):e;for(;Wo(o)&&!rs(o);){let e=is(o),t=es(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ss(o)}return t.set(e,r),r}function Os(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Yo(t)?[]:Ds(t,this._c):[].concat(n),r],o=Es(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=Es(t,a[e],i);s=qa(n.top,s),c=Ka(n.right,c),l=Ka(n.bottom,l),u=qa(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ks(e){let{width:t,height:n}=ds(e);return{width:t,height:n}}function As(e,t,n){let r=Go(t),i=V(t),a=n===`fixed`,o=_s(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Xa(0);if((r||!a)&&((Vo(t)!==`body`||qo(i))&&(s=as(t)),r)){let e=_s(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=vs(i));let l=i&&!r&&!a?ys(i,s):Xa(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function js(e){return is(e).position===`static`}function Ms(e,t){if(!Go(e)||is(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function Ns(e,t){let n=Ho(e);if(Yo(e))return n;if(!Go(e)){let t=ss(e);for(;t&&!rs(t);){if(Wo(t)&&!js(t))return t;t=ss(t)}return n}let r=Ms(e,t);for(;r&&Jo(r)&&js(r);)r=Ms(r,t);return r&&rs(r)&&js(r)&&!es(r)?n:r||ts(e)||n}var Ps=async function(e){let t=this.getOffsetParent||Ns,n=this.getDimensions,r=await n(e.floating);return{reference:As(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fs(e){return is(e).direction===`rtl`}var Is={convertOffsetParentRelativeRectToViewportRelativeRect:bs,getDocumentElement:V,getClippingRect:Os,getOffsetParent:Ns,getElementRects:Ps,getClientRects:xs,getDimensions:ks,getScale:ps,isElement:Wo,isRTL:Fs};function Ls(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rs(e,t,n){let r=null,i,a=V(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ya(d),h=Ya(a.clientWidth-(u+f)),g=Ya(a.clientHeight-(d+p)),_=Ya(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:qa(0,Ka(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ls(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ho(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function zs(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=fs(e),u=i||a?[...l?ls(l):[],...t?ls(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Rs(l,n,a):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?_s(e):null;c&&g();function g(){let t=_s(e);h&&!Ls(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 Bs=Io,Vs=Eo,Hs=Lo,Us=Do,Ws=zo,Gs=Ao,Ks=wo,qs=No,Js=Ro,Ys=(e,t,n)=>{let r=new Map,i=n??{},a={...Is,...i.platform,_c:r};return Co(e,t,{...i,platform:a})},Xs=typeof document<`u`?_.useLayoutEffect:function(){};function Zs(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(!Zs(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)&&!Zs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Qs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $s(e,t){let n=Qs(e);return Math.round(t*n)/n}function ec(e){let t=_.useRef(e);return Xs(()=>{t.current=e}),t}function tc(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:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Zs(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=ec(c),ee=ec(i),te=ec(l),O=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),Ys(C.current,w.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};k.current&&!Zs(T.current,t)&&(T.current=t,Bt.flushSync(()=>{d(t)}))})},[f,t,n,ee,te]);Xs(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=_.useRef(!1);Xs(()=>(k.current=!0,()=>{k.current=!1}),[]),Xs(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,O);O()}},[x,S,O,D,E]);let A=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),ne=_.useMemo(()=>({reference:x,floating:S}),[x,S]),re=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!ne.floating)return e;let t=$s(ne.floating,u.x),r=$s(ne.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Qs(ne.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ne.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:O,refs:A,elements:ne,floatingStyles:re}),[u,O,A,ne,re])}var nc=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?{}:Ks({element:r.current,padding:i}).fn(n):r?Ks({element:r,padding:i}).fn(n):{}}}},rc=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ic=(e,t)=>{let n=Hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ac=(e,t)=>({fn:Js(e).fn,options:[e,t]}),oc=(e,t)=>{let n=Us(e);return{name:n.name,fn:n.fn,options:[e,t]}},sc=(e,t)=>{let n=Ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},cc=(e,t)=>{let n=Gs(e);return{name:n.name,fn:n.fn,options:[e,t]}},lc=(e,t)=>{let n=nc(e);return{name:n.name,fn:n.fn,options:[e,t]}},uc=Object.defineProperty,dc=_.forwardRef(((e,t)=>uc(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(Ut.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),fc=Object.defineProperty,pc=(e,t)=>fc(e,`name`,{value:t,configurable:!0}),mc={Partial:`partial`,Always:`always`},hc={Optimized:`optimized`,Always:`always`},gc=`Popper`,[_c,vc]=Qt(gc),[yc,bc]=_c(gc),xc=pc(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,R.jsx)(yc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Sc=`PopperAnchor`,Cc=_.forwardRef(pc(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=bc(Sc,n),o=_.useRef(null),s=a.onAnchorChange,c=yt(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Nc(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,R.jsx)(Ut.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),wc=`PopperContent`,[Tc,Ec]=_c(wc),Dc=_.forwardRef(pc(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=mc.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=hc.Optimized,onPlaced:m,...h}=e,g=bc(wc,n),[v,y]=_.useState(null),b=yt(t,y),[x,S]=_.useState(null),C=Ha(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],te=ee.length>0,O={padding:D,boundary:ee.filter(jc),altBoundary:te},{refs:k,floatingStyles:A,placement:ne,isPositioned:re,middlewareData:j}=tc({strategy:`fixed`,placement:E,whileElementsMounted:pc((...e)=>zs(...e,{animationFrame:p===hc.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[rc({mainAxis:i+T,alignmentAxis:o}),c&&ic({mainAxis:!0,crossAxis:!1,...d===mc.Partial?{limiter:ac()}:{},...O}),c&&oc({...O}),sc({...O,apply:pc(({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`)},`apply`)}),x&&lc({element:x,padding:s}),Mc({arrowWidth:w,arrowHeight:T}),f&&cc(te?{strategy:`referenceHidden`,...O}:{strategy:`referenceHidden`,padding:O.padding,altBoundary:O.altBoundary})]}),M=g.setPlacementState;en(()=>(M(ne),()=>{M(void 0)}),[ne,M]);let[ie,ae]=Nc(ne),oe=ir(m);en(()=>{re&&oe?.()},[re,oe]);let se=j.arrow?.x,ce=j.arrow?.y,le=j.arrow?.centerOffset!==0,[ue,de]=_.useState();return en(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),(0,R.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...A,transform:re?A.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(` `),...j.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(Tc,{scope:n,placedSide:ie,placedAlign:ae,onArrowChange:S,arrowX:se,arrowY:ce,shouldHideArrow:le,children:(0,R.jsx)(Ut.div,{"data-side":ie,"data-align":ae,...h,ref:b,style:{...h.style,animation:re?h.style?.animation:`none`}})})})},`PopperContent`)),Oc=`PopperArrow`,kc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ac=_.forwardRef(pc(function(e,t){let{__scopePopper:n,...r}=e,i=Ec(Oc,n),a=kc[i.placedSide];return(0,R.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,R.jsx)(dc,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function jc(e){return e!==null}pc(jc,`isNotNull`);var Mc=pc(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]=Nc(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}}}}),`transformOrigin`);function Nc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}pc(Nc,`getSideAndAlignFromPlacement`);var Pc=Object.defineProperty,Fc=(e,t)=>Pc(e,`name`,{value:t,configurable:!0}),Ic=!1;function Lc(){let[e,t]=_.useState(Ic);return _.useEffect(()=>{Ic||(Ic=!0,t(!0))},[]),e}Fc(Lc,`useIsHydrated`);var Rc=_.useSyncExternalStore;function zc(){return()=>{}}Fc(zc,`subscribe`);function Bc(){return Rc(zc,()=>!0,()=>!1)}Fc(Bc,`useIsHydratedModern`);var Vc=typeof Rc==`function`?Bc:Lc,Hc=Object.defineProperty,Uc=(e,t)=>Hc(e,`name`,{value:t,configurable:!0}),Wc=`rovingFocusGroup.onEntryFocus`,Gc={bubbles:!1,cancelable:!0},Kc=`RovingFocusGroup`,[qc,Jc,Yc]=rn(Kc),[Xc,Zc]=Qt(Kc,[Yc]),Qc={Vertical:`vertical`,Horizontal:`horizontal`},$c={LTR:`ltr`,RTL:`rtl`},[el,tl]=Xc(Kc),nl=_.forwardRef(Uc(function(e,t){return(0,R.jsx)(qc.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(qc.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(rl,{...e,ref:t})})})},`RovingFocusGroup`)),rl=_.forwardRef(Uc(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=_.useRef(null),p=yt(t,f),m=er(a),[h,g]=jn({prop:o,defaultProp:s??null,onChange:c,caller:Kc}),[v,y]=_.useState(!1),b=ir(l),x=Jc(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Wc,b),()=>e.removeEventListener(Wc,b)},[b]),(0,R.jsx)(el,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,R.jsx)(Ut.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:z(e.onMouseDown,()=>{S.current=!0}),onFocus:z(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Wc,Gc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);ll([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:z(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),il=`RovingFocusGroupItem`,al=_.forwardRef(Uc(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Yn(),l=a||c,u=tl(il,n),d=u.currentTabStopId===l,f=Jc(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Vc();return en(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),_.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,R.jsx)(qc.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(Ut.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:z(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:z(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:z(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=cl(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?ul(n,r+1):n.slice(r+1)}setTimeout(()=>ll(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),ol={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function sl(e,t){return t===$c.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Uc(sl,`getDirectionAwareKey`);function cl(e,t,n){let r=sl(e.key,n);if(!(t===Qc.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Qc.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return ol[r]}Uc(cl,`getFocusIntent`);function ll(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Uc(ll,`focusFirst`);function ul(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Uc(ul,`wrapArray`);var dl=Object.defineProperty,H=(e,t)=>dl(e,`name`,{value:t,configurable:!0}),fl={LTR:`ltr`,RTL:`rtl`},pl=[`Enter`,` `],ml=[`ArrowDown`,`PageUp`,`Home`],hl=[`ArrowUp`,`PageDown`,`End`],gl=[...ml,...hl],_l={ltr:[...pl,`ArrowRight`],rtl:[...pl,`ArrowLeft`]},vl={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},yl=`Menu`,[bl,xl,Sl]=rn(yl),[Cl,wl]=Qt(yl,[Sl,vc,Zc]),Tl=vc(),El=Zc(),[Dl,Ol]=Cl(yl),[kl,Al]=Cl(yl),jl=H(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Tl(t),[c,l]=_.useState(null),u=_.useRef(!1),d=ir(a),f=er(i);return _.useEffect(()=>{let e=H(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=H(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),_.useEffect(()=>{if(!n)return;let e=H(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,R.jsx)(xc,{...s,children:(0,R.jsx)(Dl,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,R.jsx)(kl,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Ml=_.forwardRef(H(function(e,t){let{__scopeMenu:n,...r}=e,i=Tl(n);return(0,R.jsx)(Cc,{...i,...r,ref:t})},`MenuAnchor`)),Nl=`MenuPortal`,[Pl,Fl]=Cl(Nl,{forceMount:void 0}),Il=H(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ol(Nl,t);return(0,R.jsx)(Pl,{scope:t,forceMount:n,children:(0,R.jsx)(zn,{present:n||a.open,children:(0,R.jsx)(Vr,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Ll=`MenuContent`,[Rl,zl]=Cl(Ll),Bl=_.forwardRef(H(function(e,t){let n=Fl(Ll,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ol(Ll,e.__scopeMenu),o=Al(Ll,e.__scopeMenu);return(0,R.jsx)(bl.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(zn,{present:r||a.open,children:(0,R.jsx)(bl.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(Vl,{...i,ref:t}):(0,R.jsx)(Hl,{...i,ref:t})})})})},`MenuContent`)),Vl=_.forwardRef(H(function(e,t){let n=Ol(Ll,e.__scopeMenu),r=_.useRef(null),i=yt(t,r);return _.useEffect(()=>{let e=r.current;if(e)return ua(e)},[]),(0,R.jsx)(Wl,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Hl=_.forwardRef(H(function(e,t){let n=Ol(Ll,e.__scopeMenu);return(0,R.jsx)(Wl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Ul=St(`MenuContent.ScrollLock`),Wl=_.forwardRef(H(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Ol(Ll,n),v=Al(Ll,n),y=Tl(n),b=El(n),x=xl(n),[S,C]=_.useState(null),w=_.useRef(null),[T,E]=_.useState(null);Or(T);let{nodes:D,registry:ee}=Dr(),te=!!(i||m),O=yt(t,w,g.onContentChange,E),k=_.useRef(0),A=_.useRef(``),ne=_.useRef(0),re=_.useRef(null),j=_.useRef(`right`),M=_.useRef(0),ie=_.useMemo(()=>m?[w,...D.map(e=>({current:e}))]:[],[w,D,m]),ae=m?na:_.Fragment,oe=m?{as:Ul,allowPinchZoom:!0,shards:ie}:void 0,se=H(e=>{let t=A.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=bu(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){A.current=e,window.clearTimeout(k.current),e!==``&&(k.current=window.setTimeout(()=>s(``),1e3))}H(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);_.useEffect(()=>()=>window.clearTimeout(k.current),[]),qr();let ce=_.useCallback(e=>j.current===re.current?.side&&Su(e,re.current?.area),[]);return(0,R.jsx)(Rl,{scope:n,searchRef:A,onItemEnter:_.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),onItemLeave:_.useCallback(e=>{ce(e)||(w.current?.focus(),C(null))},[ce]),onTriggerLeave:_.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:_.useCallback(e=>{re.current=e},[]),children:(0,R.jsx)(Er,{registry:te?ee:null,children:(0,R.jsx)(ae,{...oe,children:(0,R.jsx)(wr,{asChild:!0,trapped:i,branches:D,onMountAutoFocus:z(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,R.jsx)(fr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,R.jsx)(nl,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:z(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(Dc,{role:`menu`,"aria-orientation":`vertical`,"data-state":hu(g.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:O,style:{outline:`none`,...h.style},onKeyDown:z(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&se(e.key));let i=w.current;if(e.target!==i||!gl.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);hl.includes(e.key)&&a.reverse(),vu(a)}),onBlur:z(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(k.current),A.current=``)}),onPointerMove:z(e.onPointerMove,Cu(e=>{let t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>M.current?`right`:`left`;j.current=t,M.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Gl=_.forwardRef(H(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Ut.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Kl=_.forwardRef(H(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Ut.div,{...r,ref:t})},`MenuLabel`)),ql=`MenuItem`,Jl=`menu.itemSelect`,Yl=_.forwardRef(H(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=Al(ql,e.__scopeMenu),s=zl(ql,e.__scopeMenu),c=yt(t,a),l=_.useRef(!1),u=H(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Jl,{bubbles:!0,cancelable:!0});e.addEventListener(Jl,e=>r?.(e),{once:!0}),Wt(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,R.jsx)(Xl,{...i,ref:c,disabled:n,onClick:z(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:z(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&pl.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Xl=_.forwardRef(H(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=zl(ql,n),s=El(n),c=_.useRef(null),l=yt(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(``);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,R.jsx)(bl.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,R.jsx)(al,{asChild:!0,...s,focusable:!r,children:(0,R.jsx)(Ut.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:z(e.onPointerMove,Cu(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Cu(e=>o.onItemLeave(e))),onFocus:z(e.onFocus,()=>d(!0)),onBlur:z(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Zl,Ql]=Cl(`MenuRadioGroup`,{value:void 0,onValueChange:H(()=>{},`onValueChange`)}),$l=_.forwardRef(H(function(e,t){let{value:n,onValueChange:r,...i}=e,a=ir(r);return(0,R.jsx)(Zl,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,R.jsx)(Gl,{...i,ref:t})})},`MenuRadioGroup`)),eu=`MenuRadioItem`,tu=_.forwardRef(H(function(e,t){let{value:n,...r}=e,i=Ql(eu,e.__scopeMenu),a=n===i.value;return(0,R.jsx)(ru,{scope:e.__scopeMenu,checked:a,children:(0,R.jsx)(Yl,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":_u(a),onSelect:z(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),nu=`MenuItemIndicator`,[ru,iu]=Cl(nu,{checked:!1}),au=_.forwardRef(H(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=iu(nu,n);return(0,R.jsx)(zn,{present:r||gu(a.checked)||a.checked===!0,children:(0,R.jsx)(Ut.span,{...i,ref:t,"data-state":_u(a.checked)})})},`MenuItemIndicator`)),ou=_.forwardRef(H(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Ut.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),su=`MenuSub`,[cu,lu]=Cl(su),uu=H(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ol(su,t),o=Tl(t),[s,c]=_.useState(null),[l,u]=_.useState(null),d=ir(i);return _.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,R.jsx)(xc,{...o,children:(0,R.jsx)(Dl,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,R.jsx)(cu,{scope:t,contentId:Yn(),triggerId:Yn(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),du=`MenuSubTrigger`,fu=_.forwardRef(H(function(e,t){let n=Ol(du,e.__scopeMenu),r=Al(du,e.__scopeMenu),i=lu(du,e.__scopeMenu),a=zl(du,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);_.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=yt(t,i.onTriggerChange);return(0,R.jsx)(Ml,{asChild:!0,...l,children:(0,R.jsx)(Xl,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":hu(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Cu(t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||o.current||(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:z(e.onPointerLeave,Cu(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&_l[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),pu=`MenuSubContent`,mu=_.forwardRef(H(function(e,t){let n=Fl(Ll,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Ol(Ll,e.__scopeMenu),s=Al(Ll,e.__scopeMenu),c=lu(pu,e.__scopeMenu),l=_.useRef(null),u=yt(t,l);return(0,R.jsx)(bl.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(zn,{present:r||o.open,children:(0,R.jsx)(bl.Slot,{scope:e.__scopeMenu,children:(0,R.jsx)(Wl,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===fl.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:z(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:z(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=vl[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function hu(e){return e?`open`:`closed`}H(hu,`getOpenState`);function gu(e){return e===`indeterminate`}H(gu,`isIndeterminate`);function _u(e){return gu(e)?`indeterminate`:e?`checked`:`unchecked`}H(_u,`getCheckedState`);function vu(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}H(vu,`focusFirst`);function yu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}H(yu,`wrapArray`);function bu(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=yu(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}H(bu,`getNextMatch`);function xu(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}H(xu,`isPointInPolygon`);function Su(e,t){return t?xu({x:e.clientX,y:e.clientY},t):!1}H(Su,`isPointerInGraceArea`);function Cu(e){return t=>t.pointerType===`mouse`?e(t):void 0}H(Cu,`whenMouse`);var wu=Object.defineProperty,Tu=(e,t)=>wu(e,`name`,{value:t,configurable:!0}),Eu=`DropdownMenu`,[Du,Ou]=Qt(Eu,[wl]),ku=wl(),[Au,ju]=Du(Eu),Mu=Tu(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=ku(t),l=_.useRef(null),[u,d]=jn({prop:i,defaultProp:a??!1,onChange:o,caller:Eu});return(0,R.jsx)(Au,{scope:t,triggerId:Yn(),triggerRef:l,contentId:Yn(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,R.jsx)(jl,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Nu=`DropdownMenuTrigger`,Pu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=ju(Nu,n),o=ku(n),s=yt(t,a.triggerRef);return(0,R.jsx)(Ml,{asChild:!0,...o,children:(0,R.jsx)(Ut.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:z(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:z(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Fu=Tu(e=>{let{__scopeDropdownMenu:t,...n}=e,r=ku(t);return(0,R.jsx)(Il,{...r,...n})},`DropdownMenuPortal`),Iu=`DropdownMenuContent`,Lu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ju(Iu,n),a=ku(n),o=_.useRef(!1);return(0,R.jsx)(Bl,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:z(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Ru=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(Kl,{...i,...r,ref:t})},`DropdownMenuLabel`)),zu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(Yl,{...i,...r,ref:t})},`DropdownMenuItem`)),Bu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)($l,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),Vu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(tu,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Hu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(au,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Uu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(ou,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Wu=Tu(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=ku(t),[s,c]=jn({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,R.jsx)(uu,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),Gu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(fu,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),Ku=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(mu,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),qu=Object.defineProperty,Ju=(e,t)=>qu(e,`name`,{value:t,configurable:!0}),Yu=`Popover`,[Xu,Zu]=Qt(Yu,[vc]),Qu=vc(),[$u,ed]=Xu(Yu),td=Ju(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Qu(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=_.useState(0),[p,m]=_.useState(0),[h,g]=jn({prop:r,defaultProp:i??!1,onChange:a,caller:Yu});return(0,R.jsx)(xc,{...s,children:(0,R.jsx)($u,{scope:t,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:_.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),nd=`PopoverAnchor`,rd=_.forwardRef(Ju(function(e,t){let{__scopePopover:n,...r}=e,i=ed(nd,n),a=Qu(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(o(),()=>s()),[o,s]),(0,R.jsx)(Cc,{...a,...r,ref:t})},`PopoverAnchor`)),id=`PopoverTrigger`,ad=_.forwardRef(Ju(function(e,t){let{__scopePopover:n,...r}=e,i=ed(id,n),a=Qu(n),o=yt(t,i.triggerRef),s=(0,R.jsx)(Ut.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":gd(i.open),...r,ref:o,onClick:z(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,R.jsx)(Cc,{asChild:!0,...a,children:s})},`PopoverTrigger`)),od=`PopoverPortal`,[sd,cd]=Xu(od,{forceMount:void 0}),ld=Ju(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ed(od,t);return(0,R.jsx)(sd,{scope:t,forceMount:n,children:(0,R.jsx)(zn,{present:n||a.open,children:(0,R.jsx)(Vr,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),ud=`PopoverContent`,dd=_.forwardRef(Ju(function(e,t){let n=cd(ud,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ed(ud,e.__scopePopover);return(0,R.jsx)(zn,{present:r||a.open,children:a.modal?(0,R.jsx)(pd,{...i,ref:t}):(0,R.jsx)(md,{...i,ref:t})})},`PopoverContent`)),fd=St(`PopoverContent.RemoveScroll`),pd=_.forwardRef(Ju(function(e,t){let n=ed(ud,e.__scopePopover),r=_.useRef(null),i=yt(t,r),a=_.useRef(!1),{nodes:o,registry:s}=Dr();return _.useEffect(()=>{let e=r.current;if(e)return ua(e)},[]),(0,R.jsx)(na,{as:fd,allowPinchZoom:!0,shards:_.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,R.jsx)(hd,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),md=_.forwardRef(Ju(function(e,t){let n=ed(ud,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return(0,R.jsx)(hd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),hd=_.forwardRef(Ju(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=ed(ud,n),g=Qu(n),[v,y]=_.useState(null),b=yt(t,y);return Or(v),qr(),(0,R.jsx)(Er,{registry:p,children:(0,R.jsx)(wr,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(fr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,R.jsx)(Dc,{"data-state":gd(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?_d(d,h.descriptionId):d,...g,...m,ref:b,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function gd(e){return e?`open`:`closed`}Ju(gd,`getState`);function _d(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ju(_d,`concatAriaDescribedby`);var vd=Object.defineProperty,yd=(e,t)=>vd(e,`name`,{value:t,configurable:!0}),[bd,xd]=Qt(`Tooltip`,[vc]),Sd=vc(),Cd=`TooltipProvider`,wd=700,Td=`tooltip.open`,[Ed,Dd]=bd(Cd),Od=yd(e=>{let{__scopeTooltip:t,delayDuration:n=wd,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(Ed,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),kd=`Tooltip`,[Ad,jd]=bd(kd),Md=yd(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Dd(kd,e.__scopeTooltip),l=Sd(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=Yn(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=jn({prop:r,defaultProp:i??!1,onChange:yd(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Td))):c.onClose(),a?.(e)},`onChange`),caller:kd}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,R.jsx)(xc,{...l,children:(0,R.jsx)(Ad,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Nd=`TooltipTrigger`,Pd=_.forwardRef(yd(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=jd(Nd,n),o=Dd(Nd,n),s=Sd(n),c=yt(t,_.useRef(null),a.onTriggerChange),l=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,R.jsx)(Cc,{asChild:!0,...s,children:(0,R.jsx)(Ut.button,{"aria-describedby":a.open?Zd(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:z(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:z(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:z(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})},`TooltipTrigger`)),Fd=`TooltipPortal`,[Id,Ld]=bd(Fd,{forceMount:void 0}),Rd=yd(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=jd(Fd,t);return(0,R.jsx)(Id,{scope:t,forceMount:n,children:(0,R.jsx)(zn,{present:n||a.open,children:(0,R.jsx)(Vr,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),zd=`TooltipContent`,Bd=_.forwardRef(yd(function(e,t){let n=Ld(zd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=jd(zd,e.__scopeTooltip);return(0,R.jsx)(zn,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(Ud,{side:i,...a,ref:t}):(0,R.jsx)(Vd,{side:i,...a,ref:t})})},`TooltipContent`)),Vd=_.forwardRef(yd(function(e,t){let n=jd(zd,e.__scopeTooltip),r=Dd(zd,e.__scopeTooltip),i=_.useRef(null),a=yt(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Kd(r,Gd(r,n.getBoundingClientRect())),a=qd(t.getBoundingClientRect()),o=Yd([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=yd(e=>p(e,u),`handleTriggerLeave`),t=yd(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=yd(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Jd(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,R.jsx)(Ud,{...e,ref:a})},`TooltipContentHoverable`)),Hd=Tt(`TooltipContent`),Ud=_.forwardRef(yd(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=jd(zd,n),u=Sd(n),{onClose:d}=l,[f,p]=_.useState(null),m=yt(t,p);Or(f),_.useEffect(()=>(document.addEventListener(Td,d),()=>document.removeEventListener(Td,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=yd(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return en(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,R.jsx)(fr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,R.jsxs)(Dc,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(Hd,{children:r}),i?(0,R.jsx)(Jt,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Wd=_.forwardRef(yd(function(e,t){let{__scopeTooltip:n,...r}=e,i=Sd(n);return(0,R.jsx)(Ac,{...i,...r,ref:t})},`TooltipArrow`));function Gd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}yd(Gd,`getExitSideFromRect`);function Kd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}yd(Kd,`getPaddedExitPoints`);function qd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}yd(qd,`getPointsFromRect`);function Jd(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}yd(Jd,`isPointInPolygon`);function Yd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Xd(t)}yd(Yd,`getHull`);function Xd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}yd(Xd,`getHullPresorted`);function Zd(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}yd(Zd,`concatAriaDescribedby`);var Qd=C(`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`,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 $d({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Ct:`button`;return(0,R.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:L(Qd({variant:t,size:n,className:e})),...i})}function ef({title:e,children:t,action:n,alert:r,extra:i}){let a=(0,_.useRef)(null);return(0,_.useEffect)(()=>{r&&a.current?.focus()},[r]),(0,R.jsxs)(`div`,{role:r?`alert`:void 0,className:`mx-auto mt-[16vh] grid max-w-lg justify-items-start gap-4 px-6`,children:[(0,R.jsx)(`h1`,{ref:a,tabIndex:r?-1:void 0,className:`font-display text-3xl font-extrabold tracking-tight [font-stretch:108%] text-balance outline-none`,children:e}),(0,R.jsx)(`p`,{className:`text-muted-foreground`,children:t}),n&&(0,R.jsx)($d,{className:`[@media(pointer:coarse)]:min-h-11`,onClick:n.onClick,children:n.label}),i]})}function tf(){return(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-1`,role:`img`,"aria-label":`Explicaí Studio`,children:[(0,R.jsx)(`img`,{src:`/favicon.svg`,alt:``,width:`26`,height:`26`}),(0,R.jsxs)(`span`,{className:`wordmark whitespace-nowrap text-[21px]`,"aria-hidden":`true`,children:[`explica`,(0,R.jsx)(`span`,{className:`i`,children:`ı`})]}),(0,R.jsx)(`span`,{className:`hidden font-mono text-xs text-muted-foreground lg:inline`,"aria-hidden":`true`,children:`studio`})]})}var nf={"Nenhuma imagem sem uso.":`No unused images.`,"Imagens que nenhuma página usa, contando versões e lixeira, vão para a lixeira.":`Images that no page uses, counting versions and trash, go to the trash.`,Recortar:`Crop`,"Recortar imagem":`Crop image`,"Ferramenta Recortar":`Crop tool`,"Arraste sobre a parte da imagem que deve ficar":`Drag over the part of the image to keep`,"Arraste sobre a parte que deve ficar.":`Drag over the part to keep.`,"Para ajustar o retângulo, use Selecionar (V). Depois aplique.":`To adjust the rectangle, use Select (V). Then apply.`,"Aplicar recorte":`Apply crop`,"Recortar a imagem?":`Crop the image?`,"Recortando…":`Cropping…`,"Recortar e apagar o original":`Crop and delete the original`,"Isto troca o print pela parte recortada. O original será apagado e não dá para voltar.":`This replaces the screenshot with the cropped part. The original is deleted and cannot be restored.`,"{n} marcação será removida":`{n} annotation will be removed`,"{n} marcações serão removidas":`{n} annotations will be removed`,"{n} marcador":`{n} marker`,"{n} marcadores":`{n} markers`,"{n} destaque":`{n} highlight`,"{n} destaques":`{n} highlights`,"{n} seta":`{n} arrow`,"{n} setas":`{n} arrows`,"{n} área clicável":`{n} clickable area`,"{n} áreas clicáveis":`{n} clickable areas`,"Não dá para recortar SVG ou GIF. Use um print em PNG, JPEG ou WebP.":`SVG and GIF cannot be cropped. Use a PNG, JPEG or WebP screenshot.`,"Aplique ou descarte as áreas a ocultar antes de recortar.":`Apply or discard the areas to hide before cropping.`,"O recorte cobre a imagem inteira. Reduza o retângulo.":`The crop covers the whole image. Make the rectangle smaller.`,"A imagem foi recortada, mas as marcações não foram gravadas. Salve de novo.":`The image was cropped, but the annotations were not saved. Save again.`,"Não foi possível recortar. A imagem não foi alterada.":`Could not crop. The image was not changed.`,"Reduzir imagem":`Reduce image`,Reduzir:`Reduce`,Atual:`Current`,Depois:`After`,"Largura (px)":`Width (px)`,Qualidade:`Quality`,"A largura precisa ser menor que a atual. Nunca amplia.":`The width must be smaller than the current one. It never enlarges.`,"Aplique ou descarte o que está pendente antes de reduzir.":`Apply or discard what is pending before reducing.`,"Reduzir a imagem?":`Reduce the image?`,"Reduzindo…":`Reducing…`,"Reduzir e apagar o original":`Reduce and delete the original`,"Isto troca o print por uma versão com menos pixels. O original será apagado e não dá para voltar. As marcações continuam no mesmo lugar.":`This replaces the screenshot with a version with fewer pixels. The original is deleted and cannot be restored. Annotations stay in place.`,"Não foi possível reduzir. A imagem não foi alterada.":`Could not reduce. The image was not changed.`,Ocultar:`Hide`,"Ocultar dados":`Hide sensitive data`,"Ferramenta Ocultar":`Hide tool`,"Arraste sobre o dado que deve sumir":`Drag over the data that must disappear`,"Arraste sobre o dado que deve sumir.":`Drag over the data that must disappear.`,"{n} área a ocultar":`{n} area to hide`,"{n} áreas a ocultar":`{n} areas to hide`,"Aplicar ocultação":`Apply hiding`,Descartar:`Discard`,Estilo:`Style`,Tarja:`Bar`,Desfoque:`Blur`,"Para senha, CPF e números, prefira a tarja.":`For passwords, ID numbers and digits, prefer the bar.`,"Ocultando…":`Hiding…`,"Ocultar e apagar o original":`Hide and delete the original`,"Ocultar as áreas marcadas?":`Hide the marked areas?`,"Isto troca o print por uma versão com as áreas cobertas. O original será apagado e não dá para voltar.":`This replaces the screenshot with a version that has the areas covered. The original will be deleted and this cannot be undone.`,"Esta pasta está no git: o print original continua no histórico depois de ocultar.":`This folder is in git: the original screenshot stays in the history after hiding.`,"Esta pasta está no git: o original continua no histórico, e limpar o histórico é com você.":`This folder is in git: the original stays in the history, and cleaning the history is up to you.`,"Exportações anteriores ainda têm o original. Exporte de novo e apague os arquivos antigos.":`Earlier exports still contain the original. Export again and delete the old files.`,"Não dá para ocultar dados em SVG ou GIF. Use um print em PNG, JPEG ou WebP.":`Hiding data does not work on SVG or GIF. Use a PNG, JPEG or WebP screenshot.`,"Não foi possível ocultar as áreas. A imagem não foi alterada.":`Could not hide the areas. The image was not changed.`,"Sair sem ocultar?":`Leave without hiding?`,"Sair e descartar":`Leave and discard`,"Continuar editando":`Keep editing`,"As áreas a ocultar ainda não foram aplicadas. Se você sair, elas se perdem e o print continua com os dados à mostra.":`The areas to hide have not been applied yet. If you leave, they are lost and the screenshot still shows the data.`,'"{nome}" e {n} subpágina foram para a lixeira.':`"{nome}" and {n} subpage went to the trash.`,'"{nome}" e {n} subpáginas foram para a lixeira.':`"{nome}" and {n} subpages went to the trash.`,'"{nome}" foi para a lixeira.':`"{nome}" went to the trash.`,"{n} arquivo foi para {pasta}.":`{n} file went to {pasta}.`,"{n} arquivos foram para {pasta}.":`{n} files went to {pasta}.`,"As marcações de {file} estão com erro de sintaxe. Corrija ou apague o arquivo.":`The markup in {file} has a syntax error. Fix or delete the file.`,"Nenhuma página está aprovada ou publicada. Aprove uma página ou exporte todas.":`No page is approved or published. Approve a page or export them all.`,"A cor de {label} tem contraste {ratio}:1 com o branco; o mínimo é {min}:1. Escolha uma cor mais escura.":`The {label} color has a contrast of {ratio}:1 with white; the minimum is {min}:1. Choose a darker color.`,"O texto sobre o realce tem contraste {ratio}:1; o mínimo é {min}:1. Escolha um realce mais claro.":`Text over the highlight has a contrast of {ratio}:1; the minimum is {min}:1. Choose a lighter highlight.`,destaque:`accent`,texto:`text`,"título da capa":`cover title`,"título da página":`page title`,"título de nível 1":`level 1 heading`,"título de nível 2":`level 2 heading`,"título de nível 3":`level 3 heading`,"Nenhuma página está aprovada ou publicada. Aprove uma página para usar esta opção.":`No page is approved or published. Approve a page to use this option.`,"{n} página aprovada ou publicada neste manual. As outras ficam de fora.":`{n} approved or published page in this manual. The others are left out.`,"{n} página":`{n} page`,"{n} páginas":`{n} pages`,"Abrir o PDF":`Open the PDF`,"Abrir o arquivo":`Open the file`,Fechar:`Close`,"{n} páginas aprovadas ou publicadas neste manual. As outras ficam de fora.":`{n} approved or published pages in this manual. The others are left out.`,"3 × 3 com cabeçalho":`3 × 3 with header`,aberta:`open`,"Abra um manual para exportar.":`Open a manual to export.`,"Abrir o menu da página":`Open the page menu`,"Adicionar coluna":`Add column`,"Adicionar linha":`Add row`,"agora há pouco":`just now`,"Ainda sendo escrita":`Still being written`,Ajustes:`Settings`,"Algo deu errado.":`Something went wrong.`,Ameixa:`Plum`,"Andar entre as páginas da árvore":`Move between pages in the tree`,"Antes de restaurar":`Before restoring`,Aparência:`Appearance`,Aplicar:`Apply`,Aprovado:`Approved`,"Área clicável":`Clickable area`,"Áreas clicáveis":`Clickable areas`,"Arraste do início até a ponta da seta":`Drag from the start to the tip of the arrow`,"Arraste sobre a área que leva a outra página":`Drag over the area that leads to another page`,"Arraste sobre o que merece atenção":`Drag over what deserves attention`,"As páginas excluídas ficam na pasta .lixeira do manual até você restaurar ou apagar.":`Deleted pages stay in the manual's .lixeira folder until you restore or delete them.`,Atalhos:`Shortcuts`,"Atalhos de teclado":`Keyboard shortcuts`,"Bloco de código":`Code block`,"Buscar página":`Find page`,"Buscar página pelo título":`Find page by title`,"Buscar página pelo título…":`Find page by title…`,"Cada manual vira uma pasta com uma página em Markdown para cada tela ou tarefa. Dá para versionar no git junto com o código.":`Each manual becomes a folder with one Markdown page per screen or task. You can version it in git next to the code.`,'Cada página entra com a "Versão do manual" ou, sem ela, com o texto atual.':`Each page goes in with the "Manual version" or, without one, with the current text.`,"Caminho da página":`Page path`,Cancelar:`Cancel`,"Carregando as marcações…":`Loading markups…`,"Carregando…":`Loading…`,Citação:`Quote`,Claro:`Light`,"Clique numa marcação para selecionar e arraste para mover; Delete exclui":`Click a markup to select it and drag to move it; Delete removes it`,"Clique onde o número deve ficar":`Click where the number should go`,Cobalto:`Cobalt`,"Código no texto":`Inline code`,"Comandos e trechos de código":`Commands and code snippets`,"Conferida, pode ir para o manual":`Checked, can go into the manual`,"Conteúdo da página":`Page content`,"Criar a primeira página":`Create the first page`,"Criar manual":`Create manual`,"Descrição da imagem":`Image description`,Desfazer:`Undo`,Destaque:`Highlight`,"Destaque {n}":`Highlight {n}`,"Destaques e setas":`Highlights and arrows`,"Destino da área {n}":`Target of area {n}`,"Editar link":`Edit link`,"Em revisão":`In review`,"Endereço da área {n}":`Address of area {n}`,"Endereço inválido. Exemplo: https://exemplo.com.br":`Invalid address. Example: https://example.com`,"Endereço na web…":`Web address…`,"Endereço não pode ter espaços. Para ligar a outra página, escolha na lista.":`An address can't have spaces. To link to another page, pick it from the list.`,"Enter no título":`Enter in the title`,"Erro {status}":`Error {status}`,"Escolha um manual":`Choose a manual`,"Escolha uma ferramenta e clique ou arraste sobre a imagem. Cada marcador numerado ganha uma linha aqui para você escrever o que ele mostra.":`Pick a tool and click or drag over the image. Each numbered marker gets a line here for you to write what it shows.`,"Esconder as páginas ({atalho})":`Hide pages ({atalho})`,"Escreva aqui, ou digite / para inserir um bloco. Cole um print com Ctrl+V.":`Write here, or type / to insert a block. Paste a screenshot with Ctrl+V.`,Escrevendo:`Writing`,Escuro:`Dark`,Esmeralda:`Emerald`,"Esta versão não tem texto.":`This version has no text.`,"Etapa da página":`Page stage`,"Ex.: Manual do Financeiro":`E.g.: Billing manual`,"Ex.: Tela de clientes com o botão Novo cliente":`E.g.: Customers screen with the New customer button`,"excluída {quando}":`deleted {quando}`,"Excluir {nome}":`Delete {nome}`,"Excluir a marcação selecionada":`Delete the selected markup`,"Excluir área {n}":`Delete area {n}`,"Excluir marcador {n}":`Delete marker {n}`,"Excluir página":`Delete page`,"Excluir página e {n} subpágina":`Delete page and {n} subpage`,"Excluir página e {n} subpáginas":`Delete page and {n} subpages`,"Exportando…":`Exporting…`,"Gerando PDF…":`Generating PDF…`,"Pode levar alguns segundos.":`This can take a few seconds.`,"{formato} exportado":`{formato} exported`,"Arquivo, dentro da pasta do manual":`File, inside the manual folder`,"Atenção: {n} aviso":`Warning: {n} notice`,"Atenção: {n} avisos":`Warning: {n} notices`,"Copiar caminho":`Copy path`,"Caminho copiado":`Path copied`,Exportar:`Export`,"Exportar manual":`Export manual`,"Falta o domínio, por exemplo: exemplo.com.br":`The domain is missing, for example: example.com`,"Ferramentas de marcação":`Markup tools`,"Ferramenta Selecionar":`Select tool`,"Ferramenta Marcador":`Marker tool`,"Ferramenta Destaque":`Highlight tool`,"Ferramenta Seta":`Arrow tool`,"Ferramenta Área clicável":`Clickable area tool`,"Ficou de fora: {motivo}":`Left out: {motivo}`,Formatação:`Formatting`,Formato:`Format`,Grafite:`Graphite`,"Guardar versão":`Save version`,'Guarde o texto como está agora para voltar a ele depois. A "Versão do manual" é a que vai para o manual final. Sem ela, vale o texto atual.':`Save the text as it is now to come back to it later. The "Manual version" is the one that goes into the final manual. Without one, the current text is used.`,Idioma:`Language`,"Idioma da interface":`Interface language`,"Muda só o Studio, neste navegador.":`Changes only the Studio, in this browser.`,Imagem:`Image`,"Colar print":`Paste screenshot`,"Inserir bloco":`Insert block`,"Inserir bloco: título, passos, imagem, tabela…":`Insert block: heading, steps, image, table…`,"Ir para o texto da página":`Go to the page text`,Itálico:`Italic`,"Itens sem ordem":`Unordered items`,"Já está no manual entregue":`Already in the delivered manual`,Legenda:`Legend`,"Legenda da imagem":`Image legend`,"Sem descrição":`No description`,Link:`Link`,"Link para outra página ou endereço":`Link to another page or address`,"Link para uma página ou endereço":`Link to a page or address`,Lista:`List`,Lixeira:`Trash`,"Lixeira deste manual":`Trash for this manual`,"Mais ações para {nome}":`More actions for {nome}`,Manual:`Manual`,"Manuais nesta pasta":`Manuals in this folder`,Marcador:`Marker`,"Marcando imagens":`Marking up images`,"Editar imagem":`Edit image`,"Tamanho da imagem":`Image size`,"Não foi possível salvar o tamanho.":`Could not save the size.`,Pequena:`Small`,Média:`Medium`,Larga:`Wide`,"Com {n} marcadores, a imagem pequena pode amontoá-los. Experimente Média.":`With {n} markers, a small image may crowd them. Try Medium.`,"Markdown para IA":`Markdown for AI`,"Mostrar as páginas ({atalho})":`Show pages ({atalho})`,"Mostrar ou esconder as páginas":`Show or hide pages`,Mover:`Move`,"Mover a página para cima ou para baixo":`Move the page up or down`,"Mover para a lixeira":`Move to trash`,"Muda só o Studio, neste navegador. A cor do manual fica em Exportar manual.":`Only changes the Studio, in this browser. The manual color is in Export manual.`,"Não foi possível abrir o Studio.":`Could not open the Studio.`,"Não foi possível enviar a imagem.":`Could not upload the image.`,"Não foi possível exportar o manual.":`Could not export the manual.`,"Não foi possível salvar as marcações.":`Could not save the markups.`,"Não foi possível salvar. O texto continua na tela.":`Could not save. Your text is still on screen.`,"Aguardando sua escolha":`Waiting for your choice`,Negrito:`Bold`,"Nenhum bloco com esse nome.":`No block with that name.`,"Nenhuma página ainda.":`No pages yet.`,"Nenhuma página com esse título.":`No page with that title.`,"Nenhuma página excluída.":`No deleted pages.`,"Há alterações sem salvar. Salve antes de limpar as imagens.":`There are unsaved changes. Save before cleaning up images.`,"Nenhuma versão guardada ainda.":`No saved versions yet.`,"Nesta página":`On this page`,"No Mac, use Cmd no lugar de Ctrl.":`On a Mac, use Cmd instead of Ctrl.`,"Nome da página ou https://…":`Page name or https://…`,"Nome da versão (opcional)":`Version name (optional)`,"Nome da versão (opcional), ex.: Revisada pelo suporte":`Version name (optional), e.g.: Reviewed by support`,"Nome do manual":`Manual name`,"Nova página":`New page`,"Nova subpágina":`New subpage`,"Nova subpágina em {nome}":`New subpage in {nome}`,"Novo manual":`New manual`,"O manual final usa a Versão do manual desta página. O que você escrever aqui só entra nele quando você voltar para o texto atual.":`The final manual uses this page's Manual version. What you write here only goes into it when you switch back to the current text.`,"O que a pessoa vê depois do passo":`What the person sees after the step`,"O que este marcador mostra?":`What does this marker show?`,"O que o marcador {n} mostra":`What marker {n} shows`,"Página: {titulo}":`Page: {titulo}`,Páginas:`Pages`,"Páginas do manual":`Manual pages`,"Páginas encontradas":`Pages found`,"Para baixo":`Down`,"Para cima":`Up`,"Para dentro da anterior":`Into the previous one`,"Para fora":`Out one level`,"Para imprimir ou mandar por e-mail.":`To print or send by email.`,"Parágrafo comum":`Plain paragraph`,"Passos numerados":`Numbered steps`,"Print da tela do sistema":`Screenshot of the system`,"Pronta para alguém conferir":`Ready for someone to check`,Publicado:`Published`,"Qual sistema você vai explicar?":`Which system are you going to explain?`,"Quem usa leitor de tela e a IA que lê o manual entendem a imagem por aqui.":`Screen reader users and the AI reading the manual understand the image through this.`,Rascunho:`Draft`,"Remover link":`Remove link`,"Remover tabela":`Remove table`,"Inserir linha acima":`Insert row above`,"Inserir linha abaixo":`Insert row below`,"Linha de cabeçalho":`Header row`,"Remover linha":`Remove row`,"Inserir coluna à esquerda":`Insert column to the left`,"Inserir coluna à direita":`Insert column to the right`,"Remover coluna":`Remove column`,"Opções da linha":`Row options`,"Opções da coluna":`Column options`,"Opções da tabela":`Table options`,"Adicionar coluna à direita":`Add column to the right`,"Adicionar linha abaixo":`Add row below`,Restaurar:`Restore`,"Restaurar esta":`Restore this one`,"Resultado esperado":`Expected result`,"Salvando…":`Saving…`,"Salvar marcações":`Save markups`,"Salvo às {hora}":`Saved at {hora}`,"Seção principal":`Main section`,Selecionar:`Select`,"sem nome":`unnamed`,"Sem título":`Untitled`,Seta:`Arrow`,"Seta {n}":`Arrow {n}`,Sistema:`System`,"Site (HTML)":`Website (HTML)`,"Só páginas aprovadas":`Approved pages only`,"Status da página: {status}":`Page status: {status}`,Subseção:`Subsection`,Tabela:`Table`,Tema:`Theme`,"Tentar de novo":`Try again`,"Esta página foi alterada fora do Studio depois que você a abriu. Recarregue do disco ou mantenha a sua versão.":`This page was changed outside Studio after you opened it. Reload it from disk or keep your version.`,"Esta página mudou fora do Studio.":`This page changed outside Studio.`,"Manter a minha versão grava o seu texto por cima do arquivo. Recarregar do disco descarta o que você escreveu aqui.":`Keep my version writes your text over the file. Reload from disk discards what you wrote here.`,"Recarregar do disco":`Reload from disk`,"Manter a minha versão":`Keep my version`,Texto:`Text`,"Texto da versão {nome}":`Text of version {nome}`,"Tipo de bloco: {tipo}":`Block type: {tipo}`,"Fonte do manual: {fonte}":`Manual font: {fonte}`,"Fonte do manual inteiro":`Font for the whole manual`,"Tipo de alerta: {tipo}":`Alert type: {tipo}`,Estrutura:`Structure`,"Passo a passo":`Step by step`,Alertas:`Alerts`,Mídia:`Media`,"Alerta: Dica":`Alert: Tip`,"Alerta: Atenção":`Alert: Warning`,"Alerta: Erro":`Alert: Error`,"Alerta: Nota":`Alert: Note`,"Um atalho ou um jeito melhor de fazer":`A shortcut or a better way to do it`,"Algo que exige cuidado":`Something that needs care`,"Um risco que não dá para desfazer":`A risk that cannot be undone`,"Uma informação a mais":`Extra information`,"Tirar do manual":`Remove from manual`,"Título {n}":`Heading {n}`,"Título da página":`Page title`,"Título vazio":`Empty heading`,"Tópico dentro da subseção":`Topic inside the subsection`,"Trecho em destaque ou observação":`Highlighted passage or note`,"Tudo salvo no disco":`All saved to disk`,"Um arquivo para publicar ou abrir no navegador.":`One file to publish or open in the browser.`,"Um arquivo só, com a legenda dos prints em texto.":`A single file, with screenshot legends as text.`,"Um passo por linha, na ordem de uso":`One step per line, in the order of use`,"Uma página por tela ou tarefa do sistema funciona bem. Comece pela que as pessoas mais usam.":`One page per screen or task works well. Start with the one people use most.`,"Usar no manual":`Use in manual`,"Usar o texto atual":`Use the current text`,"Use um endereço http, https ou mailto.":`Use an http, https or mailto address.`,Ver:`View`,"Versão do manual":`Manual version`,"Versão guardada.":`Version saved.`,'Versão restaurada. O texto que estava antes foi guardado como "Antes de restaurar".':`Version restored. The previous text was saved as "Before restoring".`,"Versão sem nome":`Unnamed version`,Versões:`Versions`,"Versões desta página":`Versions of this page`,"Virar subpágina ou subir um nível":`Make it a subpage or move up a level`,"Voltar à lista":`Back to the list`,"Cores do manual":`Manual colors`,"Logo do cliente":`Client logo`,"Aparece na capa e no topo do sumário do HTML e do PDF. PNG, JPG ou SVG, até 1 MB.":`Shown on the cover and at the top of the contents in the HTML and PDF. PNG, JPG or SVG, up to 1 MB.`,"O logo precisa estar na pasta assets/ do manual.":`The logo must be in the manual's assets/ folder.`,"O logo {logo} não está mais no manual. Envie o arquivo de novo.":`The logo {logo} is no longer in the manual. Upload the file again.`,"Enviar logo":`Upload logo`,"Trocar logo":`Replace logo`,"Tirar logo":`Remove logo`,"Logo do manual":`Manual logo`,"Não foi possível enviar o logo.":`Could not upload the logo.`,"O logo precisa ser PNG, JPG ou SVG. Escolha outro arquivo.":`The logo must be PNG, JPG or SVG. Pick another file.`,"O logo passa de {max} MB. Reduza o arquivo e envie de novo.":`The logo is over {max} MB. Shrink the file and upload it again.`,"Cor de realce":`Highlight color`,"Cor de destaque":`Accent color`,"Cor do texto":`Text color`,"Cor padrão":`Default color`,"Formatar seleção":`Format selection`,Azul:`Blue`,Cinza:`Gray`,Laranja:`Orange`,Roxo:`Purple`,Verde:`Green`,Vermelho:`Red`,Padrão:`Default`,"Título da capa":`Cover title`,"Título 1":`Heading 1`,"Título 2":`Heading 2`,"Título 3":`Heading 3`,"Use o formato #2b4fe0.":`Use the format #2b4fe0.`,"Não foi possível salvar a cor.":`Could not save the color.`,"código da cor":`color code`,"Links, números dos passos e marcações dos prints.":`Links, step numbers and markups on screenshots.`,"Capa, “Resultado:” e destaques nas imagens.":`Cover, “Result:” and highlights on images.`,"Texto, títulos e destaque precisam de contraste de 4,5:1 com o branco para a leitura ficar nítida.":`Text, headings and accent need a 4.5:1 contrast with white so reading stays clear.`,"Fonte do texto":`Text font`,"Fonte dos títulos":`Heading font`,padrão:`default`,"A conexão com o Studio voltou.":`The connection to the Studio is back.`,"Não foi possível abrir este manual":`Could not open this manual`,"Criar um manual novo":`Create a new manual`,"Abrir {nome}":`Open {nome}`,"Abrir a primeira página":`Open the first page`,"Abrindo o Studio…":`Opening the Studio…`,"Não foi possível abrir o Studio":`Could not open the Studio`,"O Studio encontrou um erro que não esperava. O texto que já foi salvo continua no disco. Recarregue para continuar; se o erro voltar, copie o código abaixo e conte para quem mantém o projeto.":`The Studio hit an error it did not expect. Text that was already saved is still on disk. Reload to continue; if the error comes back, copy the code below and tell whoever maintains the project.`,"Tentar de novo sem recarregar":`Try again without reloading`,"Recarregar o Studio":`Reload the Studio`,"Algo quebrou *nesta tela*":`Something broke *on this screen*`,"O link pode estar antigo, ou a página foi excluída ou movida para outro lugar do manual.":`The link may be old, or the page was deleted or moved somewhere else in the manual.`,"O link pode estar antigo, ou o manual foi renomeado, movido ou apagado da pasta.":`The link may be old, or the manual was renamed, moved or deleted from the folder.`,"Não achamos *esta página*":`We could not find *this page*`,"Não achamos *este manual*":`We could not find *this manual*`,"O que você escreveu continua nesta tela e será salvo quando o servidor voltar.":`What you wrote is still on this screen and will be saved when the server is back.`,"Sem conexão com o Studio.":`No connection to the Studio.`,"O servidor do Studio foi fechado ou está reiniciando. Quando ele voltar, esta tela abre o Studio sozinha. Se você usa o terminal, confira se o comando explicai ainda está rodando.":`The Studio server was closed or is restarting. When it is back, this screen opens the Studio by itself. If you use the terminal, check that the explicai command is still running.`,"Tentamos de novo sozinhos. Tentativas até agora: {n}.":`We keep trying on our own. Attempts so far: {n}.`,"Tentando de novo…":`Trying again…`,"Tentar agora":`Try now`,"O Studio *não está respondendo*":`The Studio *is not responding*`,"Código copiado.":`Code copied.`,"Copiar código":`Copy code`,Copiado:`Copied`,"Não foi possível falar com o Studio. Ele pode ter sido fechado ou estar reiniciando.":`Could not reach the Studio. It may have been closed or may be restarting.`,"O Studio só aceita pedidos deste computador. Abra-o por localhost ou 127.0.0.1.":`The Studio only accepts requests from this computer. Open it through localhost or 127.0.0.1.`,"O endereço pedido tem um % malformado. Confira o endereço e tente de novo.":`The requested address has a malformed %. Check the address and try again.`,"O Studio recebeu um texto que não está em UTF-8. Salve o conteúdo em UTF-8 e envie de novo.":`The Studio received text that is not UTF-8. Save the content as UTF-8 and send it again.`,"Para gerar o PDF, o Explicaí usa o Chrome, o Edge ou o Chromium da sua máquina, e nenhum foi encontrado. Instale um deles ou informe o caminho na variável EXPLICAI_BROWSER.":`To make the PDF, Explicaí uses Chrome, Edge or Chromium on your computer, and none was found. Install one of them or set its path in the EXPLICAI_BROWSER variable.`,"O Studio só abre *neste computador*":`The Studio only opens *on this computer*`,"O servidor *não conseguiu responder*":`The server *could not respond*`,"Se continuar, feche o comando explicai no terminal e rode de novo.":`If it keeps happening, stop the explicai command in the terminal and run it again.`},rf=`explicai:idioma`;function af(){if(typeof window>`u`)return`pt-BR`;try{let e=localStorage.getItem(rf);if(e===`pt-BR`||e===`en`)return e}catch{}return navigator.language.toLowerCase().startsWith(`pt`)?`pt-BR`:`en`}var of=af(),sf=of===`en`?`en-US`:`pt-BR`;function cf(e){try{localStorage.setItem(rf,e)}catch{}window.location.reload()}function U(e,t){let n=of===`en`?nf[e]??e:e;return t?n.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??``)):n}function lf(e,t,n,r){return U(e===1?t:n,{n:e,...r})}function uf({code:e}){let[t,n]=(0,_.useState)(!1);return(0,R.jsxs)(`div`,{className:`mt-2 flex max-w-full items-center gap-1 rounded-[3px] border border-dashed border-border py-0.5 pr-1 pl-3 text-xs text-muted-foreground`,children:[(0,R.jsx)(`code`,{className:`min-w-0 py-1.5 font-mono break-words`,children:e}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>n(!0))},className:`[@media(pointer:coarse)]:min-h-11 shrink-0 rounded-md px-2 py-1.5 font-bold text-primary underline-offset-2 hover:underline`,children:U(t?`Copiado`:`Copiar código`)}),(0,R.jsx)(`span`,{role:`status`,className:`sr-only`,children:t?U(`Código copiado.`):``})]})}var df=class extends Error{code;params;status;constructor(e,t,n={},r=0){super(e),this.code=t,this.params=n,this.status=r}},ff=e=>e instanceof df&&e.code===`offline`,pf=[502,503,504];async function mf(e,t){let n;try{n=await fetch(e,t)}catch{throw new df(`Servidor fora.`,`offline`)}let r=await n.json().catch(()=>({}));if(!n.ok){let{error:e,code:t,params:i}=r;throw!t&&pf.includes(n.status)?new df(`Servidor fora.`,`offline`,{},n.status):new df(e??U(`Erro {status}`,{status:n.status}),t,i,n.status)}return r}var hf=(e,t)=>({method:e,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),gf=e=>`/api/manuals/${encodeURIComponent(e)}`,_f=(e,t)=>`${gf(e)}/pages/${encodeURIComponent(t)}`,vf={listManuals:()=>mf(`/api/manuals`),createManual:(e,t)=>mf(`/api/manuals`,hf(`POST`,{title:e,language:t})),getManual:e=>mf(gf(e)),addPage:(e,t,n)=>mf(`${gf(e)}/pages`,hf(`POST`,{title:t,parentId:n})),getPage:(e,t)=>mf(_f(e,t)),updatePage:(e,t,n,r)=>{let i=hf(`PUT`,n);return mf(_f(e,t),r?{...i,headers:{...i.headers,"if-match":r}}:i)},removePage:(e,t)=>mf(_f(e,t),{method:`DELETE`}),listTrash:e=>mf(`${gf(e)}/trash`),restorePage:(e,t)=>mf(`${gf(e)}/trash/${encodeURIComponent(t)}/restore`,{method:`POST`}),movePage:(e,t,n,r)=>mf(`${_f(e,t)}/move`,hf(`POST`,{parentId:n,index:r})),listVersions:(e,t)=>mf(`${_f(e,t)}/versions`),getVersion:(e,t,n)=>mf(`${_f(e,t)}/versions/${encodeURIComponent(n)}`),saveVersion:(e,t,n)=>mf(`${_f(e,t)}/versions`,hf(`POST`,{note:n})),restoreVersion:(e,t,n)=>mf(`${_f(e,t)}/versions/${encodeURIComponent(n)}/restore`,{method:`POST`}),publishVersion:(e,t,n)=>mf(`${_f(e,t)}/published`,hf(`PUT`,{versionId:n})),listFonts:()=>mf(`/api/fonts`),exportManual:(e,t,n)=>mf(`${gf(e)}/export`,hf(`POST`,{format:t,onlyApproved:n})),setTheme:(e,t)=>mf(`${gf(e)}/theme`,hf(`PUT`,t)),uploadLogo:(e,t)=>mf(`${gf(e)}/logo?name=${encodeURIComponent(t.name||`logo.png`)}`,{method:`POST`,body:t}),getAnnotations:(e,t)=>mf(`${gf(e)}/annotations?asset=${encodeURIComponent(t)}`),saveAnnotations:(e,t,n)=>mf(`${gf(e)}/annotations?asset=${encodeURIComponent(t)}`,hf(`PUT`,n)),inGitRepo:e=>mf(`${gf(e)}/git`),redactAsset:(e,t,n)=>mf(`${gf(e)}/assets/redact?asset=${encodeURIComponent(t)}`,{method:`POST`,body:n}),cleanUnusedAssets:e=>mf(`${gf(e)}/assets/clean`,{method:`POST`}),uploadAsset:(e,t)=>mf(`${gf(e)}/assets?name=${encodeURIComponent(t.name||`imagem.png`)}`,{method:`POST`,body:t})},yf=e=>Number(e).toLocaleString(sf,{minimumFractionDigits:1,maximumFractionDigits:1}),bf=()=>U(`O Studio só aceita pedidos deste computador. Abra-o por localhost ou 127.0.0.1.`),xf={offline:()=>U(`Não foi possível falar com o Studio. Ele pode ter sido fechado ou estar reiniciando.`),"forbidden-host":bf,"forbidden-origin":bf,"invalid-utf8":()=>U(`O Studio recebeu um texto que não está em UTF-8. Salve o conteúdo em UTF-8 e envie de novo.`),"malformed-url":()=>U(`O endereço pedido tem um % malformado. Confira o endereço e tente de novo.`),"annotations-invalid":e=>U(`As marcações de {file} estão com erro de sintaxe. Corrija ou apague o arquivo.`,{file:String(e.file)}),"disk-conflict":()=>U(`Esta página foi alterada fora do Studio depois que você a abriu. Recarregue do disco ou mantenha a sua versão.`),"no-browser":()=>U(`Para gerar o PDF, o Explicaí usa o Chrome, o Edge ou o Chromium da sua máquina, e nenhum foi encontrado. Instale um deles ou informe o caminho na variável EXPLICAI_BROWSER.`),"no-approved-pages":()=>U(`Nenhuma página está aprovada ou publicada. Aprove uma página ou exporte todas.`),"logo-type":()=>U(`O logo precisa ser PNG, JPG ou SVG. Escolha outro arquivo.`),"logo-path":()=>U(`O logo precisa estar na pasta assets/ do manual.`),"logo-missing":e=>U(`O logo {logo} não está mais no manual. Envie o arquivo de novo.`,{logo:String(e.logo)}),"logo-size":e=>U(`O logo passa de {max} MB. Reduza o arquivo e envie de novo.`,{max:String(e.max)}),"low-contrast":e=>U(`A cor de {label} tem contraste {ratio}:1 com o branco; o mínimo é {min}:1. Escolha uma cor mais escura.`,{label:U(String(e.label)),ratio:yf(e.ratio),min:yf(e.min)}),"low-contrast-highlight":e=>U(`O texto sobre o realce tem contraste {ratio}:1; o mínimo é {min}:1. Escolha um realce mais claro.`,{ratio:yf(e.ratio),min:yf(e.min)})};function W(e,t=U(`Algo deu errado.`)){return e instanceof df&&e.code?xf[e.code]?.(e.params)??e.message:e instanceof Error?e.message:t}function Sf(e){return e.split(/\*([^*]+)\*/).map((e,t)=>({text:e,mark:t%2==1})).filter(e=>e.text)}var Cf=e=>e.replaceAll(`*`,``);function wf(e){return ff(e)?`offline`:e instanceof df&&e.code?.startsWith(`forbidden`)?`forbidden`:`server`}function Tf(e){return ff(e)&&e instanceof df?e.status?`HTTP ${e.status}`:`fetch failed`:e instanceof df&&e.status?[`HTTP ${e.status}`,e.code].filter(Boolean).join(` `):e instanceof Error?`${e.name}: ${e.message}`:String(e)}function Ef({title:e,children:t,action:n,secondary:r,technical:i,status:a,standalone:o=!0}){let s=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(s.current?.focus(),!o)return;let t=document.title;return document.title=`${Cf(e)} · Explicaí Studio`,()=>{document.title=t}},[o,e]),(0,R.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[o&&(0,R.jsx)(`header`,{className:`mx-auto w-full max-w-5xl px-5 py-5 sm:px-9`,children:(0,R.jsx)(tf,{})}),(0,R.jsx)(`div`,{role:`alert`,className:`mx-auto my-auto grid w-full max-w-5xl px-6 py-12 sm:px-10 [@media(max-height:600px)]:py-6`,children:(0,R.jsxs)(`div`,{className:`grid max-w-2xl justify-items-start gap-5`,children:[(0,R.jsx)(`h1`,{ref:s,tabIndex:-1,className:`font-display text-4xl leading-[1.08] font-extrabold tracking-tight [font-stretch:108%] text-balance outline-none sm:text-5xl`,children:Sf(e).map(e=>e.mark?(0,R.jsx)(`mark`,{className:`-mx-1 rounded-[2px] bg-marca-faixa px-1 text-inherit [box-decoration-break:clone]`,children:e.text},e.text):e.text)}),(0,R.jsx)(`p`,{className:`max-w-prose text-lg text-pretty text-muted-foreground`,children:t}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 pt-1`,children:[(0,R.jsx)($d,{size:`lg`,className:`[@media(pointer:coarse)]:min-h-11`,onClick:n.onClick,children:n.label}),r&&(0,R.jsx)(`button`,{type:`button`,onClick:r.onClick,className:`[@media(pointer:coarse)]:min-h-11 rounded-md px-1 font-bold text-primary underline-offset-4 hover:underline`,children:r.label})]}),a&&(0,R.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full bg-primary motion-safe:animate-pulse`}),a]}),(0,R.jsx)(uf,{code:i})]})})]})}function Df({error:e,onRetry:t,standalone:n=!1}){return(0,R.jsx)(Ef,{standalone:n,title:U(`Algo quebrou *nesta tela*`),action:{label:U(`Recarregar o Studio`),onClick:()=>window.location.reload()},secondary:t&&{label:U(`Tentar de novo sem recarregar`),onClick:t},technical:`${e.name}: ${e.message}`,children:U(`O Studio encontrou um erro que não esperava. O texto que já foi salvo continua no disco. Recarregue para continuar; se o erro voltar, copie o código abaixo e conte para quem mantém o projeto.`)})}var Of=class extends _.Component{state={error:null,key:this.props.resetKey};static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return e.resetKey===t.key?null:{error:null,key:e.resetKey}}componentDidCatch(e,t){console.error(e,t.componentStack)}render(){let{error:e}=this.state;return e?(0,R.jsx)(Df,{error:e,standalone:this.props.root,onRetry:this.props.root?void 0:()=>this.setState({error:null})}):this.props.children}},kf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Af(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:kf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var jf=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Mf=e=>{let t=jf(e);return t.charAt(0).toUpperCase()+t.slice(1)},Nf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Pf={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Ff(e){return e!=null}function If(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Pf.width,a=e.size??e.height??Pf.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Nf(...c):Nf(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Pf[`stroke-width`])*Number(e.size??e.width??Pf.width)/Number(t.size??t.width??Pf.width):t.strokeWidth??Pf[`stroke-width`];return[`svg`,{...Object.entries(Pf).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Ff(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Ff(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Ff(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Lf(e,t={}){return If(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Rf=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},zf=(0,_.createContext)({}),Bf=()=>(0,_.useContext)(zf),Vf=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=Bf()??{},b=!!c||Rf(d),[x,S,C=[]]=Lf(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Nf(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function G(e,t=[],n=[]){let r=typeof e==`string`?Af(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(Vf,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Mf(r.name)),i}var Hf={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Hf.node;var Uf=G(Hf),Wf={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Wf.node;var Gf=G(Wf),Kf={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};Kf.node;var qf=G(Kf),Jf={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Jf.node;var Yf=G(Jf),Xf={name:`between-horizontal-end`,size:24,node:[[`rect`,{width:`13`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`11xb64`}],[`path`,{d:`m22 15-3-3 3-3`,key:`26chmm`}],[`rect`,{width:`13`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`k6ky7n`}]],aliases:[`between-horizonal-end`]};Xf.node;var Zf=G(Xf),Qf={name:`between-vertical-end`,size:24,node:[[`rect`,{width:`7`,height:`13`,x:`3`,y:`3`,rx:`1`,key:`1fdu0f`}],[`path`,{d:`m9 22 3-3 3 3`,key:`17z65a`}],[`rect`,{width:`7`,height:`13`,x:`14`,y:`3`,rx:`1`,key:`1squn4`}]]};Qf.node;var $f=G(Qf),ep={name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]};ep.node;var tp=G(ep),np={name:`book-check`,size:24,node:[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`m9 9.5 2 2 4-4`,key:`1dth82`}]]};np.node;var rp=G(np),ip={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};ip.node;var ap=G(ip),op={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};op.node;var sp=G(op),cp={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};cp.node;var lp=G(cp),up={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};up.node;var dp=G(up),fp={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};fp.node;var pp=G(fp),mp={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};mp.node;var hp=G(mp),gp={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};gp.node;var _p=G(gp),vp={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};vp.node;var yp=G(vp),bp={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};bp.node;var xp=G(bp),Sp={name:`crop`,size:24,node:[[`path`,{d:`M6 2v14a2 2 0 0 0 2 2h14`,key:`ron5a4`}],[`path`,{d:`M18 22V8a2 2 0 0 0-2-2H2`,key:`7s9ehn`}]]};Sp.node;var Cp=G(Sp),wp={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};wp.node;var Tp=G(wp),Ep={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Ep.node;var Dp=G(Ep),Op={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Op.node;var kp=G(Op),Ap={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ap.node;var jp=G(Ap),Mp={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Mp.node;var Np=G(Mp),Pp={name:`grip-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`9`,r:`1`,key:`124mty`}],[`circle`,{cx:`19`,cy:`9`,r:`1`,key:`1ruzo2`}],[`circle`,{cx:`5`,cy:`9`,r:`1`,key:`1a8b28`}],[`circle`,{cx:`12`,cy:`15`,r:`1`,key:`1e56xg`}],[`circle`,{cx:`19`,cy:`15`,r:`1`,key:`1a92ep`}],[`circle`,{cx:`5`,cy:`15`,r:`1`,key:`5r1jwy`}]]};Pp.node;var Fp=G(Pp),Ip={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};Ip.node;var Lp=G(Ip),Rp={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Rp.node;var zp=G(Rp),Bp={name:`heading-1`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]};Bp.node;var Vp=G(Bp),Hp={name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]};Hp.node;var Up=G(Hp),Wp={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]};Wp.node;var Gp=G(Wp),Kp={name:`highlighter`,size:24,node:[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]};Kp.node;var qp=G(Kp),Jp={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};Jp.node;var Yp=G(Jp),Xp={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Xp.node;var Zp=G(Xp),Qp={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Qp.node;var $p=G(Qp),em={name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]};em.node;var tm=G(em),nm={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};nm.node;var rm=G(nm),im={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};im.node;var am=G(im),om={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};om.node;var sm=G(om),cm={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};cm.node;var lm=G(cm),um={name:`list-indent-decrease`,size:24,node:[[`path`,{d:`M21 5H11`,key:`us1j55`}],[`path`,{d:`M21 12H11`,key:`wd7e0v`}],[`path`,{d:`M21 19H11`,key:`saa85w`}],[`path`,{d:`m7 8-4 4 4 4`,key:`o5hrat`}]],aliases:[`outdent`,`indent-decrease`]};um.node;var dm=G(um),fm={name:`list-indent-increase`,size:24,node:[[`path`,{d:`M21 5H11`,key:`us1j55`}],[`path`,{d:`M21 12H11`,key:`wd7e0v`}],[`path`,{d:`M21 19H11`,key:`saa85w`}],[`path`,{d:`m3 8 4 4-4 4`,key:`1a3j6y`}]],aliases:[`indent`,`indent-increase`]};fm.node;var pm=G(fm),mm={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};mm.node;var hm=G(mm),gm={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};gm.node;var _m=G(gm),vm={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};vm.node;var ym=G(vm),bm={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};bm.node;var xm=G(bm),Sm={name:`monitor`,size:24,node:[[`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`}]]};Sm.node;var Cm=G(Sm),wm={name:`moon`,size:24,node:[[`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`}]]};wm.node;var Tm=G(wm),Em={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};Em.node;var Dm=G(Em),Om={name:`move`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]};Om.node;var km=G(Om),Am={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};Am.node;var jm=G(Am),Mm={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};Mm.node;var Nm=G(Mm),Pm={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};Pm.node;var Fm=G(Pm),Im={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};Im.node;var Lm=G(Im),Rm={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]};Rm.node;var zm=G(Rm),Bm={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Bm.node;var Vm=G(Bm),Hm={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};Hm.node;var Um=G(Hm),Wm={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Wm.node;var Gm=G(Wm),Km={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Km.node;var qm=G(Km),Jm={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Jm.node;var Ym=G(Jm),Xm={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Xm.node;var Zm=G(Xm),Qm={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};Qm.node;var $m=G(Qm),eh={name:`sun`,size:24,node:[[`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`}]]};eh.node;var th=G(eh),nh={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};nh.node;var rh=G(nh),ih={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};ih.node;var ah=G(ih),oh={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};oh.node;var sh=G(oh),ch={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};ch.node;var lh=G(ch),uh={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};uh.node;var dh=G(uh),fh={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};fh.node;var ph=G(fh),mh={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};mh.node;var hh=G(mh);function gh(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var _h=e=>{switch(e){case`success`:return bh;case`info`:return Sh;case`warning`:return xh;case`error`:return Ch;default:return null}},vh=Array(12).fill(0),yh=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},vh.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),bh=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),xh=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Sh=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ch=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),wh=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Th=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Eh=1,Dh=100,Oh=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Eh++,kh=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Dh;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Oh(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(jh(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Oh(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Ah=(e,t)=>kh.message(e,t),jh=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Mh=Object.assign(Ah,{success:kh.success,info:kh.info,warning:kh.warning,error:kh.error,custom:kh.custom,message:kh.message,promise:kh.promise,dismiss:kh.dismiss,loading:kh.loading},{getHistory:()=>kh.toasts,getToasts:()=>kh.getActiveToasts()});gh(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Nh(e){return e.label!==void 0}var Ph=3,Fh=`24px`,Ih=`16px`,Lh=4e3,Rh=356,zh=14,Bh=45,Vh=200;function Hh(...e){return e.filter(Boolean).join(` `)}function Uh(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Wh=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,ee]=_.useState(null),[te,O]=_.useState(null),[k,A]=_.useState(!1),[ne,re]=_.useState(!1),[j,M]=_.useState(!1),[ie,ae]=_.useState(!1),[oe,se]=_.useState(!1),[ce,le]=_.useState(0),[ue,de]=_.useState(0),fe=_.useRef(n.duration||b||Lh),pe=_.useRef(null),me=_.useRef(null),he=c===0,ge=c+1<=o,_e=n.type,N=_e??`default`,ve=n.dismissible!==!1,ye=n.className||``,be=n.descriptionClassName||``,xe=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),Se=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Ce=_.useMemo(()=>n.duration||b||Lh,[n.duration,b]),we=_.useRef(0),Te=_.useRef(0),Ee=_.useRef(0),De=_.useRef(null),[Oe,ke]=x.split(`-`),Ae=_.useMemo(()=>s.reduce((e,t,n)=>n>=xe?e:e+t.height,0),[s,xe]),je=Th(),Me=_.useMemo(()=>e.swipeDirections??Uh(x),[e.swipeDirections,x]),P=n.invert||t,Ne=_e===`loading`;Te.current=_.useMemo(()=>xe*S+Ae,[xe,Ae]),_.useEffect(()=>{fe.current=Ce},[Ce]),_.useEffect(()=>{A(!0)},[]),_.useEffect(()=>{let e=me.current;if(e){let t=e.getBoundingClientRect().height;return de(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!k)return;let e=me.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,de(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Pe=_.useCallback(()=>{re(!0),le(Te.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Vh)},[n,d,a,Te]);_.useEffect(()=>{if(n.promise&&_e===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||je?(()=>{if(Ee.current<we.current){let e=new Date().getTime()-we.current;fe.current-=e}Ee.current=new Date().getTime()})():fe.current!==1/0&&(we.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Pe()},fe.current)),()=>clearTimeout(e)},[u,i,n,_e,je,Pe]),_.useEffect(()=>{n.delete&&(Pe(),n.onDismiss==null||n.onDismiss.call(n,n))},[Pe,n.delete]);function Fe(){return T?.loading?_.createElement(`div`,{className:Hh(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":_e===`loading`},T.loading):_.createElement(yh,{className:Hh(w?.loader,n?.classNames?.loader),visible:_e===`loading`})}let Ie=n.icon||T?.[_e]||_h(_e);return _.createElement(`li`,{tabIndex:0,ref:me,className:Hh(v,ye,w?.toast,n?.classNames?.toast,w?.[N],n?.classNames?.[N]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":oe,"data-removed":ne,"data-visible":ge,"data-y-position":Oe,"data-x-position":ke,"data-index":c,"data-front":he,"data-swiping":j,"data-dismissible":ve,"data-type":_e,"data-invert":P,"data-swipe-out":ie,"data-swipe-direction":te,"data-expanded":!!(u||C&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${ne?ce:Te.current}px`,"--initial-height":C?`auto`:`${ue}px`,...m,...n.style},onDragEnd:()=>{M(!1),ee(null),De.current=null},onPointerDown:e=>{e.button!==2&&!Ne&&ve&&(pe.current=new Date,le(Te.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(M(!0),De.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(ie||!ve)return;De.current=null;let e=Number(me.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(me.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-pe.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Me.includes(e>0?`right`:`left`):Me.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Bh||a>.11))le(Te.current),n.onDismiss==null||n.onDismiss.call(n,n),O(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Pe(),ae(!0);else{var o,s;(o=me.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=me.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),se(!1),M(!1),ee(null)}},onPointerMove:e=>{var t,n;if(!De.current||!ve||window.getSelection()?.toString().length>0)return;let r=e.clientY-De.current.y,i=e.clientX-De.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&ee(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Me.includes(`top`)||Me.includes(`bottom`)){if(Me.includes(`top`)&&r<0||Me.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Me.includes(`left`)||Me.includes(`right`))){if(Me.includes(`left`)&&i<0||Me.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&se(!0),(t=me.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=me.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},Se&&!n.jsx&&_e!==`loading`?_.createElement(`button`,{"aria-label":E,"data-disabled":Ne,"data-close-button":!0,onClick:Ne||!ve?()=>{}:()=>{Pe(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Hh(w?.closeButton,n?.classNames?.closeButton)},T?.close??wh):null,(_e||n.icon||n.promise)&&n.icon!==null&&(T?.[_e]!==null||n.icon)?_.createElement(`div`,{"data-icon":``,className:Hh(w?.icon,n?.classNames?.icon)},_e===`loading`?n.icon||Fe():n.promise?Fe():null,_e===`loading`?null:Ie):null,_.createElement(`div`,{"data-content":``,className:Hh(w?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:Hh(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:Hh(y,be,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&Nh(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Nh(n.cancel)&&ve&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Pe())},className:Hh(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&Nh(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Nh(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Pe())},className:Hh(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Gh(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Kh(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ih:Fh;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var qh=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Ph,toastOptions:g,dir:v=Gh(),gap:y=zh,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=_.useState([]),T=_.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=_.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,ee]=_.useState([]),[te,O]=_.useState(!1),[k,A]=_.useState(!1),[ne,re]=_.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),j=_.useRef(null),M=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ie=_.useRef(null),ae=_.useRef(!1),oe=_.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||kh.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>kh.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Bt.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),_.useEffect(()=>{if(d!==`system`){re(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?re(`dark`):re(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{re(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{re(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),_.useEffect(()=>{C.length<=1&&O(!1)},[C]),_.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=j.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===j.current||j.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),_.useEffect(()=>{if(j.current)return()=>{ie.current&&(ie.current.focus({preventScroll:!0}),ie.current=null,ae.current=!1)}},[j.current]),_.createElement(`section`,{ref:t,"aria-label":x??`${S} ${M}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?_.createElement(`ol`,{key:t,dir:v===`auto`?Gh():v,tabIndex:-1,ref:j,className:c,"data-sonner-toaster":!0,"data-sonner-theme":ne,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${Rh}px`,"--gap":`${y}px`,...m,...Kh(l,u)},onBlur:e=>{ae.current&&!e.currentTarget.contains(e.relatedTarget)&&(ae.current=!1,ie.current&&=(ie.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ae.current||(ae.current=!0,ie.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Wh,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:oe,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:ee,expandByDefault:o,gap:y,expanded:te,swipeDirections:e.swipeDirections}))):null}))}),Jh=({...e})=>(0,R.jsx)(qh,{theme:`system`,className:`toaster group`,icons:{success:(0,R.jsx)(hp,{className:`size-4`}),info:(0,R.jsx)($p,{className:`size-4`}),warning:(0,R.jsx)(sh,{className:`size-4`}),error:(0,R.jsx)(jm,{className:`size-4`}),loading:(0,R.jsx)(xm,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},...e});function Yh({delayDuration:e=0,...t}){return(0,R.jsx)(Od,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Xh({...e}){return(0,R.jsx)(Md,{"data-slot":`tooltip`,...e})}function Zh({...e}){return(0,R.jsx)(Pd,{"data-slot":`tooltip-trigger`,...e})}function Qh({className:e,sideOffset:t=0,children:n,...r}){return(0,R.jsx)(Rd,{children:(0,R.jsxs)(Bd,{"data-slot":`tooltip-content`,sideOffset:t,className:L(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 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`,e),...r,children:[n,(0,R.jsx)(Wd,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 bg-foreground fill-foreground`})]})})}function $h({checking:e,onRetry:t}){return(0,R.jsxs)(`div`,{role:`alert`,className:`sticky top-0 z-20 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-destructive/50 bg-[color-mix(in_oklab,var(--destructive)_10%,var(--background))] px-4 py-1 text-sm`,children:[(0,R.jsx)(ph,{className:`size-4 shrink-0 text-destructive`,"aria-hidden":!0}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1 basis-64`,children:[(0,R.jsx)(`strong`,{children:U(`Sem conexão com o Studio.`)}),` `,U(`O que você escreveu continua nesta tela e será salvo quando o servidor voltar.`)]}),(0,R.jsx)(`button`,{type:`button`,onClick:t,disabled:e,className:`[@media(pointer:coarse)]:min-h-11 rounded-md px-2 font-bold text-primary underline-offset-2 hover:underline disabled:opacity-60`,children:U(e?`Tentando de novo…`:`Tentar agora`)})]})}var eg=`min-h-8 rounded-sm border border-border bg-background px-3 text-sm font-bold hover:bg-muted [@media(pointer:coarse)]:min-h-11`;function tg({onReload:e,onKeep:t}){return(0,R.jsxs)(`div`,{role:`alert`,className:`sticky top-0 z-20 flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 border-b border-destructive/50 bg-background px-4 py-2 text-sm`,children:[(0,R.jsx)(sh,{className:`size-4 shrink-0 text-destructive`,"aria-hidden":!0}),(0,R.jsxs)(`p`,{className:`min-w-0 flex-1 basis-72`,children:[(0,R.jsx)(`strong`,{children:U(`Esta página mudou fora do Studio.`)}),` `,U(`Manter a minha versão grava o seu texto por cima do arquivo. Recarregar do disco descarta o que você escreveu aqui.`)]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:t,className:eg,children:U(`Manter a minha versão`)}),(0,R.jsx)(`button`,{type:`button`,onClick:e,className:eg,children:U(`Recarregar do disco`)})]})]})}function ng({kind:e,address:t,action:n,secondary:r}){return(0,R.jsx)(Ef,{title:U(e===`manual`?`Não achamos *este manual*`:`Não achamos *esta página*`),action:n,secondary:r,technical:`404 ${t}`,children:U(e===`manual`?`O link pode estar antigo, ou o manual foi renomeado, movido ou apagado da pasta.`:`O link pode estar antigo, ou a página foi excluída ou movida para outro lugar do manual.`)})}function rg({error:e,onRetry:t}){let n=wf(e)===`forbidden`;return(0,R.jsx)(Ef,{title:U(n?`O Studio só abre *neste computador*`:`O servidor *não conseguiu responder*`),action:{label:U(`Tentar de novo`),onClick:t},technical:Tf(e),children:n?U(`O Studio só aceita pedidos deste computador. Abra-o por localhost ou 127.0.0.1.`):`${W(e,U(`Algo deu errado.`))} ${U(`Se continuar, feche o comando explicai no terminal e rode de novo.`)}`})}function ig({attempt:e,checking:t,onRetry:n,code:r}){return(0,R.jsx)(Ef,{title:U(`O Studio *não está respondendo*`),action:{label:U(`Tentar agora`),onClick:n},technical:r,status:t?U(`Tentando de novo…`):U(`Tentamos de novo sozinhos. Tentativas até agora: {n}.`,{n:e}),children:U(`O servidor do Studio foi fechado ou está reiniciando. Quando ele voltar, esta tela abre o Studio sozinha. Se você usa o terminal, confira se o comando explicai ainda está rodando.`)})}function ag({className:e,type:t,...n}){return(0,R.jsx)(`input`,{type:t,"data-slot":`input`,className:L(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none 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 placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}function og({firstRun:e,onCreate:t,onCancel:n}){let[r,i]=(0,_.useState)(``),a=r.trim();return(0,R.jsxs)(`form`,{className:`mx-auto mt-[16vh] grid max-w-lg gap-5 px-6`,onSubmit:e=>{e.preventDefault(),a&&t(a)},children:[(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(`h1`,{className:`font-display text-3xl font-extrabold tracking-tight [font-stretch:108%] text-balance`,children:U(e?`Qual sistema você vai explicar?`:`Novo manual`)}),(0,R.jsx)(`p`,{className:`text-muted-foreground`,children:U(`Cada manual vira uma pasta com uma página em Markdown para cada tela ou tarefa. Dá para versionar no git junto com o código.`)})]}),(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(`label`,{htmlFor:`new-manual-title`,className:`text-sm font-bold`,children:U(`Nome do manual`)}),(0,R.jsx)(ag,{id:`new-manual-title`,autoFocus:!0,value:r,onChange:e=>i(e.target.value),placeholder:U(`Ex.: Manual do Financeiro`),className:`h-10 bg-card text-base`})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)($d,{type:`submit`,disabled:!a,children:U(`Criar manual`)}),!e&&(0,R.jsx)($d,{type:`button`,variant:`ghost`,onClick:n,children:U(`Cancelar`)})]})]})}function sg({...e}){return(0,R.jsx)(va,{"data-slot":`dialog`,...e})}function cg({...e}){return(0,R.jsx)(ba,{"data-slot":`dialog-trigger`,...e})}function lg({...e}){return(0,R.jsx)(wa,{"data-slot":`dialog-portal`,...e})}function ug({className:e,...t}){return(0,R.jsx)(Ea,{"data-slot":`dialog-overlay`,className:L(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function dg({className:e,children:t,showCloseButton:n=!0,...r}){return(0,R.jsxs)(lg,{"data-slot":`dialog-portal`,children:[(0,R.jsx)(ug,{}),(0,R.jsxs)(Aa,{"data-slot":`dialog-content`,className:L(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none 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 sm:max-w-lg`,e),...r,children:[t,n&&(0,R.jsxs)(La,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,R.jsx)(hh,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:U(`Fechar`)})]})]})]})}function fg({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`dialog-header`,className:L(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function pg({className:e,showCloseButton:t=!1,children:n,...r}){return(0,R.jsxs)(`div`,{"data-slot":`dialog-footer`,className:L(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,R.jsx)(La,{asChild:!0,children:(0,R.jsx)($d,{variant:`outline`,children:`Close`})})]})}function mg({className:e,...t}){return(0,R.jsx)(Pa,{"data-slot":`dialog-title`,className:L(`text-lg leading-none font-semibold`,e),...t})}function hg({className:e,...t}){return(0,R.jsx)(Fa,{"data-slot":`dialog-description`,className:L(`text-sm text-muted-foreground`,e),...t})}function gg(e){return e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase().trim()}function _g(e){try{return decodeURIComponent(e)}catch{return e}}function vg(){let[e,t]=window.location.hash.replace(/^#\/?/,``).split(`/`).map(_g);return{slug:e||null,pageId:t||null}}function yg({slug:e,pageId:t}){let n=e?`#/${encodeURIComponent(e)}${t?`/${encodeURIComponent(t)}`:``}`:`#/`;window.location.hash!==n&&window.history.replaceState(null,``,n)}function bg(e,t){for(let n of e){if(n.id===t)return n;let e=bg(n.children,t);if(e)return e}return null}function xg(e,t,n=null){for(let r of e){if(r.id===t)return{parentId:n,siblings:e};let i=xg(r.children,t,r.id);if(i)return i}return null}function Sg(e,t,n){let r=bg(e,t);return r?bg(r.children,n)!==null:!1}function Cg(e,t,n){return e.map(e=>e.id===t?{...e,title:n}:{...e,children:Cg(e.children,t,n)})}function wg(e,t,n,r){if(t===n||Sg(e,t,n))return null;if(r===`inside`)return{parentId:n,index:2**53-1};let i=xg(e,n);if(!i)return null;let a=i.siblings.filter(e=>e.id!==t).findIndex(e=>e.id===n);return{parentId:i.parentId,index:r===`before`?a:a+1}}function Tg(e,t,n){let r=xg(e,t);if(!r)return null;let i=r.siblings.findIndex(e=>e.id===t);switch(n){case`up`:return i>0?{parentId:r.parentId,index:i-1}:null;case`down`:return i<r.siblings.length-1?{parentId:r.parentId,index:i+1}:null;case`indent`:{let e=r.siblings[i-1];return e?{parentId:e.id,index:2**53-1}:null}case`outdent`:{if(!r.parentId)return null;let t=xg(e,r.parentId);if(!t)return null;let n=t.siblings.findIndex(e=>e.id===r.parentId);return{parentId:t.parentId,index:n+1}}}}function Eg(e,t){for(let n of e){if(n.id===t)return[];let e=Eg(n.children,t);if(e.length>0||bg(n.children,t))return[n,...e]}return[]}function Dg(e){return e.flatMap(e=>[e,...Dg(e.children)])}function Og(e){let t=new Map,n=(e,r,i)=>{for(let a of e){if(a.problem){n(a.children,r,i);continue}i.n+=1;let e=r?`${r}.${i.n}`:String(i.n);t.set(a.id,e),n(a.children,e,{n:0})}};return n(e,``,{n:0}),t}function kg(e,t){let n=gg(t),r=[],i=Og(e),a=(e,t)=>{for(let n of e)r.push({item:n,number:i.get(n.id)??``,path:t}),a(n.children,[...t,n.title||U(`Sem título`)])};if(a(e,[]),!n)return r;let o=r.filter(e=>gg(e.item.title).includes(n));return[...o.filter(e=>gg(e.item.title).startsWith(n)),...o.filter(e=>!gg(e.item.title).startsWith(n))]}function Ag(e,t=600){let[n,r]=(0,_.useState)(`idle`),[i,a]=(0,_.useState)(null),o=(0,_.useRef)(new Map),s=(0,_.useRef)(void 0),c=(0,_.useRef)(e);c.current=e;let l=(0,_.useRef)(null),u=(0,_.useCallback)(async()=>{let e=[...o.current.values()];if(o.current.clear(),e.length===0)return;r(`saving`);let t=!1;for(let n of e)try{await c.current(n),a(new Date)}catch{let e=o.current.get(n.id);o.current.set(n.id,{...n,patch:{...n.patch,...e?.patch}}),t=!0}r(t?`error`:o.current.size>0?`saving`:`saved`)},[]),d=(0,_.useCallback)(()=>{window.clearTimeout(s.current);let e=l.current?l.current.then(u):u();return l.current=e,e.then(()=>{l.current===e&&(l.current=null)}),e.then(()=>o.current.size===0)},[u]),f=(0,_.useCallback)((e,n,i)=>{o.current.set(n,{slug:e,id:n,patch:{...o.current.get(n)?.patch,...i}}),r(`saving`),window.clearTimeout(s.current),s.current=window.setTimeout(()=>void d(),t)},[d,t]),p=(0,_.useCallback)(e=>{o.current.delete(e),o.current.size===0&&r(`idle`)},[]);return(0,_.useEffect)(()=>{let e=e=>{o.current.size!==0&&(d(),e.preventDefault())};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[d]),{state:n,savedAt:i,queue:f,flush:d,retry:d,discard:p}}var jg=e=>Math.min(1e3*2**e,15e3);function Mg({check:e,onBack:t,onChange:n}){let r=0,i,a=!1,o=!1,s=()=>n?.({attempt:r,checking:o}),c=()=>{i=setTimeout(()=>void l(),jg(r))};async function l(){if(a||o)return;clearTimeout(i),o=!0,s();let n=await e().then(()=>!0,()=>!1);if(o=!1,!a){if(n)return t();r++,s(),c()}}return c(),{retryNow:()=>void l(),stop:()=>{a=!0,clearTimeout(i)}}}function Ng(e,t,n){let[r,i]=(0,_.useState)({attempt:0,checking:!1}),a=(0,_.useRef)(null),o=(0,_.useRef)({check:t,onBack:n});return o.current={check:t,onBack:n},(0,_.useEffect)(()=>{if(!e)return;i({attempt:0,checking:!1});let t=Mg({check:()=>o.current.check(),onBack:()=>o.current.onBack(),onChange:i});return a.current=t,()=>{t.stop(),a.current=null}},[e]),{...r,retryNow:()=>a.current?.retryNow()}}var Pg=5e3,Fg=e=>e instanceof df&&e.code===`disk-conflict`;function Ig(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(0),y=(0,_.useRef)(new Map),b=(0,_.useCallback)(e=>{e.version&&y.current.set(e.id,e.version)},[]),x=(0,_.useRef)(null),[S,C]=(0,_.useState)(null),w=(0,_.useRef)(()=>{}),T=(0,_.useCallback)((e,t)=>{x.current={slug:e,id:t},C(t)},[]),E=(0,_.useRef)(new Map),D=(0,_.useRef)(void 0),ee=(0,_.useRef)(async()=>!0),te=(0,_.useCallback)(async()=>{if(window.clearTimeout(D.current),await ee.current())for(let[e,{slug:t,title:n}]of[...E.current]){E.current.delete(e);try{let r=await vf.updatePage(t,e,{title:n,fileName:`sync`},y.current.get(e));b(r),a(e=>e&&e.id===r.id?{...e,file:r.file}:e)}catch(r){E.current.set(e,{slug:t,title:n}),ff(r)?l(!0):Fg(r)&&T(t,e)}}},[b,T]),O=Ag(async e=>{let t=e.patch.title===void 0?e.patch:{...e.patch,fileName:`keep`};if(x.current?.id===e.id)throw T(e.slug,e.id),new df(`disk-conflict`,`disk-conflict`,{},409);let n=await vf.updatePage(e.slug,e.id,t,y.current.get(e.id)).catch(t=>{throw ff(t)?l(!0):Fg(t)&&T(e.slug,e.id),t});b(n),t.fileName&&(E.current.set(e.id,{slug:e.slug,title:n.title}),window.clearTimeout(D.current),D.current=window.setTimeout(()=>void te(),Pg)),a(e=>e&&e.id===n.id?{...e,file:n.file}:e)}),k=O.flush;ee.current=k;let A=(0,_.useCallback)(async()=>{let e=await k();return e&&await te(),e},[k,te]),ne=(0,_.useCallback)(async e=>{try{await e()}catch(e){ff(e)?l(!0):Fg(e)||Mh.error(W(e))}},[]),re=(0,_.useRef)(0),j=(0,_.useCallback)(async(e,t)=>{let n=++re.current,r=t?await vf.getPage(e,t):null;n===re.current&&(r&&b(r),a(r),d(null),yg({slug:e,pageId:t}))},[b]),M=(0,_.useCallback)(async e=>{let t=await vf.getManual(e);return r(t),t},[]),ie=(0,_.useCallback)(async(e,t=null)=>{try{await A(),h(!1),p(null);let n=await M(e),r=t?bg(n.pages,t)?.id:void 0;if(t&&!r){a(null),d({kind:`page`,address:`#/${e}/${t}`});return}await j(e,r??n.pages[0]?.id??null)}catch(t){if(ff(t))return l(!0);r(null),a(null),p({slug:e,error:t})}},[A,M,j]),ae=(0,_.useCallback)(async e=>{let{slug:t,pageId:n}=vg(),i=e.find(e=>e.slug===t);if(t&&!i){r(null),a(null),d({kind:`manual`,address:`#/${t}${n?`/${n}`:``}`});return}let o=i??e[0];o&&await ie(o.slug,i?n:null)},[ie]),oe=(0,_.useCallback)(async()=>{try{let e=await vf.listManuals();t(e),s(null),await ae(e)}catch(e){s(e)}},[ae]);(0,_.useEffect)(()=>{oe()},[oe]);let se=(0,_.useRef)(e);se.current=e,(0,_.useEffect)(()=>{let e=()=>se.current&&void ae(se.current);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[ae]);let ce=c||e===null&&ff(o),le=Ng(ce,()=>vf.listManuals(),()=>{if(l(!1),e===null)return void oe();n||ae(e),A(),Mh.success(U(`A conexão com o Studio voltou.`))}),ue=e=>ne(async()=>{n&&e!==i?.id&&(await A(),await j(n.slug,e))}),de=e=>ne(async()=>{if(!n)return;await A();let t=await vf.addPage(n.slug,``,e);b(t),re.current++,await M(n.slug),a(t),d(null),yg({slug:n.slug,pageId:t.id})}),fe=(e,t,n)=>ne(async()=>{await vf.restorePage(e,t),await M(e),await j(e,n)});return w.current=e=>ne(async()=>{let t=x.current;t&&(e===`reload`?(await M(t.slug),await j(t.slug,t.id),O.discard(t.id),E.current.delete(t.id),x.current=null,C(null),v(e=>e+1)):(b(await vf.getPage(t.slug,t.id)),x.current=null,C(null),await A()))}),{manuals:e,manual:n,page:i,bootError:o,notFound:u,openError:f,serverDown:ce,reconnect:le,reload:oe,openFromLocation:ae,creatingManual:m,setCreatingManual:h,revision:g,diskConflict:i!==null&&S===i.id,resolveConflict:e=>w.current(e),flush:A,save:{state:S!==null&&O.state===`error`?`conflict`:O.state,savedAt:O.savedAt,retry:O.retry},openManual:ie,selectPage:ue,addPage:de,removePage:e=>ne(async()=>{if(!n)return;let t=n.slug;O.discard(e.id),E.current.delete(e.id);let{trashId:r}=await vf.removePage(t,e.id),a=await M(t);i&&!bg(a.pages,i.id)&&await j(t,a.pages[0]?.id??null);let o=Dg(e.children).length,s=e.title||U(`Sem título`);Mh(o?lf(o,`"{nome}" e {n} subpágina foram para a lixeira.`,`"{nome}" e {n} subpáginas foram para a lixeira.`,{nome:s}):U(`"{nome}" foi para a lixeira.`,{nome:s}),{duration:1e4,action:{label:U(`Desfazer`),onClick:()=>void fe(t,r,e.id)}})}),restorePage:fe,movePage:(e,t,r)=>ne(async()=>{n&&(await vf.movePage(n.slug,e,t,r),await M(n.slug))}),saveVersion:e=>ne(async()=>{n&&i&&(await A(),await vf.saveVersion(n.slug,i.id,e),Mh.success(U(`Versão guardada.`)))}),restoreVersion:e=>ne(async()=>{if(!n||!i)return;await A();let t=await vf.restoreVersion(n.slug,i.id,e);await M(n.slug),b(t),a(t),v(e=>e+1),Mh(U(`Versão restaurada. O texto que estava antes foi guardado como "Antes de restaurar".`))}),publishVersion:e=>ne(async()=>{n&&i&&(await vf.publishVersion(n.slug,i.id,e),await M(n.slug))}),exportManual:async(e,t)=>{if(!n)throw Error(U(`Abra um manual para exportar.`));return await A(),vf.exportManual(n.slug,e,t)},setManualTheme:async e=>{n&&(await vf.setTheme(n.slug,e),await M(n.slug))},uploadManualLogo:async e=>{n&&(await vf.uploadLogo(n.slug,e),await M(n.slug))},setPageStatus:e=>ne(async()=>{if(!n||!i)return;await A();let t;try{t=await vf.updatePage(n.slug,i.id,{status:e},y.current.get(i.id))}catch(t){throw Fg(t)&&O.queue(n.slug,i.id,{status:e}),t}b(t),a(e=>e&&e.id===t.id?{...e,status:t.status}:e),await M(n.slug)}),createManual:e=>ne(async()=>{let n=await vf.createManual(e,sf);t(await vf.listManuals()),await ie(n.slug)}),editPage:e=>{if(n&&i){if(e.title!==void 0){let t=e.title;r(e=>e&&{...e,pages:Cg(e.pages,i.id,t)})}O.queue(n.slug,i.id,e)}},reportError:e=>Mh.error(e)}}var Lg=(0,_.createContext)(null);function Rg({children:e}){return(0,R.jsx)(Lg,{value:Ig(),children:e})}function zg(){let e=(0,_.use)(Lg);if(!e)throw Error(`useStudioContext precisa estar dentro de <StudioProvider>.`);return e}function Bg({...e}){return(0,R.jsx)(Mu,{"data-slot":`dropdown-menu`,...e})}function Vg({...e}){return(0,R.jsx)(Pu,{"data-slot":`dropdown-menu-trigger`,...e})}function Hg({className:e,sideOffset:t=4,...n}){return(0,R.jsx)(Fu,{children:(0,R.jsx)(Lu,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:L(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 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`,e),...n})})}function Ug({className:e,inset:t,variant:n=`default`,...r}){return(0,R.jsx)(zu,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:L(`relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-default data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Wg({...e}){return(0,R.jsx)(Bu,{"data-slot":`dropdown-menu-radio-group`,...e})}function Gg({className:e,children:t,...n}){return(0,R.jsxs)(Vu,{"data-slot":`dropdown-menu-radio-item`,className:L(`relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-default data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,R.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,R.jsx)(Hu,{children:(0,R.jsx)(_p,{className:`size-2 fill-current`})})}),t]})}function Kg({className:e,inset:t,...n}){return(0,R.jsx)(Ru,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:L(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function qg({className:e,...t}){return(0,R.jsx)(Uu,{"data-slot":`dropdown-menu-separator`,className:L(`-mx-1 my-1 h-px bg-border`,e),...t})}function Jg({className:e,...t}){return(0,R.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:L(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}function Yg({...e}){return(0,R.jsx)(Wu,{"data-slot":`dropdown-menu-sub`,...e})}function Xg({className:e,inset:t,children:n,...r}){return(0,R.jsxs)(Gu,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:L(`flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_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,R.jsx)(lp,{className:`ml-auto size-4`})]})}function Zg({className:e,...t}){return(0,R.jsx)(Ku,{"data-slot":`dropdown-menu-sub-content`,className:L(`z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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`,e),...t})}var Qg={id:`rascunho`,label:U(`Rascunho`),hint:U(`Ainda sendo escrita`),token:`grafite`},$g=[Qg,{id:`revisao`,label:U(`Em revisão`),hint:U(`Pronta para alguém conferir`),token:`cor-orange`},{id:`aprovado`,label:U(`Aprovado`),hint:U(`Conferida, pode ir para o manual`),token:`cor-green`},{id:`publicado`,label:U(`Publicado`),hint:U(`Já está no manual entregue`),token:`cobalto`}],e_=e=>$g.find(t=>t.id===e)??Qg;function t_({status:e,className:t}){return(0,R.jsx)(`span`,{className:L(`inline-block size-2 shrink-0 rounded-full`,e===`rascunho`?`border-[1.5px] border-current`:`bg-current`,t),"aria-hidden":!0})}function n_({status:e,className:t}){let n=e_(e);return(0,R.jsxs)(`span`,{className:L(`inline-flex shrink-0 items-center gap-1.5`,t),style:{color:`var(--${n.token})`},children:[(0,R.jsx)(t_,{status:e}),n.label]})}function r_({status:e,onChange:t}){return(0,R.jsxs)(Bg,{children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"aria-label":U(`Status da página: {status}`,{status:e_(e).label}),className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium [@media(pointer:coarse)]:min-h-11 hover:bg-muted data-[state=open]:bg-muted`,children:[(0,R.jsx)(n_,{status:e}),(0,R.jsx)(sp,{className:`size-3 text-muted-foreground`,"aria-hidden":!0})]})}),(0,R.jsxs)(Hg,{align:`end`,className:`w-64`,children:[(0,R.jsx)(Kg,{className:`text-xs text-muted-foreground`,children:U(`Etapa da página`)}),(0,R.jsx)(Wg,{value:e,onValueChange:e=>t(e),children:$g.map(e=>(0,R.jsx)(Gg,{value:e.id,className:`items-start`,children:(0,R.jsxs)(`span`,{className:`grid leading-tight`,children:[(0,R.jsx)(`span`,{className:`flex items-center gap-2`,children:(0,R.jsx)(n_,{status:e.id})}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.hint})]})},e.id))})]})]})}function i_({open:e,onOpenChange:t}){let n=zg(),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(0),s=kg(n.manual?.pages??[],r).slice(0,50),c=(0,_.useEffectEvent)(e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`p`&&n.manual&&(e.preventDefault(),i(``),o(0),t(!0))});(0,_.useEffect)(()=>(window.addEventListener(`keydown`,c),()=>window.removeEventListener(`keydown`,c)),[]);let l=s[a]?.item.id;(0,_.useEffect)(()=>{l&&document.getElementById(`busca-${l}`)?.scrollIntoView({block:`nearest`})},[l]);let u=e=>{t(!1),n.selectPage(e)};return(0,R.jsx)(sg,{open:e,onOpenChange:t,children:(0,R.jsxs)(dg,{showCloseButton:!1,"aria-describedby":void 0,className:`top-[12vh] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-lg`,children:[(0,R.jsx)(mg,{className:`sr-only`,children:U(`Buscar página`)}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3`,children:[(0,R.jsx)(qm,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,R.jsx)(`input`,{autoFocus:!0,role:`combobox`,"aria-expanded":`true`,"aria-controls":`busca-resultados`,"aria-activedescendant":s[a]?`busca-${s[a].item.id}`:void 0,"aria-label":U(`Buscar página pelo título`),placeholder:U(`Buscar página pelo título…`),value:r,onChange:e=>{i(e.target.value),o(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;o(e=>(e+t+s.length)%Math.max(s.length,1))}else if(e.key===`Enter`){e.preventDefault();let t=s[a];t&&u(t.item.id)}},className:`h-12 min-w-0 flex-1 bg-transparent text-[15px] outline-none placeholder:text-muted-foreground`})]}),(0,R.jsxs)(`div`,{id:`busca-resultados`,role:`listbox`,"aria-label":U(`Páginas encontradas`),className:`max-h-[50vh] overflow-y-auto p-1`,children:[s.length===0&&(0,R.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:U(`Nenhuma página com esse título.`)}),s.map((e,t)=>(0,R.jsxs)(`div`,{id:`busca-${e.item.id}`,role:`option`,tabIndex:-1,"aria-selected":t===a,onMouseMove:()=>o(t),onClick:()=>u(e.item.id),onKeyDown:()=>{},className:L(`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2`,t===a&&`bg-accent`),children:[e.number&&(0,R.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 font-mono text-xs tabular-nums text-primary`,children:e.number}),(0,R.jsxs)(`span`,{className:`grid min-w-0 flex-1 leading-tight`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm font-bold`,children:e.item.title||U(`Sem título`)}),e.path.length>0&&(0,R.jsx)(`span`,{className:`flex min-w-0 items-center gap-1 truncate text-xs text-muted-foreground`,children:e.path.map((t,n)=>(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[n>0&&(0,R.jsx)(lp,{className:`size-3`,"aria-hidden":!0}),t]},e.path.slice(0,n+1).join(`/`)))})]}),e.item.status!==`rascunho`&&(0,R.jsx)(n_,{status:e.item.status,className:`text-xs font-medium`}),e.item.id===n.page?.id&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:U(`aberta`)})]},e.item.id))]})]})})}var a_=`explicai:barra-lateral`,o_=`(min-width: 56.25rem)`;function s_(){try{return localStorage.getItem(a_)===`recolhida`}catch{return!1}}function c_(){let[e,t]=(0,_.useState)(s_),[n,r]=(0,_.useState)(!1),i=e=>{try{localStorage.setItem(a_,e?`recolhida`:`aberta`)}catch{}t(e)},a=()=>window.matchMedia(o_).matches?i(!e):r(!n),o=(0,_.useEffectEvent)(e=>{(e.ctrlKey||e.metaKey)&&e.key===`\\`&&(e.preventDefault(),a())});return(0,_.useEffect)(()=>(window.addEventListener(`keydown`,o),()=>window.removeEventListener(`keydown`,o)),[]),{collapsed:e,drawerOpen:n,toggle:a,collapse:()=>i(!0),expand:()=>i(!1),setDrawerOpen:r}}function l_({manuals:e,current:t,onOpen:n,onCreate:r}){return(0,R.jsxs)(Bg,{children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,className:`group -mx-1 flex w-[calc(100%+0.5rem)] flex-col items-start gap-0.5 rounded-md px-1 py-1 text-left outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-muted`,children:[(0,R.jsx)(`span`,{className:`rotulo text-muted-foreground`,children:U(`Manual`)}),(0,R.jsxs)(`span`,{className:`flex w-full items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-display text-lg font-semibold leading-tight [font-stretch:105%]`,children:t?.title??U(`Escolha um manual`)}),(0,R.jsx)(dp,{className:`size-4 shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 group-data-[state=open]:opacity-100 [@media(hover:none)]:opacity-100`,"aria-hidden":!0})]})]})}),(0,R.jsxs)(Hg,{align:`start`,className:`w-(--radix-dropdown-menu-trigger-width) min-w-56`,children:[(0,R.jsx)(Kg,{className:`text-muted-foreground`,children:U(`Manuais nesta pasta`)}),e.map(e=>(0,R.jsxs)(Ug,{onSelect:()=>n(e.slug),children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.slug===t?.slug&&(0,R.jsx)(ap,{className:`text-primary`})]},e.slug)),(0,R.jsx)(qg,{}),(0,R.jsxs)(Ug,{onSelect:r,children:[(0,R.jsx)(Vm,{}),` `,U(`Novo manual`)]})]})]})}var u_=[{shift:`up`,label:U(`Para cima`),keys:`Alt+Shift+↑`,Icon:Yf},{shift:`down`,label:U(`Para baixo`),keys:`Alt+Shift+↓`,Icon:Uf},{shift:`indent`,label:U(`Para dentro da anterior`),keys:`Alt+Shift+→`,Icon:pm},{shift:`outdent`,label:U(`Para fora`),keys:`Alt+Shift+←`,Icon:dm}],d_=`grid size-7 place-items-center rounded-md text-muted-foreground hover:bg-secondary hover:text-foreground data-[state=open]:bg-secondary`;function f_({item:e,pages:t,selected:n,menuOpen:r,onMenuOpenChange:i,onAction:a}){let o=e.title||U(`Sem título`),s=Dg(e.children).length;return(0,R.jsxs)(`span`,{className:L(`flex opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 has-[[data-state=open]]:opacity-100 pointer-coarse:opacity-100`,n&&`opacity-100`),children:[(0,R.jsxs)(Xh,{children:[(0,R.jsx)(Zh,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,tabIndex:-1,className:d_,"aria-label":U(`Nova subpágina em {nome}`,{nome:o}),onClick:()=>a({kind:`addChild`}),children:(0,R.jsx)(Vm,{className:`size-4`})})}),(0,R.jsx)(Qh,{children:U(`Nova subpágina`)})]}),(0,R.jsxs)(Bg,{open:r,onOpenChange:i,children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,tabIndex:-1,className:d_,"aria-label":U(`Mais ações para {nome}`,{nome:o}),children:(0,R.jsx)(Tp,{className:`size-4`})})}),(0,R.jsxs)(Hg,{align:`start`,className:`w-64`,children:[(0,R.jsxs)(Ug,{onSelect:()=>a({kind:`addChild`}),children:[(0,R.jsx)(Vm,{}),` `,U(`Nova subpágina`)]}),(0,R.jsxs)(Yg,{children:[(0,R.jsxs)(Xg,{children:[(0,R.jsx)(km,{className:`size-4 text-muted-foreground`}),` `,U(`Mover`)]}),(0,R.jsx)(Zg,{className:`w-64`,children:u_.map(({shift:n,label:r,keys:i,Icon:o})=>(0,R.jsxs)(Ug,{disabled:!Tg(t,e.id,n),onSelect:()=>a({kind:`shift`,shift:n}),children:[(0,R.jsx)(o,{}),` `,r,(0,R.jsx)(Jg,{children:i})]},n))})]}),(0,R.jsx)(qg,{}),(0,R.jsxs)(Ug,{variant:`destructive`,onSelect:()=>a({kind:`remove`}),children:[(0,R.jsx)(ah,{}),` `,s?lf(s,`Excluir página e {n} subpágina`,`Excluir página e {n} subpáginas`):U(`Excluir página`)]})]})]})]})}var p_={ArrowUp:`up`,ArrowDown:`down`,ArrowRight:`indent`,ArrowLeft:`outdent`};function m_(e,t,n){let r=(0,_.useRef)(null),i=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=i.current;t&&e!==void 0&&(i.current=null,r.current?.querySelector(`[data-page-id="${CSS.escape(t)}"]`)?.focus())},[e]),{onKeyDown:e=>{let r=e.target,a=r.dataset.pageId;if(!a)return;let o=p_[e.key];if(e.altKey&&e.shiftKey&&o){e.preventDefault(),i.current=a,t(a,o);return}if(e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`){e.preventDefault(),n(a);return}let s=Array.from(e.currentTarget.querySelectorAll(`[data-page-id]`)),c=s.indexOf(r),l=e.key===`ArrowDown`?c+1:e.key===`ArrowUp`?c-1:e.key===`Home`?0:e.key===`End`?s.length-1:null,u=l===null?void 0:s[l];u&&(e.preventDefault(),u.focus())},root:r}}var h_=`text/x-explicai-page`;function g_(e){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientY-t.top)/t.height;return n<.3?`before`:n>.7?`after`:`inside`}function __({pages:e,selectedId:t,onSelect:n,onAction:r,onMove:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),{onKeyDown:l,root:u}=m_(e,(t,n)=>{let i=bg(e,t);i&&r(i,{kind:`shift`,shift:n})},c),d=t&&bg(e,t)?t:e[0]?.id,f=Og(e),p=(t,n,r)=>{o(null);let a=wg(e,r,t,n);a&&i(r,a.parentId,a.index)},m=(i,h)=>(0,R.jsx)(`ul`,{ref:h===0?u:void 0,className:L(h>0&&`ml-3 border-l border-border pl-1`),onKeyDown:h===0?l:void 0,children:i.map(i=>{let l=a?.id===i.id?a.zone:null,u=i.id===t;return(0,R.jsxs)(`li`,{children:[(0,R.jsxs)(`div`,{className:L(`group relative flex items-center rounded-md pr-1 transition-colors hover:bg-muted`,l===`inside`&&`outline-2 -outline-offset-2 outline-dashed outline-primary`,l===`before`&&`before:absolute before:inset-x-2 before:-top-px before:h-0.5 before:bg-primary`,l===`after`&&`after:absolute after:inset-x-2 after:-bottom-px after:h-0.5 after:bg-primary`),draggable:!0,onDragStart:e=>{e.dataTransfer.setData(h_,i.id),e.dataTransfer.effectAllowed=`move`},onDragOver:e=>{e.dataTransfer.types.includes(h_)&&(e.preventDefault(),o({id:i.id,zone:g_(e)}))},onDragLeave:()=>o(e=>e?.id===i.id?null:e),onDrop:e=>{e.preventDefault();let t=e.dataTransfer.getData(h_);t&&l&&p(i.id,l,t)},children:[(0,R.jsxs)(`button`,{type:`button`,"data-page-id":i.id,tabIndex:i.id===d?0:-1,"aria-current":u?`page`:void 0,onClick:()=>n(i.id),className:`flex min-w-0 flex-1 items-center py-1.5 pl-2 text-left text-[14.5px]`,children:[f.get(i.id)&&(0,R.jsx)(`span`,{"aria-hidden":!0,className:`mr-1.5 inline-block shrink-0 font-mono text-xs tabular-nums text-primary`,children:f.get(i.id)}),(0,R.jsx)(`span`,{title:i.title||(i.problem?i.file.split(`/`).pop():U(`Sem título`)),className:L(`min-w-0 truncate`,u?`bg-[linear-gradient(transparent_50%,var(--marca-faixa)_50%)] font-bold text-foreground`:`text-foreground/85`,!i.title&&`italic text-muted-foreground`),children:i.title||(i.problem?i.file.split(`/`).pop():U(`Sem título`))}),i.status!==`rascunho`&&(0,R.jsx)(n_,{status:i.status,className:`ml-2 text-xs font-medium`}),i.problem&&(0,R.jsxs)(`span`,{title:i.problem,className:`ml-1.5 inline-flex align-[-2px] text-destructive`,children:[(0,R.jsx)(sh,{className:`size-3.5`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`sr-only`,children:i.problem})]})]}),(0,R.jsx)(f_,{item:i,pages:e,selected:u,menuOpen:s===i.id,onMenuOpenChange:e=>c(e?i.id:null),onAction:e=>r(i,e)})]}),i.children.length>0&&m(i.children,h+1)]},i.id)})});return m(e,0)}var v_=[{title:`Escrevendo`,keys:[[`/`,`Inserir bloco: título, passos, imagem, tabela…`],[`Ctrl+B`,`Negrito`],[`Ctrl+I`,`Itálico`],[`Ctrl+E`,`Código no texto`],[`Ctrl+K`,`Link para outra página ou endereço`],[`Ctrl+Z`,`Desfazer`],[`Enter no título`,`Ir para o texto da página`]]},{title:`Páginas`,keys:[[`Ctrl+P`,`Buscar página pelo título`],[`Ctrl+\\`,`Mostrar ou esconder as páginas`],[`↑ ↓`,`Andar entre as páginas da árvore`],[`Alt+Shift+↑ ↓`,`Mover a página para cima ou para baixo`],[`Alt+Shift+→ ←`,`Virar subpágina ou subir um nível`],[`Shift+F10`,`Abrir o menu da página`]]},{title:`Marcando imagens`,keys:[[`V`,`Ferramenta Selecionar`],[`M`,`Ferramenta Marcador`],[`D`,`Ferramenta Destaque`],[`S`,`Ferramenta Seta`],[`A`,`Ferramenta Área clicável`],[`O`,`Ferramenta Ocultar`],[`R`,`Ferramenta Recortar`],[`Delete`,`Excluir a marcação selecionada`]]}];function y_({open:e,onOpenChange:t}){return(0,R.jsx)(sg,{open:e,onOpenChange:t,children:(0,R.jsxs)(dg,{className:`max-h-[90vh] overflow-y-auto sm:max-w-md`,children:[(0,R.jsxs)(fg,{children:[(0,R.jsx)(mg,{className:`font-display text-xl font-extrabold tracking-tight`,children:U(`Atalhos de teclado`)}),(0,R.jsx)(hg,{children:U(`No Mac, use Cmd no lugar de Ctrl.`)})]}),v_.map(e=>(0,R.jsxs)(`section`,{className:`grid gap-1.5`,children:[(0,R.jsx)(`h3`,{className:`rotulo`,children:U(e.title)}),(0,R.jsx)(`dl`,{className:`grid grid-cols-[9.5rem_1fr] gap-x-4 gap-y-1.5 text-sm`,children:e.keys.map(([e,t])=>(0,R.jsxs)(`div`,{className:`contents`,children:[(0,R.jsx)(`dt`,{children:(0,R.jsx)(`kbd`,{className:`rounded-sm border border-border bg-card px-1.5 py-0.5 font-mono text-xs whitespace-nowrap`,children:U(e)})}),(0,R.jsx)(`dd`,{className:`text-muted-foreground`,children:U(t)})]},e))})]},e.title))]})})}var b_=new Intl.RelativeTimeFormat(sf,{numeric:`auto`});function x_(e){let t=Math.round((Date.parse(e)-Date.now())/6e4);if(t===0)return U(`agora há pouco`);if(Math.abs(t)<60)return b_.format(t,`minute`);let n=Math.round(t/60);return Math.abs(n)<24?b_.format(n,`hour`):b_.format(Math.round(n/24),`day`)}function S_({slug:e,open:t,onOpenChange:n,onRestore:r,flush:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),l=()=>{o(null),c(null),vf.listTrash(e).then(o,e=>c(W(e)))},u=()=>i().then(t=>{if(!t)throw Error(U(`Há alterações sem salvar. Salve antes de limpar as imagens.`));return vf.cleanUnusedAssets(e)}).then(({moved:e,folder:t})=>{Mh(e===0?U(`Nenhuma imagem sem uso.`):lf(e,`{n} arquivo foi para {pasta}.`,`{n} arquivos foram para {pasta}.`,{pasta:t??``}))},e=>c(W(e)));return(0,_.useEffect)(()=>{t&&l()},[t]),(0,R.jsx)(sg,{open:t,onOpenChange:n,children:(0,R.jsxs)(dg,{className:`gap-2 p-4 sm:max-w-sm`,"aria-describedby":void 0,children:[(0,R.jsx)(mg,{className:`px-2 pt-1 pb-2 text-sm font-bold`,children:U(`Lixeira deste manual`)}),s&&(0,R.jsx)(`p`,{className:`px-2 pb-2 text-sm text-destructive`,children:s}),!s&&a===null&&(0,R.jsx)(`p`,{className:`px-2 pb-2 text-sm text-muted-foreground`,children:U(`Carregando…`)}),a?.length===0&&(0,R.jsx)(`p`,{className:`px-2 pb-2 text-sm text-muted-foreground`,children:U(`Nenhuma página excluída.`)}),a&&a.length>0&&(0,R.jsx)(`ul`,{className:`grid gap-0.5`,children:a.map(e=>(0,R.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-muted`,children:[(0,R.jsxs)(`span`,{className:`grid min-w-0 flex-1 leading-tight`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm`,children:e.title||U(`Sem título`)}),(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.pages>1?`${U(`{n} páginas`,{n:e.pages})} · `:``,U(`excluída {quando}`,{quando:x_(e.deletedAt)})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void r(e.trashId,e.pageId).then(()=>n(!1)),className:`flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-sm font-bold text-primary hover:bg-accent`,children:[(0,R.jsx)(Gm,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Restaurar`)]})]},e.trashId))}),(0,R.jsxs)(`div`,{className:`mx-2 mt-2 grid gap-1 rounded-md border border-border p-2 text-sm`,children:[(0,R.jsx)(`p`,{children:U(`Imagens que nenhuma página usa, contando versões e lixeira, vão para a lixeira.`)}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void u(),className:`flex w-fit items-center gap-1 rounded-md px-2 py-1 font-bold text-primary hover:bg-accent`,children:[(0,R.jsx)(Yp,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Mover para a lixeira`)]})]}),(0,R.jsx)(`p`,{className:`px-2 pt-2 text-xs text-muted-foreground`,children:U(`As páginas excluídas ficam na pasta .lixeira do manual até você restaurar ou apagar.`)})]})})}var C_=`explicai:aparencia`,w_={mode:`system`},T_=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches;function E_(){try{let e=JSON.parse(localStorage.getItem(C_)??`{}`);return{mode:e.mode===`light`||e.mode===`dark`?e.mode:w_.mode}}catch{return w_}}function D_({mode:e}){let t=document.documentElement;t.dataset.theme=e===`dark`||e===`system`&&T_()?`dark`:`light`}function O_(e){try{localStorage.setItem(C_,JSON.stringify(e))}catch{}D_(e)}function k_(){window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>D_(E_()))}function A_(){return(0,_.useSyncExternalStore)(e=>{let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()},()=>document.documentElement.dataset.theme===`dark`?`dark`:`light`)}var j_=[{id:`light`,label:U(`Claro`),Icon:th},{id:`dark`,label:U(`Escuro`),Icon:Tm},{id:`system`,label:U(`Sistema`),Icon:Cm}];function M_({open:e,onOpenChange:t}){let n=(0,_.useRef)(null),[r,i]=(0,_.useState)(E_),a=e=>{let t={...E_(),...e};O_(t),i(t)};return(0,R.jsx)(sg,{open:e,onOpenChange:t,children:(0,R.jsxs)(dg,{className:`gap-4 p-4 sm:max-w-xs`,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault(),(n.current?.querySelector(`[aria-pressed=true]`)??n.current?.querySelector(`button`))?.focus()},children:[(0,R.jsx)(mg,{className:`font-display text-lg font-extrabold tracking-tight`,children:U(`Aparência`)}),(0,R.jsxs)(`fieldset`,{children:[(0,R.jsx)(`legend`,{className:`mb-2 rotulo`,children:U(`Tema`)}),(0,R.jsx)(`div`,{ref:n,className:`grid grid-cols-3 gap-1 rounded-md bg-muted p-1`,children:j_.map(({id:e,label:t,Icon:n})=>(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":r.mode===e,onClick:()=>a({mode:e}),className:`flex flex-col items-center gap-1 rounded-sm min-h-11 py-1.5 text-xs text-muted-foreground hover:text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-muted aria-pressed:bg-primary aria-pressed:font-bold aria-pressed:text-primary-foreground`,children:[(0,R.jsx)(n,{className:`size-4`,"aria-hidden":!0}),` `,t]},e))})]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`Muda só o Studio, neste navegador. A cor do manual fica em Exportar manual.`)})]})})}var N_=[{id:`pt-BR`,label:`Português`},{id:`en`,label:`English`}];function P_({open:e,onOpenChange:t}){return(0,R.jsx)(sg,{open:e,onOpenChange:t,children:(0,R.jsxs)(dg,{className:`gap-4 p-4 sm:max-w-xs`,"aria-describedby":void 0,children:[(0,R.jsx)(mg,{className:`font-display text-lg font-extrabold tracking-tight`,children:U(`Idioma`)}),(0,R.jsx)(`fieldset`,{"aria-label":U(`Idioma da interface`),className:`grid grid-cols-2 gap-1 rounded-md bg-muted p-1`,children:N_.map(({id:e,label:t})=>(0,R.jsx)(`button`,{type:`button`,lang:e,"aria-pressed":of===e,onClick:()=>of!==e&&cf(e),className:`rounded-sm min-h-11 py-1.5 text-xs text-muted-foreground hover:text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-muted aria-pressed:bg-primary aria-pressed:font-bold aria-pressed:text-primary-foreground`,children:t},e))}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`Muda só o Studio, neste navegador.`)})]})})}var F_=`group/item [@media(pointer:coarse)]:min-h-11`,I_=`size-3.5 text-muted-foreground group-data-[highlighted]/item:text-foreground`,L_={light:`Claro`,dark:`Escuro`,system:`Sistema`};function R_(){let{manual:e,restorePage:t,flush:n}=zg(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(()=>E_().mode),s=e=>({open:r===e,onOpenChange:t=>i(t?e:null)});return(0,R.jsxs)(`div`,{className:`sticky bottom-0 z-10 -mx-3 mt-auto flex h-(--rodape-h) shrink-0 flex-col justify-center border-t border-border bg-card px-3`,children:[(0,R.jsxs)(Bg,{onOpenChange:e=>e&&o(E_().mode),children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,className:`flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-muted hover:text-foreground data-[state=open]:bg-muted [@media(pointer:coarse)]:min-h-11`,children:[(0,R.jsx)(Zm,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Ajustes`)]})}),(0,R.jsxs)(Hg,{side:`top`,align:`start`,className:`w-(--radix-dropdown-menu-trigger-width)`,children:[e&&(0,R.jsxs)(Ug,{className:F_,onSelect:()=>i(`trash`),children:[(0,R.jsx)(ah,{className:I_,"aria-hidden":!0}),` `,U(`Lixeira`)]}),(0,R.jsxs)(Ug,{className:F_,onSelect:()=>i(`appearance`),children:[(0,R.jsx)($m,{className:I_,"aria-hidden":!0}),` `,U(`Aparência`),(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-muted-foreground`,children:U(L_[a])})]}),(0,R.jsxs)(Ug,{className:F_,onSelect:()=>i(`language`),children:[(0,R.jsx)(am,{className:I_,"aria-hidden":!0}),` `,U(`Idioma`),(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-muted-foreground`,children:N_.find(e=>e.id===of)?.label})]}),(0,R.jsxs)(Ug,{className:F_,onSelect:()=>i(`shortcuts`),children:[(0,R.jsx)(rm,{className:I_,"aria-hidden":!0}),` `,U(`Atalhos`)]})]})]}),e&&(0,R.jsx)(S_,{slug:e.slug,flush:n,...s(`trash`),onRestore:(n,r)=>t(e.slug,n,r)}),(0,R.jsx)(M_,{...s(`appearance`)}),(0,R.jsx)(P_,{...s(`language`)}),(0,R.jsx)(y_,{...s(`shortcuts`)})]})}function z_({onCollapse:e,onNavigate:t,onSearch:n}){let r=zg(),{manuals:i,manual:a,page:o}=r,s=i?.find(e=>e.slug===a?.slug)??null;return(0,R.jsxs)(`aside`,{className:`flex h-full flex-col gap-5 overflow-y-auto border-r border-border bg-card px-3 pt-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(tf,{}),(0,R.jsx)(`button`,{type:`button`,onClick:e,"aria-label":U(`Esconder as páginas ({atalho})`,{atalho:`Ctrl+\\`}),title:U(`Esconder as páginas ({atalho})`,{atalho:`Ctrl+\\`}),className:`grid size-8 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,R.jsx)(Nm,{className:`size-4`,"aria-hidden":!0})})]}),i&&i.length>0&&(0,R.jsx)(l_,{manuals:i,current:s,onOpen:e=>void r.openManual(e),onCreate:()=>r.setCreatingManual(!0)}),a&&(0,R.jsxs)(`nav`,{"aria-label":U(`Páginas do manual`),className:`grid grid-cols-1 gap-1`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:n,className:`mb-1 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,R.jsx)(qm,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Buscar página`),(0,R.jsx)(`kbd`,{className:`ml-auto font-mono text-[11px] text-muted-foreground`,children:`Ctrl+P`})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-2 text-[13px] text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`rotulo`,children:U(`Páginas`)}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{t?.(),r.addPage(null)},className:`flex items-center gap-1 rounded-md px-1.5 py-1 font-bold text-primary hover:bg-accent`,children:[(0,R.jsx)(Vm,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Nova página`)]})]}),a.pages.length===0?(0,R.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:U(`Nenhuma página ainda.`)}):(0,R.jsx)(__,{pages:a.pages,selectedId:o?.id??null,onSelect:e=>{t?.(),r.selectPage(e)},onAction:(e,n)=>{if(n.kind===`addChild`){t?.(),r.addPage(e.id);return}if(n.kind===`remove`)return void r.removePage(e);let i=a&&Tg(a.pages,e.id,n.shift);i&&r.movePage(e.id,i.parentId,i.index)},onMove:(e,t,n)=>void r.movePage(e,t,n)})]}),(0,R.jsx)(R_,{})]})}var B_=`Ctrl+\\`;function V_({sidebar:e,onSearch:t}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`hidden h-full shrink-0 split:block`,children:e.collapsed?(0,R.jsxs)(`div`,{className:`flex h-full w-12 flex-col items-center border-r border-border bg-card pt-4`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:e.expand,"aria-label":U(`Mostrar as páginas ({atalho})`,{atalho:B_}),title:U(`Mostrar as páginas ({atalho})`,{atalho:B_}),className:`grid size-8 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,R.jsx)(Fm,{className:`size-4`,"aria-hidden":!0})}),(0,R.jsx)(`div`,{"aria-hidden":!0,className:`mt-auto h-(--rodape-h) w-full shrink-0 border-t border-border`})]}):(0,R.jsx)(`div`,{className:`h-full w-56 lg:w-[17.5rem]`,children:(0,R.jsx)(z_,{onCollapse:e.collapse,onSearch:t})})}),(0,R.jsx)(sg,{open:e.drawerOpen,onOpenChange:e.setDrawerOpen,children:(0,R.jsxs)(dg,{showCloseButton:!1,"aria-describedby":void 0,className:`top-0 left-0 h-full w-[min(17.5rem,85vw)] max-w-none translate-x-0 translate-y-0 gap-0 rounded-none border-0 p-0 sm:max-w-none split:hidden data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left`,children:[(0,R.jsx)(mg,{className:`sr-only`,children:U(`Páginas do manual`)}),(0,R.jsx)(z_,{onCollapse:()=>e.setDrawerOpen(!1),onNavigate:()=>e.setDrawerOpen(!1),onSearch:()=>{e.setDrawerOpen(!1),t()}})]})})]})}function H_({title:e,onOpen:t,drawerOpen:n=!1}){return(0,R.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-border bg-card px-3 split:hidden`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":U(`Mostrar as páginas ({atalho})`,{atalho:B_}),className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm font-bold hover:bg-muted`,children:[(0,R.jsx)(Fm,{className:`size-4`,"aria-hidden":!0}),` `,U(`Páginas`)]}),(0,R.jsx)(`div`,{"aria-hidden":n||void 0,className:`contents`,children:(0,R.jsx)(tf,{})}),(0,R.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:e})]})}var U_=Object.defineProperty,W_=(e,t)=>{let n={};for(var r in e)U_(n,r,{get:e[r],enumerable:!0});return t||U_(n,Symbol.toStringTag,{value:`Module`}),n};function G_(e){this.content=e}G_.prototype={constructor:G_,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new G_(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new G_(n)},addToStart:function(e,t){return new G_([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new G_(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new G_(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=G_.from(e),e.size?new G_(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=G_.from(e),e.size?new G_(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=G_.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},G_.from=function(e){if(e instanceof G_)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new G_(t)};function K_(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&Y_(e.charCodeAt(r-1))&&J_(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=K_(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function q_(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&Y_(e.charCodeAt(i-1))&&J_(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=q_(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}function J_(e){return e>=56320&&e<57344}function Y_(e){return e>=55296&&e<56320}var K=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return K_(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return q_(this,e,t,n)}findIndex(e){if(e==0)return Z_(0,e);if(e==this.size)return Z_(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Z_(t+1,i):Z_(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};K.empty=new K([],0);var X_={index:0,offset:0};function Z_(e,t){return X_.index=e,X_.offset=t,X_}function Q_(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Q_(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Q_(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var $_=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Q_(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};$_.none=[];var ev=class extends Error{},q=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=nv(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(tv(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(K.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};q.empty=new q(K.empty,0,0);function tv(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(tv(a.content,t-i-1,n-i-1)))}function nv(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=nv(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function rv(e,t,n){if(n.openStart>e.depth)throw new ev(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ev(`Inconsistent open depths`);return iv(e,t,n,0)}function iv(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=iv(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return lv(a,dv(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return lv(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=fv(n,e);return lv(a,uv(e,i,o,t,r))}}function av(e,t){if(!t.type.compatibleContent(e.type))throw new ev(`Cannot join `+t.type.name+` onto `+e.type.name)}function ov(e,t,n){let r=e.node(n);return av(r,t.node(n)),r}function sv(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function cv(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(sv(e.nodeAfter,r),a++));for(let e=a;e<o;e++)sv(i.child(e),r);t&&t.depth==n&&t.textOffset&&sv(t.nodeBefore,r)}function lv(e,t){if(!e.type.validContent(t))throw new ev(`Invalid content for node `+e.type.name);return e.copy(t)}function uv(e,t,n,r,i){let a=e.depth>i&&ov(e,t,i+1),o=r.depth>i&&ov(n,r,i+1),s=[];return cv(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(av(a,o),sv(lv(a,uv(e,t,n,r,i+1)),s)):(a&&sv(lv(a,dv(e,t,i+1)),s),cv(t,n,i,s),o&&sv(lv(o,dv(n,r,i+1)),s)),cv(r,null,i,s),new K(s)}function dv(e,t,n){let r=[];return cv(null,e,n,r),e.depth>n&&sv(lv(ov(e,t,n+1),dv(e,t,n+1)),r),cv(t,null,n,r),new K(r)}function fv(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(K.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var pv=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return $_.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive!==!1||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive!==!1||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new _v(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=gv.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else gv.set(t,r=new mv);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%hv,i}},mv=class{constructor(){this.elts=[],this.i=0}},hv=12,gv=new WeakMap,_v=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},vv=Object.create(null),yv=class e{constructor(e,t,n,r=$_.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||K.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Q_(this.attrs,t||e.defaultAttrs||vv)&&$_.sameSet(this.marks,n||$_.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return q.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new q(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return rv(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return pv.resolveCached(this,e)}resolveNoCache(e){return pv.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),xv(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=K.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),Sv(this.type.attrs,this.attrs,`node`,this.type.name);let e=$_.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];Sv(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!$_.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=K.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};yv.prototype.text=void 0;var bv=class e extends yv{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xv(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function xv(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Sv(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var Cv=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new wv(t,n);if(r.next==null)return e.empty;let i=Tv(r);r.next&&r.err(`Unexpected trailing text`);let a=Fv(Mv(i));return Iv(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return K.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];a.isLeaf||a.hasRequiredAttrs()||a.name in t||r.type&&!o.validEnd||(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
49
|
+
`},Zi=0,Qi=[];function $i(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(Zi++)[0],a=_.useState(xi)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Zr([e.lockRef.current],(e.shards||[]).map(Ji),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Ki(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=zi(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=zi(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 Gi(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(Qi.length&&Qi[Qi.length-1]===a){var r=`deltaY`in n?qi(n):Ki(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Yi(e.delta,r)})[0];if(i&&i.should)n.cancelable&&n.preventDefault();else if(!i){var c=(o.current.shards||[]).map(Ji).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ea(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Ki(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,qi(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Ki(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Qi.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Pi),document.addEventListener(`touchmove`,c,Pi),document.addEventListener(`touchstart`,u,Pi),function(){Qi=Qi.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Pi),document.removeEventListener(`touchmove`,c,Pi),document.removeEventListener(`touchstart`,u,Pi)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Xi(i)}):null,p?_.createElement(ji,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ea(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var ta=di(fi,$i),na=_.forwardRef(function(e,t){return _.createElement(mi,Yr({},e,{ref:t,sideCar:ta}))});na.classNames=mi.classNames;var ra=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ia=new WeakMap,B=new WeakMap,aa={},oa=0,sa=function(e){return e&&(e.host||sa(e.parentNode))},ca=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=sa(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})},la=function(e,t,n,r){var i=ca(t,Array.isArray(e)?e:[e]);aa[n]||(aa[n]=new WeakMap);var a=aa[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=(ia.get(e)||0)+1,l=(a.get(e)||0)+1;ia.set(e,c),a.set(e,l),o.push(e),c===1&&i&&B.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(),oa++,function(){o.forEach(function(e){var t=ia.get(e)-1,i=a.get(e)-1;ia.set(e,t),a.set(e,i),t||(B.has(e)||e.removeAttribute(r),B.delete(e)),i||e.removeAttribute(n)}),oa--,oa||(ia=new WeakMap,ia=new WeakMap,B=new WeakMap,aa={})}},ua=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||ra(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),la(r,i,n,`aria-hidden`)):function(){return null}},da=Object.defineProperty,fa=(e,t)=>da(e,`name`,{value:t,configurable:!0}),pa=`Dialog`,[ma,ha]=Qt(pa),[ga,_a]=ma(pa),va=fa(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),{nodes:l,registry:u}=Dr(),[d,f]=jn({prop:r,defaultProp:i??!1,onChange:a,caller:pa}),[p,m]=_.useState(0),[h,g]=_.useState(0);return(0,R.jsx)(ga,{scope:t,triggerRef:s,contentRef:c,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),titlePresent:p>0,descriptionPresent:h>0,setTitleCount:m,setDescriptionCount:g,open:d,onOpenChange:f,onOpenToggle:_.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),ya=`DialogTrigger`,ba=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(ya,n),a=yt(t,i.triggerRef);return(0,R.jsx)(Ut.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":za(i.open),...r,ref:a,onClick:z(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),xa=`DialogPortal`,[Sa,Ca]=ma(xa,{forceMount:void 0}),wa=fa(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=_a(xa,t);return(0,R.jsx)(Sa,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,R.jsx)(zn,{present:n||a.open,children:(0,R.jsx)(Vr,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Ta=`DialogOverlay`,Ea=_.forwardRef(fa(function(e,t){let n=Ca(Ta,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=_a(Ta,e.__scopeDialog);return a.modal?(0,R.jsx)(zn,{present:r||a.open,children:(0,R.jsx)(Oa,{...i,ref:t})}):null},`DialogOverlay`)),Da=St(`DialogOverlay.RemoveScroll`),Oa=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(Ta,n),a=yt(t,pr());return(0,R.jsx)(na,{as:Da,allowPinchZoom:!0,shards:_.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,R.jsx)(Ut.div,{"data-state":za(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ka=`DialogContent`,Aa=_.forwardRef(fa(function(e,t){let n=Ca(ka,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=_a(ka,e.__scopeDialog);return(0,R.jsx)(zn,{present:r||a.open,children:a.modal?(0,R.jsx)(ja,{...i,ref:t}):(0,R.jsx)(Ma,{...i,ref:t})})},`DialogContent`)),ja=_.forwardRef(fa(function(e,t){let n=_a(ka,e.__scopeDialog),r=_.useRef(null),i=yt(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return ua(e)},[]),(0,R.jsx)(Na,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Ma=_.forwardRef(fa(function(e,t){let n=_a(ka,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,R.jsx)(Na,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Na=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=_a(ka,n);return qr(),(0,R.jsx)(Er,{registry:l.branchRegistry,children:(0,R.jsx)(wr,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(fr,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?Ra(o,l.descriptionId):o,"data-state":za(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Pa=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(`DialogTitle`,n),{setTitleCount:a}=i;return en(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Ut.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Fa=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(`DialogDescription`,n),{setDescriptionCount:a}=i;return en(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Ut.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Ia=`DialogClose`,La=_.forwardRef(fa(function(e,t){let{__scopeDialog:n,...r}=e,i=_a(Ia,n);return(0,R.jsx)(Ut.button,{type:`button`,...r,ref:t,onClick:z(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Ra(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}fa(Ra,`concatAriaDescribedby`);function za(e){return e?`open`:`closed`}fa(za,`getState`);var Ba=Object.defineProperty,Va=(e,t)=>Ba(e,`name`,{value:t,configurable:!0});function Ha(e){let[t,n]=_.useState(void 0);return en(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=0,r=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;let i=r[0];window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>{let t,r;if(`borderBoxSize`in i){let e=i.borderBoxSize,n=Array.isArray(e)?e[0]:e;t=n.inlineSize,r=n.blockSize}else t=e.offsetWidth,r=e.offsetHeight;n({width:t,height:r})})});return r.observe(e,{box:`border-box`}),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}n(void 0)},[e]),t}Va(Ha,`useSize`);var Ua=[`top`,`right`,`bottom`,`left`],Wa=[`start`,`end`],Ga=Ua.reduce((e,t)=>e.concat(t,t+`-`+Wa[0],t+`-`+Wa[1]),[]),Ka=Math.min,qa=Math.max,Ja=Math.round,Ya=Math.floor,Xa=e=>({x:e,y:e}),Za={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Qa(e,t,n){return qa(e,Ka(t,n))}function $a(e,t){return typeof e==`function`?e(t):e}function eo(e){return e.split(`-`)[0]}function to(e){return e.split(`-`)[1]}function no(e){return e===`x`?`y`:`x`}function ro(e){return e===`y`?`height`:`width`}function io(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ao(e){return no(io(e))}function oo(e,t,n){n===void 0&&(n=!1);let r=to(e),i=ao(e),a=ro(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=go(o)),[o,go(o)]}function so(e){let t=go(e);return[co(e),t,co(t)]}function co(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var lo=[`left`,`right`],uo=[`right`,`left`],fo=[`top`,`bottom`],po=[`bottom`,`top`];function mo(e,t,n){switch(e){case`top`:case`bottom`:return n?t?uo:lo:t?lo:uo;case`left`:case`right`:return t?fo:po;default:return[]}}function ho(e,t,n,r){let i=to(e),a=mo(eo(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(co)))),a}function go(e){let t=eo(e);return Za[t]+e.slice(t.length)}function _o(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function vo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:_o(e)}function yo(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 bo(e,t,n){let{reference:r,floating:i}=e,a=io(t),o=ao(t),s=ro(o),c=eo(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}}let m=to(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function xo(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}=$a(t,e),p=vo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=yo(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=yo(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 So=50,Co=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:xo},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=bo(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<So&&(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}=bo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},wo=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}=$a(e,t)||{};if(l==null)return{};let d=vo(u),f={x:n,y:r},p=ao(i),m=ro(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=Ka(d[_],T),D=Ka(d[v],T),ee=C-h[m]-D,te=C/2-h[m]/2+w,O=Qa(E,te,ee),k=!c.arrow&&to(i)!=null&&te!==O&&a.reference[m]/2-(te<E?E:D)-h[m]/2<0,A=k?te<E?te-E:te-ee:0;return{[p]:f[p]+A,data:{[p]:O,centerOffset:te-O-A,...k&&{alignmentOffset:A}},reset:k}}});function To(e,t,n){return(e?[...n.filter(t=>to(t)===e),...n.filter(t=>to(t)!==e)]:n.filter(e=>eo(e)===e)).filter(n=>!e||to(n)===e||(t?co(n)!==n:!1))}var Eo=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=Ga,autoAlignment:u=!0,...d}=$a(e,t),f=c!==void 0||l===Ga?To(c||null,u,l):l,p=r.autoPlacement?.index||0,m=f[p];if(m==null)return{};if(i!==m)return{reset:{placement:f[0]}};let h=await a.detectOverflow(t,d),g=oo(m,n,await(a.isRTL==null?void 0:a.isRTL(o.floating))),_=[h[eo(m)],h[g[0]],h[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:m,overflows:_}],y=f[p+1];if(y)return{data:{index:p+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=to(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,to(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:p+1,overflows:v},reset:{placement:x}}}}},Do=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}=$a(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=eo(r),_=io(o),v=eo(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[go(o)]:so(o)),x=p!==`none`;!d&&x&&b.push(...ho(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=oo(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`||_===io(t)||T.every(e=>io(e.placement)!==_||e.overflows[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=io(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}if(r!==n)return{reset:{placement:n}}}return{}}}};function Oo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ko(e){return Ua.some(t=>e[t]>=0)}var Ao=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=$a(e,t);switch(i){case`referenceHidden`:{let e=Oo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ko(e)}}}case`escaped`:{let e=Oo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ko(e)}}}default:return{}}}}};function jo(e){let t=Ka(...e.map(e=>e.left)),n=Ka(...e.map(e=>e.top)),r=qa(...e.map(e=>e.right)),i=qa(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Mo(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>yo(jo(e)))}var No=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=$a(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Mo(u),f=yo(jo(u)),p=vo(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(io(n)===`y`){let e=d[0],t=d[d.length-1],r=eo(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return yo({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=eo(n)===`left`,t=qa(...d.map(e=>e.right)),r=Ka(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return yo({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Po=new Set([`left`,`top`]);async function Fo(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=eo(n),s=to(n),c=io(n)===`y`,l=Po.has(o)?-1:1,u=a&&c?-1:1,d=$a(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 Io=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 Fo(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}}}}},Lo=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}=$a(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=io(i),p=no(f),m=u[p],h=u[f],g=(e,t)=>Qa(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Ro=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}=$a(e,t),u={x:n,y:r},d=io(i),f=no(d),p=u[f],m=u[d],h=$a(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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=Po.has(eo(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}}}},zo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=$a(e,t),c=await i.detectOverflow(t,s),l=eo(n),u=to(n),d=io(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Ka(p-c[m],g),y=Ka(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*qa(c.left,c.right):S=p-2*qa(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Bo(){return typeof window<`u`}function Vo(e){return Uo(e)?(e.nodeName||``).toLowerCase():`#document`}function Ho(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function V(e){return((Uo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Uo(e){return Bo()?e instanceof Node||e instanceof Ho(e).Node:!1}function Wo(e){return Bo()?e instanceof Element||e instanceof Ho(e).Element:!1}function Go(e){return Bo()?e instanceof HTMLElement||e instanceof Ho(e).HTMLElement:!1}function Ko(e){return!Bo()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Ho(e).ShadowRoot}function qo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=is(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Jo(e){return/^(table|td|th)$/.test(Vo(e))}function Yo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Xo=/transform|translate|scale|rotate|perspective|filter/,Zo=/paint|layout|strict|content/,Qo=e=>!!e&&e!==`none`,$o;function es(e){let t=Wo(e)?is(e):e;return Qo(t.transform)||Qo(t.translate)||Qo(t.scale)||Qo(t.rotate)||Qo(t.perspective)||!ns()&&(Qo(t.backdropFilter)||Qo(t.filter))||Xo.test(t.willChange||``)||Zo.test(t.contain||``)}function ts(e){let t=ss(e);for(;Go(t)&&!rs(t);){if(es(t))return t;if(Yo(t))return null;t=ss(t)}return null}function ns(){return $o??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),$o}function rs(e){return/^(html|body|#document)$/.test(Vo(e))}function is(e){return Ho(e).getComputedStyle(e)}function as(e){return Wo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ss(e){if(Vo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ko(e)&&e.host||V(e);return Ko(t)?t.host:t}function cs(e){let t=ss(e);return rs(t)?(e.ownerDocument||e).body:Go(t)&&qo(t)?t:cs(t)}function ls(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=cs(e),i=r===e.ownerDocument?.body,a=Ho(r);if(i){let e=us(a);return t.concat(a,a.visualViewport||[],qo(r)?r:[],e&&n?ls(e):[])}return t.concat(r,ls(r,[],n))}function us(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ds(e){let t=is(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Go(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ja(n)!==a||Ja(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function fs(e){return Wo(e)?e:e.contextElement}function ps(e){let t=fs(e);if(!Go(t))return Xa(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ds(t),o=(a?Ja(n.width):n.width)/r,s=(a?Ja(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var ms=Xa(0);function hs(e){let t=Ho(e);return!ns()||!t.visualViewport?ms:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function gs(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Ho(e)}function _s(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=fs(e),o=Xa(1);t&&(r?Wo(r)&&(o=ps(r)):o=ps(e));let s=gs(a,n,r)?hs(a):Xa(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&&r){let e=Ho(a),t=Wo(r)?Ho(r):r,n=e,i=us(n);for(;i&&t!==n;){let e=ps(i),t=i.getBoundingClientRect(),r=is(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=Ho(i),i=us(n)}}return yo({width:u,height:d,x:c,y:l})}function vs(e,t){let n=as(e).scrollLeft;return t?t.left+n:_s(V(e)).left+n}function ys(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vs(e,n),y:n.top+t.scrollTop}}function bs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=V(r),s=t?Yo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Xa(1),u=Xa(0),d=Go(r);if((d||!a)&&((Vo(r)!==`body`||qo(o))&&(c=as(r)),d)){let e=_s(r);l=ps(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ys(o,c):Xa(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 xs(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ss(e){let t=as(e),n=e.ownerDocument.body,r=qa(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=qa(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+vs(e),o=-t.scrollTop;return is(n).direction===`rtl`&&(a+=qa(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Cs=25;function ws(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Ho(e),a=V(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!ns()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(vs(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Cs&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ts(e,t){let n=_s(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ps(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Es(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ws(e,n,t);else if(t===`document`)r=Ss(V(e));else if(Wo(t))r=Ts(t,n);else{let n=hs(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return yo(r)}function Ds(e,t){let n=t.get(e);if(n)return n;let r=ls(e,[],!1).filter(e=>Wo(e)&&Vo(e)!==`body`),i=null,a=is(e).position===`fixed`,o=a?ss(e):e;for(;Wo(o)&&!rs(o);){let e=is(o),t=es(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ss(o)}return t.set(e,r),r}function Os(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Yo(t)?[]:Ds(t,this._c):[].concat(n),r],o=Es(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=Es(t,a[e],i);s=qa(n.top,s),c=Ka(n.right,c),l=Ka(n.bottom,l),u=qa(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function ks(e){let{width:t,height:n}=ds(e);return{width:t,height:n}}function As(e,t,n){let r=Go(t),i=V(t),a=n===`fixed`,o=_s(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Xa(0);if((r||!a)&&((Vo(t)!==`body`||qo(i))&&(s=as(t)),r)){let e=_s(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=vs(i));let l=i&&!r&&!a?ys(i,s):Xa(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function js(e){return is(e).position===`static`}function Ms(e,t){if(!Go(e)||is(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return V(e)===n&&(n=n.ownerDocument.body),n}function Ns(e,t){let n=Ho(e);if(Yo(e))return n;if(!Go(e)){let t=ss(e);for(;t&&!rs(t);){if(Wo(t)&&!js(t))return t;t=ss(t)}return n}let r=Ms(e,t);for(;r&&Jo(r)&&js(r);)r=Ms(r,t);return r&&rs(r)&&js(r)&&!es(r)?n:r||ts(e)||n}var Ps=async function(e){let t=this.getOffsetParent||Ns,n=this.getDimensions,r=await n(e.floating);return{reference:As(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Fs(e){return is(e).direction===`rtl`}var Is={convertOffsetParentRelativeRectToViewportRelativeRect:bs,getDocumentElement:V,getClippingRect:Os,getOffsetParent:Ns,getElementRects:Ps,getClientRects:xs,getDimensions:ks,getScale:ps,isElement:Wo,isRTL:Fs};function Ls(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rs(e,t,n){let r=null,i,a=V(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Ya(d),h=Ya(a.clientWidth-(u+f)),g=Ya(a.clientHeight-(d+p)),_=Ya(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:qa(0,Ka(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ls(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Ho(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function zs(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=fs(e),u=i||a?[...l?ls(l):[],...t?ls(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Rs(l,n,a):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?_s(e):null;c&&g();function g(){let t=_s(e);h&&!Ls(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 Bs=Io,Vs=Eo,Hs=Lo,Us=Do,Ws=zo,Gs=Ao,Ks=wo,qs=No,Js=Ro,Ys=(e,t,n)=>{let r=new Map,i=n??{},a={...Is,...i.platform,_c:r};return Co(e,t,{...i,platform:a})},Xs=typeof document<`u`?_.useLayoutEffect:function(){};function Zs(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(!Zs(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)&&!Zs(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Qs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $s(e,t){let n=Qs(e);return Math.round(t*n)/n}function ec(e){let t=_.useRef(e);return Xs(()=>{t.current=e}),t}function tc(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:c,open:l}=e,[u,d]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Zs(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=ec(c),ee=ec(i),te=ec(l),O=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};ee.current&&(e.platform=ee.current),Ys(C.current,w.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};k.current&&!Zs(T.current,t)&&(T.current=t,Bt.flushSync(()=>{d(t)}))})},[f,t,n,ee,te]);Xs(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=_.useRef(!1);Xs(()=>(k.current=!0,()=>{k.current=!1}),[]),Xs(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,O);O()}},[x,S,O,D,E]);let A=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),ne=_.useMemo(()=>({reference:x,floating:S}),[x,S]),re=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!ne.floating)return e;let t=$s(ne.floating,u.x),r=$s(ne.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Qs(ne.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ne.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:O,refs:A,elements:ne,floatingStyles:re}),[u,O,A,ne,re])}var nc=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?{}:Ks({element:r.current,padding:i}).fn(n):r?Ks({element:r,padding:i}).fn(n):{}}}},rc=(e,t)=>{let n=Bs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ic=(e,t)=>{let n=Hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},ac=(e,t)=>({fn:Js(e).fn,options:[e,t]}),oc=(e,t)=>{let n=Us(e);return{name:n.name,fn:n.fn,options:[e,t]}},sc=(e,t)=>{let n=Ws(e);return{name:n.name,fn:n.fn,options:[e,t]}},cc=(e,t)=>{let n=Gs(e);return{name:n.name,fn:n.fn,options:[e,t]}},lc=(e,t)=>{let n=nc(e);return{name:n.name,fn:n.fn,options:[e,t]}},uc=Object.defineProperty,dc=_.forwardRef(((e,t)=>uc(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(Ut.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),fc=Object.defineProperty,pc=(e,t)=>fc(e,`name`,{value:t,configurable:!0}),mc={Partial:`partial`,Always:`always`},hc={Optimized:`optimized`,Always:`always`},gc=`Popper`,[_c,vc]=Qt(gc),[yc,bc]=_c(gc),xc=pc(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,R.jsx)(yc,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Sc=`PopperAnchor`,Cc=_.forwardRef(pc(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=bc(Sc,n),o=_.useRef(null),s=a.onAnchorChange,c=yt(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Nc(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,R.jsx)(Ut.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),wc=`PopperContent`,[Tc,Ec]=_c(wc),Dc=_.forwardRef(pc(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=mc.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=hc.Optimized,onPlaced:m,...h}=e,g=bc(wc,n),[v,y]=_.useState(null),b=yt(t,y),[x,S]=_.useState(null),C=Ha(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},ee=Array.isArray(l)?l:[l],te=ee.length>0,O={padding:D,boundary:ee.filter(jc),altBoundary:te},{refs:k,floatingStyles:A,placement:ne,isPositioned:re,middlewareData:j}=tc({strategy:`fixed`,placement:E,whileElementsMounted:pc((...e)=>zs(...e,{animationFrame:p===hc.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[rc({mainAxis:i+T,alignmentAxis:o}),c&&ic({mainAxis:!0,crossAxis:!1,...d===mc.Partial?{limiter:ac()}:{},...O}),c&&oc({...O}),sc({...O,apply:pc(({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`)},`apply`)}),x&&lc({element:x,padding:s}),Mc({arrowWidth:w,arrowHeight:T}),f&&cc(te?{strategy:`referenceHidden`,...O}:{strategy:`referenceHidden`,padding:O.padding,altBoundary:O.altBoundary})]}),M=g.setPlacementState;en(()=>(M(ne),()=>{M(void 0)}),[ne,M]);let[ie,ae]=Nc(ne),oe=ir(m);en(()=>{re&&oe?.()},[re,oe]);let se=j.arrow?.x,ce=j.arrow?.y,le=j.arrow?.centerOffset!==0,[ue,de]=_.useState();return en(()=>{v&&de(window.getComputedStyle(v).zIndex)},[v]),(0,R.jsx)(`div`,{ref:k.setFloating,"data-radix-popper-content-wrapper":``,style:{...A,transform:re?A.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ue,"--radix-popper-transform-origin":[j.transformOrigin?.x,j.transformOrigin?.y].join(` `),...j.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(Tc,{scope:n,placedSide:ie,placedAlign:ae,onArrowChange:S,arrowX:se,arrowY:ce,shouldHideArrow:le,children:(0,R.jsx)(Ut.div,{"data-side":ie,"data-align":ae,...h,ref:b,style:{...h.style,animation:re?h.style?.animation:`none`}})})})},`PopperContent`)),Oc=`PopperArrow`,kc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Ac=_.forwardRef(pc(function(e,t){let{__scopePopper:n,...r}=e,i=Ec(Oc,n),a=kc[i.placedSide];return(0,R.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,R.jsx)(dc,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function jc(e){return e!==null}pc(jc,`isNotNull`);var Mc=pc(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]=Nc(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}}}}),`transformOrigin`);function Nc(e){let[t,n=`center`]=e.split(`-`);return[t,n]}pc(Nc,`getSideAndAlignFromPlacement`);var Pc=Object.defineProperty,Fc=(e,t)=>Pc(e,`name`,{value:t,configurable:!0}),Ic=!1;function Lc(){let[e,t]=_.useState(Ic);return _.useEffect(()=>{Ic||(Ic=!0,t(!0))},[]),e}Fc(Lc,`useIsHydrated`);var Rc=_.useSyncExternalStore;function zc(){return()=>{}}Fc(zc,`subscribe`);function Bc(){return Rc(zc,()=>!0,()=>!1)}Fc(Bc,`useIsHydratedModern`);var Vc=typeof Rc==`function`?Bc:Lc,Hc=Object.defineProperty,Uc=(e,t)=>Hc(e,`name`,{value:t,configurable:!0}),Wc=`rovingFocusGroup.onEntryFocus`,Gc={bubbles:!1,cancelable:!0},Kc=`RovingFocusGroup`,[qc,Jc,Yc]=rn(Kc),[Xc,Zc]=Qt(Kc,[Yc]),Qc={Vertical:`vertical`,Horizontal:`horizontal`},$c={LTR:`ltr`,RTL:`rtl`},[el,tl]=Xc(Kc),nl=_.forwardRef(Uc(function(e,t){return(0,R.jsx)(qc.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(qc.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(rl,{...e,ref:t})})})},`RovingFocusGroup`)),rl=_.forwardRef(Uc(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=_.useRef(null),p=yt(t,f),m=er(a),[h,g]=jn({prop:o,defaultProp:s??null,onChange:c,caller:Kc}),[v,y]=_.useState(!1),b=ir(l),x=Jc(n),S=_.useRef(!1),[C,w]=_.useState(0);return _.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Wc,b),()=>e.removeEventListener(Wc,b)},[b]),(0,R.jsx)(el,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:_.useCallback(e=>g(e),[g]),onItemShiftTab:_.useCallback(()=>y(!0),[]),onFocusableItemAdd:_.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:_.useCallback(()=>w(e=>e-1),[]),children:(0,R.jsx)(Ut.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:z(e.onMouseDown,()=>{S.current=!0}),onFocus:z(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(Wc,Gc);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);ll([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:z(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),il=`RovingFocusGroupItem`,al=_.forwardRef(Uc(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Yn(),l=a||c,u=tl(il,n),d=u.currentTabStopId===l,f=Jc(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u,g=Vc();return en(()=>{if(g&&r)return p(),()=>m()},[g,r,p,m]),_.useEffect(()=>{if(!g&&r)return p(),()=>m()},[g,r,p,m]),(0,R.jsx)(qc.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(Ut.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:z(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:z(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:z(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=cl(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?ul(n,r+1):n.slice(r+1)}setTimeout(()=>ll(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})},`RovingFocusGroupItem`)),ol={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function sl(e,t){return t===$c.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Uc(sl,`getDirectionAwareKey`);function cl(e,t,n){let r=sl(e.key,n);if(!(t===Qc.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===Qc.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return ol[r]}Uc(cl,`getFocusIntent`);function ll(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Uc(ll,`focusFirst`);function ul(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Uc(ul,`wrapArray`);var dl=Object.defineProperty,H=(e,t)=>dl(e,`name`,{value:t,configurable:!0}),fl={LTR:`ltr`,RTL:`rtl`},pl=[`Enter`,` `],ml=[`ArrowDown`,`PageUp`,`Home`],hl=[`ArrowUp`,`PageDown`,`End`],gl=[...ml,...hl],_l={ltr:[...pl,`ArrowRight`],rtl:[...pl,`ArrowLeft`]},vl={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},yl=`Menu`,[bl,xl,Sl]=rn(yl),[Cl,wl]=Qt(yl,[Sl,vc,Zc]),Tl=vc(),El=Zc(),[Dl,Ol]=Cl(yl),[kl,Al]=Cl(yl),jl=H(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=Tl(t),[c,l]=_.useState(null),u=_.useRef(!1),d=ir(a),f=er(i);return _.useEffect(()=>{let e=H(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=H(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),_.useEffect(()=>{if(!n)return;let e=H(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,R.jsx)(xc,{...s,children:(0,R.jsx)(Dl,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,R.jsx)(kl,{scope:t,onClose:_.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Ml=_.forwardRef(H(function(e,t){let{__scopeMenu:n,...r}=e,i=Tl(n);return(0,R.jsx)(Cc,{...i,...r,ref:t})},`MenuAnchor`)),Nl=`MenuPortal`,[Pl,Fl]=Cl(Nl,{forceMount:void 0}),Il=H(e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ol(Nl,t);return(0,R.jsx)(Pl,{scope:t,forceMount:n,children:(0,R.jsx)(zn,{present:n||a.open,children:(0,R.jsx)(Vr,{asChild:!0,container:i,children:r})})})},`MenuPortal`),Ll=`MenuContent`,[Rl,zl]=Cl(Ll),Bl=_.forwardRef(H(function(e,t){let n=Fl(Ll,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ol(Ll,e.__scopeMenu),o=Al(Ll,e.__scopeMenu);return(0,R.jsx)(bl.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(zn,{present:r||a.open,children:(0,R.jsx)(bl.Slot,{scope:e.__scopeMenu,children:o.modal?(0,R.jsx)(Vl,{...i,ref:t}):(0,R.jsx)(Hl,{...i,ref:t})})})})},`MenuContent`)),Vl=_.forwardRef(H(function(e,t){let n=Ol(Ll,e.__scopeMenu),r=_.useRef(null),i=yt(t,r);return _.useEffect(()=>{let e=r.current;if(e)return ua(e)},[]),(0,R.jsx)(Wl,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Hl=_.forwardRef(H(function(e,t){let n=Ol(Ll,e.__scopeMenu);return(0,R.jsx)(Wl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),Ul=St(`MenuContent.ScrollLock`),Wl=_.forwardRef(H(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Ol(Ll,n),v=Al(Ll,n),y=Tl(n),b=El(n),x=xl(n),[S,C]=_.useState(null),w=_.useRef(null),[T,E]=_.useState(null);Or(T);let{nodes:D,registry:ee}=Dr(),te=!!(i||m),O=yt(t,w,g.onContentChange,E),k=_.useRef(0),A=_.useRef(``),ne=_.useRef(0),re=_.useRef(null),j=_.useRef(`right`),M=_.useRef(0),ie=_.useMemo(()=>m?[w,...D.map(e=>({current:e}))]:[],[w,D,m]),ae=m?na:_.Fragment,oe=m?{as:Ul,allowPinchZoom:!0,shards:ie}:void 0,se=H(e=>{let t=A.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=bu(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;function s(e){A.current=e,window.clearTimeout(k.current),e!==``&&(k.current=window.setTimeout(()=>s(``),1e3))}H(s,`updateSearch`),s(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);_.useEffect(()=>()=>window.clearTimeout(k.current),[]),qr();let ce=_.useCallback(e=>j.current===re.current?.side&&Su(e,re.current?.area),[]);return(0,R.jsx)(Rl,{scope:n,searchRef:A,onItemEnter:_.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),onItemLeave:_.useCallback(e=>{ce(e)||(w.current?.focus(),C(null))},[ce]),onTriggerLeave:_.useCallback(e=>{ce(e)&&e.preventDefault()},[ce]),pointerGraceTimerRef:ne,onPointerGraceIntentChange:_.useCallback(e=>{re.current=e},[]),children:(0,R.jsx)(Er,{registry:te?ee:null,children:(0,R.jsx)(ae,{...oe,children:(0,R.jsx)(wr,{asChild:!0,trapped:i,branches:D,onMountAutoFocus:z(a,e=>{e.preventDefault(),w.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,R.jsx)(fr,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,R.jsx)(nl,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:z(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,R.jsx)(Dc,{role:`menu`,"aria-orientation":`vertical`,"data-state":hu(g.open),"data-radix-menu-content":``,dir:v.dir,...y,...h,ref:O,style:{outline:`none`,...h.style},onKeyDown:z(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&se(e.key));let i=w.current;if(e.target!==i||!gl.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);hl.includes(e.key)&&a.reverse(),vu(a)}),onBlur:z(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(k.current),A.current=``)}),onPointerMove:z(e.onPointerMove,Cu(e=>{let t=e.target,n=M.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>M.current?`right`:`left`;j.current=t,M.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Gl=_.forwardRef(H(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Ut.div,{role:`group`,...r,ref:t})},`MenuGroup`)),Kl=_.forwardRef(H(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Ut.div,{...r,ref:t})},`MenuLabel`)),ql=`MenuItem`,Jl=`menu.itemSelect`,Yl=_.forwardRef(H(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=_.useRef(null),o=Al(ql,e.__scopeMenu),s=zl(ql,e.__scopeMenu),c=yt(t,a),l=_.useRef(!1),u=H(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Jl,{bubbles:!0,cancelable:!0});e.addEventListener(Jl,e=>r?.(e),{once:!0}),Wt(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,R.jsx)(Xl,{...i,ref:c,disabled:n,onClick:z(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:z(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:z(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&pl.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Xl=_.forwardRef(H(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=zl(ql,n),s=El(n),c=_.useRef(null),l=yt(t,c),[u,d]=_.useState(!1),[f,p]=_.useState(``);return _.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,R.jsx)(bl.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,R.jsx)(al,{asChild:!0,...s,focusable:!r,children:(0,R.jsx)(Ut.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:z(e.onPointerMove,Cu(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:z(e.onPointerLeave,Cu(e=>o.onItemLeave(e))),onFocus:z(e.onFocus,()=>d(!0)),onBlur:z(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),[Zl,Ql]=Cl(`MenuRadioGroup`,{value:void 0,onValueChange:H(()=>{},`onValueChange`)}),$l=_.forwardRef(H(function(e,t){let{value:n,onValueChange:r,...i}=e,a=ir(r);return(0,R.jsx)(Zl,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,R.jsx)(Gl,{...i,ref:t})})},`MenuRadioGroup`)),eu=`MenuRadioItem`,tu=_.forwardRef(H(function(e,t){let{value:n,...r}=e,i=Ql(eu,e.__scopeMenu),a=n===i.value;return(0,R.jsx)(ru,{scope:e.__scopeMenu,checked:a,children:(0,R.jsx)(Yl,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":_u(a),onSelect:z(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})},`MenuRadioItem`)),nu=`MenuItemIndicator`,[ru,iu]=Cl(nu,{checked:!1}),au=_.forwardRef(H(function(e,t){let{__scopeMenu:n,forceMount:r,...i}=e,a=iu(nu,n);return(0,R.jsx)(zn,{present:r||gu(a.checked)||a.checked===!0,children:(0,R.jsx)(Ut.span,{...i,ref:t,"data-state":_u(a.checked)})})},`MenuItemIndicator`)),ou=_.forwardRef(H(function(e,t){let{__scopeMenu:n,...r}=e;return(0,R.jsx)(Ut.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),su=`MenuSub`,[cu,lu]=Cl(su),uu=H(e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ol(su,t),o=Tl(t),[s,c]=_.useState(null),[l,u]=_.useState(null),d=ir(i);return _.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,R.jsx)(xc,{...o,children:(0,R.jsx)(Dl,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,R.jsx)(cu,{scope:t,contentId:Yn(),triggerId:Yn(),trigger:s,onTriggerChange:c,children:n})})})},`MenuSub`),du=`MenuSubTrigger`,fu=_.forwardRef(H(function(e,t){let n=Ol(du,e.__scopeMenu),r=Al(du,e.__scopeMenu),i=lu(du,e.__scopeMenu),a=zl(du,e.__scopeMenu),o=_.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=_.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);_.useEffect(()=>u,[u]),_.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=yt(t,i.onTriggerChange);return(0,R.jsx)(Ml,{asChild:!0,...l,children:(0,R.jsx)(Xl,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":hu(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:z(e.onPointerMove,Cu(t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||n.open||o.current||(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:z(e.onPointerLeave,Cu(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:z(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||(a.searchRef.current===``||t.key!==` `)&&_l[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})},`MenuSubTrigger`)),pu=`MenuSubContent`,mu=_.forwardRef(H(function(e,t){let n=Fl(Ll,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Ol(Ll,e.__scopeMenu),s=Al(Ll,e.__scopeMenu),c=lu(pu,e.__scopeMenu),l=_.useRef(null),u=yt(t,l);return(0,R.jsx)(bl.Provider,{scope:e.__scopeMenu,children:(0,R.jsx)(zn,{present:r||o.open,children:(0,R.jsx)(bl.Slot,{scope:e.__scopeMenu,children:(0,R.jsx)(Wl,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===fl.RTL?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:z(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:z(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:z(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=vl[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})},`MenuSubContent`));function hu(e){return e?`open`:`closed`}H(hu,`getOpenState`);function gu(e){return e===`indeterminate`}H(gu,`isIndeterminate`);function _u(e){return gu(e)?`indeterminate`:e?`checked`:`unchecked`}H(_u,`getCheckedState`);function vu(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}H(vu,`focusFirst`);function yu(e,t){return e.map((n,r)=>e[(t+r)%e.length])}H(yu,`wrapArray`);function bu(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=yu(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}H(bu,`getNextMatch`);function xu(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}H(xu,`isPointInPolygon`);function Su(e,t){return t?xu({x:e.clientX,y:e.clientY},t):!1}H(Su,`isPointerInGraceArea`);function Cu(e){return t=>t.pointerType===`mouse`?e(t):void 0}H(Cu,`whenMouse`);var wu=Object.defineProperty,Tu=(e,t)=>wu(e,`name`,{value:t,configurable:!0}),Eu=`DropdownMenu`,[Du,Ou]=Qt(Eu,[wl]),ku=wl(),[Au,ju]=Du(Eu),Mu=Tu(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=ku(t),l=_.useRef(null),[u,d]=jn({prop:i,defaultProp:a??!1,onChange:o,caller:Eu});return(0,R.jsx)(Au,{scope:t,triggerId:Yn(),triggerRef:l,contentId:Yn(),open:u,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,R.jsx)(jl,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Nu=`DropdownMenuTrigger`,Pu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=ju(Nu,n),o=ku(n),s=yt(t,a.triggerRef);return(0,R.jsx)(Ml,{asChild:!0,...o,children:(0,R.jsx)(Ut.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:z(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:z(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),Fu=Tu(e=>{let{__scopeDropdownMenu:t,...n}=e,r=ku(t);return(0,R.jsx)(Il,{...r,...n})},`DropdownMenuPortal`),Iu=`DropdownMenuContent`,Lu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ju(Iu,n),a=ku(n),o=_.useRef(!1);return(0,R.jsx)(Bl,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:z(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Ru=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(Kl,{...i,...r,ref:t})},`DropdownMenuLabel`)),zu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(Yl,{...i,...r,ref:t})},`DropdownMenuItem`)),Bu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)($l,{...i,...r,ref:t})},`DropdownMenuRadioGroup`)),Vu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(tu,{...i,...r,ref:t})},`DropdownMenuRadioItem`)),Hu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(au,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Uu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(ou,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Wu=Tu(e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=ku(t),[s,c]=jn({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,R.jsx)(uu,{...o,open:s,onOpenChange:c,children:n})},`DropdownMenuSub`),Gu=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(fu,{...i,...r,ref:t})},`DropdownMenuSubTrigger`)),Ku=_.forwardRef(Tu(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=ku(n);return(0,R.jsx)(mu,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuSubContent`)),qu=Object.defineProperty,Ju=(e,t)=>qu(e,`name`,{value:t,configurable:!0}),Yu=`Popover`,[Xu,Zu]=Qt(Yu,[vc]),Qu=vc(),[$u,ed]=Xu(Yu),td=Ju(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Qu(t),c=_.useRef(null),[l,u]=_.useState(!1),[d,f]=_.useState(0),[p,m]=_.useState(0),[h,g]=jn({prop:r,defaultProp:i??!1,onChange:a,caller:Yu});return(0,R.jsx)(xc,{...s,children:(0,R.jsx)($u,{scope:t,contentId:Yn(),titleId:Yn(),descriptionId:Yn(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,triggerRef:c,open:h,onOpenChange:g,onOpenToggle:_.useCallback(()=>g(e=>!e),[g]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),nd=`PopoverAnchor`,rd=_.forwardRef(Ju(function(e,t){let{__scopePopover:n,...r}=e,i=ed(nd,n),a=Qu(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return _.useEffect(()=>(o(),()=>s()),[o,s]),(0,R.jsx)(Cc,{...a,...r,ref:t})},`PopoverAnchor`)),id=`PopoverTrigger`,ad=_.forwardRef(Ju(function(e,t){let{__scopePopover:n,...r}=e,i=ed(id,n),a=Qu(n),o=yt(t,i.triggerRef),s=(0,R.jsx)(Ut.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":gd(i.open),...r,ref:o,onClick:z(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,R.jsx)(Cc,{asChild:!0,...a,children:s})},`PopoverTrigger`)),od=`PopoverPortal`,[sd,cd]=Xu(od,{forceMount:void 0}),ld=Ju(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=ed(od,t);return(0,R.jsx)(sd,{scope:t,forceMount:n,children:(0,R.jsx)(zn,{present:n||a.open,children:(0,R.jsx)(Vr,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),ud=`PopoverContent`,dd=_.forwardRef(Ju(function(e,t){let n=cd(ud,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=ed(ud,e.__scopePopover);return(0,R.jsx)(zn,{present:r||a.open,children:a.modal?(0,R.jsx)(pd,{...i,ref:t}):(0,R.jsx)(md,{...i,ref:t})})},`PopoverContent`)),fd=St(`PopoverContent.RemoveScroll`),pd=_.forwardRef(Ju(function(e,t){let n=ed(ud,e.__scopePopover),r=_.useRef(null),i=yt(t,r),a=_.useRef(!1),{nodes:o,registry:s}=Dr();return _.useEffect(()=>{let e=r.current;if(e)return ua(e)},[]),(0,R.jsx)(na,{as:fd,allowPinchZoom:!0,shards:_.useMemo(()=>[r,...o.map(e=>({current:e}))],[r,o]),children:(0,R.jsx)(hd,{...e,ref:i,branchNodes:o,branchRegistry:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),md=_.forwardRef(Ju(function(e,t){let n=ed(ud,e.__scopePopover),r=_.useRef(!1),i=_.useRef(!1);return(0,R.jsx)(hd,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),hd=_.forwardRef(Ju(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,"aria-describedby":d,branchNodes:f,branchRegistry:p,...m}=e,h=ed(ud,n),g=Qu(n),[v,y]=_.useState(null),b=yt(t,y);return Or(v),qr(),(0,R.jsx)(Er,{registry:p,children:(0,R.jsx)(wr,{asChild:!0,loop:!0,trapped:r,branches:f,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(fr,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>h.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,R.jsx)(Dc,{"data-state":gd(h.open),role:`dialog`,id:h.contentId,"aria-labelledby":h.titlePresent?h.titleId:void 0,"aria-describedby":h.descriptionPresent?_d(d,h.descriptionId):d,...g,...m,ref:b,style:{...m.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})})},`PopoverContentImpl`));function gd(e){return e?`open`:`closed`}Ju(gd,`getState`);function _d(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Ju(_d,`concatAriaDescribedby`);var vd=Object.defineProperty,yd=(e,t)=>vd(e,`name`,{value:t,configurable:!0}),[bd,xd]=Qt(`Tooltip`,[vc]),Sd=vc(),Cd=`TooltipProvider`,wd=700,Td=`tooltip.open`,[Ed,Dd]=bd(Cd),Od=yd(e=>{let{__scopeTooltip:t,delayDuration:n=wd,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=_.useRef(!0),s=_.useRef(!1),c=_.useRef(0);return _.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(Ed,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:_.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:_.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),kd=`Tooltip`,[Ad,jd]=bd(kd),Md=yd(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Dd(kd,e.__scopeTooltip),l=Sd(t),[u,d]=_.useState(null),[f,p]=_.useState(void 0),m=Yn(),h=_.useRef(0),g=o??c.disableHoverableContent,v=s??c.delayDuration,y=_.useRef(!1),[b,x]=jn({prop:r,defaultProp:i??!1,onChange:yd(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Td))):c.onClose(),a?.(e)},`onChange`),caller:kd}),S=_.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,x(!0)},[x]),w=_.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),T=_.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,x(!0),h.current=0},v)},[v,x]);_.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let E=f??m;return(0,R.jsx)(xc,{...l,children:(0,R.jsx)(Ad,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:_.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:_.useCallback(()=>{g?w():(window.clearTimeout(h.current),h.current=0)},[w,g]),onOpen:C,onClose:w,disableHoverableContent:g,children:n})})},`Tooltip`),Nd=`TooltipTrigger`,Pd=_.forwardRef(yd(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=jd(Nd,n),o=Dd(Nd,n),s=Sd(n),c=yt(t,_.useRef(null),a.onTriggerChange),l=_.useRef(!1),u=_.useRef(!1),d=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,R.jsx)(Cc,{asChild:!0,...s,children:(0,R.jsx)(Ut.button,{"aria-describedby":a.open?Zd(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:c,onPointerMove:z(e.onPointerMove,e=>{e.pointerType!==`touch`&&!u.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),u.current=!0)}),onPointerLeave:z(e.onPointerLeave,()=>{a.onTriggerLeave(),u.current=!1}),onPointerDown:z(e.onPointerDown,()=>{a.open&&a.onClose(),l.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:z(e.onFocus,()=>{l.current||a.onOpen()}),onBlur:z(e.onBlur,a.onClose),onClick:z(e.onClick,a.onClose)})})},`TooltipTrigger`)),Fd=`TooltipPortal`,[Id,Ld]=bd(Fd,{forceMount:void 0}),Rd=yd(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=jd(Fd,t);return(0,R.jsx)(Id,{scope:t,forceMount:n,children:(0,R.jsx)(zn,{present:n||a.open,children:(0,R.jsx)(Vr,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),zd=`TooltipContent`,Bd=_.forwardRef(yd(function(e,t){let n=Ld(zd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=jd(zd,e.__scopeTooltip);return(0,R.jsx)(zn,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(Ud,{side:i,...a,ref:t}):(0,R.jsx)(Vd,{side:i,...a,ref:t})})},`TooltipContent`)),Vd=_.forwardRef(yd(function(e,t){let n=jd(zd,e.__scopeTooltip),r=Dd(zd,e.__scopeTooltip),i=_.useRef(null),a=yt(t,i),[o,s]=_.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=_.useCallback(()=>{s(null),d(!1)},[d]),p=_.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Kd(r,Gd(r,n.getBoundingClientRect())),a=qd(t.getBoundingClientRect()),o=Yd([...i,...a]);s(o),d(!0)},[d]);return _.useEffect(()=>()=>f(),[f]),_.useEffect(()=>{if(c&&u){let e=yd(e=>p(e,u),`handleTriggerLeave`),t=yd(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),_.useEffect(()=>{if(o){let e=yd(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Jd(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,R.jsx)(Ud,{...e,ref:a})},`TooltipContentHoverable`)),Hd=Tt(`TooltipContent`),Ud=_.forwardRef(yd(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=jd(zd,n),u=Sd(n),{onClose:d}=l,[f,p]=_.useState(null),m=yt(t,p);Or(f),_.useEffect(()=>(document.addEventListener(Td,d),()=>document.removeEventListener(Td,d)),[d]),_.useEffect(()=>{if(l.trigger){let e=yd(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:h}=l;return en(()=>(h(a),()=>{h(void 0)}),[a,h]),(0,R.jsx)(fr,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,R.jsxs)(Dc,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(Hd,{children:r}),i?(0,R.jsx)(Jt,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Wd=_.forwardRef(yd(function(e,t){let{__scopeTooltip:n,...r}=e,i=Sd(n);return(0,R.jsx)(Ac,{...i,...r,ref:t})},`TooltipArrow`));function Gd(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}yd(Gd,`getExitSideFromRect`);function Kd(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}yd(Kd,`getPaddedExitPoints`);function qd(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}yd(qd,`getPointsFromRect`);function Jd(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}yd(Jd,`isPointInPolygon`);function Yd(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Xd(t)}yd(Yd,`getHull`);function Xd(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}yd(Xd,`getHullPresorted`);function Zd(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}yd(Zd,`concatAriaDescribedby`);var Qd=C(`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`,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 $d({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?Ct:`button`;return(0,R.jsx)(a,{"data-slot":`button`,"data-variant":t,"data-size":n,className:L(Qd({variant:t,size:n,className:e})),...i})}function ef({title:e,children:t,action:n,alert:r,extra:i}){let a=(0,_.useRef)(null);return(0,_.useEffect)(()=>{r&&a.current?.focus()},[r]),(0,R.jsxs)(`div`,{role:r?`alert`:void 0,className:`mx-auto mt-[16vh] grid max-w-lg justify-items-start gap-4 px-6`,children:[(0,R.jsx)(`h1`,{ref:a,tabIndex:r?-1:void 0,className:`font-display text-3xl font-extrabold tracking-tight [font-stretch:108%] text-balance outline-none`,children:e}),(0,R.jsx)(`p`,{className:`text-muted-foreground`,children:t}),n&&(0,R.jsx)($d,{className:`[@media(pointer:coarse)]:min-h-11`,onClick:n.onClick,children:n.label}),i]})}function tf(){return(0,R.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 px-1`,role:`img`,"aria-label":`Explicaí Studio`,children:[(0,R.jsx)(`img`,{src:`/favicon.svg`,alt:``,width:`26`,height:`26`}),(0,R.jsxs)(`span`,{className:`wordmark whitespace-nowrap text-[21px]`,"aria-hidden":`true`,children:[`explica`,(0,R.jsx)(`span`,{className:`i`,children:`ı`})]}),(0,R.jsx)(`span`,{className:`hidden font-mono text-xs text-muted-foreground lg:inline`,"aria-hidden":`true`,children:`studio`})]})}var nf={"Nenhuma imagem sem uso.":`No unused images.`,"Imagens que nenhuma página usa, contando versões e lixeira, vão para a lixeira.":`Images that no page uses, counting versions and trash, go to the trash.`,Recortar:`Crop`,"Recortar imagem":`Crop image`,"Ferramenta Recortar":`Crop tool`,"Arraste sobre a parte da imagem que deve ficar":`Drag over the part of the image to keep`,"Arraste sobre a parte que deve ficar.":`Drag over the part to keep.`,"Para ajustar o retângulo, use Selecionar (V). Depois aplique.":`To adjust the rectangle, use Select (V). Then apply.`,"Aplicar recorte":`Apply crop`,"Recortar a imagem?":`Crop the image?`,"Recortando…":`Cropping…`,"Recortar e apagar o original":`Crop and delete the original`,"Isto troca o print pela parte recortada. O original será apagado e não dá para voltar.":`This replaces the screenshot with the cropped part. The original is deleted and cannot be restored.`,"{n} marcação será removida":`{n} annotation will be removed`,"{n} marcações serão removidas":`{n} annotations will be removed`,"{n} marcador":`{n} marker`,"{n} marcadores":`{n} markers`,"{n} destaque":`{n} highlight`,"{n} destaques":`{n} highlights`,"{n} seta":`{n} arrow`,"{n} setas":`{n} arrows`,"{n} área clicável":`{n} clickable area`,"{n} áreas clicáveis":`{n} clickable areas`,"Não dá para recortar SVG ou GIF. Use um print em PNG, JPEG ou WebP.":`SVG and GIF cannot be cropped. Use a PNG, JPEG or WebP screenshot.`,"Aplique ou descarte as áreas a ocultar antes de recortar.":`Apply or discard the areas to hide before cropping.`,"O recorte cobre a imagem inteira. Reduza o retângulo.":`The crop covers the whole image. Make the rectangle smaller.`,"A imagem foi recortada, mas as marcações não foram gravadas. Salve de novo.":`The image was cropped, but the annotations were not saved. Save again.`,"Não foi possível recortar. A imagem não foi alterada.":`Could not crop. The image was not changed.`,"Reduzir imagem":`Reduce image`,Reduzir:`Reduce`,Atual:`Current`,Depois:`After`,"Largura (px)":`Width (px)`,Qualidade:`Quality`,"A largura precisa ser menor que a atual. Nunca amplia.":`The width must be smaller than the current one. It never enlarges.`,"Aplique ou descarte o que está pendente antes de reduzir.":`Apply or discard what is pending before reducing.`,"Reduzir a imagem?":`Reduce the image?`,"Reduzindo…":`Reducing…`,"Reduzir e apagar o original":`Reduce and delete the original`,"Isto troca o print por uma versão com menos pixels. O original será apagado e não dá para voltar. As marcações continuam no mesmo lugar.":`This replaces the screenshot with a version with fewer pixels. The original is deleted and cannot be restored. Annotations stay in place.`,"Não foi possível reduzir. A imagem não foi alterada.":`Could not reduce. The image was not changed.`,Ocultar:`Hide`,"Ocultar dados":`Hide sensitive data`,"Ferramenta Ocultar":`Hide tool`,"Arraste sobre o dado que deve sumir":`Drag over the data that must disappear`,"Arraste sobre o dado que deve sumir.":`Drag over the data that must disappear.`,"{n} área a ocultar":`{n} area to hide`,"{n} áreas a ocultar":`{n} areas to hide`,"Aplicar ocultação":`Apply hiding`,Descartar:`Discard`,Estilo:`Style`,Tarja:`Bar`,Desfoque:`Blur`,"Para senha, CPF e números, prefira a tarja.":`For passwords, ID numbers and digits, prefer the bar.`,"Ocultando…":`Hiding…`,"Ocultar e apagar o original":`Hide and delete the original`,"Ocultar as áreas marcadas?":`Hide the marked areas?`,"Isto troca o print por uma versão com as áreas cobertas. O original será apagado e não dá para voltar.":`This replaces the screenshot with a version that has the areas covered. The original will be deleted and this cannot be undone.`,"Esta pasta está no git: o print original continua no histórico depois de ocultar.":`This folder is in git: the original screenshot stays in the history after hiding.`,"Esta pasta está no git: o original continua no histórico, e limpar o histórico é com você.":`This folder is in git: the original stays in the history, and cleaning the history is up to you.`,"Exportações anteriores ainda têm o original. Exporte de novo e apague os arquivos antigos.":`Earlier exports still contain the original. Export again and delete the old files.`,"Não dá para ocultar dados em SVG ou GIF. Use um print em PNG, JPEG ou WebP.":`Hiding data does not work on SVG or GIF. Use a PNG, JPEG or WebP screenshot.`,"Não foi possível ocultar as áreas. A imagem não foi alterada.":`Could not hide the areas. The image was not changed.`,"Sair sem ocultar?":`Leave without hiding?`,"Sair e descartar":`Leave and discard`,"Continuar editando":`Keep editing`,"As áreas a ocultar ainda não foram aplicadas. Se você sair, elas se perdem e o print continua com os dados à mostra.":`The areas to hide have not been applied yet. If you leave, they are lost and the screenshot still shows the data.`,'"{nome}" e {n} subpágina foram para a lixeira.':`"{nome}" and {n} subpage went to the trash.`,'"{nome}" e {n} subpáginas foram para a lixeira.':`"{nome}" and {n} subpages went to the trash.`,'"{nome}" foi para a lixeira.':`"{nome}" went to the trash.`,"{n} arquivo foi para {pasta}.":`{n} file went to {pasta}.`,"{n} arquivos foram para {pasta}.":`{n} files went to {pasta}.`,"As marcações de {file} estão com erro de sintaxe. Corrija ou apague o arquivo.":`The markup in {file} has a syntax error. Fix or delete the file.`,"Nenhuma página está aprovada ou publicada. Aprove uma página ou exporte todas.":`No page is approved or published. Approve a page or export them all.`,"A cor de {label} tem contraste {ratio}:1 com o branco; o mínimo é {min}:1. Escolha uma cor mais escura.":`The {label} color has a contrast of {ratio}:1 with white; the minimum is {min}:1. Choose a darker color.`,"O texto sobre o realce tem contraste {ratio}:1; o mínimo é {min}:1. Escolha um realce mais claro.":`Text over the highlight has a contrast of {ratio}:1; the minimum is {min}:1. Choose a lighter highlight.`,destaque:`accent`,texto:`text`,"título da capa":`cover title`,"título da página":`page title`,"título de nível 1":`level 1 heading`,"título de nível 2":`level 2 heading`,"título de nível 3":`level 3 heading`,"Nenhuma página está aprovada ou publicada. Aprove uma página para usar esta opção.":`No page is approved or published. Approve a page to use this option.`,"{n} página aprovada ou publicada neste manual. As outras ficam de fora.":`{n} approved or published page in this manual. The others are left out.`,"{n} página":`{n} page`,"{n} páginas":`{n} pages`,"Abrir o PDF":`Open the PDF`,"Abrir o arquivo":`Open the file`,Fechar:`Close`,"{n} páginas aprovadas ou publicadas neste manual. As outras ficam de fora.":`{n} approved or published pages in this manual. The others are left out.`,"3 × 3 com cabeçalho":`3 × 3 with header`,aberta:`open`,"Abra um manual para exportar.":`Open a manual to export.`,"Abrir o menu da página":`Open the page menu`,"Adicionar coluna":`Add column`,"Adicionar linha":`Add row`,"agora há pouco":`just now`,"Ainda sendo escrita":`Still being written`,Ajustes:`Settings`,"Algo deu errado.":`Something went wrong.`,Ameixa:`Plum`,"Andar entre as páginas da árvore":`Move between pages in the tree`,"Antes de restaurar":`Before restoring`,Aparência:`Appearance`,Aplicar:`Apply`,Aprovado:`Approved`,"Área clicável":`Clickable area`,"Áreas clicáveis":`Clickable areas`,"Arraste do início até a ponta da seta":`Drag from the start to the tip of the arrow`,"Arraste sobre a área que leva a outra página":`Drag over the area that leads to another page`,"Arraste sobre o que merece atenção":`Drag over what deserves attention`,"As páginas excluídas ficam na pasta .lixeira do manual até você restaurar ou apagar.":`Deleted pages stay in the manual's .lixeira folder until you restore or delete them.`,Atalhos:`Shortcuts`,"Atalhos de teclado":`Keyboard shortcuts`,"Bloco de código":`Code block`,"Buscar página":`Find page`,"Buscar página pelo título":`Find page by title`,"Buscar página pelo título…":`Find page by title…`,"Cada manual vira uma pasta com uma página em Markdown para cada tela ou tarefa. Dá para versionar no git junto com o código.":`Each manual becomes a folder with one Markdown page per screen or task. You can version it in git next to the code.`,'Cada página entra com a "Versão do manual" ou, sem ela, com o texto atual.':`Each page goes in with the "Manual version" or, without one, with the current text.`,"Caminho da página":`Page path`,Cancelar:`Cancel`,"Carregando as marcações…":`Loading markups…`,"Carregando…":`Loading…`,Citação:`Quote`,Claro:`Light`,"Clique numa marcação para selecionar e arraste para mover; Delete exclui":`Click a markup to select it and drag to move it; Delete removes it`,"Clique onde o número deve ficar":`Click where the number should go`,Cobalto:`Cobalt`,"Código no texto":`Inline code`,"Comandos e trechos de código":`Commands and code snippets`,"Conferida, pode ir para o manual":`Checked, can go into the manual`,"Conteúdo da página":`Page content`,"Criar a primeira página":`Create the first page`,"Criar manual":`Create manual`,"Descrição da imagem":`Image description`,Desfazer:`Undo`,Destaque:`Highlight`,"Destaque {n}":`Highlight {n}`,"Destaques e setas":`Highlights and arrows`,"Destino da área {n}":`Target of area {n}`,"Editar link":`Edit link`,"Em revisão":`In review`,"Endereço da área {n}":`Address of area {n}`,"Endereço inválido. Exemplo: https://exemplo.com.br":`Invalid address. Example: https://example.com`,"Endereço na web…":`Web address…`,"Endereço não pode ter espaços. Para ligar a outra página, escolha na lista.":`An address can't have spaces. To link to another page, pick it from the list.`,"Enter no título":`Enter in the title`,"Erro {status}":`Error {status}`,"Escolha um manual":`Choose a manual`,"Escolha uma ferramenta e clique ou arraste sobre a imagem. Cada marcador numerado ganha uma linha aqui para você escrever o que ele mostra.":`Pick a tool and click or drag over the image. Each numbered marker gets a line here for you to write what it shows.`,"Esconder as páginas ({atalho})":`Hide pages ({atalho})`,"Escreva aqui, ou digite / para inserir um bloco. Cole um print com Ctrl+V.":`Write here, or type / to insert a block. Paste a screenshot with Ctrl+V.`,Escrevendo:`Writing`,Escuro:`Dark`,Esmeralda:`Emerald`,"Esta versão não tem texto.":`This version has no text.`,"Etapa da página":`Page stage`,"Ex.: Manual do Financeiro":`E.g.: Billing manual`,"Ex.: Tela de clientes com o botão Novo cliente":`E.g.: Customers screen with the New customer button`,"excluída {quando}":`deleted {quando}`,"Excluir {nome}":`Delete {nome}`,"Excluir a marcação selecionada":`Delete the selected markup`,"Excluir área {n}":`Delete area {n}`,"Excluir marcador {n}":`Delete marker {n}`,"Excluir página":`Delete page`,"Excluir página e {n} subpágina":`Delete page and {n} subpage`,"Excluir página e {n} subpáginas":`Delete page and {n} subpages`,"Exportando…":`Exporting…`,"Gerando PDF…":`Generating PDF…`,"Pode levar alguns segundos.":`This can take a few seconds.`,"{formato} exportado":`{formato} exported`,"Arquivo, dentro da pasta do manual":`File, inside the manual folder`,"Atenção: {n} aviso":`Warning: {n} notice`,"Atenção: {n} avisos":`Warning: {n} notices`,"Copiar caminho":`Copy path`,"Caminho copiado":`Path copied`,Exportar:`Export`,"Exportar manual":`Export manual`,"Falta o domínio, por exemplo: exemplo.com.br":`The domain is missing, for example: example.com`,"Ferramentas de marcação":`Markup tools`,"Ferramenta Selecionar":`Select tool`,"Ferramenta Marcador":`Marker tool`,"Ferramenta Destaque":`Highlight tool`,"Ferramenta Seta":`Arrow tool`,"Ferramenta Área clicável":`Clickable area tool`,"Ficou de fora: {motivo}":`Left out: {motivo}`,Formatação:`Formatting`,Formato:`Format`,Grafite:`Graphite`,"Guardar versão":`Save version`,'Guarde o texto como está agora para voltar a ele depois. A "Versão do manual" é a que vai para o manual final. Sem ela, vale o texto atual.':`Save the text as it is now to come back to it later. The "Manual version" is the one that goes into the final manual. Without one, the current text is used.`,Idioma:`Language`,"Idioma da interface":`Interface language`,"Muda só o Studio, neste navegador.":`Changes only the Studio, in this browser.`,Imagem:`Image`,"Colar print":`Paste screenshot`,"Inserir bloco":`Insert block`,"Inserir bloco: título, passos, imagem, tabela…":`Insert block: heading, steps, image, table…`,"Ir para o texto da página":`Go to the page text`,Itálico:`Italic`,"Itens sem ordem":`Unordered items`,"Já está no manual entregue":`Already in the delivered manual`,Legenda:`Legend`,"Legenda da imagem":`Image legend`,"Sem descrição":`No description`,Link:`Link`,"Link para outra página ou endereço":`Link to another page or address`,"Link para uma página ou endereço":`Link to a page or address`,Lista:`List`,Lixeira:`Trash`,"Lixeira deste manual":`Trash for this manual`,"Mais ações para {nome}":`More actions for {nome}`,Manual:`Manual`,"Manuais nesta pasta":`Manuals in this folder`,Marcador:`Marker`,"Marcando imagens":`Marking up images`,"Editar imagem":`Edit image`,"Tamanho da imagem":`Image size`,"Não foi possível salvar o tamanho.":`Could not save the size.`,Pequena:`Small`,Média:`Medium`,Larga:`Wide`,"Com {n} marcadores, a imagem pequena pode amontoá-los. Experimente Média.":`With {n} markers, a small image may crowd them. Try Medium.`,"Markdown para IA":`Markdown for AI`,"Mostrar as páginas ({atalho})":`Show pages ({atalho})`,"Mostrar ou esconder as páginas":`Show or hide pages`,Mover:`Move`,"Mover a página para cima ou para baixo":`Move the page up or down`,"Mover para a lixeira":`Move to trash`,"Muda só o Studio, neste navegador. A cor do manual fica em Exportar manual.":`Only changes the Studio, in this browser. The manual color is in Export manual.`,"Não foi possível abrir o Studio.":`Could not open the Studio.`,"Não foi possível enviar a imagem.":`Could not upload the image.`,"Não foi possível exportar o manual.":`Could not export the manual.`,"Não foi possível salvar as marcações.":`Could not save the markups.`,"Não foi possível salvar. O texto continua na tela.":`Could not save. Your text is still on screen.`,"Aguardando sua escolha":`Waiting for your choice`,Negrito:`Bold`,"Nenhum bloco com esse nome.":`No block with that name.`,"Nenhuma página ainda.":`No pages yet.`,"Nenhuma página com esse título.":`No page with that title.`,"Nenhuma página excluída.":`No deleted pages.`,"Há alterações sem salvar. Salve antes de limpar as imagens.":`There are unsaved changes. Save before cleaning up images.`,"Nenhuma versão guardada ainda.":`No saved versions yet.`,"Nesta página":`On this page`,"No Mac, use Cmd no lugar de Ctrl.":`On a Mac, use Cmd instead of Ctrl.`,"Nome da página ou https://…":`Page name or https://…`,"Nome da versão (opcional)":`Version name (optional)`,"Nome da versão (opcional), ex.: Revisada pelo suporte":`Version name (optional), e.g.: Reviewed by support`,"Nome do manual":`Manual name`,"Nova página":`New page`,"Nova subpágina":`New subpage`,"Nova subpágina em {nome}":`New subpage in {nome}`,"Novo manual":`New manual`,"O manual final usa a Versão do manual desta página. O que você escrever aqui só entra nele quando você voltar para o texto atual.":`The final manual uses this page's Manual version. What you write here only goes into it when you switch back to the current text.`,"O que a pessoa vê depois do passo":`What the person sees after the step`,"O que este marcador mostra?":`What does this marker show?`,"O que o marcador {n} mostra":`What marker {n} shows`,"Página: {titulo}":`Page: {titulo}`,Páginas:`Pages`,"Páginas do manual":`Manual pages`,"Páginas encontradas":`Pages found`,"Para baixo":`Down`,"Para cima":`Up`,"Para dentro da anterior":`Into the previous one`,"Para fora":`Out one level`,"Para imprimir ou mandar por e-mail.":`To print or send by email.`,"Parágrafo comum":`Plain paragraph`,"Passos numerados":`Numbered steps`,"Print da tela do sistema":`Screenshot of the system`,"Pronta para alguém conferir":`Ready for someone to check`,Publicado:`Published`,"Qual sistema você vai explicar?":`Which system are you going to explain?`,"Quem usa leitor de tela e a IA que lê o manual entendem a imagem por aqui.":`Screen reader users and the AI reading the manual understand the image through this.`,Rascunho:`Draft`,"Remover link":`Remove link`,"Remover tabela":`Remove table`,"Inserir linha acima":`Insert row above`,"Inserir linha abaixo":`Insert row below`,"Linha de cabeçalho":`Header row`,"Remover linha":`Remove row`,"Inserir coluna à esquerda":`Insert column to the left`,"Inserir coluna à direita":`Insert column to the right`,"Remover coluna":`Remove column`,"Opções da linha":`Row options`,"Opções da coluna":`Column options`,"Opções da tabela":`Table options`,"Adicionar coluna à direita":`Add column to the right`,"Adicionar linha abaixo":`Add row below`,Restaurar:`Restore`,"Restaurar esta":`Restore this one`,"Resultado esperado":`Expected result`,"Salvando…":`Saving…`,"Salvar marcações":`Save markups`,"Salvo às {hora}":`Saved at {hora}`,"Seção principal":`Main section`,Selecionar:`Select`,"sem nome":`unnamed`,"Sem título":`Untitled`,Seta:`Arrow`,"Seta {n}":`Arrow {n}`,Sistema:`System`,"Agora está escuro, como no seu sistema.":`Dark right now, following your system.`,"Agora está claro, como no seu sistema.":`Light right now, following your system.`,"Site (HTML)":`Website (HTML)`,"Só páginas aprovadas":`Approved pages only`,"Status da página: {status}":`Page status: {status}`,Subseção:`Subsection`,Tabela:`Table`,Tema:`Theme`,"Tentar de novo":`Try again`,"Esta página foi alterada fora do Studio depois que você a abriu. Recarregue do disco ou mantenha a sua versão.":`This page was changed outside Studio after you opened it. Reload it from disk or keep your version.`,"Esta página mudou fora do Studio.":`This page changed outside Studio.`,"Manter a minha versão grava o seu texto por cima do arquivo. Recarregar do disco descarta o que você escreveu aqui.":`Keep my version writes your text over the file. Reload from disk discards what you wrote here.`,"Recarregar do disco":`Reload from disk`,"Manter a minha versão":`Keep my version`,Texto:`Text`,"Texto da versão {nome}":`Text of version {nome}`,"Tipo de bloco: {tipo}":`Block type: {tipo}`,"Fonte do manual: {fonte}":`Manual font: {fonte}`,"Fonte do manual inteiro":`Font for the whole manual`,"Tipo de alerta: {tipo}":`Alert type: {tipo}`,Estrutura:`Structure`,"Passo a passo":`Step by step`,Alertas:`Alerts`,Mídia:`Media`,"Alerta: Dica":`Alert: Tip`,"Alerta: Atenção":`Alert: Warning`,"Alerta: Erro":`Alert: Error`,"Alerta: Nota":`Alert: Note`,"Um atalho ou um jeito melhor de fazer":`A shortcut or a better way to do it`,"Algo que exige cuidado":`Something that needs care`,"Um risco que não dá para desfazer":`A risk that cannot be undone`,"Uma informação a mais":`Extra information`,"Tirar do manual":`Remove from manual`,"Título {n}":`Heading {n}`,"Título da página":`Page title`,"Título vazio":`Empty heading`,"Tópico dentro da subseção":`Topic inside the subsection`,"Trecho em destaque ou observação":`Highlighted passage or note`,"Tudo salvo no disco":`All saved to disk`,"Um arquivo para publicar ou abrir no navegador.":`One file to publish or open in the browser.`,"Um arquivo só, com a legenda dos prints em texto.":`A single file, with screenshot legends as text.`,"Um passo por linha, na ordem de uso":`One step per line, in the order of use`,"Uma página por tela ou tarefa do sistema funciona bem. Comece pela que as pessoas mais usam.":`One page per screen or task works well. Start with the one people use most.`,"Usar no manual":`Use in manual`,"Usar o texto atual":`Use the current text`,"Use um endereço http, https ou mailto.":`Use an http, https or mailto address.`,Ver:`View`,"Versão do manual":`Manual version`,"Versão guardada.":`Version saved.`,'Versão restaurada. O texto que estava antes foi guardado como "Antes de restaurar".':`Version restored. The previous text was saved as "Before restoring".`,"Versão sem nome":`Unnamed version`,Versões:`Versions`,"Versões desta página":`Versions of this page`,"Virar subpágina ou subir um nível":`Make it a subpage or move up a level`,"Voltar à lista":`Back to the list`,"Cores do manual":`Manual colors`,"Logo do cliente":`Client logo`,"Aparece na capa e no topo do sumário do HTML e do PDF. PNG, JPG ou SVG, até 1 MB.":`Shown on the cover and at the top of the contents in the HTML and PDF. PNG, JPG or SVG, up to 1 MB.`,"O logo precisa estar na pasta assets/ do manual.":`The logo must be in the manual's assets/ folder.`,"O logo {logo} não está mais no manual. Envie o arquivo de novo.":`The logo {logo} is no longer in the manual. Upload the file again.`,"Enviar logo":`Upload logo`,"Trocar logo":`Replace logo`,"Tirar logo":`Remove logo`,"Logo do manual":`Manual logo`,"Não foi possível enviar o logo.":`Could not upload the logo.`,"O logo precisa ser PNG, JPG ou SVG. Escolha outro arquivo.":`The logo must be PNG, JPG or SVG. Pick another file.`,"O logo passa de {max} MB. Reduza o arquivo e envie de novo.":`The logo is over {max} MB. Shrink the file and upload it again.`,"Cor de realce":`Highlight color`,"Cor de destaque":`Accent color`,"Cor do texto":`Text color`,"Cor padrão":`Default color`,"Formatar seleção":`Format selection`,Azul:`Blue`,Cinza:`Gray`,Laranja:`Orange`,Roxo:`Purple`,Verde:`Green`,Vermelho:`Red`,Padrão:`Default`,"Título da capa":`Cover title`,"Título 1":`Heading 1`,"Título 2":`Heading 2`,"Título 3":`Heading 3`,"Use o formato #2b4fe0.":`Use the format #2b4fe0.`,"Não foi possível salvar a cor.":`Could not save the color.`,"código da cor":`color code`,"Links, números dos passos e marcações dos prints.":`Links, step numbers and markups on screenshots.`,"Capa, “Resultado:” e destaques nas imagens.":`Cover, “Result:” and highlights on images.`,"Texto, títulos e destaque precisam de contraste de 4,5:1 com o branco para a leitura ficar nítida.":`Text, headings and accent need a 4.5:1 contrast with white so reading stays clear.`,"Fonte do texto":`Text font`,"Fonte dos títulos":`Heading font`,padrão:`default`,"A conexão com o Studio voltou.":`The connection to the Studio is back.`,"Não foi possível abrir este manual":`Could not open this manual`,"Criar um manual novo":`Create a new manual`,"Abrir {nome}":`Open {nome}`,"Abrir a primeira página":`Open the first page`,"Abrindo o Studio…":`Opening the Studio…`,"Não foi possível abrir o Studio":`Could not open the Studio`,"O Studio encontrou um erro que não esperava. O texto que já foi salvo continua no disco. Recarregue para continuar; se o erro voltar, copie o código abaixo e conte para quem mantém o projeto.":`The Studio hit an error it did not expect. Text that was already saved is still on disk. Reload to continue; if the error comes back, copy the code below and tell whoever maintains the project.`,"Tentar de novo sem recarregar":`Try again without reloading`,"Recarregar o Studio":`Reload the Studio`,"Algo quebrou *nesta tela*":`Something broke *on this screen*`,"O link pode estar antigo, ou a página foi excluída ou movida para outro lugar do manual.":`The link may be old, or the page was deleted or moved somewhere else in the manual.`,"O link pode estar antigo, ou o manual foi renomeado, movido ou apagado da pasta.":`The link may be old, or the manual was renamed, moved or deleted from the folder.`,"Não achamos *esta página*":`We could not find *this page*`,"Não achamos *este manual*":`We could not find *this manual*`,"O que você escreveu continua nesta tela e será salvo quando o servidor voltar.":`What you wrote is still on this screen and will be saved when the server is back.`,"Sem conexão com o Studio.":`No connection to the Studio.`,"O servidor do Studio foi fechado ou está reiniciando. Quando ele voltar, esta tela abre o Studio sozinha. Se você usa o terminal, confira se o comando explicai ainda está rodando.":`The Studio server was closed or is restarting. When it is back, this screen opens the Studio by itself. If you use the terminal, check that the explicai command is still running.`,"Tentamos de novo sozinhos. Tentativas até agora: {n}.":`We keep trying on our own. Attempts so far: {n}.`,"Tentando de novo…":`Trying again…`,"Tentar agora":`Try now`,"O Studio *não está respondendo*":`The Studio *is not responding*`,"Código copiado.":`Code copied.`,"Copiar código":`Copy code`,Copiado:`Copied`,"Não foi possível falar com o Studio. Ele pode ter sido fechado ou estar reiniciando.":`Could not reach the Studio. It may have been closed or may be restarting.`,"O Studio só aceita pedidos deste computador. Abra-o por localhost ou 127.0.0.1.":`The Studio only accepts requests from this computer. Open it through localhost or 127.0.0.1.`,"O endereço pedido tem um % malformado. Confira o endereço e tente de novo.":`The requested address has a malformed %. Check the address and try again.`,"O Studio recebeu um texto que não está em UTF-8. Salve o conteúdo em UTF-8 e envie de novo.":`The Studio received text that is not UTF-8. Save the content as UTF-8 and send it again.`,"Para gerar o PDF, o Explicaí usa o Chrome, o Edge ou o Chromium da sua máquina, e nenhum foi encontrado. Instale um deles ou informe o caminho na variável EXPLICAI_BROWSER.":`To make the PDF, Explicaí uses Chrome, Edge or Chromium on your computer, and none was found. Install one of them or set its path in the EXPLICAI_BROWSER variable.`,"O Studio só abre *neste computador*":`The Studio only opens *on this computer*`,"O servidor *não conseguiu responder*":`The server *could not respond*`,"Se continuar, feche o comando explicai no terminal e rode de novo.":`If it keeps happening, stop the explicai command in the terminal and run it again.`},rf=`explicai:idioma`;function af(){if(typeof window>`u`)return`pt-BR`;try{let e=localStorage.getItem(rf);if(e===`pt-BR`||e===`en`)return e}catch{}return navigator.language.toLowerCase().startsWith(`pt`)?`pt-BR`:`en`}var of=af(),sf=of===`en`?`en-US`:`pt-BR`;function cf(e){try{localStorage.setItem(rf,e)}catch{}window.location.reload()}function U(e,t){let n=of===`en`?nf[e]??e:e;return t?n.replace(/\{(\w+)\}/g,(e,n)=>String(t[n]??``)):n}function lf(e,t,n,r){return U(e===1?t:n,{n:e,...r})}function uf({code:e}){let[t,n]=(0,_.useState)(!1);return(0,R.jsxs)(`div`,{className:`mt-2 flex max-w-full items-center gap-1 rounded-[3px] border border-dashed border-border py-0.5 pr-1 pl-3 text-xs text-muted-foreground`,children:[(0,R.jsx)(`code`,{className:`min-w-0 py-1.5 font-mono break-words`,children:e}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>{navigator.clipboard?.writeText(e).then(()=>n(!0))},className:`[@media(pointer:coarse)]:min-h-11 shrink-0 rounded-md px-2 py-1.5 font-bold text-primary underline-offset-2 hover:underline`,children:U(t?`Copiado`:`Copiar código`)}),(0,R.jsx)(`span`,{role:`status`,className:`sr-only`,children:t?U(`Código copiado.`):``})]})}var df=class extends Error{code;params;status;constructor(e,t,n={},r=0){super(e),this.code=t,this.params=n,this.status=r}},ff=e=>e instanceof df&&e.code===`offline`,pf=[502,503,504];async function mf(e,t){let n;try{n=await fetch(e,t)}catch{throw new df(`Servidor fora.`,`offline`)}let r=await n.json().catch(()=>({}));if(!n.ok){let{error:e,code:t,params:i}=r;throw!t&&pf.includes(n.status)?new df(`Servidor fora.`,`offline`,{},n.status):new df(e??U(`Erro {status}`,{status:n.status}),t,i,n.status)}return r}var hf=(e,t)=>({method:e,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),gf=e=>`/api/manuals/${encodeURIComponent(e)}`,_f=(e,t)=>`${gf(e)}/pages/${encodeURIComponent(t)}`,vf={listManuals:()=>mf(`/api/manuals`),createManual:(e,t)=>mf(`/api/manuals`,hf(`POST`,{title:e,language:t})),getManual:e=>mf(gf(e)),addPage:(e,t,n)=>mf(`${gf(e)}/pages`,hf(`POST`,{title:t,parentId:n})),getPage:(e,t)=>mf(_f(e,t)),updatePage:(e,t,n,r)=>{let i=hf(`PUT`,n);return mf(_f(e,t),r?{...i,headers:{...i.headers,"if-match":r}}:i)},removePage:(e,t)=>mf(_f(e,t),{method:`DELETE`}),listTrash:e=>mf(`${gf(e)}/trash`),restorePage:(e,t)=>mf(`${gf(e)}/trash/${encodeURIComponent(t)}/restore`,{method:`POST`}),movePage:(e,t,n,r)=>mf(`${_f(e,t)}/move`,hf(`POST`,{parentId:n,index:r})),listVersions:(e,t)=>mf(`${_f(e,t)}/versions`),getVersion:(e,t,n)=>mf(`${_f(e,t)}/versions/${encodeURIComponent(n)}`),saveVersion:(e,t,n)=>mf(`${_f(e,t)}/versions`,hf(`POST`,{note:n})),restoreVersion:(e,t,n)=>mf(`${_f(e,t)}/versions/${encodeURIComponent(n)}/restore`,{method:`POST`}),publishVersion:(e,t,n)=>mf(`${_f(e,t)}/published`,hf(`PUT`,{versionId:n})),listFonts:()=>mf(`/api/fonts`),exportManual:(e,t,n)=>mf(`${gf(e)}/export`,hf(`POST`,{format:t,onlyApproved:n})),setTheme:(e,t)=>mf(`${gf(e)}/theme`,hf(`PUT`,t)),uploadLogo:(e,t)=>mf(`${gf(e)}/logo?name=${encodeURIComponent(t.name||`logo.png`)}`,{method:`POST`,body:t}),getAnnotations:(e,t)=>mf(`${gf(e)}/annotations?asset=${encodeURIComponent(t)}`),saveAnnotations:(e,t,n)=>mf(`${gf(e)}/annotations?asset=${encodeURIComponent(t)}`,hf(`PUT`,n)),inGitRepo:e=>mf(`${gf(e)}/git`),redactAsset:(e,t,n)=>mf(`${gf(e)}/assets/redact?asset=${encodeURIComponent(t)}`,{method:`POST`,body:n}),cleanUnusedAssets:e=>mf(`${gf(e)}/assets/clean`,{method:`POST`}),uploadAsset:(e,t)=>mf(`${gf(e)}/assets?name=${encodeURIComponent(t.name||`imagem.png`)}`,{method:`POST`,body:t})},yf=e=>Number(e).toLocaleString(sf,{minimumFractionDigits:1,maximumFractionDigits:1}),bf=()=>U(`O Studio só aceita pedidos deste computador. Abra-o por localhost ou 127.0.0.1.`),xf={offline:()=>U(`Não foi possível falar com o Studio. Ele pode ter sido fechado ou estar reiniciando.`),"forbidden-host":bf,"forbidden-origin":bf,"invalid-utf8":()=>U(`O Studio recebeu um texto que não está em UTF-8. Salve o conteúdo em UTF-8 e envie de novo.`),"malformed-url":()=>U(`O endereço pedido tem um % malformado. Confira o endereço e tente de novo.`),"annotations-invalid":e=>U(`As marcações de {file} estão com erro de sintaxe. Corrija ou apague o arquivo.`,{file:String(e.file)}),"disk-conflict":()=>U(`Esta página foi alterada fora do Studio depois que você a abriu. Recarregue do disco ou mantenha a sua versão.`),"no-browser":()=>U(`Para gerar o PDF, o Explicaí usa o Chrome, o Edge ou o Chromium da sua máquina, e nenhum foi encontrado. Instale um deles ou informe o caminho na variável EXPLICAI_BROWSER.`),"no-approved-pages":()=>U(`Nenhuma página está aprovada ou publicada. Aprove uma página ou exporte todas.`),"logo-type":()=>U(`O logo precisa ser PNG, JPG ou SVG. Escolha outro arquivo.`),"logo-path":()=>U(`O logo precisa estar na pasta assets/ do manual.`),"logo-missing":e=>U(`O logo {logo} não está mais no manual. Envie o arquivo de novo.`,{logo:String(e.logo)}),"logo-size":e=>U(`O logo passa de {max} MB. Reduza o arquivo e envie de novo.`,{max:String(e.max)}),"low-contrast":e=>U(`A cor de {label} tem contraste {ratio}:1 com o branco; o mínimo é {min}:1. Escolha uma cor mais escura.`,{label:U(String(e.label)),ratio:yf(e.ratio),min:yf(e.min)}),"low-contrast-highlight":e=>U(`O texto sobre o realce tem contraste {ratio}:1; o mínimo é {min}:1. Escolha um realce mais claro.`,{ratio:yf(e.ratio),min:yf(e.min)})};function W(e,t=U(`Algo deu errado.`)){return e instanceof df&&e.code?xf[e.code]?.(e.params)??e.message:e instanceof Error?e.message:t}function Sf(e){return e.split(/\*([^*]+)\*/).map((e,t)=>({text:e,mark:t%2==1})).filter(e=>e.text)}var Cf=e=>e.replaceAll(`*`,``);function wf(e){return ff(e)?`offline`:e instanceof df&&e.code?.startsWith(`forbidden`)?`forbidden`:`server`}function Tf(e){return ff(e)&&e instanceof df?e.status?`HTTP ${e.status}`:`fetch failed`:e instanceof df&&e.status?[`HTTP ${e.status}`,e.code].filter(Boolean).join(` `):e instanceof Error?`${e.name}: ${e.message}`:String(e)}function Ef({title:e,children:t,action:n,secondary:r,technical:i,status:a,standalone:o=!0}){let s=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(s.current?.focus(),!o)return;let t=document.title;return document.title=`${Cf(e)} · Explicaí Studio`,()=>{document.title=t}},[o,e]),(0,R.jsxs)(`div`,{className:`flex min-h-full flex-col bg-background`,children:[o&&(0,R.jsx)(`header`,{className:`mx-auto w-full max-w-5xl px-5 py-5 sm:px-9`,children:(0,R.jsx)(tf,{})}),(0,R.jsx)(`div`,{role:`alert`,className:`mx-auto my-auto grid w-full max-w-5xl px-6 py-12 sm:px-10 [@media(max-height:600px)]:py-6`,children:(0,R.jsxs)(`div`,{className:`grid max-w-2xl justify-items-start gap-5`,children:[(0,R.jsx)(`h1`,{ref:s,tabIndex:-1,className:`font-display text-4xl leading-[1.08] font-extrabold tracking-tight [font-stretch:108%] text-balance outline-none sm:text-5xl`,children:Sf(e).map(e=>e.mark?(0,R.jsx)(`mark`,{className:`-mx-1 rounded-[2px] bg-marca-faixa px-1 text-inherit [box-decoration-break:clone]`,children:e.text},e.text):e.text)}),(0,R.jsx)(`p`,{className:`max-w-prose text-lg text-pretty text-muted-foreground`,children:t}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-5 gap-y-2 pt-1`,children:[(0,R.jsx)($d,{size:`lg`,className:`[@media(pointer:coarse)]:min-h-11`,onClick:n.onClick,children:n.label}),r&&(0,R.jsx)(`button`,{type:`button`,onClick:r.onClick,className:`[@media(pointer:coarse)]:min-h-11 rounded-md px-1 font-bold text-primary underline-offset-4 hover:underline`,children:r.label})]}),a&&(0,R.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`size-2 shrink-0 rounded-full bg-primary motion-safe:animate-pulse`}),a]}),(0,R.jsx)(uf,{code:i})]})})]})}function Df({error:e,onRetry:t,standalone:n=!1}){return(0,R.jsx)(Ef,{standalone:n,title:U(`Algo quebrou *nesta tela*`),action:{label:U(`Recarregar o Studio`),onClick:()=>window.location.reload()},secondary:t&&{label:U(`Tentar de novo sem recarregar`),onClick:t},technical:`${e.name}: ${e.message}`,children:U(`O Studio encontrou um erro que não esperava. O texto que já foi salvo continua no disco. Recarregue para continuar; se o erro voltar, copie o código abaixo e conte para quem mantém o projeto.`)})}var Of=class extends _.Component{state={error:null,key:this.props.resetKey};static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return e.resetKey===t.key?null:{error:null,key:e.resetKey}}componentDidCatch(e,t){console.error(e,t.componentStack)}render(){let{error:e}=this.state;return e?(0,R.jsx)(Df,{error:e,standalone:this.props.root,onRetry:this.props.root?void 0:()=>this.setState({error:null})}):this.props.children}},kf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function Af(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:kf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var jf=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},Mf=e=>{let t=jf(e);return t.charAt(0).toUpperCase()+t.slice(1)},Nf=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Pf={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function Ff(e){return e!=null}function If(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??Pf.width,a=e.size??e.height??Pf.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?Nf(...c):Nf(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??Pf[`stroke-width`])*Number(e.size??e.width??Pf.width)/Number(t.size??t.width??Pf.width):t.strokeWidth??Pf[`stroke-width`];return[`svg`,{...Object.entries(Pf).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&Ff(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&Ff(t.width)&&{[r(`width`)]:t.width},...`height`in t&&Ff(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function Lf(e,t={}){return If(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var Rf=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},zf=(0,_.createContext)({}),Bf=()=>(0,_.useContext)(zf),Vf=(0,_.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:m=2,absoluteStrokeWidth:h=!1,nonScalingStroke:g=!1,color:v=`currentColor`,className:y=``}=Bf()??{},b=!!c||Rf(d),[x,S,C=[]]=Lf(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??m,absoluteStrokeWidth:a??h,nonScalingStroke:o??g,className:Nf(y,s),hasA11yProp:b,attributes:d});return(0,_.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function G(e,t=[],n=[]){let r=typeof e==`string`?Af(e,t,n):e,i=(0,_.forwardRef)(({className:e,...t},n)=>(0,_.createElement)(Vf,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=Mf(r.name)),i}var Hf={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Hf.node;var Uf=G(Hf),Wf={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Wf.node;var Gf=G(Wf),Kf={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};Kf.node;var qf=G(Kf),Jf={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Jf.node;var Yf=G(Jf),Xf={name:`between-horizontal-end`,size:24,node:[[`rect`,{width:`13`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`11xb64`}],[`path`,{d:`m22 15-3-3 3-3`,key:`26chmm`}],[`rect`,{width:`13`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`k6ky7n`}]],aliases:[`between-horizonal-end`]};Xf.node;var Zf=G(Xf),Qf={name:`between-vertical-end`,size:24,node:[[`rect`,{width:`7`,height:`13`,x:`3`,y:`3`,rx:`1`,key:`1fdu0f`}],[`path`,{d:`m9 22 3-3 3 3`,key:`17z65a`}],[`rect`,{width:`7`,height:`13`,x:`14`,y:`3`,rx:`1`,key:`1squn4`}]]};Qf.node;var $f=G(Qf),ep={name:`bold`,size:24,node:[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]};ep.node;var tp=G(ep),np={name:`book-check`,size:24,node:[[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`m9 9.5 2 2 4-4`,key:`1dth82`}]]};np.node;var rp=G(np),ip={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};ip.node;var ap=G(ip),op={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};op.node;var sp=G(op),cp={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};cp.node;var lp=G(cp),up={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};up.node;var dp=G(up),fp={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]};fp.node;var pp=G(fp),mp={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};mp.node;var hp=G(mp),gp={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};gp.node;var _p=G(gp),vp={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};vp.node;var yp=G(vp),bp={name:`code`,size:24,node:[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]};bp.node;var xp=G(bp),Sp={name:`crop`,size:24,node:[[`path`,{d:`M6 2v14a2 2 0 0 0 2 2h14`,key:`ron5a4`}],[`path`,{d:`M18 22V8a2 2 0 0 0-2-2H2`,key:`7s9ehn`}]]};Sp.node;var Cp=G(Sp),wp={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};wp.node;var Tp=G(wp),Ep={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]};Ep.node;var Dp=G(Ep),Op={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Op.node;var kp=G(Op),Ap={name:`eye`,size:24,node:[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Ap.node;var jp=G(Ap),Mp={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};Mp.node;var Np=G(Mp),Pp={name:`grip-horizontal`,size:24,node:[[`circle`,{cx:`12`,cy:`9`,r:`1`,key:`124mty`}],[`circle`,{cx:`19`,cy:`9`,r:`1`,key:`1ruzo2`}],[`circle`,{cx:`5`,cy:`9`,r:`1`,key:`1a8b28`}],[`circle`,{cx:`12`,cy:`15`,r:`1`,key:`1e56xg`}],[`circle`,{cx:`19`,cy:`15`,r:`1`,key:`1a92ep`}],[`circle`,{cx:`5`,cy:`15`,r:`1`,key:`5r1jwy`}]]};Pp.node;var Fp=G(Pp),Ip={name:`grip-vertical`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]};Ip.node;var Lp=G(Ip),Rp={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Rp.node;var zp=G(Rp),Bp={name:`heading-1`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`m17 12 3-2v8`,key:`1hhhft`}]]};Bp.node;var Vp=G(Bp),Hp={name:`heading-3`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2`,key:`68ncm8`}],[`path`,{d:`M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2`,key:`1ejuhz`}]]};Hp.node;var Up=G(Hp),Wp={name:`heading-2`,size:24,node:[[`path`,{d:`M4 12h8`,key:`17cfdx`}],[`path`,{d:`M4 18V6`,key:`1rz3zl`}],[`path`,{d:`M12 18V6`,key:`zqpxq5`}],[`path`,{d:`M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1`,key:`9jr5yi`}]]};Wp.node;var Gp=G(Wp),Kp={name:`highlighter`,size:24,node:[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]};Kp.node;var qp=G(Kp),Jp={name:`image-off`,size:24,node:[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]};Jp.node;var Yp=G(Jp),Xp={name:`image`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]};Xp.node;var Zp=G(Xp),Qp={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Qp.node;var $p=G(Qp),em={name:`italic`,size:24,node:[[`line`,{x1:`19`,x2:`10`,y1:`4`,y2:`4`,key:`15jd3p`}],[`line`,{x1:`14`,x2:`5`,y1:`20`,y2:`20`,key:`bu0au3`}],[`line`,{x1:`15`,x2:`9`,y1:`4`,y2:`20`,key:`uljnxc`}]]};em.node;var tm=G(em),nm={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};nm.node;var rm=G(nm),im={name:`languages`,size:24,node:[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]};im.node;var am=G(im),om={name:`lightbulb`,size:24,node:[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]};om.node;var sm=G(om),cm={name:`link-2`,size:24,node:[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]};cm.node;var lm=G(cm),um={name:`list-indent-decrease`,size:24,node:[[`path`,{d:`M21 5H11`,key:`us1j55`}],[`path`,{d:`M21 12H11`,key:`wd7e0v`}],[`path`,{d:`M21 19H11`,key:`saa85w`}],[`path`,{d:`m7 8-4 4 4 4`,key:`o5hrat`}]],aliases:[`outdent`,`indent-decrease`]};um.node;var dm=G(um),fm={name:`list-indent-increase`,size:24,node:[[`path`,{d:`M21 5H11`,key:`us1j55`}],[`path`,{d:`M21 12H11`,key:`wd7e0v`}],[`path`,{d:`M21 19H11`,key:`saa85w`}],[`path`,{d:`m3 8 4 4-4 4`,key:`1a3j6y`}]],aliases:[`indent`,`indent-increase`]};fm.node;var pm=G(fm),mm={name:`list-ordered`,size:24,node:[[`path`,{d:`M11 5h10`,key:`1cz7ny`}],[`path`,{d:`M11 12h10`,key:`1438ji`}],[`path`,{d:`M11 19h10`,key:`11t30w`}],[`path`,{d:`M4 4h1v5`,key:`10yrso`}],[`path`,{d:`M4 9h2`,key:`r1h2o0`}],[`path`,{d:`M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02`,key:`xtkcd5`}]]};mm.node;var hm=G(mm),gm={name:`list-tree`,size:24,node:[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]};gm.node;var _m=G(gm),vm={name:`list`,size:24,node:[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]};vm.node;var ym=G(vm),bm={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};bm.node;var xm=G(bm),Sm={name:`monitor`,size:24,node:[[`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`}]]};Sm.node;var Cm=G(Sm),wm={name:`moon`,size:24,node:[[`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`}]]};wm.node;var Tm=G(wm),Em={name:`mouse-pointer-2`,size:24,node:[[`path`,{d:`M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z`,key:`edeuup`}]]};Em.node;var Dm=G(Em),Om={name:`move`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]};Om.node;var km=G(Om),Am={name:`octagon-x`,size:24,node:[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]],aliases:[`x-octagon`]};Am.node;var jm=G(Am),Mm={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]};Mm.node;var Nm=G(Mm),Pm={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};Pm.node;var Fm=G(Pm),Im={name:`pen-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]],aliases:[`edit-3`]};Im.node;var Lm=G(Im),Rm={name:`pilcrow`,size:24,node:[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]};Rm.node;var zm=G(Rm),Bm={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Bm.node;var Vm=G(Bm),Hm={name:`quote`,size:24,node:[[`path`,{d:`M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`rib7q0`}],[`path`,{d:`M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z`,key:`1ymkrd`}]]};Hm.node;var Um=G(Hm),Wm={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};Wm.node;var Gm=G(Wm),Km={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Km.node;var qm=G(Km),Jm={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Jm.node;var Ym=G(Jm),Xm={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};Xm.node;var Zm=G(Xm),Qm={name:`sun-moon`,size:24,node:[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715`,key:`xlf6rm`}],[`path`,{d:`M16 12a4 4 0 0 0-4-4`,key:`6vsxu`}],[`path`,{d:`m19 5-1.256 1.256`,key:`1yg6a6`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}]]};Qm.node;var $m=G(Qm),eh={name:`sun`,size:24,node:[[`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`}]]};eh.node;var th=G(eh),nh={name:`table`,size:24,node:[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};nh.node;var rh=G(nh),ih={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};ih.node;var ah=G(ih),oh={name:`triangle-alert`,size:24,node:[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`alert-triangle`]};oh.node;var sh=G(oh),ch={name:`type`,size:24,node:[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]};ch.node;var lh=G(ch),uh={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};uh.node;var dh=G(uh),fh={name:`wifi-off`,size:24,node:[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};fh.node;var ph=G(fh),mh={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};mh.node;var hh=G(mh);function gh(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var _h=e=>{switch(e){case`success`:return bh;case`info`:return Sh;case`warning`:return xh;case`error`:return Ch;default:return null}},vh=Array(12).fill(0),yh=({visible:e,className:t})=>_.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},_.createElement(`div`,{className:`sonner-spinner`},vh.map((e,t)=>_.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),bh=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),xh=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Sh=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Ch=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`,"aria-hidden":`true`},_.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),wh=_.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`},_.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),_.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Th=()=>{let[e,t]=_.useState(document.hidden);return _.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>document.removeEventListener(`visibilitychange`,e)},[]),e},Eh=1,Dh=100,Oh=e=>typeof e?.id==`number`||e?.id?.length>0?e.id:Eh++,kh=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),this.getActiveToasts().forEach(t=>e(t)),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e],this.trimHistory()},this.trimHistory=()=>{let e=this.toasts.length-Dh;e<=0||(this.toasts=this.toasts.filter(t=>e>0&&this.dismissedToasts.has(t.id)?(this.dismissedToasts.delete(t.id),e--,!1):!0))},this.create=e=>{let{message:t,...n}=e,r=Oh(e),i=this.pendingDismissals.get(r);i!==void 0&&(cancelAnimationFrame(i),this.pendingDismissals.delete(r),this.dismissedToasts.delete(r));let a=this.dismissedToasts.has(r),o=e.dismissible===void 0||e.dismissible;return a&&(this.dismissedToasts.delete(r),this.toasts=this.toasts.filter(e=>e.id!==r)),!a&&this.toasts.find(e=>e.id===r)?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:o,title:t}):n):this.addToast({title:t,...n,dismissible:o,id:r}),r},this.dismiss=e=>{if(e==null)return this.getActiveToasts().forEach(e=>{this.dismissedToasts.add(e.id),this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e;this.dismissedToasts.add(e);let t=this.pendingDismissals.get(e);return t!==void 0&&cancelAnimationFrame(t),this.pendingDismissals.set(e,requestAnimationFrame(()=>{this.pendingDismissals.delete(e),this.subscribers.forEach(t=>t({id:e,dismiss:!0}))})),e},this.message=(e,t)=>this.create({...t,message:e,type:void 0}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],_.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(jh(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!_.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=Oh(t);return this.create({...t,jsx:e(n),id:n,type:void 0}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set,this.pendingDismissals=new Map}},Ah=(e,t)=>kh.message(e,t),jh=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,Mh=Object.assign(Ah,{success:kh.success,info:kh.info,warning:kh.warning,error:kh.error,custom:kh.custom,message:kh.message,promise:kh.promise,dismiss:kh.dismiss,loading:kh.loading},{getHistory:()=>kh.toasts,getToasts:()=>kh.getActiveToasts()});gh(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--normal-text);background:var(--normal-bg);border:1px solid var(--normal-border);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{-webkit-user-select:none;user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function Nh(e){return e.label!==void 0}var Ph=3,Fh=`24px`,Ih=`16px`,Lh=4e3,Rh=356,zh=14,Bh=45,Vh=200;function Hh(...e){return e.filter(Boolean).join(` `)}function Uh(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var Wh=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:u,removeToast:d,defaultRichColors:f,closeButton:p,style:m,cancelButtonStyle:h,actionButtonStyle:g,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,ee]=_.useState(null),[te,O]=_.useState(null),[k,A]=_.useState(!1),[ne,re]=_.useState(!1),[j,M]=_.useState(!1),[ie,ae]=_.useState(!1),[oe,se]=_.useState(!1),[ce,le]=_.useState(0),[ue,de]=_.useState(0),fe=_.useRef(n.duration||b||Lh),pe=_.useRef(null),me=_.useRef(null),he=c===0,ge=c+1<=o,_e=n.type,N=_e??`default`,ve=n.dismissible!==!1,ye=n.className||``,be=n.descriptionClassName||``,xe=_.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),Se=_.useMemo(()=>n.closeButton??p,[n.closeButton,p]),Ce=_.useMemo(()=>n.duration||b||Lh,[n.duration,b]),we=_.useRef(0),Te=_.useRef(0),Ee=_.useRef(0),De=_.useRef(null),[Oe,ke]=x.split(`-`),Ae=_.useMemo(()=>s.reduce((e,t,n)=>n>=xe?e:e+t.height,0),[s,xe]),je=Th(),Me=_.useMemo(()=>e.swipeDirections??Uh(x),[e.swipeDirections,x]),P=n.invert||t,Ne=_e===`loading`;Te.current=_.useMemo(()=>xe*S+Ae,[xe,Ae]),_.useEffect(()=>{fe.current=Ce},[Ce]),_.useEffect(()=>{A(!0)},[]),_.useEffect(()=>{let e=me.current;if(e){let t=e.getBoundingClientRect().height;return de(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),_.useLayoutEffect(()=>{if(!k)return;let e=me.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,de(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[k,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Pe=_.useCallback(()=>{re(!0),le(Te.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{d(n)},Vh)},[n,d,a,Te]);_.useEffect(()=>{if(n.promise&&_e===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return u||i||je?(()=>{if(Ee.current<we.current){let e=new Date().getTime()-we.current;fe.current-=e}Ee.current=new Date().getTime()})():fe.current!==1/0&&(we.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Pe()},fe.current)),()=>clearTimeout(e)},[u,i,n,_e,je,Pe]),_.useEffect(()=>{n.delete&&(Pe(),n.onDismiss==null||n.onDismiss.call(n,n))},[Pe,n.delete]);function Fe(){return T?.loading?_.createElement(`div`,{className:Hh(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":_e===`loading`},T.loading):_.createElement(yh,{className:Hh(w?.loader,n?.classNames?.loader),visible:_e===`loading`})}let Ie=n.icon||T?.[_e]||_h(_e);return _.createElement(`li`,{tabIndex:0,ref:me,className:Hh(v,ye,w?.toast,n?.classNames?.toast,w?.[N],n?.classNames?.[N]),"data-sonner-toast":``,"data-rich-colors":n.richColors??f,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":k,"data-promise":!!n.promise,"data-swiped":oe,"data-removed":ne,"data-visible":ge,"data-y-position":Oe,"data-x-position":ke,"data-index":c,"data-front":he,"data-swiping":j,"data-dismissible":ve,"data-type":_e,"data-invert":P,"data-swipe-out":ie,"data-swipe-direction":te,"data-expanded":!!(u||C&&k),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${ne?ce:Te.current}px`,"--initial-height":C?`auto`:`${ue}px`,...m,...n.style},onDragEnd:()=>{M(!1),ee(null),De.current=null},onPointerDown:e=>{e.button!==2&&!Ne&&ve&&(pe.current=new Date,le(Te.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(M(!0),De.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{if(ie||!ve)return;De.current=null;let e=Number(me.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(me.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-pe.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if((D===`x`?Me.includes(e>0?`right`:`left`):Me.includes(t>0?`bottom`:`top`))&&(Math.abs(i)>=Bh||a>.11))le(Te.current),n.onDismiss==null||n.onDismiss.call(n,n),O(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Pe(),ae(!0);else{var o,s;(o=me.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=me.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`),se(!1),M(!1),ee(null)}},onPointerMove:e=>{var t,n;if(!De.current||!ve||window.getSelection()?.toString().length>0)return;let r=e.clientY-De.current.y,i=e.clientX-De.current.x;!D&&(Math.abs(i)>1||Math.abs(r)>1)&&ee(Math.abs(i)>Math.abs(r)?`x`:`y`);let a={x:0,y:0},o=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(Me.includes(`top`)||Me.includes(`bottom`)){if(Me.includes(`top`)&&r<0||Me.includes(`bottom`)&&r>0)a.y=r;else{let e=r*o(r);a.y=Math.abs(e)<Math.abs(r)?e:r}}}else if(D===`x`&&(Me.includes(`left`)||Me.includes(`right`))){if(Me.includes(`left`)&&i<0||Me.includes(`right`)&&i>0)a.x=i;else{let e=i*o(i);a.x=Math.abs(e)<Math.abs(i)?e:i}}(Math.abs(a.x)>0||Math.abs(a.y)>0)&&se(!0),(t=me.current)==null||t.style.setProperty(`--swipe-amount-x`,`${a.x}px`),(n=me.current)==null||n.style.setProperty(`--swipe-amount-y`,`${a.y}px`)}},Se&&!n.jsx&&_e!==`loading`?_.createElement(`button`,{"aria-label":E,"data-disabled":Ne,"data-close-button":!0,onClick:Ne||!ve?()=>{}:()=>{Pe(),n.onDismiss==null||n.onDismiss.call(n,n)},className:Hh(w?.closeButton,n?.classNames?.closeButton)},T?.close??wh):null,(_e||n.icon||n.promise)&&n.icon!==null&&(T?.[_e]!==null||n.icon)?_.createElement(`div`,{"data-icon":``,className:Hh(w?.icon,n?.classNames?.icon)},_e===`loading`?n.icon||Fe():n.promise?Fe():null,_e===`loading`?null:Ie):null,_.createElement(`div`,{"data-content":``,className:Hh(w?.content,n?.classNames?.content)},_.createElement(`div`,{"data-title":``,className:Hh(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?_.createElement(`div`,{"data-description":``,className:Hh(y,be,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),_.isValidElement(n.cancel)?n.cancel:n.cancel&&Nh(n.cancel)?_.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||h,onClick:e=>{Nh(n.cancel)&&ve&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Pe())},className:Hh(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,_.isValidElement(n.action)?n.action:n.action&&Nh(n.action)?_.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||g,onClick:e=>{Nh(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Pe())},className:Hh(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function Gh(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function Kh(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?Ih:Fh;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var qh=_.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:l,mobileOffset:u,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=Ph,toastOptions:g,dir:v=Gh(),gap:y=zh,icons:b,customAriaLabel:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=_.useState([]),T=_.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=_.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,ee]=_.useState([]),[te,O]=_.useState(!1),[k,A]=_.useState(!1),[ne,re]=_.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),j=_.useRef(null),M=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),ie=_.useRef(null),ae=_.useRef(!1),oe=_.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||kh.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return _.useEffect(()=>kh.subscribe(e=>{e.dismiss?requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))}):setTimeout(()=>{Bt.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),_.useEffect(()=>{if(d!==`system`){re(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?re(`dark`):re(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{re(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{re(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),_.useEffect(()=>{C.length<=1&&O(!1)},[C]),_.useEffect(()=>{let e=e=>{if(a.length>0&&a.every(t=>e[t]||e.code===t)){var t;O(!0),(t=j.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===j.current||j.current?.contains(document.activeElement))&&O(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),_.useEffect(()=>{if(j.current)return()=>{ie.current&&(ie.current.focus({preventScroll:!0}),ie.current=null,ae.current=!1)}},[j.current]),_.createElement(`section`,{ref:t,"aria-label":x??`${S} ${M}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0,"data-react-aria-top-layer":!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?_.createElement(`ol`,{key:t,dir:v===`auto`?Gh():v,tabIndex:-1,ref:j,className:c,"data-sonner-toaster":!0,"data-sonner-theme":ne,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${Rh}px`,"--gap":`${y}px`,...m,...Kh(l,u)},onBlur:e=>{ae.current&&!e.currentTarget.contains(e.relatedTarget)&&(ae.current=!1,ie.current&&=(ie.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||ae.current||(ae.current=!0,ie.current=e.relatedTarget)},onMouseEnter:()=>O(!0),onMouseMove:()=>O(!0),onMouseLeave:()=>{k||O(!1)},onDragEnd:()=>O(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||A(!0)},onPointerUp:()=>A(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>_.createElement(Wh,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:r,visibleToasts:h,closeButton:g?.closeButton??s,interacting:k,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,closeButtonAriaLabel:g?.closeButtonAriaLabel,removeToast:oe,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:ee,expandByDefault:o,gap:y,expanded:te,swipeDirections:e.swipeDirections}))):null}))}),Jh=({...e})=>(0,R.jsx)(qh,{theme:`system`,className:`toaster group`,icons:{success:(0,R.jsx)(hp,{className:`size-4`}),info:(0,R.jsx)($p,{className:`size-4`}),warning:(0,R.jsx)(sh,{className:`size-4`}),error:(0,R.jsx)(jm,{className:`size-4`}),loading:(0,R.jsx)(xm,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},...e});function Yh({delayDuration:e=0,...t}){return(0,R.jsx)(Od,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Xh({...e}){return(0,R.jsx)(Md,{"data-slot":`tooltip`,...e})}function Zh({...e}){return(0,R.jsx)(Pd,{"data-slot":`tooltip-trigger`,...e})}function Qh({className:e,sideOffset:t=0,children:n,...r}){return(0,R.jsx)(Rd,{children:(0,R.jsxs)(Bd,{"data-slot":`tooltip-content`,sideOffset:t,className:L(`z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 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`,e),...r,children:[n,(0,R.jsx)(Wd,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 bg-foreground fill-foreground`})]})})}function $h({checking:e,onRetry:t}){return(0,R.jsxs)(`div`,{role:`alert`,className:`sticky top-0 z-20 flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1 border-b border-destructive/50 bg-[color-mix(in_oklab,var(--destructive)_10%,var(--background))] px-4 py-1 text-sm`,children:[(0,R.jsx)(ph,{className:`size-4 shrink-0 text-destructive`,"aria-hidden":!0}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1 basis-64`,children:[(0,R.jsx)(`strong`,{children:U(`Sem conexão com o Studio.`)}),` `,U(`O que você escreveu continua nesta tela e será salvo quando o servidor voltar.`)]}),(0,R.jsx)(`button`,{type:`button`,onClick:t,disabled:e,className:`[@media(pointer:coarse)]:min-h-11 rounded-md px-2 font-bold text-primary underline-offset-2 hover:underline disabled:opacity-60`,children:U(e?`Tentando de novo…`:`Tentar agora`)})]})}var eg=`min-h-8 rounded-sm border border-border bg-background px-3 text-sm font-bold hover:bg-muted [@media(pointer:coarse)]:min-h-11`;function tg({onReload:e,onKeep:t}){return(0,R.jsxs)(`div`,{role:`alert`,className:`sticky top-0 z-20 flex shrink-0 flex-wrap items-center gap-x-4 gap-y-2 border-b border-destructive/50 bg-background px-4 py-2 text-sm`,children:[(0,R.jsx)(sh,{className:`size-4 shrink-0 text-destructive`,"aria-hidden":!0}),(0,R.jsxs)(`p`,{className:`min-w-0 flex-1 basis-72`,children:[(0,R.jsx)(`strong`,{children:U(`Esta página mudou fora do Studio.`)}),` `,U(`Manter a minha versão grava o seu texto por cima do arquivo. Recarregar do disco descarta o que você escreveu aqui.`)]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:t,className:eg,children:U(`Manter a minha versão`)}),(0,R.jsx)(`button`,{type:`button`,onClick:e,className:eg,children:U(`Recarregar do disco`)})]})]})}function ng({kind:e,address:t,action:n,secondary:r}){return(0,R.jsx)(Ef,{title:U(e===`manual`?`Não achamos *este manual*`:`Não achamos *esta página*`),action:n,secondary:r,technical:`404 ${t}`,children:U(e===`manual`?`O link pode estar antigo, ou o manual foi renomeado, movido ou apagado da pasta.`:`O link pode estar antigo, ou a página foi excluída ou movida para outro lugar do manual.`)})}function rg({error:e,onRetry:t}){let n=wf(e)===`forbidden`;return(0,R.jsx)(Ef,{title:U(n?`O Studio só abre *neste computador*`:`O servidor *não conseguiu responder*`),action:{label:U(`Tentar de novo`),onClick:t},technical:Tf(e),children:n?U(`O Studio só aceita pedidos deste computador. Abra-o por localhost ou 127.0.0.1.`):`${W(e,U(`Algo deu errado.`))} ${U(`Se continuar, feche o comando explicai no terminal e rode de novo.`)}`})}function ig({attempt:e,checking:t,onRetry:n,code:r}){return(0,R.jsx)(Ef,{title:U(`O Studio *não está respondendo*`),action:{label:U(`Tentar agora`),onClick:n},technical:r,status:t?U(`Tentando de novo…`):U(`Tentamos de novo sozinhos. Tentativas até agora: {n}.`,{n:e}),children:U(`O servidor do Studio foi fechado ou está reiniciando. Quando ele voltar, esta tela abre o Studio sozinha. Se você usa o terminal, confira se o comando explicai ainda está rodando.`)})}function ag({className:e,type:t,...n}){return(0,R.jsx)(`input`,{type:t,"data-slot":`input`,className:L(`h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none 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 placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40`,e),...n})}function og({firstRun:e,onCreate:t,onCancel:n}){let[r,i]=(0,_.useState)(``),a=r.trim();return(0,R.jsxs)(`form`,{className:`mx-auto mt-[16vh] grid max-w-lg gap-5 px-6`,onSubmit:e=>{e.preventDefault(),a&&t(a)},children:[(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(`h1`,{className:`font-display text-3xl font-extrabold tracking-tight [font-stretch:108%] text-balance`,children:U(e?`Qual sistema você vai explicar?`:`Novo manual`)}),(0,R.jsx)(`p`,{className:`text-muted-foreground`,children:U(`Cada manual vira uma pasta com uma página em Markdown para cada tela ou tarefa. Dá para versionar no git junto com o código.`)})]}),(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(`label`,{htmlFor:`new-manual-title`,className:`text-sm font-bold`,children:U(`Nome do manual`)}),(0,R.jsx)(ag,{id:`new-manual-title`,autoFocus:!0,value:r,onChange:e=>i(e.target.value),placeholder:U(`Ex.: Manual do Financeiro`),className:`h-10 bg-card text-base`})]}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)($d,{type:`submit`,disabled:!a,children:U(`Criar manual`)}),!e&&(0,R.jsx)($d,{type:`button`,variant:`ghost`,onClick:n,children:U(`Cancelar`)})]})]})}function sg({...e}){return(0,R.jsx)(va,{"data-slot":`dialog`,...e})}function cg({...e}){return(0,R.jsx)(ba,{"data-slot":`dialog-trigger`,...e})}function lg({...e}){return(0,R.jsx)(wa,{"data-slot":`dialog-portal`,...e})}function ug({className:e,...t}){return(0,R.jsx)(Ea,{"data-slot":`dialog-overlay`,className:L(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function dg({className:e,children:t,showCloseButton:n=!0,...r}){return(0,R.jsxs)(lg,{"data-slot":`dialog-portal`,children:[(0,R.jsx)(ug,{}),(0,R.jsxs)(Aa,{"data-slot":`dialog-content`,className:L(`fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none 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 sm:max-w-lg`,e),...r,children:[t,n&&(0,R.jsxs)(La,{"data-slot":`dialog-close`,className:`absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,R.jsx)(hh,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:U(`Fechar`)})]})]})]})}function fg({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`dialog-header`,className:L(`flex flex-col gap-2 text-center sm:text-left`,e),...t})}function pg({className:e,showCloseButton:t=!1,children:n,...r}){return(0,R.jsxs)(`div`,{"data-slot":`dialog-footer`,className:L(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,R.jsx)(La,{asChild:!0,children:(0,R.jsx)($d,{variant:`outline`,children:`Close`})})]})}function mg({className:e,...t}){return(0,R.jsx)(Pa,{"data-slot":`dialog-title`,className:L(`text-lg leading-none font-semibold`,e),...t})}function hg({className:e,...t}){return(0,R.jsx)(Fa,{"data-slot":`dialog-description`,className:L(`text-sm text-muted-foreground`,e),...t})}function gg(e){return e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase().trim()}function _g(e){try{return decodeURIComponent(e)}catch{return e}}function vg(){let[e,t]=window.location.hash.replace(/^#\/?/,``).split(`/`).map(_g);return{slug:e||null,pageId:t||null}}function yg({slug:e,pageId:t}){let n=e?`#/${encodeURIComponent(e)}${t?`/${encodeURIComponent(t)}`:``}`:`#/`;window.location.hash!==n&&window.history.replaceState(null,``,n)}function bg(e,t){for(let n of e){if(n.id===t)return n;let e=bg(n.children,t);if(e)return e}return null}function xg(e,t,n=null){for(let r of e){if(r.id===t)return{parentId:n,siblings:e};let i=xg(r.children,t,r.id);if(i)return i}return null}function Sg(e,t,n){let r=bg(e,t);return r?bg(r.children,n)!==null:!1}function Cg(e,t,n){return e.map(e=>e.id===t?{...e,title:n}:{...e,children:Cg(e.children,t,n)})}function wg(e,t,n,r){if(t===n||Sg(e,t,n))return null;if(r===`inside`)return{parentId:n,index:2**53-1};let i=xg(e,n);if(!i)return null;let a=i.siblings.filter(e=>e.id!==t).findIndex(e=>e.id===n);return{parentId:i.parentId,index:r===`before`?a:a+1}}function Tg(e,t,n){let r=xg(e,t);if(!r)return null;let i=r.siblings.findIndex(e=>e.id===t);switch(n){case`up`:return i>0?{parentId:r.parentId,index:i-1}:null;case`down`:return i<r.siblings.length-1?{parentId:r.parentId,index:i+1}:null;case`indent`:{let e=r.siblings[i-1];return e?{parentId:e.id,index:2**53-1}:null}case`outdent`:{if(!r.parentId)return null;let t=xg(e,r.parentId);if(!t)return null;let n=t.siblings.findIndex(e=>e.id===r.parentId);return{parentId:t.parentId,index:n+1}}}}function Eg(e,t){for(let n of e){if(n.id===t)return[];let e=Eg(n.children,t);if(e.length>0||bg(n.children,t))return[n,...e]}return[]}function Dg(e){return e.flatMap(e=>[e,...Dg(e.children)])}function Og(e){let t=new Map,n=(e,r,i)=>{for(let a of e){if(a.problem){n(a.children,r,i);continue}i.n+=1;let e=r?`${r}.${i.n}`:String(i.n);t.set(a.id,e),n(a.children,e,{n:0})}};return n(e,``,{n:0}),t}function kg(e,t){let n=gg(t),r=[],i=Og(e),a=(e,t)=>{for(let n of e)r.push({item:n,number:i.get(n.id)??``,path:t}),a(n.children,[...t,n.title||U(`Sem título`)])};if(a(e,[]),!n)return r;let o=r.filter(e=>gg(e.item.title).includes(n));return[...o.filter(e=>gg(e.item.title).startsWith(n)),...o.filter(e=>!gg(e.item.title).startsWith(n))]}function Ag(e,t=600){let[n,r]=(0,_.useState)(`idle`),[i,a]=(0,_.useState)(null),o=(0,_.useRef)(new Map),s=(0,_.useRef)(void 0),c=(0,_.useRef)(e);c.current=e;let l=(0,_.useRef)(null),u=(0,_.useCallback)(async()=>{let e=[...o.current.values()];if(o.current.clear(),e.length===0)return;r(`saving`);let t=!1;for(let n of e)try{await c.current(n),a(new Date)}catch{let e=o.current.get(n.id);o.current.set(n.id,{...n,patch:{...n.patch,...e?.patch}}),t=!0}r(t?`error`:o.current.size>0?`saving`:`saved`)},[]),d=(0,_.useCallback)(()=>{window.clearTimeout(s.current);let e=l.current?l.current.then(u):u();return l.current=e,e.then(()=>{l.current===e&&(l.current=null)}),e.then(()=>o.current.size===0)},[u]),f=(0,_.useCallback)((e,n,i)=>{o.current.set(n,{slug:e,id:n,patch:{...o.current.get(n)?.patch,...i}}),r(`saving`),window.clearTimeout(s.current),s.current=window.setTimeout(()=>void d(),t)},[d,t]),p=(0,_.useCallback)(e=>{o.current.delete(e),o.current.size===0&&r(`idle`)},[]);return(0,_.useEffect)(()=>{let e=e=>{o.current.size!==0&&(d(),e.preventDefault())};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[d]),{state:n,savedAt:i,queue:f,flush:d,retry:d,discard:p}}var jg=e=>Math.min(1e3*2**e,15e3);function Mg({check:e,onBack:t,onChange:n}){let r=0,i,a=!1,o=!1,s=()=>n?.({attempt:r,checking:o}),c=()=>{i=setTimeout(()=>void l(),jg(r))};async function l(){if(a||o)return;clearTimeout(i),o=!0,s();let n=await e().then(()=>!0,()=>!1);if(o=!1,!a){if(n)return t();r++,s(),c()}}return c(),{retryNow:()=>void l(),stop:()=>{a=!0,clearTimeout(i)}}}function Ng(e,t,n){let[r,i]=(0,_.useState)({attempt:0,checking:!1}),a=(0,_.useRef)(null),o=(0,_.useRef)({check:t,onBack:n});return o.current={check:t,onBack:n},(0,_.useEffect)(()=>{if(!e)return;i({attempt:0,checking:!1});let t=Mg({check:()=>o.current.check(),onBack:()=>o.current.onBack(),onChange:i});return a.current=t,()=>{t.stop(),a.current=null}},[e]),{...r,retryNow:()=>a.current?.retryNow()}}var Pg=5e3,Fg=e=>e instanceof df&&e.code===`disk-conflict`;function Ig(){let[e,t]=(0,_.useState)(null),[n,r]=(0,_.useState)(null),[i,a]=(0,_.useState)(null),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1),[u,d]=(0,_.useState)(null),[f,p]=(0,_.useState)(null),[m,h]=(0,_.useState)(!1),[g,v]=(0,_.useState)(0),y=(0,_.useRef)(new Map),b=(0,_.useCallback)(e=>{e.version&&y.current.set(e.id,e.version)},[]),x=(0,_.useRef)(null),[S,C]=(0,_.useState)(null),w=(0,_.useRef)(()=>{}),T=(0,_.useCallback)((e,t)=>{x.current={slug:e,id:t},C(t)},[]),E=(0,_.useRef)(new Map),D=(0,_.useRef)(void 0),ee=(0,_.useRef)(async()=>!0),te=(0,_.useCallback)(async()=>{if(window.clearTimeout(D.current),await ee.current())for(let[e,{slug:t,title:n}]of[...E.current]){E.current.delete(e);try{let r=await vf.updatePage(t,e,{title:n,fileName:`sync`},y.current.get(e));b(r),a(e=>e&&e.id===r.id?{...e,file:r.file}:e)}catch(r){E.current.set(e,{slug:t,title:n}),ff(r)?l(!0):Fg(r)&&T(t,e)}}},[b,T]),O=Ag(async e=>{let t=e.patch.title===void 0?e.patch:{...e.patch,fileName:`keep`};if(x.current?.id===e.id)throw T(e.slug,e.id),new df(`disk-conflict`,`disk-conflict`,{},409);let n=await vf.updatePage(e.slug,e.id,t,y.current.get(e.id)).catch(t=>{throw ff(t)?l(!0):Fg(t)&&T(e.slug,e.id),t});b(n),t.fileName&&(E.current.set(e.id,{slug:e.slug,title:n.title}),window.clearTimeout(D.current),D.current=window.setTimeout(()=>void te(),Pg)),a(e=>e&&e.id===n.id?{...e,file:n.file}:e)}),k=O.flush;ee.current=k;let A=(0,_.useCallback)(async()=>{let e=await k();return e&&await te(),e},[k,te]),ne=(0,_.useCallback)(async e=>{try{await e()}catch(e){ff(e)?l(!0):Fg(e)||Mh.error(W(e))}},[]),re=(0,_.useRef)(0),j=(0,_.useCallback)(async(e,t)=>{let n=++re.current,r=t?await vf.getPage(e,t):null;n===re.current&&(r&&b(r),a(r),d(null),yg({slug:e,pageId:t}))},[b]),M=(0,_.useCallback)(async e=>{let t=await vf.getManual(e);return r(t),t},[]),ie=(0,_.useCallback)(async(e,t=null)=>{try{await A(),h(!1),p(null);let n=await M(e),r=t?bg(n.pages,t)?.id:void 0;if(t&&!r){a(null),d({kind:`page`,address:`#/${e}/${t}`});return}await j(e,r??n.pages[0]?.id??null)}catch(t){if(ff(t))return l(!0);r(null),a(null),p({slug:e,error:t})}},[A,M,j]),ae=(0,_.useCallback)(async e=>{let{slug:t,pageId:n}=vg(),i=e.find(e=>e.slug===t);if(t&&!i){r(null),a(null),d({kind:`manual`,address:`#/${t}${n?`/${n}`:``}`});return}let o=i??e[0];o&&await ie(o.slug,i?n:null)},[ie]),oe=(0,_.useCallback)(async()=>{try{let e=await vf.listManuals();t(e),s(null),await ae(e)}catch(e){s(e)}},[ae]);(0,_.useEffect)(()=>{oe()},[oe]);let se=(0,_.useRef)(e);se.current=e,(0,_.useEffect)(()=>{let e=()=>se.current&&void ae(se.current);return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[ae]);let ce=c||e===null&&ff(o),le=Ng(ce,()=>vf.listManuals(),()=>{if(l(!1),e===null)return void oe();n||ae(e),A(),Mh.success(U(`A conexão com o Studio voltou.`))}),ue=e=>ne(async()=>{n&&e!==i?.id&&(await A(),await j(n.slug,e))}),de=e=>ne(async()=>{if(!n)return;await A();let t=await vf.addPage(n.slug,``,e);b(t),re.current++,await M(n.slug),a(t),d(null),yg({slug:n.slug,pageId:t.id})}),fe=(e,t,n)=>ne(async()=>{await vf.restorePage(e,t),await M(e),await j(e,n)});return w.current=e=>ne(async()=>{let t=x.current;t&&(e===`reload`?(await M(t.slug),await j(t.slug,t.id),O.discard(t.id),E.current.delete(t.id),x.current=null,C(null),v(e=>e+1)):(b(await vf.getPage(t.slug,t.id)),x.current=null,C(null),await A()))}),{manuals:e,manual:n,page:i,bootError:o,notFound:u,openError:f,serverDown:ce,reconnect:le,reload:oe,openFromLocation:ae,creatingManual:m,setCreatingManual:h,revision:g,diskConflict:i!==null&&S===i.id,resolveConflict:e=>w.current(e),flush:A,save:{state:S!==null&&O.state===`error`?`conflict`:O.state,savedAt:O.savedAt,retry:O.retry},openManual:ie,selectPage:ue,addPage:de,removePage:e=>ne(async()=>{if(!n)return;let t=n.slug;O.discard(e.id),E.current.delete(e.id);let{trashId:r}=await vf.removePage(t,e.id),a=await M(t);i&&!bg(a.pages,i.id)&&await j(t,a.pages[0]?.id??null);let o=Dg(e.children).length,s=e.title||U(`Sem título`);Mh(o?lf(o,`"{nome}" e {n} subpágina foram para a lixeira.`,`"{nome}" e {n} subpáginas foram para a lixeira.`,{nome:s}):U(`"{nome}" foi para a lixeira.`,{nome:s}),{duration:1e4,action:{label:U(`Desfazer`),onClick:()=>void fe(t,r,e.id)}})}),restorePage:fe,movePage:(e,t,r)=>ne(async()=>{n&&(await vf.movePage(n.slug,e,t,r),await M(n.slug))}),saveVersion:e=>ne(async()=>{n&&i&&(await A(),await vf.saveVersion(n.slug,i.id,e),Mh.success(U(`Versão guardada.`)))}),restoreVersion:e=>ne(async()=>{if(!n||!i)return;await A();let t=await vf.restoreVersion(n.slug,i.id,e);await M(n.slug),b(t),a(t),v(e=>e+1),Mh(U(`Versão restaurada. O texto que estava antes foi guardado como "Antes de restaurar".`))}),publishVersion:e=>ne(async()=>{n&&i&&(await vf.publishVersion(n.slug,i.id,e),await M(n.slug))}),exportManual:async(e,t)=>{if(!n)throw Error(U(`Abra um manual para exportar.`));return await A(),vf.exportManual(n.slug,e,t)},setManualTheme:async e=>{n&&(await vf.setTheme(n.slug,e),await M(n.slug))},uploadManualLogo:async e=>{n&&(await vf.uploadLogo(n.slug,e),await M(n.slug))},setPageStatus:e=>ne(async()=>{if(!n||!i)return;await A();let t;try{t=await vf.updatePage(n.slug,i.id,{status:e},y.current.get(i.id))}catch(t){throw Fg(t)&&O.queue(n.slug,i.id,{status:e}),t}b(t),a(e=>e&&e.id===t.id?{...e,status:t.status}:e),await M(n.slug)}),createManual:e=>ne(async()=>{let n=await vf.createManual(e,sf);t(await vf.listManuals()),await ie(n.slug)}),editPage:e=>{if(n&&i){if(e.title!==void 0){let t=e.title;r(e=>e&&{...e,pages:Cg(e.pages,i.id,t)})}O.queue(n.slug,i.id,e)}},reportError:e=>Mh.error(e)}}var Lg=(0,_.createContext)(null);function Rg({children:e}){return(0,R.jsx)(Lg,{value:Ig(),children:e})}function zg(){let e=(0,_.use)(Lg);if(!e)throw Error(`useStudioContext precisa estar dentro de <StudioProvider>.`);return e}function Bg({...e}){return(0,R.jsx)(Mu,{"data-slot":`dropdown-menu`,...e})}function Vg({...e}){return(0,R.jsx)(Pu,{"data-slot":`dropdown-menu-trigger`,...e})}function Hg({className:e,sideOffset:t=4,...n}){return(0,R.jsx)(Fu,{children:(0,R.jsx)(Lu,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:L(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 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`,e),...n})})}function Ug({className:e,inset:t,variant:n=`default`,...r}){return(0,R.jsx)(zu,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:L(`relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-default data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function Wg({...e}){return(0,R.jsx)(Bu,{"data-slot":`dropdown-menu-radio-group`,...e})}function Gg({className:e,children:t,...n}){return(0,R.jsxs)(Vu,{"data-slot":`dropdown-menu-radio-item`,className:L(`relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:cursor-default data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,R.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,R.jsx)(Hu,{children:(0,R.jsx)(_p,{className:`size-2 fill-current`})})}),t]})}function Kg({className:e,inset:t,...n}){return(0,R.jsx)(Ru,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:L(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function qg({className:e,...t}){return(0,R.jsx)(Uu,{"data-slot":`dropdown-menu-separator`,className:L(`-mx-1 my-1 h-px bg-border`,e),...t})}function Jg({className:e,...t}){return(0,R.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:L(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t})}function Yg({...e}){return(0,R.jsx)(Wu,{"data-slot":`dropdown-menu-sub`,...e})}function Xg({className:e,inset:t,children:n,...r}){return(0,R.jsxs)(Gu,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":t,className:L(`flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_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,R.jsx)(lp,{className:`ml-auto size-4`})]})}function Zg({className:e,...t}){return(0,R.jsx)(Ku,{"data-slot":`dropdown-menu-sub-content`,className:L(`z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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`,e),...t})}var Qg={id:`rascunho`,label:U(`Rascunho`),hint:U(`Ainda sendo escrita`),token:`grafite`},$g=[Qg,{id:`revisao`,label:U(`Em revisão`),hint:U(`Pronta para alguém conferir`),token:`cor-orange`},{id:`aprovado`,label:U(`Aprovado`),hint:U(`Conferida, pode ir para o manual`),token:`cor-green`},{id:`publicado`,label:U(`Publicado`),hint:U(`Já está no manual entregue`),token:`cobalto`}],e_=e=>$g.find(t=>t.id===e)??Qg;function t_({status:e,className:t}){return(0,R.jsx)(`span`,{className:L(`inline-block size-2 shrink-0 rounded-full`,e===`rascunho`?`border-[1.5px] border-current`:`bg-current`,t),"aria-hidden":!0})}function n_({status:e,className:t}){let n=e_(e);return(0,R.jsxs)(`span`,{className:L(`inline-flex shrink-0 items-center gap-1.5`,t),style:{color:`var(--${n.token})`},children:[(0,R.jsx)(t_,{status:e}),n.label]})}function r_({status:e,onChange:t}){return(0,R.jsxs)(Bg,{children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"aria-label":U(`Status da página: {status}`,{status:e_(e).label}),className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium [@media(pointer:coarse)]:min-h-11 hover:bg-muted data-[state=open]:bg-muted`,children:[(0,R.jsx)(n_,{status:e}),(0,R.jsx)(sp,{className:`size-3 text-muted-foreground`,"aria-hidden":!0})]})}),(0,R.jsxs)(Hg,{align:`end`,className:`w-64`,children:[(0,R.jsx)(Kg,{className:`text-xs text-muted-foreground`,children:U(`Etapa da página`)}),(0,R.jsx)(Wg,{value:e,onValueChange:e=>t(e),children:$g.map(e=>(0,R.jsx)(Gg,{value:e.id,className:`items-start`,children:(0,R.jsxs)(`span`,{className:`grid leading-tight`,children:[(0,R.jsx)(`span`,{className:`flex items-center gap-2`,children:(0,R.jsx)(n_,{status:e.id})}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.hint})]})},e.id))})]})]})}function i_({open:e,onOpenChange:t}){let n=zg(),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(0),s=kg(n.manual?.pages??[],r).slice(0,50),c=(0,_.useEffectEvent)(e=>{(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`p`&&n.manual&&(e.preventDefault(),i(``),o(0),t(!0))});(0,_.useEffect)(()=>(window.addEventListener(`keydown`,c),()=>window.removeEventListener(`keydown`,c)),[]);let l=s[a]?.item.id;(0,_.useEffect)(()=>{l&&document.getElementById(`busca-${l}`)?.scrollIntoView({block:`nearest`})},[l]);let u=e=>{t(!1),n.selectPage(e)};return(0,R.jsx)(sg,{open:e,onOpenChange:t,children:(0,R.jsxs)(dg,{showCloseButton:!1,"aria-describedby":void 0,className:`top-[12vh] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-lg`,children:[(0,R.jsx)(mg,{className:`sr-only`,children:U(`Buscar página`)}),(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3`,children:[(0,R.jsx)(qm,{className:`size-4 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,R.jsx)(`input`,{autoFocus:!0,role:`combobox`,"aria-expanded":`true`,"aria-controls":`busca-resultados`,"aria-activedescendant":s[a]?`busca-${s[a].item.id}`:void 0,"aria-label":U(`Buscar página pelo título`),placeholder:U(`Buscar página pelo título…`),value:r,onChange:e=>{i(e.target.value),o(0)},onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;o(e=>(e+t+s.length)%Math.max(s.length,1))}else if(e.key===`Enter`){e.preventDefault();let t=s[a];t&&u(t.item.id)}},className:`h-12 min-w-0 flex-1 bg-transparent text-[15px] outline-none placeholder:text-muted-foreground`})]}),(0,R.jsxs)(`div`,{id:`busca-resultados`,role:`listbox`,"aria-label":U(`Páginas encontradas`),className:`max-h-[50vh] overflow-y-auto p-1`,children:[s.length===0&&(0,R.jsx)(`p`,{className:`px-3 py-6 text-center text-sm text-muted-foreground`,children:U(`Nenhuma página com esse título.`)}),s.map((e,t)=>(0,R.jsxs)(`div`,{id:`busca-${e.item.id}`,role:`option`,tabIndex:-1,"aria-selected":t===a,onMouseMove:()=>o(t),onClick:()=>u(e.item.id),onKeyDown:()=>{},className:L(`flex cursor-pointer items-center gap-2 rounded-md px-3 py-2`,t===a&&`bg-accent`),children:[e.number&&(0,R.jsx)(`span`,{"aria-hidden":!0,className:`shrink-0 font-mono text-xs tabular-nums text-primary`,children:e.number}),(0,R.jsxs)(`span`,{className:`grid min-w-0 flex-1 leading-tight`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm font-bold`,children:e.item.title||U(`Sem título`)}),e.path.length>0&&(0,R.jsx)(`span`,{className:`flex min-w-0 items-center gap-1 truncate text-xs text-muted-foreground`,children:e.path.map((t,n)=>(0,R.jsxs)(`span`,{className:`flex items-center gap-1`,children:[n>0&&(0,R.jsx)(lp,{className:`size-3`,"aria-hidden":!0}),t]},e.path.slice(0,n+1).join(`/`)))})]}),e.item.status!==`rascunho`&&(0,R.jsx)(n_,{status:e.item.status,className:`text-xs font-medium`}),e.item.id===n.page?.id&&(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:U(`aberta`)})]},e.item.id))]})]})})}var a_=`explicai:barra-lateral`,o_=`(min-width: 56.25rem)`;function s_(){try{return localStorage.getItem(a_)===`recolhida`}catch{return!1}}function c_(){let[e,t]=(0,_.useState)(s_),[n,r]=(0,_.useState)(!1),i=e=>{try{localStorage.setItem(a_,e?`recolhida`:`aberta`)}catch{}t(e)},a=()=>window.matchMedia(o_).matches?i(!e):r(!n),o=(0,_.useEffectEvent)(e=>{(e.ctrlKey||e.metaKey)&&e.key===`\\`&&(e.preventDefault(),a())});return(0,_.useEffect)(()=>(window.addEventListener(`keydown`,o),()=>window.removeEventListener(`keydown`,o)),[]),{collapsed:e,drawerOpen:n,toggle:a,collapse:()=>i(!0),expand:()=>i(!1),setDrawerOpen:r}}function l_({manuals:e,current:t,onOpen:n,onCreate:r}){return(0,R.jsxs)(Bg,{children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,className:`group -mx-1 flex w-[calc(100%+0.5rem)] flex-col items-start gap-0.5 rounded-md px-1 py-1 text-left outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring data-[state=open]:bg-muted`,children:[(0,R.jsx)(`span`,{className:`rotulo text-muted-foreground`,children:U(`Manual`)}),(0,R.jsxs)(`span`,{className:`flex w-full items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-display text-lg font-semibold leading-tight [font-stretch:105%]`,children:t?.title??U(`Escolha um manual`)}),(0,R.jsx)(dp,{className:`size-4 shrink-0 text-muted-foreground opacity-0 group-hover:opacity-100 group-focus-visible:opacity-100 group-data-[state=open]:opacity-100 [@media(hover:none)]:opacity-100`,"aria-hidden":!0})]})]})}),(0,R.jsxs)(Hg,{align:`start`,className:`w-(--radix-dropdown-menu-trigger-width) min-w-56`,children:[(0,R.jsx)(Kg,{className:`text-muted-foreground`,children:U(`Manuais nesta pasta`)}),e.map(e=>(0,R.jsxs)(Ug,{onSelect:()=>n(e.slug),children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.title}),e.slug===t?.slug&&(0,R.jsx)(ap,{className:`text-primary`})]},e.slug)),(0,R.jsx)(qg,{}),(0,R.jsxs)(Ug,{onSelect:r,children:[(0,R.jsx)(Vm,{}),` `,U(`Novo manual`)]})]})]})}var u_=[{shift:`up`,label:U(`Para cima`),keys:`Alt+Shift+↑`,Icon:Yf},{shift:`down`,label:U(`Para baixo`),keys:`Alt+Shift+↓`,Icon:Uf},{shift:`indent`,label:U(`Para dentro da anterior`),keys:`Alt+Shift+→`,Icon:pm},{shift:`outdent`,label:U(`Para fora`),keys:`Alt+Shift+←`,Icon:dm}],d_=`grid size-7 place-items-center rounded-md text-muted-foreground hover:bg-secondary hover:text-foreground data-[state=open]:bg-secondary`;function f_({item:e,pages:t,selected:n,menuOpen:r,onMenuOpenChange:i,onAction:a}){let o=e.title||U(`Sem título`),s=Dg(e.children).length;return(0,R.jsxs)(`span`,{className:L(`flex opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100 has-[[data-state=open]]:opacity-100 pointer-coarse:opacity-100`,n&&`opacity-100`),children:[(0,R.jsxs)(Xh,{children:[(0,R.jsx)(Zh,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,tabIndex:-1,className:d_,"aria-label":U(`Nova subpágina em {nome}`,{nome:o}),onClick:()=>a({kind:`addChild`}),children:(0,R.jsx)(Vm,{className:`size-4`})})}),(0,R.jsx)(Qh,{children:U(`Nova subpágina`)})]}),(0,R.jsxs)(Bg,{open:r,onOpenChange:i,children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,tabIndex:-1,className:d_,"aria-label":U(`Mais ações para {nome}`,{nome:o}),children:(0,R.jsx)(Tp,{className:`size-4`})})}),(0,R.jsxs)(Hg,{align:`start`,className:`w-64`,children:[(0,R.jsxs)(Ug,{onSelect:()=>a({kind:`addChild`}),children:[(0,R.jsx)(Vm,{}),` `,U(`Nova subpágina`)]}),(0,R.jsxs)(Yg,{children:[(0,R.jsxs)(Xg,{children:[(0,R.jsx)(km,{className:`size-4 text-muted-foreground`}),` `,U(`Mover`)]}),(0,R.jsx)(Zg,{className:`w-64`,children:u_.map(({shift:n,label:r,keys:i,Icon:o})=>(0,R.jsxs)(Ug,{disabled:!Tg(t,e.id,n),onSelect:()=>a({kind:`shift`,shift:n}),children:[(0,R.jsx)(o,{}),` `,r,(0,R.jsx)(Jg,{children:i})]},n))})]}),(0,R.jsx)(qg,{}),(0,R.jsxs)(Ug,{variant:`destructive`,onSelect:()=>a({kind:`remove`}),children:[(0,R.jsx)(ah,{}),` `,s?lf(s,`Excluir página e {n} subpágina`,`Excluir página e {n} subpáginas`):U(`Excluir página`)]})]})]})]})}var p_={ArrowUp:`up`,ArrowDown:`down`,ArrowRight:`indent`,ArrowLeft:`outdent`};function m_(e,t,n){let r=(0,_.useRef)(null),i=(0,_.useRef)(null);return(0,_.useEffect)(()=>{let t=i.current;t&&e!==void 0&&(i.current=null,r.current?.querySelector(`[data-page-id="${CSS.escape(t)}"]`)?.focus())},[e]),{onKeyDown:e=>{let r=e.target,a=r.dataset.pageId;if(!a)return;let o=p_[e.key];if(e.altKey&&e.shiftKey&&o){e.preventDefault(),i.current=a,t(a,o);return}if(e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`){e.preventDefault(),n(a);return}let s=Array.from(e.currentTarget.querySelectorAll(`[data-page-id]`)),c=s.indexOf(r),l=e.key===`ArrowDown`?c+1:e.key===`ArrowUp`?c-1:e.key===`Home`?0:e.key===`End`?s.length-1:null,u=l===null?void 0:s[l];u&&(e.preventDefault(),u.focus())},root:r}}var h_=`text/x-explicai-page`;function g_(e){let t=e.currentTarget.getBoundingClientRect(),n=(e.clientY-t.top)/t.height;return n<.3?`before`:n>.7?`after`:`inside`}function __({pages:e,selectedId:t,onSelect:n,onAction:r,onMove:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),{onKeyDown:l,root:u}=m_(e,(t,n)=>{let i=bg(e,t);i&&r(i,{kind:`shift`,shift:n})},c),d=t&&bg(e,t)?t:e[0]?.id,f=Og(e),p=(t,n,r)=>{o(null);let a=wg(e,r,t,n);a&&i(r,a.parentId,a.index)},m=(i,h)=>(0,R.jsx)(`ul`,{ref:h===0?u:void 0,className:L(h>0&&`ml-3 border-l border-border pl-1`),onKeyDown:h===0?l:void 0,children:i.map(i=>{let l=a?.id===i.id?a.zone:null,u=i.id===t;return(0,R.jsxs)(`li`,{children:[(0,R.jsxs)(`div`,{className:L(`group relative flex items-center rounded-md pr-1 transition-colors hover:bg-muted`,l===`inside`&&`outline-2 -outline-offset-2 outline-dashed outline-primary`,l===`before`&&`before:absolute before:inset-x-2 before:-top-px before:h-0.5 before:bg-primary`,l===`after`&&`after:absolute after:inset-x-2 after:-bottom-px after:h-0.5 after:bg-primary`),draggable:!0,onDragStart:e=>{e.dataTransfer.setData(h_,i.id),e.dataTransfer.effectAllowed=`move`},onDragOver:e=>{e.dataTransfer.types.includes(h_)&&(e.preventDefault(),o({id:i.id,zone:g_(e)}))},onDragLeave:()=>o(e=>e?.id===i.id?null:e),onDrop:e=>{e.preventDefault();let t=e.dataTransfer.getData(h_);t&&l&&p(i.id,l,t)},children:[(0,R.jsxs)(`button`,{type:`button`,"data-page-id":i.id,tabIndex:i.id===d?0:-1,"aria-current":u?`page`:void 0,onClick:()=>n(i.id),className:`flex min-w-0 flex-1 items-center py-1.5 pl-2 text-left text-[14.5px]`,children:[f.get(i.id)&&(0,R.jsx)(`span`,{"aria-hidden":!0,className:`mr-1.5 inline-block shrink-0 font-mono text-xs tabular-nums text-primary`,children:f.get(i.id)}),(0,R.jsx)(`span`,{title:i.title||(i.problem?i.file.split(`/`).pop():U(`Sem título`)),className:L(`min-w-0 truncate`,u?`bg-[linear-gradient(transparent_50%,var(--marca-faixa)_50%)] font-bold text-foreground`:`text-foreground/85`,!i.title&&`italic text-muted-foreground`),children:i.title||(i.problem?i.file.split(`/`).pop():U(`Sem título`))}),i.status!==`rascunho`&&(0,R.jsx)(n_,{status:i.status,className:`ml-2 text-xs font-medium`}),i.problem&&(0,R.jsxs)(`span`,{title:i.problem,className:`ml-1.5 inline-flex align-[-2px] text-destructive`,children:[(0,R.jsx)(sh,{className:`size-3.5`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`sr-only`,children:i.problem})]})]}),(0,R.jsx)(f_,{item:i,pages:e,selected:u,menuOpen:s===i.id,onMenuOpenChange:e=>c(e?i.id:null),onAction:e=>r(i,e)})]}),i.children.length>0&&m(i.children,h+1)]},i.id)})});return m(e,0)}var v_=[{title:`Escrevendo`,keys:[[`/`,`Inserir bloco: título, passos, imagem, tabela…`],[`Ctrl+B`,`Negrito`],[`Ctrl+I`,`Itálico`],[`Ctrl+E`,`Código no texto`],[`Ctrl+K`,`Link para outra página ou endereço`],[`Ctrl+Z`,`Desfazer`],[`Enter no título`,`Ir para o texto da página`]]},{title:`Páginas`,keys:[[`Ctrl+P`,`Buscar página pelo título`],[`Ctrl+\\`,`Mostrar ou esconder as páginas`],[`↑ ↓`,`Andar entre as páginas da árvore`],[`Alt+Shift+↑ ↓`,`Mover a página para cima ou para baixo`],[`Alt+Shift+→ ←`,`Virar subpágina ou subir um nível`],[`Shift+F10`,`Abrir o menu da página`]]},{title:`Marcando imagens`,keys:[[`V`,`Ferramenta Selecionar`],[`M`,`Ferramenta Marcador`],[`D`,`Ferramenta Destaque`],[`S`,`Ferramenta Seta`],[`A`,`Ferramenta Área clicável`],[`O`,`Ferramenta Ocultar`],[`R`,`Ferramenta Recortar`],[`Delete`,`Excluir a marcação selecionada`]]}];function y_({open:e,onOpenChange:t}){return(0,R.jsx)(sg,{open:e,onOpenChange:t,children:(0,R.jsxs)(dg,{className:`max-h-[90vh] overflow-y-auto sm:max-w-md`,children:[(0,R.jsxs)(fg,{children:[(0,R.jsx)(mg,{className:`font-display text-xl font-extrabold tracking-tight`,children:U(`Atalhos de teclado`)}),(0,R.jsx)(hg,{children:U(`No Mac, use Cmd no lugar de Ctrl.`)})]}),v_.map(e=>(0,R.jsxs)(`section`,{className:`grid gap-1.5`,children:[(0,R.jsx)(`h3`,{className:`rotulo`,children:U(e.title)}),(0,R.jsx)(`dl`,{className:`grid grid-cols-[9.5rem_1fr] gap-x-4 gap-y-1.5 text-sm`,children:e.keys.map(([e,t])=>(0,R.jsxs)(`div`,{className:`contents`,children:[(0,R.jsx)(`dt`,{children:(0,R.jsx)(`kbd`,{className:`rounded-sm border border-border bg-card px-1.5 py-0.5 font-mono text-xs whitespace-nowrap`,children:U(e)})}),(0,R.jsx)(`dd`,{className:`text-muted-foreground`,children:U(t)})]},e))})]},e.title))]})})}var b_=new Intl.RelativeTimeFormat(sf,{numeric:`auto`});function x_(e){let t=Math.round((Date.parse(e)-Date.now())/6e4);if(t===0)return U(`agora há pouco`);if(Math.abs(t)<60)return b_.format(t,`minute`);let n=Math.round(t/60);return Math.abs(n)<24?b_.format(n,`hour`):b_.format(Math.round(n/24),`day`)}function S_({slug:e,open:t,onOpenChange:n,onRestore:r,flush:i}){let[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(null),l=()=>{o(null),c(null),vf.listTrash(e).then(o,e=>c(W(e)))},u=()=>i().then(t=>{if(!t)throw Error(U(`Há alterações sem salvar. Salve antes de limpar as imagens.`));return vf.cleanUnusedAssets(e)}).then(({moved:e,folder:t})=>{Mh(e===0?U(`Nenhuma imagem sem uso.`):lf(e,`{n} arquivo foi para {pasta}.`,`{n} arquivos foram para {pasta}.`,{pasta:t??``}))},e=>c(W(e)));return(0,_.useEffect)(()=>{t&&l()},[t]),(0,R.jsx)(sg,{open:t,onOpenChange:n,children:(0,R.jsxs)(dg,{className:`gap-2 p-4 sm:max-w-sm`,"aria-describedby":void 0,children:[(0,R.jsx)(mg,{className:`px-2 pt-1 pb-2 text-sm font-bold`,children:U(`Lixeira deste manual`)}),s&&(0,R.jsx)(`p`,{className:`px-2 pb-2 text-sm text-destructive`,children:s}),!s&&a===null&&(0,R.jsx)(`p`,{className:`px-2 pb-2 text-sm text-muted-foreground`,children:U(`Carregando…`)}),a?.length===0&&(0,R.jsx)(`p`,{className:`px-2 pb-2 text-sm text-muted-foreground`,children:U(`Nenhuma página excluída.`)}),a&&a.length>0&&(0,R.jsx)(`ul`,{className:`grid gap-0.5`,children:a.map(e=>(0,R.jsxs)(`li`,{className:`flex items-center gap-2 rounded-md px-2 py-1.5 hover:bg-muted`,children:[(0,R.jsxs)(`span`,{className:`grid min-w-0 flex-1 leading-tight`,children:[(0,R.jsx)(`span`,{className:`truncate text-sm`,children:e.title||U(`Sem título`)}),(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.pages>1?`${U(`{n} páginas`,{n:e.pages})} · `:``,U(`excluída {quando}`,{quando:x_(e.deletedAt)})]})]}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void r(e.trashId,e.pageId).then(()=>n(!1)),className:`flex shrink-0 items-center gap-1 rounded-md px-2 py-1 text-sm font-bold text-primary hover:bg-accent`,children:[(0,R.jsx)(Gm,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Restaurar`)]})]},e.trashId))}),(0,R.jsxs)(`div`,{className:`mx-2 mt-2 grid gap-1 rounded-md border border-border p-2 text-sm`,children:[(0,R.jsx)(`p`,{children:U(`Imagens que nenhuma página usa, contando versões e lixeira, vão para a lixeira.`)}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void u(),className:`flex w-fit items-center gap-1 rounded-md px-2 py-1 font-bold text-primary hover:bg-accent`,children:[(0,R.jsx)(Yp,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Mover para a lixeira`)]})]}),(0,R.jsx)(`p`,{className:`px-2 pt-2 text-xs text-muted-foreground`,children:U(`As páginas excluídas ficam na pasta .lixeira do manual até você restaurar ou apagar.`)})]})})}var C_=`explicai:aparencia`,w_={mode:`system`},T_=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches;function E_(){try{let e=JSON.parse(localStorage.getItem(C_)??`{}`);return{mode:e.mode===`light`||e.mode===`dark`?e.mode:w_.mode}}catch{return w_}}function D_({mode:e}){let t=document.documentElement;t.dataset.theme=e===`dark`||e===`system`&&T_()?`dark`:`light`}function O_(e){try{localStorage.setItem(C_,JSON.stringify(e))}catch{}D_(e)}function k_(){window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>D_(E_()))}function A_(){return(0,_.useSyncExternalStore)(e=>{let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),()=>t.disconnect()},()=>document.documentElement.dataset.theme===`dark`?`dark`:`light`)}var j_=[{id:`light`,label:U(`Claro`),Icon:th},{id:`dark`,label:U(`Escuro`),Icon:Tm},{id:`system`,label:U(`Sistema`),Icon:Cm}];function M_({open:e,onOpenChange:t}){let n=(0,_.useRef)(null),[r,i]=(0,_.useState)(E_),a=A_(),o=e=>{let t={...E_(),...e};O_(t),i(t)};return(0,R.jsx)(sg,{open:e,onOpenChange:t,children:(0,R.jsxs)(dg,{className:`gap-4 p-4 sm:max-w-xs`,"aria-describedby":void 0,onOpenAutoFocus:e=>{e.preventDefault(),(n.current?.querySelector(`[aria-pressed=true]`)??n.current?.querySelector(`button`))?.focus()},children:[(0,R.jsx)(mg,{className:`font-display text-lg font-extrabold tracking-tight`,children:U(`Aparência`)}),(0,R.jsxs)(`fieldset`,{children:[(0,R.jsx)(`legend`,{className:`mb-2 rotulo`,children:U(`Tema`)}),(0,R.jsx)(`div`,{ref:n,className:`grid grid-cols-3 gap-1 rounded-md bg-muted p-1`,children:j_.map(({id:e,label:t,Icon:n})=>(0,R.jsxs)(`button`,{type:`button`,"aria-pressed":r.mode===e,onClick:()=>o({mode:e}),className:`flex flex-col items-center gap-1 rounded-sm min-h-11 py-1.5 text-xs text-muted-foreground hover:text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-muted aria-pressed:bg-primary aria-pressed:font-bold aria-pressed:text-primary-foreground`,children:[(0,R.jsx)(n,{className:`size-4`,"aria-hidden":!0}),` `,t]},e))}),r.mode===`system`&&(0,R.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:U(a===`dark`?`Agora está escuro, como no seu sistema.`:`Agora está claro, como no seu sistema.`)})]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`Muda só o Studio, neste navegador. A cor do manual fica em Exportar manual.`)})]})})}var N_=[{id:`pt-BR`,label:`Português`},{id:`en`,label:`English`}];function P_({open:e,onOpenChange:t}){return(0,R.jsx)(sg,{open:e,onOpenChange:t,children:(0,R.jsxs)(dg,{className:`gap-4 p-4 sm:max-w-xs`,"aria-describedby":void 0,children:[(0,R.jsx)(mg,{className:`font-display text-lg font-extrabold tracking-tight`,children:U(`Idioma`)}),(0,R.jsx)(`fieldset`,{"aria-label":U(`Idioma da interface`),className:`grid grid-cols-2 gap-1 rounded-md bg-muted p-1`,children:N_.map(({id:e,label:t})=>(0,R.jsx)(`button`,{type:`button`,lang:e,"aria-pressed":of===e,onClick:()=>of!==e&&cf(e),className:`rounded-sm min-h-11 py-1.5 text-xs text-muted-foreground hover:text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-muted aria-pressed:bg-primary aria-pressed:font-bold aria-pressed:text-primary-foreground`,children:t},e))}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`Muda só o Studio, neste navegador.`)})]})})}var F_=`group/item [@media(pointer:coarse)]:min-h-11`,I_=`size-3.5 text-muted-foreground group-data-[highlighted]/item:text-foreground`,L_={light:`Claro`,dark:`Escuro`,system:`Sistema`};function R_(){let{manual:e,restorePage:t,flush:n}=zg(),[r,i]=(0,_.useState)(null),[a,o]=(0,_.useState)(()=>E_().mode),s=e=>({open:r===e,onOpenChange:t=>i(t?e:null)});return(0,R.jsxs)(`div`,{className:`sticky bottom-0 z-10 -mx-3 mt-auto flex h-(--rodape-h) shrink-0 flex-col justify-center border-t border-border bg-card px-3`,children:[(0,R.jsxs)(Bg,{onOpenChange:e=>e&&o(E_().mode),children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,className:`flex w-full cursor-pointer items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground hover:bg-muted hover:text-foreground data-[state=open]:bg-muted [@media(pointer:coarse)]:min-h-11`,children:[(0,R.jsx)(Zm,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Ajustes`)]})}),(0,R.jsxs)(Hg,{side:`top`,align:`start`,className:`w-(--radix-dropdown-menu-trigger-width)`,children:[e&&(0,R.jsxs)(Ug,{className:F_,onSelect:()=>i(`trash`),children:[(0,R.jsx)(ah,{className:I_,"aria-hidden":!0}),` `,U(`Lixeira`)]}),(0,R.jsxs)(Ug,{className:F_,onSelect:()=>i(`appearance`),children:[(0,R.jsx)($m,{className:I_,"aria-hidden":!0}),` `,U(`Aparência`),(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-muted-foreground`,children:U(L_[a])})]}),(0,R.jsxs)(Ug,{className:F_,onSelect:()=>i(`language`),children:[(0,R.jsx)(am,{className:I_,"aria-hidden":!0}),` `,U(`Idioma`),(0,R.jsx)(`span`,{className:`ml-auto font-mono text-[11px] text-muted-foreground`,children:N_.find(e=>e.id===of)?.label})]}),(0,R.jsxs)(Ug,{className:F_,onSelect:()=>i(`shortcuts`),children:[(0,R.jsx)(rm,{className:I_,"aria-hidden":!0}),` `,U(`Atalhos`)]})]})]}),e&&(0,R.jsx)(S_,{slug:e.slug,flush:n,...s(`trash`),onRestore:(n,r)=>t(e.slug,n,r)}),(0,R.jsx)(M_,{...s(`appearance`)}),(0,R.jsx)(P_,{...s(`language`)}),(0,R.jsx)(y_,{...s(`shortcuts`)})]})}function z_({onCollapse:e,onNavigate:t,onSearch:n}){let r=zg(),{manuals:i,manual:a,page:o}=r,s=i?.find(e=>e.slug===a?.slug)??null;return(0,R.jsxs)(`aside`,{className:`flex h-full flex-col gap-5 overflow-y-auto border-r border-border bg-card px-3 pt-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(tf,{}),(0,R.jsx)(`button`,{type:`button`,onClick:e,"aria-label":U(`Esconder as páginas ({atalho})`,{atalho:`Ctrl+\\`}),title:U(`Esconder as páginas ({atalho})`,{atalho:`Ctrl+\\`}),className:`grid size-8 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,R.jsx)(Nm,{className:`size-4`,"aria-hidden":!0})})]}),i&&i.length>0&&(0,R.jsx)(l_,{manuals:i,current:s,onOpen:e=>void r.openManual(e),onCreate:()=>r.setCreatingManual(!0)}),a&&(0,R.jsxs)(`nav`,{"aria-label":U(`Páginas do manual`),className:`grid grid-cols-1 gap-1`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:n,className:`mb-1 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-muted hover:text-foreground`,children:[(0,R.jsx)(qm,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Buscar página`),(0,R.jsx)(`kbd`,{className:`ml-auto font-mono text-[11px] text-muted-foreground`,children:`Ctrl+P`})]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between px-2 text-[13px] text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`rotulo`,children:U(`Páginas`)}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>{t?.(),r.addPage(null)},className:`flex items-center gap-1 rounded-md px-1.5 py-1 font-bold text-primary hover:bg-accent`,children:[(0,R.jsx)(Vm,{className:`size-3.5`,"aria-hidden":!0}),` `,U(`Nova página`)]})]}),a.pages.length===0?(0,R.jsx)(`p`,{className:`px-2 text-sm text-muted-foreground`,children:U(`Nenhuma página ainda.`)}):(0,R.jsx)(__,{pages:a.pages,selectedId:o?.id??null,onSelect:e=>{t?.(),r.selectPage(e)},onAction:(e,n)=>{if(n.kind===`addChild`){t?.(),r.addPage(e.id);return}if(n.kind===`remove`)return void r.removePage(e);let i=a&&Tg(a.pages,e.id,n.shift);i&&r.movePage(e.id,i.parentId,i.index)},onMove:(e,t,n)=>void r.movePage(e,t,n)})]}),(0,R.jsx)(R_,{})]})}var B_=`Ctrl+\\`;function V_({sidebar:e,onSearch:t}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`hidden h-full shrink-0 split:block`,children:e.collapsed?(0,R.jsxs)(`div`,{className:`flex h-full w-12 flex-col items-center border-r border-border bg-card pt-4`,children:[(0,R.jsx)(`button`,{type:`button`,onClick:e.expand,"aria-label":U(`Mostrar as páginas ({atalho})`,{atalho:B_}),title:U(`Mostrar as páginas ({atalho})`,{atalho:B_}),className:`grid size-8 place-items-center rounded-md text-muted-foreground hover:bg-muted hover:text-foreground`,children:(0,R.jsx)(Fm,{className:`size-4`,"aria-hidden":!0})}),(0,R.jsx)(`div`,{"aria-hidden":!0,className:`mt-auto h-(--rodape-h) w-full shrink-0 border-t border-border`})]}):(0,R.jsx)(`div`,{className:`h-full w-56 lg:w-[17.5rem]`,children:(0,R.jsx)(z_,{onCollapse:e.collapse,onSearch:t})})}),(0,R.jsx)(sg,{open:e.drawerOpen,onOpenChange:e.setDrawerOpen,children:(0,R.jsxs)(dg,{showCloseButton:!1,"aria-describedby":void 0,className:`top-0 left-0 h-full w-[min(17.5rem,85vw)] max-w-none translate-x-0 translate-y-0 gap-0 rounded-none border-0 p-0 sm:max-w-none split:hidden data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left`,children:[(0,R.jsx)(mg,{className:`sr-only`,children:U(`Páginas do manual`)}),(0,R.jsx)(z_,{onCollapse:()=>e.setDrawerOpen(!1),onNavigate:()=>e.setDrawerOpen(!1),onSearch:()=>{e.setDrawerOpen(!1),t()}})]})})]})}function H_({title:e,onOpen:t,drawerOpen:n=!1}){return(0,R.jsxs)(`div`,{className:`flex h-12 shrink-0 items-center gap-2 border-b border-border bg-card px-3 split:hidden`,children:[(0,R.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":U(`Mostrar as páginas ({atalho})`,{atalho:B_}),className:`flex items-center gap-2 rounded-md px-2 py-1.5 text-sm font-bold hover:bg-muted`,children:[(0,R.jsx)(Fm,{className:`size-4`,"aria-hidden":!0}),` `,U(`Páginas`)]}),(0,R.jsx)(`div`,{"aria-hidden":n||void 0,className:`contents`,children:(0,R.jsx)(tf,{})}),(0,R.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:e})]})}var U_=Object.defineProperty,W_=(e,t)=>{let n={};for(var r in e)U_(n,r,{get:e[r],enumerable:!0});return t||U_(n,Symbol.toStringTag,{value:`Module`}),n};function G_(e){this.content=e}G_.prototype={constructor:G_,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var r=n&&n!=e?this.remove(n):this,i=r.find(e),a=r.content.slice();return i==-1?a.push(n||e,t):(a[i+1]=t,n&&(a[i]=n)),new G_(a)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new G_(n)},addToStart:function(e,t){return new G_([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new G_(n)},addBefore:function(e,t,n){var r=this.remove(t),i=r.content.slice(),a=r.find(e);return i.splice(a==-1?i.length:a,0,t,n),new G_(i)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=G_.from(e),e.size?new G_(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=G_.from(e),e.size?new G_(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=G_.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}},G_.from=function(e){if(e instanceof G_)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new G_(t)};function K_(e,t,n){for(let r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;let i=e.child(r),a=t.child(r);if(i==a)n+=i.nodeSize;else{if(!i.sameMarkup(a))return n;if(i.isText&&i.text!=a.text){let e=i.text,t=a.text,r=0;for(;e[r]==t[r];r++)n++;return r&&r<e.length&&r<t.length&&Y_(e.charCodeAt(r-1))&&J_(e.charCodeAt(r))&&n--,n}if(i.content.size||a.content.size){let e=K_(i.content,a.content,n+1);if(e!=null)return e}n+=i.nodeSize}}}function q_(e,t,n,r){for(let i=e.childCount,a=t.childCount;;){if(i==0||a==0)return i==a?null:{a:n,b:r};let o=e.child(--i),s=t.child(--a),c=o.nodeSize;if(o==s)n-=c,r-=c;else{if(!o.sameMarkup(s))return{a:n,b:r};if(o.isText&&o.text!=s.text){let e=o.text,t=s.text,i=e.length,a=t.length;for(;i>0&&a>0&&e[i-1]==t[a-1];)i--,a--,n--,r--;return i&&a&&i<e.length&&Y_(e.charCodeAt(i-1))&&J_(e.charCodeAt(i))&&(n++,r++),{a:n,b:r}}if(o.content.size||s.content.size){let e=q_(o.content,s.content,n-1,r-1);if(e)return e}n-=c,r-=c}}}function J_(e){return e>=56320&&e<57344}function Y_(e){return e>=55296&&e<56320}var K=class e{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let t=0;t<e.length;t++)this.size+=e[t].nodeSize}nodesBetween(e,t,n,r=0,i){for(let a=0,o=0;o<t;a++){let s=this.content[a],c=o+s.nodeSize;if(c>e&&n(s,r+o,i||null,a)!==!1&&s.content.size){let i=o+1;s.nodesBetween(Math.max(0,e-i),Math.min(s.content.size,t-i),n,r+i)}o=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,n,r){let i=``,a=!0;return this.nodesBetween(e,t,(o,s)=>{let c=o.isText?o.text.slice(Math.max(e,s)-s,t-s):o.isLeaf?r?typeof r==`function`?r(o):r:o.type.spec.leafText?o.type.spec.leafText(o):``:``;o.isBlock&&(o.isLeaf&&c||o.isTextblock)&&n&&(a?a=!1:i+=n),i+=c},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,r=t.firstChild,i=this.content.slice(),a=0;for(n.isText&&n.sameMarkup(r)&&(i[i.length-1]=n.withText(n.text+r.text),a=1);a<t.content.length;a++)i.push(t.content[a]);return new e(i,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let r=[],i=0;if(n>t)for(let e=0,a=0;a<n;e++){let o=this.content[e],s=a+o.nodeSize;s>t&&((a<t||s>n)&&(o=o.isText?o.cut(Math.max(0,t-a),Math.min(o.text.length,n-a)):o.cut(Math.max(0,t-a-1),Math.min(o.content.size,n-a-1))),r.push(o),i+=o.nodeSize),a=s}return new e(r,i)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let r=this.content[t];if(r==n)return this;let i=this.content.slice(),a=this.size+n.nodeSize-r.nodeSize;return i[t]=n,new e(i,a)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw RangeError(`Index `+e+` out of range for `+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,n=0;t<this.content.length;t++){let r=this.content[t];e(r,n,t),n+=r.nodeSize}}findDiffStart(e,t=0){return K_(this,e,t)}findDiffEnd(e,t=this.size,n=e.size){return q_(this,e,t,n)}findIndex(e){if(e==0)return Z_(0,e);if(e==this.size)return Z_(this.content.length,e);if(e>this.size||e<0)throw RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,n=0;;t++){let r=this.child(t),i=n+r.nodeSize;if(i>=e)return i==e?Z_(t+1,i):Z_(t,n);n=i}}toString(){return`<`+this.toStringInner()+`>`}toStringInner(){return this.content.join(`, `)}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw RangeError(`Invalid input for Fragment.fromJSON`);return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,r=0;for(let e=0;e<t.length;e++){let i=t[e];r+=i.nodeSize,e&&i.isText&&t[e-1].sameMarkup(i)?(n||=t.slice(0,e),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,r)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw RangeError(`Can not convert `+t+` to a Fragment`+(t.nodesBetween?` (looks like multiple versions of prosemirror-model were loaded)`:``))}};K.empty=new K([],0);var X_={index:0,offset:0};function Z_(e,t){return X_.index=e,X_.offset=t,X_}function Q_(e,t){if(e===t)return!0;if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!Q_(e[n],t[n]))return!1}else{for(let n in e)if(!(n in t)||!Q_(e[n],t[n]))return!1;for(let n in t)if(!(n in e))return!1}return!0}var $_=class e{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(this.eq(i))return e;if(this.type.excludes(i.type))t||=e.slice(0,r);else if(i.type.excludes(this.type))return e;else!n&&i.type.rank>this.type.rank&&(t||=e.slice(0,r),t.push(this),n=!0),t&&t.push(i)}return t||=e.slice(),n||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Q_(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Mark.fromJSON`);let n=e.marks[t.type];if(!n)throw RangeError(`There is no mark type ${t.type} in this schema`);return n.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(t[n]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((e,t)=>e.type.rank-t.type.rank),n}};$_.none=[];var ev=class extends Error{},q=class e{constructor(e,t,n){this.content=e,this.openStart=t,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let r=nv(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return r&&new e(r,this.openStart,this.openEnd)}removeBetween(t,n){return new e(tv(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+`(`+this.openStart+`,`+this.openEnd+`)`}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(t,n){if(!n)return e.empty;let r=n.openStart||0,i=n.openEnd||0;if(typeof r!=`number`||typeof i!=`number`)throw RangeError(`Invalid input for Slice.fromJSON`);return new e(K.fromJSON(t,n.content),r,i)}static maxOpen(t,n=!0){let r=0,i=0;for(let e=t.firstChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.firstChild)r++;for(let e=t.lastChild;e&&!e.isLeaf&&(n||!e.type.spec.isolating);e=e.lastChild)i++;return new e(t,r,i)}};q.empty=new q(K.empty,0,0);function tv(e,t,n){let{index:r,offset:i}=e.findIndex(t),a=e.maybeChild(r),{index:o,offset:s}=e.findIndex(n);if(i==t||a.isText){if(s!=n&&!e.child(o).isText)throw RangeError(`Removing non-flat range`);return e.cut(0,t).append(e.cut(n))}if(r!=o)throw RangeError(`Removing non-flat range`);return e.replaceChild(r,a.copy(tv(a.content,t-i-1,n-i-1)))}function nv(e,t,n,r,i,a){let{index:o,offset:s}=e.findIndex(t),c=e.maybeChild(o);if(s==t||c.isText)return a&&r<=0&&i<=0&&!a.canReplace(o,o,n)?null:e.cut(0,t).append(n).append(e.cut(t));let l=nv(c.content,t-s-1,n,o==0?r-1:0,o==e.childCount-1?i-1:0,c);return l&&e.replaceChild(o,c.copy(l))}function rv(e,t,n){if(n.openStart>e.depth)throw new ev(`Inserted content deeper than insertion position`);if(e.depth-n.openStart!=t.depth-n.openEnd)throw new ev(`Inconsistent open depths`);return iv(e,t,n,0)}function iv(e,t,n,r){let i=e.index(r),a=e.node(r);if(i==t.index(r)&&r<e.depth-n.openStart){let o=iv(e,t,n,r+1);return a.copy(a.content.replaceChild(i,o))}if(!n.content.size)return lv(a,dv(e,t,r));if(!n.openStart&&!n.openEnd&&e.depth==r&&t.depth==r){let r=e.parent,i=r.content;return lv(r,i.cut(0,e.parentOffset).append(n.content).append(i.cut(t.parentOffset)))}{let{start:i,end:o}=fv(n,e);return lv(a,uv(e,i,o,t,r))}}function av(e,t){if(!t.type.compatibleContent(e.type))throw new ev(`Cannot join `+t.type.name+` onto `+e.type.name)}function ov(e,t,n){let r=e.node(n);return av(r,t.node(n)),r}function sv(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function cv(e,t,n,r){let i=(t||e).node(n),a=0,o=t?t.index(n):i.childCount;e&&(a=e.index(n),e.depth>n?a++:e.textOffset&&(sv(e.nodeAfter,r),a++));for(let e=a;e<o;e++)sv(i.child(e),r);t&&t.depth==n&&t.textOffset&&sv(t.nodeBefore,r)}function lv(e,t){if(!e.type.validContent(t))throw new ev(`Invalid content for node `+e.type.name);return e.copy(t)}function uv(e,t,n,r,i){let a=e.depth>i&&ov(e,t,i+1),o=r.depth>i&&ov(n,r,i+1),s=[];return cv(null,e,i,s),a&&o&&t.index(i)==n.index(i)?(av(a,o),sv(lv(a,uv(e,t,n,r,i+1)),s)):(a&&sv(lv(a,dv(e,t,i+1)),s),cv(t,n,i,s),o&&sv(lv(o,dv(n,r,i+1)),s)),cv(r,null,i,s),new K(s)}function dv(e,t,n){let r=[];return cv(null,e,n,r),e.depth>n&&sv(lv(ov(e,t,n+1),dv(e,t,n+1)),r),cv(t,null,n,r),new K(r)}function fv(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let e=n-1;e>=0;e--)r=t.node(e).copy(K.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var pv=class e{constructor(e,t,n){this.pos=e,this.path=t,this.parentOffset=n,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position before the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw RangeError(`There is no position after the top-level node`);return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let n=this.path[t*3],r=t==0?0:this.path[t*3-1]+1;for(let t=0;t<e;t++)r+=n.child(t).nodeSize;return r}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return $_.none;if(this.textOffset)return e.child(t).marks;let n=e.maybeChild(t-1),r=e.maybeChild(t);if(!n){let e=n;n=r,r=e}let i=n.marks;for(var a=0;a<i.length;a++)i[a].type.spec.inclusive!==!1||r&&i[a].isInSet(r.marks)||(i=i[a--].removeFromSet(i));return i}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let n=t.marks,r=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive!==!1||r&&n[i].isInSet(r.marks)||(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new _v(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e=``;for(let t=1;t<=this.depth;t++)e+=(e?`/`:``)+this.node(t).type.name+`_`+this.index(t-1);return e+`:`+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw RangeError(`Position `+n+` out of range`);let r=[],i=0,a=n;for(let e=t;;){let{index:t,offset:n}=e.content.findIndex(a),o=a-n;if(r.push(e,t,i+n),!o||(e=e.child(t),e.isText))break;a=o-1,i+=n+1}return new e(n,r,a)}static resolveCached(t,n){let r=gv.get(t);if(r)for(let e=0;e<r.elts.length;e++){let t=r.elts[e];if(t.pos==n)return t}else gv.set(t,r=new mv);let i=r.elts[r.i]=e.resolve(t,n);return r.i=(r.i+1)%hv,i}},mv=class{constructor(){this.elts=[],this.i=0}},hv=12,gv=new WeakMap,_v=class{constructor(e,t,n){this.$from=e,this.$to=t,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},vv=Object.create(null),yv=class e{constructor(e,t,n,r=$_.none){this.type=e,this.attrs=t,this.marks=r,this.content=n||K.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,n,r=0){this.content.nodesBetween(e,t,n,r,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,``)}textBetween(e,t,n,r){return this.content.textBetween(e,t,n,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,n){return this.type==e&&Q_(this.attrs,t||e.defaultAttrs||vv)&&$_.sameSet(this.marks,n||$_.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,n=!1){if(e==t)return q.empty;let r=this.resolve(e),i=this.resolve(t),a=n?0:r.sharedDepth(t),o=r.start(a);return new q(r.node(a).content.cut(r.pos-o,i.pos-o),r.depth-a,i.depth-a)}replace(e,t,n){return rv(this.resolve(e),this.resolve(t),n)}nodeAt(e){for(let t=this;;){let{index:n,offset:r}=t.content.findIndex(e);if(t=t.maybeChild(n),!t)return null;if(r==e||t.isText)return t;e-=r+1}}childAfter(e){let{index:t,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(t),index:t,offset:n};let r=this.content.child(t-1);return{node:r,index:t-1,offset:n-r.nodeSize}}resolve(e){return pv.resolveCached(this,e)}resolveNoCache(e){return pv.resolve(this,e)}rangeHasMark(e,t,n){let r=!1;return t>e&&this.nodesBetween(e,t,e=>(n.isInSet(e.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+=`(`+this.content.toStringInner()+`)`),xv(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw Error(`Called contentMatchAt on a node with invalid content`);return t}canReplace(e,t,n=K.empty,r=0,i=n.childCount){let a=this.contentMatchAt(e).matchFragment(n,r,i),o=a&&a.matchFragment(this.content,t);if(!o||!o.validEnd)return!1;for(let e=r;e<i;e++)if(!this.type.allowsMarks(n.child(e).marks))return!1;return!0}canReplaceWith(e,t,n,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(e).matchType(n),a=i&&i.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),Sv(this.type.attrs,this.attrs,`node`,this.type.name);let e=$_.none;for(let t=0;t<this.marks.length;t++){let n=this.marks[t];Sv(n.type.attrs,n.attrs,`mark`,n.type.name),e=n.addToSet(e)}if(!$_.sameSet(e,this.marks))throw RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(e=>e.type.name)}`);this.content.forEach(e=>e.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(e=>e.toJSON())),e}static fromJSON(e,t){if(!t)throw RangeError(`Invalid input for Node.fromJSON`);let n;if(t.marks){if(!Array.isArray(t.marks))throw RangeError(`Invalid mark data for Node.fromJSON`);n=t.marks.map(e.markFromJSON)}if(t.type==`text`){if(typeof t.text!=`string`)throw RangeError(`Invalid text node in JSON`);return e.text(t.text,n)}let r=K.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,r,n)}};yv.prototype.text=void 0;var bv=class e extends yv{constructor(e,t,n,r){if(super(e,t,null,r),!n)throw RangeError(`Empty text nodes are not allowed`);this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):xv(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function xv(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+`(`+t+`)`;return t}function Sv(e,t,n,r){for(let i in t)if(!(i in e))throw RangeError(`Unsupported attribute ${i} for ${n} of type ${r}`);for(let n in e)e[n].validate&&e[n].validate(t[n])}var Cv=class e{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(t,n){let r=new wv(t,n);if(r.next==null)return e.empty;let i=Tv(r);r.next&&r.err(`Unexpected trailing text`);let a=Fv(Mv(i));return Iv(a,r),a}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,n=e.childCount){let r=this;for(let i=t;r&&i<n;i++)r=r.matchType(e.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let n=0;n<e.next.length;n++)if(this.next[t].type==e.next[n].type)return!0;return!1}fillBefore(e,t=!1,n=0){let r=[this];function i(a,o){let s=a.matchFragment(e,n);if(s&&(!t||s.validEnd))return K.from(o.map(e=>e.createAndFill()));for(let e=0;e<a.next.length;e++){let{type:t,next:n}=a.next[e];if(!(t.isText||t.hasRequiredAttrs())&&r.indexOf(n)==-1){r.push(n);let e=i(n,o.concat(t));if(e)return e}}return null}return i(this,[])}findWrapping(e){for(let t=0;t<this.wrapCache.length;t+=2)if(this.wrapCache[t]==e)return this.wrapCache[t+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let r=n.shift(),i=r.match;if(i.matchType(e)){let e=[];for(let t=r;t.type;t=t.via)e.push(t.type);return e.reverse()}for(let e=0;e<i.next.length;e++){let{type:a,next:o}=i.next[e];a.isLeaf||a.hasRequiredAttrs()||a.name in t||r.type&&!o.validEnd||(n.push({match:a.contentMatch,type:a,via:r}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(n){e.push(n);for(let r=0;r<n.next.length;r++)e.indexOf(n.next[r].next)==-1&&t(n.next[r].next)}return t(this),e.map((t,n)=>{let r=n+(t.validEnd?`*`:` `)+` `;for(let n=0;n<t.next.length;n++)r+=(n?`, `:``)+t.next[n].type.name+`->`+e.indexOf(t.next[n].next);return r}).join(`
|
|
50
50
|
`)}};Cv.empty=new Cv(!0);var wv=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==``&&this.tokens.pop(),this.tokens[0]==``&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw SyntaxError(e+` (in content expression '`+this.string+`')`)}};function Tv(e){let t=[];do t.push(Ev(e));while(e.eat(`|`));return t.length==1?t[0]:{type:`choice`,exprs:t}}function Ev(e){let t=[];do t.push(Dv(e));while(e.next&&e.next!=`)`&&e.next!=`|`);return t.length==1?t[0]:{type:`seq`,exprs:t}}function Dv(e){let t=jv(e);for(;;)if(e.eat(`+`))t={type:`plus`,expr:t};else if(e.eat(`*`))t={type:`star`,expr:t};else if(e.eat(`?`))t={type:`opt`,expr:t};else if(e.eat(`{`))t=kv(e,t);else break;return t}function Ov(e){/\D/.test(e.next)&&e.err(`Expected number, got '`+e.next+`'`);let t=Number(e.next);return e.pos++,t}function kv(e,t){let n=Ov(e),r=n;return e.eat(`,`)&&(r=e.next==`}`?-1:Ov(e)),e.eat(`}`)||e.err(`Unclosed braced range`),{type:`range`,min:n,max:r,expr:t}}function Av(e,t){let n=e.nodeTypes,r=n[t];if(r)return[r];let i=[];for(let e in n){let r=n[e];r.isInGroup(t)&&i.push(r)}return i.length==0&&e.err(`No node type or group '`+t+`' found`),i}function jv(e){if(e.eat(`(`)){let t=Tv(e);return e.eat(`)`)||e.err(`Missing closing paren`),t}if(/\W/.test(e.next))e.err(`Unexpected token '`+e.next+`'`);else{let t=Av(e,e.next).map(t=>(e.inline==null?e.inline=t.isInline:e.inline!=t.isInline&&e.err(`Mixing inline and block content`),{type:`name`,value:t}));return e.pos++,t.length==1?t[0]:{type:`choice`,exprs:t}}}function Mv(e){let t=[[]];return i(a(e,0),n()),t;function n(){return t.push([])-1}function r(e,n,r){let i={term:r,to:n};return t[e].push(i),i}function i(e,t){e.forEach(e=>e.to=t)}function a(e,t){if(e.type==`choice`)return e.exprs.reduce((e,n)=>e.concat(a(n,t)),[]);if(e.type==`seq`)for(let r=0;;r++){let o=a(e.exprs[r],t);if(r==e.exprs.length-1)return o;i(o,t=n())}else if(e.type==`star`){let o=n();return r(t,o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`plus`){let o=n();return i(a(e.expr,t),o),i(a(e.expr,o),o),[r(o)]}else if(e.type==`opt`)return[r(t)].concat(a(e.expr,t));else if(e.type==`range`){let o=t;for(let t=0;t<e.min;t++){let t=n();i(a(e.expr,o),t),o=t}if(e.max==-1)i(a(e.expr,o),o);else for(let t=e.min;t<e.max;t++){let t=n();r(o,t),i(a(e.expr,o),t),o=t}return[r(o)]}else if(e.type==`name`)return[r(t,void 0,e.value)];else throw Error(`Unknown expr type`)}}function Nv(e,t){return t-e}function Pv(e,t){let n=[];return r(t),n.sort(Nv);function r(t){let i=e[t];if(i.length==1&&!i[0].term)return r(i[0].to);n.push(t);for(let e=0;e<i.length;e++){let{term:t,to:a}=i[e];!t&&n.indexOf(a)==-1&&r(a)}}}function Fv(e){let t=Object.create(null);return n(Pv(e,0));function n(r){let i=[];r.forEach(t=>{e[t].forEach(({term:t,to:n})=>{if(!t)return;let r;for(let e=0;e<i.length;e++)i[e][0]==t&&(r=i[e][1]);Pv(e,n).forEach(e=>{r||i.push([t,r=[]]),r.indexOf(e)==-1&&r.push(e)})})});let a=t[r.join(`,`)]=new Cv(r.indexOf(e.length-1)>-1);for(let e=0;e<i.length;e++){let r=i[e][1].sort(Nv);a.next.push({type:i[e][0],next:t[r.join(`,`)]||n(r)})}return a}}function Iv(e,t){for(let n=0,r=[e];n<r.length;n++){let e=r[n],i=!e.validEnd,a=[];for(let t=0;t<e.next.length;t++){let{type:n,next:o}=e.next[t];a.push(n.name),i&&!(n.isText||n.hasRequiredAttrs())&&(i=!1),r.indexOf(o)==-1&&r.push(o)}i&&t.err(`Only non-generatable nodes (`+a.join(`, `)+`) in a required position (see https://prosemirror.net/docs/guide/#generatable)`)}}function Lv(e){let t=Object.create(null);for(let n in e){let r=e[n];if(!r.hasDefault)return null;t[n]=r.default}return t}function Rv(e,t){let n=Object.create(null);for(let r in e){let i=e[r],a=t&&t[r];if(a===void 0){if(i.hasDefault)a=i.default;else throw RangeError(`No value supplied for attribute `+r)}else i.validate&&i.validate(a);n[r]=a}return n}function zv(e,t){let n=Object.create(null);if(t)for(let r in t)n[r]=new Hv(e,r,t[r]);return n}var Bv=class e{constructor(e,t,n){this.name=e,this.schema=t,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(` `):[],this.attrs=zv(e,n.attrs),this.defaultAttrs=Lv(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e==`text`),this.isText=e==`text`}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Cv.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?`pre`:`normal`)}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Rv(this.attrs,e)}create(e=null,t,n){if(this.isText)throw Error(`NodeType.create can't construct text nodes`);return new yv(this,this.computeAttrs(e),K.from(t),$_.setFrom(n))}createChecked(e=null,t,n){return t=K.from(t),this.checkContent(t),new yv(this,this.computeAttrs(e),t,$_.setFrom(n))}createAndFill(e=null,t,n){if(e=this.computeAttrs(e),t=K.from(t),t.size){let e=this.contentMatch.fillBefore(t);if(!e)return null;t=e.append(t)}let r=this.contentMatch.matchFragment(t),i=r&&r.fillBefore(K.empty,!0);return i?new yv(this,e,t.append(i),$_.setFrom(n)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let t=0;t<e.childCount;t++)if(!this.allowsMarks(e.child(t).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?t&&t.push(e[n]):t||=e.slice(0,n);return t?t.length?t:$_.none:e}static compile(t,n){let r=Object.create(null);t.forEach((t,i)=>r[t]=new e(t,n,i));let i=n.spec.topNode||`doc`;if(!r[i])throw RangeError(`Schema is missing its top node type ('`+i+`')`);if(!r.text)throw RangeError(`Every schema needs a 'text' type`);for(let e in r.text.attrs)throw RangeError(`The text node type should not have attributes`);return r}};function Vv(e,t,n){let r=n.split(`|`);return n=>{let i=n===null?`null`:typeof n;if(r.indexOf(i)<0)throw RangeError(`Expected value of type ${r} for attribute ${t} on type ${e}, got ${i}`)}}var Hv=class{constructor(e,t,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,`default`),this.default=n.default,this.validate=typeof n.validate==`string`?Vv(e,t,n.validate):n.validate}get isRequired(){return!this.hasDefault}},Uv=class e{constructor(e,t,n,r){this.name=e,this.rank=t,this.schema=n,this.spec=r,this.attrs=zv(e,r.attrs),this.excluded=null;let i=Lv(this.attrs);this.instance=i?new $_(this,i):null}create(e=null){return!e&&this.instance?this.instance:new $_(this,Rv(this.attrs,e))}static compile(t,n){let r=Object.create(null),i=0;return t.forEach((t,a)=>r[t]=new e(t,i++,n,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}},Wv=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let n in e)t[n]=e[n];t.nodes=G_.from(e.nodes),t.marks=G_.from(e.marks||{}),this.nodes=Bv.compile(this.spec.nodes,this),this.marks=Uv.compile(this.spec.marks,this);let n=Object.create(null);for(let e in this.nodes){if(e in this.marks)throw RangeError(e+` can not be both a node and a mark`);let t=this.nodes[e],r=t.spec.content||``,i=t.spec.marks;if(t.contentMatch=n[r]||(n[r]=Cv.parse(r,this.nodes)),t.inlineContent=t.contentMatch.inlineContent,t.spec.linebreakReplacement){if(this.linebreakReplacement)throw RangeError(`Multiple linebreak nodes defined`);if(!t.isInline||!t.isLeaf)throw RangeError(`Linebreak replacement nodes must be inline leaf nodes`);this.linebreakReplacement=t}t.markSet=i==`_`?null:i?Gv(this,i.split(` `)):i==``||!t.inlineContent?[]:null}for(let e in this.marks){let t=this.marks[e],n=t.spec.excludes;t.excluded=n==null?[t]:n==``?[]:Gv(this,n.split(` `))}this.nodeFromJSON=e=>yv.fromJSON(this,e),this.markFromJSON=e=>$_.fromJSON(this,e),this.topNodeType=this.nodes[this.spec.topNode||`doc`],this.cached.wrappings=Object.create(null)}node(e,t=null,n,r){if(typeof e==`string`)e=this.nodeType(e);else if(!(e instanceof Bv))throw RangeError(`Invalid node type: `+e);else if(e.schema!=this)throw RangeError(`Node type from different schema used (`+e.name+`)`);return e.createChecked(t,n,r)}text(e,t){let n=this.nodes.text;return new bv(n,n.defaultAttrs,e,$_.setFrom(t))}mark(e,t){return typeof e==`string`&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw RangeError(`Unknown node type: `+e);return t}};function Gv(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r],a=e.marks[i],o=a;if(a)n.push(a);else for(let t in e.marks){let r=e.marks[t];(i==`_`||r.spec.group&&r.spec.group.split(` `).indexOf(i)>-1)&&n.push(o=r)}if(!o)throw SyntaxError(`Unknown mark type: '`+t[r]+`'`)}return n}function Kv(e){return e.tag!=null}function qv(e){return e.style!=null}var Jv=class e{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let n=this.matchedStyles=[];t.forEach(e=>{if(Kv(e))this.tags.push(e);else if(qv(e)){let t=/[^=]*/.exec(e.style)[0];n.indexOf(t)<0&&n.push(t),this.styles.push(e)}}),this.normalizeLists=!this.tags.some(t=>{if(!/^(ul|ol)\b/.test(t.tag)||!t.node)return!1;let n=e.nodes[t.node];return n.contentMatch.matchType(n)})}parse(e,t={}){let n=new ry(this,t,!1);return n.addAll(e,$_.none,t.from,t.to),n.finish()}parseSlice(e,t={}){let n=new ry(this,t,!0);return n.addAll(e,$_.none,t.from,t.to),q.maxOpen(n.finish())}matchTag(e,t,n){for(let r=n?this.tags.indexOf(n)+1:0;r<this.tags.length;r++){let n=this.tags[r];if(ay(e,n.tag)&&(n.namespace===void 0||e.namespaceURI==n.namespace)&&(!n.context||t.matchesContext(n.context))){if(n.getAttrs){let t=n.getAttrs(e);if(t===!1)continue;n.attrs=t||void 0}return n}}}matchStyle(e,t,n,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let r=this.styles[i],a=r.style;if(!(a.indexOf(e)!=0||r.context&&!n.matchesContext(r.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(r.getAttrs){let e=r.getAttrs(t);if(e===!1)continue;r.attrs=e||void 0}return r}}}static schemaRules(e){let t=[];function n(e){let n=e.priority==null?50:e.priority,r=0;for(;r<t.length;r++){let e=t[r];if((e.priority==null?50:e.priority)<n)break}t.splice(r,0,e)}for(let t in e.marks){let r=e.marks[t].spec.parseDOM;r&&r.forEach(e=>{n(e=oy(e)),e.mark||e.ignore||e.clearMark||(e.mark=t)})}for(let t in e.nodes){let r=e.nodes[t].spec.parseDOM;r&&r.forEach(e=>{n(e=oy(e)),e.node||e.ignore||e.mark||(e.node=t)})}return t}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},Yv={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},Xv={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Zv={ol:!0,ul:!0},Qv=1,$v=2,ey=4;function ty(e,t,n){return t==null?e&&e.whitespace==`pre`?3:n&-5:(t?Qv:0)|(t===`full`?$v:0)}var ny=class{constructor(e,t,n,r,i,a){this.type=e,this.attrs=t,this.marks=n,this.solid=r,this.options=a,this.content=[],this.activeMarks=$_.none,this.match=i||(a&ey?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(K.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let t=this.type.contentMatch,n;return(n=t.findWrapping(e.type))?(this.match=t,n):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Qv)){let e=this.content[this.content.length-1],t;if(e&&e.isText&&(t=/[ \t\r\n\u000c]+$/.exec(e.text))){let n=e;e.text.length==t[0].length?this.content.pop():this.content[this.content.length-1]=n.withText(n.text.slice(0,n.text.length-t[0].length))}}let t=K.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(K.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Yv.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ry=class{constructor(e,t,n){this.parser=e,this.options=t,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let r=t.topNode,i,a=ty(null,t.preserveWhitespace,0)|(n?ey:0);i=r?new ny(r.type,r.attrs,$_.none,!0,t.topMatch||r.type.contentMatch,a):n?new ny(null,null,$_.none,!0,null,a):new ny(e.schema.topNodeType,null,$_.none,!0,null,a),this.nodes=[i],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let n=e.nodeValue,r=this.top,i=r.options&$v?`full`:this.localPreserveWS||(r.options&Qv)>0,{schema:a}=this.parser;if(i===`full`||r.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(!i){if(n=n.replace(/[ \t\r\n\u000c]+/g,` `),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let t=r.content[r.content.length-1],i=e.previousSibling;(!t||i&&i.nodeName==`BR`||t.isText&&/[ \t\r\n\u000c]$/.test(t.text))&&(n=n.slice(1))}}else if(i===`full`)n=n.replace(/\r\n?/g,`
|
|
51
51
|
`);else if(a.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(a.linebreakReplacement.create())){let e=n.split(/\r?\n|\r/);for(let n=0;n<e.length;n++)n&&this.insertNode(a.linebreakReplacement.create(),t,!0),e[n]&&this.insertNode(a.text(e[n]),t,!/\S/.test(e[n]));n=``}else n=n.replace(/\r?\n|\r/g,` `);n&&this.insertNode(a.text(n),t,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,t,n){let r=this.localPreserveWS,i=this.top;(e.tagName==`PRE`||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),o;Zv.hasOwnProperty(a)&&this.parser.normalizeLists&&iy(e);let s=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(o=this.parser.matchTag(e,this,n));out:if(s?s.ignore:Xv.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!s||s.skip||s.closeParent){s&&s.closeParent?this.open=Math.max(0,this.open-1):s&&s.skip.nodeType&&(e=s.skip);let n,r=this.needsBlock;if(Yv.hasOwnProperty(a))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),n=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break out}let o=s&&s.skip?t:this.readStyles(e,t);o&&this.addAll(e,o),n&&this.sync(i),this.needsBlock=r}else{let n=this.readStyles(e,t);n&&this.addElementByRule(e,s,n,s.consuming===!1?o:void 0)}this.localPreserveWS=r}leafFallback(e,t){e.nodeName==`BR`&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
52
52
|
`),t)}ignoreFallback(e,t){e.nodeName!=`BR`||this.top.type&&this.top.type.inlineContent||this.findPlace(this.parser.schema.text(`-`),t,!0)}readStyles(e,t){let n=e.style;if(n&&n.length)for(let e=0;e<this.parser.matchedStyles.length;e++){let r=this.parser.matchedStyles[e],i=n.getPropertyValue(r);if(i)for(let e;;){let n=this.parser.matchStyle(r,i,this,e);if(!n)break;if(n.ignore)return null;if(t=n.clearMark?t.filter(e=>!n.clearMark(e)):t.concat(this.parser.schema.marks[n.mark].create(n.attrs)),n.consuming===!1)e=n;else break}}return t}addElementByRule(e,t,n,r){let i,a;if(t.node){if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),n,e.nodeName==`BR`)||this.leafFallback(e,n);else{let e=this.enter(a,t.attrs||null,n,t.preserveWhitespace);e&&(i=!0,n=e)}}else{let e=this.parser.schema.marks[t.mark];n=n.concat(e.create(t.attrs))}let o=this.top;if(a&&a.isLeaf)this.findInside(e);else if(r)this.addElement(e,n,r);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(e=>this.insertNode(e,n,!1));else{let r=e;typeof t.contentElement==`string`?r=e.querySelector(t.contentElement):typeof t.contentElement==`function`?r=t.contentElement(e):t.contentElement&&(r=t.contentElement),this.findAround(e,r,!0),this.addAll(r,n),this.findAround(e,r,!1)}i&&this.sync(o)&&this.open--}addAll(e,t,n,r){let i=n||0;for(let a=n?e.childNodes[n]:e.firstChild,o=r==null?null:e.childNodes[r];a!=o;a=a.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(a,t);this.findAtPoint(e,i)}findPlace(e,t,n){let r,i;for(let t=this.open,a=0;t>=0;t--){let o=this.nodes[t],s=o.findWrapping(e);if(s&&(!r||r.length>s.length+a)&&(r=s,i=o,!s.length))break;if(o.solid){if(n)break;a+=2}}if(!r)return null;this.sync(i);for(let e=0;e<r.length;e++)t=this.enterInner(r[e],null,t,!1);return t}insertNode(e,t,n){if(e.isInline&&this.needsBlock&&!this.top.type){let e=this.textblockFromContext();e&&(t=this.enterInner(e,null,t))}let r=this.findPlace(e,t,n);if(r){this.closeExtra();let t=this.top;t.match&&=t.match.matchType(e.type);let n=$_.none;for(let i of r.concat(e.marks))(t.type?t.type.allowsMarkType(i.type):sy(i.type,e.type))&&(n=i.addToSet(n));return t.content.push(e.mark(n)),!0}return!1}enter(e,t,n,r){let i=this.findPlace(e.create(t),n,!1);return i&&=this.enterInner(e,t,n,!0,r),i}enterInner(e,t,n,r=!1,i){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let o=ty(e,i,a.options);a.options&ey&&a.content.length==0&&(o|=ey);let s=$_.none;return n=n.filter(t=>!(a.type?a.type.allowsMarkType(t.type):sy(t.type,e))||(s=t.addToSet(s),!1)),this.nodes.push(new ny(e,t,s,r,null,o)),this.open++,n}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;else this.localPreserveWS&&(this.nodes[t].options|=Qv);return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let n=this.nodes[t].content;for(let t=n.length-1;t>=0;t--)e+=n[t].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==t&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,n){if(e!=t&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&t.compareDocumentPosition(this.find[r].node)&(n?2:4)&&(this.find[r].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf(`|`)>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split(`/`),n=this.options.context,r=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+ +!r,a=(e,o)=>{for(;e>=0;e--){let s=t[e];if(s==``){if(e==t.length-1||e==0)continue;for(;o>=i;o--)if(a(e-1,o))return!0;return!1}{let e=o>0||o==0&&r?this.nodes[o].type:n&&o>=i?n.node(o-i).type:null;if(!e||e.name!=s&&!e.isInGroup(s))return!1;o--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let e in this.parser.schema.nodes){let t=this.parser.schema.nodes[e];if(t.isTextblock&&t.defaultAttrs)return t}}};function iy(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let e=t.nodeType==1?t.nodeName.toLowerCase():null;e&&Zv.hasOwnProperty(e)&&n?(n.appendChild(t),t=n):e==`li`?n=t:e&&(n=null)}}function ay(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function oy(e){let t={};for(let n in e)t[n]=e[n];return t}function sy(e,t){let n=t.schema.nodes;for(let r in n){let i=n[r];if(!i.allowsMarkType(e))continue;let a=[],o=e=>{a.push(e);for(let n=0;n<e.edgeCount;n++){let{type:r,next:i}=e.edge(n);if(r==t||a.indexOf(i)<0&&o(i))return!0}};if(o(i.contentMatch))return!0}}var cy=class e{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},n){n||=uy(t).createDocumentFragment();let r=n,i=[];return e.forEach(e=>{if(i.length||e.marks.length){let n=0,a=0;for(;n<i.length&&a<e.marks.length;){let t=e.marks[a];if(!this.marks[t.type.name])a++;else{if(!t.eq(i[n][0])||t.type.spec.spanning===!1)break;n++,a++}}for(;n<i.length;)r=i.pop()[1];for(;a<e.marks.length;){let n=e.marks[a++],o=this.serializeMark(n,e.isInline,t);o&&(i.push([n,r]),r.appendChild(o.dom),r=o.contentDOM||o.dom)}}r.appendChild(this.serializeNodeInner(e,t))}),n}serializeNodeInner(e,t){if(e.isText)return uy(t).createTextNode(e.text);let{dom:n,contentDOM:r}=my(uy(t),this.nodes[e.type.name](e),null,e.attrs);if(r){if(e.isLeaf)throw RangeError(`Content hole not allowed in a leaf node spec`);this.serializeFragment(e.content,t,r)}return n}serializeNode(e,t={}){let n=this.serializeNodeInner(e,t);for(let r=e.marks.length-1;r>=0;r--){let i=this.serializeMark(e.marks[r],e.isInline,t);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,t,n={}){let r=this.marks[e.type.name];return r&&my(uy(n),r(e,t),null,e.attrs)}static renderSpec(e,t,n=null,r){return typeof t==`string`?{dom:e.createTextNode(t)}:my(e,t,n,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(e){let t=ly(e.nodes);return t.text||=e=>e.text,t}static marksFromSchema(e){return ly(e.marks)}};function ly(e){let t={};for(let n in e){let r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function uy(e){return e.document||window.document}var dy=new WeakMap;function fy(e){let t=dy.get(e);return t===void 0&&dy.set(e,t=py(e)),t}function py(e){let t=null;function n(e){if(e&&typeof e==`object`){if(Array.isArray(e)){if(typeof e[0]==`string`)t||=[],t.push(e);else for(let t=0;t<e.length;t++)n(e[t])}else for(let t in e)n(e[t])}}return n(e),t}function my(e,t,n,r){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let i=t[0],a;if(typeof i!=`string`)throw RangeError(`Invalid array passed to renderSpec`);if(r&&(a=fy(r))&&a.indexOf(t)>-1)throw RangeError(`Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.`);let o=i.indexOf(` `);o>0&&(n=i.slice(0,o),i=i.slice(o+1));let s,c=n?e.createElementNS(n,i):e.createElement(i),l=t[1],u=1;if(l&&typeof l==`object`&&l.nodeType==null&&!Array.isArray(l)){u=2;for(let e in l)if(l[e]!=null){let t=e.indexOf(` `);t>0?c.setAttributeNS(e.slice(0,t),e.slice(t+1),l[e]):e==`style`&&c.style?c.style.cssText=l[e]:c.setAttribute(e,l[e])}}for(let i=u;i<t.length;i++){let a=t[i];if(a===0){if(i<t.length-1||i>u)throw RangeError(`Content hole must be the only child of its parent node`);return{dom:c,contentDOM:c}}if(typeof a==`string`)c.appendChild(e.createTextNode(a));else{let{dom:t,contentDOM:i}=my(e,a,n,r);if(c.appendChild(t),i){if(s)throw RangeError(`Multiple content holes`);s=i}}}return{dom:c,contentDOM:s}}var hy=65535,gy=2**16;function _y(e,t){return e+t*gy}function vy(e){return e&hy}function yy(e){return(e-(e&hy))/gy}var by=1,xy=2,Sy=4,Cy=8,wy=class{constructor(e,t,n){this.pos=e,this.delInfo=t,this.recover=n}get deleted(){return(this.delInfo&Cy)>0}get deletedBefore(){return(this.delInfo&5)>0}get deletedAfter(){return(this.delInfo&6)>0}get deletedAcross(){return(this.delInfo&Sy)>0}},Ty=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(e){let t=0,n=vy(e);if(!this.inverted)for(let e=0;e<n;e++)t+=this.ranges[e*3+2]-this.ranges[e*3+1];return this.ranges[n*3]+t+yy(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,n){let r=0,i=this.inverted?2:1,a=this.inverted?1:2;for(let o=0;o<this.ranges.length;o+=3){let s=this.ranges[o]-(this.inverted?r:0);if(s>e)break;let c=this.ranges[o+i],l=this.ranges[o+a],u=s+c;if(e<=u){let i=c?e==s?-1:e==u?1:t:t,a=s+r+(i<0?0:l);if(n)return a;let d=e==(t<0?s:u)?null:_y(o/3,e-s),f=0;return c&&(f|=e==s?xy:e==u?by:Sy,(t<0?e!=s:e!=u)&&(f|=Cy)),new wy(a,f,d)}r+=l-c}return n?e+r:new wy(e+r,0,null)}touches(e,t){let n=0,r=vy(t),i=this.inverted?2:1,a=this.inverted?1:2;for(let t=0;t<this.ranges.length;t+=3){let o=this.ranges[t]-(this.inverted?n:0);if(o>e)break;let s=this.ranges[t+i];if(e<=o+s&&t==r*3)return!0;n+=this.ranges[t+a]-s}return!1}forEach(e){let t=this.inverted?2:1,n=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let a=this.ranges[r],o=a-(this.inverted?i:0),s=a+(this.inverted?0:i),c=this.ranges[r+t],l=this.ranges[r+n];e(o,o+c,s,s+l),i+=l-c}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?`-`:``)+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Ty.empty=new Ty([]);var Ey=class e{constructor(e,t,n=0,r=e?e.length:0){this.mirror=t,this.from=n,this.to=r,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(e,t){this.ownData||=(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=0,n=this._maps.length;t<e._maps.length;t++){let r=e.getMirror(t);this.appendMap(e._maps[t],r!=null&&r<t?n+r:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||=[],this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,n=this._maps.length+e._maps.length;t>=0;t--){let r=e.getMirror(t);this.appendMap(e._maps[t].invert(),r!=null&&r>t?n-r-1:void 0)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,n){let r=0;for(let n=this.from;n<this.to;n++){let i=this._maps[n].mapResult(e,t);if(i.recover!=null){let t=this.getMirror(n);if(t!=null&&t>n&&t<this.to){n=t,e=this._maps[t].recover(i.recover);continue}}r|=i.delInfo,e=i.pos}return n?e:new wy(e,r,null)}},Dy=Object.create(null),Oy=class{getMap(){return Ty.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw RangeError(`Invalid input for Step.fromJSON`);let n=Dy[t.stepType];if(!n)throw RangeError(`No step type ${t.stepType} defined`);return n.fromJSON(e,t)}static jsonID(e,t){if(e in Dy)throw RangeError(`Duplicate use of step JSON ID `+e);return Dy[e]=t,t.prototype.jsonID=e,t}},ky=class e{constructor(e,t){this.doc=e,this.failed=t}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,r,i){try{return e.ok(t.replace(n,r,i))}catch(t){if(t instanceof ev)return e.fail(t.message);throw t}}};function Ay(e,t,n){let r=[];for(let i=0;i<e.childCount;i++){let a=e.child(i);a.content.size&&(a=a.copy(Ay(a.content,t,a))),a.isInline&&(a=t(a,n,i)),r.push(a)}return K.fromArray(r)}var jy=class e extends Oy{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=e.resolve(this.from),r=n.node(n.sharedDepth(this.to)),i=new q(Ay(t.content,(e,t)=>!e.isAtom||!t.type.allowsMarkType(this.mark.type)?e:e.mark(this.mark.addToSet(e.marks)),r),t.openStart,t.openEnd);return ky.fromReplace(e,this.from,this.to,i)}invert(t){let n=[];return t.nodesBetween(this.from,this.to,(t,r)=>{if(t.isInline&&t.isAtom){let i=this.mark.addToSet(t.marks);if(!$_.sameSet(i,t.marks)){let a=Math.max(this.from,r),o=Math.min(this.to,r+t.nodeSize);Ny(My,a,o,this.mark,n);for(let r of t.marks)r.isInSet(i)||Ny(e,a,o,r,n)}}}),n.length==1?n[0]:new Py(n)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`addMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for AddMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Oy.jsonID(`addMark`,jy);var My=class e extends Oy{constructor(e,t,n){super(),this.from=e,this.to=t,this.mark=n}apply(e){let t=e.slice(this.from,this.to),n=new q(Ay(t.content,e=>e.mark(this.mark.removeFromSet(e.marks)),e),t.openStart,t.openEnd);return ky.fromReplace(e,this.from,this.to,n)}invert(e){let t=[];return e.nodesBetween(this.from,this.to,(e,n)=>{e.isInline&&e.isAtom&&this.mark.isInSet(e.marks)&&Ny(jy,Math.max(this.from,n),Math.min(this.to,n+e.nodeSize),this.mark,t)}),t.length==1?t[0]:new Py(t)}map(t){let n=t.map(this.from,1),r=t.map(this.to,-1);return n>=r?null:new e(n,r,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:`removeMark`,mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for RemoveMarkStep.fromJSON`);return new e(n.from,n.to,t.markFromJSON(n.mark))}};Oy.jsonID(`removeMark`,My);function Ny(e,t,n,r,i){let a=i.length?i[i.length-1]:null;a&&a instanceof e&&a.to==t&&a.mark.eq(r)?i[i.length-1]=new e(a.from,n,r):i.push(new e(t,n,r))}var Py=class e extends Oy{constructor(e){super(),this.steps=e}apply(e){for(let t of this.steps){let n=t.apply(e);if(!n.doc)return n;e=n.doc}return new ky(e,null)}invert(t){return new e(this.steps.map(e=>e.invert(t)))}map(t){let n=[];for(let e of this.steps){let r=e.map(t);r&&n.push(r)}return n.length?new e(n):null}toJSON(){return{stepType:`markSet`,steps:this.steps.map(e=>e.toJSON())}}static fromJSON(t,n){if(!Array.isArray(n.steps)||!n.steps.every(e=>e.stepType==`addMark`||e.stepType==`removeMark`))throw RangeError(`Invalid JSON for MarkSetStep`);return new e(n.steps.map(e=>Oy.fromJSON(t,e)))}};Oy.jsonID(`markSet`,Py);var Fy=class e extends Oy{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ky.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return ky.fromReplace(e,this.pos,this.pos+1,new q(K.from(n),0,+!t.isLeaf))}invert(t){let n=t.nodeAt(this.pos);if(n){let t=this.mark.addToSet(n.marks);if(t.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(t))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Iy(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`addNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for AddNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Oy.jsonID(`addNodeMark`,Fy);var Iy=class e extends Oy{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return ky.fail(`No node at mark step's position`);let n=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return ky.fromReplace(e,this.pos,this.pos+1,new q(K.from(n),0,+!t.isLeaf))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Fy(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:`removeNodeMark`,pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!=`number`)throw RangeError(`Invalid input for RemoveNodeMarkStep.fromJSON`);return new e(n.pos,t.markFromJSON(n.mark))}};Oy.jsonID(`removeNodeMark`,Iy);var Ly=class e extends Oy{constructor(e,t,n,r=!1){super(),this.from=e,this.to=t,this.slice=n,this.structure=r}apply(e){return this.structure&&zy(e,this.from,this.to)?ky.fail(`Structure replace would overwrite content`):ky.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Ty([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),r=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return r.deletedAcross&&n.deletedAcross?null:new e(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?q.empty:new q(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?q.empty:new q(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}return null}toJSON(){let e={stepType:`replace`,from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`)throw RangeError(`Invalid input for ReplaceStep.fromJSON`);return new e(n.from,n.to,q.fromJSON(t,n.slice),!!n.structure)}};Ly.MAP_BIAS=1,Oy.jsonID(`replace`,Ly);var Ry=class e extends Oy{constructor(e,t,n,r,i,a,o=!1){super(),this.from=e,this.to=t,this.gapFrom=n,this.gapTo=r,this.slice=i,this.insert=a,this.structure=o}apply(e){if(this.structure&&(zy(e,this.from,this.gapFrom)||zy(e,this.gapTo,this.to)))return ky.fail(`Structure gap-replace would overwrite content`);let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return ky.fail(`Gap is not a flat range`);let n=this.slice.insertAt(this.insert,t.content);return n?ky.fromReplace(e,this.from,this.to,n):ky.fail(`Content does not fit in gap`)}getMap(){return new Ty([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),r=t.mapResult(this.to,-1),i=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),a=this.to==this.gapTo?r.pos:t.map(this.gapTo,1);return n.deletedAcross&&r.deletedAcross||i<n.pos||a>r.pos?null:new e(n.pos,r.pos,i,a,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:`replaceAround`,from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(t,n){if(typeof n.from!=`number`||typeof n.to!=`number`||typeof n.gapFrom!=`number`||typeof n.gapTo!=`number`||typeof n.insert!=`number`)throw RangeError(`Invalid input for ReplaceAroundStep.fromJSON`);return new e(n.from,n.to,n.gapFrom,n.gapTo,q.fromJSON(t,n.slice),n.insert,!!n.structure)}};Oy.jsonID(`replaceAround`,Ry);function zy(e,t,n){let r=e.resolve(t),i=n-t,a=r.depth;for(;i>0&&a>0&&r.indexAfter(a)==r.node(a).childCount;)a--,i--;if(i>0){let e=r.node(a).maybeChild(r.indexAfter(a));for(;i>0;){if(!e||e.isLeaf)return!0;e=e.firstChild,i--}}return!1}function By(e,t,n,r){let i=[];e.doc.nodesBetween(t,n,(e,a,o)=>{if(!e.isInline)return;let s=e.marks;!r.isInSet(s)&&o.type.allowsMarkType(r.type)&&Ny(jy,Math.max(a,t),Math.min(a+e.nodeSize,n),r,i)}),i.forEach(t=>e.step(t))}function Vy(e,t,n,r){let i=[],a=0;e.doc.nodesBetween(t,n,(e,o)=>{if(!e.isInline||!e.isAtom)return;a++;let s=null;if(r instanceof Uv){let t=e.marks,n;for(;n=r.isInSet(t);)(s||=[]).push(n),t=n.removeFromSet(t)}else r?r.isInSet(e.marks)&&(s=[r]):s=e.marks;if(s&&s.length){let r=Math.min(o+e.nodeSize,n);for(let e=0;e<s.length;e++){let n=s[e],c;for(let e=0;e<i.length;e++){let t=i[e];t.step==a-1&&n.eq(i[e].style)&&(c=t)}c?(c.to=r,c.step=a):i.push({style:n,from:Math.max(o,t),to:r,step:a})}}}),i.forEach(t=>e.step(new My(t.from,t.to,t.style)))}function Hy(e,t,n,r=n.contentMatch,i=!0){let a=e.doc.nodeAt(t),o=[],s=t+1;for(let t=0;t<a.childCount;t++){let c=a.child(t),l=s+c.nodeSize,u=r.matchType(c.type);if(!u)o.push(new Ly(s,l,q.empty));else{r=u;for(let t=0;t<c.marks.length;t++)n.allowsMarkType(c.marks[t].type)||e.step(new My(s,l,c.marks[t]));if(i&&c.isText&&n.whitespace!=`pre`){let e,t=/\r?\n|\r/g,r;for(;e=t.exec(c.text);)r||=new q(K.from(n.schema.text(` `,n.allowedMarks(c.marks))),0,0),o.push(new Ly(s+e.index,s+e.index+e[0].length,r))}}s=l}if(!r.validEnd){let t=r.fillBefore(K.empty,!0);e.replace(s,s,new q(t,0,0))}for(let t=o.length-1;t>=0;t--)e.step(o[t])}function Uy(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Wy(e){let t=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let n=e.depth,r=0,i=0;;--n){let a=e.$from.node(n),o=e.$from.index(n)+r,s=e.$to.indexAfter(n)-i;if(n<e.depth&&a.canReplace(o,s,t))return n;if(n==0||a.type.spec.isolating||!Uy(a,o,s))break;o&&(r=1),s<a.childCount&&(i=1)}return null}function Gy(e,t,n){let{$from:r,$to:i,depth:a}=t,o=r.before(a+1),s=i.after(a+1),c=o,l=s,u=K.empty,d=0;for(let e=a,t=!1;e>n;e--)t||r.index(e)>0?(t=!0,u=K.from(r.node(e).copy(u)),d++):c--;let f=K.empty,p=0;for(let e=a,t=!1;e>n;e--)t||i.after(e+1)<i.end(e)?(t=!0,f=K.from(i.node(e).copy(f)),p++):l++;e.step(new Ry(c,l,o,s,new q(u.append(f),d,p),u.size-d,!0))}function Ky(e,t,n=null,r=e){let i=Jy(e,t),a=i&&Yy(r,t);return a?i.map(qy).concat({type:t,attrs:n}).concat(a.map(qy)):null}function qy(e){return{type:e,attrs:null}}function Jy(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.contentMatchAt(r).findWrapping(t);if(!a)return null;let o=a.length?a[0]:t;return n.canReplaceWith(r,i,o)?a:null}function Yy(e,t){let{parent:n,startIndex:r,endIndex:i}=e,a=n.child(r),o=t.contentMatch.findWrapping(a.type);if(!o)return null;let s=(o.length?o[o.length-1]:t).contentMatch;for(let e=r;s&&e<i;e++)s=s.matchType(n.child(e).type);return!s||!s.validEnd?null:o}function Xy(e,t,n){let r=K.empty;for(let e=n.length-1;e>=0;e--){if(r.size){let t=n[e].type.contentMatch.matchFragment(r);if(!t||!t.validEnd)throw RangeError(`Wrapper type given to Transform.wrap does not form valid content of its parent wrapper`)}r=K.from(n[e].type.create(n[e].attrs,r))}let i=t.start,a=t.end;e.step(new Ry(i,a,i,a,new q(r,0,0),n.length,!0))}function Zy(e,t,n,r,i){if(!r.isTextblock)throw RangeError(`Type given to setBlockType should be a textblock`);let a=e.steps.length;e.doc.nodesBetween(t,n,(t,n)=>{let o=typeof i==`function`?i(t):i;if(t.isTextblock&&!t.hasMarkup(r,o)&&eb(e.doc,e.mapping.slice(a).map(n),r)){let i=null;if(r.schema.linebreakReplacement){let e=r.whitespace==`pre`,t=!!r.contentMatch.matchType(r.schema.linebreakReplacement);e&&!t?i=!1:!e&&t&&(i=!0)}i===!1&&$y(e,t,n,a),Hy(e,e.mapping.slice(a).map(n,1),r,void 0,i===null);let s=e.mapping.slice(a),c=s.map(n,1),l=s.map(n+t.nodeSize,1);return e.step(new Ry(c,l,c+1,l-1,new q(K.from(r.create(o,null,t.marks)),0,0),1,!0)),i===!0&&Qy(e,t,n,a),!1}})}function Qy(e,t,n,r){t.forEach((i,a)=>{if(i.isText){let o,s=/\r?\n|\r/g;for(;o=s.exec(i.text);){let i=e.mapping.slice(r).map(n+1+a+o.index);e.replaceWith(i,i+1,t.type.schema.linebreakReplacement.create())}}})}function $y(e,t,n,r){t.forEach((i,a)=>{if(i.type==i.type.schema.linebreakReplacement){let i=e.mapping.slice(r).map(n+1+a);e.replaceWith(i,i+1,t.type.schema.text(`
|
|
@@ -255,7 +255,7 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
|
|
|
255
255
|
2. Cannot start or end with "-"
|
|
256
256
|
3. "-" cannot repeat`);DW.customSchemes.push([e,t])}function AW(){DW.scanner=sW(DW.customSchemes);for(let e=0;e<DW.tokenQueue.length;e++)DW.tokenQueue[e][1]({scanner:DW.scanner});DW.parser=SW(DW.scanner.tokens);for(let e=0;e<DW.pluginQueue.length;e++)DW.pluginQueue[e][1]({scanner:DW.scanner,parser:DW.parser});return DW.initialized=!0,DW}function jW(e){return DW.initialized||AW(),CW(DW.parser.start,e,cW(DW.scanner.start,e))}jW.scan=cW;function MW(e,t=null,n=null){if(t&&typeof t==`object`){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let r=new pW(n),i=jW(e),a=[];for(let e=0;e<i.length;e++){let n=i[e];n.isLink&&(!t||n.t===t)&&r.check(n)&&a.push(n.toFormattedObject(r))}return a}var NW=`[\0- \xA0 -\u2029 ]`,PW=new RegExp(NW),FW=RegExp(`${NW}$`),IW=RegExp(`${NW}+$`),LW=new RegExp(NW,`g`);function RW(e,t,n){let r=e.doc.resolve(t.to);if(!r.nodeBefore?.isText)return;let i=e.doc.textBetween(t.from,t.to,``,``).match(IW)?.[0];if(!i)return;let a=t.to-i.length,o=uk(a,t.to,e.doc).filter(e=>e.mark.type===n);if(!o.length)return;let{nodeAfter:s}=r;if(s&&o.some(e=>e.mark.isInSet(s.marks)))return;let c=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(c),e.selection.empty&&e.selection.from===t.to&&e.removeStoredMark(n)}function zW(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?[`()`,`[]`].includes(e[0].value+e[2].value):!1}function BW(e){return new Zb({key:new ex(`autolink`),appendTransaction:(t,n,r)=>{let i=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),a=t.some(e=>e.getMeta(`preventAutolink`));if(!i||a)return;let{tr:o}=r,s=CO(n.doc,[...t]);if(!t.some(nD)){let t=[];s.steps.forEach((e,n)=>{if(!(e instanceof Ly)||!e.slice.size)return;let r=s.mapping.slice(n+1),i=r.map(e.from,1),a=r.map(e.from+e.slice.size,-1);i<a&&t.push({from:i,to:a})}),t.sort((e,t)=>t.to-e.to),t.forEach(t=>RW(o,t,e.type))}if(lk(s).forEach(({newRange:t})=>{let n=wO(r.doc,t,e=>e.isTextblock),i,a;if(n.length>1)i=n[0],a=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0,` `);else if(n.length){let e=r.doc.textBetween(t.from,t.to,` `,` `);if(!FW.test(e))return;i=n[0],a=r.doc.textBetween(i.pos,t.to,void 0,` `)}if(i&&a){let t=a.split(PW).filter(Boolean);if(t.length<=0)return!1;let n=t[t.length-1],s=i.pos+a.lastIndexOf(n);if(!n)return!1;let c=jW(n).map(t=>t.toObject(e.defaultProtocol));if(!zW(c))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:s+e.start+1,to:s+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{uk(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||o.addMark(t.from,t.to,e.type.create({href:t.href}))})}}),o.steps.length)return o}})}function VW(e){return new Zb({key:new ex(`handleClickLink`),props:{handleClick:(t,n,r)=>{if(r.button!==0||!t.editable)return!1;let i=null;if(r.target instanceof HTMLAnchorElement)i=r.target;else{let t=r.target;if(!t)return!1;let n=e.editor.view.dom;i=t.closest(`a`),i&&!n.contains(i)&&(i=null)}if(!i)return!1;let a=!1;if(e.enableClickSelection&&(a=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){let n=ok(t.state,e.type.name),r=i.href??n.href,o=i.target??n.target;r&&(window.open(r,o),a=!0)}return a}}})}var HW=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,UW=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function WW(e,t){let n=0;for(let r=t-1;r>=0&&e[r]===`\\`;--r)n+=1;return n%2==1}function GW(e,t){let n=0,r=0;for(;r<t;){if(e[r]!=="`"||n===0&&WW(e,r)){r+=1;continue}let i=0;for(;r<t&&e[r]==="`";)i+=1,r+=1;n===0?n=i:i===n&&(n=0)}return n>0}function KW(e,t,n){let[,r,i]=t;return(t.index?e[t.index-1]:void 0)===`!`||WW(e,t.index??0)||GW(e,t.index??0)?!1:!!r.trim()&&n(i)}function qW(e){let[t,n,r,,i,a,o]=e,s=i??a??o;return{index:e.index??0,text:t,replaceWith:n,data:{href:r,title:s||null,markdown:!0}}}function JW(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function YW(e){return{href:e.data?.href,title:e.data?.title??null}}function XW(e){let t=Lj({find:t=>{let n=HW.exec(t);return!n||!KW(t,n,e.isAllowedHref)?null:qW(n)},type:e.type,getAttributes:YW});return new ij({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function ZW(e){let t=Gj({find:t=>{let n=[];for(let r of t.matchAll(UW))KW(t,r,e.isAllowedHref)&&n.push(qW(r));let r=(e.findPlainUrls?.call(e,t)??[]).filter(e=>!n.some(t=>JW(t,e)));return[...n,...r]},type:e.type,getAttributes:YW});return new pj({find:t.find,handler:e=>{let n=t.handler(e);return n!==null&&e.state.tr.steps.length&&e.match.data?.markdown&&e.state.tr.setMeta(`preventAutolink`,!0),n}})}function QW(e){return new Zb({key:new ex(`handlePasteLink`),props:{handlePaste:(t,n,r)=>{let{shouldAutoLink:i}=e,{state:a}=t,{selection:o}=a,{empty:s}=o;if(s)return!1;let c=``;r.content.forEach(e=>{c+=e.textContent});let l=MW(c,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===c);return!c||!l||i!==void 0&&!i(l.value)?!1:e.editor.commands.setMark(e.type,{href:l.href})}}})}function $W(e,t){let n=[`http`,`https`,`ftp`,`ftps`,`mailto`,`tel`,`callto`,`sms`,`cid`,`xmpp`];return t&&t.forEach(e=>{let t=typeof e==`string`?e:e.scheme;t&&n.push(t)}),!e||e.replace(LW,``).match(RegExp(`^(?:(?:${n.map(e=>e.replace(/[-/\\^$*+?.()|[\]{}]/g,`\\$&`)).join(`|`)}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,`i`))}var eG=fj.create({name:`link`,priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{typeof e==`string`?kW(e):kW(e.scheme,e.optionalSlashes)})},onDestroy(){OW()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer nofollow`,class:null},isAllowedUri:(e,t)=>!!$W(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes(`@`))return!0;let r=(e.includes(`@`)?e.split(`@`).pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(r)||!/\./.test(r))}}},addAttributes(){return{href:{default:null,parseHTML(e){return e.getAttribute(`href`)}},target:{default:this.options.HTMLAttributes.target??null},rel:{default:this.options.HTMLAttributes.rel??null},class:{default:this.options.HTMLAttributes.class??null},title:{default:null}}},parseHTML(){return[{tag:`a[href]`,getAttrs:e=>{let t=e.getAttribute(`href`);return!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!$W(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!$W(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?[`a`,WO(this.options.HTMLAttributes,e),0]:[`a`,WO(this.options.HTMLAttributes,{...e,href:``}),0]},markdownTokenName:`link`,parseMarkdown:(e,t)=>t.applyMark(`link`,t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{let n=e.attrs?.href??``,r=e.attrs?.title??``,i=t.renderChildren(e);return r?`[${i}](${n} "${r}")`:`[${i}](${n})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:e=>!!$W(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta(`preventAutolink`,!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:e=>!!$W(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta(`preventAutolink`,!0).run()}},addInputRules(){return this.options.markdownLinks?[XW({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!$W(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=e=>{let t=[];if(e){let{protocols:n,defaultProtocol:r}=this.options;MW(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!$W(e,n),protocols:n,defaultProtocol:r})).forEach(e=>{this.options.shouldAutoLink(e.value)&&t.push({text:e.value,data:{href:e.href},index:e.start})})}return t};return this.options.markdownLinks?[ZW({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!$W(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[Gj({find:e,type:this.type,getAttributes:e=>({href:e.data?.href})})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(BW({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!$W(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(VW({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick===`whenNotEditable`||this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(QW({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}}),tG=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,nG=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,rG=fj.create({name:`strike`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`s`},{tag:`del`},{tag:`strike`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`line-through`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`s`,WO(this.options.HTMLAttributes,e),0]},markdownTokenName:`del`,parseMarkdown:(e,t)=>t.applyMark(`strike`,t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Lj({find:tG,type:this.type})]},addPasteRules(){return[Gj({find:nG,type:this.type})]}}),iG=Uj.create({name:`text`,group:`inline`,parseMarkdown:e=>({type:`text`,text:e.text||``}),renderMarkdown:e=>e.text||``}),aG=fj.create({name:`underline`,addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:`u`},{style:`text-decoration`,consuming:!1,getAttrs:e=>e.includes(`underline`)?{}:!1}]},renderHTML({HTMLAttributes:e}){return[`u`,WO(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||`underline`,t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`++${t.renderChildren(e)}++`},markdownTokenizer:{name:`underline`,level:`inline`,start(e){return e.indexOf(`++`)},tokenize(e,t,n){let r=/^(\+\+)([\s\S]+?)(\+\+)/.exec(e);if(!r)return;let i=r[2].trim();return{type:`underline`,raw:r[0],text:i,tokens:n.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),oG=bj.create({name:`starterKit`,addExtensions(){let e=[];return this.options.bold!==!1&&e.push(mH.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(lH.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(KF.configure(this.options.bulletList)),this.options.code!==!1&&e.push(VF.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(vH.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(yH.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(Nz.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(Pz.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(bH.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(xH.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(aB.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(SH.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(DH.configure(this.options.italic)),this.options.listItem!==!1&&e.push(hI.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(wI.configure(this.options?.listKeymap)),this.options.link!==!1&&e.push(eG.configure(this.options?.link)),this.options.orderedList!==!1&&e.push(WI.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(QI.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(rG.configure(this.options.strike)),this.options.text!==!1&&e.push(iG.configure(this.options.text)),this.options.underline!==!1&&e.push(aG.configure(this.options?.underline)),this.options.trailingNode!==!1&&e.push(iB.configure(this.options?.trailingNode)),e}}),sG=[`gray`,`red`,`orange`,`green`,`blue`,`purple`],cG={gray:`Cinza`,red:`Vermelho`,orange:`Laranja`,green:`Verde`,blue:`Azul`,purple:`Roxo`},lG=e=>sG.includes(e??``),uG=fj.create({name:`textColor`,addAttributes(){return{color:{default:null,parseHTML:e=>e.getAttribute(`data-color`),renderHTML:e=>({"data-color":e.color})}}},parseHTML(){return[{tag:`span[data-color]`,getAttrs:e=>lG(e.getAttribute(`data-color`))?null:!1}]},renderHTML({HTMLAttributes:e}){return[`span`,e,0]},markdownTokenName:`textColor`,markdownTokenizer:{name:`textColor`,level:`inline`,start:e=>e.indexOf(`<span data-color=`),tokenize(e,t,n){let r=/^<span data-color="([a-z]+)">([\s\S]*?)<\/span>/.exec(e);if(r&&lG(r[1]??null))return{type:`textColor`,raw:r[0],color:r[1],tokens:n.inlineTokens(r[2]??``)}}},parseMarkdown:(e,t)=>t.applyMark(`textColor`,t.parseInline(e.tokens??[]),{color:e.color}),renderMarkdown:(e,t)=>`<span data-color="${e.attrs?.color}">${t.renderChildren(e)}</span>`,addCommands(){return{setTextColor:e=>({commands:t})=>t.setMark(this.name,{color:e}),unsetTextColor:()=>({commands:e})=>e.unsetMark(this.name)}}}),dG=hI.extend({renderMarkdown:(e,t,n)=>{let r=Number(n.meta?.parentAttrs?.start??1),i=n.parentType===`orderedList`?`${r+(n.index??0)}. `:`- `,a=` `.repeat(i.length),[o,...s]=e.content??[],c=i+(o?t.renderChildren([o]):``);return s.forEach((e,n)=>{let r=t.renderChild?.(e,n+1)??t.renderChildren([e]);c+=`\n\n${r.split(`
|
|
257
257
|
`).map(e=>e&&a+e).join(`
|
|
258
|
-
`)}`}),c}}),fG=$I.extend({parseMarkdown(e,t){let n=this.parent?.(e,t);return(Array.isArray(n)?n:n?[n]:[]).map(e=>`type`in e&&e.type===`image`?{type:`paragraph`,content:[e]}:e)}}),pG=HF.extend({excludes:``});function mG(e=fF,t=MF){return[oG.configure({code:!1,link:{openOnClick:!1,autolink:!0},listItem:!1,paragraph:!1}),pG,fG,dG,e.configure({inline:!0,HTMLAttributes:{loading:`lazy`,decoding:`async`}}),yz.configure({table:{resizable:!1}}),t,uG,Qz.configure({placeholder:U(`Escreva aqui, ou digite / para inserir um bloco. Cole um print com Ctrl+V.`)}),$V.configure({markedOptions:{gfm:!0}})]}var hG=[{id:`s`,label:()=>U(`Pequena`)},{id:`m`,label:()=>U(`Média`)},{id:`full`,label:()=>U(`Larga`)}];function gG({slug:e,src:t}){let n=$N(t),r=YN(e,n),[i,a]=(0,_.useState)(!1);if(!n)return null;let o=t=>{a(!1),JN(e,n,{...r??QN(),display:t}).catch(()=>a(!0))};return(0,R.jsxs)(`fieldset`,{className:`grid gap-1.5`,children:[(0,R.jsx)(`legend`,{className:`mb-1 text-sm font-bold`,children:U(`Tamanho da imagem`)}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:hG.map(e=>(0,R.jsx)(`button`,{type:`button`,"aria-pressed":r?.display===e.id,disabled:!r,onClick:()=>o(e.id),className:`min-h-11 min-w-11 rounded-md border border-border px-3 py-1 text-sm hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:font-bold disabled:opacity-50`,children:e.label()},e.id))}),r&&ZN(r)&&(0,R.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:U(`Com {n} marcadores, a imagem pequena pode amontoá-los. Experimente Média.`,{n:r.markers.length})}),i&&(0,R.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:U(`Não foi possível salvar o tamanho.`)})]})}function _G({...e}){return(0,R.jsx)(td,{"data-slot":`popover`,...e})}function vG({...e}){return(0,R.jsx)(ad,{"data-slot":`popover-trigger`,...e})}function yG({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,R.jsx)(ld,{children:(0,R.jsx)(dd,{"data-slot":`popover-content`,align:t,sideOffset:n,className:L(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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`,e),...r})})}function bG({...e}){return(0,R.jsx)(rd,{"data-slot":`popover-anchor`,...e})}function xG({open:e,onClose:t,getRect:n,label:r,onEscape:i,children:a}){return(0,R.jsxs)(_G,{open:e,onOpenChange:e=>!e&&t(),children:[(0,R.jsx)(bG,{virtualRef:{current:{getBoundingClientRect:n}}}),(0,R.jsx)(yG,{align:`start`,side:`bottom`,sideOffset:8,collisionPadding:PF(),"aria-label":r,className:`max-h-(--radix-popover-content-available-height) w-80 overflow-y-auto p-3 shadow-[0_8px_24px_-12px_rgb(21_26_51/0.35)]`,onEscapeKeyDown:i,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget?.querySelector(`input`)?.focus()},children:a})]})}function SG(e){let t=e.state.selection;return!(t instanceof X)||t.node.type.name!==`image`?null:{pos:t.from,alt:t.node.attrs.alt??``,src:t.node.attrs.src}}var CG=330;function wG({editor:e,slug:t,onAnnotate:n}){let r=fN({editor:e,selector:({editor:e})=>SG(e)}),[i,a]=(0,_.useState)(null),o=r!==null&&i!==r.pos;return r===null&&i!==null&&a(null),(0,R.jsx)(xG,{open:o,onClose:()=>a(r?.pos??null),getRect:()=>{let t=r?e.view.nodeDOM(r.pos):null;if(!(t instanceof HTMLElement))return new DOMRect;let n=t.getBoundingClientRect(),i=Math.max(n.top+1,Math.min(n.bottom,window.innerHeight-CG));return new DOMRect(n.x,n.y,n.width,i-n.y)},label:U(`Descrição da imagem`),onEscape:()=>e.commands.focus(),children:r&&(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(`label`,{htmlFor:`image-alt`,className:`text-sm font-bold`,children:U(`Descrição da imagem`)}),(0,R.jsx)(ag,{id:`image-alt`,defaultValue:r.alt,placeholder:U(`Ex.: Tela de clientes com o botão Novo cliente`),onChange:t=>e.chain().updateAttributes(`image`,{alt:t.target.value}).setNodeSelection(r.pos).run(),onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),a(r.pos),e.commands.focus())}},r.pos),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`Quem usa leitor de tela e a IA que lê o manual entendem a imagem por aqui.`)}),$N(r.src)&&(0,R.jsx)(gG,{slug:t,src:r.src}),$N(r.src)&&(0,R.jsxs)($d,{type:`button`,size:`sm`,className:`mt-1 justify-self-start`,onClick:()=>{a(r.pos),n(r.src,r.alt)},children:[(0,R.jsx)(Lm,{}),` `,U(`Editar imagem`)]})]})})}var TG=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`];async function EG(e,t,n,r,i){let a=r;for(let r of n)try{let{path:n}=await vf.uploadAsset(t,r),i=r.name.replace(/\.[^.]+$/,``);e.chain().focus().insertContentAt(a,{type:`image`,attrs:{src:SF(t,n),alt:i}}).run(),a+=1}catch(e){i(W(e,U(`Não foi possível enviar a imagem.`)))}}function DG(e){let t=e.trim();if(!t)return{ok:!0,href:``};if(/\s/.test(t))return{ok:!1,error:U(`Endereço não pode ter espaços. Para ligar a outra página, escolha na lista.`)};if(/^(#|\/|\.\/)/.test(t)||/^mailto:[^@]+@[^@]+$/i.test(t))return{ok:!0,href:t};let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?t:`https://${t}`;try{let e=new URL(n);return[`http:`,`https:`].includes(e.protocol)?!e.hostname.includes(`.`)&&e.hostname!==`localhost`?{ok:!1,error:U(`Falta o domínio, por exemplo: exemplo.com.br`)}:{ok:!0,href:n}:{ok:!1,error:U(`Use um endereço http, https ou mailto.`)}}catch{return{ok:!1,error:U(`Endereço inválido. Exemplo: https://exemplo.com.br`)}}}function OG(e){return`./${e.split(`/`).pop()??e}`}function kG(e){let{from:t,to:n}=e.state.selection,r=e.view.coordsAtPos(t),i=e.view.coordsAtPos(n);return new DOMRect(r.left,r.top,Math.max(i.right-r.left,1),i.bottom-r.top)}function AG({editor:e,open:t,onClose:n,pages:r}){let i=e.getAttributes(`link`).href??``,[a,o]=(0,_.useState)(i),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1);t!==l&&(u(t),t&&(o(i),c(null)));let d=gg(a.trim()),f=d&&!/[/:.#]/.test(d)?Dg(r).filter(e=>gg(e.title).includes(d)).slice(0,5):[],p=t=>{let r=e.chain().focus().extendMarkRange(`link`);t?r.setLink({href:t}).run():r.unsetLink().run(),n()},m=()=>{let e=DG(a);e.ok?p(e.href):c(e.error)};return(0,R.jsx)(xG,{open:t,onClose:()=>{n(),e.commands.focus()},getRect:()=>kG(e),label:U(`Editar link`),children:(0,R.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault();let t=f[0];t&&!s&&f.length===1?p(OG(t.file)):m()},children:[(0,R.jsx)(`label`,{htmlFor:`link-href`,className:`text-sm font-bold`,children:U(`Link para uma página ou endereço`)}),(0,R.jsx)(ag,{id:`link-href`,value:a,"aria-invalid":s!==null,"aria-describedby":s?`link-error`:void 0,onChange:e=>{o(e.target.value),c(null)},placeholder:U(`Nome da página ou https://…`)}),s&&(0,R.jsx)(`p`,{id:`link-error`,role:`alert`,className:`text-xs text-destructive`,children:s}),f.length>0&&(0,R.jsx)(`ul`,{"aria-label":U(`Páginas do manual`),className:`grid gap-0.5`,children:f.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>p(OG(e.file)),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent`,children:[(0,R.jsx)(Np,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`truncate`,children:e.title||U(`Sem título`)})]})},e.id))}),(0,R.jsxs)(`div`,{className:`flex justify-between gap-2 pt-1`,children:[i?(0,R.jsx)($d,{type:`button`,variant:`ghost`,size:`sm`,className:`text-destructive`,onClick:()=>p(``),children:U(`Remover link`)}):(0,R.jsx)(`span`,{}),(0,R.jsx)($d,{type:`submit`,size:`sm`,children:U(`Aplicar`)})]})]})})}function jG(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var MG=class{get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Us(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Hs(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Bs(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Ks(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ws(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Vs(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(Gs(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(qs(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){var e;let{selection:t}=this.editor.state,n=this.getReferencedVirtualElement?.call(this);if(n)return n;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let r=kk(this.view,t.from,t.to),i={getBoundingClientRect:()=>r,getClientRects:()=>[r]};if(t instanceof X){let e=this.view.nodeDOM(t.from),n=e.dataset.nodeViewWrapper?e:e.querySelector(`[data-node-view-wrapper]`);n&&(e=n),e&&(i={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(t instanceof xL){let{$anchorCell:e,$headCell:n}=t,r=e?e.pos:n.pos,a=n?n.pos:e.pos,o=this.view.nodeDOM(r),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():jG(o.getBoundingClientRect(),s.getBoundingClientRect());i={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return i}constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&kD(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{this.editor.isDestroyed?this.destroy():this.preventHide?this.preventHide=!1:e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;i||!t&&!n||(this.getShouldShow(r)?(this.show(),this.updatePosition()):this.hide())},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Ys(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{this.isVisible&&!this.editor.isDestroyed&&this.element.isConnected&&(r.hide?.referenceHidden||r.hide?.escaped?this.element.style.visibility=`hidden`:(this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()))})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||=(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},NG=e=>new Zb({key:typeof e.pluginKey==`string`?new ex(e.pluginKey):e.pluginKey,view:t=>new MG({view:t,...e})});bj.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[NG({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var PG=class{getTextContent(e){return rk(e,{textSerializers:ik(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Us(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Hs(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Bs(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Ks(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ws(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Vs(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(Gs(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(qs(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;i||!t&&!n||(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{this.preventHide?this.preventHide=!1:e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let{selection:t}=this.editor.state,n=kk(this.view,t.from,t.to);Ys({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{r.hide?.referenceHidden||r.hide?.escaped?this.element.style.visibility=`hidden`:(this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate())})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||=(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},FG=e=>new Zb({key:typeof e.pluginKey==`string`?new ex(e.pluginKey):e.pluginKey,view:t=>new PG({view:t,...e})});bj.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[FG({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function IG(e,t){return e??new ex(t)}var LG=typeof window<`u`?_.useLayoutEffect:_.useEffect,RG=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),zG=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),BG=new Set([`children`,`className`,`style`]),VG=new Set([`tabIndex`]),HG=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),UG={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function WG(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function GG(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function KG(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||HG.has(e)}function qG(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function JG(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:UG[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function YG(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function XG(e){return VG.has(e)}function ZG(e,t,n){t===`tabIndex`?e.tabIndex=Number(n):e[t]=n}function QG(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];e[t]=typeof n==`boolean`?!1:typeof n==`number`?0:``}function $G(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||zG.has(e)?String(t):`${t}px`}function eK(e,t){RG.has(t)||e.style.removeProperty(qG(t))}function tK(e,t,n){RG.has(t)||e.style.setProperty(qG(t),$G(t,n))}function nK(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(BG.has(r)||!KG(r)||WG(r,t[r])||WG(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=GG(r);a==null||a===!1?(XG(r)&&QG(e,r),e.removeAttribute(o)):a===!0?(XG(r)&&ZG(e,r,!0),e.setAttribute(o,``)):XG(r)?ZG(e,r,a):e.setAttribute(o,String(a))})}function rK(e,t,n){t!==n&&(n?e.className=n:e.removeAttribute(`class`))}function iK(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];n!==a&&(a==null?eK(e,t):tK(e,t,a))})}function aK(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!WG(t,n))return;let{eventName:i,options:a}=JG(t),o=t=>{n(YG(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function oK(e,t){let n=(0,_.useRef)({}),r=(0,_.useRef)([]);LG(()=>{let i=n.current;return rK(e,i.className,t.className),iK(e,i.style,t.style),nK(e,i,t),r.current=aK(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var sK=_.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,_.useRef)(document.createElement(`div`)),f=(0,_.useRef)(IG(e,`bubbleMenu`)).current;oK(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=vN(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,_.useRef)(h);g.current=h;let[v,y]=(0,_.useState)(!1),b=(0,_.useRef)(!0);return(0,_.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=NG({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return b.current=!0,y(!0),()=>{y(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,_.useEffect)(()=>{v&&m&&!m.isDestroyed&&(b.current?b.current=!1:m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current})))},[v,m,n,r,a,s,i,o,f]),(0,Bt.createPortal)(c,d.current)});_.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,_.useRef)(document.createElement(`div`)),d=(0,_.useRef)(IG(e,`floatingMenu`)).current;oK(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=vN(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,_.useRef)(m);h.current=m;let[g,v]=(0,_.useState)(!1),y=(0,_.useRef)(!0);return(0,_.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=FG({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,_.useEffect)(()=>{g&&p&&!p.isDestroyed&&(y.current?y.current=!1:p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current})))},[g,p,n,r,a,o,i,d]),(0,Bt.createPortal)(s,u.current)});var cK=[{id:`estrutura`,label:U(`Estrutura`)},{id:`passos`,label:U(`Passo a passo`)},{id:`alertas`,label:U(`Alertas`)},{id:`midia`,label:U(`Mídia`)}],lK=e=>e.chain().focus();function uK(e){return(e.view.dom.closest(`[lang]`)?.getAttribute(`lang`)??`pt-BR`).toLowerCase().startsWith(`pt`)?`Resultado: `:`Result: `}function dK(e){let t=uK(e),{$from:n}=e.state.selection,r=n.parent.content.size===0,i=r?n.before():n.after(),a={type:`blockquote`,content:[{type:`paragraph`,content:[{type:`text`,marks:[{type:`bold`}],text:t.trim()},{type:`text`,text:` `}]}]};lK(e).insertContentAt(r?{from:i,to:n.after()}:i,a).setTextSelection(i+2+t.length).run()}var fK={tip:()=>U(`Alerta: Dica`),warning:()=>U(`Alerta: Atenção`),caution:()=>U(`Alerta: Erro`),note:()=>U(`Alerta: Nota`)},pK={tip:()=>U(`Um atalho ou um jeito melhor de fazer`),warning:()=>U(`Algo que exige cuidado`),caution:()=>U(`Um risco que não dá para desfazer`),note:()=>U(`Uma informação a mais`)},mK={tip:[`dica`,`tip`,`hint`],warning:[`atencao`,`cuidado`,`warning`],caution:[`erro`,`perigo`,`risco`,`caution`,`error`],note:[`nota`,`info`,`informacao`,`note`]},hK=[{id:`paragraph`,group:`estrutura`,label:U(`Texto`),hint:U(`Parágrafo comum`),icon:zm,keywords:[`paragrafo`,`texto`,`comum`,`paragraph`,`text`,`plain`],isTextType:!0,isActive:e=>e.isActive(`paragraph`),run:({editor:e})=>(e.isActive(`callout`)?lK(e).unsetCallout():lK(e).setParagraph()).run()},...[1,2,3].map(e=>({id:`h${e}`,group:`estrutura`,label:U(`Título {n}`,{n:e}),hint:U(e===1?`Seção principal`:e===2?`Subseção`:`Tópico dentro da subseção`),icon:[Vp,Gp,Up][e-1]??Vp,keywords:[`titulo`,`cabecalho`,`secao`,`subsecao`,`topico`,`heading`,`section`,`title`,`h${e}`],isTextType:!0,isActive:t=>t.isActive(`heading`,{level:e}),run:({editor:t})=>lK(t).setHeading({level:e}).run()})),{id:`steps`,group:`passos`,label:U(`Passos numerados`),hint:U(`Um passo por linha, na ordem de uso`),icon:hm,keywords:[`lista`,`numerada`,`passo`,`etapas`,`steps`,`numbered`,`list`],isTextType:!0,isActive:e=>e.isActive(`orderedList`),run:({editor:e})=>lK(e).toggleOrderedList().run()},{id:`result`,group:`passos`,label:U(`Resultado esperado`),hint:U(`O que a pessoa vê depois do passo`),icon:hp,keywords:[`resultado`,`esperado`,`confirmacao`,`passo`,`result`,`expected`],isTextType:!1,run:({editor:e})=>dK(e)},{id:`bullets`,group:`estrutura`,label:U(`Lista`),hint:U(`Itens sem ordem`),icon:ym,keywords:[`lista`,`marcadores`,`itens`,`bullet`,`list`,`unordered`],isTextType:!0,isActive:e=>e.isActive(`bulletList`),run:({editor:e})=>lK(e).toggleBulletList().run()},{id:`quote`,group:`estrutura`,label:U(`Citação`),hint:U(`Trecho em destaque ou observação`),icon:Um,keywords:[`citacao`,`observacao`,`nota`,`quote`,`note`],isTextType:!0,isActive:e=>e.isActive(`blockquote`),run:({editor:e})=>lK(e).toggleBlockquote().run()},...TF.map(e=>({id:`callout-${e}`,group:`alertas`,label:fK[e](),hint:pK[e](),icon:NF[e],keywords:[`alerta`,`aviso`,`destaque`,`alert`,`callout`,`warning`,...mK[e]],isTextType:!0,isActive:t=>t.isActive(`callout`,{type:e}),run:({editor:t})=>lK(t).setCallout(e).run()})),{id:`code`,group:`estrutura`,label:U(`Bloco de código`),hint:U(`Comandos e trechos de código`),icon:yp,keywords:[`codigo`,`comando`,`terminal`,`trecho`,`code`,`command`,`snippet`],isTextType:!0,isActive:e=>e.isActive(`codeBlock`),run:({editor:e})=>lK(e).toggleCodeBlock().run()},{id:`image`,group:`midia`,label:U(`Imagem`),hint:U(`Print da tela do sistema`),icon:Zp,keywords:[`imagem`,`print`,`foto`,`captura`,`tela`,`image`,`screenshot`],isTextType:!1,run:({pickImage:e})=>e()},{id:`table`,group:`midia`,label:U(`Tabela`),hint:U(`3 × 3 com cabeçalho`),icon:rh,keywords:[`tabela`,`colunas`,`campos`,`table`,`columns`,`grid`],isTextType:!1,run:({editor:e})=>lK(e).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}],gK=e=>cK.findIndex(t=>t.id===e.group);function _K(e){let t=gg(e);return(t?hK.filter(e=>[e.label,e.hint,...e.keywords].some(e=>gg(e).includes(t))):hK).toSorted((e,t)=>gK(e)-gK(t))}function vK(e){return cK.map(t=>({...t,items:e.filter(e=>e.group===t.id)})).filter(e=>e.items.length>0)}var yK=hK.filter(e=>e.isTextType);function bK({editor:e,pickImage:t,className:n}){let r=fN({editor:e,selector:({editor:e})=>[...yK].reverse().find(t=>t.isActive?.(e))?.id??`paragraph`}),i=yK.find(e=>e.id===r)??yK[0];return i?(0,R.jsxs)(Bg,{children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"data-roving":!0,tabIndex:0,"aria-label":U(`Tipo de bloco: {tipo}`,{tipo:i.label}),onMouseDown:e=>e.preventDefault(),className:L(`inline-flex h-8 w-52 items-center gap-2 rounded-md px-2.5 text-sm [@media(pointer:coarse)]:h-11 hover:bg-secondary data-[state=open]:bg-secondary`,n),children:[(0,R.jsx)(i.icon,{className:`size-4 text-primary`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`flex-1 truncate text-left font-display font-bold`,children:i.label}),(0,R.jsx)(sp,{className:`size-4 text-muted-foreground`,"aria-hidden":!0})]})}),(0,R.jsx)(Hg,{align:`start`,className:`w-56`,onCloseAutoFocus:e=>e.preventDefault(),children:yK.map(n=>(0,R.jsxs)(Ug,{onSelect:()=>n.run({editor:e,pickImage:t}),children:[(0,R.jsx)(n.icon,{className:`text-primary`}),` `,n.label]},n.id))})]}):null}function xK({editor:e,roving:t}){let n=fN({editor:e,selector:({editor:e})=>e.getAttributes(`textColor`).color??null}),r=t=>(t?e.chain().focus().setTextColor(t):e.chain().focus().unsetTextColor()).run(),i=e=>({color:e?`var(--cor-${e})`:void 0});return(0,R.jsxs)(Bg,{children:[(0,R.jsxs)(Xh,{children:[(0,R.jsx)(Zh,{asChild:!0,children:(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"data-roving":t?``:void 0,tabIndex:t?-1:void 0,"aria-label":U(`Cor do texto`),onMouseDown:e=>e.preventDefault(),className:`inline-flex h-8 flex-col items-center justify-center rounded-md px-2 [@media(pointer:coarse)]:h-11 [@media(pointer:coarse)]:min-w-11 font-display text-sm font-bold text-muted-foreground hover:bg-secondary hover:text-foreground data-[state=open]:bg-secondary`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,children:`A`}),(0,R.jsx)(`span`,{"aria-hidden":!0,className:`-mt-0.5 h-[3px] w-4 rounded-full bg-foreground`,style:n?{background:`var(--cor-${n})`}:void 0})]})})}),(0,R.jsx)(Qh,{children:U(`Cor do texto`)})]}),(0,R.jsx)(Hg,{align:`start`,className:`w-44`,onCloseAutoFocus:e=>e.preventDefault(),children:[null,...sG].map(e=>(0,R.jsxs)(Ug,{"aria-current":n===e,onSelect:()=>r(e),children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`w-4 text-center font-display font-bold`,style:i(e),children:`A`}),U(e?cG[e]:`Cor padrão`),n===e&&(0,R.jsx)(ap,{className:`ml-auto`,"aria-hidden":!0})]},e??`default`))})]})}function SK({label:e,shortcut:t,icon:n,onClick:r,active:i,showLabel:a,hint:o}){let s=(0,R.jsxs)(`button`,{type:`button`,"data-roving":!0,tabIndex:-1,"aria-pressed":i,"aria-label":e,onMouseDown:e=>e.preventDefault(),onClick:r,className:L(`inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-muted-foreground [@media(pointer:coarse)]:h-11 [@media(pointer:coarse)]:min-w-11 [@media(pointer:coarse)]:justify-center transition-colors hover:bg-secondary hover:text-foreground`,i&&`bg-accent text-primary`,a&&`shrink-0 border border-border px-2.5 text-sm font-bold whitespace-nowrap text-foreground`),children:[(0,R.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),a&&(0,R.jsx)(`span`,{children:e})]});return(0,R.jsxs)(Xh,{children:[(0,R.jsx)(Zh,{asChild:!0,children:s}),(0,R.jsxs)(Qh,{children:[o??e,t&&(0,R.jsx)(`kbd`,{className:`ml-2 font-mono text-[11px] opacity-70`,children:t})]})]})}var CK=`selectionMenu`,wK=()=>({boundary:[],padding:{top:document.querySelector(`[data-editor-toolbar]`)?.getBoundingClientRect().bottom??0}}),TK=()=>(0,R.jsx)(`span`,{className:`mx-1 h-5 w-px bg-border`,"aria-hidden":!0});function EK({editor:e,pickImage:t,onEditLink:n}){let r=fN({editor:e,selector:({editor:e})=>({bold:e.isActive(`bold`),italic:e.isActive(`italic`),code:e.isActive(`code`),link:e.isActive(`link`)})}),i=()=>e.chain().focus();return(0,R.jsx)(sK,{editor:e,pluginKey:CK,options:{placement:`top-start`,offset:8,flip:wK},shouldShow:({view:t,state:n,from:r,to:i})=>t.hasFocus()&&n.selection instanceof Y&&n.doc.textBetween(r,i).trim().length>0&&!e.isActive(`codeBlock`),className:`z-20 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md`,children:(0,R.jsxs)(`div`,{role:`toolbar`,"aria-label":U(`Formatar seleção`),className:`flex items-center gap-0.5`,children:[(0,R.jsx)(bK,{editor:e,pickImage:t,className:`w-auto`}),(0,R.jsx)(TK,{}),(0,R.jsx)(SK,{icon:tp,label:U(`Negrito`),shortcut:`Ctrl+B`,active:r.bold,onClick:()=>i().toggleBold().run()}),(0,R.jsx)(SK,{icon:tm,label:U(`Itálico`),shortcut:`Ctrl+I`,active:r.italic,onClick:()=>i().toggleItalic().run()}),(0,R.jsx)(SK,{icon:xp,label:U(`Código no texto`),shortcut:`Ctrl+E`,active:r.code,onClick:()=>i().toggleCode().run()}),(0,R.jsx)(SK,{icon:lm,label:U(`Link`),shortcut:`Ctrl+K`,active:r.link,onClick:n}),(0,R.jsx)(TK,{}),(0,R.jsx)(xK,{editor:e})]})})}function DK(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=BA(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function OK(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
|
|
258
|
+
`)}`}),c}}),fG=$I.extend({parseMarkdown(e,t){let n=this.parent?.(e,t);return(Array.isArray(n)?n:n?[n]:[]).map(e=>`type`in e&&e.type===`image`?{type:`paragraph`,content:[e]}:e)}}),pG=HF.extend({excludes:``});function mG(e=fF,t=MF){return[oG.configure({code:!1,link:{openOnClick:!1,autolink:!0},listItem:!1,paragraph:!1}),pG,fG,dG,e.configure({inline:!0,HTMLAttributes:{loading:`lazy`,decoding:`async`}}),yz.configure({table:{resizable:!1}}),t,uG,Qz.configure({placeholder:U(`Escreva aqui, ou digite / para inserir um bloco. Cole um print com Ctrl+V.`)}),$V.configure({markedOptions:{gfm:!0}})]}var hG=[{id:`s`,label:()=>U(`Pequena`)},{id:`m`,label:()=>U(`Média`)},{id:`full`,label:()=>U(`Larga`)}];function gG({slug:e,src:t}){let n=$N(t),r=YN(e,n),[i,a]=(0,_.useState)(!1);if(!n)return null;let o=t=>{a(!1),JN(e,n,{...r??QN(),display:t}).catch(()=>a(!0))};return(0,R.jsxs)(`fieldset`,{className:`grid gap-1.5`,children:[(0,R.jsx)(`legend`,{className:`mb-1 text-sm font-bold`,children:U(`Tamanho da imagem`)}),(0,R.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:hG.map(e=>(0,R.jsx)(`button`,{type:`button`,"aria-pressed":r?.display===e.id,disabled:!r,onClick:()=>o(e.id),className:`min-h-11 min-w-11 rounded-md border border-border px-3 py-1 text-sm hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-pressed:border-primary aria-pressed:bg-accent aria-pressed:font-bold disabled:opacity-50`,children:e.label()},e.id))}),r&&ZN(r)&&(0,R.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:U(`Com {n} marcadores, a imagem pequena pode amontoá-los. Experimente Média.`,{n:r.markers.length})}),i&&(0,R.jsx)(`p`,{role:`alert`,className:`text-xs text-destructive`,children:U(`Não foi possível salvar o tamanho.`)})]})}function _G({...e}){return(0,R.jsx)(td,{"data-slot":`popover`,...e})}function vG({...e}){return(0,R.jsx)(ad,{"data-slot":`popover-trigger`,...e})}function yG({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,R.jsx)(ld,{children:(0,R.jsx)(dd,{"data-slot":`popover-content`,align:t,sideOffset:n,className:L(`z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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`,e),...r})})}function bG({...e}){return(0,R.jsx)(rd,{"data-slot":`popover-anchor`,...e})}function xG({open:e,onClose:t,getRect:n,label:r,onEscape:i,children:a}){return(0,R.jsxs)(_G,{open:e,onOpenChange:e=>!e&&t(),children:[(0,R.jsx)(bG,{virtualRef:{current:{getBoundingClientRect:n}}}),(0,R.jsx)(yG,{align:`start`,side:`bottom`,sideOffset:8,collisionPadding:PF(),"aria-label":r,className:`max-h-(--radix-popover-content-available-height) w-80 overflow-y-auto p-3 shadow-[0_8px_24px_-12px_rgb(21_26_51/0.35)]`,onEscapeKeyDown:i,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget?.querySelector(`input`)?.focus()},children:a})]})}function SG(e){let t=e.state.selection;return!(t instanceof X)||t.node.type.name!==`image`?null:{pos:t.from,alt:t.node.attrs.alt??``,src:t.node.attrs.src}}var CG=330;function wG({editor:e,slug:t,onAnnotate:n}){let r=fN({editor:e,selector:({editor:e})=>SG(e)}),[i,a]=(0,_.useState)(null),o=r!==null&&i!==r.pos;return r===null&&i!==null&&a(null),(0,R.jsx)(xG,{open:o,onClose:()=>a(r?.pos??null),getRect:()=>{let t=r?e.view.nodeDOM(r.pos):null;if(!(t instanceof HTMLElement))return new DOMRect;let n=t.getBoundingClientRect(),i=Math.max(n.top+1,Math.min(n.bottom,window.innerHeight-CG));return new DOMRect(n.x,n.y,n.width,i-n.y)},label:U(`Descrição da imagem`),onEscape:()=>e.commands.focus(),children:r&&(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsx)(`label`,{htmlFor:`image-alt`,className:`text-sm font-bold`,children:U(`Descrição da imagem`)}),(0,R.jsx)(ag,{id:`image-alt`,defaultValue:r.alt,placeholder:U(`Ex.: Tela de clientes com o botão Novo cliente`),onChange:t=>e.chain().updateAttributes(`image`,{alt:t.target.value}).setNodeSelection(r.pos).run(),onKeyDown:t=>{t.key===`Enter`&&(t.preventDefault(),a(r.pos),e.commands.focus())}},r.pos),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:U(`Quem usa leitor de tela e a IA que lê o manual entendem a imagem por aqui.`)}),$N(r.src)&&(0,R.jsx)(gG,{slug:t,src:r.src}),$N(r.src)&&(0,R.jsxs)($d,{type:`button`,size:`sm`,className:`mt-1 justify-self-start`,onClick:()=>{a(r.pos),n(r.src,r.alt)},children:[(0,R.jsx)(Lm,{}),` `,U(`Editar imagem`)]})]})})}var TG=[`image/png`,`image/jpeg`,`image/gif`,`image/webp`];async function EG(e,t,n,r,i){let a=r,o=({transaction:e})=>{a=e.mapping.map(a)};e.on(`transaction`,o);try{await s()}finally{e.off(`transaction`,o)}async function s(){for(let r of n)try{let{path:n}=await vf.uploadAsset(t,r),i=r.name.replace(/\.[^.]+$/,``);e.chain().focus().insertContentAt(Math.min(a,e.state.doc.content.size),{type:`image`,attrs:{src:SF(t,n),alt:i}}).run()}catch(e){i(W(e,U(`Não foi possível enviar a imagem.`)))}}}function DG(e){let t=e.trim();if(!t)return{ok:!0,href:``};if(/\s/.test(t))return{ok:!1,error:U(`Endereço não pode ter espaços. Para ligar a outra página, escolha na lista.`)};if(/^(#|\/|\.\/)/.test(t)||/^mailto:[^@]+@[^@]+$/i.test(t))return{ok:!0,href:t};let n=/^[a-z][a-z0-9+.-]*:/i.test(t)?t:`https://${t}`;try{let e=new URL(n);return[`http:`,`https:`].includes(e.protocol)?!e.hostname.includes(`.`)&&e.hostname!==`localhost`?{ok:!1,error:U(`Falta o domínio, por exemplo: exemplo.com.br`)}:{ok:!0,href:n}:{ok:!1,error:U(`Use um endereço http, https ou mailto.`)}}catch{return{ok:!1,error:U(`Endereço inválido. Exemplo: https://exemplo.com.br`)}}}function OG(e){return`./${e.split(`/`).pop()??e}`}function kG(e){let{from:t,to:n}=e.state.selection,r=e.view.coordsAtPos(t),i=e.view.coordsAtPos(n);return new DOMRect(r.left,r.top,Math.max(i.right-r.left,1),i.bottom-r.top)}function AG({editor:e,open:t,onClose:n,pages:r}){let i=e.getAttributes(`link`).href??``,[a,o]=(0,_.useState)(i),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1);t!==l&&(u(t),t&&(o(i),c(null)));let d=gg(a.trim()),f=d&&!/[/:.#]/.test(d)?Dg(r).filter(e=>gg(e.title).includes(d)).slice(0,5):[],p=t=>{let r=e.chain().focus().extendMarkRange(`link`);t?r.setLink({href:t}).run():r.unsetLink().run(),n()},m=()=>{let e=DG(a);e.ok?p(e.href):c(e.error)};return(0,R.jsx)(xG,{open:t,onClose:()=>{n(),e.commands.focus()},getRect:()=>kG(e),label:U(`Editar link`),children:(0,R.jsxs)(`form`,{className:`grid gap-2`,onSubmit:e=>{e.preventDefault();let t=f[0];t&&!s&&f.length===1?p(OG(t.file)):m()},children:[(0,R.jsx)(`label`,{htmlFor:`link-href`,className:`text-sm font-bold`,children:U(`Link para uma página ou endereço`)}),(0,R.jsx)(ag,{id:`link-href`,value:a,"aria-invalid":s!==null,"aria-describedby":s?`link-error`:void 0,onChange:e=>{o(e.target.value),c(null)},placeholder:U(`Nome da página ou https://…`)}),s&&(0,R.jsx)(`p`,{id:`link-error`,role:`alert`,className:`text-xs text-destructive`,children:s}),f.length>0&&(0,R.jsx)(`ul`,{"aria-label":U(`Páginas do manual`),className:`grid gap-0.5`,children:f.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{type:`button`,onClick:()=>p(OG(e.file)),className:`flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent`,children:[(0,R.jsx)(Np,{className:`size-4 shrink-0 text-primary`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`truncate`,children:e.title||U(`Sem título`)})]})},e.id))}),(0,R.jsxs)(`div`,{className:`flex justify-between gap-2 pt-1`,children:[i?(0,R.jsx)($d,{type:`button`,variant:`ghost`,size:`sm`,className:`text-destructive`,onClick:()=>p(``),children:U(`Remover link`)}):(0,R.jsx)(`span`,{}),(0,R.jsx)($d,{type:`submit`,size:`sm`,children:U(`Aplicar`)})]})]})})}function jG(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var MG=class{get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Us(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Hs(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Bs(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Ks(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ws(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Vs(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(Gs(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(qs(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){var e;let{selection:t}=this.editor.state,n=this.getReferencedVirtualElement?.call(this);if(n)return n;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let r=kk(this.view,t.from,t.to),i={getBoundingClientRect:()=>r,getClientRects:()=>[r]};if(t instanceof X){let e=this.view.nodeDOM(t.from),n=e.dataset.nodeViewWrapper?e:e.querySelector(`[data-node-view-wrapper]`);n&&(e=n),e&&(i={getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>[e.getBoundingClientRect()]})}if(t instanceof xL){let{$anchorCell:e,$headCell:n}=t,r=e?e.pos:n.pos,a=n?n.pos:e.pos,o=this.view.nodeDOM(r),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():jG(o.getBoundingClientRect(),s.getBoundingClientRect());i={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return i}constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&kD(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{this.editor.isDestroyed?this.destroy():this.preventHide?this.preventHide=!1:e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);(n||r)&&(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;i||!t&&!n||(this.getShouldShow(r)?(this.show(),this.updatePosition()):this.hide())},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Ys(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{this.isVisible&&!this.editor.isDestroyed&&this.element.isConnected&&(r.hide?.referenceHidden||r.hide?.escaped?this.element.style.visibility=`hidden`:(this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()))})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||=(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},NG=e=>new Zb({key:typeof e.pluginKey==`string`?new ex(e.pluginKey):e.pluginKey,view:t=>new MG({view:t,...e})});bj.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[NG({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var PG=class{getTextContent(e){return rk(e,{textSerializers:ik(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(Us(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Hs(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Bs(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Ks(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ws(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Vs(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(Gs(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(qs(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;i||!t&&!n||(this.getShouldShow(r)?(this.updatePosition(),this.show()):this.hide())},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{this.preventHide?this.preventHide=!1:e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){var e;if(!((e=this.view)!=null&&(e=e.dom)!=null&&e.parentNode))return;let{selection:t}=this.editor.state,n=kk(this.view,t.from,t.to);Ys({getBoundingClientRect:()=>n,getClientRects:()=>[n]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{r.hide?.referenceHidden||r.hide?.escaped?this.element.style.visibility=`hidden`:(this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate())})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||=(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},FG=e=>new Zb({key:typeof e.pluginKey==`string`?new ex(e.pluginKey):e.pluginKey,view:t=>new PG({view:t,...e})});bj.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[FG({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function IG(e,t){return e??new ex(t)}var LG=typeof window<`u`?_.useLayoutEffect:_.useEffect,RG=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),zG=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),BG=new Set([`children`,`className`,`style`]),VG=new Set([`tabIndex`]),HG=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),UG={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function WG(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function GG(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function KG(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||HG.has(e)}function qG(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function JG(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:UG[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function YG(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function XG(e){return VG.has(e)}function ZG(e,t,n){t===`tabIndex`?e.tabIndex=Number(n):e[t]=n}function QG(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];e[t]=typeof n==`boolean`?!1:typeof n==`number`?0:``}function $G(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||zG.has(e)?String(t):`${t}px`}function eK(e,t){RG.has(t)||e.style.removeProperty(qG(t))}function tK(e,t,n){RG.has(t)||e.style.setProperty(qG(t),$G(t,n))}function nK(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(BG.has(r)||!KG(r)||WG(r,t[r])||WG(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=GG(r);a==null||a===!1?(XG(r)&&QG(e,r),e.removeAttribute(o)):a===!0?(XG(r)&&ZG(e,r,!0),e.setAttribute(o,``)):XG(r)?ZG(e,r,a):e.setAttribute(o,String(a))})}function rK(e,t,n){t!==n&&(n?e.className=n:e.removeAttribute(`class`))}function iK(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];n!==a&&(a==null?eK(e,t):tK(e,t,a))})}function aK(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!WG(t,n))return;let{eventName:i,options:a}=JG(t),o=t=>{n(YG(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function oK(e,t){let n=(0,_.useRef)({}),r=(0,_.useRef)([]);LG(()=>{let i=n.current;return rK(e,i.className,t.className),iK(e,i.style,t.style),nK(e,i,t),r.current=aK(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var sK=_.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,_.useRef)(document.createElement(`div`)),f=(0,_.useRef)(IG(e,`bubbleMenu`)).current;oK(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=vN(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,_.useRef)(h);g.current=h;let[v,y]=(0,_.useState)(!1),b=(0,_.useRef)(!0);return(0,_.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=NG({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return b.current=!0,y(!0),()=>{y(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,_.useEffect)(()=>{v&&m&&!m.isDestroyed&&(b.current?b.current=!1:m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current})))},[v,m,n,r,a,s,i,o,f]),(0,Bt.createPortal)(c,d.current)});_.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,_.useRef)(document.createElement(`div`)),d=(0,_.useRef)(IG(e,`floatingMenu`)).current;oK(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=vN(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,_.useRef)(m);h.current=m;let[g,v]=(0,_.useState)(!1),y=(0,_.useRef)(!0);return(0,_.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=FG({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,_.useEffect)(()=>{g&&p&&!p.isDestroyed&&(y.current?y.current=!1:p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current})))},[g,p,n,r,a,o,i,d]),(0,Bt.createPortal)(s,u.current)});var cK=[{id:`estrutura`,label:U(`Estrutura`)},{id:`passos`,label:U(`Passo a passo`)},{id:`alertas`,label:U(`Alertas`)},{id:`midia`,label:U(`Mídia`)}],lK=e=>e.chain().focus();function uK(e){return(e.view.dom.closest(`[lang]`)?.getAttribute(`lang`)??`pt-BR`).toLowerCase().startsWith(`pt`)?`Resultado: `:`Result: `}function dK(e){let t=uK(e),{$from:n}=e.state.selection,r=n.parent.content.size===0,i=r?n.before():n.after(),a={type:`blockquote`,content:[{type:`paragraph`,content:[{type:`text`,marks:[{type:`bold`}],text:t.trim()},{type:`text`,text:` `}]}]};lK(e).insertContentAt(r?{from:i,to:n.after()}:i,a).setTextSelection(i+2+t.length).run()}var fK={tip:()=>U(`Alerta: Dica`),warning:()=>U(`Alerta: Atenção`),caution:()=>U(`Alerta: Erro`),note:()=>U(`Alerta: Nota`)},pK={tip:()=>U(`Um atalho ou um jeito melhor de fazer`),warning:()=>U(`Algo que exige cuidado`),caution:()=>U(`Um risco que não dá para desfazer`),note:()=>U(`Uma informação a mais`)},mK={tip:[`dica`,`tip`,`hint`],warning:[`atencao`,`cuidado`,`warning`],caution:[`erro`,`perigo`,`risco`,`caution`,`error`],note:[`nota`,`info`,`informacao`,`note`]},hK=[{id:`paragraph`,group:`estrutura`,label:U(`Texto`),hint:U(`Parágrafo comum`),icon:zm,keywords:[`paragrafo`,`texto`,`comum`,`paragraph`,`text`,`plain`],isTextType:!0,isActive:e=>e.isActive(`paragraph`),run:({editor:e})=>(e.isActive(`callout`)?lK(e).unsetCallout():lK(e).setParagraph()).run()},...[1,2,3].map(e=>({id:`h${e}`,group:`estrutura`,label:U(`Título {n}`,{n:e}),hint:U(e===1?`Seção principal`:e===2?`Subseção`:`Tópico dentro da subseção`),icon:[Vp,Gp,Up][e-1]??Vp,keywords:[`titulo`,`cabecalho`,`secao`,`subsecao`,`topico`,`heading`,`section`,`title`,`h${e}`],isTextType:!0,isActive:t=>t.isActive(`heading`,{level:e}),run:({editor:t})=>lK(t).setHeading({level:e}).run()})),{id:`steps`,group:`passos`,label:U(`Passos numerados`),hint:U(`Um passo por linha, na ordem de uso`),icon:hm,keywords:[`lista`,`numerada`,`passo`,`etapas`,`steps`,`numbered`,`list`],isTextType:!0,isActive:e=>e.isActive(`orderedList`),run:({editor:e})=>lK(e).toggleOrderedList().run()},{id:`result`,group:`passos`,label:U(`Resultado esperado`),hint:U(`O que a pessoa vê depois do passo`),icon:hp,keywords:[`resultado`,`esperado`,`confirmacao`,`passo`,`result`,`expected`],isTextType:!1,run:({editor:e})=>dK(e)},{id:`bullets`,group:`estrutura`,label:U(`Lista`),hint:U(`Itens sem ordem`),icon:ym,keywords:[`lista`,`marcadores`,`itens`,`bullet`,`list`,`unordered`],isTextType:!0,isActive:e=>e.isActive(`bulletList`),run:({editor:e})=>lK(e).toggleBulletList().run()},{id:`quote`,group:`estrutura`,label:U(`Citação`),hint:U(`Trecho em destaque ou observação`),icon:Um,keywords:[`citacao`,`observacao`,`nota`,`quote`,`note`],isTextType:!0,isActive:e=>e.isActive(`blockquote`),run:({editor:e})=>lK(e).toggleBlockquote().run()},...TF.map(e=>({id:`callout-${e}`,group:`alertas`,label:fK[e](),hint:pK[e](),icon:NF[e],keywords:[`alerta`,`aviso`,`destaque`,`alert`,`callout`,`warning`,...mK[e]],isTextType:!0,isActive:t=>t.isActive(`callout`,{type:e}),run:({editor:t})=>lK(t).setCallout(e).run()})),{id:`code`,group:`estrutura`,label:U(`Bloco de código`),hint:U(`Comandos e trechos de código`),icon:yp,keywords:[`codigo`,`comando`,`terminal`,`trecho`,`code`,`command`,`snippet`],isTextType:!0,isActive:e=>e.isActive(`codeBlock`),run:({editor:e})=>lK(e).toggleCodeBlock().run()},{id:`image`,group:`midia`,label:U(`Imagem`),hint:U(`Print da tela do sistema`),icon:Zp,keywords:[`imagem`,`print`,`foto`,`captura`,`tela`,`image`,`screenshot`],isTextType:!1,run:({pickImage:e})=>e()},{id:`table`,group:`midia`,label:U(`Tabela`),hint:U(`3 × 3 com cabeçalho`),icon:rh,keywords:[`tabela`,`colunas`,`campos`,`table`,`columns`,`grid`],isTextType:!1,run:({editor:e})=>lK(e).insertTable({rows:3,cols:3,withHeaderRow:!0}).run()}],gK=e=>cK.findIndex(t=>t.id===e.group);function _K(e){let t=gg(e);return(t?hK.filter(e=>[e.label,e.hint,...e.keywords].some(e=>gg(e).includes(t))):hK).toSorted((e,t)=>gK(e)-gK(t))}function vK(e){return cK.map(t=>({...t,items:e.filter(e=>e.group===t.id)})).filter(e=>e.items.length>0)}var yK=hK.filter(e=>e.isTextType);function bK({editor:e,pickImage:t,className:n}){let r=fN({editor:e,selector:({editor:e})=>[...yK].reverse().find(t=>t.isActive?.(e))?.id??`paragraph`}),i=yK.find(e=>e.id===r)??yK[0];return i?(0,R.jsxs)(Bg,{children:[(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"data-roving":!0,tabIndex:0,"aria-label":U(`Tipo de bloco: {tipo}`,{tipo:i.label}),onMouseDown:e=>e.preventDefault(),className:L(`inline-flex h-8 w-52 items-center gap-2 rounded-md px-2.5 text-sm [@media(pointer:coarse)]:h-11 hover:bg-secondary data-[state=open]:bg-secondary`,n),children:[(0,R.jsx)(i.icon,{className:`size-4 text-primary`,"aria-hidden":!0}),(0,R.jsx)(`span`,{className:`flex-1 truncate text-left font-display font-bold`,children:i.label}),(0,R.jsx)(sp,{className:`size-4 text-muted-foreground`,"aria-hidden":!0})]})}),(0,R.jsx)(Hg,{align:`start`,className:`w-56`,onCloseAutoFocus:e=>e.preventDefault(),children:yK.map(n=>(0,R.jsxs)(Ug,{onSelect:()=>n.run({editor:e,pickImage:t}),children:[(0,R.jsx)(n.icon,{className:`text-primary`}),` `,n.label]},n.id))})]}):null}function xK({editor:e,roving:t}){let n=fN({editor:e,selector:({editor:e})=>e.getAttributes(`textColor`).color??null}),r=t=>(t?e.chain().focus().setTextColor(t):e.chain().focus().unsetTextColor()).run(),i=e=>({color:e?`var(--cor-${e})`:void 0});return(0,R.jsxs)(Bg,{children:[(0,R.jsxs)(Xh,{children:[(0,R.jsx)(Zh,{asChild:!0,children:(0,R.jsx)(Vg,{asChild:!0,children:(0,R.jsxs)(`button`,{type:`button`,"data-roving":t?``:void 0,tabIndex:t?-1:void 0,"aria-label":U(`Cor do texto`),onMouseDown:e=>e.preventDefault(),className:`inline-flex h-8 flex-col items-center justify-center rounded-md px-2 [@media(pointer:coarse)]:h-11 [@media(pointer:coarse)]:min-w-11 font-display text-sm font-bold text-muted-foreground hover:bg-secondary hover:text-foreground data-[state=open]:bg-secondary`,children:[(0,R.jsx)(`span`,{"aria-hidden":!0,children:`A`}),(0,R.jsx)(`span`,{"aria-hidden":!0,className:`-mt-0.5 h-[3px] w-4 rounded-full bg-foreground`,style:n?{background:`var(--cor-${n})`}:void 0})]})})}),(0,R.jsx)(Qh,{children:U(`Cor do texto`)})]}),(0,R.jsx)(Hg,{align:`start`,className:`w-44`,onCloseAutoFocus:e=>e.preventDefault(),children:[null,...sG].map(e=>(0,R.jsxs)(Ug,{"aria-current":n===e,onSelect:()=>r(e),children:[(0,R.jsx)(`span`,{"aria-hidden":!0,className:`w-4 text-center font-display font-bold`,style:i(e),children:`A`}),U(e?cG[e]:`Cor padrão`),n===e&&(0,R.jsx)(ap,{className:`ml-auto`,"aria-hidden":!0})]},e??`default`))})]})}function SK({label:e,shortcut:t,icon:n,onClick:r,active:i,showLabel:a,hint:o}){let s=(0,R.jsxs)(`button`,{type:`button`,"data-roving":!0,tabIndex:-1,"aria-pressed":i,"aria-label":e,onMouseDown:e=>e.preventDefault(),onClick:r,className:L(`inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-muted-foreground [@media(pointer:coarse)]:h-11 [@media(pointer:coarse)]:min-w-11 [@media(pointer:coarse)]:justify-center transition-colors hover:bg-secondary hover:text-foreground`,i&&`bg-accent text-primary`,a&&`shrink-0 border border-border px-2.5 text-sm font-bold whitespace-nowrap text-foreground`),children:[(0,R.jsx)(n,{className:`size-4 shrink-0`,"aria-hidden":!0}),a&&(0,R.jsx)(`span`,{children:e})]});return(0,R.jsxs)(Xh,{children:[(0,R.jsx)(Zh,{asChild:!0,children:s}),(0,R.jsxs)(Qh,{children:[o??e,t&&(0,R.jsx)(`kbd`,{className:`ml-2 font-mono text-[11px] opacity-70`,children:t})]})]})}var CK=`selectionMenu`,wK=()=>({boundary:[],padding:{top:document.querySelector(`[data-editor-toolbar]`)?.getBoundingClientRect().bottom??0}}),TK=()=>(0,R.jsx)(`span`,{className:`mx-1 h-5 w-px bg-border`,"aria-hidden":!0});function EK({editor:e,pickImage:t,onEditLink:n}){let r=fN({editor:e,selector:({editor:e})=>({bold:e.isActive(`bold`),italic:e.isActive(`italic`),code:e.isActive(`code`),link:e.isActive(`link`)})}),i=()=>e.chain().focus();return(0,R.jsx)(sK,{editor:e,pluginKey:CK,options:{placement:`top-start`,offset:8,flip:wK},shouldShow:({view:t,state:n,from:r,to:i})=>t.hasFocus()&&n.selection instanceof Y&&n.doc.textBetween(r,i).trim().length>0&&!e.isActive(`codeBlock`),className:`z-20 rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md`,children:(0,R.jsxs)(`div`,{role:`toolbar`,"aria-label":U(`Formatar seleção`),className:`flex items-center gap-0.5`,children:[(0,R.jsx)(bK,{editor:e,pickImage:t,className:`w-auto`}),(0,R.jsx)(TK,{}),(0,R.jsx)(SK,{icon:tp,label:U(`Negrito`),shortcut:`Ctrl+B`,active:r.bold,onClick:()=>i().toggleBold().run()}),(0,R.jsx)(SK,{icon:tm,label:U(`Itálico`),shortcut:`Ctrl+I`,active:r.italic,onClick:()=>i().toggleItalic().run()}),(0,R.jsx)(SK,{icon:xp,label:U(`Código no texto`),shortcut:`Ctrl+E`,active:r.code,onClick:()=>i().toggleCode().run()}),(0,R.jsx)(SK,{icon:lm,label:U(`Link`),shortcut:`Ctrl+K`,active:r.link,onClick:n}),(0,R.jsx)(TK,{}),(0,R.jsx)(xK,{editor:e})]})})}function DK(e){let{char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:o}=e,s=n&&!r,c=BA(t),l=RegExp(`\\s${c}$`),u=a?`^`:``,d=r?``:c,f=RegExp(s?`${u}${c}.*?(?=\\s${d}|$)`:`${u}(?:^)?${c}[^\\s${d}]*`,`gm`),p=o.nodeBefore?.isText&&o.nodeBefore.text;if(!p)return null;let m=o.pos-p.length,h=Array.from(p.matchAll(f)).pop();if(!h||h.input===void 0||h.index===void 0)return null;let g=h.input.slice(Math.max(0,h.index-1),h.index),_=RegExp(`^[${i?.join(``)}\0]?$`).test(g);if(i!==null&&!_)return null;let v=m+h.index,y=v+h[0].length;return s&&l.test(p.slice(y-1,y+1))&&(h[0]+=` `,y+=1),v<o.pos&&y>=o.pos?{range:{from:v,to:y},query:h[0].slice(t.length),text:h[0]}:null}function OK(e){return e.docChanged?e.steps.some(e=>{let t=e.slice;if(!t?.content)return!1;let n=t.content.textBetween(0,t.content.size,`
|
|
259
259
|
`);return/\s/.test(n)}):!1}function kK(e){return()=>{let t=e.state.selection.$anchor.pos,{top:n,right:r,bottom:i,left:a}=e.view.coordsAtPos(t);try{return new DOMRect(a,n,r-a,i-n)}catch{return null}}}function AK(e,t,n,r){return n?()=>{let n=r.getState(e.state)?.decorationId;return t.dom.querySelector(`[data-decoration-id="${n}"]`)?.getBoundingClientRect()||null}:kK(e)}function jK({match:e,dismissedRange:t,state:n,transaction:r,editor:i,shouldResetDismissed:a,effectiveAllowSpaces:o}){return a?.({editor:i,state:n,range:t,match:e,transaction:r,allowSpaces:o})?!1:o?e.range.from===t.from:e.range.from===t.from&&!OK(r)}function MK({view:e,pluginKeyRef:t}){let n=e.state.tr.setMeta(t,{exit:!0});e.dispatch(n)}function NK({pluginKey:e,decorationTag:t,decorationClass:n,decorationContent:r,decorationEmptyClass:i,renderer:a,dispatchExit:o}){return{handleKeyDown(t,n){var r;let i=e.getState(t.state);if(!i.active)return!1;if(n.key===`Escape`||n.key===`Esc`){var s;return a==null||(s=a.onKeyDown)==null||s.call(a,{view:t,event:n,range:i.range}),o(t),!0}return(a==null||(r=a.onKeyDown)==null?void 0:r.call(a,{view:t,event:n,range:i.range}))||!1},decorations(a){let{active:o,range:s,decorationId:c,query:l}=e.getState(a);if(!o)return null;let u=!l?.length,d=[n];return u&&d.push(i),kT.create(a.doc,[ET.inline(s.from,s.to,{nodeName:t,class:d.join(` `),"data-decoration-id":c||void 0,"data-decoration-content":r})])}}}function PK({editor:e,char:t,effectiveAllowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,findSuggestionMatch:o,allow:s,shouldShow:c,shouldKeepDismissed:l,pluginKey:u}){return{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1,dismissedRange:null}},apply(d,f,p,m){let{isEditable:h}=e,{composing:g}=e.view,{selection:_}=d,{empty:v,from:y}=_,b={...f},x=d.getMeta(u);if(x&&x.exit)return b.active=!1,b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null,b.dismissedRange=f.active?{...f.range}:f.dismissedRange,b;if(b.composing=g,d.docChanged&&b.dismissedRange!==null&&(b.dismissedRange={from:d.mapping.map(b.dismissedRange.from),to:d.mapping.map(b.dismissedRange.to)}),h&&(v||e.view.composing)){(y<f.range.from||y>f.range.to)&&!g&&!f.composing&&(b.active=!1);let u=o({char:t,allowSpaces:n,allowToIncludeChar:r,allowedPrefixes:i,startOfLine:a,$position:_.$from}),p=`id_${Math.floor(Math.random()*4294967295)}`;u&&s({editor:e,state:m,range:u.range,isActive:f.active})&&(!c||c({editor:e,range:u.range,query:u.query,text:u.text,transaction:d}))?(b.dismissedRange!==null&&!l({match:u,dismissedRange:b.dismissedRange,state:m,transaction:d})&&(b.dismissedRange=null),b.dismissedRange===null?(b.active=!0,b.decorationId=f.decorationId||p,b.range=u.range,b.query=u.query,b.text=u.text):b.active=!1):(u||(b.dismissedRange=null),b.active=!1)}else b.active=!1;return b.active||(b.decorationId=null,b.range={from:0,to:0},b.query=null,b.text=null),b}}}function FK({editor:e,items:t}){let n=null,r=null,i=null,a=()=>{r!==null&&(clearTimeout(r),r=null),i?.(),i=null},o=e=>new Promise(t=>{i=t,r=setTimeout(()=>{r=null;let e=i;i=null,e?.()},e)}),s=()=>{n?.abort(),a(),n=null};return{abort:s,fetch:async(r,i)=>{s(),n=new AbortController;let a=n;if(i>0&&await o(i),n!==a||a.signal.aborted)return{status:`aborted`};try{let i=await t({editor:e,query:r,signal:a.signal});return n!==a||a.signal.aborted?{status:`aborted`}:{status:`resolved`,items:i}}catch{return n!==a||a.signal.aborted?{status:`aborted`}:{status:`error`}}}}}function IK({placement:e,offset:t,flip:n,floatingUi:r}){var i;let a=[Bs({mainAxis:t.mainAxis??4,crossAxis:t.crossAxis??0})];return n&&a.push(Us()),r!=null&&(i=r.middleware)!=null&&i.length&&a.push(...r.middleware),{placement:e,strategy:r?.strategy??`absolute`,middleware:a}}function LK(e){if(e instanceof HTMLElement)return e;if(typeof e==`string`)try{let t=document.querySelector(e);if(t)return t}catch{return document.body}return document.body}function RK({getReferenceRect:e,contextElement:t,config:n,container:r,dismissOnOutsideClick:i,dismiss:a}){return(o,s={})=>{let c={getBoundingClientRect:()=>e()??new DOMRect,contextElement:t},l=!1,u=!o.isConnected;u&&LK(r).appendChild(o),s.onPosition||(o.style.visibility=`hidden`,o.style.width=`max-content`);let d=zs(c,o,()=>{Ys(c,o,{placement:n.placement,strategy:n.strategy,middleware:n.middleware}).then(({x:e,y:t,placement:n,strategy:r})=>{s.onPosition?s.onPosition({x:e,y:t,placement:n,strategy:r}):(Object.assign(o.style,{position:r,left:`${e}px`,top:`${t}px`}),l||(l=!0,o.style.visibility=``))})},s.autoUpdate),f;return i&&(f=e=>{let n=e.target;!(n instanceof Node)||o.contains(n)||t.contains(n)||a()},document.addEventListener(`pointerdown`,f,!0)),()=>{d(),f&&document.removeEventListener(`pointerdown`,f,!0),u&&o.remove()}}}function zK({editor:e,pluginKey:t,items:n,renderer:r,minQueryLength:i,debounce:a,initialItems:o,placement:s,offset:c,container:l,flip:u,floatingUi:d,dismissOnOutsideClick:f,command:p,clientRectFor:m,dispatchExit:h}){let g,_=FK({editor:e,items:n}),v=IK({placement:s,offset:c,flip:u,floatingUi:d});function y(e,t){switch(e){case`started`:var n;r==null||(n=r.onStart)==null||n.call(r,t);break;case`updated`:var i;r==null||(i=r.onUpdate)==null||i.call(r,t);break;case`stopped`:var a;r==null||(a=r.onExit)==null||a.call(r,t)}}return{update:async(n,d)=>{let b=t.getState(d),x=t.getState(n.state);if(!b||!x)return;let S=null,C=b.query!==x.query,w=b.text!==x.text,T=b.range.from!==x.range.from||b.range.to!==x.range.to,E=C||w||T;if(!b.active&&x.active)S=`started`;else if(b.active&&!x.active)S=`stopped`;else if(x.active&&E)S=`updated`;else return;let D=S===`stopped`?b:x,ee=n.dom.querySelector(`[data-decoration-id="${D.decorationId}"]`),te=m(n,ee),O=i===0||(D.query?D.query.length>=i:!1),k=(S===`started`||S===`updated`)&&O;if(g={editor:e,range:D.range,query:D.query||``,text:D.text||``,items:o??[],command:t=>p({editor:e,range:D.range,props:t}),decorationNode:ee,clientRect:te,loading:k,placement:s,offset:{mainAxis:c.mainAxis??4,crossAxis:c.crossAxis??0},container:l,flip:u,floatingUi:v,mount:RK({getReferenceRect:te,contextElement:n.dom,config:v,container:l,dismissOnOutsideClick:f,dismiss:()=>h(e.view)})},S===`started`){var A;r==null||(A=r.onBeforeStart)==null||A.call(r,g)}if(S===`updated`){var ne;r==null||(ne=r.onBeforeUpdate)==null||ne.call(r,g)}if(S===`started`&&y(S,g),S===`started`||S===`updated`){if(!k)_.abort(),g={...g,items:o??[],loading:!1};else{g={...g,items:o??[],loading:!0},S=`updated`,y(S,g);let e=await _.fetch(D.query||``,a);if(e.status===`aborted`)return;if(!t.getState(n.state)?.active){_.abort();return}g=e.status===`resolved`?{...g,items:e.items,loading:!1}:{...g,loading:!1}}}S===`stopped`?(_.abort(),y(S,g),g=void 0):S===`updated`&&y(S,g)},destroy:()=>{var e;_.abort(),g&&(r==null||(e=r.onExit)==null||e.call(r,g))}}}var BK=new ex(`suggestion`);function VK({pluginKey:e=BK,editor:t,char:n=`@`,allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:a=[` `],startOfLine:o=!1,decorationTag:s=`span`,decorationClass:c=`suggestion`,decorationContent:l=``,decorationEmptyClass:u=`is-empty`,command:d=()=>null,items:f=()=>[],minQueryLength:p=0,debounce:m=0,initialItems:h,placement:g=`bottom-start`,offset:_={},container:v,flip:y=!0,floatingUi:b,dismissOnOutsideClick:x=!0,render:S=()=>({}),allow:C=()=>!0,findSuggestionMatch:w=DK,shouldShow:T,shouldResetDismissed:E}){let D=S?.(),ee=r&&!i,te=(n,r)=>AK(t,n,r,e);function O(e){return jK({...e,editor:t,shouldResetDismissed:E,effectiveAllowSpaces:ee})}let k=t=>MK({view:t,pluginKeyRef:e});return new Zb({key:e,view:()=>zK({editor:t,pluginKey:e,items:f,renderer:D,minQueryLength:p,debounce:m,initialItems:h,placement:g,offset:_,container:v,flip:y,floatingUi:b,dismissOnOutsideClick:x,command:d,clientRectFor:te,dispatchExit:k}),state:PK({editor:t,char:n,effectiveAllowSpaces:ee,allowToIncludeChar:i,allowedPrefixes:a,startOfLine:o,findSuggestionMatch:w,allow:C,shouldShow:T,shouldKeepDismissed:O,pluginKey:e}),props:NK({pluginKey:e,decorationTag:s,decorationClass:c,decorationContent:l,decorationEmptyClass:u,renderer:D,dispatchExit:k})})}var HK=VK,UK={"callout-tip":`var(--aviso-tip)`,"callout-warning":`var(--aviso-warning)`,"callout-caution":`var(--aviso-caution)`,"callout-note":`var(--aviso-note)`},WK={h1:`text-[22px]`,h2:`text-[18px]`,h3:`text-[15px]`},GK=`font-mono text-[10px] font-bold`;function KK(e){let t=UK[e.id];if(t)return(0,R.jsx)(`span`,{className:`h-6 w-8 rounded-[2px] border-l-4 bg-muted`,style:{borderLeftColor:t}});if(WK[e.id])return(0,R.jsx)(`span`,{className:L(`font-display font-bold leading-none`,WK[e.id]),children:`Aa`});switch(e.id){case`steps`:return(0,R.jsx)(`span`,{className:L(GK,`grid size-6 place-items-center rounded-full bg-anotacao text-[var(--sobre-anotacao)]`),children:`1`});case`result`:return(0,R.jsx)(`span`,{className:L(GK,`bg-[linear-gradient(transparent_50%,var(--marca-faixa)_50%)] uppercase`),children:`OK`});case`quote`:return(0,R.jsx)(`span`,{className:`h-5 border-l-2 border-border pl-1.5 text-base italic leading-5`,children:`“`});case`code`:return(0,R.jsx)(`span`,{className:L(GK,`rounded-[4px] border border-border bg-superficie px-1`),children:`{ }`});case`bullets`:return(0,R.jsx)(`span`,{className:`text-base font-bold leading-none`,children:`•`});case`image`:return(0,R.jsx)(`span`,{className:`h-5 w-7 rounded-[3px] border-2 border-muted-foreground/60`});case`table`:return(0,R.jsx)(`span`,{className:`size-6 border border-muted-foreground/60 bg-[linear-gradient(var(--border),var(--border))_center/1px_100%_no-repeat,linear-gradient(var(--border),var(--border))_center/100%_1px_no-repeat]`});default:return(0,R.jsx)(`span`,{className:`text-base leading-none`,children:`Aa`})}}function qK({block:e}){return(0,R.jsx)(`span`,{"aria-hidden":!0,className:`grid h-8 w-10 shrink-0 place-items-center text-foreground`,children:KK(e)})}function JK({items:e,command:t,ref:n}){let[r,i]=(0,_.useState)(0),[a,o]=(0,_.useState)(e);e!==a&&(o(e),i(0));let s=(0,_.useRef)(null),c=(0,_.useRef)(!1);return(0,_.useEffect)(()=>{c.current&&(c.current=!1,s.current?.querySelector(`[aria-selected="true"]`)?.scrollIntoView({block:`nearest`}))}),(0,_.useImperativeHandle)(n,()=>({onKeyDown:n=>{if(n.key===`ArrowDown`)return c.current=!0,i(t=>(t+1)%Math.max(e.length,1)),!0;if(n.key===`ArrowUp`)return c.current=!0,i(t=>(t-1+e.length)%Math.max(e.length,1)),!0;if(n.key===`Enter`){let n=e[r];return n&&t(n),!0}return!1}})),(0,R.jsx)(`div`,{ref:s,role:`listbox`,"aria-label":U(`Inserir bloco`),className:`z-50 max-h-[min(20rem,var(--slash-max-h,20rem))] w-80 overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-[0_8px_24px_-12px_rgb(21_26_51/0.35)]`,children:e.length===0?(0,R.jsx)(`p`,{className:`px-3 py-2 text-sm text-muted-foreground`,children:U(`Nenhum bloco com esse nome.`)}):vK(e).map(n=>(0,R.jsxs)(`div`,{role:`group`,"aria-labelledby":`slash-${n.id}`,children:[(0,R.jsx)(`p`,{id:`slash-${n.id}`,className:`rotulo px-2 pt-2 pb-1`,children:n.label}),n.items.map(n=>{let a=e.indexOf(n);return(0,R.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":a===r,onMouseEnter:()=>i(a),onClick:()=>t(n),className:L(`flex w-full items-center gap-2 rounded-md px-2 py-1 text-left`,a===r&&`bg-accent`),children:[(0,R.jsx)(qK,{block:n}),(0,R.jsxs)(`span`,{className:`grid leading-tight`,children:[(0,R.jsx)(`span`,{className:`text-sm font-bold`,children:n.label}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.hint})]})]},n.id)})]},n.id))})}var YK=bj.create({name:`slashCommand`,addOptions(){return{pickImage:()=>{}}},addProseMirrorPlugins(){let{pickImage:e}=this.options;return[HK({editor:this.editor,char:`/`,startOfLine:!1,flip:!1,floatingUi:{middleware:[Us(()=>({padding:PF()})),Ws(()=>({padding:PF(),apply:({availableHeight:e,elements:t})=>t.floating.style.setProperty(`--slash-max-h`,`${e}px`)}))]},allow:({state:e,range:t})=>{let n=e.doc.textBetween(Math.max(t.from-1,0),t.from,`
|
|
260
260
|
`,`
|
|
261
261
|
`);return n===``||n===` `||n===`
|