tempest-react-sdk 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.cjs +3 -3
- package/dist/tempest-react-sdk.cjs.map +1 -1
- package/dist/tempest-react-sdk.d.ts +169 -6
- package/dist/tempest-react-sdk.js +3174 -2985
- package/dist/tempest-react-sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("./sw.cjs"),o=require("react/jsx-runtime"),l=require("react"),x=require("./cn-CNScIEB4.cjs"),G=require("@tanstack/react-query"),I=require("react-router-dom"),He=require("react-dom"),pe=require("react-hook-form"),Pt=require("zustand"),gt=require("zustand/middleware"),Es=require("dexie"),Ts="tempest_accordion_LVhhv",Ms="tempest_item_7ryVk",Rs="tempest_header_WaTdJ",Ls="tempest_trigger_9BYFY",Ds="tempest_chevron_i-HVZ",Is="tempest_open_98jLY",Ps="tempest_panel_Wx50w",Ce={accordion:Ts,item:Ms,header:Rs,trigger:Ls,chevron:Ds,open:Is,panel:Ps};function As({items:e,multiple:t=!1,value:n,defaultValue:s=[],onChange:r,className:a}){const c=l.useId(),i=n!==void 0,[u,d]=l.useState(s),p=i?n:u,m=l.useCallback(f=>{const h=p.includes(f),_=t?h?p.filter(b=>b!==f):[...p,f]:h?[]:[f];i||d(_),r?.(_)},[p,t,i,r]);return o.jsx("div",{className:x.cn(Ce.accordion,a),children:e.map(f=>{const h=p.includes(f.id),_=`${c}-${f.id}-panel`,b=`${c}-${f.id}-trigger`;return o.jsxs("div",{className:x.cn(Ce.item,h&&Ce.open),children:[o.jsx("h3",{className:Ce.header,children:o.jsxs("button",{type:"button",id:b,className:Ce.trigger,"aria-expanded":h,"aria-controls":_,disabled:f.disabled,onClick:()=>m(f.id),children:[o.jsx("span",{children:f.title}),o.jsx(Fs,{className:Ce.chevron})]})}),h&&o.jsx("div",{id:_,role:"region","aria-labelledby":b,className:Ce.panel,children:f.children})]},f.id)})})}function Fs({className:e}){return o.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Os="tempest_alert_7cYyI",Bs="tempest_content_UXnmZ",zs="tempest_title_abGgF",Ws="tempest_description_pXPvw",qs="tempest_icon_Zg6SB",Us="tempest_close_narep",Ks="tempest_neutral_J7MH1",Hs="tempest_solid_s-oW5",Gs="tempest_outline_v7w9b",Js="tempest_info_9r3r1",Qs="tempest_success_1bzoB",Ys="tempest_warning_q-j1Q",Vs="tempest_danger_CiZkW",fe={alert:Os,content:Bs,title:zs,description:Ws,icon:qs,close:Us,neutral:Ks,solid:Hs,outline:Gs,info:Js,success:Qs,warning:Ys,danger:Vs};function Xs({variant:e="info",appearance:t="soft",title:n,description:s,icon:r,onClose:a,closeLabel:c="Dismiss",className:i,children:u,...d}){return o.jsxs("div",{role:"alert",className:x.cn(fe.alert,fe[e],t==="solid"&&fe.solid,t==="outline"&&fe.outline,i),...d,children:[r&&o.jsx("span",{className:fe.icon,children:r}),o.jsxs("div",{className:fe.content,children:[n&&o.jsx("p",{className:fe.title,children:n}),s&&o.jsx("p",{className:fe.description,children:s}),u]}),a&&o.jsx("button",{type:"button",className:fe.close,onClick:a,"aria-label":c,children:o.jsx(Zs,{})})]})}function Zs(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const bt={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},er=["xs","sm","md","lg","xl","2xl"];function tr(e){let t="xs";for(const n of er)e>=bt[n]&&(t=n);return t}function Fe(){const[e,t]=l.useState(()=>typeof window>"u"?0:window.innerWidth);l.useEffect(()=>{if(typeof window>"u")return;const a=()=>t(window.innerWidth);return a(),window.addEventListener("resize",a,{passive:!0}),()=>window.removeEventListener("resize",a)},[]);const n=tr(e),s=a=>e>=bt[a],r=a=>e<bt[a];return{current:n,width:e,above:s,below:r,isMobile:r("md"),isTablet:s("md")&&r("lg"),isDesktop:s("lg")}}const nr="tempest_shell_-xp0O",sr="tempest_navbar_liTKV",rr="tempest_row_PE41P",or="tempest_sidebar_wyx-V",ar="tempest_main_O3GFv",cr="tempest_footer_IFW4q",ir="tempest_bottomNav_pKJ1v",Ee={shell:nr,navbar:sr,row:rr,sidebar:or,main:ar,footer:cr,bottomNav:ir};function lr({navbar:e,sidebar:t,bottomNav:n,footer:s,sidebarBreakpoint:r="md",className:a,children:c,...i}){const d=Fe().above(r);return o.jsxs("div",{className:x.cn(Ee.shell,a),...i,children:[e&&o.jsx("div",{className:Ee.navbar,children:e}),o.jsxs("div",{className:Ee.row,children:[t&&d&&o.jsx("div",{className:Ee.sidebar,children:t}),o.jsx("main",{className:Ee.main,children:c})]}),s&&o.jsx("div",{className:Ee.footer,children:s}),n&&!d&&o.jsx("div",{className:Ee.bottomNav,children:n})]})}const ur="tempest_aspect_GnAJt",dr={aspect:ur};function pr({ratio:e=16/9,className:t,style:n,children:s,...r}){const a={aspectRatio:String(e),...n};return o.jsx("div",{className:x.cn(dr.aspect,t),style:a,...r,children:s})}const mr="tempest_avatar_3xMuZ",fr="tempest_image_ieqGp",hr="tempest_xs_oSaLL",_r="tempest_sm_sZ2bk",gr="tempest_md_Fdkbz",br="tempest_lg_pTTUA",yr="tempest_xl_mW58F",vr="tempest_status_ISBnL",wr="tempest_dot_Wgfo-",xr="tempest_online_-aWoW",jr="tempest_offline_-StX3",$r="tempest_busy_TbwuF",Oe={avatar:mr,image:fr,xs:hr,sm:_r,md:gr,lg:br,xl:yr,status:vr,dot:wr,online:xr,offline:jr,busy:$r};function kr(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2):`${t[0].charAt(0)}${t[t.length-1].charAt(0)}`}function Nr({src:e,alt:t,name:n="",size:s="md",status:r,className:a,onClick:c}){const[i,u]=l.useState(!1),d=l.useMemo(()=>kr(n),[n]),p=e&&!i,m=c?"button":void 0,f=c?0:void 0;return o.jsxs("span",{className:x.cn(Oe.avatar,Oe[s],r&&Oe.status,a),role:m,tabIndex:f,onClick:c,onKeyDown:c?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c())}:void 0,children:[p?o.jsx("img",{src:e,alt:t??n,className:Oe.image,onError:()=>u(!0)}):o.jsx("span",{"aria-label":t??n,children:d}),r&&o.jsx("span",{className:x.cn(Oe.dot,Oe[r]),"aria-hidden":!0})]})}const Sr="tempest_badge_RsuMz",Cr="tempest_sm_LYsCn",Er="tempest_md_4Or8q",Tr="tempest_lg_Bseje",Mr="tempest_square_l63D-",Rr="tempest_neutral_lulSm",Lr="tempest_solid_0Leug",Dr="tempest_outline_x06HL",Ir="tempest_success_u9JiS",Pr="tempest_warning_nsGp-",Ar="tempest_danger_PD2hz",Fr="tempest_info_na6DQ",Or="tempest_primary_S0WCS",Br="tempest_dot_i0c-G",Te={badge:Sr,sm:Cr,md:Er,lg:Tr,square:Mr,neutral:Rr,solid:Lr,outline:Dr,success:Ir,warning:Pr,danger:Ar,info:Fr,primary:Or,dot:Br};function zr({variant:e="neutral",appearance:t="soft",size:n="md",shape:s="pill",dot:r=!1,className:a,children:c,...i}){return o.jsxs("span",{className:x.cn(Te.badge,Te[e],t==="solid"&&Te.solid,t==="outline"&&Te.outline,Te[n],s==="square"&&Te.square,a),...i,children:[r&&o.jsx("span",{className:Te.dot,"aria-hidden":!0}),c]})}const Wr="tempest_banner_oyoWE",qr="tempest_info_s2q0P",Ur="tempest_success_uLYQ3",Kr="tempest_warning_9rua8",Hr="tempest_danger_Uzb-6",Gr="tempest_icon_vzKmx",Jr="tempest_body_-Qm4K",Qr="tempest_title_AeTHT",Yr="tempest_description_nbyf-",Vr="tempest_action_47P8e",Xr="tempest_close_Iy2oN",$e={banner:Wr,info:qr,success:Ur,warning:Kr,danger:Hr,icon:Gr,body:Jr,title:Qr,description:Yr,action:Vr,close:Xr};function Zr({variant:e="info",icon:t,title:n,action:s,dismissible:r=!1,onDismiss:a,className:c,children:i,...u}){const[d,p]=l.useState(!0);return d?o.jsxs("div",{className:x.cn($e.banner,$e[e],c),role:"status",...u,children:[t&&o.jsx("span",{className:$e.icon,children:t}),o.jsxs("div",{className:$e.body,children:[n&&o.jsx("p",{className:$e.title,children:n}),i&&o.jsx("p",{className:$e.description,children:i})]}),s&&o.jsx("div",{className:$e.action,children:s}),r&&o.jsx("button",{type:"button",className:$e.close,"aria-label":"Fechar",onClick:()=>{p(!1),a?.()},children:"×"})]}):null}const eo="tempest_bar_kp35Q",to="tempest_item_XfDIW",no="tempest_active_sK54f",so="tempest_iconWrap_yJ20b",ro="tempest_icon_TAjtI",oo="tempest_badge_-c3Do",ao="tempest_label_qJj3L",Me={bar:eo,item:to,active:no,iconWrap:so,icon:ro,badge:oo,label:ao};function co({items:e,value:t,onChange:n,showLabels:s=!0,className:r,...a}){return o.jsx("nav",{className:x.cn(Me.bar,r),"aria-label":"Navegação principal",...a,children:e.map(c=>{const i=c.key===t;return o.jsxs("button",{type:"button",className:x.cn(Me.item,i&&Me.active),"aria-current":i?"page":void 0,disabled:c.disabled,onClick:()=>n(c.key),children:[o.jsxs("span",{className:Me.iconWrap,children:[c.icon&&o.jsx("span",{className:Me.icon,children:c.icon}),c.badge!==void 0&&o.jsx("span",{className:Me.badge,children:c.badge})]}),s&&o.jsx("span",{className:Me.label,children:c.label})]},c.key)})})}const io="tempest_root_qXce2",lo="tempest_backdrop_WLqh0",uo="tempest_sheet_Okz1P",po="tempest_handle_GWCoK",mo="tempest_handleBar_XPPiI",fo="tempest_title_i5Vuc",ho="tempest_body_bgDhJ",Re={root:io,backdrop:lo,sheet:uo,handle:po,handleBar:mo,title:fo,body:ho};function _o({open:e,onClose:t,title:n,showHandle:s=!0,dismissOnBackdrop:r=!0,dismissOnEsc:a=!0,className:c,children:i,...u}){return l.useEffect(()=>{if(!e||!a)return;const d=p=>{p.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,a,t]),l.useEffect(()=>{if(!e)return;const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[e]),!e||typeof document>"u"?null:He.createPortal(o.jsxs("div",{className:Re.root,role:"dialog","aria-modal":"true",children:[o.jsx("div",{className:Re.backdrop,onClick:()=>r&&t(),"aria-hidden":"true"}),o.jsxs("div",{className:x.cn(Re.sheet,c),...u,children:[s&&o.jsx("button",{type:"button",className:Re.handle,"aria-label":"Arrastar para fechar",onClick:t,children:o.jsx("span",{className:Re.handleBar})}),n&&o.jsx("div",{className:Re.title,children:n}),o.jsx("div",{className:Re.body,children:i})]})]}),document.body)}const go="tempest_nav_H4g6P",bo="tempest_item_O4g3P",yo="tempest_link_7WM67",vo="tempest_current_JdlcS",wo="tempest_separator_zGWyJ",Je={nav:go,item:bo,link:yo,current:vo,separator:wo};function xo({items:e,separator:t="/",className:n}){return o.jsx("nav",{"aria-label":"breadcrumb",className:x.cn(Je.nav,n),children:e.map((s,r)=>{const a=r===e.length-1,c=!a&&(s.href||s.onClick);return o.jsxs(l.Fragment,{children:[o.jsx("span",{className:Je.item,children:c?o.jsx("a",{href:s.href,onClick:i=>{s.onClick&&(i.preventDefault(),s.onClick())},className:Je.link,children:s.label}):o.jsx("span",{"aria-current":a?"page":void 0,className:a?Je.current:void 0,children:s.label})}),!a&&o.jsx("span",{className:Je.separator,"aria-hidden":!0,children:t})]},r)})})}const jo="tempest_button_2ZuB7",$o="tempest_primary_s1sM6",ko="tempest_secondary_R0waJ",No="tempest_danger_V4fX8",So="tempest_success_w6qB6",Co="tempest_ghost_1KINV",Eo="tempest_soft_c3kzm",To="tempest_outline_F5jq-",Mo="tempest_link_Zt5hw",Ro="tempest_xs_cF6m0",Lo="tempest_sm_NhG0g",Do="tempest_md_hH4h3",Io="tempest_lg_2plQf",Po="tempest_xl_nx4V0",Ao="tempest_iconOnly_WCpTS",Fo="tempest_pill_lx8lt",Oo="tempest_fullWidth_36oJT",Bo="tempest_loading_EQAt2",zo="tempest_hiddenText_hIiJ2",Wo="tempest_spinner_ZExvW",qo="tempest_tempest-spin_UOSVC",he={button:jo,primary:$o,secondary:ko,danger:No,success:So,ghost:Co,soft:Eo,outline:To,link:Mo,xs:Ro,sm:Lo,md:Do,lg:Io,xl:Po,iconOnly:Ao,pill:Fo,fullWidth:Oo,loading:Bo,hiddenText:zo,spinner:Wo,tempestSpin:qo};function yt({variant:e="primary",size:t="md",loading:n=!1,fullWidth:s=!1,iconOnly:r=!1,pill:a=!1,leftIcon:c,rightIcon:i,disabled:u,className:d,children:p,...m}){return o.jsxs("button",{className:x.cn(he.button,he[e],he[t],r&&he.iconOnly,a&&he.pill,n&&he.loading,s&&he.fullWidth,d),disabled:u||n,...m,children:[n&&o.jsx("span",{className:he.spinner,"aria-hidden":!0,children:o.jsx(Uo,{})}),o.jsxs("span",{className:x.cn(n&&he.hiddenText),children:[c,p,i]})]})}function Uo(){return o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Ko="tempest_card_Cb1o4",Ho="tempest_flat_LRpce",Go="tempest_raised_WmIqk",Jo="tempest_elevated_5VEDw",Qo="tempest_interactive_B8Tah",Yo="tempest_padded_oOxwN",Vo="tempest_flush_aiDZi",Xo="tempest_header_PTXf2",Zo="tempest_title_mSgoo",ea="tempest_body_W441Z",ta="tempest_footer_Mu-JC",ee={card:Ko,flat:Ho,raised:Go,elevated:Jo,interactive:Qo,padded:Yo,flush:Vo,header:Xo,title:Zo,body:ea,footer:ta};function na({title:e,actions:t,footer:n,flush:s=!1,interactive:r=!1,elevation:a="default",className:c,children:i,...u}){const d=!!(e||t);return o.jsxs("div",{className:x.cn(ee.card,a==="flat"&&ee.flat,a==="raised"&&ee.raised,a==="elevated"&&ee.elevated,r&&ee.interactive,!d&&!s&&ee.padded,s&&ee.flush,c),tabIndex:r?u.tabIndex??0:u.tabIndex,...u,children:[d&&o.jsxs("header",{className:ee.header,children:[typeof e=="string"?o.jsx("h3",{className:ee.title,children:e}):e,t]}),d?o.jsx("div",{className:ee.body,children:i}):i,n&&o.jsx("footer",{className:ee.footer,children:n})]})}const sa="tempest_center_Pu1Pf",ra="tempest_both_53GWn",oa="tempest_horizontal_94-Bt",aa="tempest_vertical_Q7Kyg",Vt={center:sa,both:ra,horizontal:oa,vertical:aa};function ca({axis:e="both",minHeight:t,fullWidth:n=!0,className:s,style:r,children:a,...c}){const i={...t!==void 0?{minHeight:typeof t=="number"?`${t}px`:t}:null,...n?{width:"100%"}:null,...r};return o.jsx("div",{className:x.cn(Vt.center,Vt[e],s),style:i,...c,children:a})}const ia="tempest_wrapper_rpthW",la="tempest_disabled_x7-eg",ua="tempest_input_2kt-h",da="tempest_box_OCPee",pa="tempest_labelWrap_Ktbp0",ma="tempest_label_cwRtI",fa="tempest_description_rMhG1",Le={wrapper:ia,disabled:la,input:ua,box:da,labelWrap:pa,label:ma,description:fa},ha=l.forwardRef(function({label:t,description:n,indeterminate:s,disabled:r,wrapperClassName:a,className:c,...i},u){const d=l.useRef(null);l.useEffect(()=>{d.current&&(d.current.indeterminate=!!s)},[s]);function p(m){d.current=m,typeof u=="function"?u(m):u&&(u.current=m)}return o.jsxs("label",{className:x.cn(Le.wrapper,r&&Le.disabled,a),children:[o.jsx("input",{ref:p,type:"checkbox",disabled:r,className:x.cn(Le.input,c),...i}),o.jsx("span",{className:Le.box,"aria-hidden":!0,children:s?o.jsx(ga,{}):o.jsx(_a,{})}),(t||n)&&o.jsxs("span",{className:Le.labelWrap,children:[t&&o.jsx("span",{className:Le.label,children:t}),n&&o.jsx("span",{className:Le.description,children:n})]})]})});function _a(){return o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M5 12l5 5L20 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}function ga(){return o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M5 12h14",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})}const ba="tempest_wrapper_KR4-F",ya="tempest_label_Mz-wX",va="tempest_field_iIBJw",wa="tempest_error_O9n-9",xa="tempest_chip_GEwrc",ja="tempest_remove_JYDIq",$a="tempest_input_frJmk",ka="tempest_helper_Yts53",Na="tempest_errorText_llJGq",_e={wrapper:ba,label:ya,field:va,error:wa,chip:xa,remove:ja,input:$a,helper:ka,errorText:Na};function Sa({value:e,onChange:t,label:n,placeholder:s="Adicionar e pressionar Enter…",helperText:r,error:a,commitKeys:c=["Enter",",","Tab"],normalize:i=!0,className:u}){const[d,p]=l.useState(""),m=l.useRef(null);function f(){const b=i?d.trim().toLowerCase():d.trim();if(b){if(e.includes(b)){p("");return}t([...e,b]),p("")}}function h(b){if(c.includes(b.key)){b.preventDefault(),f();return}b.key==="Backspace"&&!d&&e.length>0&&t(e.slice(0,-1))}function _(b){const v=e.slice();v.splice(b,1),t(v)}return o.jsxs("div",{className:x.cn(_e.wrapper,a&&_e.error,u),children:[n&&o.jsx("label",{className:_e.label,children:n}),o.jsxs("div",{className:_e.field,onClick:()=>m.current?.focus(),children:[e.map((b,v)=>o.jsxs("span",{className:_e.chip,children:[b,o.jsx("button",{type:"button",className:_e.remove,"aria-label":`Remover ${b}`,onClick:()=>_(v),children:"×"})]},`${b}-${v}`)),o.jsx("input",{ref:m,className:_e.input,value:d,placeholder:e.length===0?s:"",onChange:b=>p(b.target.value),onKeyDown:h,onBlur:f})]}),a?o.jsx("span",{className:_e.errorText,children:a}):r?o.jsx("span",{className:_e.helper,children:r}):null]})}const Ca="tempest_wrapper_TNvle",Ea="tempest_label_KVkZO",Ta="tempest_field_BenH0",Ma="tempest_input_-HTv1",Ra="tempest_caret_jRplQ",La="tempest_menu_zPQG3",Da="tempest_option_vhhn5",Ia="tempest_active_XCgtX",Pa="tempest_selected_T6nm2",Aa="tempest_empty_Ahw5K",Fa="tempest_helper_OzB7V",Oa="tempest_errorText_X18sQ",Ba="tempest_error_bnVuM",U={wrapper:Ca,label:Ea,field:Ta,input:Ma,caret:Ra,menu:La,option:Da,active:Ia,selected:Pa,empty:Aa,helper:Fa,errorText:Oa,error:Ba};function za(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function Wa({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:a,error:c,disabled:i,filter:u=za,emptyMessage:d="Nenhuma opção encontrada",className:p}){const m=l.useId(),f=l.useRef(null),h=l.useRef(null),[_,b]=l.useState(!1),[v,g]=l.useState(""),[w,y]=l.useState(0),j=l.useMemo(()=>e.find(k=>k.value===t)?.label??"",[e,t]),S=l.useMemo(()=>e.filter(k=>u(k,v)),[e,u,v]),M=l.useCallback(()=>{b(!1),g(""),y(0)},[]),T=l.useCallback(k=>{k.disabled||(n(k.value),M())},[n,M]);l.useEffect(()=>{if(!_)return;const k=E=>{f.current&&!f.current.contains(E.target)&&M()};return window.addEventListener("mousedown",k),()=>window.removeEventListener("mousedown",k)},[_,M]);const N=k=>{if(k.key==="ArrowDown")k.preventDefault(),b(!0),y(E=>Math.min(S.length-1,E+1));else if(k.key==="ArrowUp")k.preventDefault(),y(E=>Math.max(0,E-1));else if(k.key==="Enter"){k.preventDefault();const E=S[w];E&&T(E)}else k.key==="Escape"&&M()};return o.jsxs("div",{ref:f,className:x.cn(U.wrapper,c&&U.error,p),children:[s&&o.jsx("label",{htmlFor:m,className:U.label,children:s}),o.jsxs("div",{className:U.field,children:[o.jsx("input",{id:m,ref:h,type:"text",role:"combobox","aria-expanded":_,"aria-controls":`${m}-listbox`,"aria-autocomplete":"list",className:U.input,placeholder:r,disabled:i,value:_?v:j,onFocus:()=>b(!0),onChange:k=>{g(k.target.value),b(!0),y(0)},onKeyDown:N}),o.jsx("span",{className:U.caret,"aria-hidden":!0,children:"▾"})]}),_&&o.jsx("ul",{id:`${m}-listbox`,role:"listbox",className:U.menu,children:S.length===0?o.jsx("li",{className:U.empty,children:d}):S.map((k,E)=>o.jsx("li",{role:"option","aria-selected":k.value===t,className:x.cn(U.option,E===w&&U.active,k.value===t&&U.selected),onMouseEnter:()=>y(E),onMouseDown:D=>{D.preventDefault(),T(k)},children:k.label},k.value))}),c?o.jsx("span",{className:U.errorText,children:c}):a?o.jsx("span",{className:U.helper,children:a}):null]})}const qa="tempest_overlay_dd9h1",Ua="tempest_tempest-fade-in_DvgSp",Ka="tempest_dialog_ptM-K",Ha="tempest_tempest-modal-in_UoxQC",Ga="tempest_sm_K5k3W",Ja="tempest_md_gvyR7",Qa="tempest_lg_BgB1a",Ya="tempest_xl_MR-68",Va="tempest_size2xl_-PH9e",Xa="tempest_size3xl_iqDwN",Za="tempest_fullscreen_o84Xi",ec="tempest_fullscreenOnMobile_0bDwe",tc="tempest_body_lVhql",nc="tempest_header_ILG9i",sc="tempest_footer_rro2w",rc="tempest_title_A5OeE",oc="tempest_close_-ER1C",V={overlay:qa,tempestFadeIn:Ua,dialog:Ka,tempestModalIn:Ha,sm:Ga,md:Ja,lg:Qa,xl:Ya,size2Xl:Va,size3Xl:Xa,fullscreen:Za,fullscreenOnMobile:ec,body:tc,header:nc,footer:sc,title:rc,close:oc};function Ut({open:e,onClose:t,title:n,children:s,footer:r,size:a="md",closeOnBackdrop:c=!0,closeOnEsc:i=!0,className:u,hideCloseButton:d=!1,fullscreen:p=!1,fullscreenOnMobile:m=!1}){return l.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;document.body.style.overflow="hidden";const h=_=>{i&&_.key==="Escape"&&t()};return window.addEventListener("keydown",h),()=>{document.body.style.overflow=f,window.removeEventListener("keydown",h)}},[e,i,t]),!e||typeof document>"u"?null:He.createPortal(o.jsx("div",{className:V.overlay,role:"presentation",onClick:()=>{c&&t()},children:o.jsxs("div",{role:"dialog","aria-modal":"true",className:x.cn(V.dialog,ac(a),p&&V.fullscreen,m&&V.fullscreenOnMobile,u),onClick:f=>f.stopPropagation(),children:[(n||!d)&&o.jsxs("header",{className:V.header,children:[o.jsx("h3",{className:V.title,children:n}),!d&&o.jsx("button",{type:"button",className:V.close,"aria-label":"Fechar",onClick:t,children:o.jsx(cc,{})})]}),o.jsx("div",{className:V.body,children:s}),r&&o.jsx("footer",{className:V.footer,children:r})]})}),document.body)}function ac(e){return e==="2xl"?V.size2xl:e==="3xl"?V.size3xl:V[e]}function cc(){return o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Nn({open:e,title:t,description:n,confirmLabel:s="Confirmar",cancelLabel:r="Cancelar",variant:a="primary",loading:c=!1,onConfirm:i,onCancel:u}){return o.jsx(Ut,{open:e,onClose:u,title:t,size:"sm",footer:o.jsxs(o.Fragment,{children:[o.jsx(yt,{variant:"secondary",onClick:u,disabled:c,children:r}),o.jsx(yt,{variant:a,loading:c,onClick:()=>{i()},children:s})]}),children:n})}const ic="tempest_wrapper_iHNUs",lc="tempest_label_-OEBL",uc="tempest_required_CTss-",dc="tempest_field_65yGJ",pc="tempest_input_WjT81",mc="tempest_sizeSm_cgds6",fc="tempest_sizeMd_EPFGy",hc="tempest_sizeLg_5Cq8k",_c="tempest_hasLeftIcon_xYO-v",gc="tempest_hasRightIcon_C7uyr",bc="tempest_iconLeft_KrUhI",yc="tempest_iconRight_Ssr47",vc="tempest_error_VLISa",wc="tempest_helper_7Vc-s",xc="tempest_errorText_xz4xS",z={wrapper:ic,label:lc,required:uc,field:dc,input:pc,sizeSm:mc,sizeMd:fc,sizeLg:hc,hasLeftIcon:_c,hasRightIcon:gc,iconLeft:bc,iconRight:yc,error:vc,helper:wc,errorText:xc},xt=l.forwardRef(function({label:t,helperText:n,error:s,leftIcon:r,rightIcon:a,wrapperClassName:c,className:i,id:u,required:d,size:p="md",...m},f){const h=l.useId(),_=u??h,b=s?`${_}-error`:n?`${_}-helper`:void 0,v=p==="sm"?z.sizeSm:p==="lg"?z.sizeLg:z.sizeMd;return o.jsxs("div",{className:x.cn(z.wrapper,s&&z.error,c),children:[t&&o.jsxs("label",{htmlFor:_,className:z.label,children:[t,d&&o.jsx("span",{className:z.required,children:"*"})]}),o.jsxs("div",{className:z.field,children:[r&&o.jsx("span",{className:z.iconLeft,children:r}),o.jsx("input",{ref:f,id:_,"aria-invalid":!!s,"aria-describedby":b,required:d,className:x.cn(z.input,v,r&&z.hasLeftIcon,a&&z.hasRightIcon,i),...m}),a&&o.jsx("span",{className:z.iconRight,children:a})]}),s?o.jsx("span",{id:`${_}-error`,className:z.errorText,children:s}):n?o.jsx("span",{id:`${_}-helper`,className:z.helper,children:n}):null]})}),jc=l.forwardRef(function({value:t,onChange:n,mode:s="date",...r},a){return o.jsx(xt,{...r,ref:a,type:s,value:t,onChange:c=>n(c.target.value)})}),$c="tempest_divider_KSGsi",kc="tempest_horizontal_pZ05Y",Nc="tempest_bare_elDbS",Sc="tempest_vertical_p-jD4",Cc="tempest_dashed_JWxCU",Ec="tempest_alignStart_QAIi1",Tc="tempest_alignEnd_eZDwa",J={divider:$c,horizontal:kc,bare:Nc,vertical:Sc,dashed:Cc,alignStart:Ec,alignEnd:Tc};function Mc({orientation:e="horizontal",variant:t="solid",label:n,align:s="center",className:r,...a}){return e==="vertical"?o.jsx("span",{role:"separator","aria-orientation":"vertical",className:x.cn(J.divider,J.vertical,t==="dashed"&&J.dashed,r),...a}):n?o.jsx("div",{role:"separator","aria-orientation":"horizontal",className:x.cn(J.divider,J.horizontal,t==="dashed"&&J.dashed,s==="start"&&J.alignStart,s==="end"&&J.alignEnd,r),...a,children:n}):o.jsx("hr",{className:x.cn(J.divider,J.horizontal,J.bare,t==="dashed"&&J.dashed,r)})}const Rc="tempest_overlay_hcG1G",Lc="tempest_tempest-drawer-overlay_XFbxY",Dc="tempest_panel_wUX0N",Ic="tempest_right_-oX-6",Pc="tempest_tempest-drawer-in-right_pWYHv",Ac="tempest_left_xi3nD",Fc="tempest_tempest-drawer-in-left_o7JSb",Oc="tempest_top_7rGCn",Bc="tempest_tempest-drawer-in-top_kn6AF",zc="tempest_bottom_zd-25",Wc="tempest_tempest-drawer-in-bottom_0x3u7",qc="tempest_handle_5B-TB",Uc="tempest_handleTop_7aMf-",Kc="tempest_header_sYoP1",Hc="tempest_title_LqUOu",Gc="tempest_close_tYPhU",Jc="tempest_body_aV9FG",Qc="tempest_footer_AuvUP",ie={overlay:Rc,tempestDrawerOverlay:Lc,panel:Dc,right:Ic,tempestDrawerInRight:Pc,left:Ac,tempestDrawerInLeft:Fc,top:Oc,tempestDrawerInTop:Bc,bottom:zc,tempestDrawerInBottom:Wc,handle:qc,handleTop:Uc,header:Kc,title:Hc,close:Gc,body:Jc,footer:Qc};function Yc({open:e,onClose:t,placement:n="right",title:s,children:r,footer:a,closeOnBackdrop:c=!0,closeOnEsc:i=!0,hideCloseButton:u=!1,className:d,mobilePlacement:p,showHandle:m=!1}){const{isMobile:f}=Fe(),h=f&&p?p:n;return l.useEffect(()=>{if(!e)return;const _=document.body.style.overflow;document.body.style.overflow="hidden";const b=v=>{i&&v.key==="Escape"&&t()};return window.addEventListener("keydown",b),()=>{document.body.style.overflow=_,window.removeEventListener("keydown",b)}},[e,i,t]),!e||typeof document>"u"?null:He.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:ie.overlay,onClick:()=>{c&&t()}}),o.jsxs("aside",{role:"dialog","aria-modal":"true",className:x.cn(ie.panel,ie[h],d),children:[m&&(h==="bottom"||h==="top")&&o.jsx("div",{className:x.cn(ie.handle,h==="top"&&ie.handleTop),"aria-hidden":!0}),(s||!u)&&o.jsxs("header",{className:ie.header,children:[o.jsx("h3",{className:ie.title,children:s}),!u&&o.jsx("button",{type:"button","aria-label":"Fechar",className:ie.close,onClick:t,children:o.jsx(Vc,{})})]}),o.jsx("div",{className:ie.body,children:r}),a&&o.jsx("footer",{className:ie.footer,children:a})]})]}),document.body)}function Vc(){return o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Xc="tempest_root_5ZetV",Zc="tempest_menu_-RiRW",ei="tempest_bottomStart_z60h9",ti="tempest_bottomEnd_b1tmU",ni="tempest_topStart_A0em2",si="tempest_topEnd_cFA5-",ri="tempest_item_T-QPZ",oi="tempest_active_WNqoX",ai="tempest_danger_C0jN3",ci="tempest_separator_RimQa",ii="tempest_label_6yP76",oe={root:Xc,menu:Zc,bottomStart:ei,bottomEnd:ti,topStart:ni,topEnd:si,item:ri,active:oi,danger:ai,separator:ci,label:ii};function li(e){switch(e){case"bottom-end":return oe.bottomEnd;case"top-start":return oe.topStart;case"top-end":return oe.topEnd;default:return oe.bottomStart}}function ui({trigger:e,items:t,placement:n="bottom-start",className:s}){const[r,a]=l.useState(!1),[c,i]=l.useState(-1),u=l.useId(),d=l.useRef(null),p=l.useRef([]),m=t.map((v,g)=>v.type==="item"&&!v.disabled?g:-1).filter(v=>v!==-1),f=l.useCallback(()=>{a(!1),i(-1)},[]);l.useEffect(()=>{if(!r)return;const v=w=>{if(w.key==="Escape"){f();return}if(w.key==="ArrowDown"){w.preventDefault();const y=m.indexOf(c),j=m[(y+1)%m.length]??-1;i(j),p.current[j]?.focus()}if(w.key==="ArrowUp"){w.preventDefault();const y=m.indexOf(c),j=m[(y-1+m.length)%m.length]??-1;i(j),p.current[j]?.focus()}},g=w=>{d.current&&!d.current.contains(w.target)&&f()};return window.addEventListener("keydown",v),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",v),window.removeEventListener("mousedown",g)}},[r,c,m,f]);const h=v=>{e.props.onClick?.(v),a(g=>!g)},_={...e,props:{...e.props,onClick:h,"aria-expanded":r,"aria-controls":u,"aria-haspopup":"menu"}},b=v=>{v.onSelect(),f()};return o.jsxs("span",{ref:d,className:oe.root,children:[_,r&&o.jsx("ul",{id:u,role:"menu",className:x.cn(oe.menu,li(n),s),children:t.map((v,g)=>v.type==="separator"?o.jsx("li",{role:"separator",className:oe.separator,"aria-hidden":!0},v.id):v.type==="label"?o.jsx("li",{role:"presentation",className:oe.label,children:v.label},v.id):o.jsx("li",{role:"none",children:o.jsxs("button",{ref:w=>{p.current[g]=w},type:"button",role:"menuitem",className:x.cn(oe.item,v.danger&&oe.danger,c===g&&oe.active),disabled:v.disabled,onClick:()=>b(v),onMouseEnter:()=>i(g),children:[v.icon&&o.jsx("span",{"aria-hidden":!0,children:v.icon}),v.label]})},v.id))})]})}const di="tempest_zone_u04pu",pi="tempest_dragging_uGtl4",mi="tempest_disabled_GTKfV",fi="tempest_input_qhJ1u",hi="tempest_prompt_mlpWz",Qe={zone:di,dragging:pi,disabled:mi,input:fi,prompt:hi};function _i({onDrop:e,accept:t,multiple:n=!0,disabled:s=!1,maxSize:r,onReject:a,children:c,className:i}){const u=l.useRef(null),[d,p]=l.useState(!1),m=w=>{if(!w||w.length===0)return;const y=Array.from(w),j=n?y:y.slice(0,1);if(r===void 0){e(j);return}const S=[],M=[];for(const T of j)T.size>r?M.push(T):S.push(T);M.length>0&&a?.(M),S.length>0&&e(S)},f=()=>{s||u.current?.click()},h=w=>{w.preventDefault(),!s&&p(!0)},_=w=>{w.preventDefault()},b=w=>{w.preventDefault(),p(!1)},v=w=>{w.preventDefault(),p(!1),!s&&m(w.dataTransfer.files)},g=w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),f())};return o.jsxs("div",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,className:x.cn(Qe.zone,d&&Qe.dragging,s&&Qe.disabled,i),onClick:f,onKeyDown:g,onDragEnter:h,onDragOver:_,onDragLeave:b,onDrop:v,children:[o.jsx("input",{ref:u,type:"file",className:Qe.input,accept:t,multiple:n,disabled:s,onChange:w=>{m(w.target.files),w.target.value=""}}),c??o.jsx("span",{className:Qe.prompt,children:"Arraste arquivos aqui ou clique para selecionar"})]})}const gi="tempest_wrapper_gzyTd",bi="tempest_icon_qVCyh",yi="tempest_title_xPfUf",vi="tempest_description_oWwH1",wi="tempest_action_dqxw1",Ye={wrapper:gi,icon:bi,title:yi,description:vi,action:wi};function xi({icon:e,title:t,description:n,action:s,className:r}){return o.jsxs("div",{className:x.cn(Ye.wrapper,r),children:[e&&o.jsx("div",{className:Ye.icon,children:e}),o.jsx("h4",{className:Ye.title,children:t}),n&&o.jsx("p",{className:Ye.description,children:n}),s&&o.jsx("div",{className:Ye.action,children:s})]})}const ji="tempest_wrapper_luRyF",$i="tempest_icon_dEdBl",ki="tempest_title_StutD",Ni="tempest_description_A2XCb",Si="tempest_action_vm1LC",Ve={wrapper:ji,icon:$i,title:ki,description:Ni,action:Si};function Ci({title:e="Algo deu errado",description:t="Não foi possível carregar essas informações.",onRetry:n,retryLabel:s="Tentar novamente",icon:r,className:a}){return o.jsxs("div",{className:x.cn(Ve.wrapper,a),children:[o.jsx("div",{className:Ve.icon,children:r??o.jsx(Ei,{})}),o.jsx("h4",{className:Ve.title,children:e}),t&&o.jsx("p",{className:Ve.description,children:t}),n&&o.jsx("div",{className:Ve.action,children:o.jsx(yt,{variant:"secondary",onClick:n,children:s})})]})}function Ei(){return o.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ti="tempest_wrapper_E0qHs",Mi="tempest_label_lbMkx",Ri="tempest_dropzone_jqua0",Li="tempest_active_CG9Uk",Di="tempest_disabled_WNUUl",Ii="tempest_icon_i9fGH",Pi="tempest_title_bTVFl",Ai="tempest_subtitle_S54OV",Fi="tempest_files_WljYm",Oi="tempest_file_Lp-dR",Bi="tempest_fileMeta_LTnN2",zi="tempest_remove_jskra",Wi="tempest_hidden_ReEq6",K={wrapper:Ti,label:Mi,dropzone:Ri,active:Li,disabled:Di,icon:Ii,title:Pi,subtitle:Ai,files:Fi,file:Oi,fileMeta:Bi,remove:zi,hidden:Wi};function qi(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function Ui(e,t){if(!t)return!0;const n=t.split(",").map(a=>a.trim().toLowerCase()),s=e.name.toLowerCase(),r=e.type.toLowerCase();return n.some(a=>a.startsWith(".")?s.endsWith(a):a.endsWith("/*")?r.startsWith(a.replace("/*","/")):r===a)}function Ki({value:e,onChange:t,label:n,accept:s,multiple:r=!1,maxSize:a,onReject:c,disabled:i,title:u="Arraste arquivos aqui ou clique para selecionar",subtitle:d,className:p}){const[m,f]=l.useState(!1),h=l.useRef(null);function _(g){const w=[],y=[];for(const S of Array.from(g)){if(!Ui(S,s)){y.push({file:S,reason:"type"});continue}if(a&&S.size>a){y.push({file:S,reason:"size"});continue}w.push(S)}if(y.length>0&&c?.(y),w.length===0)return;const j=r?[...e,...w]:w.slice(0,1);t(j)}function b(g){g.preventDefault(),f(!1),!i&&g.dataTransfer?.files&&_(g.dataTransfer.files)}function v(g){const w=e.slice();w.splice(g,1),t(w)}return o.jsxs("div",{className:x.cn(K.wrapper,p),children:[n&&o.jsx("label",{className:K.label,children:n}),o.jsxs("div",{className:x.cn(K.dropzone,m&&K.active,i&&K.disabled),role:"button",tabIndex:i?-1:0,onClick:()=>!i&&h.current?.click(),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),h.current?.click())},onDragEnter:g=>{g.preventDefault(),i||f(!0)},onDragOver:g=>g.preventDefault(),onDragLeave:()=>f(!1),onDrop:b,children:[o.jsx("div",{className:K.icon,"aria-hidden":!0,children:o.jsx(Hi,{})}),o.jsx("p",{className:K.title,children:u}),d&&o.jsx("p",{className:K.subtitle,children:d}),o.jsx("input",{ref:h,type:"file",accept:s,multiple:r,disabled:i,className:K.hidden,onChange:g=>{g.target.files&&_(g.target.files),g.target.value=""}})]}),e.length>0&&o.jsx("ul",{className:K.files,children:e.map((g,w)=>o.jsxs("li",{className:K.file,children:[o.jsxs("div",{children:[o.jsx("div",{children:g.name}),o.jsx("div",{className:K.fileMeta,children:qi(g.size)})]}),o.jsx("button",{type:"button","aria-label":`Remover ${g.name}`,className:K.remove,onClick:()=>v(w),children:"×"})]},`${g.name}-${w}`))})]})}function Hi(){return o.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4M4 20h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Gi="tempest_form_jNBDR",Ji="tempest_stack_O1Hl-",Qi="tempest_inline_LBQAv",Yi="tempest_grid_-B86T",Vi="tempest_section_HGqw3",Xi="tempest_sectionHeader_ji9hQ",Zi="tempest_sectionTitle_GTPwe",el="tempest_sectionDescription_KjW7k",tl="tempest_sectionBody_Vp2wz",nl="tempest_row_1EkVR",sl="tempest_actions_hK95I",rl="tempest_start_gXnm3",ol="tempest_center_mKkz4",al="tempest_end_O3yDQ",cl="tempest_between_tte2z",ae={form:Gi,stack:Ji,inline:Qi,grid:Yi,section:Vi,sectionHeader:Xi,sectionTitle:Zi,sectionDescription:el,sectionBody:tl,row:nl,actions:sl,start:rl,center:ol,end:al,between:cl};function jt(e,t){return e===void 0?`${t*4}px`:typeof e=="number"?`${e*4}px`:e}function Sn(e){return e===void 0?"repeat(2, minmax(0, 1fr))":typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}const il=l.forwardRef(function({layout:t="stack",columns:n,gap:s,className:r,style:a,children:c,...i},u){const d={gap:jt(s,4),...t==="grid"?{gridTemplateColumns:Sn(n)}:null,...a};return o.jsx("form",{ref:u,className:x.cn(ae.form,ae[t],r),style:d,...i,children:c})});function ll({title:e,description:t,layout:n="stack",columns:s,gap:r,className:a,style:c,children:i,...u}){const d={gap:jt(r,4),...n==="grid"?{gridTemplateColumns:Sn(s)}:null};return o.jsxs("section",{className:x.cn(ae.section,a),style:c,...u,children:[(e||t)&&o.jsxs("header",{className:ae.sectionHeader,children:[e&&o.jsx("h3",{className:ae.sectionTitle,children:e}),t&&o.jsx("p",{className:ae.sectionDescription,children:t})]}),o.jsx("div",{className:x.cn(ae.sectionBody,ae[n]),style:d,children:i})]})}function ul({gap:e,className:t,style:n,children:s,...r}){const a={gap:jt(e,3),...n};return o.jsx("div",{className:x.cn(ae.row,t),style:a,...r,children:s})}function dl({align:e="end",gap:t,className:n,style:s,children:r,...a}){const c={gap:jt(t,2),...s};return o.jsx("div",{className:x.cn(ae.actions,ae[e],n),style:c,...a,children:r})}const pl="tempest_container_fJfOt",ml="tempest_sm_k8D4-",fl="tempest_md_EnpYy",hl="tempest_lg_UU-Ig",_l="tempest_xl_2TEWj",gl="tempest_full_l8bvG",bl="tempest_stack_sxR8u",yl="tempest_vertical_2TMf5",vl="tempest_horizontal_r7-c-",wl="tempest_center_EDSAh",xl="tempest_start_ucQ-K",jl="tempest_end_pnKlF",$l="tempest_stretch_pX6l7",kl="tempest_justifyStart_lHYsS",Nl="tempest_justifyCenter_JH2m6",Sl="tempest_justifyEnd_EBisT",Cl="tempest_justifyBetween_mAJwT",El="tempest_wrap_-xxOh",Tl="tempest_grid_o-JIX",X={container:pl,sm:ml,md:fl,lg:hl,xl:_l,full:gl,stack:bl,vertical:yl,horizontal:vl,center:wl,start:xl,end:jl,stretch:$l,justifyStart:kl,justifyCenter:Nl,justifyEnd:Sl,justifyBetween:Cl,wrap:El,grid:Tl};function Ml({size:e="lg",className:t,children:n,...s}){return o.jsx("div",{className:x.cn(X.container,X[e],t),...s,children:n})}function Rl(e){return typeof e=="object"&&e!==null&&("mobile"in e||"tablet"in e||"desktop"in e)}function vt(e,t){if(e!==void 0)return Rl(e)?t==="desktop"?e.desktop??e.tablet??e.mobile:t==="tablet"?e.tablet??e.mobile??e.desktop:e.mobile??e.tablet??e.desktop:e}function Cn(e){if(e!==void 0)return typeof e=="number"?`${e*4}px`:e}function En(e,t){return e?"mobile":t?"tablet":"desktop"}function Ll({direction:e="vertical",gap:t=2,align:n,justify:s,wrap:r=!1,className:a,style:c,children:i,...u}){const{isMobile:d,isTablet:p}=Fe(),m=En(d,p),f=vt(e,m)??"vertical",_={gap:Cn(vt(t,m)),...c},b=s==="between"?X.justifyBetween:s==="center"?X.justifyCenter:s==="end"?X.justifyEnd:s==="start"?X.justifyStart:void 0;return o.jsx("div",{className:x.cn(X.stack,f==="vertical"?X.vertical:X.horizontal,n&&X[n],b,r&&X.wrap,a),style:_,...u,children:i})}function Dl(e){if(e!==void 0)return typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}function Il({columns:e=2,gap:t=4,className:n,style:s,children:r,...a}){const{isMobile:c,isTablet:i}=Fe(),u=En(c,i),d=Dl(vt(e,u)),p=Cn(vt(t,u));return o.jsx("div",{className:x.cn(X.grid,n),style:{gridTemplateColumns:d,gap:p,...s},...a,children:r})}const Pl="tempest_kbd_jgbYx",Al="tempest_sm_9WPWA",Fl="tempest_md_BePC0",Ol="tempest_lg_cBKum",Xt={kbd:Pl,sm:Al,md:Fl,lg:Ol};function Bl({size:e="md",className:t,children:n,...s}){return o.jsx("kbd",{className:x.cn(Xt.kbd,Xt[e],t),...s,children:n})}const zl="tempest_stack_zYzdv",Wl={stack:zl},Tn=l.createContext(null);function ql({children:e}){const[t,n]=l.useState([]),s=l.useRef(0),r=l.useCallback(()=>(s.current+=1,`modal-${s.current}`),[]),a=l.useCallback(p=>{n(m=>m.filter(f=>f.id!==p))},[]),c=l.useCallback(()=>{n([])},[]),i=l.useCallback(p=>{const m=r();return n(f=>[...f,{kind:"content",id:m,options:p}]),m},[r]),u=l.useCallback(p=>{const m=r();return n(f=>[...f,{kind:"confirm",id:m,options:p}]),m},[r]),d=l.useMemo(()=>({open:i,confirm:u,close:a,closeAll:c}),[i,u,a,c]);return o.jsxs(Tn.Provider,{value:d,children:[e,o.jsx("div",{className:Wl.stack,children:t.map(p=>p.kind==="content"?o.jsx(Ul,{entry:p,close:a},p.id):o.jsx(Kl,{entry:p,close:a},p.id))})]})}function Ul({entry:e,close:t}){const{options:n,id:s}=e,r=()=>{n.onClose?.(),t(s)};return o.jsx(Ut,{open:!0,onClose:r,title:n.title,size:n.size,closeOnBackdrop:n.closeOnBackdrop,closeOnEsc:n.closeOnEsc,hideCloseButton:n.hideCloseButton,children:n.children})}function Kl({entry:e,close:t}){const{options:n,id:s}=e,[r,a]=l.useState(!1),c=async()=>{try{a(!0),await n.onConfirm?.()}finally{a(!1),t(s)}},i=()=>{n.onCancel?.(),t(s)};return o.jsx(Nn,{open:!0,title:n.title??"",description:n.message,confirmLabel:n.confirmLabel,cancelLabel:n.cancelLabel,variant:n.danger?"danger":"primary",loading:r,onConfirm:c,onCancel:i})}function Hl(){const e=l.useContext(Tn);if(e===null)throw new Error("useModals must be used within a <ModalsProvider>");return e}const Gl="tempest_navbar_Ey25T",Jl="tempest_surface_xyKhM",Ql="tempest_primary_w3ft-",Yl="tempest_transparent_N1vMR",Vl="tempest_bordered_HD49R",Xl="tempest_sticky_0XsOs",Zl="tempest_logo_O9j3q",eu="tempest_nav_0oisE",tu="tempest_actions_8BNWJ",De={navbar:Gl,surface:Jl,primary:Ql,transparent:Yl,bordered:Vl,sticky:Xl,logo:Zl,nav:eu,actions:tu};function nu({logo:e,nav:t,actions:n,sticky:s=!0,tone:r="surface",bordered:a=!0,className:c,...i}){return o.jsxs("header",{className:x.cn(De.navbar,De[r],s&&De.sticky,a&&De.bordered,c),...i,children:[e&&o.jsx("div",{className:De.logo,children:e}),t&&o.jsx("nav",{className:De.nav,children:t}),n&&o.jsx("div",{className:De.actions,children:n})]})}const su="tempest_bar_zxTqx",ru={bar:su},ou=300,Zt=.9,au=300;function en(e){return e<0?0:e>1?1:e}function cu(){let e={value:0,active:!1};const t=new Set;let n=null,s=null;const r=()=>{for(const h of t)h(e)},a=h=>{e={...e,...h},r()},c=()=>{n!==null&&(clearInterval(n),n=null)},i=()=>{s!==null&&(clearTimeout(s),s=null)},u=h=>{const _=e.value;if(_>=Zt)return;const b=h??(1-_)*.1+.01;a({value:Math.min(en(_+b),Zt)})};return{start:()=>{i(),!e.active&&(a({active:!0,value:e.value>0?e.value:.08}),c(),n=setInterval(()=>u(),ou))},done:()=>{c(),i(),a({value:1,active:!0}),s=setTimeout(()=>{a({active:!1,value:0}),s=null},au)},set:h=>{i();const _=en(h);a({value:_,active:_<1?!0:e.active})},inc:u,subscribe:h=>(t.add(h),h(e),()=>{t.delete(h)})}}const Mn=cu();function iu({color:e,height:t=3,className:n}){const[s,r]=l.useState({value:0,active:!1});if(l.useEffect(()=>Mn.subscribe(r),[]),!s.active)return null;const a={width:`${Math.round(s.value*100)}%`,height:`${t}px`,background:e??"var(--tempest-primary)"};return o.jsx("div",{className:x.cn(ru.bar,n),style:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s.value*100)})}const lu="tempest_page_THNNc",uu="tempest_padded_bzjoF",du="tempest_header_PZEzk",pu="tempest_headerText_qYXFI",mu="tempest_eyebrow_651RV",fu="tempest_title_2oGnT",hu="tempest_description_YzmWl",_u="tempest_actions_-rB3U",gu="tempest_toolbar_sA7sD",bu="tempest_content_RCB4b",yu="tempest_footer_540pQ",te={page:lu,padded:uu,header:du,headerText:pu,eyebrow:mu,title:fu,description:hu,actions:_u,toolbar:gu,content:bu,footer:yu};function vu({title:e,eyebrow:t,description:n,actions:s,toolbar:r,footer:a,padded:c=!0,className:i,children:u,...d}){const p=e||t||n||s;return o.jsxs("main",{className:x.cn(te.page,c&&te.padded,i),...d,children:[p&&o.jsxs("header",{className:te.header,children:[o.jsxs("div",{className:te.headerText,children:[t&&o.jsx("div",{className:te.eyebrow,children:t}),e&&o.jsx("h1",{className:te.title,children:e}),n&&o.jsx("p",{className:te.description,children:n})]}),s&&o.jsx("div",{className:te.actions,children:s})]}),r&&o.jsx("div",{className:te.toolbar,children:r}),o.jsx("div",{className:te.content,children:u}),a&&o.jsx("footer",{className:te.footer,children:a})]})}const wu="tempest_wrapper_cRGQm",xu="tempest_controls_fdL-y",ju="tempest_page_WjG0l",$u="tempest_active_1kqsJ",ku="tempest_ellipsis_V294k",Nu="tempest_sizeSelect_ZayTo",Su="tempest_numeric_ztI0I",Cu="tempest_summary_ZTggV",ne={wrapper:wu,controls:xu,page:ju,active:$u,ellipsis:ku,sizeSelect:Nu,numeric:Su,summary:Cu};function Eu(e,t,n){const s=n+4;if(t<=s)return Array.from({length:t},(i,u)=>u+1);const r=Math.max(2,e-Math.floor(n/2)),a=Math.min(t-1,r+n-1),c=[1];r>2&&c.push("...");for(let i=r;i<=a;i++)c.push(i);return a<t-1&&c.push("..."),c.push(t),c}function Rn({page:e,totalPages:t,onPageChange:n,pageSize:s,onPageSizeChange:r,pageSizeOptions:a=[10,25,50,100],totalItems:c,siblingCount:i=3,className:u}){const d=l.useMemo(()=>Eu(e,t,i),[e,t,i]);return t<=1&&!r?null:o.jsxs("div",{className:x.cn(ne.wrapper,u),children:[o.jsx("div",{className:ne.summary,children:typeof c=="number"?`${c} resultado${c===1?"":"s"}`:`Página ${e} de ${t}`}),o.jsxs("div",{className:ne.controls,children:[o.jsx("button",{type:"button",className:ne.page,onClick:()=>n(Math.max(1,e-1)),disabled:e<=1,"aria-label":"Página anterior",children:"‹"}),d.map((p,m)=>p==="..."?o.jsx("span",{className:x.cn(ne.ellipsis,ne.numeric),children:"…"},`ellipsis-${m}`):o.jsx("button",{type:"button",className:x.cn(ne.page,ne.numeric,p===e&&ne.active),onClick:()=>n(p),"aria-current":p===e?"page":void 0,children:p},p)),o.jsx("button",{type:"button",className:ne.page,onClick:()=>n(Math.min(t,e+1)),disabled:e>=t,"aria-label":"Próxima página",children:"›"}),r&&o.jsx("select",{className:ne.sizeSelect,value:s,onChange:p=>r(Number(p.target.value)),"aria-label":"Itens por página",children:a.map(p=>o.jsxs("option",{value:p,children:[p," / página"]},p))})]})]})}const Tu="tempest_wrapper_zEU-L",Mu="tempest_label_ps3gD",Ru="tempest_field_7taZG",Lu="tempest_input_FWEvb",Du="tempest_sm_3-CZz",Iu="tempest_md_ReV0O",Pu="tempest_lg_DiTiB",Au="tempest_toggle_WNeX9",Fu="tempest_error_QdIFf",Ou="tempest_helper_mBUna",Bu="tempest_errorText_73Uvv",zu="tempest_strength_i6RaQ",Wu="tempest_strengthBar_PAPHR",qu="tempest_strengthLabel_u9QHS",Uu="tempest_level0_n6tWv",Ku="tempest_level1_FOI93",Hu="tempest_level2_q5Wii",Gu="tempest_level3_BpB53",Ju="tempest_level4_vyQ3x",H={wrapper:Tu,label:Mu,field:Ru,input:Lu,sm:Du,md:Iu,lg:Pu,toggle:Au,error:Fu,helper:Ou,errorText:Bu,strength:zu,strengthBar:Wu,strengthLabel:qu,level0:Uu,level1:Ku,level2:Hu,level3:Gu,level4:Ju},Qu=["Muito fraca","Fraca","Razoável","Forte","Excelente"];function Ln(e){if(!e)return 0;let t=0;return e.length>=8&&(t+=1),e.length>=12&&(t+=1),/[a-z]/.test(e)&&/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[^A-Za-z0-9]/.test(e)&&(t+=1),Math.min(4,t)}const Yu=l.forwardRef(function({label:t,helperText:n,error:s,size:r="md",showStrength:a=!1,strength:c,strengthLabels:i=Qu,toggleLabels:u={show:"Mostrar senha",hide:"Esconder senha"},className:d,value:p,defaultValue:m,...f},h){const[_,b]=l.useState(!1),v=String(p??m??""),g=c??Ln(v);return o.jsxs("div",{className:x.cn(H.wrapper,H[r],s&&H.error,d),children:[t&&o.jsx("label",{className:H.label,children:t}),o.jsxs("div",{className:H.field,children:[o.jsx("input",{ref:h,...f,value:p,defaultValue:m,type:_?"text":"password","aria-invalid":!!s,className:H.input}),o.jsx("button",{type:"button",className:H.toggle,"aria-label":_?u.hide:u.show,"aria-pressed":_,onClick:()=>b(w=>!w),children:_?"🙈":"👁"})]}),a&&o.jsxs("div",{className:x.cn(H.strength,H[`level${g}`]),"aria-label":i[g],children:[o.jsx("div",{className:H.strengthBar,children:o.jsx("span",{style:{width:`${g/4*100}%`}})}),o.jsx("span",{className:H.strengthLabel,children:i[g]})]}),s?o.jsx("span",{className:H.errorText,children:s}):n?o.jsx("span",{className:H.helper,children:n}):null]})}),Vu="tempest_wrapper_3WAh7",Xu="tempest_label_Hk01i",Zu="tempest_cells_URO3v",ed="tempest_cell_fxLzs",td="tempest_sm_SQM-s",nd="tempest_md_aHCGl",sd="tempest_lg_JpI4A",rd="tempest_error_Kou0o",od="tempest_helper_W04iL",ad="tempest_errorText_h4svq",ke={wrapper:Vu,label:Xu,cells:Zu,cell:ed,sm:td,md:nd,lg:sd,error:rd,helper:od,errorText:ad},cd=/[0-9]/,id=/[A-Za-z0-9]/,ld=l.forwardRef(function({length:t=6,type:n="numeric",size:s="md",value:r,defaultValue:a,onChange:c,onComplete:i,masked:u=!1,label:d,helperText:p,error:m,disabled:f=!1,autoFocus:h=!1,id:_,className:b},v){const g=l.useId(),w=_??g,y=r!==void 0,[j,S]=l.useState(a??""),M=y?r??"":j,T=Array.from({length:t},(L,R)=>M[R]??""),N=l.useRef([]),k=n==="numeric"?cd:id;l.useEffect(()=>{h&&N.current[0]?.focus()},[h]);const E=L=>{const R=L.slice(0,t);y||S(R),c?.(R),R.length===t&&i?.(R)},D=L=>{const R=Math.max(0,Math.min(t-1,L));N.current[R]?.focus(),N.current[R]?.select()},$=L=>R=>{const q=R.target.value.slice(-1);if(q&&!k.test(q))return;const at=T.slice();at[L]=q,E(at.join("")),q&&D(L+1)},C=L=>R=>{if(R.key==="Backspace"){if(!T[L]&&L>0){R.preventDefault();const q=T.slice();q[L-1]="",E(q.join("")),D(L-1)}}else R.key==="ArrowLeft"?(R.preventDefault(),D(L-1)):R.key==="ArrowRight"&&(R.preventDefault(),D(L+1))},F=L=>{const R=L.clipboardData.getData("text").split("").filter(q=>k.test(q)).join("");R&&(L.preventDefault(),E(R),D(Math.min(t-1,R.length)))};return o.jsxs("div",{ref:v,className:x.cn(ke.wrapper,m&&ke.error,b),id:w,children:[d&&o.jsx("label",{className:ke.label,children:d}),o.jsx("div",{className:x.cn(ke.cells,ke[s]),role:"group","aria-label":d,children:T.map((L,R)=>o.jsx("input",{ref:q=>{N.current[R]=q},type:u?"password":"text",inputMode:n==="numeric"?"numeric":"text",autoComplete:R===0?"one-time-code":"off",maxLength:1,value:L,disabled:f,className:ke.cell,"aria-label":`Dígito ${R+1}`,"aria-invalid":!!m,onChange:$(R),onKeyDown:C(R),onPaste:F},R))}),m?o.jsx("span",{className:ke.errorText,children:m}):p?o.jsx("span",{className:ke.helper,children:p}):null]})}),ud="tempest_root_vEMon",dd="tempest_popover_E9K9X",pd="tempest_tempest-popover-in_W8miP",md="tempest_top_TYlrh",fd="tempest_bottom_wGs70",hd="tempest_left_h7fCr",_d="tempest_right_--bJW",kt={root:ud,popover:dd,tempestPopoverIn:pd,top:md,bottom:fd,left:hd,right:_d};function gd({trigger:e,children:t,placement:n="bottom",open:s,onOpenChange:r,defaultOpen:a=!1,closeOnEsc:c=!0,closeOnOutsideClick:i=!0,className:u}){const d=s!==void 0,[p,m]=l.useState(a),f=d?s:p,h=l.useId(),_=l.useRef(null),b=l.useCallback(w=>{d||m(w),r?.(w)},[d,r]);l.useEffect(()=>{if(!f)return;const w=j=>{c&&j.key==="Escape"&&b(!1)},y=j=>{i&&_.current&&!_.current.contains(j.target)&&b(!1)};return window.addEventListener("keydown",w),window.addEventListener("mousedown",y),()=>{window.removeEventListener("keydown",w),window.removeEventListener("mousedown",y)}},[f,c,i,b]);const v=w=>{e.props.onClick?.(w),b(!f)},g={...e,props:{...e.props,onClick:v,"aria-expanded":f,"aria-controls":h}};return o.jsxs("span",{ref:_,className:kt.root,children:[g,f&&o.jsx("div",{id:h,role:"dialog",className:x.cn(kt.popover,kt[n],u),children:t})]})}const bd="tempest_wrapper_BQek1",yd="tempest_bar_uC-0x",vd="tempest_fill_vmg7x",wd="tempest_success_gWJ8U",xd="tempest_warning_DGkPO",jd="tempest_danger_gfwHh",$d="tempest_indeterminate_HojUj",kd="tempest_tempest-progress-loop_0nEdF",Nd="tempest_label_qqHJM",Be={wrapper:bd,bar:yd,fill:vd,success:wd,warning:xd,danger:jd,indeterminate:$d,tempestProgressLoop:kd,label:Nd};function Sd({value:e=0,max:t=100,variant:n="primary",indeterminate:s=!1,showLabel:r=!1,label:a,className:c}){const i=s?0:Math.max(0,Math.min(100,e/t*100));return o.jsxs("div",{className:x.cn(Be.wrapper,c),children:[(r||a)&&o.jsxs("div",{className:Be.label,children:[a&&o.jsx("span",{children:a}),r&&!s&&o.jsxs("span",{children:[Math.round(i),"%"]})]}),o.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:e,className:x.cn(Be.bar,s&&Be.indeterminate),children:o.jsx("div",{className:x.cn(Be.fill,n!=="primary"&&Be[n]),style:{width:s?void 0:`${i}%`}})})]})}const Cd="tempest_wrapper_P-gFm",Ed="tempest_disabled_0-cna",Td="tempest_input_7R8ZN",Md="tempest_dot_P7ejP",Rd="tempest_labelWrap_iQ1HR",Ld="tempest_label_vAFIP",Dd="tempest_description_bEB8u",Id="tempest_group_oi329",Pd="tempest_horizontal_1Ovgu",je={wrapper:Cd,disabled:Ed,input:Td,dot:Md,labelWrap:Rd,label:Ld,description:Dd,group:Id,horizontal:Pd},Dn=l.createContext(null),Ad=l.forwardRef(function({label:t,description:n,value:s,disabled:r,name:a,checked:c,onChange:i,wrapperClassName:u,className:d,...p},m){const f=l.useContext(Dn),h=f?.name??a,_=f?.disabled??r,b=f?f.value===s:c;function v(g){f&&f.onChange?.(s),i?.(g)}return o.jsxs("label",{className:x.cn(je.wrapper,_&&je.disabled,u),children:[o.jsx("input",{ref:m,type:"radio",name:h,value:s,checked:b,disabled:_,onChange:v,className:x.cn(je.input,d),...p}),o.jsx("span",{className:je.dot,"aria-hidden":!0}),(t||n)&&o.jsxs("span",{className:je.labelWrap,children:[t&&o.jsx("span",{className:je.label,children:t}),n&&o.jsx("span",{className:je.description,children:n})]})]})});function Fd({value:e,defaultValue:t,onChange:n,name:s,disabled:r,horizontal:a=!1,className:c,children:i}){const u=l.useId(),d=s??u,[p,m]=l.useState(t),f=e!==void 0,h=f?e:p;function _(b){f||m(b),n?.(b)}return o.jsx(Dn.Provider,{value:{name:d,value:h,onChange:_,disabled:r},children:o.jsx("div",{role:"radiogroup",className:x.cn(je.group,a&&je.horizontal,c),children:i})})}const Od="tempest_wrapper_o1aOo",Bd="tempest_label_jaBOA",zd="tempest_value_GKfOu",Wd="tempest_field_YxCzt",qd="tempest_track_j-2iy",Ud="tempest_fill_1pbqj",Kd="tempest_input_1MASw",Hd="tempest_helper_uqxKu",ge={wrapper:Od,label:Bd,value:zd,field:Wd,track:qd,fill:Ud,input:Kd,helper:Hd};function Gd({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:a,helperText:c,disabled:i=!1,formatValue:u,className:d}){const[p,m]=e,f=s-n,h=l.useMemo(()=>(p-n)/f*100,[p,n,f]),_=l.useMemo(()=>(m-n)/f*100,[m,n,f]),b=u?.(e)??`${p} – ${m}`,v=l.useCallback(w=>{const y=Math.min(Number(w.target.value),m);t([y,m])},[m,t]),g=l.useCallback(w=>{const y=Math.max(Number(w.target.value),p);t([p,y])},[p,t]);return o.jsxs("div",{className:x.cn(ge.wrapper,d),children:[a&&o.jsxs("div",{className:ge.label,children:[o.jsx("span",{children:a}),o.jsx("span",{className:ge.value,children:b})]}),o.jsxs("div",{className:ge.field,children:[o.jsx("div",{className:ge.track}),o.jsx("div",{className:ge.fill,style:{left:`${h}%`,right:`${100-_}%`}}),o.jsx("input",{type:"range",className:ge.input,min:n,max:s,step:r,value:p,onChange:v,disabled:i,"aria-label":a?`${a} (mínimo)`:"Mínimo"}),o.jsx("input",{type:"range",className:ge.input,min:n,max:s,step:r,value:m,onChange:g,disabled:i,"aria-label":a?`${a} (máximo)`:"Máximo"})]}),c&&o.jsx("span",{className:ge.helper,children:c})]})}const Jd="tempest_wrapper_K9Mqa",Qd="tempest_star_goIGS",Yd="tempest_filled_mMs-d",Vd="tempest_disabled_tyUlQ",Xd="tempest_readonly_bnKLN",Zd="tempest_sm_K7-y9",ep="tempest_md_ex2Tb",tp="tempest_lg_TstLJ",ze={wrapper:Jd,star:Qd,filled:Yd,disabled:Vd,readonly:Xd,sm:Zd,md:ep,lg:tp};function np({value:e,max:t=5,onChange:n,size:s="md",readonly:r=!1,disabled:a=!1,label:c="Avaliação",className:i}){const[u,d]=l.useState(0),p=u>0?u:e,m=f=>{r||a||n?.(f)};return o.jsx("span",{role:"radiogroup","aria-label":c,className:x.cn(ze.wrapper,ze[s],a&&ze.disabled,r&&ze.readonly,i),onMouseLeave:()=>d(0),children:Array.from({length:t},(f,h)=>{const _=h+1,b=_<=p;return o.jsx("button",{type:"button",role:"radio","aria-checked":e===_,"aria-label":`${_} ${_===1?"estrela":"estrelas"}`,className:x.cn(ze.star,b&&ze.filled),disabled:a,onMouseEnter:()=>!r&&!a&&d(_),onClick:()=>m(_),children:o.jsx(sp,{filled:b})},_)})})}function sp({filled:e}){return o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14 2 9.27l6.91-1.01L12 2z"})})}function In(e,t,n,s,r){return s?(Array.isArray(s)?s:[s]).includes(e):!(t&&!r.above(t)||n&&!r.below(n))}function rp({above:e,below:t,only:n,children:s}){const r=Fe();return In(r.current,e,t,n,r)?s:null}function op({above:e,below:t,only:n,children:s}){const r=Fe();return In(r.current,e,t,n,r)?null:s}const ap="tempest_safe_iqDFY",cp="tempest_inline_V9eMG",ip="tempest_top_Xse9E",lp="tempest_right_GZm9b",up="tempest_bottom_kkyD7",dp="tempest_left_Z4Q72",We={safe:ap,inline:cp,top:ip,right:lp,bottom:up,left:dp},pp=["top","right","bottom","left"];function mp({edges:e=pp,inline:t=!1,className:n,children:s,...r}){return o.jsx("div",{className:x.cn(We.safe,t&&We.inline,e.includes("top")&&We.top,e.includes("right")&&We.right,e.includes("bottom")&&We.bottom,e.includes("left")&&We.left,n),"data-edges":e.join(" "),...r,children:s})}const fp="tempest_wrapper_dKXJJ",hp="tempest_input_m0lPc",_p="tempest_iconLeft_030-U",gp="tempest_clear_nb6lG",ct={wrapper:fp,input:hp,iconLeft:_p,clear:gp},Pn=l.forwardRef(function({value:t,onChange:n,onClear:s,wrapperClassName:r,placeholder:a="Buscar...",className:c,...i},u){function d(){n(""),s?.()}return o.jsxs("div",{className:x.cn(ct.wrapper,r),children:[o.jsx("span",{className:ct.iconLeft,"aria-hidden":!0,children:o.jsx(bp,{})}),o.jsx("input",{ref:u,type:"search",value:t,onChange:p=>n(p.target.value),placeholder:a,className:x.cn(ct.input,c),...i}),t&&o.jsx("button",{type:"button",className:ct.clear,"aria-label":"Limpar busca",onClick:d,children:o.jsx(yp,{})})]})});function bp(){return o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function yp(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const vp="tempest_group_mYyFC",wp="tempest_fullWidth_unSMm",xp="tempest_segment_cu-EL",jp="tempest_sm_CfD41",$p="tempest_md_2ixuM",kp="tempest_lg_2Kt7-",Np="tempest_active_GmyKg",Sp="tempest_icon_9h6GK",Cp="tempest_label_mS17q",Ie={group:vp,fullWidth:wp,segment:xp,sm:jp,md:$p,lg:kp,active:Np,icon:Sp,label:Cp};function Ep({options:e,value:t,onChange:n,size:s="md",fullWidth:r=!1,className:a,"aria-label":c,...i}){return o.jsx("div",{role:"radiogroup","aria-label":c,className:x.cn(Ie.group,Ie[s],r&&Ie.fullWidth,a),...i,children:e.map(u=>{const d=u.value===t;return o.jsxs("button",{type:"button",role:"radio","aria-checked":d,disabled:u.disabled,className:x.cn(Ie.segment,d&&Ie.active),onClick:()=>n(u.value),children:[u.icon&&o.jsx("span",{className:Ie.icon,children:u.icon}),o.jsx("span",{className:Ie.label,children:u.label})]},u.value)})})}const Tp="tempest_wrapper_KS2K3",Mp="tempest_label_Lmgos",Rp="tempest_required_PvDVJ",Lp="tempest_field_h-wBy",Dp="tempest_select_cjdcr",Ip="tempest_caret_MdCao",Pp="tempest_error_sw9MU",Ap="tempest_helper_frosK",Fp="tempest_errorText_-zd6i",be={wrapper:Tp,label:Mp,required:Rp,field:Lp,select:Dp,caret:Ip,error:Pp,helper:Ap,errorText:Fp},Op=l.forwardRef(function({label:t,helperText:n,error:s,options:r,placeholder:a,wrapperClassName:c,className:i,children:u,id:d,required:p,...m},f){const h=l.useId(),_=d??h;return o.jsxs("div",{className:x.cn(be.wrapper,s&&be.error,c),children:[t&&o.jsxs("label",{htmlFor:_,className:be.label,children:[t,p&&o.jsx("span",{className:be.required,children:"*"})]}),o.jsxs("div",{className:be.field,children:[o.jsxs("select",{ref:f,id:_,"aria-invalid":!!s,required:p,className:x.cn(be.select,i),...m,children:[a&&o.jsx("option",{value:"",disabled:!0,hidden:!0,children:a}),r?.map(b=>o.jsx("option",{value:b.value,disabled:b.disabled,children:b.label},b.value)),u]}),o.jsx("span",{className:be.caret,"aria-hidden":!0,children:o.jsx(Bp,{})})]}),s?o.jsx("span",{className:be.errorText,children:s}):n?o.jsx("span",{className:be.helper,children:n}):null]})});function Bp(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const zp="tempest_sidebar_UB1qz",Wp="tempest_header_zupoS",qp="tempest_nav_aLYuL",Up="tempest_item_IAjHb",Kp="tempest_collapsed_ZbZYA",Hp="tempest_active_BgcFy",Gp="tempest_icon_UQswn",Jp="tempest_label_TPvJ9",Qp="tempest_badge_xwEZv",Yp="tempest_footer_TyRyi",le={sidebar:zp,header:Wp,nav:qp,item:Up,collapsed:Kp,active:Hp,icon:Gp,label:Jp,badge:Qp,footer:Yp};function Vp({header:e,items:t,value:n,onChange:s,footer:r,collapsed:a=!1,width:c=240,collapsedWidth:i=64,className:u,style:d,...p}){const m=typeof(a?i:c)=="number"?`${a?i:c}px`:a?i:c;return o.jsxs("aside",{className:x.cn(le.sidebar,a&&le.collapsed,u),style:{width:m,...d},...p,children:[e&&o.jsx("div",{className:le.header,children:e}),o.jsx("nav",{className:le.nav,"aria-label":"Navegação lateral",children:t.map(f=>{const h=f.key===n;return o.jsxs("button",{type:"button",className:x.cn(le.item,h&&le.active),"aria-current":h?"page":void 0,disabled:f.disabled,onClick:()=>s?.(f.key),title:a&&typeof f.label=="string"?f.label:void 0,children:[f.icon&&o.jsx("span",{className:le.icon,children:f.icon}),!a&&o.jsx("span",{className:le.label,children:f.label}),!a&&f.badge!==void 0&&o.jsx("span",{className:le.badge,children:f.badge})]},f.key)})}),r&&o.jsx("div",{className:le.footer,children:r})]})}const Xp="tempest_skeleton_CB4uF",Zp="tempest_text_-A8IF",em="tempest_circle_DYcl8",Nt={skeleton:Xp,text:Zp,circle:em};function tm({variant:e="rect",width:t,height:n,className:s,style:r}){return o.jsx("span",{"aria-hidden":!0,className:x.cn(Nt.skeleton,e==="text"&&Nt.text,e==="circle"&&Nt.circle,s),style:{width:t,height:n,...r}})}const nm="tempest_spacer_okdOd",sm="tempest_both_85qSF",rm="tempest_x_QiU2B",om="tempest_y_hTtCp",tn={spacer:nm,both:sm,x:rm,y:om};function am({axis:e="both",className:t,...n}){return o.jsx("div",{className:x.cn(tn.spacer,tn[e],t),...n})}const cm="tempest_spinner_GpFZS",im="tempest_tempest-spinner_wKVCY",lm="tempest_xs_p8BFI",um="tempest_sm_3sIoD",dm="tempest_md_M2sPj",pm="tempest_lg_IxTw2",mm="tempest_xl_cgwqq",nn={spinner:cm,tempestSpinner:im,xs:lm,sm:um,md:dm,lg:pm,xl:mm};function An({size:e="md",className:t,label:n="Carregando"}){return o.jsx("span",{role:"status","aria-label":n,className:x.cn(nn.spinner,nn[e],t)})}const fm="tempest_stat_zoo9y",hm="tempest_header_3UQqq",_m="tempest_icon_zUG3e",gm="tempest_label_lIH47",bm="tempest_row_Ifyts",ym="tempest_value_JBWnr",vm="tempest_delta_mRVrE",wm="tempest_up_7qgUO",xm="tempest_down_3Rq2Z",jm="tempest_flat_R5pZT",$m="tempest_hint_YkTF8",se={stat:fm,header:hm,icon:_m,label:gm,row:bm,value:ym,delta:vm,up:wm,down:xm,flat:jm,hint:$m};function km(e){if(typeof e!="string")return;const t=e.trim();if(t.startsWith("+"))return"up";if(t.startsWith("-")||t.startsWith("−"))return"down"}function Nm({label:e,value:t,delta:n,trend:s,hint:r,icon:a,className:c,...i}){const u=s??km(n);return o.jsxs("div",{className:x.cn(se.stat,c),...i,children:[o.jsxs("div",{className:se.header,children:[a&&o.jsx("span",{className:se.icon,children:a}),o.jsx("span",{className:se.label,children:e})]}),o.jsxs("div",{className:se.row,children:[o.jsx("span",{className:se.value,children:t}),n!==void 0&&o.jsx("span",{className:x.cn(se.delta,u==="up"&&se.up,u==="down"&&se.down,u==="flat"&&se.flat),children:n})]}),r&&o.jsx("p",{className:se.hint,children:r})]})}const Sm="tempest_stepper_w3qjQ",Cm="tempest_vertical_d4mOs",Em="tempest_step_s2nqL",Tm="tempest_dot_d1bSL",Mm="tempest_completed_gcFHM",Rm="tempest_active_kL-CH",Lm="tempest_label_8irAI",Dm="tempest_connector_lyeWp",ye={stepper:Sm,vertical:Cm,step:Em,dot:Tm,completed:Mm,active:Rm,label:Lm,connector:Dm};function Im({steps:e,current:t,orientation:n="horizontal",className:s}){return o.jsx("ol",{className:x.cn(ye.stepper,n==="vertical"&&ye.vertical,s),children:e.map((r,a)=>{const c=a<t,i=a===t;return o.jsxs(l.Fragment,{children:[o.jsxs("li",{className:x.cn(ye.step,c&&ye.completed,i&&ye.active),"aria-current":i?"step":void 0,children:[o.jsx("span",{className:ye.dot,children:c?"✓":a+1}),o.jsx("span",{className:ye.label,children:r.label})]}),a<e.length-1&&o.jsx("span",{className:x.cn(ye.connector,c&&ye.completed),"aria-hidden":!0})]},a)})})}function At(e,t,n){if(Number.isNaN(e))return e;if(t>n){const s=t;t=n,n=s}return e<t?t:e>n?n:e}function Pm(e,t=1){if(e===0)return"0 B";const n=["B","KB","MB","GB","TB"],s=1024,r=Math.min(Math.floor(Math.log(Math.abs(e))/Math.log(s)),n.length-1),a=e/s**r,c=r===0?0:Math.max(0,t);return`${parseFloat(a.toFixed(c)).toString()} ${n[r]}`}function Am(e,t="en-US"){return new Intl.NumberFormat(t,{notation:"compact",maximumFractionDigits:1}).format(e)}const Fm="tempest_wrapper_JNjXK",Om="tempest_label_9XKNm",Bm="tempest_row_cOARX",zm="tempest_sm_RzVSU",Wm="tempest_md_pezRm",qm="tempest_lg_kYbIN",Um="tempest_disabled_vqmo2",Km="tempest_btn_xuHhj",Hm="tempest_value_NEatO",Ne={wrapper:Fm,label:Om,row:Bm,sm:zm,md:Wm,lg:qm,disabled:Um,btn:Km,value:Hm},Gm=l.forwardRef(function({value:t,onChange:n,min:s=0,max:r=Number.POSITIVE_INFINITY,step:a=1,size:c="md",disabled:i=!1,label:u,format:d,labels:p={decrement:"Diminuir",increment:"Aumentar"},className:m},f){const h=()=>{i||n(At(t-a,s,r))},_=()=>{i||n(At(t+a,s,r))},b=d?d(t):String(t),v=!i&&t>s,g=!i&&t<r;return o.jsxs("div",{ref:f,className:x.cn(Ne.wrapper,m),children:[u&&o.jsx("label",{className:Ne.label,children:u}),o.jsxs("div",{className:x.cn(Ne.row,Ne[c],i&&Ne.disabled),children:[o.jsx("button",{type:"button",className:Ne.btn,"aria-label":p.decrement,onClick:h,disabled:!v,children:"−"}),o.jsx("span",{className:Ne.value,role:"status","aria-live":"polite",children:b}),o.jsx("button",{type:"button",className:Ne.btn,"aria-label":p.increment,onClick:_,disabled:!g,children:"+"})]})]})}),Jm="tempest_wrapper_kudO9",Qm="tempest_disabled_2aZ0V",Ym="tempest_input_5BPNu",Vm="tempest_track_7ObdZ",Xm="tempest_thumb_-FTeK",Zm="tempest_label_LrH7V",qe={wrapper:Jm,disabled:Qm,input:Ym,track:Vm,thumb:Xm,label:Zm},ef=l.forwardRef(function({label:t,disabled:n,wrapperClassName:s,className:r,...a},c){return o.jsxs("label",{className:x.cn(qe.wrapper,n&&qe.disabled,s),children:[o.jsx("input",{ref:c,type:"checkbox",role:"switch",disabled:n,className:x.cn(qe.input,r),...a}),o.jsx("span",{className:qe.track,"aria-hidden":!0,children:o.jsx("span",{className:qe.thumb})}),t&&o.jsx("span",{className:qe.label,children:t})]})}),tf="tempest_tag_16VPH",nf="tempest_sm_pzyd5",sf="tempest_md_GL6tQ",rf="tempest_lg_8tgXU",of="tempest_neutral_jAd-x",af="tempest_primary_AXKlN",cf="tempest_success_56lz4",lf="tempest_warning_UK7SC",uf="tempest_danger_kJ-yx",df="tempest_info_hmHE-",pf="tempest_label_ZBPfO",mf="tempest_remove_UEwgr",Xe={tag:tf,sm:nf,md:sf,lg:rf,neutral:of,primary:af,success:cf,warning:lf,danger:uf,info:df,label:pf,remove:mf};function ff({variant:e="neutral",size:t="md",onRemove:n,removeLabel:s="Remover",className:r,children:a,...c}){return o.jsxs("span",{className:x.cn(Xe.tag,Xe[e],Xe[t],r),...c,children:[o.jsx("span",{className:Xe.label,children:a}),n&&o.jsx("button",{type:"button",className:Xe.remove,"aria-label":s,onClick:n,children:"×"})]})}const hf="tempest_scroll_unrJp",_f="tempest_table_Dkosn",gf="tempest_th_PNuEx",bf="tempest_td_jv9tA",yf="tempest_tr_7UG8J",vf="tempest_clickable_B6Si-",wf="tempest_alignRight_9hY0G",xf="tempest_alignCenter_YiUQy",jf="tempest_emptyRow_kdMiv",$f="tempest_priorityTablet_3alUt",kf="tempest_priorityDesktop_3f8Fq",Nf="tempest_stackable_heix7",Sf="tempest_stackableHead_mKGcA",Cf="tempest_stackableRow_qPNqc",B={scroll:hf,table:_f,th:gf,td:bf,tr:yf,clickable:vf,alignRight:wf,alignCenter:xf,emptyRow:jf,priorityTablet:$f,priorityDesktop:kf,stackable:Nf,stackableHead:Sf,stackableRow:Cf};function sn(e){if(e==="tablet")return B.priorityTablet;if(e==="desktop")return B.priorityDesktop}function Fn({columns:e,data:t,rowKey:n,onRowClick:s,emptyMessage:r="Nenhum registro encontrado.",className:a,stackOnMobile:c=!1}){return o.jsx("div",{className:x.cn(B.scroll,c&&B.stackable,a),children:o.jsxs("table",{className:B.table,children:[o.jsx("thead",{className:x.cn(c&&B.stackableHead),children:o.jsx("tr",{children:e.map(i=>o.jsx("th",{className:x.cn(B.th,i.align==="right"&&B.alignRight,i.align==="center"&&B.alignCenter,sn(i.priority)),style:{width:i.width},children:i.header},i.key))})}),o.jsx("tbody",{children:t.length===0?o.jsx("tr",{children:o.jsx("td",{className:B.emptyRow,colSpan:e.length,children:r})}):t.map((i,u)=>o.jsx("tr",{className:x.cn(B.tr,s&&B.clickable,c&&B.stackableRow),onClick:s?()=>s(i):void 0,children:e.map(d=>{const p=d.render?d.render(i,u):i[d.key];return o.jsx("td",{className:x.cn(B.td,d.align==="right"&&B.alignRight,d.align==="center"&&B.alignCenter,sn(d.priority),d.className),"data-label":typeof d.header=="string"?d.header:void 0,children:p},d.key)})},n(i,u)))})]})})}const Ef="tempest_tablist_WR6ag",Tf="tempest_tab_IdDYc",Mf="tempest_active_PTNtG",Rf="tempest_panel_08i9c",Lf="tempest_pill_lGuqn",Ze={tablist:Ef,tab:Tf,active:Mf,panel:Rf,pill:Lf};function Df({items:e,defaultId:t,activeId:n,onChange:s,variant:r="underline",className:a}){const c=e.find(h=>!h.disabled),[i,u]=l.useState(t??c?.id),d=n!==void 0,p=d?n:i,m=e.find(h=>h.id===p)??c;function f(h){d||u(h),s?.(h)}return o.jsxs("div",{className:a,children:[o.jsx("div",{role:"tablist",className:x.cn(Ze.tablist,r==="pill"&&Ze.pill),children:e.map(h=>{const _=h.id===m?.id;return o.jsx("button",{type:"button",role:"tab","aria-selected":_,"aria-controls":`panel-${h.id}`,id:`tab-${h.id}`,disabled:h.disabled,className:x.cn(Ze.tab,_&&Ze.active),onClick:()=>f(h.id),children:h.label},h.id)})}),m&&o.jsx("div",{role:"tabpanel",id:`panel-${m.id}`,"aria-labelledby":`tab-${m.id}`,className:Ze.panel,children:m.content})]})}const If="tempest_wrapper_C0gfg",Pf="tempest_label_cWLXP",Af="tempest_required_rDZXE",Ff="tempest_textarea_Z-y6g",Of="tempest_error_NWC9f",Bf="tempest_helper_gedut",zf="tempest_errorText_ey07q",Pe={wrapper:If,label:Pf,required:Af,textarea:Ff,error:Of,helper:Bf,errorText:zf},Wf=l.forwardRef(function({label:t,helperText:n,error:s,wrapperClassName:r,className:a,id:c,required:i,...u},d){const p=l.useId(),m=c??p;return o.jsxs("div",{className:x.cn(Pe.wrapper,s&&Pe.error,r),children:[t&&o.jsxs("label",{htmlFor:m,className:Pe.label,children:[t,i&&o.jsx("span",{className:Pe.required,children:"*"})]}),o.jsx("textarea",{ref:d,id:m,"aria-invalid":!!s,required:i,className:x.cn(Pe.textarea,a),...u}),s?o.jsx("span",{className:Pe.errorText,children:s}):n?o.jsx("span",{className:Pe.helper,children:n}):null]})}),qf="tempest_timeline_utrkA",Uf="tempest_item_T5xdQ",Kf="tempest_markerColumn_BMe4d",Hf="tempest_marker_kmPV-",Gf="tempest_marker-primary_s9BNB",Jf="tempest_marker-success_areMM",Qf="tempest_marker-warning_rRrS8",Yf="tempest_marker-danger_3GEBk",Vf="tempest_marker-neutral_M2mnw",Xf="tempest_line_CwY-N",Zf="tempest_body_KpMJ6",eh="tempest_row_AX2ti",th="tempest_title_DxfAX",nh="tempest_meta_GU0ih",sh="tempest_description_f9sxV",Q={timeline:qf,item:Uf,markerColumn:Kf,marker:Hf,markerPrimary:Gf,markerSuccess:Jf,markerWarning:Qf,markerDanger:Yf,markerNeutral:Vf,line:Xf,body:Zf,row:eh,title:th,meta:nh,description:sh};function rh({items:e,connector:t=!0,className:n,...s}){return o.jsx("ol",{className:x.cn(Q.timeline,t&&Q.connector,n),...s,children:e.map((r,a)=>{const c=a===e.length-1;return o.jsxs("li",{className:Q.item,children:[o.jsxs("div",{className:Q.markerColumn,children:[o.jsx("span",{className:x.cn(Q.marker,Q[`marker-${r.marker??"primary"}`]),"aria-hidden":"true",children:r.icon}),t&&!c&&o.jsx("span",{className:Q.line,"aria-hidden":"true"})]}),o.jsxs("div",{className:Q.body,children:[o.jsxs("div",{className:Q.row,children:[o.jsx("span",{className:Q.title,children:r.title}),r.meta&&o.jsx("span",{className:Q.meta,children:r.meta})]}),r.description&&o.jsx("p",{className:Q.description,children:r.description})]})]},r.id)})})}const oh="tempest_trigger_Dmc5E",ah="tempest_bubble_TPGHB",ch="tempest_tempest-tooltip-in_csYeZ",ih="tempest_top_m2tnn",lh="tempest_bottom_9Twz4",uh="tempest_left_UPdrG",dh="tempest_right_CV--T",St={trigger:oh,bubble:ah,tempestTooltipIn:ch,top:ih,bottom:lh,left:uh,right:dh};function ph({content:e,placement:t="top",children:n,disabled:s=!1,openDelay:r=150}){const[a,c]=l.useState(!1),i=l.useId();let u=null;function d(){s||(u&&clearTimeout(u),u=setTimeout(()=>c(!0),r))}function p(){u&&(clearTimeout(u),u=null),c(!1)}const m=l.cloneElement(n,{onMouseEnter:d,onMouseLeave:p,onFocus:d,onBlur:p,"aria-describedby":a?i:void 0});return o.jsxs("span",{className:St.trigger,children:[m,a&&o.jsx("span",{id:i,role:"tooltip",className:x.cn(St.bubble,St[t]),children:e})]})}const mh="tempest_container_x4-Qm",fh="tempest_positionTopRight_gbUCQ",hh="tempest_positionTopLeft_Z-tMJ",_h="tempest_positionTopCenter_A4Ze4",gh="tempest_positionBottomRight_MGo19",bh="tempest_positionBottomLeft_DpiNe",yh="tempest_positionBottomCenter_XUdok",vh="tempest_toast_FLdHz",wh="tempest_tempest-toast-in_E2d-A",xh="tempest_success_Oy694",jh="tempest_warning_84GC8",$h="tempest_error_hrQAA",kh="tempest_info_eq5bQ",Nh="tempest_title_-H6R2",Sh="tempest_description_-QwfC",Ch="tempest_close_i10-s",Z={container:mh,positionTopRight:fh,positionTopLeft:hh,positionTopCenter:_h,positionBottomRight:gh,positionBottomLeft:bh,positionBottomCenter:yh,toast:vh,tempestToastIn:wh,success:xh,warning:jh,error:$h,info:kh,title:Nh,description:Sh,close:Ch},On=l.createContext(null);function Eh(){const e=l.useContext(On);if(!e)throw new Error("useToast must be used inside a <ToastProvider>");return e}function Th({children:e,defaultDuration:t=4e3,position:n="top-right"}){const[s,r]=l.useState([]),a=l.useRef(0),c=l.useCallback(d=>{r(p=>p.filter(m=>m.id!==d))},[]),i=l.useCallback(d=>{const p=d.id??`toast-${++a.current}`,m={id:p,title:d.title,description:d.description,variant:d.variant??"info",duration:d.duration??t};return r(f=>[...f,m]),p},[t]),u=l.useMemo(()=>({show:i,dismiss:c,success:(d,p)=>i({...p,description:d,variant:"success"}),error:(d,p)=>i({...p,description:d,variant:"error"}),warning:(d,p)=>i({...p,description:d,variant:"warning"}),info:(d,p)=>i({...p,description:d,variant:"info"})}),[i,c]);return o.jsxs(On.Provider,{value:u,children:[e,o.jsx(Rh,{toasts:s,onDismiss:c,position:n})]})}function Mh(e){switch(e){case"top-left":return Z.positionTopLeft;case"top-center":return Z.positionTopCenter;case"bottom-right":return Z.positionBottomRight;case"bottom-left":return Z.positionBottomLeft;case"bottom-center":return Z.positionBottomCenter;default:return Z.positionTopRight}}function Rh({toasts:e,onDismiss:t,position:n}){return typeof document>"u"?null:He.createPortal(o.jsx("div",{className:x.cn(Z.container,Mh(n)),"aria-live":"polite","aria-atomic":"true",children:e.map(s=>o.jsx(Lh,{toast:s,onDismiss:t},s.id))}),document.body)}function Lh({toast:e,onDismiss:t}){return l.useEffect(()=>{if(!e.duration)return;const n=setTimeout(()=>t(e.id),e.duration);return()=>clearTimeout(n)},[e.id,e.duration,t]),o.jsxs("div",{className:x.cn(Z.toast,Z[e.variant]),role:"status",children:[o.jsxs("div",{children:[e.title&&o.jsx("p",{className:Z.title,children:e.title}),e.description&&o.jsx("p",{className:Z.description,children:e.description})]}),o.jsx("button",{type:"button",className:Z.close,"aria-label":"Fechar notificação",onClick:()=>t(e.id),children:o.jsx(Dh,{})})]})}function Dh(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Ih="tempest_scroll_8Giwl",Ph="tempest_spacer_P3Pvl",Ah="tempest_row_Ff0VU",Ct={scroll:Ih,spacer:Ph,row:Ah};function Fh({items:e,itemHeight:t,renderItem:n,height:s,overscan:r=4,getKey:a,className:c,style:i}){const u=l.useRef(null),[d,p]=l.useState(0),[m,f]=l.useState(0);l.useEffect(()=>{const g=u.current;if(!g||(f(g.clientHeight),typeof ResizeObserver>"u"))return;const w=new ResizeObserver(()=>f(g.clientHeight));return w.observe(g),()=>w.disconnect()},[]);const h=e.length*t,_=Math.max(0,Math.floor(d/t)-r),b=Math.ceil(m/t)+r*2,v=Math.min(e.length,_+b);return o.jsx("div",{ref:u,className:x.cn(Ct.scroll,c),style:{height:s,...i},onScroll:g=>p(g.target.scrollTop),role:"list",children:o.jsx("div",{className:Ct.spacer,style:{height:h},children:e.slice(_,v).map((g,w)=>{const y=_+w,j=a?a(g,y):y;return o.jsx("div",{role:"listitem",className:Ct.row,style:{top:y*t,height:t},children:n(g,y)},j)})})})}const Oh="tempest_button_58f9i",Bh="tempest_copied_WkLgR",rn={button:Oh,copied:Bh};function zh({value:e,timeout:t=2e3,children:n,onCopied:s,className:r,onClick:a,...c}){const[i,u]=l.useState(!1),d=l.useRef(null);l.useEffect(()=>()=>{d.current!==null&&clearTimeout(d.current)},[]);const p=l.useCallback(async m=>{a?.(m);try{await navigator.clipboard.writeText(e),u(!0),s?.(),d.current!==null&&clearTimeout(d.current),d.current=setTimeout(()=>u(!1),t)}catch{}},[e,t,s,a]);return o.jsx("button",{type:"button",className:x.cn(rn.button,i&&rn.copied,r),"data-copied":i||void 0,onClick:p,...c,children:n??(i?"Copied":"Copy")})}const Wh={justNow:"agora há pouco",secondsAgo:e=>`${e} s atrás`,minutesAgo:e=>`${e} min atrás`,hoursAgo:e=>e===1?"1 hora atrás":`${e} horas atrás`,daysAgo:e=>e===1?"ontem":`${e} dias atrás`,weeksAgo:e=>e===1?"semana passada":`${e} semanas atrás`,monthsAgo:e=>e===1?"mês passado":`${e} meses atrás`,yearsAgo:e=>e===1?"ano passado":`${e} anos atrás`,inSeconds:e=>`em ${e} s`,inMinutes:e=>`em ${e} min`,inHours:e=>`em ${e} h`,inDays:e=>`em ${e} ${e===1?"dia":"dias"}`,inWeeks:e=>`em ${e} ${e===1?"semana":"semanas"}`,inMonths:e=>`em ${e} ${e===1?"mês":"meses"}`,inYears:e=>`em ${e} ${e===1?"ano":"anos"}`},qh={justNow:"just now",secondsAgo:e=>`${e}s ago`,minutesAgo:e=>`${e}m ago`,hoursAgo:e=>`${e}h ago`,daysAgo:e=>e===1?"yesterday":`${e} days ago`,weeksAgo:e=>`${e}w ago`,monthsAgo:e=>`${e}mo ago`,yearsAgo:e=>`${e}y ago`,inSeconds:e=>`in ${e}s`,inMinutes:e=>`in ${e}m`,inHours:e=>`in ${e}h`,inDays:e=>`in ${e}d`,inWeeks:e=>`in ${e}w`,inMonths:e=>`in ${e}mo`,inYears:e=>`in ${e}y`},Uh={"pt-BR":Wh,en:qh},Ft=1e3,Ot=60*Ft,Bt=60*Ot,rt=24*Bt,on=7*rt,an=30*rt,cn=365*rt;function Bn(e,t={}){const{locale:n="pt-BR",now:s=Date.now()}=t,r=Uh[n],a=e instanceof Date?e.getTime():new Date(e).getTime(),i=(typeof s=="number"?s:s.getTime())-a,u=i>=0,d=Math.abs(i);if(d<30*Ft)return r.justNow;if(d<Ot){const m=Math.round(d/Ft);return u?r.secondsAgo(m):r.inSeconds(m)}if(d<Bt){const m=Math.round(d/Ot);return u?r.minutesAgo(m):r.inMinutes(m)}if(d<rt){const m=Math.round(d/Bt);return u?r.hoursAgo(m):r.inHours(m)}if(d<on){const m=Math.round(d/rt);return u?r.daysAgo(m):r.inDays(m)}if(d<an){const m=Math.round(d/on);return u?r.weeksAgo(m):r.inWeeks(m)}if(d<cn){const m=Math.round(d/an);return u?r.monthsAgo(m):r.inMonths(m)}const p=Math.round(d/cn);return u?r.yearsAgo(p):r.inYears(p)}function Kh({date:e,locale:t="pt",...n}){const s=e instanceof Date?e:new Date(e),r=Number.isNaN(s.getTime())?void 0:s.toISOString(),a=Bn(e,{locale:t==="pt"?"pt-BR":"en"});return o.jsx("time",{dateTime:r,...n,children:a})}function Hh({cents:e,currency:t="BRL",locale:n="pt-BR",...s}){const r=new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e/100);return o.jsx("span",{...s,children:r})}const Gh="tempest_clamp_r43C-",Jh={clamp:Gh};function Qh({lines:e=1,className:t,style:n,children:s,...r}){const a={...n,"--tempest-clamp-lines":e};return o.jsx("div",{className:x.cn(Jh.clamp,t),style:a,...r,children:s})}const Yh="tempest_hidden_k7p-e",Vh={hidden:Yh};function Xh({as:e="span",className:t,children:n,...s}){return l.createElement(e,{className:x.cn(Vh.hidden,t),...s},n)}function zn({children:e,container:t}){const[n,s]=l.useState(!1);return l.useEffect(()=>(s(!0),()=>s(!1)),[]),!n||typeof document>"u"?null:He.createPortal(e,t??document.body)}function Zh({onOutside:e,children:t,...n}){const s=l.useRef(null),r=l.useRef(e);return r.current=e,l.useEffect(()=>{if(typeof document>"u")return;function a(c){const i=s.current,u=c.target;i&&u&&!i.contains(u)&&r.current(c)}return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[]),o.jsx("div",{ref:s,...n,children:t})}function e_({condition:e,wrapper:t,children:n}){return e?t(n):o.jsx(o.Fragment,{children:n})}function t_({each:e,children:t,fallback:n=null}){return e.length===0?o.jsx(o.Fragment,{children:n}):o.jsx(o.Fragment,{children:e.map((s,r)=>o.jsx(l.Fragment,{children:t(s,r)},r))})}const n_="tempest_errorText_LU3jn",s_={errorText:n_};function r_({children:e,className:t,...n}){return e==null||e===!1||e===""?null:o.jsx("p",{role:"alert",className:x.cn(s_.errorText,t),...n,children:e})}const o_="tempest_image_Zq9Zs",a_={image:o_};function c_({src:e,fallback:t,alt:n,lazy:s=!0,className:r,onError:a,...c}){const[i,u]=l.useState(e),[d,p]=l.useState(!1);return o.jsx("img",{src:i,alt:n,loading:s?"lazy":"eager",className:x.cn(a_.image,r),onError:m=>{t&&!d&&i!==t&&(p(!0),u(t)),a?.(m)},...c})}const i_="tempest_list_bAP4Q",l_="tempest_item_oRy5T",ln={list:i_,item:l_};function u_({items:e,renderItem:t,keyExtractor:n,empty:s,className:r,...a}){return e.length===0?o.jsx(o.Fragment,{children:s??null}):o.jsx("ul",{className:x.cn(ln.list,r),...a,children:e.map((c,i)=>o.jsx("li",{className:ln.item,children:t(c,i)},n?n(c,i):i))})}const d_="tempest_list_fwIXq",p_="tempest_term_QkQNZ",m_="tempest_description_e1bNN",Et={list:d_,term:p_,description:m_};function f_({items:e,className:t,...n}){return o.jsx("dl",{className:x.cn(Et.list,t),...n,children:e.map((s,r)=>o.jsxs(l.Fragment,{children:[o.jsx("dt",{className:Et.term,children:s.term}),o.jsx("dd",{className:Et.description,children:s.description})]},r))})}const h_="tempest_toggle_kmzmH",__="tempest_outline_aFbzy",g_="tempest_pressed_hX319",b_="tempest_sm_JTqaB",y_="tempest_md_QfS4K",v_="tempest_lg_ajzsM",it={toggle:h_,outline:__,pressed:g_,sm:b_,md:y_,lg:v_},w_=l.forwardRef(function({pressed:t,defaultPressed:n=!1,onPressedChange:s,size:r="md",variant:a="default",className:c,disabled:i,onClick:u,children:d,...p},m){const f=t!==void 0,[h,_]=l.useState(n),b=f?t:h,v=l.useCallback(g=>{if(u?.(g),g.defaultPrevented)return;const w=!b;f||_(w),s?.(w)},[b,f,u,s]);return o.jsx("button",{ref:m,type:"button","aria-pressed":b,disabled:i,"data-state":b?"on":"off",className:x.cn(it.toggle,it[r],it[a],b&&it.pressed,c),onClick:v,...p,children:d})}),x_="tempest_group_XZCDJ",j_="tempest_item_B-27E",$_="tempest_selected_OHPVQ",zt={group:x_,item:j_,selected:$_},Wn=l.createContext(null);function k_(){const e=l.useContext(Wn);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e}function un(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function N_({type:e="single",value:t,defaultValue:n,onValueChange:s,className:r,children:a,...c}){const i=t!==void 0,[u,d]=l.useState(()=>un(n)),p=i?un(t):u,m=l.useCallback(_=>{i||d(_),s?.(e==="single"?_[0]??"":_)},[i,s,e]),f=l.useCallback(_=>{const b=p.includes(_);m(e==="single"?b?[]:[_]:b?p.filter(v=>v!==_):[...p,_])},[p,e,m]),h=l.useMemo(()=>({type:e,isSelected:_=>p.includes(_),toggle:f}),[e,p,f]);return o.jsx(Wn.Provider,{value:h,children:o.jsx("div",{role:"group",className:x.cn(zt.group,r),...c,children:a})})}function S_({value:e,disabled:t,className:n,children:s,...r}){const{isSelected:a,toggle:c}=k_(),i=a(e);return o.jsx("button",{type:"button",role:"button","aria-pressed":i,disabled:t,"data-state":i?"on":"off",className:x.cn(zt.item,i&&zt.selected,n),onClick:()=>c(e),...r,children:s})}const C_="tempest_label_RaRvM",E_="tempest_asterisk_1CgE8",dn={label:C_,asterisk:E_},T_=l.forwardRef(function({required:t=!1,className:n,children:s,...r},a){return o.jsxs("label",{ref:a,className:x.cn(dn.label,n),...r,children:[s,t&&o.jsx("span",{className:dn.asterisk,"aria-hidden":!0,children:"*"})]})}),M_="tempest_collapsible_8jmKP",R_="tempest_trigger_ers75",L_="tempest_content_XmUZL",lt={collapsible:M_,trigger:R_,content:L_};function D_({open:e,defaultOpen:t=!1,onOpenChange:n,trigger:s,className:r,children:a,...c}){const i=l.useId(),u=`${i}-content`,d=`${i}-trigger`,p=e!==void 0,[m,f]=l.useState(t),h=p?e:m,_=l.useCallback(()=>{const b=!h;p||f(b),n?.(b)},[h,p,n]);return o.jsxs("div",{className:x.cn(lt.collapsible,h&<.open,r),...c,children:[o.jsx("button",{type:"button",id:d,className:lt.trigger,"aria-expanded":h,"aria-controls":u,onClick:_,children:s}),o.jsx("div",{id:u,role:"region","aria-labelledby":d,hidden:!h,className:lt.content,children:a})]})}const I_="tempest_root_OxRHj",P_="tempest_menu_MDn4t",A_="tempest_item_PoiMY",F_="tempest_active_ATcDu",O_="tempest_danger_COgly",B_="tempest_separator_omuCz",Ue={root:I_,menu:P_,item:A_,active:F_,danger:O_,separator:B_};function pn(e){return"separator"in e&&e.separator===!0}function z_({items:e,children:t,className:n}){const[s,r]=l.useState(!1),[a,c]=l.useState({x:0,y:0}),[i,u]=l.useState(-1),d=l.useId(),p=l.useRef(null),m=l.useRef([]),f=e.map((v,g)=>!pn(v)&&!v.disabled?g:-1).filter(v=>v!==-1),h=l.useCallback(()=>{r(!1),u(-1)},[]),_=v=>{v.preventDefault(),c({x:v.clientX,y:v.clientY}),u(-1),r(!0)};l.useEffect(()=>{if(!s)return;const v=w=>{if(w.key==="Escape"){h();return}if(w.key==="ArrowDown"){w.preventDefault();const y=f.indexOf(i),j=f[(y+1)%f.length]??-1;u(j),m.current[j]?.focus()}if(w.key==="ArrowUp"){w.preventDefault();const y=f.indexOf(i),j=f[(y-1+f.length)%f.length]??-1;u(j),m.current[j]?.focus()}},g=w=>{p.current&&!p.current.contains(w.target)&&h()};return window.addEventListener("keydown",v),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",v),window.removeEventListener("mousedown",g)}},[s,i,f,h]);const b=v=>{v.onSelect?.(),h()};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:Ue.root,onContextMenu:_,children:t}),s&&o.jsx(zn,{children:o.jsx("ul",{ref:p,id:d,role:"menu",className:x.cn(Ue.menu,n),style:{top:a.y,left:a.x},children:e.map((v,g)=>pn(v)?o.jsx("li",{role:"separator",className:Ue.separator,"aria-hidden":!0},`separator-${g}`):o.jsx("li",{role:"none",children:o.jsx("button",{ref:w=>{m.current[g]=w},type:"button",role:"menuitem",className:x.cn(Ue.item,v.danger&&Ue.danger,i===g&&Ue.active),disabled:v.disabled,onClick:()=>b(v),onMouseEnter:()=>u(g),children:v.label})},`item-${g}`))})})]})}const W_="tempest_root_2KoZA",q_="tempest_trigger_OXsnr",U_="tempest_card_CoGx4",K_="tempest_tempest-hover-card-in_jD85J",H_="tempest_top_AVcQ0",G_="tempest_bottom_2rLAA",J_="tempest_left_tqGPt",Q_="tempest_right_9Fe6S",ut={root:W_,trigger:q_,card:U_,tempestHoverCardIn:K_,top:H_,bottom:G_,left:J_,right:Q_};function Y_({trigger:e,children:t,openDelay:n=300,closeDelay:s=150,placement:r="bottom",className:a,...c}){const[i,u]=l.useState(!1),d=l.useId(),p=l.useRef(null),m=l.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]),f=l.useCallback(()=>{m(),p.current=setTimeout(()=>u(!0),n)},[m,n]),h=l.useCallback(()=>{m(),p.current=setTimeout(()=>u(!1),s)},[m,s]);return l.useEffect(()=>m,[m]),o.jsxs("span",{className:ut.root,onMouseEnter:f,onMouseLeave:h,onFocus:f,onBlur:h,children:[o.jsx("span",{"aria-describedby":i?d:void 0,className:ut.trigger,children:e}),i&&o.jsx("div",{id:d,role:"dialog",className:x.cn(ut.card,ut[r],a),...c,children:t})]})}const V_=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function qn(e,t){l.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const s=document.activeElement;function r(){return Array.from(n?.querySelectorAll(V_)??[]).filter(i=>{if(i.hasAttribute("aria-hidden"))return!1;const u=typeof window<"u"?window.getComputedStyle(i):null;return!(u&&(u.display==="none"||u.visibility==="hidden"))})}function a(i){if(i.key!=="Tab")return;const u=r();if(u.length===0){i.preventDefault();return}const d=u[0],p=u[u.length-1],m=document.activeElement;i.shiftKey?(m===d||!m||!n?.contains(m))&&(i.preventDefault(),p.focus()):m===p&&(i.preventDefault(),d.focus())}return r()[0]?.focus(),document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),s?.focus?.()}},[e,t])}const X_="tempest_overlay_drnPW",Z_="tempest_dialog_lPl6k",eg="tempest_inputRow_KxWoQ",tg="tempest_searchIcon_8PULr",ng="tempest_input_D3HQr",sg="tempest_list_5UzZU",rg="tempest_group_vLaWy",og="tempest_groupHeading_d01fo",ag="tempest_groupList_QFMjK",cg="tempest_option_doqib",ig="tempest_active_LdCIJ",lg="tempest_icon_CyCCx",ug="tempest_label_QePT-",dg="tempest_empty_al68D",W={overlay:X_,dialog:Z_,inputRow:eg,searchIcon:tg,input:ng,list:sg,group:rg,groupHeading:og,groupList:ag,option:cg,active:ig,icon:lg,label:ug,empty:dg};function pg(e,t){return t===""||e.label.toLowerCase().includes(t)?!0:(e.keywords??[]).some(n=>n.toLowerCase().includes(t))}function mn(e){const t=[],n=new Map;for(const s of e){const r=n.get(s.group);r===void 0?(n.set(s.group,t.length),t.push({name:s.group,items:[s]})):t[r].items.push(s)}return t}function mg({open:e,onOpenChange:t,items:n,placeholder:s="Type a command…",emptyMessage:r="No results",className:a}){const c=l.useRef(null),[i,u]=l.useState(""),[d,p]=l.useState(0),m="tempest-command-list";qn(c,e);const f=l.useMemo(()=>{const g=i.trim().toLowerCase(),w=n.filter(y=>pg(y,g));return mn(w).flatMap(y=>y.items)},[n,i]),h=l.useMemo(()=>mn(f),[f]);if(l.useEffect(()=>{e&&(u(""),p(0))},[e]),l.useEffect(()=>{p(g=>f.length===0?0:Math.min(g,f.length-1))},[f.length]),!e||typeof document>"u")return null;function _(g){g.onSelect(),t(!1)}function b(g){if(g.key==="Escape"){g.preventDefault(),t(!1);return}if(g.key==="ArrowDown"){if(g.preventDefault(),f.length===0)return;p(w=>(w+1)%f.length);return}if(g.key==="ArrowUp"){if(g.preventDefault(),f.length===0)return;p(w=>(w-1+f.length)%f.length);return}if(g.key==="Enter"){g.preventDefault();const w=f[d];w&&_(w)}}let v=-1;return He.createPortal(o.jsx("div",{className:W.overlay,role:"presentation",onClick:()=>t(!1),children:o.jsxs("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":"Command palette",className:x.cn(W.dialog,a),onClick:g=>g.stopPropagation(),children:[o.jsxs("div",{className:W.inputRow,children:[o.jsx(fg,{}),o.jsx("input",{type:"text",role:"combobox","aria-expanded":"true","aria-controls":m,"aria-autocomplete":"list",autoFocus:!0,className:W.input,placeholder:s,value:i,onChange:g=>u(g.target.value),onKeyDown:b})]}),o.jsx("ul",{id:m,role:"listbox",className:W.list,children:f.length===0?o.jsx("li",{className:W.empty,children:r}):h.map(g=>o.jsxs("li",{className:W.group,children:[g.name&&o.jsx("div",{className:W.groupHeading,children:g.name}),o.jsx("ul",{role:"presentation",className:W.groupList,children:g.items.map(w=>{v+=1;const y=v===d,j=v;return o.jsxs("li",{role:"option","aria-selected":y,className:x.cn(W.option,y&&W.active),onMouseMove:()=>p(j),onClick:()=>_(w),children:[w.icon&&o.jsx("span",{className:W.icon,children:w.icon}),o.jsx("span",{className:W.label,children:w.label})]},w.id)})})]},g.name??"__ungrouped__"))})]})}),document.body)}function fg(){return o.jsxs("svg",{className:W.searchIcon,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}const hg="tempest_root_cWKqF",_g={root:hg},gg=l.forwardRef(function({maxHeight:t,orientation:n="vertical",className:s,style:r,children:a,...c},i){const u={overflowX:n==="vertical"?"hidden":"auto",overflowY:n==="horizontal"?"hidden":"auto",...t!==void 0?{maxHeight:t}:{},...r};return o.jsx("div",{ref:i,className:x.cn(_g.root,s),style:u,...c,children:a})}),bg="tempest_root_-Xerf",yg="tempest_horizontal_3QOMV",vg="tempest_vertical_6A7lb",wg="tempest_pane_x6yUG",xg="tempest_divider_fhaTB",jg="tempest_handle_eCe1B",Ae={root:bg,horizontal:yg,vertical:vg,pane:wg,divider:xg,handle:jg},dt=2;function Tt(e,t,n){return Math.min(n,Math.max(t,e))}function $g({direction:e="horizontal",defaultSize:t=50,min:n=10,max:s=90,children:r,className:a,...c}){const[i,u]=l.useState(()=>Tt(t,n,s)),d=l.useRef(null),[p,m]=r,f=e==="horizontal",h=l.useCallback((v,g)=>{const w=d.current;if(!w)return;const y=w.getBoundingClientRect(),j=f?y.width:y.height;if(j<=0)return;const M=(f?v-y.left:g-y.top)/j*100;u(Tt(M,n,s))},[f,n,s]),_=l.useCallback(v=>{v.preventDefault(),v.currentTarget.setPointerCapture(v.pointerId);const w=j=>{h(j.clientX,j.clientY)},y=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",y)};window.addEventListener("pointermove",w),window.addEventListener("pointerup",y)},[h]),b=l.useCallback(v=>{let g=0;if(f?v.key==="ArrowRight"?g=dt:v.key==="ArrowLeft"&&(g=-dt):v.key==="ArrowDown"?g=dt:v.key==="ArrowUp"&&(g=-dt),v.key==="Home"){v.preventDefault(),u(n);return}if(v.key==="End"){v.preventDefault(),u(s);return}g!==0&&(v.preventDefault(),u(w=>Tt(w+g,n,s)))},[f,n,s]);return o.jsxs("div",{ref:d,className:x.cn(Ae.root,f?Ae.horizontal:Ae.vertical,a),...c,children:[o.jsx("div",{className:Ae.pane,style:{flexBasis:`${i}%`},children:p}),o.jsx("div",{role:"separator","aria-orientation":f?"vertical":"horizontal","aria-valuenow":Math.round(i),"aria-valuemin":n,"aria-valuemax":s,tabIndex:0,className:Ae.divider,onPointerDown:_,onKeyDown:b,children:o.jsx("span",{className:Ae.handle,"aria-hidden":"true"})}),o.jsx("div",{className:Ae.pane,style:{flexBasis:`${100-i}%`},children:m})]})}const kg="tempest_root_ObO-Z",Ng="tempest_header_5nSJG",Sg="tempest_title_Jd3Xb",Cg="tempest_nav_4h58I",Eg="tempest_weekdays_YzRfx",Tg="tempest_grid_nbaFm",Mg="tempest_weekday_k-7Vr",Rg="tempest_day_ao-IC",Lg="tempest_outside_HkC-6",Dg="tempest_today_p18-m",Ig="tempest_selected_C9bTY",Y={root:kg,header:Ng,title:Sg,nav:Cg,weekdays:Eg,grid:Tg,weekday:Mg,day:Rg,outside:Lg,today:Dg,selected:Ig},Pg=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Ag=["January","February","March","April","May","June","July","August","September","October","November","December"],Un=42;function Ke(e,t,n){return new Date(e,t,n)}function ht(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function fn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function hn(e,t,n){const s=ht(e).getTime();return!!(t&&s<ht(t).getTime()||n&&s>ht(n).getTime())}function Fg(e,t){const n=e.getFullYear(),s=e.getMonth(),c=(Ke(n,s,1).getDay()-t+7)%7,i=Ke(n,s,1-c),u=[];for(let d=0;d<Un;d+=1)u.push(Ke(i.getFullYear(),i.getMonth(),i.getDate()+d));return u}function Og({value:e,defaultValue:t,onChange:n,month:s,onMonthChange:r,minDate:a,maxDate:c,weekStartsOn:i=0,className:u,...d}){const p=e!==void 0,[m,f]=l.useState(t),h=p?e:m,_=s!==void 0,[b,v]=l.useState(()=>{const $=s??e??t??new Date;return Ke($.getFullYear(),$.getMonth(),1)}),g=_?Ke(s.getFullYear(),s.getMonth(),1):b,[w,y]=l.useState(null),j=l.useRef(null),S=l.useMemo(()=>ht(new Date),[]),M=l.useMemo(()=>Fg(g,i),[g,i]),T=l.useMemo(()=>Array.from({length:7},($,C)=>Pg[(C+i)%7]),[i]),N=l.useCallback($=>{const C=Ke(g.getFullYear(),g.getMonth()+$,1);r&&r(C),_||v(C)},[g,r,_]),k=l.useCallback($=>{hn($,a,c)||(n&&n($),p||f($))},[a,c,n,p]),E=l.useCallback($=>{const C=Math.max(0,Math.min(Un-1,$));y(C);const F=j.current;if(!F)return;F.querySelectorAll("button[data-day]")[C]?.focus()},[]),D=l.useCallback(($,C)=>{switch($.key){case"ArrowLeft":$.preventDefault(),E(C-1);break;case"ArrowRight":$.preventDefault(),E(C+1);break;case"ArrowUp":$.preventDefault(),E(C-7);break;case"ArrowDown":$.preventDefault(),E(C+7);break;case"Enter":case" ":$.preventDefault(),k(M[C]);break}},[E,k,M]);return o.jsxs("div",{className:x.cn(Y.root,u),...d,children:[o.jsxs("div",{className:Y.header,children:[o.jsx("button",{type:"button",className:Y.nav,"aria-label":"Previous month",onClick:()=>N(-1),children:"‹"}),o.jsxs("span",{className:Y.title,"aria-live":"polite",children:[Ag[g.getMonth()]," ",g.getFullYear()]}),o.jsx("button",{type:"button",className:Y.nav,"aria-label":"Next month",onClick:()=>N(1),children:"›"})]}),o.jsx("div",{className:Y.weekdays,role:"row",children:T.map($=>o.jsx("span",{className:Y.weekday,role:"columnheader",children:$},$))}),o.jsx("div",{className:Y.grid,role:"grid",ref:j,children:M.map(($,C)=>{const F=$.getMonth()===g.getMonth(),L=h?fn($,h):!1,R=fn($,S),q=hn($,a,c),at=w===null?F&&$.getDate()===1:w===C;return o.jsx("button",{type:"button","data-day":!0,role:"gridcell",className:x.cn(Y.day,!F&&Y.outside,L&&Y.selected,R&&Y.today),"aria-pressed":L,"aria-selected":L,"aria-current":R?"date":void 0,disabled:q,tabIndex:at?0:-1,onClick:()=>k($),onKeyDown:Cs=>D(Cs,C),children:$.getDate()},C)})})]})}const Bg="tempest_wrapper_KCCs1",zg="tempest_label_N4ak-",Wg="tempest_value_-33zj",qg="tempest_field_wFJsg",Ug="tempest_track_kaJkL",Kg="tempest_fill_tio-b",Hg="tempest_input_J48Um",Gg="tempest_helper_yn8VW",Se={wrapper:Bg,label:zg,value:Wg,field:qg,track:Ug,fill:Kg,input:Hg,helper:Gg};function Jg({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:a,helperText:c,disabled:i=!1,formatValue:u,className:d}){const p=l.useMemo(()=>{const h=s-n;return h<=0?0:Math.min(100,Math.max(0,(e-n)/h*100))},[e,n,s]),m=u?.(e)??String(e),f=l.useCallback(h=>{t(Number(h.target.value))},[t]);return o.jsxs("div",{className:x.cn(Se.wrapper,d),children:[a&&o.jsxs("div",{className:Se.label,children:[o.jsx("span",{children:a}),o.jsx("span",{className:Se.value,children:m})]}),o.jsxs("div",{className:Se.field,children:[o.jsx("div",{className:Se.track}),o.jsx("div",{className:Se.fill,style:{width:`${p}%`}}),o.jsx("input",{type:"range",className:Se.input,min:n,max:s,step:r,value:e,onChange:f,disabled:i,"aria-label":a??"Slider","aria-valuetext":m})]}),c&&o.jsx("span",{className:Se.helper,children:c})]})}const Qg="tempest_wrapper_6xZZr",Yg="tempest_label_Jwj7I",Vg="tempest_field_GpA0V",Xg="tempest_disabled_BIKaG",Zg="tempest_chip_Zk0ch",eb="tempest_chipRemove_R-mNv",tb="tempest_input_SjOXU",nb="tempest_menu_3xnmo",sb="tempest_option_lqEl1",rb="tempest_check_aUM1w",ob="tempest_active_S9sQ-",ab="tempest_selected_Rw8yr",cb="tempest_empty_-5B16",ib="tempest_helper_c7aH3",lb="tempest_errorText_qZR9s",ub="tempest_error_DIOTW",O={wrapper:Qg,label:Yg,field:Vg,disabled:Xg,chip:Zg,chipRemove:eb,input:tb,menu:nb,option:sb,check:rb,active:ob,selected:ab,empty:cb,helper:ib,errorText:lb,error:ub};function db(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function pb({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:a,error:c,disabled:i,maxItems:u,filter:d=db,emptyMessage:p="Nenhuma opção encontrada",className:m}){const f=l.useId(),h=l.useRef(null),_=l.useRef(null),[b,v]=l.useState(!1),[g,w]=l.useState(""),[y,j]=l.useState(0),S=l.useMemo(()=>new Set(t),[t]),M=l.useMemo(()=>t.map($=>e.find(C=>C.value===$)).filter($=>!!$),[t,e]),T=l.useMemo(()=>e.filter($=>d($,g)),[e,d,g]),N=u!==void 0&&t.length>=u,k=l.useCallback($=>{if(!$.disabled){if(S.has($.value))n(t.filter(C=>C!==$.value));else{if(N)return;n([...t,$.value])}w(""),_.current?.focus()}},[S,n,t,N]),E=l.useCallback($=>{n(t.filter(C=>C!==$))},[n,t]);l.useEffect(()=>{if(!b)return;const $=C=>{h.current&&!h.current.contains(C.target)&&(v(!1),w(""))};return window.addEventListener("mousedown",$),()=>window.removeEventListener("mousedown",$)},[b]);const D=$=>{if($.key==="ArrowDown")$.preventDefault(),v(!0),j(C=>Math.min(T.length-1,C+1));else if($.key==="ArrowUp")$.preventDefault(),j(C=>Math.max(0,C-1));else if($.key==="Enter"){$.preventDefault();const C=T[y];C&&k(C)}else $.key==="Escape"?(v(!1),w("")):$.key==="Backspace"&&g===""&&t.length>0&&E(t[t.length-1])};return o.jsxs("div",{ref:h,className:x.cn(O.wrapper,c&&O.error,m),children:[s&&o.jsx("label",{htmlFor:f,className:O.label,children:s}),o.jsxs("div",{className:x.cn(O.field,i&&O.disabled),onMouseDown:$=>{i||$.target===$.currentTarget&&($.preventDefault(),_.current?.focus(),v(!0))},children:[M.map($=>o.jsxs("span",{className:O.chip,children:[$.label,o.jsx("button",{type:"button",className:O.chipRemove,"aria-label":`Remover ${$.label}`,disabled:i,onMouseDown:C=>{C.preventDefault(),E($.value)},children:"×"})]},$.value)),o.jsx("input",{id:f,ref:_,type:"text",role:"combobox","aria-expanded":b,"aria-controls":`${f}-listbox`,"aria-autocomplete":"list",className:O.input,placeholder:t.length===0?r:"",disabled:i,value:g,onFocus:()=>v(!0),onChange:$=>{w($.target.value),v(!0),j(0)},onKeyDown:D})]}),b&&o.jsx("ul",{id:`${f}-listbox`,role:"listbox","aria-multiselectable":!0,className:O.menu,children:T.length===0?o.jsx("li",{className:O.empty,children:p}):T.map(($,C)=>{const F=S.has($.value);return o.jsxs("li",{role:"option","aria-selected":F,"aria-disabled":$.disabled||!F&&N,className:x.cn(O.option,C===y&&O.active,F&&O.selected),onMouseEnter:()=>j(C),onMouseDown:L=>{L.preventDefault(),k($)},children:[o.jsx("span",{className:O.check,"aria-hidden":!0,children:F?"✓":""}),$.label]},$.value)})}),c?o.jsx("span",{className:O.errorText,children:c}):a?o.jsx("span",{className:O.helper,children:a}):null]})}const mb="tempest_root_fVC66",fb="tempest_header_sTdRM",hb="tempest_headerSpacer_nqeNO",_b="tempest_nav_7nFJE",gb="tempest_months_fbwtK",bb="tempest_month_0WfUc",yb="tempest_title_OGQrm",vb="tempest_weekdays_nYTrg",wb="tempest_grid_O0eUF",xb="tempest_weekday_cy-Mz",jb="tempest_day_-V6FX",$b="tempest_outside_3otid",kb="tempest_today_gwmhs",Nb="tempest_inRange_iQJYA",Sb="tempest_selected_DRsBO",Cb="tempest_rangeStart_-Oe1u",Eb="tempest_rangeEnd_mUaKW",P={root:mb,header:fb,headerSpacer:hb,nav:_b,months:gb,month:bb,title:yb,weekdays:vb,grid:wb,weekday:xb,day:jb,outside:$b,today:kb,inRange:Nb,selected:Sb,rangeStart:Cb,rangeEnd:Eb},Tb=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],_n=["January","February","March","April","May","June","July","August","September","October","November","December"],Mb=42;function nt(e,t,n){return new Date(e,t,n)}function ce(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function gn(e,t){return nt(e.getFullYear(),e.getMonth()+t,1)}function Mt(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function bn(e,t,n){const s=ce(e).getTime();return!!(t&&s<ce(t).getTime()||n&&s>ce(n).getTime())}function Rb(e,t,n){const s=ce(e).getTime(),r=Math.min(ce(t).getTime(),ce(n).getTime()),a=Math.max(ce(t).getTime(),ce(n).getTime());return s>r&&s<a}function Lb(e,t){const n=e.getFullYear(),s=e.getMonth(),a=(nt(n,s,1).getDay()-t+7)%7,c=nt(n,s,1-a);return Array.from({length:Mb},(i,u)=>nt(c.getFullYear(),c.getMonth(),c.getDate()+u))}function Db({value:e,onChange:t,numberOfMonths:n=2,defaultMonth:s,minDate:r,maxDate:a,weekStartsOn:c=0,className:i,...u}){const[d,p]=l.useState(()=>{const y=s??e.start??new Date;return nt(y.getFullYear(),y.getMonth(),1)}),[m,f]=l.useState(null),h=l.useMemo(()=>ce(new Date),[]),_=l.useMemo(()=>Array.from({length:7},(y,j)=>Tb[(j+c)%7]),[c]),b=l.useCallback(y=>{if(bn(y,r,a))return;const{start:j,end:S}=e;!j||S?t({start:y,end:null}):ce(y).getTime()<ce(j).getTime()?t({start:y,end:j}):t({start:j,end:y})},[e,t,r,a]),v=l.useCallback(y=>{p(j=>gn(j,y))},[]),g=e.start&&!e.end?m:e.end;function w(y){const{start:j}=e,S=g,M=j?Mt(y,j):!1,T=S?Mt(y,S):!1,N=j&&S?Rb(y,j,S):!1;return{selected:M||T,inRange:N,isStart:M,isEnd:T}}return o.jsxs("div",{className:x.cn(P.root,i),...u,children:[o.jsxs("div",{className:P.header,children:[o.jsx("button",{type:"button",className:P.nav,"aria-label":"Previous month",onClick:()=>v(-1),children:"‹"}),o.jsx("span",{className:P.headerSpacer,"aria-hidden":!0}),o.jsx("button",{type:"button",className:P.nav,"aria-label":"Next month",onClick:()=>v(1),children:"›"})]}),o.jsx("div",{className:P.months,onMouseLeave:()=>f(null),children:Array.from({length:Math.max(1,n)},(y,j)=>{const S=gn(d,j),M=Lb(S,c);return o.jsxs("div",{className:P.month,children:[o.jsxs("div",{className:P.title,"aria-live":"polite",children:[_n[S.getMonth()]," ",S.getFullYear()]}),o.jsx("div",{className:P.weekdays,role:"row",children:_.map(T=>o.jsx("span",{className:P.weekday,role:"columnheader",children:T},T))}),o.jsx("div",{className:P.grid,role:"grid",children:M.map((T,N)=>{const k=T.getMonth()===S.getMonth(),E=bn(T,r,a),{selected:D,inRange:$,isStart:C,isEnd:F}=w(T),L=Mt(T,h);return o.jsx("button",{type:"button",role:"gridcell",className:x.cn(P.day,!k&&P.outside,$&&P.inRange,D&&P.selected,C&&P.rangeStart,F&&P.rangeEnd,L&&P.today),"aria-label":`${_n[T.getMonth()]} ${T.getDate()}, ${T.getFullYear()}`,"aria-selected":D,"aria-current":L?"date":void 0,disabled:E,onClick:()=>b(T),onMouseEnter:()=>f(T),children:T.getDate()},N)})})]},j)})})]})}const Ib="tempest_root_Nosqs",Pb="tempest_list_v9FNC",Ab="tempest_item_9RzZ7",Fb="tempest_link_67ULr",Ob="tempest_trigger_2gBDu",Bb="tempest_panel_N2ujp",zb="tempest_subItem_LjtO7",ve={root:Ib,list:Pb,item:Ab,link:Fb,trigger:Ob,panel:Bb,subItem:zb};function Wb({items:e,className:t,...n}){const[s,r]=l.useState(-1),[a,c]=l.useState(-1),i=l.useId(),u=l.useRef(null),d=l.useCallback(()=>{r(-1),c(-1)},[]),p=s!==-1?s:a;l.useEffect(()=>{if(p===-1)return;const f=_=>{_.key==="Escape"&&d()},h=_=>{u.current&&!u.current.contains(_.target)&&d()};return window.addEventListener("keydown",f),window.addEventListener("mousedown",h),()=>{window.removeEventListener("keydown",f),window.removeEventListener("mousedown",h)}},[p,d]);const m=(f,h)=>{const _=()=>{f.onSelect?.(),d()};return f.href?o.jsx("a",{href:f.href,role:h==="menuitem"?"menuitem":void 0,className:ve.link,onClick:_,children:f.label}):o.jsx("button",{type:"button",role:h==="menuitem"?"menuitem":void 0,className:ve.link,onClick:_,children:f.label})};return o.jsx("nav",{ref:u,className:x.cn(ve.root,t),...n,children:o.jsx("ul",{className:ve.list,children:e.map((f,h)=>{if(!(!!f.children&&f.children.length>0))return o.jsx("li",{className:ve.item,children:m(f,"none")},h);const b=p===h,v=`${i}-panel-${h}`;return o.jsxs("li",{className:ve.item,onMouseEnter:()=>c(h),onMouseLeave:()=>c(g=>g===h?-1:g),children:[o.jsx("button",{type:"button",className:ve.trigger,"aria-haspopup":"menu","aria-expanded":b,"aria-controls":v,onClick:()=>r(g=>g===h?-1:h),onFocus:()=>c(h),children:f.label}),b&&o.jsx("ul",{id:v,role:"menu",className:ve.panel,children:f.children.map((g,w)=>o.jsx("li",{role:"none",className:ve.subItem,children:m(g,"menuitem")},w))})]},h)})})})}const qb="tempest_root_PGUO2",Ub="tempest_menu_hEVLT",Kb="tempest_trigger_ZlZBx",Hb="tempest_triggerOpen_Hpfbu",Gb="tempest_panel_6ta6u",Jb="tempest_item_wM-61",Qb="tempest_itemLabel_wXfB2",Yb="tempest_shortcut_qNlmN",Vb="tempest_separator_LfK3t",we={root:qb,menu:Ub,trigger:Kb,triggerOpen:Hb,panel:Gb,item:Jb,itemLabel:Qb,shortcut:Yb,separator:Vb};function Xb(e){return"separator"in e}function Zb({menus:e,className:t,...n}){const[s,r]=l.useState(-1),a=l.useId(),c=l.useRef(null),i=l.useRef([]),u=l.useCallback(()=>{r(-1)},[]);return l.useEffect(()=>{if(s===-1)return;const d=m=>{if(m.key==="Escape"){u(),i.current[s]?.focus();return}if(m.key==="ArrowRight"){m.preventDefault();const f=(s+1)%e.length;r(f),i.current[f]?.focus()}if(m.key==="ArrowLeft"){m.preventDefault();const f=(s-1+e.length)%e.length;r(f),i.current[f]?.focus()}},p=m=>{c.current&&!c.current.contains(m.target)&&u()};return window.addEventListener("keydown",d),window.addEventListener("mousedown",p),()=>{window.removeEventListener("keydown",d),window.removeEventListener("mousedown",p)}},[s,e.length,u]),o.jsx("div",{ref:c,role:"menubar",className:x.cn(we.root,t),...n,children:e.map((d,p)=>{const m=s===p,f=`${a}-panel-${p}`;return o.jsxs("div",{className:we.menu,children:[o.jsx("button",{ref:h=>{i.current[p]=h},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?f:void 0,className:x.cn(we.trigger,m&&we.triggerOpen),onClick:()=>r(h=>h===p?-1:p),children:d.label}),m&&o.jsx("ul",{id:f,role:"menu",className:we.panel,children:d.items.map((h,_)=>Xb(h)?o.jsx("li",{role:"separator",className:we.separator,"aria-hidden":!0},_):o.jsx("li",{role:"none",children:o.jsxs("button",{type:"button",role:"menuitem",className:we.item,disabled:h.disabled,onClick:()=>{h.onSelect?.(),u()},children:[o.jsx("span",{className:we.itemLabel,children:h.label}),h.shortcut&&o.jsx("span",{className:we.shortcut,children:h.shortcut})]})},_))})]},p)})})}const ey="tempest_root_-w3-j",ty="tempest_viewport_n0hzM",ny="tempest_track_5PA8h",sy="tempest_slide_fhfjg",ry="tempest_arrow_S92Lt",oy="tempest_prev_X8whU",ay="tempest_next_jBRSz",cy="tempest_dots_fL3Hr",iy="tempest_dot_vEB56",ly="tempest_dotActive_OSSUg",re={root:ey,viewport:ty,track:ny,slide:sy,arrow:ry,prev:oy,next:ay,dots:cy,dot:iy,dotActive:ly};function uy({children:e,loop:t=!1,showArrows:n=!0,showDots:s=!0,index:r,defaultIndex:a=0,onIndexChange:c,className:i,...u}){const d=e.length,p=r!==void 0,[m,f]=l.useState(a),h=p?r:m,_=l.useCallback(w=>{let y=w;y<0?y=t?d-1:0:y>=d&&(y=t?0:d-1),y!==h&&(p||f(y),c?.(y))},[d,t,h,p,c]),b=h<=0,v=h>=d-1,g=w=>{w.key==="ArrowRight"?(w.preventDefault(),_(h+1)):w.key==="ArrowLeft"&&(w.preventDefault(),_(h-1))};return o.jsxs("div",{role:"region","aria-roledescription":"carousel",tabIndex:0,className:x.cn(re.root,i),onKeyDown:g,...u,children:[o.jsx("div",{className:re.viewport,children:o.jsx("div",{className:re.track,style:{transform:`translateX(-${h*100}%)`},children:e.map((w,y)=>o.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":`${y+1} of ${d}`,"aria-hidden":y!==h,className:re.slide,children:w},y))})}),n&&d>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:x.cn(re.arrow,re.prev),"aria-label":"Previous slide",disabled:!t&&b,onClick:()=>_(h-1),children:"‹"}),o.jsx("button",{type:"button",className:x.cn(re.arrow,re.next),"aria-label":"Next slide",disabled:!t&&v,onClick:()=>_(h+1),children:"›"})]}),s&&d>1&&o.jsx("div",{className:re.dots,role:"tablist","aria-label":"Slides",children:e.map((w,y)=>o.jsx("button",{type:"button",role:"tab","aria-label":`Go to slide ${y+1}`,"aria-selected":y===h,className:x.cn(re.dot,y===h&&re.dotActive),onClick:()=>_(y)},y))})]})}function dy(e,t=300){const[n,s]=l.useState(e);return l.useEffect(()=>{const r=setTimeout(()=>s(e),t);return()=>clearTimeout(r)},[e,t]),n}function Kn(e=1,t=50){const[n,s]=l.useState(e),[r,a]=l.useState(t),c=l.useCallback(()=>s(1),[]);return{page:n,size:r,setPage:s,setSize:a,reset:c}}function py(e,t,n){return l.useMemo(()=>{const s=t.trim().toLowerCase();return s?typeof n=="function"?e.filter(r=>n(r,s)):e.filter(r=>n.some(a=>{const c=r[a];return c!=null&&String(c).toLowerCase().includes(s)})):e},[e,t,n])}function my(e){const[t,n]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(e),r=a=>n(a.matches);return n(s.matches),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}function fy(e,t,n,s){const r=l.useRef(t);r.current=t,l.useEffect(()=>{const a=n===void 0?typeof window>"u"?null:window:"current"in n?n.current??null:n;if(!a?.addEventListener)return;const c=i=>r.current(i);return a.addEventListener(e,c,s),()=>a.removeEventListener(e,c,s)},[e,n,s])}const hy=JSON.stringify,_y=e=>JSON.parse(e);function gy(e,t,n={}){const s=n.serialize??hy,r=n.deserialize??_y,a=l.useCallback(()=>{if(typeof window>"u")return t;try{const p=window.localStorage.getItem(e);return p===null?t:r(p)}catch{return t}},[e,t,r]),[c,i]=l.useState(a);l.useEffect(()=>{i(a())},[a]);const u=l.useCallback(p=>{i(m=>{const f=typeof p=="function"?p(m):p;try{typeof window<"u"&&window.localStorage.setItem(e,s(f))}catch{}return f})},[e,s]),d=l.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e)}catch{}i(t)},[e,t]);return l.useEffect(()=>{if(typeof window>"u")return;const p=m=>{if(m.key===e){if(m.newValue===null){i(t);return}try{i(r(m.newValue))}catch{}}};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[e,t,r]),[c,u,d]}function by(e=!1){const[t,n]=l.useState(e),s=l.useCallback(()=>n(i=>!i),[]),r=l.useCallback(()=>n(!0),[]),a=l.useCallback(()=>n(!1),[]),c=l.useCallback(i=>n(i),[]);return[t,{toggle:s,setTrue:r,setFalse:a,set:c}]}function yy(e,t=[],n={}){const{immediate:s=!1}=n,[r,a]=l.useState({status:"idle",data:void 0,error:void 0}),c=l.useRef(e);c.current=e;const i=l.useRef(0),u=l.useRef(!0);l.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const d=l.useCallback(async()=>{const m=++i.current;a(f=>({...f,status:"pending",error:void 0}));try{const f=await c.current();return u.current&&i.current===m&&a({status:"success",data:f,error:void 0}),f}catch(f){throw u.current&&i.current===m&&a({status:"error",data:void 0,error:f}),f}},[]),p=l.useCallback(()=>{i.current++,a({status:"idle",data:void 0,error:void 0})},[]);return l.useEffect(()=>{s&&d().catch(()=>{})},[s,...t]),{status:r.status,data:r.data,error:r.error,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",run:d,reset:p}}function vy(){const[e,t]=l.useState(()=>typeof navigator>"u"?!0:navigator.onLine);return l.useEffect(()=>{if(typeof window>"u")return;const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",s),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}},[]),e}function wy(){const[e,t]=l.useState(()=>typeof document>"u"?"visible":document.visibilityState);return l.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function xy(e,t={}){const[n,s]=l.useState(null),{once:r=!1,root:a,rootMargin:c,threshold:i}=t;return l.useEffect(()=>{const u=e.current;if(!u||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(([p])=>{p&&(s(p),r&&p.isIntersecting&&d.unobserve(u))},{root:a,rootMargin:c,threshold:i});return d.observe(u),()=>d.disconnect()},[e,r,a,c,i]),n}function jy(e){const[t,n]=l.useState(null);return l.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const r=new ResizeObserver(a=>{const c=a[0];if(!c)return;const i=c.contentRect;n({width:i.width,height:i.height})});return r.observe(s),()=>r.disconnect()},[e]),t}function $y(e={}){const{resetAfter:t=1500}=e,[n,s]=l.useState(!1),r=l.useRef(null),a=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),s(!1)},[]);l.useEffect(()=>()=>a(),[a]);const c=l.useCallback(async i=>{try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(i);else if(typeof document<"u"){const u=document.createElement("textarea");u.value=i,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}else return!1;return s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),t),!0}catch{return!1}},[t]);return{copied:n,copy:c,reset:a}}function ky(e,t){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1;const n=!!t.ctrl,s=!!t.meta,r=!!t.shift,a=!!t.alt;if(t.mod){if(!e.ctrlKey&&!e.metaKey)return!1}else if(e.ctrlKey!==n||e.metaKey!==s)return!1;return!(e.shiftKey!==r||e.altKey!==a)}function Ny(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:e.isContentEditable}function Sy(e,t,n={}){const{disabled:s=!1,ignoreInput:r=!0}=n;l.useEffect(()=>{if(s||typeof window>"u")return;const a=c=>{r&&Ny(c.target)||ky(c,e)&&t(c)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,r,e.key,e.ctrl,e.meta,e.shift,e.alt,e.mod,t])}function Cy(){const[e,t]=l.useState(null),[n,s]=l.useState(!1);l.useEffect(()=>{if(typeof window>"u")return;const a=i=>{i.preventDefault(),t(i)},c=()=>{t(null),s(!0)};return window.addEventListener("beforeinstallprompt",a),window.addEventListener("appinstalled",c),()=>{window.removeEventListener("beforeinstallprompt",a),window.removeEventListener("appinstalled",c)}},[]);const r=l.useCallback(async()=>{if(!e)return"unsupported";await e.prompt();const a=await e.userChoice;return t(null),a.outcome==="accepted"&&s(!0),a.outcome},[e]);return{installable:!!e,installed:n,prompt:r}}const yn=["mousemove","mousedown","keydown","touchstart","wheel","scroll"];function Ey(e=6e4){const[t,n]=l.useState(!1);return l.useEffect(()=>{if(typeof window>"u")return;let s=setTimeout(()=>n(!0),e);function r(){n(!1),clearTimeout(s),s=setTimeout(()=>n(!0),e)}for(const a of yn)window.addEventListener(a,r,{passive:!0});return()=>{clearTimeout(s);for(const a of yn)window.removeEventListener(a,r)}},[e]),t}function Ty(e={}){const{watch:t=!1,disabled:n=!1,...s}=e,[r,a]=l.useState({loading:!n,error:null,coords:null,timestamp:null});return l.useEffect(()=>{if(n||typeof navigator>"u"||!navigator.geolocation){a(u=>({...u,loading:!1}));return}const c=u=>{a({loading:!1,error:null,coords:u.coords,timestamp:u.timestamp})},i=u=>{a(d=>({...d,loading:!1,error:u}))};if(t){const u=navigator.geolocation.watchPosition(c,i,s);return()=>navigator.geolocation.clearWatch(u)}navigator.geolocation.getCurrentPosition(c,i,s)},[n,t,s.enableHighAccuracy,s.maximumAge,s.timeout]),r}function My(e){l.useEffect(()=>{if(!e||typeof document>"u")return;const t=document.body,n=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=n}},[e])}function Ry(e){const t=l.useRef(e);return t.current=e,l.useCallback((...n)=>t.current(...n),[])}function Wt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((r,a)=>Wt(r,t[a]));const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(r=>Wt(e[r],t[r]))}function Ly(e){const t=l.useRef(e);return Wt(t.current,e)||(t.current=e),t.current}function Dy(e){const t=l.useRef(void 0);return l.useEffect(()=>{t.current=e},[e]),t.current}function Iy(e,t){const n=l.useRef(e);n.current=e,l.useEffect(()=>{if(t===null)return;const s=setInterval(()=>n.current(),t);return()=>clearInterval(s)},[t])}function Py(e,t){const n=l.useRef(e);n.current=e,l.useEffect(()=>{if(t===null)return;const s=setTimeout(()=>n.current(),t);return()=>clearTimeout(s)},[t])}function Ay(e,t){const[n,s]=l.useState(e),r=l.useRef(0),a=l.useRef(null);return l.useEffect(()=>{const c=Date.now(),i=c-r.current;return i>=t?(r.current=c,s(e)):(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{r.current=Date.now(),s(e)},t-i)),()=>{a.current&&clearTimeout(a.current)}},[e,t]),n}function Fy(){const[e,t]=l.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight});return l.useEffect(()=>{if(typeof window>"u")return;const n=()=>t({width:window.innerWidth,height:window.innerHeight});return n(),window.addEventListener("resize",n,{passive:!0}),()=>window.removeEventListener("resize",n)},[]),e}function Oy(e){const[t,n]=l.useState(!1);return l.useEffect(()=>{const s=e.current;if(!s)return;const r=()=>n(!0),a=()=>n(!1);return s.addEventListener("mouseenter",r),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",r),s.removeEventListener("mouseleave",a)}},[e]),t}function By(e,t,n={}){const{delay:s=500,moveThreshold:r=10}=n,a=l.useRef(t);a.current=t,l.useEffect(()=>{const c=e.current;if(!c)return;let i=null,u=0,d=0;const p=()=>{i&&(clearTimeout(i),i=null)},m=h=>{u=h.clientX,d=h.clientY,p(),i=setTimeout(()=>{i=null,a.current()},s)},f=h=>{if(i===null)return;const _=h.clientX-u,b=h.clientY-d;Math.hypot(_,b)>r&&p()};return c.addEventListener("pointerdown",m),c.addEventListener("pointermove",f),c.addEventListener("pointerup",p),c.addEventListener("pointercancel",p),c.addEventListener("pointerleave",p),()=>{p(),c.removeEventListener("pointerdown",m),c.removeEventListener("pointermove",f),c.removeEventListener("pointerup",p),c.removeEventListener("pointercancel",p),c.removeEventListener("pointerleave",p)}},[e,s,r])}function zy(e=!1){const[t,n]=l.useState(e),s=l.useCallback(()=>n(!0),[]),r=l.useCallback(()=>n(!1),[]),a=l.useCallback(()=>n(i=>!i),[]),c=l.useMemo(()=>({open:s,close:r,toggle:a}),[s,r,a]);return[t,c]}function Wy(e=[]){const[t,n]=l.useState(e),s=l.useCallback((...h)=>{n(_=>[..._,...h])},[]),r=l.useCallback((...h)=>{n(_=>[...h,..._])},[]),a=l.useCallback((h,..._)=>{n(b=>[...b.slice(0,h),..._,...b.slice(h)])},[]),c=l.useCallback((...h)=>{const _=new Set(h);n(b=>b.filter((v,g)=>!_.has(g)))},[]),i=l.useCallback(({from:h,to:_})=>{n(b=>{const v=[...b],[g]=v.splice(h,1);return v.splice(_,0,g),v})},[]),u=l.useCallback((h,_)=>{n(b=>b.map((v,g)=>g===h?_:v))},[]),d=l.useCallback(h=>n(h),[]),p=l.useCallback(h=>{n(_=>_.map(h))},[]),m=l.useCallback(()=>n([]),[]),f=l.useMemo(()=>({append:s,prepend:r,insert:a,remove:c,reorder:i,setItem:u,setState:d,apply:p,clear:m}),[s,r,a,c,i,u,d,p,m]);return[t,f]}const et=(e,t,n)=>{let s=e;return typeof t=="number"&&(s=Math.max(t,s)),typeof n=="number"&&(s=Math.min(n,s)),s};function qy(e=0,t={}){const{min:n,max:s}=t,[r,a]=l.useState(()=>et(e,n,s)),c=l.useCallback(()=>{a(m=>et(m+1,n,s))},[n,s]),i=l.useCallback(()=>{a(m=>et(m-1,n,s))},[n,s]),u=l.useCallback(m=>{a(et(m,n,s))},[n,s]),d=l.useCallback(()=>{a(et(e,n,s))},[e,n,s]),p=l.useMemo(()=>({increment:c,decrement:i,set:u,reset:d}),[c,i,u,d]);return[r,p]}function Uy(e){l.useEffect(()=>{if(typeof document>"u")return;const t=document.title;return document.title=e,()=>{document.title=t}},[e])}function Ky(e){l.useEffect(()=>{if(typeof document>"u")return;let t=document.querySelector('link[rel="icon"]');t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},[e])}function Hy(e){const[t,n]=l.useState(()=>new Map(e)),s=l.useCallback((u,d)=>{n(p=>{const m=new Map(p);return m.set(u,d),m})},[]),r=l.useCallback(u=>{n(d=>{if(!d.has(u))return d;const p=new Map(d);return p.delete(u),p})},[]),a=l.useCallback(()=>{n(u=>u.size===0?u:new Map)},[]),c=l.useCallback(u=>t.get(u),[t]),i=l.useCallback(u=>t.has(u),[t]);return l.useMemo(()=>({map:t,set:s,delete:r,clear:a,get:c,has:i,size:t.size}),[t,s,r,a,c,i])}function Gy(e){const[t,n]=l.useState(()=>new Set(e)),s=l.useCallback(u=>{n(d=>{if(d.has(u))return d;const p=new Set(d);return p.add(u),p})},[]),r=l.useCallback(u=>{n(d=>{if(!d.has(u))return d;const p=new Set(d);return p.delete(u),p})},[]),a=l.useCallback(()=>{n(u=>u.size===0?u:new Set)},[]),c=l.useCallback(u=>t.has(u),[t]),i=l.useCallback(u=>{n(d=>{const p=new Set(d);return p.has(u)?p.delete(u):p.add(u),p})},[]);return l.useMemo(()=>({set:t,add:s,delete:r,clear:a,has:c,toggle:i,size:t.size}),[t,s,r,a,c,i])}function Jy(e={}){const{initialValues:t=[],limit:n=1/0}=e,[s,r]=l.useState(()=>({queue:t.slice(0,n),overflow:t.slice(n)})),a=l.useCallback((...u)=>{r(d=>{const p=[...d.queue,...d.overflow,...u];return{queue:p.slice(0,n),overflow:p.slice(n)}})},[n]),c=l.useCallback(u=>{r(d=>{const p=[...u(d.queue),...d.overflow];return{queue:p.slice(0,n),overflow:p.slice(n)}})},[n]),i=l.useCallback(()=>{r(u=>({queue:u.overflow.slice(0,n),overflow:u.overflow.slice(n)}))},[n]);return l.useMemo(()=>({queue:s.queue,add:a,update:c,cleanQueue:i,size:s.queue.length}),[s.queue,a,c,i])}function Qy(e){const t=l.useRef(null),n=l.useRef(e);return n.current=e,l.useEffect(()=>{if(typeof document>"u")return;const s=r=>{const a=r.target;!t.current||a&&t.current.contains(a)||n.current()};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[]),t}function Yy(){const e=l.useRef(!0);return e.current?(e.current=!1,!0):!1}const Vy="tempest_wrapper_iB6ka",Xy="tempest_search_2y-yM",Zy="tempest_sortButton_9p6w4",ev="tempest_sortIndicator_bZMlH",pt={wrapper:Vy,search:Xy,sortButton:Zy,sortIndicator:ev};function tv(e,t){return e==null&&t==null?0:e==null?-1:t==null?1:typeof e=="number"&&typeof t=="number"?e-t:e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():typeof e=="boolean"&&typeof t=="boolean"?Number(e)-Number(t):String(e).localeCompare(String(t),void 0,{numeric:!0})}function nv({data:e,columns:t,pageSize:n=10,searchable:s=!1,searchKeys:r,initialSort:a,rowKey:c=(p,m)=>m,emptyMessage:i,className:u,...d}){const[p,m]=l.useState(""),[f,h]=l.useState(a??null),{page:_,setPage:b}=Kn(1,n),v=l.useMemo(()=>r&&r.length>0?r:t.filter(N=>{const k=e.find(D=>D[N.key]!=null),E=k?k[N.key]:void 0;return typeof E=="string"||typeof E=="number"}).map(N=>N.key),[r,t,e]),g=l.useMemo(()=>{const N=p.trim().toLowerCase();return!N||!s?e:e.filter(k=>v.some(E=>{const D=k[E];return D!=null&&String(D).toLowerCase().includes(N)}))},[e,p,s,v]),w=l.useMemo(()=>{if(!f)return g;const N=f.direction==="asc"?1:-1;return[...g].sort((k,E)=>tv(k[f.key],E[f.key])*N)},[g,f]),y=Math.max(1,Math.ceil(w.length/n));l.useEffect(()=>{_>y&&b(y)},[_,y,b]);const j=Math.min(_,y),S=l.useMemo(()=>{const N=(j-1)*n;return w.slice(N,N+n)},[w,j,n]);function M(N){h(k=>!k||k.key!==N?{key:N,direction:"asc"}:k.direction==="asc"?{key:N,direction:"desc"}:null)}const T=l.useMemo(()=>t.map(N=>{const E=f?.key===N.key?f?.direction==="asc"?" ▲":" ▼":"",D=N.sortable?o.jsxs("button",{type:"button",className:pt.sortButton,onClick:()=>M(N.key),"aria-label":`Ordenar por ${typeof N.header=="string"?N.header:String(N.key)}`,children:[N.header,o.jsx("span",{className:pt.sortIndicator,"aria-hidden":!0,children:E})]}):N.header;return{key:String(N.key),header:D,align:N.align,priority:N.priority,width:N.width,render:N.render?$=>N.render($):$=>$[N.key]??null}}),[t,f]);return o.jsxs("div",{className:x.cn(pt.wrapper,u),...d,children:[s&&o.jsx(Pn,{value:p,onChange:N=>{m(N),b(1)},wrapperClassName:pt.search}),o.jsx(Fn,{columns:T,data:S,rowKey:(N,k)=>c(N,(j-1)*n+k),emptyMessage:i}),y>1&&o.jsx(Rn,{page:j,totalPages:y,onPageChange:b,totalItems:w.length})]})}const sv="tempest_tile_ZpED6",rv="tempest_interactive_3ICXQ",ov="tempest_selected_dMY11",av="tempest_disabled_HnXxf",cv="tempest_leading_gSuBb",iv="tempest_trailing_cVd1n",lv="tempest_body_gyEl2",uv="tempest_title_jWFBN",dv="tempest_subtitle_GUtn7",xe={tile:sv,interactive:rv,selected:ov,disabled:av,leading:cv,trailing:iv,body:lv,title:uv,subtitle:dv};function pv({leading:e,title:t,subtitle:n,trailing:s,onClick:r,disabled:a=!1,selected:c=!1,className:i}){const u=o.jsxs(o.Fragment,{children:[e!==void 0&&o.jsx("span",{className:xe.leading,children:e}),o.jsxs("span",{className:xe.body,children:[o.jsx("span",{className:xe.title,children:t}),n!==void 0&&o.jsx("span",{className:xe.subtitle,children:n})]}),s!==void 0&&o.jsx("span",{className:xe.trailing,children:s})]}),d=x.cn(xe.tile,c&&xe.selected,a&&xe.disabled,i);return r?o.jsx("button",{type:"button",className:x.cn(d,xe.interactive),"aria-pressed":c?!0:void 0,disabled:a,onClick:r,children:u}):o.jsx("div",{className:d,children:u})}const mv="tempest_fab_U3NIL",fv="tempest_primary_8lnHI",hv="tempest_surface_ZTMQ4",_v="tempest_round_ljguw",gv="tempest_sm_3-rLi",bv="tempest_md_vOdzW",yv="tempest_lg_Xc6vE",vv="tempest_extended_GhPio",wv="tempest_icon_cZ8Nq",xv="tempest_label_tfoCq",jv="tempest_fixed_Xr8Xa",$v="tempest_bottomRight_bJ8Oo",kv="tempest_bottomLeft_USN6N",ue={fab:mv,primary:fv,surface:hv,round:_v,sm:gv,md:bv,lg:yv,extended:vv,icon:wv,label:xv,fixed:jv,bottomRight:$v,bottomLeft:kv};function Nv({icon:e,label:t,position:n="bottom-right",size:s="md",variant:r="primary",className:a,...c}){const i=t!==void 0;return o.jsxs("button",{type:"button",className:x.cn(ue.fab,ue[s],ue[r],i?ue.extended:ue.round,n!=="none"&&ue.fixed,n==="bottom-right"&&ue.bottomRight,n==="bottom-left"&&ue.bottomLeft,a),...c,children:[o.jsx("span",{className:ue.icon,children:e}),i&&o.jsx("span",{className:ue.label,children:t})]})}const Sv="tempest_rail_bvns5",Cv="tempest_header_Mikit",Ev="tempest_list_rS6XJ",Tv="tempest_footer_ojpGC",Mv="tempest_item_XEXI9",Rv="tempest_active_U3hSU",Lv="tempest_iconWrap_iVwlb",Dv="tempest_icon_-hpb6",Iv="tempest_badge_1YxwU",Pv="tempest_label_zCKyA",de={rail:Sv,header:Cv,list:Ev,footer:Tv,item:Mv,active:Rv,iconWrap:Lv,icon:Dv,badge:Iv,label:Pv};function Av({items:e,value:t,onChange:n,header:s,footer:r,labelVisibility:a="all",className:c,...i}){return o.jsxs("nav",{className:x.cn(de.rail,c),"aria-label":"Navegação lateral",...i,children:[s!==void 0&&o.jsx("div",{className:de.header,children:s}),o.jsx("ul",{className:de.list,children:e.map(u=>{const d=u.key===t,p=a==="all"||a==="selected"&&d;return o.jsx("li",{children:o.jsxs("button",{type:"button",className:x.cn(de.item,d&&de.active),"aria-current":d?"page":void 0,disabled:u.disabled,onClick:()=>n(u.key),children:[o.jsxs("span",{className:de.iconWrap,children:[u.icon&&o.jsx("span",{className:de.icon,children:u.icon}),u.badge!==void 0&&o.jsx("span",{className:de.badge,children:u.badge})]}),p&&o.jsx("span",{className:de.label,children:u.label})]})},u.key)})}),r!==void 0&&o.jsx("div",{className:de.footer,children:r})]})}const Fv="tempest_wrapper_tFKNC",Ov="tempest_label_FUecv",Bv="tempest_columns_XMru6",zv="tempest_column_bwotJ",Wv="tempest_cellWrapper_xRos3",qv="tempest_cell_eSc7G",Uv="tempest_active_6amgd",Kv="tempest_helper_ihHGE",Hv="tempest_disabled_NDezB",A={wrapper:Fv,label:Ov,columns:Bv,column:zv,cellWrapper:Wv,cell:qv,active:Uv,helper:Kv,disabled:Hv};function mt(e){return e.toString().padStart(2,"0")}function Gv(e){const t=/^(\d{1,2}):(\d{1,2})$/.exec(e.trim());if(!t)return{hour24:null,minute:null};const n=Number(t[1]),s=Number(t[2]);return n<0||n>23||s<0||s>59?{hour24:null,minute:null}:{hour24:n,minute:s}}function Jv(e){const t=e%12;return t===0?12:t}function Rt(e,t){const n=e%12;return t==="PM"?n+12:n}function Qv({value:e,onChange:t,minuteStep:n=5,use12Hours:s=!1,label:r,helperText:a,disabled:c,className:i}){const u=l.useId(),{hour24:d,minute:p}=l.useMemo(()=>Gv(e),[e]),m=d!==null&&d>=12?"PM":"AM",f=l.useMemo(()=>s?Array.from({length:12},(y,j)=>j+1):Array.from({length:24},(y,j)=>j),[s]),h=l.useMemo(()=>{const y=n>0?n:1,j=[];for(let S=0;S<60;S+=y)j.push(S);return j},[n]),_=d===null?null:s?Jv(d):d,b=(y,j)=>{t(`${mt(y)}:${mt(j)}`)},v=y=>{if(c)return;const j=p??0,S=s?Rt(y,m):y;b(S,j)},g=y=>{if(c)return;const j=d??(s?Rt(12,"AM"):0);b(j,y)},w=y=>{if(c)return;const j=_??12,S=p??0;b(Rt(j,y),S)};return o.jsxs("div",{className:x.cn(A.wrapper,c&&A.disabled,i),children:[r&&o.jsx("span",{id:`${u}-label`,className:A.label,children:r}),o.jsxs("div",{className:A.columns,children:[o.jsx("ul",{role:"listbox","aria-label":"Horas",className:A.column,children:f.map(y=>{const j=y===_;return o.jsx("li",{className:A.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:c,className:x.cn(A.cell,j&&A.active),onClick:()=>v(y),children:s?y:mt(y)})},y)})}),o.jsx("ul",{role:"listbox","aria-label":"Minutos",className:A.column,children:h.map(y=>{const j=y===p;return o.jsx("li",{className:A.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:c,className:x.cn(A.cell,j&&A.active),onClick:()=>g(y),children:mt(y)})},y)})}),s&&o.jsx("ul",{role:"listbox","aria-label":"Período",className:A.column,children:["AM","PM"].map(y=>{const j=_!==null&&y===m;return o.jsx("li",{className:A.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:c,className:x.cn(A.cell,j&&A.active),onClick:()=>w(y),children:y})},y)})})]}),a&&o.jsx("span",{className:A.helper,children:a})]})}const Yv="tempest_wrapper_vGp-3",Vv="tempest_indicator_S7mV0",Xv="tempest_content_bZdpc",Zv="tempest_dragging_BvUty",ft={wrapper:Yv,indicator:Vv,content:Xv,dragging:Zv};function ew(e,t){const n=t*1.5;return Math.min(e/2,n)}function tw({onRefresh:e,children:t,threshold:n=80,disabled:s,className:r}){const a=l.useRef(null),c=l.useRef(null),[i,u]=l.useState(0),[d,p]=l.useState(!1),m=c.current!==null,f=w=>{if(s||d)return;const y=a.current;if(!y||y.scrollTop>0)return;const j=w.touches[0];j&&(c.current=j.clientY)},h=w=>{if(s||d)return;const y=c.current;if(y===null)return;const j=w.touches[0];if(!j)return;const S=j.clientY-y;if(S<=0){u(0);return}u(ew(S,n))},_=()=>{c.current=null,u(0)},b=async()=>{if(s||d){_();return}if(!(c.current!==null&&i>=n)){_();return}c.current=null,p(!0),u(n);try{await e()}finally{p(!1),u(0)}},v=d||i>0,g=Math.min(1,i/n);return o.jsxs("div",{ref:a,className:x.cn(ft.wrapper,r),"data-refreshing":d,onTouchStart:f,onTouchMove:h,onTouchEnd:b,children:[o.jsx("div",{className:ft.indicator,"aria-hidden":!v,style:{opacity:d?1:g,transform:`translateX(-50%) translateY(${v?i:0}px) rotate(${g*360}deg)`},children:o.jsx(An,{size:"sm",label:"Atualizando"})}),o.jsx("div",{className:x.cn(ft.content,(m||d)&&ft.dragging),style:{transform:`translateY(${v?i:0}px)`},children:t})]})}function nw(e){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(e)}function sw(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR").format(t)}function rw(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR",{dateStyle:"short",timeStyle:"short"}).format(t)}function Hn(e){const t=e.replace(/\D/g,"").slice(0,11);return t.length<=10?t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2"):t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2")}function Gn(e){return e.replace(/\D/g,"").slice(0,11).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2")}function ow(e){return new Intl.NumberFormat("pt-BR",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}const aw={get(e,t){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}},set(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}},remove(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}}};function cw(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function iw(e,t,n="…"){if(e.length<=t)return e;const s=Math.max(0,t-n.length);return e.slice(0,s).trimEnd()+n}function lw(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function uw(e){const t=e.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);return t.length===0?"":t.map((n,s)=>{const r=n.toLowerCase();return s===0?r:r.charAt(0).toUpperCase()+r.slice(1)}).join("")}function dw(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function pw(e,t,n){return e===1?t:n??`${t}s`}function mw(e,t){const n={};for(const s of e){const r=t(s);(n[r]??=[]).push(s)}return n}function fw(e,t){const n=new Set,s=[];for(const r of e){const a=t(r);n.has(a)||(n.add(a),s.push(r))}return s}function hw(e,t){if(t<1)throw new RangeError(`chunk size must be >= 1, received ${t}`);const n=[];for(let s=0;s<e.length;s+=t)n.push(e.slice(s,s+t));return n}function _w(e,t,n=1){const s=[];if(n===0)return s;if(n>0)for(let r=e;r<t;r+=n)s.push(r);else for(let r=e;r>t;r+=n)s.push(r);return s}function tt(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function gw(e,t){const n={};for(const s of t)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n}function bw(e,t){const n=new Set(t),s={};for(const r of Object.keys(e))n.has(r)||(s[r]=e[r]);return s}function Jn(e,t){if(!tt(e)||!tt(t))return t===void 0?e:t;const n={...e};for(const s of Object.keys(t)){const r=t[s],a=n[s];tt(a)&&tt(r)?n[s]=Jn(a,r):n[s]=r}return n}function yw(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:tt(e)?Object.keys(e).length===0:!1}function vw(e){return e!=null}function ww(e){return typeof e=="string"}function xw(e){return typeof e=="number"&&!Number.isNaN(e)}function jw(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function $w(e,t){throw new Error(t??`Unexpected value: ${String(e)}`)}function kw(e,t){let n;const s=(...r)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...r)},t)};return s.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},s}function Nw(e,t){let n,s,r=0;const a=i=>{r=Date.now(),e(...i)},c=(...i)=>{const u=Date.now(),d=t-(u-r);d<=0?(n!==void 0&&(clearTimeout(n),n=void 0),a(i)):(s=i,n===void 0&&(n=setTimeout(()=>{if(n=void 0,s!==void 0){const p=s;s=void 0,a(p)}},d)))};return c.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0),s=void 0,r=0},c}function Sw(e){let t=!1,n;return(...s)=>(t||(t=!0,n=e(...s)),n)}function Cw(e){let t=!1,n,s;const r=a=>{if(!t||a.length!==n.length)return!1;for(let c=0;c<a.length;c++)if(!Object.is(a[c],n[c]))return!1;return!0};return(...a)=>(r(a)||(n=a,s=e(...a),t=!0),s)}function Ew(e){return new Promise(t=>setTimeout(t,e))}function Tw(e,t,n){return new Promise((s,r)=>{const a=setTimeout(()=>{const c=new Error(n??`Operation timed out after ${t}ms`);c.name="TimeoutError",r(c)},t);e.then(c=>{clearTimeout(a),s(c)},c=>{clearTimeout(a),r(c)})})}function Kt(e){let t;if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")t=crypto.randomUUID();else{const n=Date.now().toString(36),s=Math.random().toString(36).slice(2,10);t=`${n}-${s}`}return e?`${e}-${t}`:t}class wt extends Error{status;detail;code;requestId;body;constructor(t){super(t.detail),this.name="TempestApiError",this.status=t.status,this.detail=t.detail,this.code=t.code,this.requestId=t.requestId,this.body=t.body}}function Mw(e){return typeof e=="object"&&e!==null&&typeof e.status=="number"&&typeof e.detail=="string"}function Ht(e,t,n,s){const r=typeof t=="object"&&t!==null?t:null,a=r?.detail??r?.message??`Erro ${e}`,c=typeof r?.code=="string"?r.code:void 0,i=typeof r?.details=="object"&&r.details!==null?r.details:null,u=(typeof i?.request_id=="string"?i.request_id:void 0)??n?.get("X-Request-ID")??s??void 0;return{status:e,detail:String(a),code:c,requestId:u??void 0,retryAfter:Rw(n?.get("Retry-After")),body:t}}function Rw(e){if(!e)return;const t=e.trim();if(/^\d+$/.test(t))return Number(t);const n=Date.parse(t);if(!Number.isNaN(n))return Math.max(0,Math.round((n-Date.now())/1e3))}function Lw(e,t,n){const s=new URL(t,e.endsWith("/")?e:`${e}/`);if(n)for(const[r,a]of Object.entries(n))a!=null&&s.searchParams.set(r,String(a));return s.toString()}function Dw(e){return typeof FormData<"u"&&e instanceof FormData}async function vn(e,t){let n=null;try{n=await e.clone().json()}catch{try{n=await e.text()}catch{n=null}}return new wt(Ht(e.status,n,e.headers,t))}function _t(e){const t=e.fetcher??globalThis.fetch.bind(globalThis);function n(){const c=e.getToken?.();return c?{Authorization:`Bearer ${c}`}:{}}async function s(c,i,u){const{body:d,params:p,headers:m,...f}=i,h=Dw(d),_={...h?{}:{"Content-Type":"application/json"},...u?{"X-Request-ID":u}:{},...e.headers,...n(),...m},b={...f,headers:_,credentials:e.withCredentials?"include":f.credentials,body:d==null?void 0:h?d:JSON.stringify(d)};return t(Lw(e.baseURL,c,p),b)}async function r(c,i={}){const u=e.requestId?e.requestId():Kt();let d=await s(c,i,u);if(d.status===401)if(e.refresh)try{await e.refresh(),d=await s(c,i,u)}catch{throw await e.onUnauthorized?.(d),await vn(d,u)}else await e.onUnauthorized?.(d);if(!d.ok)throw await vn(d,u);return d.status===204?void 0:(d.headers.get("content-type")??"").includes("application/json")?await d.json():await d.text()}async function a(c,i,u="POST"){return r(c,{method:u,body:i})}return{request:r,get:(c,i)=>r(c,{...i,method:"GET"}),post:(c,i)=>r(c,{...i,method:"POST"}),put:(c,i)=>r(c,{...i,method:"PUT"}),patch:(c,i)=>r(c,{...i,method:"PATCH"}),delete:(c,i)=>r(c,{...i,method:"DELETE"}),upload:a}}function Iw(e,t,n){const s=e.safeParse(t);if(s.success)return s.data;if(typeof process<"u"&&(process.env?.NODE_ENV==="development"||process.env?.NODE_ENV==="test")){const a=s.error.issues.map(c=>` - ${c.path.join(".")||"<root>"}: ${c.message}`).join(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("./sw.cjs"),o=require("react/jsx-runtime"),l=require("react"),x=require("./cn-CNScIEB4.cjs"),Mn=require("lucide-react"),G=require("@tanstack/react-query"),I=require("react-router-dom"),Ye=require("react-dom"),me=require("react-hook-form"),Ot=require("zustand"),wt=require("zustand/middleware"),Is=require("dexie"),Ps="tempest_accordion_LVhhv",As="tempest_item_7ryVk",Fs="tempest_header_WaTdJ",Os="tempest_trigger_9BYFY",Bs="tempest_chevron_i-HVZ",zs="tempest_open_98jLY",Ws="tempest_panel_Wx50w",Ee={accordion:Ps,item:As,header:Fs,trigger:Os,chevron:Bs,open:zs,panel:Ws};function qs({items:e,multiple:t=!1,value:n,defaultValue:s=[],onChange:r,className:a}){const c=l.useId(),i=n!==void 0,[u,d]=l.useState(s),p=i?n:u,m=l.useCallback(f=>{const h=p.includes(f),_=t?h?p.filter(b=>b!==f):[...p,f]:h?[]:[f];i||d(_),r?.(_)},[p,t,i,r]);return o.jsx("div",{className:x.cn(Ee.accordion,a),children:e.map(f=>{const h=p.includes(f.id),_=`${c}-${f.id}-panel`,b=`${c}-${f.id}-trigger`;return o.jsxs("div",{className:x.cn(Ee.item,h&&Ee.open),children:[o.jsx("h3",{className:Ee.header,children:o.jsxs("button",{type:"button",id:b,className:Ee.trigger,"aria-expanded":h,"aria-controls":_,disabled:f.disabled,onClick:()=>m(f.id),children:[o.jsx("span",{children:f.title}),o.jsx(Us,{className:Ee.chevron})]})}),h&&o.jsx("div",{id:_,role:"region","aria-labelledby":b,className:Ee.panel,children:f.children})]},f.id)})})}function Us({className:e}){return o.jsx("svg",{className:e,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ks="tempest_alert_7cYyI",Hs="tempest_content_UXnmZ",Gs="tempest_title_abGgF",Js="tempest_description_pXPvw",Qs="tempest_icon_Zg6SB",Ys="tempest_close_narep",Vs="tempest_neutral_J7MH1",Xs="tempest_solid_s-oW5",Zs="tempest_outline_v7w9b",er="tempest_info_9r3r1",tr="tempest_success_1bzoB",nr="tempest_warning_q-j1Q",sr="tempest_danger_CiZkW",he={alert:Ks,content:Hs,title:Gs,description:Js,icon:Qs,close:Ys,neutral:Vs,solid:Xs,outline:Zs,info:er,success:tr,warning:nr,danger:sr};function rr({variant:e="info",appearance:t="soft",title:n,description:s,icon:r,onClose:a,closeLabel:c="Dismiss",className:i,children:u,...d}){return o.jsxs("div",{role:"alert",className:x.cn(he.alert,he[e],t==="solid"&&he.solid,t==="outline"&&he.outline,i),...d,children:[r&&o.jsx("span",{className:he.icon,children:r}),o.jsxs("div",{className:he.content,children:[n&&o.jsx("p",{className:he.title,children:n}),s&&o.jsx("p",{className:he.description,children:s}),u]}),a&&o.jsx("button",{type:"button",className:he.close,onClick:a,"aria-label":c,children:o.jsx(or,{})})]})}function or(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:o.jsx("path",{d:"M6 6l12 12M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const ar="tempest_bar_SHqWS",cr="tempest_centered_S0CCw",ir="tempest_surface_fusKb",lr="tempest_primary_QcCyN",ur="tempest_transparent_uGrsu",dr="tempest_bordered_5M9FZ",pr="tempest_sticky_DStUO",mr="tempest_safeArea_Vo3Bi",fr="tempest_leading_mXv-d",hr="tempest_actions_x7tMx",_r="tempest_title_qaMMQ",gr="tempest_brand_xKt54",br="tempest_iconBtn_S-BTg",ee={bar:ar,centered:cr,surface:ir,primary:lr,transparent:ur,bordered:dr,sticky:pr,safeArea:mr,leading:fr,actions:hr,title:_r,brand:gr,iconBtn:br};function yr({title:e,leading:t,showBack:n=!1,onBack:s,backLabel:r="Go back",backIcon:a,brand:c,actions:i,centered:u=!1,sticky:d=!0,tone:p="surface",bordered:m=!0,safeArea:f=!0,className:h,..._}){const b=s??(()=>window.history.back()),y=t??o.jsxs(o.Fragment,{children:[n&&o.jsx("button",{type:"button",className:ee.iconBtn,onClick:b,"aria-label":r,children:a??o.jsx(Mn.ArrowLeft,{size:22,"aria-hidden":"true"})}),c&&o.jsx("span",{className:ee.brand,children:c})]});return o.jsxs("header",{className:x.cn(ee.bar,ee[p],u&&ee.centered,d&&ee.sticky,m&&ee.bordered,f&&ee.safeArea,h),..._,children:[o.jsx("div",{className:ee.leading,children:y}),e!=null&&e!==""&&o.jsx("h1",{className:ee.title,"aria-live":"polite",children:e}),o.jsx("div",{className:ee.actions,children:i})]})}const xt={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},vr=["xs","sm","md","lg","xl","2xl"];function wr(e){let t="xs";for(const n of vr)e>=xt[n]&&(t=n);return t}function Be(){const[e,t]=l.useState(()=>typeof window>"u"?0:window.innerWidth);l.useEffect(()=>{if(typeof window>"u")return;const a=()=>t(window.innerWidth);return a(),window.addEventListener("resize",a,{passive:!0}),()=>window.removeEventListener("resize",a)},[]);const n=wr(e),s=a=>e>=xt[a],r=a=>e<xt[a];return{current:n,width:e,above:s,below:r,isMobile:r("md"),isTablet:s("md")&&r("lg"),isDesktop:s("lg")}}const xr="tempest_shell_-xp0O",jr="tempest_navbar_liTKV",$r="tempest_row_PE41P",kr="tempest_sidebar_wyx-V",Nr="tempest_main_O3GFv",Sr="tempest_footer_IFW4q",Cr="tempest_bottomNav_pKJ1v",Te={shell:xr,navbar:jr,row:$r,sidebar:kr,main:Nr,footer:Sr,bottomNav:Cr};function Er({navbar:e,sidebar:t,bottomNav:n,footer:s,sidebarBreakpoint:r="md",className:a,children:c,...i}){const d=Be().above(r);return o.jsxs("div",{className:x.cn(Te.shell,a),...i,children:[e&&o.jsx("div",{className:Te.navbar,children:e}),o.jsxs("div",{className:Te.row,children:[t&&d&&o.jsx("div",{className:Te.sidebar,children:t}),o.jsx("main",{className:Te.main,children:c})]}),s&&o.jsx("div",{className:Te.footer,children:s}),n&&!d&&o.jsx("div",{className:Te.bottomNav,children:n})]})}const Tr="tempest_aspect_GnAJt",Mr={aspect:Tr};function Rr({ratio:e=16/9,className:t,style:n,children:s,...r}){const a={aspectRatio:String(e),...n};return o.jsx("div",{className:x.cn(Mr.aspect,t),style:a,...r,children:s})}const Lr="tempest_avatar_3xMuZ",Dr="tempest_image_ieqGp",Ir="tempest_xs_oSaLL",Pr="tempest_sm_sZ2bk",Ar="tempest_md_Fdkbz",Fr="tempest_lg_pTTUA",Or="tempest_xl_mW58F",Br="tempest_status_ISBnL",zr="tempest_dot_Wgfo-",Wr="tempest_online_-aWoW",qr="tempest_offline_-StX3",Ur="tempest_busy_TbwuF",ze={avatar:Lr,image:Dr,xs:Ir,sm:Pr,md:Ar,lg:Fr,xl:Or,status:Br,dot:zr,online:Wr,offline:qr,busy:Ur};function Kr(e){const t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.length===1?t[0].slice(0,2):`${t[0].charAt(0)}${t[t.length-1].charAt(0)}`}function Hr({src:e,alt:t,name:n="",size:s="md",status:r,className:a,onClick:c}){const[i,u]=l.useState(!1),d=l.useMemo(()=>Kr(n),[n]),p=e&&!i,m=c?"button":void 0,f=c?0:void 0;return o.jsxs("span",{className:x.cn(ze.avatar,ze[s],r&&ze.status,a),role:m,tabIndex:f,onClick:c,onKeyDown:c?h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c())}:void 0,children:[p?o.jsx("img",{src:e,alt:t??n,className:ze.image,onError:()=>u(!0)}):o.jsx("span",{"aria-label":t??n,children:d}),r&&o.jsx("span",{className:x.cn(ze.dot,ze[r]),"aria-hidden":!0})]})}const Gr="tempest_badge_RsuMz",Jr="tempest_sm_LYsCn",Qr="tempest_md_4Or8q",Yr="tempest_lg_Bseje",Vr="tempest_square_l63D-",Xr="tempest_neutral_lulSm",Zr="tempest_solid_0Leug",eo="tempest_outline_x06HL",to="tempest_success_u9JiS",no="tempest_warning_nsGp-",so="tempest_danger_PD2hz",ro="tempest_info_na6DQ",oo="tempest_primary_S0WCS",ao="tempest_dot_i0c-G",Me={badge:Gr,sm:Jr,md:Qr,lg:Yr,square:Vr,neutral:Xr,solid:Zr,outline:eo,success:to,warning:no,danger:so,info:ro,primary:oo,dot:ao};function co({variant:e="neutral",appearance:t="soft",size:n="md",shape:s="pill",dot:r=!1,className:a,children:c,...i}){return o.jsxs("span",{className:x.cn(Me.badge,Me[e],t==="solid"&&Me.solid,t==="outline"&&Me.outline,Me[n],s==="square"&&Me.square,a),...i,children:[r&&o.jsx("span",{className:Me.dot,"aria-hidden":!0}),c]})}const io="tempest_banner_oyoWE",lo="tempest_info_s2q0P",uo="tempest_success_uLYQ3",po="tempest_warning_9rua8",mo="tempest_danger_Uzb-6",fo="tempest_icon_vzKmx",ho="tempest_body_-Qm4K",_o="tempest_title_AeTHT",go="tempest_description_nbyf-",bo="tempest_action_47P8e",yo="tempest_close_Iy2oN",ke={banner:io,info:lo,success:uo,warning:po,danger:mo,icon:fo,body:ho,title:_o,description:go,action:bo,close:yo};function vo({variant:e="info",icon:t,title:n,action:s,dismissible:r=!1,onDismiss:a,className:c,children:i,...u}){const[d,p]=l.useState(!0);return d?o.jsxs("div",{className:x.cn(ke.banner,ke[e],c),role:"status",...u,children:[t&&o.jsx("span",{className:ke.icon,children:t}),o.jsxs("div",{className:ke.body,children:[n&&o.jsx("p",{className:ke.title,children:n}),i&&o.jsx("p",{className:ke.description,children:i})]}),s&&o.jsx("div",{className:ke.action,children:s}),r&&o.jsx("button",{type:"button",className:ke.close,"aria-label":"Fechar",onClick:()=>{p(!1),a?.()},children:"×"})]}):null}const wo="tempest_bar_kp35Q",xo="tempest_item_XfDIW",jo="tempest_active_sK54f",$o="tempest_iconWrap_yJ20b",ko="tempest_icon_TAjtI",No="tempest_badge_-c3Do",So="tempest_label_qJj3L",Re={bar:wo,item:xo,active:jo,iconWrap:$o,icon:ko,badge:No,label:So};function Co({items:e,value:t,onChange:n,showLabels:s=!0,className:r,...a}){return o.jsx("nav",{className:x.cn(Re.bar,r),"aria-label":"Navegação principal",...a,children:e.map(c=>{const i=c.key===t;return o.jsxs("button",{type:"button",className:x.cn(Re.item,i&&Re.active),"aria-current":i?"page":void 0,disabled:c.disabled,onClick:()=>n(c.key),children:[o.jsxs("span",{className:Re.iconWrap,children:[c.icon&&o.jsx("span",{className:Re.icon,children:c.icon}),c.badge!==void 0&&o.jsx("span",{className:Re.badge,children:c.badge})]}),s&&o.jsx("span",{className:Re.label,children:c.label})]},c.key)})})}const Eo="tempest_root_qXce2",To="tempest_backdrop_WLqh0",Mo="tempest_sheet_Okz1P",Ro="tempest_handle_GWCoK",Lo="tempest_handleBar_XPPiI",Do="tempest_title_i5Vuc",Io="tempest_body_bgDhJ",Le={root:Eo,backdrop:To,sheet:Mo,handle:Ro,handleBar:Lo,title:Do,body:Io};function Po({open:e,onClose:t,title:n,showHandle:s=!0,dismissOnBackdrop:r=!0,dismissOnEsc:a=!0,className:c,children:i,...u}){return l.useEffect(()=>{if(!e||!a)return;const d=p=>{p.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[e,a,t]),l.useEffect(()=>{if(!e)return;const d=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=d}},[e]),!e||typeof document>"u"?null:Ye.createPortal(o.jsxs("div",{className:Le.root,role:"dialog","aria-modal":"true",children:[o.jsx("div",{className:Le.backdrop,onClick:()=>r&&t(),"aria-hidden":"true"}),o.jsxs("div",{className:x.cn(Le.sheet,c),...u,children:[s&&o.jsx("button",{type:"button",className:Le.handle,"aria-label":"Arrastar para fechar",onClick:t,children:o.jsx("span",{className:Le.handleBar})}),n&&o.jsx("div",{className:Le.title,children:n}),o.jsx("div",{className:Le.body,children:i})]})]}),document.body)}const Ao="tempest_nav_H4g6P",Fo="tempest_item_O4g3P",Oo="tempest_link_7WM67",Bo="tempest_current_JdlcS",zo="tempest_separator_zGWyJ",Xe={nav:Ao,item:Fo,link:Oo,current:Bo,separator:zo};function Wo({items:e,separator:t="/",className:n}){return o.jsx("nav",{"aria-label":"breadcrumb",className:x.cn(Xe.nav,n),children:e.map((s,r)=>{const a=r===e.length-1,c=!a&&(s.href||s.onClick);return o.jsxs(l.Fragment,{children:[o.jsx("span",{className:Xe.item,children:c?o.jsx("a",{href:s.href,onClick:i=>{s.onClick&&(i.preventDefault(),s.onClick())},className:Xe.link,children:s.label}):o.jsx("span",{"aria-current":a?"page":void 0,className:a?Xe.current:void 0,children:s.label})}),!a&&o.jsx("span",{className:Xe.separator,"aria-hidden":!0,children:t})]},r)})})}const qo="tempest_button_2ZuB7",Uo="tempest_primary_s1sM6",Ko="tempest_secondary_R0waJ",Ho="tempest_danger_V4fX8",Go="tempest_success_w6qB6",Jo="tempest_ghost_1KINV",Qo="tempest_soft_c3kzm",Yo="tempest_outline_F5jq-",Vo="tempest_link_Zt5hw",Xo="tempest_xs_cF6m0",Zo="tempest_sm_NhG0g",ea="tempest_md_hH4h3",ta="tempest_lg_2plQf",na="tempest_xl_nx4V0",sa="tempest_iconOnly_WCpTS",ra="tempest_pill_lx8lt",oa="tempest_fullWidth_36oJT",aa="tempest_loading_EQAt2",ca="tempest_hiddenText_hIiJ2",ia="tempest_spinner_ZExvW",la="tempest_tempest-spin_UOSVC",_e={button:qo,primary:Uo,secondary:Ko,danger:Ho,success:Go,ghost:Jo,soft:Qo,outline:Yo,link:Vo,xs:Xo,sm:Zo,md:ea,lg:ta,xl:na,iconOnly:sa,pill:ra,fullWidth:oa,loading:aa,hiddenText:ca,spinner:ia,tempestSpin:la};function Qe({variant:e="primary",size:t="md",loading:n=!1,fullWidth:s=!1,iconOnly:r=!1,pill:a=!1,leftIcon:c,rightIcon:i,disabled:u,className:d,children:p,...m}){return o.jsxs("button",{className:x.cn(_e.button,_e[e],_e[t],r&&_e.iconOnly,a&&_e.pill,n&&_e.loading,s&&_e.fullWidth,d),disabled:u||n,...m,children:[n&&o.jsx("span",{className:_e.spinner,"aria-hidden":!0,children:o.jsx(ua,{})}),o.jsxs("span",{className:x.cn(n&&_e.hiddenText),children:[c,p,i]})]})}function ua(){return o.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const da="tempest_card_Cb1o4",pa="tempest_flat_LRpce",ma="tempest_raised_WmIqk",fa="tempest_elevated_5VEDw",ha="tempest_interactive_B8Tah",_a="tempest_padded_oOxwN",ga="tempest_flush_aiDZi",ba="tempest_header_PTXf2",ya="tempest_title_mSgoo",va="tempest_body_W441Z",wa="tempest_footer_Mu-JC",te={card:da,flat:pa,raised:ma,elevated:fa,interactive:ha,padded:_a,flush:ga,header:ba,title:ya,body:va,footer:wa};function xa({title:e,actions:t,footer:n,flush:s=!1,interactive:r=!1,elevation:a="default",className:c,children:i,...u}){const d=!!(e||t);return o.jsxs("div",{className:x.cn(te.card,a==="flat"&&te.flat,a==="raised"&&te.raised,a==="elevated"&&te.elevated,r&&te.interactive,!d&&!s&&te.padded,s&&te.flush,c),tabIndex:r?u.tabIndex??0:u.tabIndex,...u,children:[d&&o.jsxs("header",{className:te.header,children:[typeof e=="string"?o.jsx("h3",{className:te.title,children:e}):e,t]}),d?o.jsx("div",{className:te.body,children:i}):i,n&&o.jsx("footer",{className:te.footer,children:n})]})}const ja="tempest_center_Pu1Pf",$a="tempest_both_53GWn",ka="tempest_horizontal_94-Bt",Na="tempest_vertical_Q7Kyg",tn={center:ja,both:$a,horizontal:ka,vertical:Na};function Sa({axis:e="both",minHeight:t,fullWidth:n=!0,className:s,style:r,children:a,...c}){const i={...t!==void 0?{minHeight:typeof t=="number"?`${t}px`:t}:null,...n?{width:"100%"}:null,...r};return o.jsx("div",{className:x.cn(tn.center,tn[e],s),style:i,...c,children:a})}const Ca="tempest_wrapper_rpthW",Ea="tempest_disabled_x7-eg",Ta="tempest_input_2kt-h",Ma="tempest_box_OCPee",Ra="tempest_labelWrap_Ktbp0",La="tempest_label_cwRtI",Da="tempest_description_rMhG1",De={wrapper:Ca,disabled:Ea,input:Ta,box:Ma,labelWrap:Ra,label:La,description:Da},Ia=l.forwardRef(function({label:t,description:n,indeterminate:s,disabled:r,wrapperClassName:a,className:c,...i},u){const d=l.useRef(null);l.useEffect(()=>{d.current&&(d.current.indeterminate=!!s)},[s]);function p(m){d.current=m,typeof u=="function"?u(m):u&&(u.current=m)}return o.jsxs("label",{className:x.cn(De.wrapper,r&&De.disabled,a),children:[o.jsx("input",{ref:p,type:"checkbox",disabled:r,className:x.cn(De.input,c),...i}),o.jsx("span",{className:De.box,"aria-hidden":!0,children:s?o.jsx(Aa,{}):o.jsx(Pa,{})}),(t||n)&&o.jsxs("span",{className:De.labelWrap,children:[t&&o.jsx("span",{className:De.label,children:t}),n&&o.jsx("span",{className:De.description,children:n})]})]})});function Pa(){return o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M5 12l5 5L20 7",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"})})}function Aa(){return o.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M5 12h14",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})})}const Fa="tempest_wrapper_KR4-F",Oa="tempest_label_Mz-wX",Ba="tempest_field_iIBJw",za="tempest_error_O9n-9",Wa="tempest_chip_GEwrc",qa="tempest_remove_JYDIq",Ua="tempest_input_frJmk",Ka="tempest_helper_Yts53",Ha="tempest_errorText_llJGq",ge={wrapper:Fa,label:Oa,field:Ba,error:za,chip:Wa,remove:qa,input:Ua,helper:Ka,errorText:Ha};function Ga({value:e,onChange:t,label:n,placeholder:s="Adicionar e pressionar Enter…",helperText:r,error:a,commitKeys:c=["Enter",",","Tab"],normalize:i=!0,className:u}){const[d,p]=l.useState(""),m=l.useRef(null);function f(){const b=i?d.trim().toLowerCase():d.trim();if(b){if(e.includes(b)){p("");return}t([...e,b]),p("")}}function h(b){if(c.includes(b.key)){b.preventDefault(),f();return}b.key==="Backspace"&&!d&&e.length>0&&t(e.slice(0,-1))}function _(b){const y=e.slice();y.splice(b,1),t(y)}return o.jsxs("div",{className:x.cn(ge.wrapper,a&&ge.error,u),children:[n&&o.jsx("label",{className:ge.label,children:n}),o.jsxs("div",{className:ge.field,onClick:()=>m.current?.focus(),children:[e.map((b,y)=>o.jsxs("span",{className:ge.chip,children:[b,o.jsx("button",{type:"button",className:ge.remove,"aria-label":`Remover ${b}`,onClick:()=>_(y),children:"×"})]},`${b}-${y}`)),o.jsx("input",{ref:m,className:ge.input,value:d,placeholder:e.length===0?s:"",onChange:b=>p(b.target.value),onKeyDown:h,onBlur:f})]}),a?o.jsx("span",{className:ge.errorText,children:a}):r?o.jsx("span",{className:ge.helper,children:r}):null]})}const Ja="tempest_wrapper_TNvle",Qa="tempest_label_KVkZO",Ya="tempest_field_BenH0",Va="tempest_input_-HTv1",Xa="tempest_caret_jRplQ",Za="tempest_menu_zPQG3",ec="tempest_option_vhhn5",tc="tempest_active_XCgtX",nc="tempest_selected_T6nm2",sc="tempest_empty_Ahw5K",rc="tempest_helper_OzB7V",oc="tempest_errorText_X18sQ",ac="tempest_error_bnVuM",U={wrapper:Ja,label:Qa,field:Ya,input:Va,caret:Xa,menu:Za,option:ec,active:tc,selected:nc,empty:sc,helper:rc,errorText:oc,error:ac};function cc(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function ic({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:a,error:c,disabled:i,filter:u=cc,emptyMessage:d="Nenhuma opção encontrada",className:p}){const m=l.useId(),f=l.useRef(null),h=l.useRef(null),[_,b]=l.useState(!1),[y,g]=l.useState(""),[w,v]=l.useState(0),j=l.useMemo(()=>e.find(k=>k.value===t)?.label??"",[e,t]),S=l.useMemo(()=>e.filter(k=>u(k,y)),[e,u,y]),M=l.useCallback(()=>{b(!1),g(""),v(0)},[]),T=l.useCallback(k=>{k.disabled||(n(k.value),M())},[n,M]);l.useEffect(()=>{if(!_)return;const k=E=>{f.current&&!f.current.contains(E.target)&&M()};return window.addEventListener("mousedown",k),()=>window.removeEventListener("mousedown",k)},[_,M]);const N=k=>{if(k.key==="ArrowDown")k.preventDefault(),b(!0),v(E=>Math.min(S.length-1,E+1));else if(k.key==="ArrowUp")k.preventDefault(),v(E=>Math.max(0,E-1));else if(k.key==="Enter"){k.preventDefault();const E=S[w];E&&T(E)}else k.key==="Escape"&&M()};return o.jsxs("div",{ref:f,className:x.cn(U.wrapper,c&&U.error,p),children:[s&&o.jsx("label",{htmlFor:m,className:U.label,children:s}),o.jsxs("div",{className:U.field,children:[o.jsx("input",{id:m,ref:h,type:"text",role:"combobox","aria-expanded":_,"aria-controls":`${m}-listbox`,"aria-autocomplete":"list",className:U.input,placeholder:r,disabled:i,value:_?y:j,onFocus:()=>b(!0),onChange:k=>{g(k.target.value),b(!0),v(0)},onKeyDown:N}),o.jsx("span",{className:U.caret,"aria-hidden":!0,children:"▾"})]}),_&&o.jsx("ul",{id:`${m}-listbox`,role:"listbox",className:U.menu,children:S.length===0?o.jsx("li",{className:U.empty,children:d}):S.map((k,E)=>o.jsx("li",{role:"option","aria-selected":k.value===t,className:x.cn(U.option,E===w&&U.active,k.value===t&&U.selected),onMouseEnter:()=>v(E),onMouseDown:D=>{D.preventDefault(),T(k)},children:k.label},k.value))}),c?o.jsx("span",{className:U.errorText,children:c}):a?o.jsx("span",{className:U.helper,children:a}):null]})}const lc="tempest_overlay_dd9h1",uc="tempest_tempest-fade-in_DvgSp",dc="tempest_dialog_ptM-K",pc="tempest_tempest-modal-in_UoxQC",mc="tempest_sm_K5k3W",fc="tempest_md_gvyR7",hc="tempest_lg_BgB1a",_c="tempest_xl_MR-68",gc="tempest_size2xl_-PH9e",bc="tempest_size3xl_iqDwN",yc="tempest_fullscreen_o84Xi",vc="tempest_fullscreenOnMobile_0bDwe",wc="tempest_body_lVhql",xc="tempest_header_ILG9i",jc="tempest_footer_rro2w",$c="tempest_title_A5OeE",kc="tempest_close_-ER1C",V={overlay:lc,tempestFadeIn:uc,dialog:dc,tempestModalIn:pc,sm:mc,md:fc,lg:hc,xl:_c,size2Xl:gc,size3Xl:bc,fullscreen:yc,fullscreenOnMobile:vc,body:wc,header:xc,footer:jc,title:$c,close:kc};function Gt({open:e,onClose:t,title:n,children:s,footer:r,size:a="md",closeOnBackdrop:c=!0,closeOnEsc:i=!0,className:u,hideCloseButton:d=!1,fullscreen:p=!1,fullscreenOnMobile:m=!1}){return l.useEffect(()=>{if(!e)return;const f=document.body.style.overflow;document.body.style.overflow="hidden";const h=_=>{i&&_.key==="Escape"&&t()};return window.addEventListener("keydown",h),()=>{document.body.style.overflow=f,window.removeEventListener("keydown",h)}},[e,i,t]),!e||typeof document>"u"?null:Ye.createPortal(o.jsx("div",{className:V.overlay,role:"presentation",onClick:()=>{c&&t()},children:o.jsxs("div",{role:"dialog","aria-modal":"true",className:x.cn(V.dialog,Nc(a),p&&V.fullscreen,m&&V.fullscreenOnMobile,u),onClick:f=>f.stopPropagation(),children:[(n||!d)&&o.jsxs("header",{className:V.header,children:[o.jsx("h3",{className:V.title,children:n}),!d&&o.jsx("button",{type:"button",className:V.close,"aria-label":"Fechar",onClick:t,children:o.jsx(Sc,{})})]}),o.jsx("div",{className:V.body,children:s}),r&&o.jsx("footer",{className:V.footer,children:r})]})}),document.body)}function Nc(e){return e==="2xl"?V.size2xl:e==="3xl"?V.size3xl:V[e]}function Sc(){return o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Rn({open:e,title:t,description:n,confirmLabel:s="Confirmar",cancelLabel:r="Cancelar",variant:a="primary",loading:c=!1,onConfirm:i,onCancel:u}){return o.jsx(Gt,{open:e,onClose:u,title:t,size:"sm",footer:o.jsxs(o.Fragment,{children:[o.jsx(Qe,{variant:"secondary",onClick:u,disabled:c,children:r}),o.jsx(Qe,{variant:a,loading:c,onClick:()=>{i()},children:s})]}),children:n})}const Cc="tempest_wrapper_iHNUs",Ec="tempest_label_-OEBL",Tc="tempest_required_CTss-",Mc="tempest_field_65yGJ",Rc="tempest_input_WjT81",Lc="tempest_sizeSm_cgds6",Dc="tempest_sizeMd_EPFGy",Ic="tempest_sizeLg_5Cq8k",Pc="tempest_hasLeftIcon_xYO-v",Ac="tempest_hasRightIcon_C7uyr",Fc="tempest_iconLeft_KrUhI",Oc="tempest_iconRight_Ssr47",Bc="tempest_error_VLISa",zc="tempest_helper_7Vc-s",Wc="tempest_errorText_xz4xS",z={wrapper:Cc,label:Ec,required:Tc,field:Mc,input:Rc,sizeSm:Lc,sizeMd:Dc,sizeLg:Ic,hasLeftIcon:Pc,hasRightIcon:Ac,iconLeft:Fc,iconRight:Oc,error:Bc,helper:zc,errorText:Wc},kt=l.forwardRef(function({label:t,helperText:n,error:s,leftIcon:r,rightIcon:a,wrapperClassName:c,className:i,id:u,required:d,size:p="md",...m},f){const h=l.useId(),_=u??h,b=s?`${_}-error`:n?`${_}-helper`:void 0,y=p==="sm"?z.sizeSm:p==="lg"?z.sizeLg:z.sizeMd;return o.jsxs("div",{className:x.cn(z.wrapper,s&&z.error,c),children:[t&&o.jsxs("label",{htmlFor:_,className:z.label,children:[t,d&&o.jsx("span",{className:z.required,children:"*"})]}),o.jsxs("div",{className:z.field,children:[r&&o.jsx("span",{className:z.iconLeft,children:r}),o.jsx("input",{ref:f,id:_,"aria-invalid":!!s,"aria-describedby":b,required:d,className:x.cn(z.input,y,r&&z.hasLeftIcon,a&&z.hasRightIcon,i),...m}),a&&o.jsx("span",{className:z.iconRight,children:a})]}),s?o.jsx("span",{id:`${_}-error`,className:z.errorText,children:s}):n?o.jsx("span",{id:`${_}-helper`,className:z.helper,children:n}):null]})}),qc=l.forwardRef(function({value:t,onChange:n,mode:s="date",...r},a){return o.jsx(kt,{...r,ref:a,type:s,value:t,onChange:c=>n(c.target.value)})}),Uc="tempest_divider_KSGsi",Kc="tempest_horizontal_pZ05Y",Hc="tempest_bare_elDbS",Gc="tempest_vertical_p-jD4",Jc="tempest_dashed_JWxCU",Qc="tempest_alignStart_QAIi1",Yc="tempest_alignEnd_eZDwa",J={divider:Uc,horizontal:Kc,bare:Hc,vertical:Gc,dashed:Jc,alignStart:Qc,alignEnd:Yc};function Vc({orientation:e="horizontal",variant:t="solid",label:n,align:s="center",className:r,...a}){return e==="vertical"?o.jsx("span",{role:"separator","aria-orientation":"vertical",className:x.cn(J.divider,J.vertical,t==="dashed"&&J.dashed,r),...a}):n?o.jsx("div",{role:"separator","aria-orientation":"horizontal",className:x.cn(J.divider,J.horizontal,t==="dashed"&&J.dashed,s==="start"&&J.alignStart,s==="end"&&J.alignEnd,r),...a,children:n}):o.jsx("hr",{className:x.cn(J.divider,J.horizontal,J.bare,t==="dashed"&&J.dashed,r)})}const Xc="tempest_overlay_hcG1G",Zc="tempest_tempest-drawer-overlay_XFbxY",ei="tempest_panel_wUX0N",ti="tempest_right_-oX-6",ni="tempest_tempest-drawer-in-right_pWYHv",si="tempest_left_xi3nD",ri="tempest_tempest-drawer-in-left_o7JSb",oi="tempest_top_7rGCn",ai="tempest_tempest-drawer-in-top_kn6AF",ci="tempest_bottom_zd-25",ii="tempest_tempest-drawer-in-bottom_0x3u7",li="tempest_handle_5B-TB",ui="tempest_handleTop_7aMf-",di="tempest_header_sYoP1",pi="tempest_title_LqUOu",mi="tempest_close_tYPhU",fi="tempest_body_aV9FG",hi="tempest_footer_AuvUP",le={overlay:Xc,tempestDrawerOverlay:Zc,panel:ei,right:ti,tempestDrawerInRight:ni,left:si,tempestDrawerInLeft:ri,top:oi,tempestDrawerInTop:ai,bottom:ci,tempestDrawerInBottom:ii,handle:li,handleTop:ui,header:di,title:pi,close:mi,body:fi,footer:hi};function _i({open:e,onClose:t,placement:n="right",title:s,children:r,footer:a,closeOnBackdrop:c=!0,closeOnEsc:i=!0,hideCloseButton:u=!1,className:d,mobilePlacement:p,showHandle:m=!1}){const{isMobile:f}=Be(),h=f&&p?p:n;return l.useEffect(()=>{if(!e)return;const _=document.body.style.overflow;document.body.style.overflow="hidden";const b=y=>{i&&y.key==="Escape"&&t()};return window.addEventListener("keydown",b),()=>{document.body.style.overflow=_,window.removeEventListener("keydown",b)}},[e,i,t]),!e||typeof document>"u"?null:Ye.createPortal(o.jsxs(o.Fragment,{children:[o.jsx("div",{className:le.overlay,onClick:()=>{c&&t()}}),o.jsxs("aside",{role:"dialog","aria-modal":"true",className:x.cn(le.panel,le[h],d),children:[m&&(h==="bottom"||h==="top")&&o.jsx("div",{className:x.cn(le.handle,h==="top"&&le.handleTop),"aria-hidden":!0}),(s||!u)&&o.jsxs("header",{className:le.header,children:[o.jsx("h3",{className:le.title,children:s}),!u&&o.jsx("button",{type:"button","aria-label":"Fechar",className:le.close,onClick:t,children:o.jsx(gi,{})})]}),o.jsx("div",{className:le.body,children:r}),a&&o.jsx("footer",{className:le.footer,children:a})]})]}),document.body)}function gi(){return o.jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const bi="tempest_root_5ZetV",yi="tempest_menu_-RiRW",vi="tempest_bottomStart_z60h9",wi="tempest_bottomEnd_b1tmU",xi="tempest_topStart_A0em2",ji="tempest_topEnd_cFA5-",$i="tempest_item_T-QPZ",ki="tempest_active_WNqoX",Ni="tempest_danger_C0jN3",Si="tempest_separator_RimQa",Ci="tempest_label_6yP76",ae={root:bi,menu:yi,bottomStart:vi,bottomEnd:wi,topStart:xi,topEnd:ji,item:$i,active:ki,danger:Ni,separator:Si,label:Ci};function Ei(e){switch(e){case"bottom-end":return ae.bottomEnd;case"top-start":return ae.topStart;case"top-end":return ae.topEnd;default:return ae.bottomStart}}function Ti({trigger:e,items:t,placement:n="bottom-start",className:s}){const[r,a]=l.useState(!1),[c,i]=l.useState(-1),u=l.useId(),d=l.useRef(null),p=l.useRef([]),m=t.map((y,g)=>y.type==="item"&&!y.disabled?g:-1).filter(y=>y!==-1),f=l.useCallback(()=>{a(!1),i(-1)},[]);l.useEffect(()=>{if(!r)return;const y=w=>{if(w.key==="Escape"){f();return}if(w.key==="ArrowDown"){w.preventDefault();const v=m.indexOf(c),j=m[(v+1)%m.length]??-1;i(j),p.current[j]?.focus()}if(w.key==="ArrowUp"){w.preventDefault();const v=m.indexOf(c),j=m[(v-1+m.length)%m.length]??-1;i(j),p.current[j]?.focus()}},g=w=>{d.current&&!d.current.contains(w.target)&&f()};return window.addEventListener("keydown",y),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",y),window.removeEventListener("mousedown",g)}},[r,c,m,f]);const h=y=>{e.props.onClick?.(y),a(g=>!g)},_={...e,props:{...e.props,onClick:h,"aria-expanded":r,"aria-controls":u,"aria-haspopup":"menu"}},b=y=>{y.onSelect(),f()};return o.jsxs("span",{ref:d,className:ae.root,children:[_,r&&o.jsx("ul",{id:u,role:"menu",className:x.cn(ae.menu,Ei(n),s),children:t.map((y,g)=>y.type==="separator"?o.jsx("li",{role:"separator",className:ae.separator,"aria-hidden":!0},y.id):y.type==="label"?o.jsx("li",{role:"presentation",className:ae.label,children:y.label},y.id):o.jsx("li",{role:"none",children:o.jsxs("button",{ref:w=>{p.current[g]=w},type:"button",role:"menuitem",className:x.cn(ae.item,y.danger&&ae.danger,c===g&&ae.active),disabled:y.disabled,onClick:()=>b(y),onMouseEnter:()=>i(g),children:[y.icon&&o.jsx("span",{"aria-hidden":!0,children:y.icon}),y.label]})},y.id))})]})}const Mi="tempest_zone_u04pu",Ri="tempest_dragging_uGtl4",Li="tempest_disabled_GTKfV",Di="tempest_input_qhJ1u",Ii="tempest_prompt_mlpWz",Ze={zone:Mi,dragging:Ri,disabled:Li,input:Di,prompt:Ii};function Pi({onDrop:e,accept:t,multiple:n=!0,disabled:s=!1,maxSize:r,onReject:a,children:c,className:i}){const u=l.useRef(null),[d,p]=l.useState(!1),m=w=>{if(!w||w.length===0)return;const v=Array.from(w),j=n?v:v.slice(0,1);if(r===void 0){e(j);return}const S=[],M=[];for(const T of j)T.size>r?M.push(T):S.push(T);M.length>0&&a?.(M),S.length>0&&e(S)},f=()=>{s||u.current?.click()},h=w=>{w.preventDefault(),!s&&p(!0)},_=w=>{w.preventDefault()},b=w=>{w.preventDefault(),p(!1)},y=w=>{w.preventDefault(),p(!1),!s&&m(w.dataTransfer.files)},g=w=>{(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),f())};return o.jsxs("div",{role:"button",tabIndex:s?-1:0,"aria-disabled":s||void 0,className:x.cn(Ze.zone,d&&Ze.dragging,s&&Ze.disabled,i),onClick:f,onKeyDown:g,onDragEnter:h,onDragOver:_,onDragLeave:b,onDrop:y,children:[o.jsx("input",{ref:u,type:"file",className:Ze.input,accept:t,multiple:n,disabled:s,onChange:w=>{m(w.target.files),w.target.value=""}}),c??o.jsx("span",{className:Ze.prompt,children:"Arraste arquivos aqui ou clique para selecionar"})]})}const Ai="tempest_wrapper_gzyTd",Fi="tempest_icon_qVCyh",Oi="tempest_title_xPfUf",Bi="tempest_description_oWwH1",zi="tempest_action_dqxw1",et={wrapper:Ai,icon:Fi,title:Oi,description:Bi,action:zi};function Wi({icon:e,title:t,description:n,action:s,className:r}){return o.jsxs("div",{className:x.cn(et.wrapper,r),children:[e&&o.jsx("div",{className:et.icon,children:e}),o.jsx("h4",{className:et.title,children:t}),n&&o.jsx("p",{className:et.description,children:n}),s&&o.jsx("div",{className:et.action,children:s})]})}const qi="tempest_wrapper_luRyF",Ui="tempest_icon_dEdBl",Ki="tempest_title_StutD",Hi="tempest_description_A2XCb",Gi="tempest_action_vm1LC",tt={wrapper:qi,icon:Ui,title:Ki,description:Hi,action:Gi};function Ji({title:e="Algo deu errado",description:t="Não foi possível carregar essas informações.",onRetry:n,retryLabel:s="Tentar novamente",icon:r,className:a}){return o.jsxs("div",{className:x.cn(tt.wrapper,a),children:[o.jsx("div",{className:tt.icon,children:r??o.jsx(Qi,{})}),o.jsx("h4",{className:tt.title,children:e}),t&&o.jsx("p",{className:tt.description,children:t}),n&&o.jsx("div",{className:tt.action,children:o.jsx(Qe,{variant:"secondary",onClick:n,children:s})})]})}function Qi(){return o.jsx("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Yi="tempest_wrapper_E0qHs",Vi="tempest_label_lbMkx",Xi="tempest_dropzone_jqua0",Zi="tempest_active_CG9Uk",el="tempest_disabled_WNUUl",tl="tempest_icon_i9fGH",nl="tempest_title_bTVFl",sl="tempest_subtitle_S54OV",rl="tempest_files_WljYm",ol="tempest_file_Lp-dR",al="tempest_fileMeta_LTnN2",cl="tempest_remove_jskra",il="tempest_hidden_ReEq6",K={wrapper:Yi,label:Vi,dropzone:Xi,active:Zi,disabled:el,icon:tl,title:nl,subtitle:sl,files:rl,file:ol,fileMeta:al,remove:cl,hidden:il};function ll(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/1024/1024).toFixed(1)} MB`}function ul(e,t){if(!t)return!0;const n=t.split(",").map(a=>a.trim().toLowerCase()),s=e.name.toLowerCase(),r=e.type.toLowerCase();return n.some(a=>a.startsWith(".")?s.endsWith(a):a.endsWith("/*")?r.startsWith(a.replace("/*","/")):r===a)}function dl({value:e,onChange:t,label:n,accept:s,multiple:r=!1,maxSize:a,onReject:c,disabled:i,title:u="Arraste arquivos aqui ou clique para selecionar",subtitle:d,className:p}){const[m,f]=l.useState(!1),h=l.useRef(null);function _(g){const w=[],v=[];for(const S of Array.from(g)){if(!ul(S,s)){v.push({file:S,reason:"type"});continue}if(a&&S.size>a){v.push({file:S,reason:"size"});continue}w.push(S)}if(v.length>0&&c?.(v),w.length===0)return;const j=r?[...e,...w]:w.slice(0,1);t(j)}function b(g){g.preventDefault(),f(!1),!i&&g.dataTransfer?.files&&_(g.dataTransfer.files)}function y(g){const w=e.slice();w.splice(g,1),t(w)}return o.jsxs("div",{className:x.cn(K.wrapper,p),children:[n&&o.jsx("label",{className:K.label,children:n}),o.jsxs("div",{className:x.cn(K.dropzone,m&&K.active,i&&K.disabled),role:"button",tabIndex:i?-1:0,onClick:()=>!i&&h.current?.click(),onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),h.current?.click())},onDragEnter:g=>{g.preventDefault(),i||f(!0)},onDragOver:g=>g.preventDefault(),onDragLeave:()=>f(!1),onDrop:b,children:[o.jsx("div",{className:K.icon,"aria-hidden":!0,children:o.jsx(pl,{})}),o.jsx("p",{className:K.title,children:u}),d&&o.jsx("p",{className:K.subtitle,children:d}),o.jsx("input",{ref:h,type:"file",accept:s,multiple:r,disabled:i,className:K.hidden,onChange:g=>{g.target.files&&_(g.target.files),g.target.value=""}})]}),e.length>0&&o.jsx("ul",{className:K.files,children:e.map((g,w)=>o.jsxs("li",{className:K.file,children:[o.jsxs("div",{children:[o.jsx("div",{children:g.name}),o.jsx("div",{className:K.fileMeta,children:ll(g.size)})]}),o.jsx("button",{type:"button","aria-label":`Remover ${g.name}`,className:K.remove,onClick:()=>y(w),children:"×"})]},`${g.name}-${w}`))})]})}function pl(){return o.jsx("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4M4 20h16",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const ml="tempest_form_jNBDR",fl="tempest_stack_O1Hl-",hl="tempest_inline_LBQAv",_l="tempest_grid_-B86T",gl="tempest_section_HGqw3",bl="tempest_sectionHeader_ji9hQ",yl="tempest_sectionTitle_GTPwe",vl="tempest_sectionDescription_KjW7k",wl="tempest_sectionBody_Vp2wz",xl="tempest_row_1EkVR",jl="tempest_actions_hK95I",$l="tempest_start_gXnm3",kl="tempest_center_mKkz4",Nl="tempest_end_O3yDQ",Sl="tempest_between_tte2z",ce={form:ml,stack:fl,inline:hl,grid:_l,section:gl,sectionHeader:bl,sectionTitle:yl,sectionDescription:vl,sectionBody:wl,row:xl,actions:jl,start:$l,center:kl,end:Nl,between:Sl};function Nt(e,t){return e===void 0?`${t*4}px`:typeof e=="number"?`${e*4}px`:e}function Ln(e){return e===void 0?"repeat(2, minmax(0, 1fr))":typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}const Cl=l.forwardRef(function({layout:t="stack",columns:n,gap:s,className:r,style:a,children:c,...i},u){const d={gap:Nt(s,4),...t==="grid"?{gridTemplateColumns:Ln(n)}:null,...a};return o.jsx("form",{ref:u,className:x.cn(ce.form,ce[t],r),style:d,...i,children:c})});function El({title:e,description:t,layout:n="stack",columns:s,gap:r,className:a,style:c,children:i,...u}){const d={gap:Nt(r,4),...n==="grid"?{gridTemplateColumns:Ln(s)}:null};return o.jsxs("section",{className:x.cn(ce.section,a),style:c,...u,children:[(e||t)&&o.jsxs("header",{className:ce.sectionHeader,children:[e&&o.jsx("h3",{className:ce.sectionTitle,children:e}),t&&o.jsx("p",{className:ce.sectionDescription,children:t})]}),o.jsx("div",{className:x.cn(ce.sectionBody,ce[n]),style:d,children:i})]})}function Tl({gap:e,className:t,style:n,children:s,...r}){const a={gap:Nt(e,3),...n};return o.jsx("div",{className:x.cn(ce.row,t),style:a,...r,children:s})}function Ml({align:e="end",gap:t,className:n,style:s,children:r,...a}){const c={gap:Nt(t,2),...s};return o.jsx("div",{className:x.cn(ce.actions,ce[e],n),style:c,...a,children:r})}const Rl="tempest_container_fJfOt",Ll="tempest_sm_k8D4-",Dl="tempest_md_EnpYy",Il="tempest_lg_UU-Ig",Pl="tempest_xl_2TEWj",Al="tempest_full_l8bvG",Fl="tempest_stack_sxR8u",Ol="tempest_vertical_2TMf5",Bl="tempest_horizontal_r7-c-",zl="tempest_center_EDSAh",Wl="tempest_start_ucQ-K",ql="tempest_end_pnKlF",Ul="tempest_stretch_pX6l7",Kl="tempest_justifyStart_lHYsS",Hl="tempest_justifyCenter_JH2m6",Gl="tempest_justifyEnd_EBisT",Jl="tempest_justifyBetween_mAJwT",Ql="tempest_wrap_-xxOh",Yl="tempest_grid_o-JIX",X={container:Rl,sm:Ll,md:Dl,lg:Il,xl:Pl,full:Al,stack:Fl,vertical:Ol,horizontal:Bl,center:zl,start:Wl,end:ql,stretch:Ul,justifyStart:Kl,justifyCenter:Hl,justifyEnd:Gl,justifyBetween:Jl,wrap:Ql,grid:Yl};function Vl({size:e="lg",className:t,children:n,...s}){return o.jsx("div",{className:x.cn(X.container,X[e],t),...s,children:n})}function Xl(e){return typeof e=="object"&&e!==null&&("mobile"in e||"tablet"in e||"desktop"in e)}function jt(e,t){if(e!==void 0)return Xl(e)?t==="desktop"?e.desktop??e.tablet??e.mobile:t==="tablet"?e.tablet??e.mobile??e.desktop:e.mobile??e.tablet??e.desktop:e}function Dn(e){if(e!==void 0)return typeof e=="number"?`${e*4}px`:e}function In(e,t){return e?"mobile":t?"tablet":"desktop"}function Zl({direction:e="vertical",gap:t=2,align:n,justify:s,wrap:r=!1,className:a,style:c,children:i,...u}){const{isMobile:d,isTablet:p}=Be(),m=In(d,p),f=jt(e,m)??"vertical",_={gap:Dn(jt(t,m)),...c},b=s==="between"?X.justifyBetween:s==="center"?X.justifyCenter:s==="end"?X.justifyEnd:s==="start"?X.justifyStart:void 0;return o.jsx("div",{className:x.cn(X.stack,f==="vertical"?X.vertical:X.horizontal,n&&X[n],b,r&&X.wrap,a),style:_,...u,children:i})}function eu(e){if(e!==void 0)return typeof e=="number"?`repeat(${e}, minmax(0, 1fr))`:e}function tu({columns:e=2,gap:t=4,className:n,style:s,children:r,...a}){const{isMobile:c,isTablet:i}=Be(),u=In(c,i),d=eu(jt(e,u)),p=Dn(jt(t,u));return o.jsx("div",{className:x.cn(X.grid,n),style:{gridTemplateColumns:d,gap:p,...s},...a,children:r})}function nn(){if(typeof window>"u")return!1;const t=["standalone","fullscreen","minimal-ui"].some(s=>window.matchMedia?.(`(display-mode: ${s})`)?.matches),n=window.navigator.standalone===!0;return t||n}function Jt(){const[e,t]=l.useState(null),[n,s]=l.useState(!1),[r,a]=l.useState(nn);l.useEffect(()=>{if(typeof window>"u")return;const i=m=>{m.preventDefault(),t(m)},u=()=>{t(null),s(!0),a(!0)},d=window.matchMedia?.("(display-mode: standalone)"),p=()=>a(nn());return window.addEventListener("beforeinstallprompt",i),window.addEventListener("appinstalled",u),d?.addEventListener("change",p),()=>{window.removeEventListener("beforeinstallprompt",i),window.removeEventListener("appinstalled",u),d?.removeEventListener("change",p)}},[]);const c=l.useCallback(async()=>{if(!e)return"unsupported";await e.prompt();const i=await e.userChoice;return t(null),i.outcome==="accepted"&&s(!0),i.outcome},[e]);return{installable:!!e,installed:n,isStandalone:r,prompt:c}}const nu="tempest_banner_0oCIc",su="tempest_icon_izjRL",ru="tempest_body_9JAQv",ou="tempest_title_1E50X",au="tempest_description_QY25-",cu="tempest_close_RN6FO",We={banner:nu,icon:su,body:ru,title:ou,description:au,close:cu};function iu(e){if(!e||typeof window>"u")return!1;try{return window.localStorage.getItem(e)==="1"}catch{return!1}}function lu({title:e="Instale o app",description:t,installLabel:n="Instalar",dismissLabel:s="Dispensar",icon:r,storageKey:a,onResult:c,className:i}){const{installable:u,installed:d,isStandalone:p,prompt:m}=Jt(),[f,h]=l.useState(()=>iu(a));if(!u||d||p||f)return null;const _=()=>{if(h(!0),a&&typeof window<"u")try{window.localStorage.setItem(a,"1")}catch{}};return o.jsxs("div",{className:x.cn(We.banner,i),role:"region","aria-label":String(e),children:[r&&o.jsx("span",{className:We.icon,children:r}),o.jsxs("div",{className:We.body,children:[o.jsx("p",{className:We.title,children:e}),t&&o.jsx("p",{className:We.description,children:t})]}),o.jsx(Qe,{size:"sm",onClick:async()=>{c?.(await m())},children:n}),o.jsx("button",{type:"button",className:We.close,"aria-label":s,onClick:_,children:o.jsx(Mn.X,{size:18,"aria-hidden":!0})})]})}function uu({label:e="Instalar app",onResult:t,...n}){const{installable:s,installed:r,isStandalone:a,prompt:c}=Jt();return!s||r||a?null:o.jsx(Qe,{onClick:async()=>{t?.(await c())},...n,children:e})}const du="tempest_kbd_jgbYx",pu="tempest_sm_9WPWA",mu="tempest_md_BePC0",fu="tempest_lg_cBKum",sn={kbd:du,sm:pu,md:mu,lg:fu};function hu({size:e="md",className:t,children:n,...s}){return o.jsx("kbd",{className:x.cn(sn.kbd,sn[e],t),...s,children:n})}const _u="tempest_stack_zYzdv",gu={stack:_u},Pn=l.createContext(null);function bu({children:e}){const[t,n]=l.useState([]),s=l.useRef(0),r=l.useCallback(()=>(s.current+=1,`modal-${s.current}`),[]),a=l.useCallback(p=>{n(m=>m.filter(f=>f.id!==p))},[]),c=l.useCallback(()=>{n([])},[]),i=l.useCallback(p=>{const m=r();return n(f=>[...f,{kind:"content",id:m,options:p}]),m},[r]),u=l.useCallback(p=>{const m=r();return n(f=>[...f,{kind:"confirm",id:m,options:p}]),m},[r]),d=l.useMemo(()=>({open:i,confirm:u,close:a,closeAll:c}),[i,u,a,c]);return o.jsxs(Pn.Provider,{value:d,children:[e,o.jsx("div",{className:gu.stack,children:t.map(p=>p.kind==="content"?o.jsx(yu,{entry:p,close:a},p.id):o.jsx(vu,{entry:p,close:a},p.id))})]})}function yu({entry:e,close:t}){const{options:n,id:s}=e,r=()=>{n.onClose?.(),t(s)};return o.jsx(Gt,{open:!0,onClose:r,title:n.title,size:n.size,closeOnBackdrop:n.closeOnBackdrop,closeOnEsc:n.closeOnEsc,hideCloseButton:n.hideCloseButton,children:n.children})}function vu({entry:e,close:t}){const{options:n,id:s}=e,[r,a]=l.useState(!1),c=async()=>{try{a(!0),await n.onConfirm?.()}finally{a(!1),t(s)}},i=()=>{n.onCancel?.(),t(s)};return o.jsx(Rn,{open:!0,title:n.title??"",description:n.message,confirmLabel:n.confirmLabel,cancelLabel:n.cancelLabel,variant:n.danger?"danger":"primary",loading:r,onConfirm:c,onCancel:i})}function wu(){const e=l.useContext(Pn);if(e===null)throw new Error("useModals must be used within a <ModalsProvider>");return e}const xu="tempest_navbar_Ey25T",ju="tempest_surface_xyKhM",$u="tempest_primary_w3ft-",ku="tempest_transparent_N1vMR",Nu="tempest_bordered_HD49R",Su="tempest_sticky_0XsOs",Cu="tempest_logo_O9j3q",Eu="tempest_nav_0oisE",Tu="tempest_actions_8BNWJ",Ie={navbar:xu,surface:ju,primary:$u,transparent:ku,bordered:Nu,sticky:Su,logo:Cu,nav:Eu,actions:Tu};function Mu({logo:e,nav:t,actions:n,sticky:s=!0,tone:r="surface",bordered:a=!0,className:c,...i}){return o.jsxs("header",{className:x.cn(Ie.navbar,Ie[r],s&&Ie.sticky,a&&Ie.bordered,c),...i,children:[e&&o.jsx("div",{className:Ie.logo,children:e}),t&&o.jsx("nav",{className:Ie.nav,children:t}),n&&o.jsx("div",{className:Ie.actions,children:n})]})}const Ru="tempest_bar_zxTqx",Lu={bar:Ru},Du=300,rn=.9,Iu=300;function on(e){return e<0?0:e>1?1:e}function Pu(){let e={value:0,active:!1};const t=new Set;let n=null,s=null;const r=()=>{for(const h of t)h(e)},a=h=>{e={...e,...h},r()},c=()=>{n!==null&&(clearInterval(n),n=null)},i=()=>{s!==null&&(clearTimeout(s),s=null)},u=h=>{const _=e.value;if(_>=rn)return;const b=h??(1-_)*.1+.01;a({value:Math.min(on(_+b),rn)})};return{start:()=>{i(),!e.active&&(a({active:!0,value:e.value>0?e.value:.08}),c(),n=setInterval(()=>u(),Du))},done:()=>{c(),i(),a({value:1,active:!0}),s=setTimeout(()=>{a({active:!1,value:0}),s=null},Iu)},set:h=>{i();const _=on(h);a({value:_,active:_<1?!0:e.active})},inc:u,subscribe:h=>(t.add(h),h(e),()=>{t.delete(h)})}}const An=Pu();function Au({color:e,height:t=3,className:n}){const[s,r]=l.useState({value:0,active:!1});if(l.useEffect(()=>An.subscribe(r),[]),!s.active)return null;const a={width:`${Math.round(s.value*100)}%`,height:`${t}px`,background:e??"var(--tempest-primary)"};return o.jsx("div",{className:x.cn(Lu.bar,n),style:a,role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(s.value*100)})}const Fu="tempest_page_THNNc",Ou="tempest_padded_bzjoF",Bu="tempest_header_PZEzk",zu="tempest_headerText_qYXFI",Wu="tempest_eyebrow_651RV",qu="tempest_title_2oGnT",Uu="tempest_description_YzmWl",Ku="tempest_actions_-rB3U",Hu="tempest_toolbar_sA7sD",Gu="tempest_content_RCB4b",Ju="tempest_footer_540pQ",ne={page:Fu,padded:Ou,header:Bu,headerText:zu,eyebrow:Wu,title:qu,description:Uu,actions:Ku,toolbar:Hu,content:Gu,footer:Ju};function Qu({title:e,eyebrow:t,description:n,actions:s,toolbar:r,footer:a,padded:c=!0,className:i,children:u,...d}){const p=e||t||n||s;return o.jsxs("main",{className:x.cn(ne.page,c&&ne.padded,i),...d,children:[p&&o.jsxs("header",{className:ne.header,children:[o.jsxs("div",{className:ne.headerText,children:[t&&o.jsx("div",{className:ne.eyebrow,children:t}),e&&o.jsx("h1",{className:ne.title,children:e}),n&&o.jsx("p",{className:ne.description,children:n})]}),s&&o.jsx("div",{className:ne.actions,children:s})]}),r&&o.jsx("div",{className:ne.toolbar,children:r}),o.jsx("div",{className:ne.content,children:u}),a&&o.jsx("footer",{className:ne.footer,children:a})]})}const Yu="tempest_wrapper_cRGQm",Vu="tempest_controls_fdL-y",Xu="tempest_page_WjG0l",Zu="tempest_active_1kqsJ",ed="tempest_ellipsis_V294k",td="tempest_sizeSelect_ZayTo",nd="tempest_numeric_ztI0I",sd="tempest_summary_ZTggV",se={wrapper:Yu,controls:Vu,page:Xu,active:Zu,ellipsis:ed,sizeSelect:td,numeric:nd,summary:sd};function rd(e,t,n){const s=n+4;if(t<=s)return Array.from({length:t},(i,u)=>u+1);const r=Math.max(2,e-Math.floor(n/2)),a=Math.min(t-1,r+n-1),c=[1];r>2&&c.push("...");for(let i=r;i<=a;i++)c.push(i);return a<t-1&&c.push("..."),c.push(t),c}function Fn({page:e,totalPages:t,onPageChange:n,pageSize:s,onPageSizeChange:r,pageSizeOptions:a=[10,25,50,100],totalItems:c,siblingCount:i=3,className:u}){const d=l.useMemo(()=>rd(e,t,i),[e,t,i]);return t<=1&&!r?null:o.jsxs("div",{className:x.cn(se.wrapper,u),children:[o.jsx("div",{className:se.summary,children:typeof c=="number"?`${c} resultado${c===1?"":"s"}`:`Página ${e} de ${t}`}),o.jsxs("div",{className:se.controls,children:[o.jsx("button",{type:"button",className:se.page,onClick:()=>n(Math.max(1,e-1)),disabled:e<=1,"aria-label":"Página anterior",children:"‹"}),d.map((p,m)=>p==="..."?o.jsx("span",{className:x.cn(se.ellipsis,se.numeric),children:"…"},`ellipsis-${m}`):o.jsx("button",{type:"button",className:x.cn(se.page,se.numeric,p===e&&se.active),onClick:()=>n(p),"aria-current":p===e?"page":void 0,children:p},p)),o.jsx("button",{type:"button",className:se.page,onClick:()=>n(Math.min(t,e+1)),disabled:e>=t,"aria-label":"Próxima página",children:"›"}),r&&o.jsx("select",{className:se.sizeSelect,value:s,onChange:p=>r(Number(p.target.value)),"aria-label":"Itens por página",children:a.map(p=>o.jsxs("option",{value:p,children:[p," / página"]},p))})]})]})}const od="tempest_wrapper_zEU-L",ad="tempest_label_ps3gD",cd="tempest_field_7taZG",id="tempest_input_FWEvb",ld="tempest_sm_3-CZz",ud="tempest_md_ReV0O",dd="tempest_lg_DiTiB",pd="tempest_toggle_WNeX9",md="tempest_error_QdIFf",fd="tempest_helper_mBUna",hd="tempest_errorText_73Uvv",_d="tempest_strength_i6RaQ",gd="tempest_strengthBar_PAPHR",bd="tempest_strengthLabel_u9QHS",yd="tempest_level0_n6tWv",vd="tempest_level1_FOI93",wd="tempest_level2_q5Wii",xd="tempest_level3_BpB53",jd="tempest_level4_vyQ3x",H={wrapper:od,label:ad,field:cd,input:id,sm:ld,md:ud,lg:dd,toggle:pd,error:md,helper:fd,errorText:hd,strength:_d,strengthBar:gd,strengthLabel:bd,level0:yd,level1:vd,level2:wd,level3:xd,level4:jd},$d=["Muito fraca","Fraca","Razoável","Forte","Excelente"];function On(e){if(!e)return 0;let t=0;return e.length>=8&&(t+=1),e.length>=12&&(t+=1),/[a-z]/.test(e)&&/[A-Z]/.test(e)&&(t+=1),/[0-9]/.test(e)&&(t+=1),/[^A-Za-z0-9]/.test(e)&&(t+=1),Math.min(4,t)}const kd=l.forwardRef(function({label:t,helperText:n,error:s,size:r="md",showStrength:a=!1,strength:c,strengthLabels:i=$d,toggleLabels:u={show:"Mostrar senha",hide:"Esconder senha"},className:d,value:p,defaultValue:m,...f},h){const[_,b]=l.useState(!1),y=String(p??m??""),g=c??On(y);return o.jsxs("div",{className:x.cn(H.wrapper,H[r],s&&H.error,d),children:[t&&o.jsx("label",{className:H.label,children:t}),o.jsxs("div",{className:H.field,children:[o.jsx("input",{ref:h,...f,value:p,defaultValue:m,type:_?"text":"password","aria-invalid":!!s,className:H.input}),o.jsx("button",{type:"button",className:H.toggle,"aria-label":_?u.hide:u.show,"aria-pressed":_,onClick:()=>b(w=>!w),children:_?"🙈":"👁"})]}),a&&o.jsxs("div",{className:x.cn(H.strength,H[`level${g}`]),"aria-label":i[g],children:[o.jsx("div",{className:H.strengthBar,children:o.jsx("span",{style:{width:`${g/4*100}%`}})}),o.jsx("span",{className:H.strengthLabel,children:i[g]})]}),s?o.jsx("span",{className:H.errorText,children:s}):n?o.jsx("span",{className:H.helper,children:n}):null]})}),Nd="tempest_wrapper_3WAh7",Sd="tempest_label_Hk01i",Cd="tempest_cells_URO3v",Ed="tempest_cell_fxLzs",Td="tempest_sm_SQM-s",Md="tempest_md_aHCGl",Rd="tempest_lg_JpI4A",Ld="tempest_error_Kou0o",Dd="tempest_helper_W04iL",Id="tempest_errorText_h4svq",Ne={wrapper:Nd,label:Sd,cells:Cd,cell:Ed,sm:Td,md:Md,lg:Rd,error:Ld,helper:Dd,errorText:Id},Pd=/[0-9]/,Ad=/[A-Za-z0-9]/,Fd=l.forwardRef(function({length:t=6,type:n="numeric",size:s="md",value:r,defaultValue:a,onChange:c,onComplete:i,masked:u=!1,label:d,helperText:p,error:m,disabled:f=!1,autoFocus:h=!1,id:_,className:b},y){const g=l.useId(),w=_??g,v=r!==void 0,[j,S]=l.useState(a??""),M=v?r??"":j,T=Array.from({length:t},(L,R)=>M[R]??""),N=l.useRef([]),k=n==="numeric"?Pd:Ad;l.useEffect(()=>{h&&N.current[0]?.focus()},[h]);const E=L=>{const R=L.slice(0,t);v||S(R),c?.(R),R.length===t&&i?.(R)},D=L=>{const R=Math.max(0,Math.min(t-1,L));N.current[R]?.focus(),N.current[R]?.select()},$=L=>R=>{const q=R.target.value.slice(-1);if(q&&!k.test(q))return;const ut=T.slice();ut[L]=q,E(ut.join("")),q&&D(L+1)},C=L=>R=>{if(R.key==="Backspace"){if(!T[L]&&L>0){R.preventDefault();const q=T.slice();q[L-1]="",E(q.join("")),D(L-1)}}else R.key==="ArrowLeft"?(R.preventDefault(),D(L-1)):R.key==="ArrowRight"&&(R.preventDefault(),D(L+1))},F=L=>{const R=L.clipboardData.getData("text").split("").filter(q=>k.test(q)).join("");R&&(L.preventDefault(),E(R),D(Math.min(t-1,R.length)))};return o.jsxs("div",{ref:y,className:x.cn(Ne.wrapper,m&&Ne.error,b),id:w,children:[d&&o.jsx("label",{className:Ne.label,children:d}),o.jsx("div",{className:x.cn(Ne.cells,Ne[s]),role:"group","aria-label":d,children:T.map((L,R)=>o.jsx("input",{ref:q=>{N.current[R]=q},type:u?"password":"text",inputMode:n==="numeric"?"numeric":"text",autoComplete:R===0?"one-time-code":"off",maxLength:1,value:L,disabled:f,className:Ne.cell,"aria-label":`Dígito ${R+1}`,"aria-invalid":!!m,onChange:$(R),onKeyDown:C(R),onPaste:F},R))}),m?o.jsx("span",{className:Ne.errorText,children:m}):p?o.jsx("span",{className:Ne.helper,children:p}):null]})}),Od="tempest_root_vEMon",Bd="tempest_popover_E9K9X",zd="tempest_tempest-popover-in_W8miP",Wd="tempest_top_TYlrh",qd="tempest_bottom_wGs70",Ud="tempest_left_h7fCr",Kd="tempest_right_--bJW",Ct={root:Od,popover:Bd,tempestPopoverIn:zd,top:Wd,bottom:qd,left:Ud,right:Kd};function Hd({trigger:e,children:t,placement:n="bottom",open:s,onOpenChange:r,defaultOpen:a=!1,closeOnEsc:c=!0,closeOnOutsideClick:i=!0,className:u}){const d=s!==void 0,[p,m]=l.useState(a),f=d?s:p,h=l.useId(),_=l.useRef(null),b=l.useCallback(w=>{d||m(w),r?.(w)},[d,r]);l.useEffect(()=>{if(!f)return;const w=j=>{c&&j.key==="Escape"&&b(!1)},v=j=>{i&&_.current&&!_.current.contains(j.target)&&b(!1)};return window.addEventListener("keydown",w),window.addEventListener("mousedown",v),()=>{window.removeEventListener("keydown",w),window.removeEventListener("mousedown",v)}},[f,c,i,b]);const y=w=>{e.props.onClick?.(w),b(!f)},g={...e,props:{...e.props,onClick:y,"aria-expanded":f,"aria-controls":h}};return o.jsxs("span",{ref:_,className:Ct.root,children:[g,f&&o.jsx("div",{id:h,role:"dialog",className:x.cn(Ct.popover,Ct[n],u),children:t})]})}const Gd="tempest_wrapper_BQek1",Jd="tempest_bar_uC-0x",Qd="tempest_fill_vmg7x",Yd="tempest_success_gWJ8U",Vd="tempest_warning_DGkPO",Xd="tempest_danger_gfwHh",Zd="tempest_indeterminate_HojUj",ep="tempest_tempest-progress-loop_0nEdF",tp="tempest_label_qqHJM",qe={wrapper:Gd,bar:Jd,fill:Qd,success:Yd,warning:Vd,danger:Xd,indeterminate:Zd,tempestProgressLoop:ep,label:tp};function np({value:e=0,max:t=100,variant:n="primary",indeterminate:s=!1,showLabel:r=!1,label:a,className:c}){const i=s?0:Math.max(0,Math.min(100,e/t*100));return o.jsxs("div",{className:x.cn(qe.wrapper,c),children:[(r||a)&&o.jsxs("div",{className:qe.label,children:[a&&o.jsx("span",{children:a}),r&&!s&&o.jsxs("span",{children:[Math.round(i),"%"]})]}),o.jsx("div",{role:"progressbar","aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":s?void 0:e,className:x.cn(qe.bar,s&&qe.indeterminate),children:o.jsx("div",{className:x.cn(qe.fill,n!=="primary"&&qe[n]),style:{width:s?void 0:`${i}%`}})})]})}const sp="tempest_wrapper_P-gFm",rp="tempest_disabled_0-cna",op="tempest_input_7R8ZN",ap="tempest_dot_P7ejP",cp="tempest_labelWrap_iQ1HR",ip="tempest_label_vAFIP",lp="tempest_description_bEB8u",up="tempest_group_oi329",dp="tempest_horizontal_1Ovgu",$e={wrapper:sp,disabled:rp,input:op,dot:ap,labelWrap:cp,label:ip,description:lp,group:up,horizontal:dp},Bn=l.createContext(null),pp=l.forwardRef(function({label:t,description:n,value:s,disabled:r,name:a,checked:c,onChange:i,wrapperClassName:u,className:d,...p},m){const f=l.useContext(Bn),h=f?.name??a,_=f?.disabled??r,b=f?f.value===s:c;function y(g){f&&f.onChange?.(s),i?.(g)}return o.jsxs("label",{className:x.cn($e.wrapper,_&&$e.disabled,u),children:[o.jsx("input",{ref:m,type:"radio",name:h,value:s,checked:b,disabled:_,onChange:y,className:x.cn($e.input,d),...p}),o.jsx("span",{className:$e.dot,"aria-hidden":!0}),(t||n)&&o.jsxs("span",{className:$e.labelWrap,children:[t&&o.jsx("span",{className:$e.label,children:t}),n&&o.jsx("span",{className:$e.description,children:n})]})]})});function mp({value:e,defaultValue:t,onChange:n,name:s,disabled:r,horizontal:a=!1,className:c,children:i}){const u=l.useId(),d=s??u,[p,m]=l.useState(t),f=e!==void 0,h=f?e:p;function _(b){f||m(b),n?.(b)}return o.jsx(Bn.Provider,{value:{name:d,value:h,onChange:_,disabled:r},children:o.jsx("div",{role:"radiogroup",className:x.cn($e.group,a&&$e.horizontal,c),children:i})})}const fp="tempest_wrapper_o1aOo",hp="tempest_label_jaBOA",_p="tempest_value_GKfOu",gp="tempest_field_YxCzt",bp="tempest_track_j-2iy",yp="tempest_fill_1pbqj",vp="tempest_input_1MASw",wp="tempest_helper_uqxKu",be={wrapper:fp,label:hp,value:_p,field:gp,track:bp,fill:yp,input:vp,helper:wp};function xp({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:a,helperText:c,disabled:i=!1,formatValue:u,className:d}){const[p,m]=e,f=s-n,h=l.useMemo(()=>(p-n)/f*100,[p,n,f]),_=l.useMemo(()=>(m-n)/f*100,[m,n,f]),b=u?.(e)??`${p} – ${m}`,y=l.useCallback(w=>{const v=Math.min(Number(w.target.value),m);t([v,m])},[m,t]),g=l.useCallback(w=>{const v=Math.max(Number(w.target.value),p);t([p,v])},[p,t]);return o.jsxs("div",{className:x.cn(be.wrapper,d),children:[a&&o.jsxs("div",{className:be.label,children:[o.jsx("span",{children:a}),o.jsx("span",{className:be.value,children:b})]}),o.jsxs("div",{className:be.field,children:[o.jsx("div",{className:be.track}),o.jsx("div",{className:be.fill,style:{left:`${h}%`,right:`${100-_}%`}}),o.jsx("input",{type:"range",className:be.input,min:n,max:s,step:r,value:p,onChange:y,disabled:i,"aria-label":a?`${a} (mínimo)`:"Mínimo"}),o.jsx("input",{type:"range",className:be.input,min:n,max:s,step:r,value:m,onChange:g,disabled:i,"aria-label":a?`${a} (máximo)`:"Máximo"})]}),c&&o.jsx("span",{className:be.helper,children:c})]})}const jp="tempest_wrapper_K9Mqa",$p="tempest_star_goIGS",kp="tempest_filled_mMs-d",Np="tempest_disabled_tyUlQ",Sp="tempest_readonly_bnKLN",Cp="tempest_sm_K7-y9",Ep="tempest_md_ex2Tb",Tp="tempest_lg_TstLJ",Ue={wrapper:jp,star:$p,filled:kp,disabled:Np,readonly:Sp,sm:Cp,md:Ep,lg:Tp};function Mp({value:e,max:t=5,onChange:n,size:s="md",readonly:r=!1,disabled:a=!1,label:c="Avaliação",className:i}){const[u,d]=l.useState(0),p=u>0?u:e,m=f=>{r||a||n?.(f)};return o.jsx("span",{role:"radiogroup","aria-label":c,className:x.cn(Ue.wrapper,Ue[s],a&&Ue.disabled,r&&Ue.readonly,i),onMouseLeave:()=>d(0),children:Array.from({length:t},(f,h)=>{const _=h+1,b=_<=p;return o.jsx("button",{type:"button",role:"radio","aria-checked":e===_,"aria-label":`${_} ${_===1?"estrela":"estrelas"}`,className:x.cn(Ue.star,b&&Ue.filled),disabled:a,onMouseEnter:()=>!r&&!a&&d(_),onClick:()=>m(_),children:o.jsx(Rp,{filled:b})},_)})})}function Rp({filled:e}){return o.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:e?"currentColor":"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round","aria-hidden":!0,children:o.jsx("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14 2 9.27l6.91-1.01L12 2z"})})}function zn(e,t,n,s,r){return s?(Array.isArray(s)?s:[s]).includes(e):!(t&&!r.above(t)||n&&!r.below(n))}function Lp({above:e,below:t,only:n,children:s}){const r=Be();return zn(r.current,e,t,n,r)?s:null}function Dp({above:e,below:t,only:n,children:s}){const r=Be();return zn(r.current,e,t,n,r)?null:s}const Ip="tempest_safe_iqDFY",Pp="tempest_inline_V9eMG",Ap="tempest_top_Xse9E",Fp="tempest_right_GZm9b",Op="tempest_bottom_kkyD7",Bp="tempest_left_Z4Q72",Ke={safe:Ip,inline:Pp,top:Ap,right:Fp,bottom:Op,left:Bp},zp=["top","right","bottom","left"];function Wp({edges:e=zp,inline:t=!1,className:n,children:s,...r}){return o.jsx("div",{className:x.cn(Ke.safe,t&&Ke.inline,e.includes("top")&&Ke.top,e.includes("right")&&Ke.right,e.includes("bottom")&&Ke.bottom,e.includes("left")&&Ke.left,n),"data-edges":e.join(" "),...r,children:s})}const qp="tempest_wrapper_dKXJJ",Up="tempest_input_m0lPc",Kp="tempest_iconLeft_030-U",Hp="tempest_clear_nb6lG",dt={wrapper:qp,input:Up,iconLeft:Kp,clear:Hp},Wn=l.forwardRef(function({value:t,onChange:n,onClear:s,wrapperClassName:r,placeholder:a="Buscar...",className:c,...i},u){function d(){n(""),s?.()}return o.jsxs("div",{className:x.cn(dt.wrapper,r),children:[o.jsx("span",{className:dt.iconLeft,"aria-hidden":!0,children:o.jsx(Gp,{})}),o.jsx("input",{ref:u,type:"search",value:t,onChange:p=>n(p.target.value),placeholder:a,className:x.cn(dt.input,c),...i}),t&&o.jsx("button",{type:"button",className:dt.clear,"aria-label":"Limpar busca",onClick:d,children:o.jsx(Jp,{})})]})});function Gp(){return o.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function Jp(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const Qp="tempest_group_mYyFC",Yp="tempest_fullWidth_unSMm",Vp="tempest_segment_cu-EL",Xp="tempest_sm_CfD41",Zp="tempest_md_2ixuM",em="tempest_lg_2Kt7-",tm="tempest_active_GmyKg",nm="tempest_icon_9h6GK",sm="tempest_label_mS17q",Pe={group:Qp,fullWidth:Yp,segment:Vp,sm:Xp,md:Zp,lg:em,active:tm,icon:nm,label:sm};function rm({options:e,value:t,onChange:n,size:s="md",fullWidth:r=!1,className:a,"aria-label":c,...i}){return o.jsx("div",{role:"radiogroup","aria-label":c,className:x.cn(Pe.group,Pe[s],r&&Pe.fullWidth,a),...i,children:e.map(u=>{const d=u.value===t;return o.jsxs("button",{type:"button",role:"radio","aria-checked":d,disabled:u.disabled,className:x.cn(Pe.segment,d&&Pe.active),onClick:()=>n(u.value),children:[u.icon&&o.jsx("span",{className:Pe.icon,children:u.icon}),o.jsx("span",{className:Pe.label,children:u.label})]},u.value)})})}const om="tempest_wrapper_KS2K3",am="tempest_label_Lmgos",cm="tempest_required_PvDVJ",im="tempest_field_h-wBy",lm="tempest_select_cjdcr",um="tempest_caret_MdCao",dm="tempest_error_sw9MU",pm="tempest_helper_frosK",mm="tempest_errorText_-zd6i",ye={wrapper:om,label:am,required:cm,field:im,select:lm,caret:um,error:dm,helper:pm,errorText:mm},fm=l.forwardRef(function({label:t,helperText:n,error:s,options:r,placeholder:a,wrapperClassName:c,className:i,children:u,id:d,required:p,...m},f){const h=l.useId(),_=d??h;return o.jsxs("div",{className:x.cn(ye.wrapper,s&&ye.error,c),children:[t&&o.jsxs("label",{htmlFor:_,className:ye.label,children:[t,p&&o.jsx("span",{className:ye.required,children:"*"})]}),o.jsxs("div",{className:ye.field,children:[o.jsxs("select",{ref:f,id:_,"aria-invalid":!!s,required:p,className:x.cn(ye.select,i),...m,children:[a&&o.jsx("option",{value:"",disabled:!0,hidden:!0,children:a}),r?.map(b=>o.jsx("option",{value:b.value,disabled:b.disabled,children:b.label},b.value)),u]}),o.jsx("span",{className:ye.caret,"aria-hidden":!0,children:o.jsx(hm,{})})]}),s?o.jsx("span",{className:ye.errorText,children:s}):n?o.jsx("span",{className:ye.helper,children:n}):null]})});function hm(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 9l6 6 6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const _m="tempest_sidebar_UB1qz",gm="tempest_header_zupoS",bm="tempest_nav_aLYuL",ym="tempest_item_IAjHb",vm="tempest_collapsed_ZbZYA",wm="tempest_active_BgcFy",xm="tempest_icon_UQswn",jm="tempest_label_TPvJ9",$m="tempest_badge_xwEZv",km="tempest_footer_TyRyi",ue={sidebar:_m,header:gm,nav:bm,item:ym,collapsed:vm,active:wm,icon:xm,label:jm,badge:$m,footer:km};function Nm({header:e,items:t,value:n,onChange:s,footer:r,collapsed:a=!1,width:c=240,collapsedWidth:i=64,className:u,style:d,...p}){const m=typeof(a?i:c)=="number"?`${a?i:c}px`:a?i:c;return o.jsxs("aside",{className:x.cn(ue.sidebar,a&&ue.collapsed,u),style:{width:m,...d},...p,children:[e&&o.jsx("div",{className:ue.header,children:e}),o.jsx("nav",{className:ue.nav,"aria-label":"Navegação lateral",children:t.map(f=>{const h=f.key===n;return o.jsxs("button",{type:"button",className:x.cn(ue.item,h&&ue.active),"aria-current":h?"page":void 0,disabled:f.disabled,onClick:()=>s?.(f.key),title:a&&typeof f.label=="string"?f.label:void 0,children:[f.icon&&o.jsx("span",{className:ue.icon,children:f.icon}),!a&&o.jsx("span",{className:ue.label,children:f.label}),!a&&f.badge!==void 0&&o.jsx("span",{className:ue.badge,children:f.badge})]},f.key)})}),r&&o.jsx("div",{className:ue.footer,children:r})]})}const Sm="tempest_skeleton_CB4uF",Cm="tempest_text_-A8IF",Em="tempest_circle_DYcl8",Et={skeleton:Sm,text:Cm,circle:Em};function Tm({variant:e="rect",width:t,height:n,className:s,style:r}){return o.jsx("span",{"aria-hidden":!0,className:x.cn(Et.skeleton,e==="text"&&Et.text,e==="circle"&&Et.circle,s),style:{width:t,height:n,...r}})}const Mm="tempest_spacer_okdOd",Rm="tempest_both_85qSF",Lm="tempest_x_QiU2B",Dm="tempest_y_hTtCp",an={spacer:Mm,both:Rm,x:Lm,y:Dm};function Im({axis:e="both",className:t,...n}){return o.jsx("div",{className:x.cn(an.spacer,an[e],t),...n})}const Pm="tempest_spinner_GpFZS",Am="tempest_tempest-spinner_wKVCY",Fm="tempest_xs_p8BFI",Om="tempest_sm_3sIoD",Bm="tempest_md_M2sPj",zm="tempest_lg_IxTw2",Wm="tempest_xl_cgwqq",qm="tempest_wrap_Xkv-I",Um="tempest_overlay_sVSe9",Km="tempest_caption_B0ED9",Ae={spinner:Pm,tempestSpinner:Am,xs:Fm,sm:Om,md:Bm,lg:zm,xl:Wm,wrap:qm,overlay:Um,caption:Km};function qn({size:e="md",className:t,label:n="Carregando",caption:s,overlay:r=!1}){const a=o.jsx("span",{"aria-hidden":!0,className:x.cn(Ae.spinner,Ae[e])});return!r&&s===void 0?o.jsx("span",{role:"status","aria-label":n,className:x.cn(Ae.spinner,Ae[e],t)}):o.jsxs("div",{role:"status","aria-label":n,"aria-live":"polite",className:x.cn(Ae.wrap,r&&Ae.overlay,t),children:[a,s!==void 0&&o.jsx("span",{className:Ae.caption,children:s})]})}const Hm="tempest_stat_zoo9y",Gm="tempest_header_3UQqq",Jm="tempest_icon_zUG3e",Qm="tempest_label_lIH47",Ym="tempest_row_Ifyts",Vm="tempest_value_JBWnr",Xm="tempest_delta_mRVrE",Zm="tempest_up_7qgUO",ef="tempest_down_3Rq2Z",tf="tempest_flat_R5pZT",nf="tempest_hint_YkTF8",re={stat:Hm,header:Gm,icon:Jm,label:Qm,row:Ym,value:Vm,delta:Xm,up:Zm,down:ef,flat:tf,hint:nf};function sf(e){if(typeof e!="string")return;const t=e.trim();if(t.startsWith("+"))return"up";if(t.startsWith("-")||t.startsWith("−"))return"down"}function rf({label:e,value:t,delta:n,trend:s,hint:r,icon:a,className:c,...i}){const u=s??sf(n);return o.jsxs("div",{className:x.cn(re.stat,c),...i,children:[o.jsxs("div",{className:re.header,children:[a&&o.jsx("span",{className:re.icon,children:a}),o.jsx("span",{className:re.label,children:e})]}),o.jsxs("div",{className:re.row,children:[o.jsx("span",{className:re.value,children:t}),n!==void 0&&o.jsx("span",{className:x.cn(re.delta,u==="up"&&re.up,u==="down"&&re.down,u==="flat"&&re.flat),children:n})]}),r&&o.jsx("p",{className:re.hint,children:r})]})}const of="tempest_stepper_w3qjQ",af="tempest_vertical_d4mOs",cf="tempest_step_s2nqL",lf="tempest_dot_d1bSL",uf="tempest_completed_gcFHM",df="tempest_active_kL-CH",pf="tempest_label_8irAI",mf="tempest_connector_lyeWp",ve={stepper:of,vertical:af,step:cf,dot:lf,completed:uf,active:df,label:pf,connector:mf};function ff({steps:e,current:t,orientation:n="horizontal",className:s}){return o.jsx("ol",{className:x.cn(ve.stepper,n==="vertical"&&ve.vertical,s),children:e.map((r,a)=>{const c=a<t,i=a===t;return o.jsxs(l.Fragment,{children:[o.jsxs("li",{className:x.cn(ve.step,c&&ve.completed,i&&ve.active),"aria-current":i?"step":void 0,children:[o.jsx("span",{className:ve.dot,children:c?"✓":a+1}),o.jsx("span",{className:ve.label,children:r.label})]}),a<e.length-1&&o.jsx("span",{className:x.cn(ve.connector,c&&ve.completed),"aria-hidden":!0})]},a)})})}function Bt(e,t,n){if(Number.isNaN(e))return e;if(t>n){const s=t;t=n,n=s}return e<t?t:e>n?n:e}function hf(e,t=1){if(e===0)return"0 B";const n=["B","KB","MB","GB","TB"],s=1024,r=Math.min(Math.floor(Math.log(Math.abs(e))/Math.log(s)),n.length-1),a=e/s**r,c=r===0?0:Math.max(0,t);return`${parseFloat(a.toFixed(c)).toString()} ${n[r]}`}function _f(e,t="en-US"){return new Intl.NumberFormat(t,{notation:"compact",maximumFractionDigits:1}).format(e)}const gf="tempest_wrapper_JNjXK",bf="tempest_label_9XKNm",yf="tempest_row_cOARX",vf="tempest_sm_RzVSU",wf="tempest_md_pezRm",xf="tempest_lg_kYbIN",jf="tempest_disabled_vqmo2",$f="tempest_btn_xuHhj",kf="tempest_value_NEatO",Se={wrapper:gf,label:bf,row:yf,sm:vf,md:wf,lg:xf,disabled:jf,btn:$f,value:kf},Nf=l.forwardRef(function({value:t,onChange:n,min:s=0,max:r=Number.POSITIVE_INFINITY,step:a=1,size:c="md",disabled:i=!1,label:u,format:d,labels:p={decrement:"Diminuir",increment:"Aumentar"},className:m},f){const h=()=>{i||n(Bt(t-a,s,r))},_=()=>{i||n(Bt(t+a,s,r))},b=d?d(t):String(t),y=!i&&t>s,g=!i&&t<r;return o.jsxs("div",{ref:f,className:x.cn(Se.wrapper,m),children:[u&&o.jsx("label",{className:Se.label,children:u}),o.jsxs("div",{className:x.cn(Se.row,Se[c],i&&Se.disabled),children:[o.jsx("button",{type:"button",className:Se.btn,"aria-label":p.decrement,onClick:h,disabled:!y,children:"−"}),o.jsx("span",{className:Se.value,role:"status","aria-live":"polite",children:b}),o.jsx("button",{type:"button",className:Se.btn,"aria-label":p.increment,onClick:_,disabled:!g,children:"+"})]})]})}),Sf="tempest_wrapper_kudO9",Cf="tempest_disabled_2aZ0V",Ef="tempest_input_5BPNu",Tf="tempest_track_7ObdZ",Mf="tempest_thumb_-FTeK",Rf="tempest_label_LrH7V",He={wrapper:Sf,disabled:Cf,input:Ef,track:Tf,thumb:Mf,label:Rf},Lf=l.forwardRef(function({label:t,disabled:n,wrapperClassName:s,className:r,...a},c){return o.jsxs("label",{className:x.cn(He.wrapper,n&&He.disabled,s),children:[o.jsx("input",{ref:c,type:"checkbox",role:"switch",disabled:n,className:x.cn(He.input,r),...a}),o.jsx("span",{className:He.track,"aria-hidden":!0,children:o.jsx("span",{className:He.thumb})}),t&&o.jsx("span",{className:He.label,children:t})]})}),Df="tempest_tag_16VPH",If="tempest_sm_pzyd5",Pf="tempest_md_GL6tQ",Af="tempest_lg_8tgXU",Ff="tempest_neutral_jAd-x",Of="tempest_primary_AXKlN",Bf="tempest_success_56lz4",zf="tempest_warning_UK7SC",Wf="tempest_danger_kJ-yx",qf="tempest_info_hmHE-",Uf="tempest_label_ZBPfO",Kf="tempest_remove_UEwgr",nt={tag:Df,sm:If,md:Pf,lg:Af,neutral:Ff,primary:Of,success:Bf,warning:zf,danger:Wf,info:qf,label:Uf,remove:Kf};function Hf({variant:e="neutral",size:t="md",onRemove:n,removeLabel:s="Remover",className:r,children:a,...c}){return o.jsxs("span",{className:x.cn(nt.tag,nt[e],nt[t],r),...c,children:[o.jsx("span",{className:nt.label,children:a}),n&&o.jsx("button",{type:"button",className:nt.remove,"aria-label":s,onClick:n,children:"×"})]})}const Gf="tempest_scroll_unrJp",Jf="tempest_table_Dkosn",Qf="tempest_th_PNuEx",Yf="tempest_td_jv9tA",Vf="tempest_tr_7UG8J",Xf="tempest_clickable_B6Si-",Zf="tempest_alignRight_9hY0G",eh="tempest_alignCenter_YiUQy",th="tempest_emptyRow_kdMiv",nh="tempest_priorityTablet_3alUt",sh="tempest_priorityDesktop_3f8Fq",rh="tempest_stackable_heix7",oh="tempest_stackableHead_mKGcA",ah="tempest_stackableRow_qPNqc",B={scroll:Gf,table:Jf,th:Qf,td:Yf,tr:Vf,clickable:Xf,alignRight:Zf,alignCenter:eh,emptyRow:th,priorityTablet:nh,priorityDesktop:sh,stackable:rh,stackableHead:oh,stackableRow:ah};function cn(e){if(e==="tablet")return B.priorityTablet;if(e==="desktop")return B.priorityDesktop}function Un({columns:e,data:t,rowKey:n,onRowClick:s,emptyMessage:r="Nenhum registro encontrado.",className:a,stackOnMobile:c=!1}){return o.jsx("div",{className:x.cn(B.scroll,c&&B.stackable,a),children:o.jsxs("table",{className:B.table,children:[o.jsx("thead",{className:x.cn(c&&B.stackableHead),children:o.jsx("tr",{children:e.map(i=>o.jsx("th",{className:x.cn(B.th,i.align==="right"&&B.alignRight,i.align==="center"&&B.alignCenter,cn(i.priority)),style:{width:i.width},children:i.header},i.key))})}),o.jsx("tbody",{children:t.length===0?o.jsx("tr",{children:o.jsx("td",{className:B.emptyRow,colSpan:e.length,children:r})}):t.map((i,u)=>o.jsx("tr",{className:x.cn(B.tr,s&&B.clickable,c&&B.stackableRow),onClick:s?()=>s(i):void 0,children:e.map(d=>{const p=d.render?d.render(i,u):i[d.key];return o.jsx("td",{className:x.cn(B.td,d.align==="right"&&B.alignRight,d.align==="center"&&B.alignCenter,cn(d.priority),d.className),"data-label":typeof d.header=="string"?d.header:void 0,children:p},d.key)})},n(i,u)))})]})})}const ch="tempest_tablist_WR6ag",ih="tempest_tab_IdDYc",lh="tempest_active_PTNtG",uh="tempest_panel_08i9c",dh="tempest_pill_lGuqn",st={tablist:ch,tab:ih,active:lh,panel:uh,pill:dh};function ph({items:e,defaultId:t,activeId:n,onChange:s,variant:r="underline",className:a}){const c=e.find(h=>!h.disabled),[i,u]=l.useState(t??c?.id),d=n!==void 0,p=d?n:i,m=e.find(h=>h.id===p)??c;function f(h){d||u(h),s?.(h)}return o.jsxs("div",{className:a,children:[o.jsx("div",{role:"tablist",className:x.cn(st.tablist,r==="pill"&&st.pill),children:e.map(h=>{const _=h.id===m?.id;return o.jsx("button",{type:"button",role:"tab","aria-selected":_,"aria-controls":`panel-${h.id}`,id:`tab-${h.id}`,disabled:h.disabled,className:x.cn(st.tab,_&&st.active),onClick:()=>f(h.id),children:h.label},h.id)})}),m&&o.jsx("div",{role:"tabpanel",id:`panel-${m.id}`,"aria-labelledby":`tab-${m.id}`,className:st.panel,children:m.content})]})}const mh="tempest_wrapper_C0gfg",fh="tempest_label_cWLXP",hh="tempest_required_rDZXE",_h="tempest_textarea_Z-y6g",gh="tempest_error_NWC9f",bh="tempest_helper_gedut",yh="tempest_errorText_ey07q",Fe={wrapper:mh,label:fh,required:hh,textarea:_h,error:gh,helper:bh,errorText:yh},vh=l.forwardRef(function({label:t,helperText:n,error:s,wrapperClassName:r,className:a,id:c,required:i,...u},d){const p=l.useId(),m=c??p;return o.jsxs("div",{className:x.cn(Fe.wrapper,s&&Fe.error,r),children:[t&&o.jsxs("label",{htmlFor:m,className:Fe.label,children:[t,i&&o.jsx("span",{className:Fe.required,children:"*"})]}),o.jsx("textarea",{ref:d,id:m,"aria-invalid":!!s,required:i,className:x.cn(Fe.textarea,a),...u}),s?o.jsx("span",{className:Fe.errorText,children:s}):n?o.jsx("span",{className:Fe.helper,children:n}):null]})}),wh="tempest_timeline_utrkA",xh="tempest_item_T5xdQ",jh="tempest_markerColumn_BMe4d",$h="tempest_marker_kmPV-",kh="tempest_marker-primary_s9BNB",Nh="tempest_marker-success_areMM",Sh="tempest_marker-warning_rRrS8",Ch="tempest_marker-danger_3GEBk",Eh="tempest_marker-neutral_M2mnw",Th="tempest_line_CwY-N",Mh="tempest_body_KpMJ6",Rh="tempest_row_AX2ti",Lh="tempest_title_DxfAX",Dh="tempest_meta_GU0ih",Ih="tempest_description_f9sxV",Q={timeline:wh,item:xh,markerColumn:jh,marker:$h,markerPrimary:kh,markerSuccess:Nh,markerWarning:Sh,markerDanger:Ch,markerNeutral:Eh,line:Th,body:Mh,row:Rh,title:Lh,meta:Dh,description:Ih};function Ph({items:e,connector:t=!0,className:n,...s}){return o.jsx("ol",{className:x.cn(Q.timeline,t&&Q.connector,n),...s,children:e.map((r,a)=>{const c=a===e.length-1;return o.jsxs("li",{className:Q.item,children:[o.jsxs("div",{className:Q.markerColumn,children:[o.jsx("span",{className:x.cn(Q.marker,Q[`marker-${r.marker??"primary"}`]),"aria-hidden":"true",children:r.icon}),t&&!c&&o.jsx("span",{className:Q.line,"aria-hidden":"true"})]}),o.jsxs("div",{className:Q.body,children:[o.jsxs("div",{className:Q.row,children:[o.jsx("span",{className:Q.title,children:r.title}),r.meta&&o.jsx("span",{className:Q.meta,children:r.meta})]}),r.description&&o.jsx("p",{className:Q.description,children:r.description})]})]},r.id)})})}const Ah="tempest_trigger_Dmc5E",Fh="tempest_bubble_TPGHB",Oh="tempest_tempest-tooltip-in_csYeZ",Bh="tempest_top_m2tnn",zh="tempest_bottom_9Twz4",Wh="tempest_left_UPdrG",qh="tempest_right_CV--T",Tt={trigger:Ah,bubble:Fh,tempestTooltipIn:Oh,top:Bh,bottom:zh,left:Wh,right:qh};function Uh({content:e,placement:t="top",children:n,disabled:s=!1,openDelay:r=150}){const[a,c]=l.useState(!1),i=l.useId();let u=null;function d(){s||(u&&clearTimeout(u),u=setTimeout(()=>c(!0),r))}function p(){u&&(clearTimeout(u),u=null),c(!1)}const m=l.cloneElement(n,{onMouseEnter:d,onMouseLeave:p,onFocus:d,onBlur:p,"aria-describedby":a?i:void 0});return o.jsxs("span",{className:Tt.trigger,children:[m,a&&o.jsx("span",{id:i,role:"tooltip",className:x.cn(Tt.bubble,Tt[t]),children:e})]})}const Kh="tempest_container_x4-Qm",Hh="tempest_positionTopRight_gbUCQ",Gh="tempest_positionTopLeft_Z-tMJ",Jh="tempest_positionTopCenter_A4Ze4",Qh="tempest_positionBottomRight_MGo19",Yh="tempest_positionBottomLeft_DpiNe",Vh="tempest_positionBottomCenter_XUdok",Xh="tempest_toast_FLdHz",Zh="tempest_tempest-toast-in_E2d-A",e_="tempest_success_Oy694",t_="tempest_warning_84GC8",n_="tempest_error_hrQAA",s_="tempest_info_eq5bQ",r_="tempest_title_-H6R2",o_="tempest_description_-QwfC",a_="tempest_close_i10-s",Z={container:Kh,positionTopRight:Hh,positionTopLeft:Gh,positionTopCenter:Jh,positionBottomRight:Qh,positionBottomLeft:Yh,positionBottomCenter:Vh,toast:Xh,tempestToastIn:Zh,success:e_,warning:t_,error:n_,info:s_,title:r_,description:o_,close:a_},Kn=l.createContext(null);function c_(){const e=l.useContext(Kn);if(!e)throw new Error("useToast must be used inside a <ToastProvider>");return e}function i_({children:e,defaultDuration:t=4e3,position:n="top-right"}){const[s,r]=l.useState([]),a=l.useRef(0),c=l.useCallback(d=>{r(p=>p.filter(m=>m.id!==d))},[]),i=l.useCallback(d=>{const p=d.id??`toast-${++a.current}`,m={id:p,title:d.title,description:d.description,variant:d.variant??"info",duration:d.duration??t};return r(f=>[...f,m]),p},[t]),u=l.useMemo(()=>({show:i,dismiss:c,success:(d,p)=>i({...p,description:d,variant:"success"}),error:(d,p)=>i({...p,description:d,variant:"error"}),warning:(d,p)=>i({...p,description:d,variant:"warning"}),info:(d,p)=>i({...p,description:d,variant:"info"})}),[i,c]);return o.jsxs(Kn.Provider,{value:u,children:[e,o.jsx(u_,{toasts:s,onDismiss:c,position:n})]})}function l_(e){switch(e){case"top-left":return Z.positionTopLeft;case"top-center":return Z.positionTopCenter;case"bottom-right":return Z.positionBottomRight;case"bottom-left":return Z.positionBottomLeft;case"bottom-center":return Z.positionBottomCenter;default:return Z.positionTopRight}}function u_({toasts:e,onDismiss:t,position:n}){return typeof document>"u"?null:Ye.createPortal(o.jsx("div",{className:x.cn(Z.container,l_(n)),"aria-live":"polite","aria-atomic":"true",children:e.map(s=>o.jsx(d_,{toast:s,onDismiss:t},s.id))}),document.body)}function d_({toast:e,onDismiss:t}){return l.useEffect(()=>{if(!e.duration)return;const n=setTimeout(()=>t(e.id),e.duration);return()=>clearTimeout(n)},[e.id,e.duration,t]),o.jsxs("div",{className:x.cn(Z.toast,Z[e.variant]),role:"status",children:[o.jsxs("div",{children:[e.title&&o.jsx("p",{className:Z.title,children:e.title}),e.description&&o.jsx("p",{className:Z.description,children:e.description})]}),o.jsx("button",{type:"button",className:Z.close,"aria-label":"Fechar notificação",onClick:()=>t(e.id),children:o.jsx(p_,{})})]})}function p_(){return o.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{d:"M6 6l12 12M6 18L18 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}const m_="tempest_scroll_8Giwl",f_="tempest_spacer_P3Pvl",h_="tempest_row_Ff0VU",Mt={scroll:m_,spacer:f_,row:h_};function __({items:e,itemHeight:t,renderItem:n,height:s,overscan:r=4,getKey:a,className:c,style:i}){const u=l.useRef(null),[d,p]=l.useState(0),[m,f]=l.useState(0);l.useEffect(()=>{const g=u.current;if(!g||(f(g.clientHeight),typeof ResizeObserver>"u"))return;const w=new ResizeObserver(()=>f(g.clientHeight));return w.observe(g),()=>w.disconnect()},[]);const h=e.length*t,_=Math.max(0,Math.floor(d/t)-r),b=Math.ceil(m/t)+r*2,y=Math.min(e.length,_+b);return o.jsx("div",{ref:u,className:x.cn(Mt.scroll,c),style:{height:s,...i},onScroll:g=>p(g.target.scrollTop),role:"list",children:o.jsx("div",{className:Mt.spacer,style:{height:h},children:e.slice(_,y).map((g,w)=>{const v=_+w,j=a?a(g,v):v;return o.jsx("div",{role:"listitem",className:Mt.row,style:{top:v*t,height:t},children:n(g,v)},j)})})})}const g_="tempest_button_58f9i",b_="tempest_copied_WkLgR",ln={button:g_,copied:b_};function y_({value:e,timeout:t=2e3,children:n,onCopied:s,className:r,onClick:a,...c}){const[i,u]=l.useState(!1),d=l.useRef(null);l.useEffect(()=>()=>{d.current!==null&&clearTimeout(d.current)},[]);const p=l.useCallback(async m=>{a?.(m);try{await navigator.clipboard.writeText(e),u(!0),s?.(),d.current!==null&&clearTimeout(d.current),d.current=setTimeout(()=>u(!1),t)}catch{}},[e,t,s,a]);return o.jsx("button",{type:"button",className:x.cn(ln.button,i&&ln.copied,r),"data-copied":i||void 0,onClick:p,...c,children:n??(i?"Copied":"Copy")})}const v_={justNow:"agora há pouco",secondsAgo:e=>`${e} s atrás`,minutesAgo:e=>`${e} min atrás`,hoursAgo:e=>e===1?"1 hora atrás":`${e} horas atrás`,daysAgo:e=>e===1?"ontem":`${e} dias atrás`,weeksAgo:e=>e===1?"semana passada":`${e} semanas atrás`,monthsAgo:e=>e===1?"mês passado":`${e} meses atrás`,yearsAgo:e=>e===1?"ano passado":`${e} anos atrás`,inSeconds:e=>`em ${e} s`,inMinutes:e=>`em ${e} min`,inHours:e=>`em ${e} h`,inDays:e=>`em ${e} ${e===1?"dia":"dias"}`,inWeeks:e=>`em ${e} ${e===1?"semana":"semanas"}`,inMonths:e=>`em ${e} ${e===1?"mês":"meses"}`,inYears:e=>`em ${e} ${e===1?"ano":"anos"}`},w_={justNow:"just now",secondsAgo:e=>`${e}s ago`,minutesAgo:e=>`${e}m ago`,hoursAgo:e=>`${e}h ago`,daysAgo:e=>e===1?"yesterday":`${e} days ago`,weeksAgo:e=>`${e}w ago`,monthsAgo:e=>`${e}mo ago`,yearsAgo:e=>`${e}y ago`,inSeconds:e=>`in ${e}s`,inMinutes:e=>`in ${e}m`,inHours:e=>`in ${e}h`,inDays:e=>`in ${e}d`,inWeeks:e=>`in ${e}w`,inMonths:e=>`in ${e}mo`,inYears:e=>`in ${e}y`},x_={"pt-BR":v_,en:w_},zt=1e3,Wt=60*zt,qt=60*Wt,it=24*qt,un=7*it,dn=30*it,pn=365*it;function Hn(e,t={}){const{locale:n="pt-BR",now:s=Date.now()}=t,r=x_[n],a=e instanceof Date?e.getTime():new Date(e).getTime(),i=(typeof s=="number"?s:s.getTime())-a,u=i>=0,d=Math.abs(i);if(d<30*zt)return r.justNow;if(d<Wt){const m=Math.round(d/zt);return u?r.secondsAgo(m):r.inSeconds(m)}if(d<qt){const m=Math.round(d/Wt);return u?r.minutesAgo(m):r.inMinutes(m)}if(d<it){const m=Math.round(d/qt);return u?r.hoursAgo(m):r.inHours(m)}if(d<un){const m=Math.round(d/it);return u?r.daysAgo(m):r.inDays(m)}if(d<dn){const m=Math.round(d/un);return u?r.weeksAgo(m):r.inWeeks(m)}if(d<pn){const m=Math.round(d/dn);return u?r.monthsAgo(m):r.inMonths(m)}const p=Math.round(d/pn);return u?r.yearsAgo(p):r.inYears(p)}function j_({date:e,locale:t="pt",...n}){const s=e instanceof Date?e:new Date(e),r=Number.isNaN(s.getTime())?void 0:s.toISOString(),a=Hn(e,{locale:t==="pt"?"pt-BR":"en"});return o.jsx("time",{dateTime:r,...n,children:a})}function $_({cents:e,currency:t="BRL",locale:n="pt-BR",...s}){const r=new Intl.NumberFormat(n,{style:"currency",currency:t}).format(e/100);return o.jsx("span",{...s,children:r})}const k_="tempest_clamp_r43C-",N_={clamp:k_};function S_({lines:e=1,className:t,style:n,children:s,...r}){const a={...n,"--tempest-clamp-lines":e};return o.jsx("div",{className:x.cn(N_.clamp,t),style:a,...r,children:s})}const C_="tempest_hidden_k7p-e",E_={hidden:C_};function T_({as:e="span",className:t,children:n,...s}){return l.createElement(e,{className:x.cn(E_.hidden,t),...s},n)}function Gn({children:e,container:t}){const[n,s]=l.useState(!1);return l.useEffect(()=>(s(!0),()=>s(!1)),[]),!n||typeof document>"u"?null:Ye.createPortal(e,t??document.body)}function M_({onOutside:e,children:t,...n}){const s=l.useRef(null),r=l.useRef(e);return r.current=e,l.useEffect(()=>{if(typeof document>"u")return;function a(c){const i=s.current,u=c.target;i&&u&&!i.contains(u)&&r.current(c)}return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[]),o.jsx("div",{ref:s,...n,children:t})}function R_({condition:e,wrapper:t,children:n}){return e?t(n):o.jsx(o.Fragment,{children:n})}function L_({each:e,children:t,fallback:n=null}){return e.length===0?o.jsx(o.Fragment,{children:n}):o.jsx(o.Fragment,{children:e.map((s,r)=>o.jsx(l.Fragment,{children:t(s,r)},r))})}const D_="tempest_errorText_LU3jn",I_={errorText:D_};function P_({children:e,className:t,...n}){return e==null||e===!1||e===""?null:o.jsx("p",{role:"alert",className:x.cn(I_.errorText,t),...n,children:e})}const A_="tempest_image_Zq9Zs",F_={image:A_};function O_({src:e,fallback:t,alt:n,lazy:s=!0,className:r,onError:a,...c}){const[i,u]=l.useState(e),[d,p]=l.useState(!1);return o.jsx("img",{src:i,alt:n,loading:s?"lazy":"eager",className:x.cn(F_.image,r),onError:m=>{t&&!d&&i!==t&&(p(!0),u(t)),a?.(m)},...c})}const B_="tempest_list_bAP4Q",z_="tempest_item_oRy5T",mn={list:B_,item:z_};function W_({items:e,renderItem:t,keyExtractor:n,empty:s,className:r,...a}){return e.length===0?o.jsx(o.Fragment,{children:s??null}):o.jsx("ul",{className:x.cn(mn.list,r),...a,children:e.map((c,i)=>o.jsx("li",{className:mn.item,children:t(c,i)},n?n(c,i):i))})}const q_="tempest_list_fwIXq",U_="tempest_term_QkQNZ",K_="tempest_description_e1bNN",Rt={list:q_,term:U_,description:K_};function H_({items:e,className:t,...n}){return o.jsx("dl",{className:x.cn(Rt.list,t),...n,children:e.map((s,r)=>o.jsxs(l.Fragment,{children:[o.jsx("dt",{className:Rt.term,children:s.term}),o.jsx("dd",{className:Rt.description,children:s.description})]},r))})}const G_="tempest_toggle_kmzmH",J_="tempest_outline_aFbzy",Q_="tempest_pressed_hX319",Y_="tempest_sm_JTqaB",V_="tempest_md_QfS4K",X_="tempest_lg_ajzsM",pt={toggle:G_,outline:J_,pressed:Q_,sm:Y_,md:V_,lg:X_},Z_=l.forwardRef(function({pressed:t,defaultPressed:n=!1,onPressedChange:s,size:r="md",variant:a="default",className:c,disabled:i,onClick:u,children:d,...p},m){const f=t!==void 0,[h,_]=l.useState(n),b=f?t:h,y=l.useCallback(g=>{if(u?.(g),g.defaultPrevented)return;const w=!b;f||_(w),s?.(w)},[b,f,u,s]);return o.jsx("button",{ref:m,type:"button","aria-pressed":b,disabled:i,"data-state":b?"on":"off",className:x.cn(pt.toggle,pt[r],pt[a],b&&pt.pressed,c),onClick:y,...p,children:d})}),eg="tempest_group_XZCDJ",tg="tempest_item_B-27E",ng="tempest_selected_OHPVQ",Ut={group:eg,item:tg,selected:ng},Jn=l.createContext(null);function sg(){const e=l.useContext(Jn);if(!e)throw new Error("ToggleGroupItem must be used within a ToggleGroup");return e}function fn(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function rg({type:e="single",value:t,defaultValue:n,onValueChange:s,className:r,children:a,...c}){const i=t!==void 0,[u,d]=l.useState(()=>fn(n)),p=i?fn(t):u,m=l.useCallback(_=>{i||d(_),s?.(e==="single"?_[0]??"":_)},[i,s,e]),f=l.useCallback(_=>{const b=p.includes(_);m(e==="single"?b?[]:[_]:b?p.filter(y=>y!==_):[...p,_])},[p,e,m]),h=l.useMemo(()=>({type:e,isSelected:_=>p.includes(_),toggle:f}),[e,p,f]);return o.jsx(Jn.Provider,{value:h,children:o.jsx("div",{role:"group",className:x.cn(Ut.group,r),...c,children:a})})}function og({value:e,disabled:t,className:n,children:s,...r}){const{isSelected:a,toggle:c}=sg(),i=a(e);return o.jsx("button",{type:"button",role:"button","aria-pressed":i,disabled:t,"data-state":i?"on":"off",className:x.cn(Ut.item,i&&Ut.selected,n),onClick:()=>c(e),...r,children:s})}const ag="tempest_label_RaRvM",cg="tempest_asterisk_1CgE8",hn={label:ag,asterisk:cg},ig=l.forwardRef(function({required:t=!1,className:n,children:s,...r},a){return o.jsxs("label",{ref:a,className:x.cn(hn.label,n),...r,children:[s,t&&o.jsx("span",{className:hn.asterisk,"aria-hidden":!0,children:"*"})]})}),lg="tempest_collapsible_8jmKP",ug="tempest_trigger_ers75",dg="tempest_content_XmUZL",mt={collapsible:lg,trigger:ug,content:dg};function pg({open:e,defaultOpen:t=!1,onOpenChange:n,trigger:s,className:r,children:a,...c}){const i=l.useId(),u=`${i}-content`,d=`${i}-trigger`,p=e!==void 0,[m,f]=l.useState(t),h=p?e:m,_=l.useCallback(()=>{const b=!h;p||f(b),n?.(b)},[h,p,n]);return o.jsxs("div",{className:x.cn(mt.collapsible,h&&mt.open,r),...c,children:[o.jsx("button",{type:"button",id:d,className:mt.trigger,"aria-expanded":h,"aria-controls":u,onClick:_,children:s}),o.jsx("div",{id:u,role:"region","aria-labelledby":d,hidden:!h,className:mt.content,children:a})]})}const mg="tempest_root_OxRHj",fg="tempest_menu_MDn4t",hg="tempest_item_PoiMY",_g="tempest_active_ATcDu",gg="tempest_danger_COgly",bg="tempest_separator_omuCz",Ge={root:mg,menu:fg,item:hg,active:_g,danger:gg,separator:bg};function _n(e){return"separator"in e&&e.separator===!0}function yg({items:e,children:t,className:n}){const[s,r]=l.useState(!1),[a,c]=l.useState({x:0,y:0}),[i,u]=l.useState(-1),d=l.useId(),p=l.useRef(null),m=l.useRef([]),f=e.map((y,g)=>!_n(y)&&!y.disabled?g:-1).filter(y=>y!==-1),h=l.useCallback(()=>{r(!1),u(-1)},[]),_=y=>{y.preventDefault(),c({x:y.clientX,y:y.clientY}),u(-1),r(!0)};l.useEffect(()=>{if(!s)return;const y=w=>{if(w.key==="Escape"){h();return}if(w.key==="ArrowDown"){w.preventDefault();const v=f.indexOf(i),j=f[(v+1)%f.length]??-1;u(j),m.current[j]?.focus()}if(w.key==="ArrowUp"){w.preventDefault();const v=f.indexOf(i),j=f[(v-1+f.length)%f.length]??-1;u(j),m.current[j]?.focus()}},g=w=>{p.current&&!p.current.contains(w.target)&&h()};return window.addEventListener("keydown",y),window.addEventListener("mousedown",g),()=>{window.removeEventListener("keydown",y),window.removeEventListener("mousedown",g)}},[s,i,f,h]);const b=y=>{y.onSelect?.(),h()};return o.jsxs(o.Fragment,{children:[o.jsx("span",{className:Ge.root,onContextMenu:_,children:t}),s&&o.jsx(Gn,{children:o.jsx("ul",{ref:p,id:d,role:"menu",className:x.cn(Ge.menu,n),style:{top:a.y,left:a.x},children:e.map((y,g)=>_n(y)?o.jsx("li",{role:"separator",className:Ge.separator,"aria-hidden":!0},`separator-${g}`):o.jsx("li",{role:"none",children:o.jsx("button",{ref:w=>{m.current[g]=w},type:"button",role:"menuitem",className:x.cn(Ge.item,y.danger&&Ge.danger,i===g&&Ge.active),disabled:y.disabled,onClick:()=>b(y),onMouseEnter:()=>u(g),children:y.label})},`item-${g}`))})})]})}const vg="tempest_root_2KoZA",wg="tempest_trigger_OXsnr",xg="tempest_card_CoGx4",jg="tempest_tempest-hover-card-in_jD85J",$g="tempest_top_AVcQ0",kg="tempest_bottom_2rLAA",Ng="tempest_left_tqGPt",Sg="tempest_right_9Fe6S",ft={root:vg,trigger:wg,card:xg,tempestHoverCardIn:jg,top:$g,bottom:kg,left:Ng,right:Sg};function Cg({trigger:e,children:t,openDelay:n=300,closeDelay:s=150,placement:r="bottom",className:a,...c}){const[i,u]=l.useState(!1),d=l.useId(),p=l.useRef(null),m=l.useCallback(()=>{p.current!==null&&(clearTimeout(p.current),p.current=null)},[]),f=l.useCallback(()=>{m(),p.current=setTimeout(()=>u(!0),n)},[m,n]),h=l.useCallback(()=>{m(),p.current=setTimeout(()=>u(!1),s)},[m,s]);return l.useEffect(()=>m,[m]),o.jsxs("span",{className:ft.root,onMouseEnter:f,onMouseLeave:h,onFocus:f,onBlur:h,children:[o.jsx("span",{"aria-describedby":i?d:void 0,className:ft.trigger,children:e}),i&&o.jsx("div",{id:d,role:"dialog",className:x.cn(ft.card,ft[r],a),...c,children:t})]})}const Eg=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function Qn(e,t){l.useEffect(()=>{if(!t)return;const n=e.current;if(!n)return;const s=document.activeElement;function r(){return Array.from(n?.querySelectorAll(Eg)??[]).filter(i=>{if(i.hasAttribute("aria-hidden"))return!1;const u=typeof window<"u"?window.getComputedStyle(i):null;return!(u&&(u.display==="none"||u.visibility==="hidden"))})}function a(i){if(i.key!=="Tab")return;const u=r();if(u.length===0){i.preventDefault();return}const d=u[0],p=u[u.length-1],m=document.activeElement;i.shiftKey?(m===d||!m||!n?.contains(m))&&(i.preventDefault(),p.focus()):m===p&&(i.preventDefault(),d.focus())}return r()[0]?.focus(),document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),s?.focus?.()}},[e,t])}const Tg="tempest_overlay_drnPW",Mg="tempest_dialog_lPl6k",Rg="tempest_inputRow_KxWoQ",Lg="tempest_searchIcon_8PULr",Dg="tempest_input_D3HQr",Ig="tempest_list_5UzZU",Pg="tempest_group_vLaWy",Ag="tempest_groupHeading_d01fo",Fg="tempest_groupList_QFMjK",Og="tempest_option_doqib",Bg="tempest_active_LdCIJ",zg="tempest_icon_CyCCx",Wg="tempest_label_QePT-",qg="tempest_empty_al68D",W={overlay:Tg,dialog:Mg,inputRow:Rg,searchIcon:Lg,input:Dg,list:Ig,group:Pg,groupHeading:Ag,groupList:Fg,option:Og,active:Bg,icon:zg,label:Wg,empty:qg};function Ug(e,t){return t===""||e.label.toLowerCase().includes(t)?!0:(e.keywords??[]).some(n=>n.toLowerCase().includes(t))}function gn(e){const t=[],n=new Map;for(const s of e){const r=n.get(s.group);r===void 0?(n.set(s.group,t.length),t.push({name:s.group,items:[s]})):t[r].items.push(s)}return t}function Kg({open:e,onOpenChange:t,items:n,placeholder:s="Type a command…",emptyMessage:r="No results",className:a}){const c=l.useRef(null),[i,u]=l.useState(""),[d,p]=l.useState(0),m="tempest-command-list";Qn(c,e);const f=l.useMemo(()=>{const g=i.trim().toLowerCase(),w=n.filter(v=>Ug(v,g));return gn(w).flatMap(v=>v.items)},[n,i]),h=l.useMemo(()=>gn(f),[f]);if(l.useEffect(()=>{e&&(u(""),p(0))},[e]),l.useEffect(()=>{p(g=>f.length===0?0:Math.min(g,f.length-1))},[f.length]),!e||typeof document>"u")return null;function _(g){g.onSelect(),t(!1)}function b(g){if(g.key==="Escape"){g.preventDefault(),t(!1);return}if(g.key==="ArrowDown"){if(g.preventDefault(),f.length===0)return;p(w=>(w+1)%f.length);return}if(g.key==="ArrowUp"){if(g.preventDefault(),f.length===0)return;p(w=>(w-1+f.length)%f.length);return}if(g.key==="Enter"){g.preventDefault();const w=f[d];w&&_(w)}}let y=-1;return Ye.createPortal(o.jsx("div",{className:W.overlay,role:"presentation",onClick:()=>t(!1),children:o.jsxs("div",{ref:c,role:"dialog","aria-modal":"true","aria-label":"Command palette",className:x.cn(W.dialog,a),onClick:g=>g.stopPropagation(),children:[o.jsxs("div",{className:W.inputRow,children:[o.jsx(Hg,{}),o.jsx("input",{type:"text",role:"combobox","aria-expanded":"true","aria-controls":m,"aria-autocomplete":"list",autoFocus:!0,className:W.input,placeholder:s,value:i,onChange:g=>u(g.target.value),onKeyDown:b})]}),o.jsx("ul",{id:m,role:"listbox",className:W.list,children:f.length===0?o.jsx("li",{className:W.empty,children:r}):h.map(g=>o.jsxs("li",{className:W.group,children:[g.name&&o.jsx("div",{className:W.groupHeading,children:g.name}),o.jsx("ul",{role:"presentation",className:W.groupList,children:g.items.map(w=>{y+=1;const v=y===d,j=y;return o.jsxs("li",{role:"option","aria-selected":v,className:x.cn(W.option,v&&W.active),onMouseMove:()=>p(j),onClick:()=>_(w),children:[w.icon&&o.jsx("span",{className:W.icon,children:w.icon}),o.jsx("span",{className:W.label,children:w.label})]},w.id)})})]},g.name??"__ungrouped__"))})]})}),document.body)}function Hg(){return o.jsxs("svg",{className:W.searchIcon,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7",stroke:"currentColor",strokeWidth:"2"}),o.jsx("path",{d:"M20 20l-3.5-3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}const Gg="tempest_root_cWKqF",Jg={root:Gg},Qg=l.forwardRef(function({maxHeight:t,orientation:n="vertical",className:s,style:r,children:a,...c},i){const u={overflowX:n==="vertical"?"hidden":"auto",overflowY:n==="horizontal"?"hidden":"auto",...t!==void 0?{maxHeight:t}:{},...r};return o.jsx("div",{ref:i,className:x.cn(Jg.root,s),style:u,...c,children:a})}),Yg="tempest_root_-Xerf",Vg="tempest_horizontal_3QOMV",Xg="tempest_vertical_6A7lb",Zg="tempest_pane_x6yUG",eb="tempest_divider_fhaTB",tb="tempest_handle_eCe1B",Oe={root:Yg,horizontal:Vg,vertical:Xg,pane:Zg,divider:eb,handle:tb},ht=2;function Lt(e,t,n){return Math.min(n,Math.max(t,e))}function nb({direction:e="horizontal",defaultSize:t=50,min:n=10,max:s=90,children:r,className:a,...c}){const[i,u]=l.useState(()=>Lt(t,n,s)),d=l.useRef(null),[p,m]=r,f=e==="horizontal",h=l.useCallback((y,g)=>{const w=d.current;if(!w)return;const v=w.getBoundingClientRect(),j=f?v.width:v.height;if(j<=0)return;const M=(f?y-v.left:g-v.top)/j*100;u(Lt(M,n,s))},[f,n,s]),_=l.useCallback(y=>{y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId);const w=j=>{h(j.clientX,j.clientY)},v=()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",v)};window.addEventListener("pointermove",w),window.addEventListener("pointerup",v)},[h]),b=l.useCallback(y=>{let g=0;if(f?y.key==="ArrowRight"?g=ht:y.key==="ArrowLeft"&&(g=-ht):y.key==="ArrowDown"?g=ht:y.key==="ArrowUp"&&(g=-ht),y.key==="Home"){y.preventDefault(),u(n);return}if(y.key==="End"){y.preventDefault(),u(s);return}g!==0&&(y.preventDefault(),u(w=>Lt(w+g,n,s)))},[f,n,s]);return o.jsxs("div",{ref:d,className:x.cn(Oe.root,f?Oe.horizontal:Oe.vertical,a),...c,children:[o.jsx("div",{className:Oe.pane,style:{flexBasis:`${i}%`},children:p}),o.jsx("div",{role:"separator","aria-orientation":f?"vertical":"horizontal","aria-valuenow":Math.round(i),"aria-valuemin":n,"aria-valuemax":s,tabIndex:0,className:Oe.divider,onPointerDown:_,onKeyDown:b,children:o.jsx("span",{className:Oe.handle,"aria-hidden":"true"})}),o.jsx("div",{className:Oe.pane,style:{flexBasis:`${100-i}%`},children:m})]})}const sb="tempest_root_ObO-Z",rb="tempest_header_5nSJG",ob="tempest_title_Jd3Xb",ab="tempest_nav_4h58I",cb="tempest_weekdays_YzRfx",ib="tempest_grid_nbaFm",lb="tempest_weekday_k-7Vr",ub="tempest_day_ao-IC",db="tempest_outside_HkC-6",pb="tempest_today_p18-m",mb="tempest_selected_C9bTY",Y={root:sb,header:rb,title:ob,nav:ab,weekdays:cb,grid:ib,weekday:lb,day:ub,outside:db,today:pb,selected:mb},fb=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],hb=["January","February","March","April","May","June","July","August","September","October","November","December"],Yn=42;function Je(e,t,n){return new Date(e,t,n)}function yt(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function bn(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function yn(e,t,n){const s=yt(e).getTime();return!!(t&&s<yt(t).getTime()||n&&s>yt(n).getTime())}function _b(e,t){const n=e.getFullYear(),s=e.getMonth(),c=(Je(n,s,1).getDay()-t+7)%7,i=Je(n,s,1-c),u=[];for(let d=0;d<Yn;d+=1)u.push(Je(i.getFullYear(),i.getMonth(),i.getDate()+d));return u}function gb({value:e,defaultValue:t,onChange:n,month:s,onMonthChange:r,minDate:a,maxDate:c,weekStartsOn:i=0,className:u,...d}){const p=e!==void 0,[m,f]=l.useState(t),h=p?e:m,_=s!==void 0,[b,y]=l.useState(()=>{const $=s??e??t??new Date;return Je($.getFullYear(),$.getMonth(),1)}),g=_?Je(s.getFullYear(),s.getMonth(),1):b,[w,v]=l.useState(null),j=l.useRef(null),S=l.useMemo(()=>yt(new Date),[]),M=l.useMemo(()=>_b(g,i),[g,i]),T=l.useMemo(()=>Array.from({length:7},($,C)=>fb[(C+i)%7]),[i]),N=l.useCallback($=>{const C=Je(g.getFullYear(),g.getMonth()+$,1);r&&r(C),_||y(C)},[g,r,_]),k=l.useCallback($=>{yn($,a,c)||(n&&n($),p||f($))},[a,c,n,p]),E=l.useCallback($=>{const C=Math.max(0,Math.min(Yn-1,$));v(C);const F=j.current;if(!F)return;F.querySelectorAll("button[data-day]")[C]?.focus()},[]),D=l.useCallback(($,C)=>{switch($.key){case"ArrowLeft":$.preventDefault(),E(C-1);break;case"ArrowRight":$.preventDefault(),E(C+1);break;case"ArrowUp":$.preventDefault(),E(C-7);break;case"ArrowDown":$.preventDefault(),E(C+7);break;case"Enter":case" ":$.preventDefault(),k(M[C]);break}},[E,k,M]);return o.jsxs("div",{className:x.cn(Y.root,u),...d,children:[o.jsxs("div",{className:Y.header,children:[o.jsx("button",{type:"button",className:Y.nav,"aria-label":"Previous month",onClick:()=>N(-1),children:"‹"}),o.jsxs("span",{className:Y.title,"aria-live":"polite",children:[hb[g.getMonth()]," ",g.getFullYear()]}),o.jsx("button",{type:"button",className:Y.nav,"aria-label":"Next month",onClick:()=>N(1),children:"›"})]}),o.jsx("div",{className:Y.weekdays,role:"row",children:T.map($=>o.jsx("span",{className:Y.weekday,role:"columnheader",children:$},$))}),o.jsx("div",{className:Y.grid,role:"grid",ref:j,children:M.map(($,C)=>{const F=$.getMonth()===g.getMonth(),L=h?bn($,h):!1,R=bn($,S),q=yn($,a,c),ut=w===null?F&&$.getDate()===1:w===C;return o.jsx("button",{type:"button","data-day":!0,role:"gridcell",className:x.cn(Y.day,!F&&Y.outside,L&&Y.selected,R&&Y.today),"aria-pressed":L,"aria-selected":L,"aria-current":R?"date":void 0,disabled:q,tabIndex:ut?0:-1,onClick:()=>k($),onKeyDown:Ds=>D(Ds,C),children:$.getDate()},C)})})]})}const bb="tempest_wrapper_KCCs1",yb="tempest_label_N4ak-",vb="tempest_value_-33zj",wb="tempest_field_wFJsg",xb="tempest_track_kaJkL",jb="tempest_fill_tio-b",$b="tempest_input_J48Um",kb="tempest_helper_yn8VW",Ce={wrapper:bb,label:yb,value:vb,field:wb,track:xb,fill:jb,input:$b,helper:kb};function Nb({value:e,onChange:t,min:n=0,max:s=100,step:r=1,label:a,helperText:c,disabled:i=!1,formatValue:u,className:d}){const p=l.useMemo(()=>{const h=s-n;return h<=0?0:Math.min(100,Math.max(0,(e-n)/h*100))},[e,n,s]),m=u?.(e)??String(e),f=l.useCallback(h=>{t(Number(h.target.value))},[t]);return o.jsxs("div",{className:x.cn(Ce.wrapper,d),children:[a&&o.jsxs("div",{className:Ce.label,children:[o.jsx("span",{children:a}),o.jsx("span",{className:Ce.value,children:m})]}),o.jsxs("div",{className:Ce.field,children:[o.jsx("div",{className:Ce.track}),o.jsx("div",{className:Ce.fill,style:{width:`${p}%`}}),o.jsx("input",{type:"range",className:Ce.input,min:n,max:s,step:r,value:e,onChange:f,disabled:i,"aria-label":a??"Slider","aria-valuetext":m})]}),c&&o.jsx("span",{className:Ce.helper,children:c})]})}const Sb="tempest_wrapper_6xZZr",Cb="tempest_label_Jwj7I",Eb="tempest_field_GpA0V",Tb="tempest_disabled_BIKaG",Mb="tempest_chip_Zk0ch",Rb="tempest_chipRemove_R-mNv",Lb="tempest_input_SjOXU",Db="tempest_menu_3xnmo",Ib="tempest_option_lqEl1",Pb="tempest_check_aUM1w",Ab="tempest_active_S9sQ-",Fb="tempest_selected_Rw8yr",Ob="tempest_empty_-5B16",Bb="tempest_helper_c7aH3",zb="tempest_errorText_qZR9s",Wb="tempest_error_DIOTW",O={wrapper:Sb,label:Cb,field:Eb,disabled:Tb,chip:Mb,chipRemove:Rb,input:Lb,menu:Db,option:Ib,check:Pb,active:Ab,selected:Fb,empty:Ob,helper:Bb,errorText:zb,error:Wb};function qb(e,t){return t?e.label.toLowerCase().includes(t.toLowerCase()):!0}function Ub({options:e,value:t,onChange:n,label:s,placeholder:r="Selecione",helperText:a,error:c,disabled:i,maxItems:u,filter:d=qb,emptyMessage:p="Nenhuma opção encontrada",className:m}){const f=l.useId(),h=l.useRef(null),_=l.useRef(null),[b,y]=l.useState(!1),[g,w]=l.useState(""),[v,j]=l.useState(0),S=l.useMemo(()=>new Set(t),[t]),M=l.useMemo(()=>t.map($=>e.find(C=>C.value===$)).filter($=>!!$),[t,e]),T=l.useMemo(()=>e.filter($=>d($,g)),[e,d,g]),N=u!==void 0&&t.length>=u,k=l.useCallback($=>{if(!$.disabled){if(S.has($.value))n(t.filter(C=>C!==$.value));else{if(N)return;n([...t,$.value])}w(""),_.current?.focus()}},[S,n,t,N]),E=l.useCallback($=>{n(t.filter(C=>C!==$))},[n,t]);l.useEffect(()=>{if(!b)return;const $=C=>{h.current&&!h.current.contains(C.target)&&(y(!1),w(""))};return window.addEventListener("mousedown",$),()=>window.removeEventListener("mousedown",$)},[b]);const D=$=>{if($.key==="ArrowDown")$.preventDefault(),y(!0),j(C=>Math.min(T.length-1,C+1));else if($.key==="ArrowUp")$.preventDefault(),j(C=>Math.max(0,C-1));else if($.key==="Enter"){$.preventDefault();const C=T[v];C&&k(C)}else $.key==="Escape"?(y(!1),w("")):$.key==="Backspace"&&g===""&&t.length>0&&E(t[t.length-1])};return o.jsxs("div",{ref:h,className:x.cn(O.wrapper,c&&O.error,m),children:[s&&o.jsx("label",{htmlFor:f,className:O.label,children:s}),o.jsxs("div",{className:x.cn(O.field,i&&O.disabled),onMouseDown:$=>{i||$.target===$.currentTarget&&($.preventDefault(),_.current?.focus(),y(!0))},children:[M.map($=>o.jsxs("span",{className:O.chip,children:[$.label,o.jsx("button",{type:"button",className:O.chipRemove,"aria-label":`Remover ${$.label}`,disabled:i,onMouseDown:C=>{C.preventDefault(),E($.value)},children:"×"})]},$.value)),o.jsx("input",{id:f,ref:_,type:"text",role:"combobox","aria-expanded":b,"aria-controls":`${f}-listbox`,"aria-autocomplete":"list",className:O.input,placeholder:t.length===0?r:"",disabled:i,value:g,onFocus:()=>y(!0),onChange:$=>{w($.target.value),y(!0),j(0)},onKeyDown:D})]}),b&&o.jsx("ul",{id:`${f}-listbox`,role:"listbox","aria-multiselectable":!0,className:O.menu,children:T.length===0?o.jsx("li",{className:O.empty,children:p}):T.map(($,C)=>{const F=S.has($.value);return o.jsxs("li",{role:"option","aria-selected":F,"aria-disabled":$.disabled||!F&&N,className:x.cn(O.option,C===v&&O.active,F&&O.selected),onMouseEnter:()=>j(C),onMouseDown:L=>{L.preventDefault(),k($)},children:[o.jsx("span",{className:O.check,"aria-hidden":!0,children:F?"✓":""}),$.label]},$.value)})}),c?o.jsx("span",{className:O.errorText,children:c}):a?o.jsx("span",{className:O.helper,children:a}):null]})}const Kb="tempest_root_fVC66",Hb="tempest_header_sTdRM",Gb="tempest_headerSpacer_nqeNO",Jb="tempest_nav_7nFJE",Qb="tempest_months_fbwtK",Yb="tempest_month_0WfUc",Vb="tempest_title_OGQrm",Xb="tempest_weekdays_nYTrg",Zb="tempest_grid_O0eUF",ey="tempest_weekday_cy-Mz",ty="tempest_day_-V6FX",ny="tempest_outside_3otid",sy="tempest_today_gwmhs",ry="tempest_inRange_iQJYA",oy="tempest_selected_DRsBO",ay="tempest_rangeStart_-Oe1u",cy="tempest_rangeEnd_mUaKW",P={root:Kb,header:Hb,headerSpacer:Gb,nav:Jb,months:Qb,month:Yb,title:Vb,weekdays:Xb,grid:Zb,weekday:ey,day:ty,outside:ny,today:sy,inRange:ry,selected:oy,rangeStart:ay,rangeEnd:cy},iy=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],vn=["January","February","March","April","May","June","July","August","September","October","November","December"],ly=42;function at(e,t,n){return new Date(e,t,n)}function ie(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function wn(e,t){return at(e.getFullYear(),e.getMonth()+t,1)}function Dt(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function xn(e,t,n){const s=ie(e).getTime();return!!(t&&s<ie(t).getTime()||n&&s>ie(n).getTime())}function uy(e,t,n){const s=ie(e).getTime(),r=Math.min(ie(t).getTime(),ie(n).getTime()),a=Math.max(ie(t).getTime(),ie(n).getTime());return s>r&&s<a}function dy(e,t){const n=e.getFullYear(),s=e.getMonth(),a=(at(n,s,1).getDay()-t+7)%7,c=at(n,s,1-a);return Array.from({length:ly},(i,u)=>at(c.getFullYear(),c.getMonth(),c.getDate()+u))}function py({value:e,onChange:t,numberOfMonths:n=2,defaultMonth:s,minDate:r,maxDate:a,weekStartsOn:c=0,className:i,...u}){const[d,p]=l.useState(()=>{const v=s??e.start??new Date;return at(v.getFullYear(),v.getMonth(),1)}),[m,f]=l.useState(null),h=l.useMemo(()=>ie(new Date),[]),_=l.useMemo(()=>Array.from({length:7},(v,j)=>iy[(j+c)%7]),[c]),b=l.useCallback(v=>{if(xn(v,r,a))return;const{start:j,end:S}=e;!j||S?t({start:v,end:null}):ie(v).getTime()<ie(j).getTime()?t({start:v,end:j}):t({start:j,end:v})},[e,t,r,a]),y=l.useCallback(v=>{p(j=>wn(j,v))},[]),g=e.start&&!e.end?m:e.end;function w(v){const{start:j}=e,S=g,M=j?Dt(v,j):!1,T=S?Dt(v,S):!1,N=j&&S?uy(v,j,S):!1;return{selected:M||T,inRange:N,isStart:M,isEnd:T}}return o.jsxs("div",{className:x.cn(P.root,i),...u,children:[o.jsxs("div",{className:P.header,children:[o.jsx("button",{type:"button",className:P.nav,"aria-label":"Previous month",onClick:()=>y(-1),children:"‹"}),o.jsx("span",{className:P.headerSpacer,"aria-hidden":!0}),o.jsx("button",{type:"button",className:P.nav,"aria-label":"Next month",onClick:()=>y(1),children:"›"})]}),o.jsx("div",{className:P.months,onMouseLeave:()=>f(null),children:Array.from({length:Math.max(1,n)},(v,j)=>{const S=wn(d,j),M=dy(S,c);return o.jsxs("div",{className:P.month,children:[o.jsxs("div",{className:P.title,"aria-live":"polite",children:[vn[S.getMonth()]," ",S.getFullYear()]}),o.jsx("div",{className:P.weekdays,role:"row",children:_.map(T=>o.jsx("span",{className:P.weekday,role:"columnheader",children:T},T))}),o.jsx("div",{className:P.grid,role:"grid",children:M.map((T,N)=>{const k=T.getMonth()===S.getMonth(),E=xn(T,r,a),{selected:D,inRange:$,isStart:C,isEnd:F}=w(T),L=Dt(T,h);return o.jsx("button",{type:"button",role:"gridcell",className:x.cn(P.day,!k&&P.outside,$&&P.inRange,D&&P.selected,C&&P.rangeStart,F&&P.rangeEnd,L&&P.today),"aria-label":`${vn[T.getMonth()]} ${T.getDate()}, ${T.getFullYear()}`,"aria-selected":D,"aria-current":L?"date":void 0,disabled:E,onClick:()=>b(T),onMouseEnter:()=>f(T),children:T.getDate()},N)})})]},j)})})]})}const my="tempest_root_Nosqs",fy="tempest_list_v9FNC",hy="tempest_item_9RzZ7",_y="tempest_link_67ULr",gy="tempest_trigger_2gBDu",by="tempest_panel_N2ujp",yy="tempest_subItem_LjtO7",we={root:my,list:fy,item:hy,link:_y,trigger:gy,panel:by,subItem:yy};function vy({items:e,className:t,...n}){const[s,r]=l.useState(-1),[a,c]=l.useState(-1),i=l.useId(),u=l.useRef(null),d=l.useCallback(()=>{r(-1),c(-1)},[]),p=s!==-1?s:a;l.useEffect(()=>{if(p===-1)return;const f=_=>{_.key==="Escape"&&d()},h=_=>{u.current&&!u.current.contains(_.target)&&d()};return window.addEventListener("keydown",f),window.addEventListener("mousedown",h),()=>{window.removeEventListener("keydown",f),window.removeEventListener("mousedown",h)}},[p,d]);const m=(f,h)=>{const _=()=>{f.onSelect?.(),d()};return f.href?o.jsx("a",{href:f.href,role:h==="menuitem"?"menuitem":void 0,className:we.link,onClick:_,children:f.label}):o.jsx("button",{type:"button",role:h==="menuitem"?"menuitem":void 0,className:we.link,onClick:_,children:f.label})};return o.jsx("nav",{ref:u,className:x.cn(we.root,t),...n,children:o.jsx("ul",{className:we.list,children:e.map((f,h)=>{if(!(!!f.children&&f.children.length>0))return o.jsx("li",{className:we.item,children:m(f,"none")},h);const b=p===h,y=`${i}-panel-${h}`;return o.jsxs("li",{className:we.item,onMouseEnter:()=>c(h),onMouseLeave:()=>c(g=>g===h?-1:g),children:[o.jsx("button",{type:"button",className:we.trigger,"aria-haspopup":"menu","aria-expanded":b,"aria-controls":y,onClick:()=>r(g=>g===h?-1:h),onFocus:()=>c(h),children:f.label}),b&&o.jsx("ul",{id:y,role:"menu",className:we.panel,children:f.children.map((g,w)=>o.jsx("li",{role:"none",className:we.subItem,children:m(g,"menuitem")},w))})]},h)})})})}const wy="tempest_root_PGUO2",xy="tempest_menu_hEVLT",jy="tempest_trigger_ZlZBx",$y="tempest_triggerOpen_Hpfbu",ky="tempest_panel_6ta6u",Ny="tempest_item_wM-61",Sy="tempest_itemLabel_wXfB2",Cy="tempest_shortcut_qNlmN",Ey="tempest_separator_LfK3t",xe={root:wy,menu:xy,trigger:jy,triggerOpen:$y,panel:ky,item:Ny,itemLabel:Sy,shortcut:Cy,separator:Ey};function Ty(e){return"separator"in e}function My({menus:e,className:t,...n}){const[s,r]=l.useState(-1),a=l.useId(),c=l.useRef(null),i=l.useRef([]),u=l.useCallback(()=>{r(-1)},[]);return l.useEffect(()=>{if(s===-1)return;const d=m=>{if(m.key==="Escape"){u(),i.current[s]?.focus();return}if(m.key==="ArrowRight"){m.preventDefault();const f=(s+1)%e.length;r(f),i.current[f]?.focus()}if(m.key==="ArrowLeft"){m.preventDefault();const f=(s-1+e.length)%e.length;r(f),i.current[f]?.focus()}},p=m=>{c.current&&!c.current.contains(m.target)&&u()};return window.addEventListener("keydown",d),window.addEventListener("mousedown",p),()=>{window.removeEventListener("keydown",d),window.removeEventListener("mousedown",p)}},[s,e.length,u]),o.jsx("div",{ref:c,role:"menubar",className:x.cn(xe.root,t),...n,children:e.map((d,p)=>{const m=s===p,f=`${a}-panel-${p}`;return o.jsxs("div",{className:xe.menu,children:[o.jsx("button",{ref:h=>{i.current[p]=h},type:"button",role:"menuitem","aria-haspopup":"menu","aria-expanded":m,"aria-controls":m?f:void 0,className:x.cn(xe.trigger,m&&xe.triggerOpen),onClick:()=>r(h=>h===p?-1:p),children:d.label}),m&&o.jsx("ul",{id:f,role:"menu",className:xe.panel,children:d.items.map((h,_)=>Ty(h)?o.jsx("li",{role:"separator",className:xe.separator,"aria-hidden":!0},_):o.jsx("li",{role:"none",children:o.jsxs("button",{type:"button",role:"menuitem",className:xe.item,disabled:h.disabled,onClick:()=>{h.onSelect?.(),u()},children:[o.jsx("span",{className:xe.itemLabel,children:h.label}),h.shortcut&&o.jsx("span",{className:xe.shortcut,children:h.shortcut})]})},_))})]},p)})})}const Ry="tempest_root_-w3-j",Ly="tempest_viewport_n0hzM",Dy="tempest_track_5PA8h",Iy="tempest_slide_fhfjg",Py="tempest_arrow_S92Lt",Ay="tempest_prev_X8whU",Fy="tempest_next_jBRSz",Oy="tempest_dots_fL3Hr",By="tempest_dot_vEB56",zy="tempest_dotActive_OSSUg",oe={root:Ry,viewport:Ly,track:Dy,slide:Iy,arrow:Py,prev:Ay,next:Fy,dots:Oy,dot:By,dotActive:zy};function Wy({children:e,loop:t=!1,showArrows:n=!0,showDots:s=!0,index:r,defaultIndex:a=0,onIndexChange:c,className:i,...u}){const d=e.length,p=r!==void 0,[m,f]=l.useState(a),h=p?r:m,_=l.useCallback(w=>{let v=w;v<0?v=t?d-1:0:v>=d&&(v=t?0:d-1),v!==h&&(p||f(v),c?.(v))},[d,t,h,p,c]),b=h<=0,y=h>=d-1,g=w=>{w.key==="ArrowRight"?(w.preventDefault(),_(h+1)):w.key==="ArrowLeft"&&(w.preventDefault(),_(h-1))};return o.jsxs("div",{role:"region","aria-roledescription":"carousel",tabIndex:0,className:x.cn(oe.root,i),onKeyDown:g,...u,children:[o.jsx("div",{className:oe.viewport,children:o.jsx("div",{className:oe.track,style:{transform:`translateX(-${h*100}%)`},children:e.map((w,v)=>o.jsx("div",{role:"group","aria-roledescription":"slide","aria-label":`${v+1} of ${d}`,"aria-hidden":v!==h,className:oe.slide,children:w},v))})}),n&&d>1&&o.jsxs(o.Fragment,{children:[o.jsx("button",{type:"button",className:x.cn(oe.arrow,oe.prev),"aria-label":"Previous slide",disabled:!t&&b,onClick:()=>_(h-1),children:"‹"}),o.jsx("button",{type:"button",className:x.cn(oe.arrow,oe.next),"aria-label":"Next slide",disabled:!t&&y,onClick:()=>_(h+1),children:"›"})]}),s&&d>1&&o.jsx("div",{className:oe.dots,role:"tablist","aria-label":"Slides",children:e.map((w,v)=>o.jsx("button",{type:"button",role:"tab","aria-label":`Go to slide ${v+1}`,"aria-selected":v===h,className:x.cn(oe.dot,v===h&&oe.dotActive),onClick:()=>_(v)},v))})]})}function qy(e,t=300){const[n,s]=l.useState(e);return l.useEffect(()=>{const r=setTimeout(()=>s(e),t);return()=>clearTimeout(r)},[e,t]),n}function Vn(e=1,t=50){const[n,s]=l.useState(e),[r,a]=l.useState(t),c=l.useCallback(()=>s(1),[]);return{page:n,size:r,setPage:s,setSize:a,reset:c}}function Uy(e,t,n){return l.useMemo(()=>{const s=t.trim().toLowerCase();return s?typeof n=="function"?e.filter(r=>n(r,s)):e.filter(r=>n.some(a=>{const c=r[a];return c!=null&&String(c).toLowerCase().includes(s)})):e},[e,t,n])}function Ky(e){const[t,n]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{if(typeof window>"u")return;const s=window.matchMedia(e),r=a=>n(a.matches);return n(s.matches),s.addEventListener("change",r),()=>s.removeEventListener("change",r)},[e]),t}function Hy(e,t,n,s){const r=l.useRef(t);r.current=t,l.useEffect(()=>{const a=n===void 0?typeof window>"u"?null:window:"current"in n?n.current??null:n;if(!a?.addEventListener)return;const c=i=>r.current(i);return a.addEventListener(e,c,s),()=>a.removeEventListener(e,c,s)},[e,n,s])}const Gy=JSON.stringify,Jy=e=>JSON.parse(e);function Qy(e,t,n={}){const s=n.serialize??Gy,r=n.deserialize??Jy,a=l.useCallback(()=>{if(typeof window>"u")return t;try{const p=window.localStorage.getItem(e);return p===null?t:r(p)}catch{return t}},[e,t,r]),[c,i]=l.useState(a);l.useEffect(()=>{i(a())},[a]);const u=l.useCallback(p=>{i(m=>{const f=typeof p=="function"?p(m):p;try{typeof window<"u"&&window.localStorage.setItem(e,s(f))}catch{}return f})},[e,s]),d=l.useCallback(()=>{try{typeof window<"u"&&window.localStorage.removeItem(e)}catch{}i(t)},[e,t]);return l.useEffect(()=>{if(typeof window>"u")return;const p=m=>{if(m.key===e){if(m.newValue===null){i(t);return}try{i(r(m.newValue))}catch{}}};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[e,t,r]),[c,u,d]}function Yy(e=!1){const[t,n]=l.useState(e),s=l.useCallback(()=>n(i=>!i),[]),r=l.useCallback(()=>n(!0),[]),a=l.useCallback(()=>n(!1),[]),c=l.useCallback(i=>n(i),[]);return[t,{toggle:s,setTrue:r,setFalse:a,set:c}]}function Vy(e,t=[],n={}){const{immediate:s=!1}=n,[r,a]=l.useState({status:"idle",data:void 0,error:void 0}),c=l.useRef(e);c.current=e;const i=l.useRef(0),u=l.useRef(!0);l.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const d=l.useCallback(async()=>{const m=++i.current;a(f=>({...f,status:"pending",error:void 0}));try{const f=await c.current();return u.current&&i.current===m&&a({status:"success",data:f,error:void 0}),f}catch(f){throw u.current&&i.current===m&&a({status:"error",data:void 0,error:f}),f}},[]),p=l.useCallback(()=>{i.current++,a({status:"idle",data:void 0,error:void 0})},[]);return l.useEffect(()=>{s&&d().catch(()=>{})},[s,...t]),{status:r.status,data:r.data,error:r.error,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",run:d,reset:p}}function Xy(){const[e,t]=l.useState(()=>typeof navigator>"u"?!0:navigator.onLine);return l.useEffect(()=>{if(typeof window>"u")return;const n=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",n),window.addEventListener("offline",s),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}},[]),e}function Zy(){const[e,t]=l.useState(()=>typeof document>"u"?"visible":document.visibilityState);return l.useEffect(()=>{if(typeof document>"u")return;const n=()=>t(document.visibilityState);return document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n)},[]),e}function ev(e,t={}){const[n,s]=l.useState(null),{once:r=!1,root:a,rootMargin:c,threshold:i}=t;return l.useEffect(()=>{const u=e.current;if(!u||typeof IntersectionObserver>"u")return;const d=new IntersectionObserver(([p])=>{p&&(s(p),r&&p.isIntersecting&&d.unobserve(u))},{root:a,rootMargin:c,threshold:i});return d.observe(u),()=>d.disconnect()},[e,r,a,c,i]),n}function tv(e){const[t,n]=l.useState(null);return l.useEffect(()=>{const s=e.current;if(!s||typeof ResizeObserver>"u")return;const r=new ResizeObserver(a=>{const c=a[0];if(!c)return;const i=c.contentRect;n({width:i.width,height:i.height})});return r.observe(s),()=>r.disconnect()},[e]),t}function nv(e={}){const{resetAfter:t=1500}=e,[n,s]=l.useState(!1),r=l.useRef(null),a=l.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null),s(!1)},[]);l.useEffect(()=>()=>a(),[a]);const c=l.useCallback(async i=>{try{if(typeof navigator<"u"&&navigator.clipboard?.writeText)await navigator.clipboard.writeText(i);else if(typeof document<"u"){const u=document.createElement("textarea");u.value=i,u.style.position="fixed",u.style.opacity="0",document.body.appendChild(u),u.select(),document.execCommand("copy"),document.body.removeChild(u)}else return!1;return s(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>s(!1),t),!0}catch{return!1}},[t]);return{copied:n,copy:c,reset:a}}function sv(e,t){if(e.key.toLowerCase()!==t.key.toLowerCase())return!1;const n=!!t.ctrl,s=!!t.meta,r=!!t.shift,a=!!t.alt;if(t.mod){if(!e.ctrlKey&&!e.metaKey)return!1}else if(e.ctrlKey!==n||e.metaKey!==s)return!1;return!(e.shiftKey!==r||e.altKey!==a)}function rv(e){if(!(e instanceof HTMLElement))return!1;const t=e.tagName.toLowerCase();return t==="input"||t==="textarea"||t==="select"?!0:e.isContentEditable}function ov(e,t,n={}){const{disabled:s=!1,ignoreInput:r=!0}=n;l.useEffect(()=>{if(s||typeof window>"u")return;const a=c=>{r&&rv(c.target)||sv(c,e)&&t(c)};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[s,r,e.key,e.ctrl,e.meta,e.shift,e.alt,e.mod,t])}const jn=["mousemove","mousedown","keydown","touchstart","wheel","scroll"];function av(e=6e4){const[t,n]=l.useState(!1);return l.useEffect(()=>{if(typeof window>"u")return;let s=setTimeout(()=>n(!0),e);function r(){n(!1),clearTimeout(s),s=setTimeout(()=>n(!0),e)}for(const a of jn)window.addEventListener(a,r,{passive:!0});return()=>{clearTimeout(s);for(const a of jn)window.removeEventListener(a,r)}},[e]),t}function cv(e={}){const{watch:t=!1,disabled:n=!1,...s}=e,[r,a]=l.useState({loading:!n,error:null,coords:null,timestamp:null});return l.useEffect(()=>{if(n||typeof navigator>"u"||!navigator.geolocation){a(u=>({...u,loading:!1}));return}const c=u=>{a({loading:!1,error:null,coords:u.coords,timestamp:u.timestamp})},i=u=>{a(d=>({...d,loading:!1,error:u}))};if(t){const u=navigator.geolocation.watchPosition(c,i,s);return()=>navigator.geolocation.clearWatch(u)}navigator.geolocation.getCurrentPosition(c,i,s)},[n,t,s.enableHighAccuracy,s.maximumAge,s.timeout]),r}function iv(e){l.useEffect(()=>{if(!e||typeof document>"u")return;const t=document.body,n=t.style.overflow;return t.style.overflow="hidden",()=>{t.style.overflow=n}},[e])}function lv(e){const t=l.useRef(e);return t.current=e,l.useCallback((...n)=>t.current(...n),[])}function Kt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null||Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((r,a)=>Kt(r,t[a]));const n=Object.keys(e),s=Object.keys(t);return n.length!==s.length?!1:n.every(r=>Kt(e[r],t[r]))}function uv(e){const t=l.useRef(e);return Kt(t.current,e)||(t.current=e),t.current}function dv(e){const t=l.useRef(void 0);return l.useEffect(()=>{t.current=e},[e]),t.current}function pv(e,t){const n=l.useRef(e);n.current=e,l.useEffect(()=>{if(t===null)return;const s=setInterval(()=>n.current(),t);return()=>clearInterval(s)},[t])}function mv(e,t){const n=l.useRef(e);n.current=e,l.useEffect(()=>{if(t===null)return;const s=setTimeout(()=>n.current(),t);return()=>clearTimeout(s)},[t])}function fv(e,t){const[n,s]=l.useState(e),r=l.useRef(0),a=l.useRef(null);return l.useEffect(()=>{const c=Date.now(),i=c-r.current;return i>=t?(r.current=c,s(e)):(a.current&&clearTimeout(a.current),a.current=setTimeout(()=>{r.current=Date.now(),s(e)},t-i)),()=>{a.current&&clearTimeout(a.current)}},[e,t]),n}function hv(){const[e,t]=l.useState(()=>typeof window>"u"?{width:0,height:0}:{width:window.innerWidth,height:window.innerHeight});return l.useEffect(()=>{if(typeof window>"u")return;const n=()=>t({width:window.innerWidth,height:window.innerHeight});return n(),window.addEventListener("resize",n,{passive:!0}),()=>window.removeEventListener("resize",n)},[]),e}function _v(e){const[t,n]=l.useState(!1);return l.useEffect(()=>{const s=e.current;if(!s)return;const r=()=>n(!0),a=()=>n(!1);return s.addEventListener("mouseenter",r),s.addEventListener("mouseleave",a),()=>{s.removeEventListener("mouseenter",r),s.removeEventListener("mouseleave",a)}},[e]),t}function gv(e,t,n={}){const{delay:s=500,moveThreshold:r=10}=n,a=l.useRef(t);a.current=t,l.useEffect(()=>{const c=e.current;if(!c)return;let i=null,u=0,d=0;const p=()=>{i&&(clearTimeout(i),i=null)},m=h=>{u=h.clientX,d=h.clientY,p(),i=setTimeout(()=>{i=null,a.current()},s)},f=h=>{if(i===null)return;const _=h.clientX-u,b=h.clientY-d;Math.hypot(_,b)>r&&p()};return c.addEventListener("pointerdown",m),c.addEventListener("pointermove",f),c.addEventListener("pointerup",p),c.addEventListener("pointercancel",p),c.addEventListener("pointerleave",p),()=>{p(),c.removeEventListener("pointerdown",m),c.removeEventListener("pointermove",f),c.removeEventListener("pointerup",p),c.removeEventListener("pointercancel",p),c.removeEventListener("pointerleave",p)}},[e,s,r])}function bv(e=!1){const[t,n]=l.useState(e),s=l.useCallback(()=>n(!0),[]),r=l.useCallback(()=>n(!1),[]),a=l.useCallback(()=>n(i=>!i),[]),c=l.useMemo(()=>({open:s,close:r,toggle:a}),[s,r,a]);return[t,c]}function yv(e=[]){const[t,n]=l.useState(e),s=l.useCallback((...h)=>{n(_=>[..._,...h])},[]),r=l.useCallback((...h)=>{n(_=>[...h,..._])},[]),a=l.useCallback((h,..._)=>{n(b=>[...b.slice(0,h),..._,...b.slice(h)])},[]),c=l.useCallback((...h)=>{const _=new Set(h);n(b=>b.filter((y,g)=>!_.has(g)))},[]),i=l.useCallback(({from:h,to:_})=>{n(b=>{const y=[...b],[g]=y.splice(h,1);return y.splice(_,0,g),y})},[]),u=l.useCallback((h,_)=>{n(b=>b.map((y,g)=>g===h?_:y))},[]),d=l.useCallback(h=>n(h),[]),p=l.useCallback(h=>{n(_=>_.map(h))},[]),m=l.useCallback(()=>n([]),[]),f=l.useMemo(()=>({append:s,prepend:r,insert:a,remove:c,reorder:i,setItem:u,setState:d,apply:p,clear:m}),[s,r,a,c,i,u,d,p,m]);return[t,f]}const rt=(e,t,n)=>{let s=e;return typeof t=="number"&&(s=Math.max(t,s)),typeof n=="number"&&(s=Math.min(n,s)),s};function vv(e=0,t={}){const{min:n,max:s}=t,[r,a]=l.useState(()=>rt(e,n,s)),c=l.useCallback(()=>{a(m=>rt(m+1,n,s))},[n,s]),i=l.useCallback(()=>{a(m=>rt(m-1,n,s))},[n,s]),u=l.useCallback(m=>{a(rt(m,n,s))},[n,s]),d=l.useCallback(()=>{a(rt(e,n,s))},[e,n,s]),p=l.useMemo(()=>({increment:c,decrement:i,set:u,reset:d}),[c,i,u,d]);return[r,p]}function wv(e){l.useEffect(()=>{if(typeof document>"u")return;const t=document.title;return document.title=e,()=>{document.title=t}},[e])}function xv(e){l.useEffect(()=>{if(typeof document>"u")return;let t=document.querySelector('link[rel="icon"]');t||(t=document.createElement("link"),t.rel="icon",document.head.appendChild(t)),t.href=e},[e])}function jv(e){const[t,n]=l.useState(()=>new Map(e)),s=l.useCallback((u,d)=>{n(p=>{const m=new Map(p);return m.set(u,d),m})},[]),r=l.useCallback(u=>{n(d=>{if(!d.has(u))return d;const p=new Map(d);return p.delete(u),p})},[]),a=l.useCallback(()=>{n(u=>u.size===0?u:new Map)},[]),c=l.useCallback(u=>t.get(u),[t]),i=l.useCallback(u=>t.has(u),[t]);return l.useMemo(()=>({map:t,set:s,delete:r,clear:a,get:c,has:i,size:t.size}),[t,s,r,a,c,i])}function $v(e){const[t,n]=l.useState(()=>new Set(e)),s=l.useCallback(u=>{n(d=>{if(d.has(u))return d;const p=new Set(d);return p.add(u),p})},[]),r=l.useCallback(u=>{n(d=>{if(!d.has(u))return d;const p=new Set(d);return p.delete(u),p})},[]),a=l.useCallback(()=>{n(u=>u.size===0?u:new Set)},[]),c=l.useCallback(u=>t.has(u),[t]),i=l.useCallback(u=>{n(d=>{const p=new Set(d);return p.has(u)?p.delete(u):p.add(u),p})},[]);return l.useMemo(()=>({set:t,add:s,delete:r,clear:a,has:c,toggle:i,size:t.size}),[t,s,r,a,c,i])}function kv(e={}){const{initialValues:t=[],limit:n=1/0}=e,[s,r]=l.useState(()=>({queue:t.slice(0,n),overflow:t.slice(n)})),a=l.useCallback((...u)=>{r(d=>{const p=[...d.queue,...d.overflow,...u];return{queue:p.slice(0,n),overflow:p.slice(n)}})},[n]),c=l.useCallback(u=>{r(d=>{const p=[...u(d.queue),...d.overflow];return{queue:p.slice(0,n),overflow:p.slice(n)}})},[n]),i=l.useCallback(()=>{r(u=>({queue:u.overflow.slice(0,n),overflow:u.overflow.slice(n)}))},[n]);return l.useMemo(()=>({queue:s.queue,add:a,update:c,cleanQueue:i,size:s.queue.length}),[s.queue,a,c,i])}function Nv(e){const t=l.useRef(null),n=l.useRef(e);return n.current=e,l.useEffect(()=>{if(typeof document>"u")return;const s=r=>{const a=r.target;!t.current||a&&t.current.contains(a)||n.current()};return document.addEventListener("mousedown",s),document.addEventListener("touchstart",s),()=>{document.removeEventListener("mousedown",s),document.removeEventListener("touchstart",s)}},[]),t}function Sv(){const e=l.useRef(!0);return e.current?(e.current=!1,!0):!1}const Cv="tempest_wrapper_iB6ka",Ev="tempest_search_2y-yM",Tv="tempest_sortButton_9p6w4",Mv="tempest_sortIndicator_bZMlH",_t={wrapper:Cv,search:Ev,sortButton:Tv,sortIndicator:Mv};function Rv(e,t){return e==null&&t==null?0:e==null?-1:t==null?1:typeof e=="number"&&typeof t=="number"?e-t:e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():typeof e=="boolean"&&typeof t=="boolean"?Number(e)-Number(t):String(e).localeCompare(String(t),void 0,{numeric:!0})}function Lv({data:e,columns:t,pageSize:n=10,searchable:s=!1,searchKeys:r,initialSort:a,rowKey:c=(p,m)=>m,emptyMessage:i,className:u,...d}){const[p,m]=l.useState(""),[f,h]=l.useState(a??null),{page:_,setPage:b}=Vn(1,n),y=l.useMemo(()=>r&&r.length>0?r:t.filter(N=>{const k=e.find(D=>D[N.key]!=null),E=k?k[N.key]:void 0;return typeof E=="string"||typeof E=="number"}).map(N=>N.key),[r,t,e]),g=l.useMemo(()=>{const N=p.trim().toLowerCase();return!N||!s?e:e.filter(k=>y.some(E=>{const D=k[E];return D!=null&&String(D).toLowerCase().includes(N)}))},[e,p,s,y]),w=l.useMemo(()=>{if(!f)return g;const N=f.direction==="asc"?1:-1;return[...g].sort((k,E)=>Rv(k[f.key],E[f.key])*N)},[g,f]),v=Math.max(1,Math.ceil(w.length/n));l.useEffect(()=>{_>v&&b(v)},[_,v,b]);const j=Math.min(_,v),S=l.useMemo(()=>{const N=(j-1)*n;return w.slice(N,N+n)},[w,j,n]);function M(N){h(k=>!k||k.key!==N?{key:N,direction:"asc"}:k.direction==="asc"?{key:N,direction:"desc"}:null)}const T=l.useMemo(()=>t.map(N=>{const E=f?.key===N.key?f?.direction==="asc"?" ▲":" ▼":"",D=N.sortable?o.jsxs("button",{type:"button",className:_t.sortButton,onClick:()=>M(N.key),"aria-label":`Ordenar por ${typeof N.header=="string"?N.header:String(N.key)}`,children:[N.header,o.jsx("span",{className:_t.sortIndicator,"aria-hidden":!0,children:E})]}):N.header;return{key:String(N.key),header:D,align:N.align,priority:N.priority,width:N.width,render:N.render?$=>N.render($):$=>$[N.key]??null}}),[t,f]);return o.jsxs("div",{className:x.cn(_t.wrapper,u),...d,children:[s&&o.jsx(Wn,{value:p,onChange:N=>{m(N),b(1)},wrapperClassName:_t.search}),o.jsx(Un,{columns:T,data:S,rowKey:(N,k)=>c(N,(j-1)*n+k),emptyMessage:i}),v>1&&o.jsx(Fn,{page:j,totalPages:v,onPageChange:b,totalItems:w.length})]})}const Dv="tempest_tile_ZpED6",Iv="tempest_interactive_3ICXQ",Pv="tempest_selected_dMY11",Av="tempest_disabled_HnXxf",Fv="tempest_leading_gSuBb",Ov="tempest_trailing_cVd1n",Bv="tempest_body_gyEl2",zv="tempest_title_jWFBN",Wv="tempest_subtitle_GUtn7",je={tile:Dv,interactive:Iv,selected:Pv,disabled:Av,leading:Fv,trailing:Ov,body:Bv,title:zv,subtitle:Wv};function qv({leading:e,title:t,subtitle:n,trailing:s,onClick:r,disabled:a=!1,selected:c=!1,className:i}){const u=o.jsxs(o.Fragment,{children:[e!==void 0&&o.jsx("span",{className:je.leading,children:e}),o.jsxs("span",{className:je.body,children:[o.jsx("span",{className:je.title,children:t}),n!==void 0&&o.jsx("span",{className:je.subtitle,children:n})]}),s!==void 0&&o.jsx("span",{className:je.trailing,children:s})]}),d=x.cn(je.tile,c&&je.selected,a&&je.disabled,i);return r?o.jsx("button",{type:"button",className:x.cn(d,je.interactive),"aria-pressed":c?!0:void 0,disabled:a,onClick:r,children:u}):o.jsx("div",{className:d,children:u})}const Uv="tempest_fab_U3NIL",Kv="tempest_primary_8lnHI",Hv="tempest_surface_ZTMQ4",Gv="tempest_round_ljguw",Jv="tempest_sm_3-rLi",Qv="tempest_md_vOdzW",Yv="tempest_lg_Xc6vE",Vv="tempest_extended_GhPio",Xv="tempest_icon_cZ8Nq",Zv="tempest_label_tfoCq",ew="tempest_fixed_Xr8Xa",tw="tempest_bottomRight_bJ8Oo",nw="tempest_bottomLeft_USN6N",de={fab:Uv,primary:Kv,surface:Hv,round:Gv,sm:Jv,md:Qv,lg:Yv,extended:Vv,icon:Xv,label:Zv,fixed:ew,bottomRight:tw,bottomLeft:nw};function sw({icon:e,label:t,position:n="bottom-right",size:s="md",variant:r="primary",className:a,...c}){const i=t!==void 0;return o.jsxs("button",{type:"button",className:x.cn(de.fab,de[s],de[r],i?de.extended:de.round,n!=="none"&&de.fixed,n==="bottom-right"&&de.bottomRight,n==="bottom-left"&&de.bottomLeft,a),...c,children:[o.jsx("span",{className:de.icon,children:e}),i&&o.jsx("span",{className:de.label,children:t})]})}const rw="tempest_rail_bvns5",ow="tempest_header_Mikit",aw="tempest_list_rS6XJ",cw="tempest_footer_ojpGC",iw="tempest_item_XEXI9",lw="tempest_active_U3hSU",uw="tempest_iconWrap_iVwlb",dw="tempest_icon_-hpb6",pw="tempest_badge_1YxwU",mw="tempest_label_zCKyA",pe={rail:rw,header:ow,list:aw,footer:cw,item:iw,active:lw,iconWrap:uw,icon:dw,badge:pw,label:mw};function fw({items:e,value:t,onChange:n,header:s,footer:r,labelVisibility:a="all",className:c,...i}){return o.jsxs("nav",{className:x.cn(pe.rail,c),"aria-label":"Navegação lateral",...i,children:[s!==void 0&&o.jsx("div",{className:pe.header,children:s}),o.jsx("ul",{className:pe.list,children:e.map(u=>{const d=u.key===t,p=a==="all"||a==="selected"&&d;return o.jsx("li",{children:o.jsxs("button",{type:"button",className:x.cn(pe.item,d&&pe.active),"aria-current":d?"page":void 0,disabled:u.disabled,onClick:()=>n(u.key),children:[o.jsxs("span",{className:pe.iconWrap,children:[u.icon&&o.jsx("span",{className:pe.icon,children:u.icon}),u.badge!==void 0&&o.jsx("span",{className:pe.badge,children:u.badge})]}),p&&o.jsx("span",{className:pe.label,children:u.label})]})},u.key)})}),r!==void 0&&o.jsx("div",{className:pe.footer,children:r})]})}const hw="tempest_wrapper_tFKNC",_w="tempest_label_FUecv",gw="tempest_columns_XMru6",bw="tempest_column_bwotJ",yw="tempest_cellWrapper_xRos3",vw="tempest_cell_eSc7G",ww="tempest_active_6amgd",xw="tempest_helper_ihHGE",jw="tempest_disabled_NDezB",A={wrapper:hw,label:_w,columns:gw,column:bw,cellWrapper:yw,cell:vw,active:ww,helper:xw,disabled:jw};function gt(e){return e.toString().padStart(2,"0")}function $w(e){const t=/^(\d{1,2}):(\d{1,2})$/.exec(e.trim());if(!t)return{hour24:null,minute:null};const n=Number(t[1]),s=Number(t[2]);return n<0||n>23||s<0||s>59?{hour24:null,minute:null}:{hour24:n,minute:s}}function kw(e){const t=e%12;return t===0?12:t}function It(e,t){const n=e%12;return t==="PM"?n+12:n}function Nw({value:e,onChange:t,minuteStep:n=5,use12Hours:s=!1,label:r,helperText:a,disabled:c,className:i}){const u=l.useId(),{hour24:d,minute:p}=l.useMemo(()=>$w(e),[e]),m=d!==null&&d>=12?"PM":"AM",f=l.useMemo(()=>s?Array.from({length:12},(v,j)=>j+1):Array.from({length:24},(v,j)=>j),[s]),h=l.useMemo(()=>{const v=n>0?n:1,j=[];for(let S=0;S<60;S+=v)j.push(S);return j},[n]),_=d===null?null:s?kw(d):d,b=(v,j)=>{t(`${gt(v)}:${gt(j)}`)},y=v=>{if(c)return;const j=p??0,S=s?It(v,m):v;b(S,j)},g=v=>{if(c)return;const j=d??(s?It(12,"AM"):0);b(j,v)},w=v=>{if(c)return;const j=_??12,S=p??0;b(It(j,v),S)};return o.jsxs("div",{className:x.cn(A.wrapper,c&&A.disabled,i),children:[r&&o.jsx("span",{id:`${u}-label`,className:A.label,children:r}),o.jsxs("div",{className:A.columns,children:[o.jsx("ul",{role:"listbox","aria-label":"Horas",className:A.column,children:f.map(v=>{const j=v===_;return o.jsx("li",{className:A.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:c,className:x.cn(A.cell,j&&A.active),onClick:()=>y(v),children:s?v:gt(v)})},v)})}),o.jsx("ul",{role:"listbox","aria-label":"Minutos",className:A.column,children:h.map(v=>{const j=v===p;return o.jsx("li",{className:A.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:c,className:x.cn(A.cell,j&&A.active),onClick:()=>g(v),children:gt(v)})},v)})}),s&&o.jsx("ul",{role:"listbox","aria-label":"Período",className:A.column,children:["AM","PM"].map(v=>{const j=_!==null&&v===m;return o.jsx("li",{className:A.cellWrapper,children:o.jsx("button",{type:"button",role:"option","aria-selected":j,disabled:c,className:x.cn(A.cell,j&&A.active),onClick:()=>w(v),children:v})},v)})})]}),a&&o.jsx("span",{className:A.helper,children:a})]})}const Sw="tempest_wrapper_vGp-3",Cw="tempest_indicator_S7mV0",Ew="tempest_content_bZdpc",Tw="tempest_dragging_BvUty",bt={wrapper:Sw,indicator:Cw,content:Ew,dragging:Tw};function Mw(e,t){const n=t*1.5;return Math.min(e/2,n)}function Rw({onRefresh:e,children:t,threshold:n=80,disabled:s,className:r}){const a=l.useRef(null),c=l.useRef(null),[i,u]=l.useState(0),[d,p]=l.useState(!1),m=c.current!==null,f=w=>{if(s||d)return;const v=a.current;if(!v||v.scrollTop>0)return;const j=w.touches[0];j&&(c.current=j.clientY)},h=w=>{if(s||d)return;const v=c.current;if(v===null)return;const j=w.touches[0];if(!j)return;const S=j.clientY-v;if(S<=0){u(0);return}u(Mw(S,n))},_=()=>{c.current=null,u(0)},b=async()=>{if(s||d){_();return}if(!(c.current!==null&&i>=n)){_();return}c.current=null,p(!0),u(n);try{await e()}finally{p(!1),u(0)}},y=d||i>0,g=Math.min(1,i/n);return o.jsxs("div",{ref:a,className:x.cn(bt.wrapper,r),"data-refreshing":d,onTouchStart:f,onTouchMove:h,onTouchEnd:b,children:[o.jsx("div",{className:bt.indicator,"aria-hidden":!y,style:{opacity:d?1:g,transform:`translateX(-50%) translateY(${y?i:0}px) rotate(${g*360}deg)`},children:o.jsx(qn,{size:"sm",label:"Atualizando"})}),o.jsx("div",{className:x.cn(bt.content,(m||d)&&bt.dragging),style:{transform:`translateY(${y?i:0}px)`},children:t})]})}function Lw(e){return new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(e)}function Dw(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR").format(t)}function Iw(e){const t=typeof e=="string"?new Date(e):e;return Number.isNaN(t.getTime())?"":new Intl.DateTimeFormat("pt-BR",{dateStyle:"short",timeStyle:"short"}).format(t)}function Xn(e){const t=e.replace(/\D/g,"").slice(0,11);return t.length<=10?t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{4})(\d)/,"$1-$2"):t.replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d)/,"$1-$2")}function Zn(e){return e.replace(/\D/g,"").slice(0,11).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2")}function Pw(e){return new Intl.NumberFormat("pt-BR",{style:"percent",minimumFractionDigits:1,maximumFractionDigits:1}).format(e)}const Aw={get(e,t){if(typeof window>"u")return t;try{const n=window.localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}},set(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}},remove(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}}};function Fw(e){return e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Ow(e,t,n="…"){if(e.length<=t)return e;const s=Math.max(0,t-n.length);return e.slice(0,s).trimEnd()+n}function Bw(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}function zw(e){const t=e.replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean);return t.length===0?"":t.map((n,s)=>{const r=n.toLowerCase();return s===0?r:r.charAt(0).toUpperCase()+r.slice(1)}).join("")}function Ww(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function qw(e,t,n){return e===1?t:n??`${t}s`}function Uw(e,t){const n={};for(const s of e){const r=t(s);(n[r]??=[]).push(s)}return n}function Kw(e,t){const n=new Set,s=[];for(const r of e){const a=t(r);n.has(a)||(n.add(a),s.push(r))}return s}function Hw(e,t){if(t<1)throw new RangeError(`chunk size must be >= 1, received ${t}`);const n=[];for(let s=0;s<e.length;s+=t)n.push(e.slice(s,s+t));return n}function Gw(e,t,n=1){const s=[];if(n===0)return s;if(n>0)for(let r=e;r<t;r+=n)s.push(r);else for(let r=e;r>t;r+=n)s.push(r);return s}function ot(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Jw(e,t){const n={};for(const s of t)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n}function Qw(e,t){const n=new Set(t),s={};for(const r of Object.keys(e))n.has(r)||(s[r]=e[r]);return s}function es(e,t){if(!ot(e)||!ot(t))return t===void 0?e:t;const n={...e};for(const s of Object.keys(t)){const r=t[s],a=n[s];ot(a)&&ot(r)?n[s]=es(a,r):n[s]=r}return n}function Yw(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:e instanceof Map||e instanceof Set?e.size===0:ot(e)?Object.keys(e).length===0:!1}function Vw(e){return e!=null}function Xw(e){return typeof e=="string"}function Zw(e){return typeof e=="number"&&!Number.isNaN(e)}function ex(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function tx(e,t){throw new Error(t??`Unexpected value: ${String(e)}`)}function nx(e,t){let n;const s=(...r)=>{n!==void 0&&clearTimeout(n),n=setTimeout(()=>{n=void 0,e(...r)},t)};return s.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0)},s}function sx(e,t){let n,s,r=0;const a=i=>{r=Date.now(),e(...i)},c=(...i)=>{const u=Date.now(),d=t-(u-r);d<=0?(n!==void 0&&(clearTimeout(n),n=void 0),a(i)):(s=i,n===void 0&&(n=setTimeout(()=>{if(n=void 0,s!==void 0){const p=s;s=void 0,a(p)}},d)))};return c.cancel=()=>{n!==void 0&&(clearTimeout(n),n=void 0),s=void 0,r=0},c}function rx(e){let t=!1,n;return(...s)=>(t||(t=!0,n=e(...s)),n)}function ox(e){let t=!1,n,s;const r=a=>{if(!t||a.length!==n.length)return!1;for(let c=0;c<a.length;c++)if(!Object.is(a[c],n[c]))return!1;return!0};return(...a)=>(r(a)||(n=a,s=e(...a),t=!0),s)}function ax(e){return new Promise(t=>setTimeout(t,e))}function cx(e,t,n){return new Promise((s,r)=>{const a=setTimeout(()=>{const c=new Error(n??`Operation timed out after ${t}ms`);c.name="TimeoutError",r(c)},t);e.then(c=>{clearTimeout(a),s(c)},c=>{clearTimeout(a),r(c)})})}function Qt(e){let t;if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")t=crypto.randomUUID();else{const n=Date.now().toString(36),s=Math.random().toString(36).slice(2,10);t=`${n}-${s}`}return e?`${e}-${t}`:t}class $t extends Error{status;detail;code;requestId;body;constructor(t){super(t.detail),this.name="TempestApiError",this.status=t.status,this.detail=t.detail,this.code=t.code,this.requestId=t.requestId,this.body=t.body}}function ix(e){return typeof e=="object"&&e!==null&&typeof e.status=="number"&&typeof e.detail=="string"}function Yt(e,t,n,s){const r=typeof t=="object"&&t!==null?t:null,a=r?.detail??r?.message??`Erro ${e}`,c=typeof r?.code=="string"?r.code:void 0,i=typeof r?.details=="object"&&r.details!==null?r.details:null,u=(typeof i?.request_id=="string"?i.request_id:void 0)??n?.get("X-Request-ID")??s??void 0;return{status:e,detail:String(a),code:c,requestId:u??void 0,retryAfter:lx(n?.get("Retry-After")),body:t}}function lx(e){if(!e)return;const t=e.trim();if(/^\d+$/.test(t))return Number(t);const n=Date.parse(t);if(!Number.isNaN(n))return Math.max(0,Math.round((n-Date.now())/1e3))}function ux(e,t,n){const s=new URL(t,e.endsWith("/")?e:`${e}/`);if(n)for(const[r,a]of Object.entries(n))a!=null&&s.searchParams.set(r,String(a));return s.toString()}function dx(e){return typeof FormData<"u"&&e instanceof FormData}async function $n(e,t){let n=null;try{n=await e.clone().json()}catch{try{n=await e.text()}catch{n=null}}return new $t(Yt(e.status,n,e.headers,t))}function vt(e){const t=e.fetcher??globalThis.fetch.bind(globalThis);function n(){const c=e.getToken?.();return c?{Authorization:`Bearer ${c}`}:{}}async function s(c,i,u){const{body:d,params:p,headers:m,...f}=i,h=dx(d),_={...h?{}:{"Content-Type":"application/json"},...u?{"X-Request-ID":u}:{},...e.headers,...n(),...m},b={...f,headers:_,credentials:e.withCredentials?"include":f.credentials,body:d==null?void 0:h?d:JSON.stringify(d)};return t(ux(e.baseURL,c,p),b)}async function r(c,i={}){const u=e.requestId?e.requestId():Qt();let d=await s(c,i,u);if(d.status===401)if(e.refresh)try{await e.refresh(),d=await s(c,i,u)}catch{throw await e.onUnauthorized?.(d),await $n(d,u)}else await e.onUnauthorized?.(d);if(!d.ok)throw await $n(d,u);return d.status===204?void 0:(d.headers.get("content-type")??"").includes("application/json")?await d.json():await d.text()}async function a(c,i,u="POST"){return r(c,{method:u,body:i})}return{request:r,get:(c,i)=>r(c,{...i,method:"GET"}),post:(c,i)=>r(c,{...i,method:"POST"}),put:(c,i)=>r(c,{...i,method:"PUT"}),patch:(c,i)=>r(c,{...i,method:"PATCH"}),delete:(c,i)=>r(c,{...i,method:"DELETE"}),upload:a}}function px(e,t,n){const s=e.safeParse(t);if(s.success)return s.data;if(typeof process<"u"&&(process.env?.NODE_ENV==="development"||process.env?.NODE_ENV==="test")){const a=s.error.issues.map(c=>` - ${c.path.join(".")||"<root>"}: ${c.message}`).join(`
|
|
2
2
|
`);throw new Error(`[parseResponse] Contract drift on ${n}:
|
|
3
3
|
${a}
|
|
4
4
|
|
|
5
|
-
Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida do servidor (${n}).`)}function Pw(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function Aw(e){const{url:t,body:n,method:s="POST",headers:r={},getToken:a,withCredentials:c=!1,onProgress:i,signal:u,parser:d=JSON.parse,requestId:p}=e;return new Promise((m,f)=>{if(u?.aborted){f(new DOMException("Aborted","AbortError"));return}const h=new XMLHttpRequest;h.open(s,t),h.withCredentials=c;const _=a?.(),b=p?p():Kt(),v={...r};_&&!("Authorization"in v)&&(v.Authorization=`Bearer ${_}`),b&&!("X-Request-ID"in v)&&(v["X-Request-ID"]=b);for(const[w,y]of Object.entries(v))h.setRequestHeader(w,y);i&&(h.upload.onprogress=w=>{i({loaded:w.loaded,total:w.total,fraction:w.lengthComputable?w.loaded/w.total:null,lengthComputable:w.lengthComputable})});function g(){h.abort()}u?.addEventListener("abort",g),h.onload=()=>{u?.removeEventListener("abort",g);const w=h.status>=200&&h.status<300,y=h.getResponseHeader("content-type")??"";if(!w){const j=Pw(h.responseText);f(new wt(Ht(h.status,j,{get:S=>h.getResponseHeader(S)},b)));return}if(h.status===204||!h.responseText){m(void 0);return}if(y.includes("application/json"))try{m(d(h.responseText))}catch(j){f(j)}else m(h.responseText)},h.onerror=()=>{u?.removeEventListener("abort",g),f(new wt({status:0,detail:"Falha de rede no upload.",requestId:b||void 0}))},h.onabort=()=>{u?.removeEventListener("abort",g),f(new DOMException("Aborted","AbortError"))},h.send(n)})}function Fw(e,t){return new Promise((n,s)=>{if(t?.aborted){s(new DOMException("Aborted","AbortError"));return}const r=setTimeout(n,e);t?.addEventListener("abort",()=>{clearTimeout(r),s(new DOMException("Aborted","AbortError"))},{once:!0})})}async function Ow(e,t={}){const{retries:n=3,initialDelay:s=300,maxDelay:r=1e4,respectRetryAfter:a=!0,shouldRetry:c=()=>!0,onRetry:i,signal:u}=t;let d=0,p;for(;d<n;){if(u?.aborted)throw new DOMException("Aborted","AbortError");try{return await e()}catch(m){if(p=m,d+=1,d>=n||!c(m,d))throw m;const f=a&&typeof m?.retryAfter=="number"?m.retryAfter*1e3:null,h=Math.min(f!==null?f:s*2**(d-1),r);i?.({attempt:d,delay:h,error:m}),await Fw(h,u)}}throw p}function Bw(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16;return(e==="x"?Math.floor(t):Math.floor(t)&3|8).toString(16)})}function zw(e,t){const{interval:n,disabled:s=!1,stopWhen:r,onError:a}=t,[c,i]=l.useState(null),[u,d]=l.useState(null),[p,m]=l.useState(!s),f=l.useRef(s),h=l.useRef(!1),_=l.useRef(null);async function b(){if(!(f.current||h.current)){h.current=!0;try{const v=await e();if(f.current)return;i(v),d(null),r?.(v)&&(f.current=!0)}catch(v){f.current||(d(v),a?.(v))}finally{h.current=!1,m(!1),f.current||(_.current=setTimeout(b,n))}}}return l.useEffect(()=>{if(f.current=s,s){_.current&&clearTimeout(_.current);return}return m(!0),b(),()=>{f.current=!0,_.current&&clearTimeout(_.current)}},[n,s]),{data:c,error:u,loading:p,stop:()=>{f.current=!0,_.current&&clearTimeout(_.current)},start:()=>{f.current&&(f.current=!1,b())}}}function Qn(e={}){const t=e.name??"tempest-auth",n=e.storage==="session"?()=>sessionStorage:()=>localStorage;return Pt.create()(gt.persist(s=>({user:e.initialUser??null,token:e.initialToken??null,isAuthenticated:!!e.initialToken,setSession:({user:r,token:a})=>s({user:r,token:a,isAuthenticated:!0}),setUser:r=>s({user:r}),setToken:r=>s({token:r,isAuthenticated:!!r}),logout:()=>s({user:null,token:null,isAuthenticated:!1})}),{name:t,storage:gt.createJSONStorage(n),partialize:s=>({user:s.user,token:s.token}),onRehydrateStorage:()=>s=>{s&&(s.isAuthenticated=!!s.token)}}))}function Ww({isAuthenticated:e,children:t,fallback:n}){return o.jsx(o.Fragment,{children:e?t:n})}function wn(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4);return typeof atob<"u"?atob(t+n):Buffer.from(t+n,"base64").toString("binary")}function Gt(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT: must contain three segments.");const[n,s,r]=t;try{return{header:JSON.parse(wn(n)),payload:JSON.parse(wn(s)),signature:r}}catch{throw new Error("Invalid JWT: header or payload is not valid JSON.")}}function qw(e,t=0){try{const{payload:n}=Gt(e);if(typeof n.exp!="number")return!0;const s=Math.floor(Date.now()/1e3);return n.exp<=s+t}catch{return!0}}function Yn(e,t={}){const{retries:n=3,initialDelay:s=400,reloadOnFinalFailure:r=!0}=t;async function a(c=1){try{return await e()}catch(i){if(c>=n)throw r&&typeof window<"u"&&window.location.reload(),i;return await new Promise(u=>setTimeout(u,s*2**(c-1))),a(c+1)}}return l.lazy(a)}function Vn(e){let t=null;return()=>t||(t=(async()=>{try{await e()}finally{t=null}})(),t)}function Uw(e){const t=e??{};return{token:t.access_token,refreshToken:t.refresh_token}}function Kw(e){const{baseURL:t,loginPath:n="/api/auth/login",refreshPath:s="/api/auth/refresh",mePath:r,storeName:a="tempest-auth",storage:c="local",withCredentials:i=!1,fetcher:u,parseTokens:d=Uw,parseUser:p,refreshBody:m=k=>k?{refresh_token:k}:void 0}=e,f=Qn({name:a,storage:c}),h=`${a}-refresh`;function _(){return typeof window>"u"?null:c==="session"?window.sessionStorage:window.localStorage}function b(){return _()?.getItem(h)??null}function v(k){const E=_();E&&(k?E.setItem(h,k):E.removeItem(h))}const g=()=>f.getState(),w=()=>g().token,y=_t({baseURL:t,withCredentials:i,fetcher:u});async function j(){if(!r)return g().user;const k=w(),E=await _t({baseURL:t,withCredentials:i,fetcher:u,getToken:()=>k}).get(r);return g().setUser(E),E}async function S(k){const E=await y.post(n,{body:k}),{token:D,refreshToken:$}=d(E);g().setToken(D),v($??null);const C=p?.(E);return C!=null?(g().setUser(C),C):j()}function M(){g().logout(),v(null)}const T=Vn(async()=>{const k=await y.post(s,{body:m(b())}),{token:E,refreshToken:D}=d(k);g().setToken(E),D&&v(D)}),N=_t({baseURL:t,withCredentials:i,fetcher:u,getToken:w,refresh:T,onUnauthorized:()=>M()});return{useAuthStore:f,api:N,login:S,logout:M,refresh:T,getToken:w}}const Xn=l.createContext(null);function Hw({control:e,children:t}){return o.jsx(Xn.Provider,{value:e,children:t})}function Zn(){return l.useContext(Xn)}function Gw(e){return typeof e=="boolean"?{can:e}:e}function es(e){const t=Zn(),n=JSON.stringify(e),[s,r]=l.useState(()=>t?{allowed:!1,isLoading:!0}:{allowed:!0,isLoading:!1});return l.useEffect(()=>{if(!t){r({allowed:!0,isLoading:!1});return}let a=!1;return r(c=>({...c,isLoading:!0})),Promise.resolve(t.can(e)).then(c=>{if(a)return;const i=Gw(c);r({allowed:i.can,isLoading:!1,reason:i.reason})}).catch(c=>{a||r({allowed:!1,isLoading:!1,reason:c instanceof Error?c.message:"access check failed"})}),()=>{a=!0}},[t,n]),s}function Jw({action:e,resource:t,params:n,children:s,fallback:r}){const{allowed:a,isLoading:c}=es({action:e,resource:t,params:n});return c?o.jsx(o.Fragment,{children:r??null}):o.jsx(o.Fragment,{children:a?s:r??null})}function Qw(e){const t=new Set(e.permissions??[]),n=e.role?Array.isArray(e.role)?e.role:[e.role]:[];for(const s of n)for(const r of e.roles?.[s]??[])t.add(r);return t}function Yw(e){const t=Qw(e);return{can({action:n,resource:s}){return t.has("*")||s!==void 0&&(t.has(`${s}:*`)||t.has(`${s}:${n}`))||s===void 0&&t.has(n)?{can:!0}:{can:!1,reason:"missing permission"}}}}function Lt(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):typeof e=="string"?e.split(/\s+/).filter(Boolean):[]}function Vw(e,t){try{const{payload:n}=Gt(e),s=t?.claim??"permissions",r=Lt(n[s]);if(r.length>0)return r;if(t?.claim===void 0){const a=Lt(n.scopes);return a.length>0?a:Lt(n.scope)}return r}catch{return[]}}function Xw({component:e,onSuccess:t,onError:n,locale:s,theme:r,text:a,shape:c,size:i,disableOneTap:u,width:d,className:p,style:m}){return o.jsx("div",{className:p,style:m,children:e({onSuccess:f=>{if(!f.credential){n?.({provider:"google",message:"Google returned no credential",raw:f});return}return t({idToken:f.credential,provider:"google",raw:f})},onError:()=>{n?.({provider:"google",message:"Google login failed"})},locale:s,theme:r,text:a,shape:c,size:i,useOneTap:!u,width:d})})}function Zw(e){const{exchange:t,onSuccess:n,onError:s}=e,[r,a]=l.useState(null),[c,i]=l.useState(null),[u,d]=l.useState("pending"),p=l.useRef(!1);return l.useEffect(()=>{if(p.current)return;p.current=!0;let m=!1;return t().then(f=>{if(!m)return a(f),d("success"),n?.(f)}).catch(f=>{m||(i(f),d("error"),s?.(f))}),()=>{m=!0}},[t,n,s]),{loading:u==="pending",data:r,error:c,status:u}}const ts={SHORT:30*1e3,DEFAULT:300*1e3,LONG:1800*1e3,INFINITE:1/0},ns={SHORT:300*1e3,DEFAULT:1800*1e3,LONG:3600*1e3},ex={REALTIME:5*1e3,FAST:30*1e3,DEFAULT:60*1e3,SLOW:300*1e3};function tx(e,t){const n={all:[e]};for(const[s,r]of Object.entries(t))typeof r=="function"?n[s]=(...a)=>[e,...r(...a)]:n[s]=[e,...r];return n}function ss({children:e,client:t,defaultOptions:n}){const[s]=l.useState(()=>t??new G.QueryClient({defaultOptions:{queries:{staleTime:ts.DEFAULT,gcTime:ns.DEFAULT,retry:1,refetchOnWindowFocus:!1,...n?.queries??{}},mutations:{retry:0,...n?.mutations??{}}}}));return o.jsx(G.QueryClientProvider,{client:s,children:e})}function nx(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.items)&&typeof t.total=="number"&&typeof t.pages=="number"}function sx(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.items)&&typeof t.has_more=="boolean"&&"next_cursor"in t}function rx(e=20){return{items:[],total:0,page:1,size:e,pages:0}}function ox(e){const{queryKey:t,queryFn:n,initialPage:s=1,pageSize:r=20,sizeParam:a="size",orderBy:c,ascending:i=!1,...u}=e,[d,p]=l.useState(s),m=G.useQuery({...u,queryKey:[...t,{page:d,pageSize:r,sizeParam:a,orderBy:c,ascending:i}],queryFn:()=>{const y={page:d,[a]:r};return c&&(y.order_by=c,y.ascending=i),n(y)},placeholderData:G.keepPreviousData}),f=m.data,h=f?.pages??0,_=d<h,b=d>1,v=l.useCallback(y=>p(Math.max(1,y)),[]),g=l.useCallback(()=>p(y=>y<h?y+1:y),[h]),w=l.useCallback(()=>p(y=>y>1?y-1:y),[]);return{page:f,items:f?.items??[],pageNumber:d,pageCount:h,total:f?.total??0,hasNext:_,hasPrev:b,isLoading:m.isLoading,isFetching:m.isFetching,error:m.error,setPage:v,next:g,prev:w,refetch:()=>{m.refetch()}}}function ax(e){const{queryKey:t,queryFn:n,limit:s=20,orderBy:r,ascending:a=!1,...c}=e,i=G.useInfiniteQuery({...c,queryKey:[...t,{limit:s,orderBy:r,ascending:a}],initialPageParam:null,queryFn:({pageParam:d})=>n({cursor:d,limit:s,order_by:r,ascending:a}),getNextPageParam:d=>d.has_more?d.next_cursor:void 0}),u=i.data?.pages??[];return{items:u.flatMap(d=>d.items),pages:u,hasNextPage:i.hasNextPage,isLoading:i.isLoading,isFetchingNextPage:i.isFetchingNextPage,error:i.error,fetchNextPage:()=>{i.fetchNextPage()},refetch:()=>{i.refetch()}}}const cx=(e,t)=>t==null?`/${e}`:`/${e}/${t}`;function ix(e,t={}){const{pageParam:n="page",sizeParam:s="size",sortFieldParam:r="order_by",sortOrderParam:a="ascending",sortOrderAsBoolean:c=!0,updateMethod:i="patch",buildPath:u=cx}=t,d={getList(p,m={}){const{pagination:f,sort:h,filters:_}=m,b={};if(f?.page!=null&&(b[n]=f.page),f?.pageSize!=null&&(b[s]=f.pageSize),h?.field){const g=h.order??"asc";b[r]=h.field,b[a]=c?g==="asc":g}if(_)for(const[g,w]of Object.entries(_))b[g]=w;const v={params:b};return e.get(u(p),v)},getOne(p,m){return e.get(u(p,m))},getMany(p,m){return Promise.all(m.map(f=>d.getOne(p,f)))},create(p,m){return e.post(u(p),{body:m})},update(p,m,f){const h=u(p,m);return i==="put"?e.put(h,{body:f}):e.patch(h,{body:f})},deleteOne(p,m){return e.delete(u(p,m))}};return d}const rs=l.createContext(null);function lx({provider:e,children:t}){return o.jsx(rs.Provider,{value:e,children:t})}function Ge(){const e=l.useContext(rs);if(!e)throw new Error("useDataProvider must be used within a <TempestDataProvider>");return e}function os(e,t){return["data",e,"list",t]}function Jt(e,t){return["data",e,"one",t]}function ux(e,t,n){const s=Ge();return G.useQuery({queryKey:os(e,t),queryFn:()=>s.getList(e,t),...n})}function dx(e,t,n){const s=Ge(),{enabled:r,...a}=n??{};return G.useQuery({queryKey:Jt(e,t),queryFn:()=>s.getOne(e,t),enabled:t!=null&&(r??!0),...a})}function px(e,t){const n=Ge(),s=G.useQueryClient();return G.useMutation({mutationFn:r=>n.create(e,r),onSuccess:(...r)=>{s.invalidateQueries({queryKey:["data",e,"list"]}),t?.onSuccess?.(...r)},...t})}function mx(e,t){const n=Ge(),s=G.useQueryClient();return G.useMutation({mutationFn:({id:r,data:a})=>n.update(e,r,a),onSuccess:(...r)=>{const[,a]=r;s.invalidateQueries({queryKey:["data",e,"list"]}),s.invalidateQueries({queryKey:Jt(e,a.id)}),t?.onSuccess?.(...r)},...t})}function fx(e,t){const n=Ge(),s=G.useQueryClient();return G.useMutation({mutationFn:r=>n.deleteOne(e,r),onSuccess:(...r)=>{s.invalidateQueries({queryKey:["data",e,"list"]}),t?.onSuccess?.(...r)},...t})}function as({when:e,redirectTo:t="/",replace:n=!0,children:s}){return o.jsx(o.Fragment,{children:e?s:o.jsx(I.Navigate,{to:t,replace:n})})}function hx(e){return e}const xn=new WeakMap;function _x(e){let t=xn.get(e);return t||(t=Yn(e.lazy),xn.set(e,t)),t}function gx({guard:e,redirectTo:t,children:n}){const s=typeof e=="function"?e():e;return o.jsx(as,{when:s,redirectTo:t,children:n})}function cs(e){return e.map((t,n)=>{let s=t.element;if(t.lazy){const r=_x(t);s=o.jsx(r,{})}return t.guard!==void 0&&(s=o.jsx(gx,{guard:t.guard,redirectTo:t.redirectTo,children:s})),t.index?o.jsx(I.Route,{index:!0,element:s},`index-${n}`):o.jsx(I.Route,{path:t.path,element:s,caseSensitive:t.caseSensitive,children:t.children?cs(t.children):null},t.path??`route-${n}`)})}const bx={browser:I.BrowserRouter,hash:I.HashRouter,memory:I.MemoryRouter};function yx({routes:e,router:t="browser",basename:n,initialEntries:s,fallback:r=null}){const a=l.useMemo(()=>cs(e),[e]),c=bx[t],i=t==="memory"?{basename:n,initialEntries:s}:{basename:n};return o.jsx(c,{...i,children:o.jsx(l.Suspense,{fallback:r,children:o.jsx(I.Routes,{children:a})})})}function vx(e,t={}){if(!t.persist)return Pt.create()(e);const{name:n,storage:s="local",partialize:r,version:a,migrate:c}=t.persist,i=s==="session"?()=>sessionStorage:()=>localStorage;return Pt.create()(gt.persist(e,{name:n,storage:gt.createJSONStorage(i),...r?{partialize:r}:{},...a!==void 0?{version:a}:{},...c?{migrate:c}:{}}))}function wx(e){const t=e;t.use={};for(const n of Object.keys(e.getState()))t.use[n]=()=>e(s=>s[n]);return t}const is=l.createContext(null);function jn(e){return e==="dark"||e==="light"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function xx(e){if(!e||typeof window>"u")return null;try{const t=window.localStorage.getItem(e);return t==="light"||t==="dark"||t==="system"?t:null}catch{return null}}function ls({children:e,defaultTheme:t="system",storageKey:n="tempest-theme",target:s,attribute:r="data-tempest-theme"}){const[a,c]=l.useState(()=>xx(n)??t),[i,u]=l.useState(()=>jn(a)),d=l.useRef(s);d.current=s,l.useEffect(()=>{const h=d.current?.()??document.documentElement;if(!h)return;const _=jn(a);h.setAttribute(r,_),u(_)},[a,r]),l.useEffect(()=>{if(a!=="system"||typeof window>"u")return;const h=window.matchMedia("(prefers-color-scheme: dark)"),_=()=>{const b=d.current?.()??document.documentElement,v=h.matches?"dark":"light";b?.setAttribute(r,v),u(v)};return h.addEventListener("change",_),()=>h.removeEventListener("change",_)},[a,r]);const p=l.useCallback(h=>{if(c(h),n&&typeof window<"u")try{window.localStorage.setItem(n,h)}catch{}},[n]),m=l.useCallback(()=>{p(i==="dark"?"light":"dark")},[i,p]),f=l.useMemo(()=>({theme:a,resolvedTheme:i,setTheme:p,toggle:m}),[a,i,p,m]);return o.jsx(is.Provider,{value:f,children:e})}function jx(){const e=l.useContext(is);if(!e)throw new Error("useTheme must be used inside a <ThemeProvider>");return e}function $n(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>{const r=t[s];return r===void 0?`{${s}}`:String(r)}):e}function Dt(e,t,n,s){const r=e[t]?.[s];if(r!==void 0)return r;if(n){const a=e[n]?.[s];if(a!==void 0)return a}return null}function Qt(e){const{locale:t,fallbackLocale:n=null,messages:s}=e;function r(u,d){const p=Dt(s,t,n,u);return p===null?u:$n(p,d)}function a(u,d,p){const f=Dt(s,t,n,`${u}${d===1?"_one":"_other"}`)??Dt(s,t,n,u);return f===null?u:$n(f,{count:d,...p??{}})}function c(u,d){return new Intl.NumberFormat(t,d).format(u)}function i(u,d){const p=typeof u=="string"?new Date(u):u;return Number.isNaN(p.getTime())?"":new Intl.DateTimeFormat(t,d).format(p)}return{locale:t,fallbackLocale:n,t:r,plural:a,formatNumber:c,formatDate:i,withLocale:u=>Qt({locale:u,fallbackLocale:n??void 0,messages:s})}}const us=l.createContext(null);function $x(e,t){if(!e||typeof window>"u")return null;try{const n=window.localStorage.getItem(e);return n&&t.includes(n)?n:null}catch{return null}}function ds({children:e,locale:t,fallbackLocale:n,messages:s,storageKey:r="tempest-locale"}){const a=l.useMemo(()=>Object.keys(s),[s]),[c,i]=l.useState(()=>$x(r,a)??t);l.useEffect(()=>{typeof document<"u"&&document.documentElement.setAttribute("lang",c)},[c]);const u=l.useCallback(p=>{if(i(p),r&&typeof window<"u")try{window.localStorage.setItem(r,p)}catch{}},[r]),d=l.useMemo(()=>({...Qt({locale:c,fallbackLocale:n,messages:s}),setLocale:u,availableLocales:a}),[c,n,s,u,a]);return o.jsx(us.Provider,{value:d,children:e})}function ps(){const e=l.useContext(us);if(!e)throw new Error("useI18n must be used inside an <I18nProvider>");return e}function kx(){return ps().t}function Nx(e=[],t=[]){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!0;return!1}class ms extends l.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t){this.state.error&&Nx(t.resetKeys,this.props.resetKeys)&&this.reset()}reset=()=>{this.setState({error:null})};render(){const{error:t}=this.state;if(!t)return this.props.children;const{fallback:n}=this.props;return typeof n=="function"?n({error:t,reset:this.reset}):n}}function Sx({children:e,query:t,theme:n,i18n:s,errorBoundary:r}){let a=e;return s&&(a=o.jsx(ds,{...s,children:a})),n!==!1&&(a=o.jsx(ls,{...n||{},children:a})),t!==!1&&(a=o.jsx(ss,{...t||{},children:a})),r&&(a=o.jsx(ms,{...r,children:a})),o.jsx(o.Fragment,{children:a})}function Cx(e){try{return JSON.parse(e)}catch{return e}}function fs(e,t={}){const{withCredentials:n=!1,namedEvents:s=[],heartbeatEvents:r=["ping"],maxRetries:a=10,initialBackoff:c=1e3,maxBackoff:i=3e4,parser:u=Cx,onOpen:d,onMessage:p,onError:m,onStatusChange:f}=t;let h=null,_=null,b=0,v="idle",g=!1;function w(N){v!==N&&(v=N,f?.(N))}function y(N,k){r.includes(N)||p?.({event:N,data:u(k.data),id:k.lastEventId||void 0,raw:k})}function j(){if(g)return;if(b>=a){w("error");return}const N=Math.min(c*2**b,i);b+=1,_=setTimeout(S,N)}function S(){if(g)return;h&&h.close(),w("connecting");const N=new EventSource(e,{withCredentials:n});h=N,N.onopen=()=>{b=0,w("open"),d?.()},N.onmessage=k=>y("message",k);for(const k of s)N.addEventListener(k,E=>y(k,E));for(const k of r)N.addEventListener(k,()=>{});N.onerror=k=>{m?.(k),N.close(),h=null,w("closed"),j()}}function M(){g=!0,_&&(clearTimeout(_),_=null),b=0,h&&(h.close(),h=null),w("closed")}function T(){_&&(clearTimeout(_),_=null),b=0,g=!1,S()}return S(),{close:M,reconnect:T,get status(){return v}}}function Ex(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[a,c]=l.useState("idle"),[i,u]=l.useState(null),d=l.useRef(null),p=l.useRef(s);return p.current=s,l.useEffect(()=>{if(!n||!e){c("idle");return}const m=fs(e,{...r,onStatusChange:c,onMessage:f=>{u(f),p.current?.(f)}});return d.current=m.reconnect,()=>{m.close(),d.current=null}},[e,n]),{status:a,lastMessage:i,reconnect:()=>d.current?.()}}function hs(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(n),r=new ArrayBuffer(s.length),a=new Uint8Array(r);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return a}function st(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}class qt extends Error{constructor(){super("Web Push não suportado neste navegador."),this.name="WebPushUnsupportedError"}}class _s extends Error{constructor(){super("Permissão de notificação negada pelo usuário."),this.name="WebPushPermissionDeniedError"}}class gs{config;constructor(t){this.config=t}static isSupported(){return st()}async registration(){if(!st())throw new qt;return this.config.getRegistration?await this.config.getRegistration():await navigator.serviceWorker.ready}permission(){return typeof Notification>"u"?"unsupported":Notification.permission}async requestPermission(){if(typeof Notification>"u")throw new qt;return Notification.requestPermission()}async getSubscription(){return(await this.registration()).pushManager.getSubscription()}async isSubscribed(){return st()?await this.getSubscription()!==null:!1}async subscribe(){if(await this.requestPermission()!=="granted")throw new _s;const n=await this.registration(),s=await n.pushManager.getSubscription();if(s)return await this.config.onSubscribe(s.toJSON()),s;const r=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:hs(this.config.vapidPublicKey)});return await this.config.onSubscribe(r.toJSON()),r}async unsubscribe(){const t=await this.getSubscription();return t?(this.config.onUnsubscribe&&await this.config.onUnsubscribe(t.toJSON()),t.unsubscribe()):!1}}function Tx(e){const t=l.useRef(e);t.current=e;const n=l.useMemo(()=>new gs({vapidPublicKey:e.vapidPublicKey,onSubscribe:b=>t.current.onSubscribe(b),onUnsubscribe:b=>t.current.onUnsubscribe?.(b),getRegistration:e.getRegistration}),[e.vapidPublicKey,e.getRegistration]),[s]=l.useState(()=>st()),[r,a]=l.useState(()=>n.permission()),[c,i]=l.useState(!1),[u,d]=l.useState(!1),[p,m]=l.useState(null),f=l.useCallback(async()=>{if(s){a(n.permission());try{const b=await n.isSubscribed();i(b)}catch(b){m(b instanceof Error?b:new Error(String(b)))}}},[n,s]);l.useEffect(()=>{f()},[f]);const h=l.useCallback(async()=>{if(s){d(!0),m(null);try{await n.subscribe(),i(!0),a(n.permission())}catch(b){throw m(b instanceof Error?b:new Error(String(b))),b}finally{d(!1)}}},[n,s]),_=l.useCallback(async()=>{if(s){d(!0),m(null);try{await n.unsubscribe(),i(!1)}catch(b){throw m(b instanceof Error?b:new Error(String(b))),b}finally{d(!1)}}},[n,s]);return{supported:s,permission:r,subscribed:c,loading:u,error:p,subscribe:h,unsubscribe:_,refresh:f}}function Yt(){let e=null;async function t(s,{volume:r=1,loop:a=!1,autoplay:c=!0,stopPrevious:i=!1,onEnded:u,onError:d}={}){try{i&&e&&(e.pause(),e.currentTime=0);const p=new Audio(s);return p.volume=Math.max(0,Math.min(1,r)),p.loop=a,p.preload="auto",u&&(p.onended=u),d&&(p.onerror=m=>d(m)),e=p,c&&await p.play(),p}catch(p){return d?.(p),null}}function n(){e&&(e.pause(),e.currentTime=0)}return{play:t,stop:n,current:()=>e}}let It=null;function bs(){return It||(It=Yt()),It}async function Mx(e,t){return bs().play(e,t)}function Rx(){bs().stop()}function Lx(){const e=l.useRef(null),[t,n]=l.useState(!1);e.current||(e.current=Yt()),l.useEffect(()=>()=>{e.current?.stop()},[]);const s=l.useCallback(async(a,c)=>{await e.current.play(a,c)&&n(!0)},[]),r=l.useCallback(()=>{e.current?.stop()},[]);return{play:s,stop:r,unlocked:t}}class Dx extends Es{store;constructor(t,n,s,r){super(t),this.version(n).stores({[s]:r}),this.store=this.table(s)}}function Ix(e){const{databaseName:t,version:n,tableName:s,indexes:r,keyPath:a="id",ownerField:c}=e,i=new Dx(t,n,s,r),u=i.store;function d(m,f){return!c||!f?m:{...m,[c]:f}}async function p(m,f={}){const{orderBy:h=a,reverse:_=!1,limit:b,offset:v,filter:g}=f;let w=c&&m?u.where(c).equals(m):u.toCollection();g&&(w=w.filter(g));let y=h===a?await w.toArray():await w.sortBy(h);return _&&(y=y.reverse()),v&&(y=y.slice(v)),typeof b=="number"&&(y=y.slice(0,b)),y}return{put:(m,f)=>u.put(d(m,f)),bulkPut:(m,f)=>u.bulkPut(m.map(h=>d(h,f))),get:m=>u.get(m),list:p,update:(m,f)=>u.update(m,f),updateMany:async(m,f)=>{const h=f;return c&&m?u.where(c).equals(m).modify(h):u.toCollection().modify(h)},delete:m=>u.delete(m),clear:async m=>{if(c&&m){await u.where(c).equals(m).delete();return}await u.clear()},count:m=>c&&m?u.where(c).equals(m).count():u.count(),raw:u,db:i}}function Px(){const[,e]=l.useState(null);return l.useCallback(t=>{e(()=>{throw t instanceof Error?t:new Error(String(t))})},[])}function Ax({name:e,label:t,helperText:n,required:s,control:r,children:a}){const c=pe.useFormContext(),i=r??c?.control;if(!i)throw new Error("FormField requires either a `control` prop or a <FormProvider> in the tree.");return o.jsx(pe.Controller,{name:e,control:i,render:({field:u,fieldState:d})=>{if(!l.isValidElement(a))return a;const p=d.error?.message;return l.cloneElement(a,{name:u.name,value:u.value,onChange:u.onChange,onBlur:u.onBlur,ref:u.ref,label:t,helperText:p?void 0:n,error:p,required:s,"aria-invalid":!!p})}})}function Fx(e,t){const n=e.safeParse(t);if(n.success)return{success:!0,data:n.data,errors:{}};const s={};for(const r of n.error.issues){const a=r.path.length===0?"_root":r.path.join(".");a in s||(s[a]=r.message)}return{success:!1,errors:s}}function ys(e){return async(t,n,s)=>{const r=e.safeParse(t);if(r.success)return{values:r.data,errors:{}};const a={},c=s.criteriaMode??"firstError";for(const i of r.error.issues){const u=i.path.length===0?"_root":i.path.join(".");c==="firstError"&&a[u]||(a[u]={type:i.code,message:i.message})}return{values:{},errors:a}}}function Ox(e,t={}){return pe.useForm({...t,resolver:ys(e)})}function ot(e){return e.replace(/\D/g,"")}function Bx(e){const t=ot(e);if(t.length!==11||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number);let s=0;for(let a=0;a<9;a++)s+=n[a]*(10-a);let r=s*10%11;if(r===10&&(r=0),r!==n[9])return!1;s=0;for(let a=0;a<10;a++)s+=n[a]*(11-a);return r=s*10%11,r===10&&(r=0),r===n[10]}function zx(e){const t=ot(e);if(t.length!==14||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number),s=[5,4,3,2,9,8,7,6,5,4,3,2],r=[6,5,4,3,2,9,8,7,6,5,4,3,2];let a=0;for(let i=0;i<12;i++)a+=n[i]*s[i];let c=a%11;if(c=c<2?0:11-c,c!==n[12])return!1;a=0;for(let i=0;i<13;i++)a+=n[i]*r[i];return c=a%11,c=c<2?0:11-c,c===n[13]}function vs(e){return ot(e).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}function ws(e){return ot(e).slice(0,14).replace(/(\d{2})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1-$2")}function Wx(e){return ot(e)}function $t(e,t="numeric"){return l.forwardRef(function({value:s,onChange:r,...a},c){return o.jsx(xt,{...a,ref:c,value:e(s??""),inputMode:t,onChange:i=>r(e(i.target.value))})})}const qx=$t(Gn),Ux=$t(ws),Kx=$t(Hn,"tel"),Hx=$t(vs);function Gx(e,t,n){return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e/100)}function Jx(e){const t=e.replace(/\D/g,"");return t?Number.parseInt(t,10):0}const Qx=l.forwardRef(function({value:t,onChange:n,currency:s="BRL",locale:r="pt-BR",...a},c){return o.jsx(xt,{...a,ref:c,type:"text",inputMode:"numeric",value:Gx(t||0,r,s),onChange:i=>n(Jx(i.target.value))})});function Yx(){const[e,t]=l.useState(!1),[n,s]=l.useState(null),[r,a]=l.useState(null),c=l.useCallback(async u=>{const d=u.replace(/\D/g,"");if(d.length!==8)return s("CEP inválido."),null;t(!0),s(null);try{const m=await(await fetch(`https://viacep.com.br/ws/${d}/json/`)).json();return"erro"in m&&m.erro?(s("CEP não encontrado."),a(null),null):(a(m),m)}catch(p){return s(p instanceof Error?p.message:String(p)),null}finally{t(!1)}},[]),i=l.useCallback(()=>{t(!1),s(null),a(null)},[]);return{loading:e,error:n,data:r,lookup:c,reset:i}}function Vx(e){try{return JSON.parse(e)}catch{return e}}function xs(e,t={}){const{protocols:n,maxRetries:s=10,initialBackoff:r=1e3,maxBackoff:a=3e4,pingInterval:c=0,pingPayload:i=JSON.stringify({type:"ping"}),parser:u=Vx,onOpen:d,onMessage:p,onClose:m,onError:f,onStatusChange:h}=t;let _=null,b=null,v=null,g=0,w="idle",y=!1;function j($){w!==$&&(w=$,h?.($))}function S(){v&&(clearInterval(v),v=null)}function M(){!c||c<=0||(S(),v=setInterval(()=>{_?.readyState===WebSocket.OPEN&&_.send(i)},c))}function T(){if(y)return;if(g>=s){j("error");return}const $=Math.min(r*2**g,a);g+=1,b=setTimeout(N,$)}function N(){if(y)return;_&&(_.onopen=null,_.onmessage=null,_.onclose=null,_.onerror=null,_.close()),j("connecting");const $=new WebSocket(e,n);_=$,$.onopen=C=>{g=0,j("open"),M(),d?.(C)},$.onmessage=C=>{const F=typeof C.data=="string"?C.data:"";p?.({data:u(F),raw:C})},$.onerror=C=>{f?.(C)},$.onclose=C=>{S(),m?.(C),_=null,j("closed"),!y&&!C.wasClean&&T()}}function k($){return _?.readyState!==WebSocket.OPEN?!1:(_.send($),!0)}function E($,C){y=!0,b&&(clearTimeout(b),b=null),S(),g=0,_&&(j("closing"),_.close($,C),_=null),j("closed")}function D(){b&&(clearTimeout(b),b=null),g=0,y=!1,N()}return N(),{send:k,close:E,reconnect:D,get status(){return w}}}function Xx(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[a,c]=l.useState("idle"),[i,u]=l.useState(null),d=l.useRef(null),p=l.useRef(s);p.current=s,l.useEffect(()=>{if(!n||!e){c("idle");return}const h=xs(e,{...r,onStatusChange:c,onMessage:_=>{u(_),p.current?.(_)}});return d.current=h,()=>{h.close(),d.current=null}},[e,n]);const m=l.useCallback(h=>d.current?.send(h)??!1,[]),f=l.useCallback(()=>{d.current?.reconnect()},[]);return{status:a,lastMessage:i,send:m,reconnect:f}}function Zx(e={}){const{storageKey:t="tempest-theme",defaultTheme:n="system"}=e;if(typeof window>"u")return n==="dark"?"dark":"light";let s=null;try{s=window.localStorage.getItem(t)}catch{s=null}const r=s??n;return r==="dark"||r==="light"?r:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ej(e={}){const t=e.storageKey??"tempest-theme",n=e.defaultTheme??"system";return`
|
|
5
|
+
Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida do servidor (${n}).`)}function mx(e){if(!e)return null;try{return JSON.parse(e)}catch{return e}}function fx(e){const{url:t,body:n,method:s="POST",headers:r={},getToken:a,withCredentials:c=!1,onProgress:i,signal:u,parser:d=JSON.parse,requestId:p}=e;return new Promise((m,f)=>{if(u?.aborted){f(new DOMException("Aborted","AbortError"));return}const h=new XMLHttpRequest;h.open(s,t),h.withCredentials=c;const _=a?.(),b=p?p():Qt(),y={...r};_&&!("Authorization"in y)&&(y.Authorization=`Bearer ${_}`),b&&!("X-Request-ID"in y)&&(y["X-Request-ID"]=b);for(const[w,v]of Object.entries(y))h.setRequestHeader(w,v);i&&(h.upload.onprogress=w=>{i({loaded:w.loaded,total:w.total,fraction:w.lengthComputable?w.loaded/w.total:null,lengthComputable:w.lengthComputable})});function g(){h.abort()}u?.addEventListener("abort",g),h.onload=()=>{u?.removeEventListener("abort",g);const w=h.status>=200&&h.status<300,v=h.getResponseHeader("content-type")??"";if(!w){const j=mx(h.responseText);f(new $t(Yt(h.status,j,{get:S=>h.getResponseHeader(S)},b)));return}if(h.status===204||!h.responseText){m(void 0);return}if(v.includes("application/json"))try{m(d(h.responseText))}catch(j){f(j)}else m(h.responseText)},h.onerror=()=>{u?.removeEventListener("abort",g),f(new $t({status:0,detail:"Falha de rede no upload.",requestId:b||void 0}))},h.onabort=()=>{u?.removeEventListener("abort",g),f(new DOMException("Aborted","AbortError"))},h.send(n)})}function hx(e,t){return new Promise((n,s)=>{if(t?.aborted){s(new DOMException("Aborted","AbortError"));return}const r=setTimeout(n,e);t?.addEventListener("abort",()=>{clearTimeout(r),s(new DOMException("Aborted","AbortError"))},{once:!0})})}async function _x(e,t={}){const{retries:n=3,initialDelay:s=300,maxDelay:r=1e4,respectRetryAfter:a=!0,shouldRetry:c=()=>!0,onRetry:i,signal:u}=t;let d=0,p;for(;d<n;){if(u?.aborted)throw new DOMException("Aborted","AbortError");try{return await e()}catch(m){if(p=m,d+=1,d>=n||!c(m,d))throw m;const f=a&&typeof m?.retryAfter=="number"?m.retryAfter*1e3:null,h=Math.min(f!==null?f:s*2**(d-1),r);i?.({attempt:d,delay:h,error:m}),await hx(h,u)}}throw p}function gx(){return typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16;return(e==="x"?Math.floor(t):Math.floor(t)&3|8).toString(16)})}function bx(e,t){const{interval:n,disabled:s=!1,stopWhen:r,onError:a}=t,[c,i]=l.useState(null),[u,d]=l.useState(null),[p,m]=l.useState(!s),f=l.useRef(s),h=l.useRef(!1),_=l.useRef(null);async function b(){if(!(f.current||h.current)){h.current=!0;try{const y=await e();if(f.current)return;i(y),d(null),r?.(y)&&(f.current=!0)}catch(y){f.current||(d(y),a?.(y))}finally{h.current=!1,m(!1),f.current||(_.current=setTimeout(b,n))}}}return l.useEffect(()=>{if(f.current=s,s){_.current&&clearTimeout(_.current);return}return m(!0),b(),()=>{f.current=!0,_.current&&clearTimeout(_.current)}},[n,s]),{data:c,error:u,loading:p,stop:()=>{f.current=!0,_.current&&clearTimeout(_.current)},start:()=>{f.current&&(f.current=!1,b())}}}function ts(e={}){const t=e.name??"tempest-auth",n=e.storage==="session"?()=>sessionStorage:()=>localStorage;return Ot.create()(wt.persist(s=>({user:e.initialUser??null,token:e.initialToken??null,isAuthenticated:!!e.initialToken,setSession:({user:r,token:a})=>s({user:r,token:a,isAuthenticated:!0}),setUser:r=>s({user:r}),setToken:r=>s({token:r,isAuthenticated:!!r}),logout:()=>s({user:null,token:null,isAuthenticated:!1})}),{name:t,storage:wt.createJSONStorage(n),partialize:s=>({user:s.user,token:s.token}),onRehydrateStorage:()=>s=>{s&&(s.isAuthenticated=!!s.token)}}))}function yx({isAuthenticated:e,children:t,fallback:n}){return o.jsx(o.Fragment,{children:e?t:n})}function kn(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4);return typeof atob<"u"?atob(t+n):Buffer.from(t+n,"base64").toString("binary")}function Vt(e){const t=e.split(".");if(t.length!==3)throw new Error("Invalid JWT: must contain three segments.");const[n,s,r]=t;try{return{header:JSON.parse(kn(n)),payload:JSON.parse(kn(s)),signature:r}}catch{throw new Error("Invalid JWT: header or payload is not valid JSON.")}}function vx(e,t=0){try{const{payload:n}=Vt(e);if(typeof n.exp!="number")return!0;const s=Math.floor(Date.now()/1e3);return n.exp<=s+t}catch{return!0}}function ns(e,t={}){const{retries:n=3,initialDelay:s=400,reloadOnFinalFailure:r=!0}=t;async function a(c=1){try{return await e()}catch(i){if(c>=n)throw r&&typeof window<"u"&&window.location.reload(),i;return await new Promise(u=>setTimeout(u,s*2**(c-1))),a(c+1)}}return l.lazy(a)}function ss(e){let t=null;return()=>t||(t=(async()=>{try{await e()}finally{t=null}})(),t)}function wx(e){const t=e??{};return{token:t.access_token,refreshToken:t.refresh_token}}function xx(e){const{baseURL:t,loginPath:n="/api/auth/login",refreshPath:s="/api/auth/refresh",mePath:r,storeName:a="tempest-auth",storage:c="local",withCredentials:i=!1,fetcher:u,parseTokens:d=wx,parseUser:p,refreshBody:m=k=>k?{refresh_token:k}:void 0}=e,f=ts({name:a,storage:c}),h=`${a}-refresh`;function _(){return typeof window>"u"?null:c==="session"?window.sessionStorage:window.localStorage}function b(){return _()?.getItem(h)??null}function y(k){const E=_();E&&(k?E.setItem(h,k):E.removeItem(h))}const g=()=>f.getState(),w=()=>g().token,v=vt({baseURL:t,withCredentials:i,fetcher:u});async function j(){if(!r)return g().user;const k=w(),E=await vt({baseURL:t,withCredentials:i,fetcher:u,getToken:()=>k}).get(r);return g().setUser(E),E}async function S(k){const E=await v.post(n,{body:k}),{token:D,refreshToken:$}=d(E);g().setToken(D),y($??null);const C=p?.(E);return C!=null?(g().setUser(C),C):j()}function M(){g().logout(),y(null)}const T=ss(async()=>{const k=await v.post(s,{body:m(b())}),{token:E,refreshToken:D}=d(k);g().setToken(E),D&&y(D)}),N=vt({baseURL:t,withCredentials:i,fetcher:u,getToken:w,refresh:T,onUnauthorized:()=>M()});return{useAuthStore:f,api:N,login:S,logout:M,refresh:T,getToken:w}}const rs=l.createContext(null);function jx({control:e,children:t}){return o.jsx(rs.Provider,{value:e,children:t})}function os(){return l.useContext(rs)}function $x(e){return typeof e=="boolean"?{can:e}:e}function as(e){const t=os(),n=JSON.stringify(e),[s,r]=l.useState(()=>t?{allowed:!1,isLoading:!0}:{allowed:!0,isLoading:!1});return l.useEffect(()=>{if(!t){r({allowed:!0,isLoading:!1});return}let a=!1;return r(c=>({...c,isLoading:!0})),Promise.resolve(t.can(e)).then(c=>{if(a)return;const i=$x(c);r({allowed:i.can,isLoading:!1,reason:i.reason})}).catch(c=>{a||r({allowed:!1,isLoading:!1,reason:c instanceof Error?c.message:"access check failed"})}),()=>{a=!0}},[t,n]),s}function kx({action:e,resource:t,params:n,children:s,fallback:r}){const{allowed:a,isLoading:c}=as({action:e,resource:t,params:n});return c?o.jsx(o.Fragment,{children:r??null}):o.jsx(o.Fragment,{children:a?s:r??null})}function Nx(e){const t=new Set(e.permissions??[]),n=e.role?Array.isArray(e.role)?e.role:[e.role]:[];for(const s of n)for(const r of e.roles?.[s]??[])t.add(r);return t}function Sx(e){const t=Nx(e);return{can({action:n,resource:s}){return t.has("*")||s!==void 0&&(t.has(`${s}:*`)||t.has(`${s}:${n}`))||s===void 0&&t.has(n)?{can:!0}:{can:!1,reason:"missing permission"}}}}function Pt(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):typeof e=="string"?e.split(/\s+/).filter(Boolean):[]}function Cx(e,t){try{const{payload:n}=Vt(e),s=t?.claim??"permissions",r=Pt(n[s]);if(r.length>0)return r;if(t?.claim===void 0){const a=Pt(n.scopes);return a.length>0?a:Pt(n.scope)}return r}catch{return[]}}function Ex({component:e,onSuccess:t,onError:n,locale:s,theme:r,text:a,shape:c,size:i,disableOneTap:u,width:d,className:p,style:m}){return o.jsx("div",{className:p,style:m,children:e({onSuccess:f=>{if(!f.credential){n?.({provider:"google",message:"Google returned no credential",raw:f});return}return t({idToken:f.credential,provider:"google",raw:f})},onError:()=>{n?.({provider:"google",message:"Google login failed"})},locale:s,theme:r,text:a,shape:c,size:i,useOneTap:!u,width:d})})}function Tx(e){const{exchange:t,onSuccess:n,onError:s}=e,[r,a]=l.useState(null),[c,i]=l.useState(null),[u,d]=l.useState("pending"),p=l.useRef(!1);return l.useEffect(()=>{if(p.current)return;p.current=!0;let m=!1;return t().then(f=>{if(!m)return a(f),d("success"),n?.(f)}).catch(f=>{m||(i(f),d("error"),s?.(f))}),()=>{m=!0}},[t,n,s]),{loading:u==="pending",data:r,error:c,status:u}}const cs={SHORT:30*1e3,DEFAULT:300*1e3,LONG:1800*1e3,INFINITE:1/0},is={SHORT:300*1e3,DEFAULT:1800*1e3,LONG:3600*1e3},Mx={REALTIME:5*1e3,FAST:30*1e3,DEFAULT:60*1e3,SLOW:300*1e3};function Rx(e,t){const n={all:[e]};for(const[s,r]of Object.entries(t))typeof r=="function"?n[s]=(...a)=>[e,...r(...a)]:n[s]=[e,...r];return n}function ls({children:e,client:t,defaultOptions:n}){const[s]=l.useState(()=>t??new G.QueryClient({defaultOptions:{queries:{staleTime:cs.DEFAULT,gcTime:is.DEFAULT,retry:1,refetchOnWindowFocus:!1,...n?.queries??{}},mutations:{retry:0,...n?.mutations??{}}}}));return o.jsx(G.QueryClientProvider,{client:s,children:e})}function Lx(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.items)&&typeof t.total=="number"&&typeof t.pages=="number"}function Dx(e){if(typeof e!="object"||e===null)return!1;const t=e;return Array.isArray(t.items)&&typeof t.has_more=="boolean"&&"next_cursor"in t}function Ix(e=20){return{items:[],total:0,page:1,size:e,pages:0}}function Px(e){const{queryKey:t,queryFn:n,initialPage:s=1,pageSize:r=20,sizeParam:a="size",orderBy:c,ascending:i=!1,...u}=e,[d,p]=l.useState(s),m=G.useQuery({...u,queryKey:[...t,{page:d,pageSize:r,sizeParam:a,orderBy:c,ascending:i}],queryFn:()=>{const v={page:d,[a]:r};return c&&(v.order_by=c,v.ascending=i),n(v)},placeholderData:G.keepPreviousData}),f=m.data,h=f?.pages??0,_=d<h,b=d>1,y=l.useCallback(v=>p(Math.max(1,v)),[]),g=l.useCallback(()=>p(v=>v<h?v+1:v),[h]),w=l.useCallback(()=>p(v=>v>1?v-1:v),[]);return{page:f,items:f?.items??[],pageNumber:d,pageCount:h,total:f?.total??0,hasNext:_,hasPrev:b,isLoading:m.isLoading,isFetching:m.isFetching,error:m.error,setPage:y,next:g,prev:w,refetch:()=>{m.refetch()}}}function Ax(e){const{queryKey:t,queryFn:n,limit:s=20,orderBy:r,ascending:a=!1,...c}=e,i=G.useInfiniteQuery({...c,queryKey:[...t,{limit:s,orderBy:r,ascending:a}],initialPageParam:null,queryFn:({pageParam:d})=>n({cursor:d,limit:s,order_by:r,ascending:a}),getNextPageParam:d=>d.has_more?d.next_cursor:void 0}),u=i.data?.pages??[];return{items:u.flatMap(d=>d.items),pages:u,hasNextPage:i.hasNextPage,isLoading:i.isLoading,isFetchingNextPage:i.isFetchingNextPage,error:i.error,fetchNextPage:()=>{i.fetchNextPage()},refetch:()=>{i.refetch()}}}const Fx=(e,t)=>t==null?`/${e}`:`/${e}/${t}`;function Ox(e,t={}){const{pageParam:n="page",sizeParam:s="size",sortFieldParam:r="order_by",sortOrderParam:a="ascending",sortOrderAsBoolean:c=!0,updateMethod:i="patch",buildPath:u=Fx}=t,d={getList(p,m={}){const{pagination:f,sort:h,filters:_}=m,b={};if(f?.page!=null&&(b[n]=f.page),f?.pageSize!=null&&(b[s]=f.pageSize),h?.field){const g=h.order??"asc";b[r]=h.field,b[a]=c?g==="asc":g}if(_)for(const[g,w]of Object.entries(_))b[g]=w;const y={params:b};return e.get(u(p),y)},getOne(p,m){return e.get(u(p,m))},getMany(p,m){return Promise.all(m.map(f=>d.getOne(p,f)))},create(p,m){return e.post(u(p),{body:m})},update(p,m,f){const h=u(p,m);return i==="put"?e.put(h,{body:f}):e.patch(h,{body:f})},deleteOne(p,m){return e.delete(u(p,m))}};return d}const us=l.createContext(null);function Bx({provider:e,children:t}){return o.jsx(us.Provider,{value:e,children:t})}function Ve(){const e=l.useContext(us);if(!e)throw new Error("useDataProvider must be used within a <TempestDataProvider>");return e}function ds(e,t){return["data",e,"list",t]}function Xt(e,t){return["data",e,"one",t]}function zx(e,t,n){const s=Ve();return G.useQuery({queryKey:ds(e,t),queryFn:()=>s.getList(e,t),...n})}function Wx(e,t,n){const s=Ve(),{enabled:r,...a}=n??{};return G.useQuery({queryKey:Xt(e,t),queryFn:()=>s.getOne(e,t),enabled:t!=null&&(r??!0),...a})}function qx(e,t){const n=Ve(),s=G.useQueryClient();return G.useMutation({mutationFn:r=>n.create(e,r),onSuccess:(...r)=>{s.invalidateQueries({queryKey:["data",e,"list"]}),t?.onSuccess?.(...r)},...t})}function Ux(e,t){const n=Ve(),s=G.useQueryClient();return G.useMutation({mutationFn:({id:r,data:a})=>n.update(e,r,a),onSuccess:(...r)=>{const[,a]=r;s.invalidateQueries({queryKey:["data",e,"list"]}),s.invalidateQueries({queryKey:Xt(e,a.id)}),t?.onSuccess?.(...r)},...t})}function Kx(e,t){const n=Ve(),s=G.useQueryClient();return G.useMutation({mutationFn:r=>n.deleteOne(e,r),onSuccess:(...r)=>{s.invalidateQueries({queryKey:["data",e,"list"]}),t?.onSuccess?.(...r)},...t})}function ps({when:e,redirectTo:t="/",replace:n=!0,children:s}){return o.jsx(o.Fragment,{children:e?s:o.jsx(I.Navigate,{to:t,replace:n})})}function Hx(e){return e}const Nn=new WeakMap;function Gx(e){let t=Nn.get(e);return t||(t=ns(e.lazy),Nn.set(e,t)),t}function Jx({guard:e,redirectTo:t,children:n}){const s=typeof e=="function"?e():e;return o.jsx(ps,{when:s,redirectTo:t,children:n})}function ms(e){return e.map((t,n)=>{let s=t.element;if(t.lazy){const r=Gx(t);s=o.jsx(r,{})}return t.guard!==void 0&&(s=o.jsx(Jx,{guard:t.guard,redirectTo:t.redirectTo,children:s})),t.index?o.jsx(I.Route,{index:!0,element:s},`index-${n}`):o.jsx(I.Route,{path:t.path,element:s,caseSensitive:t.caseSensitive,children:t.children?ms(t.children):null},t.path??`route-${n}`)})}const Qx={browser:I.BrowserRouter,hash:I.HashRouter,memory:I.MemoryRouter};function Yx({routes:e,router:t="browser",basename:n,initialEntries:s,fallback:r=null}){const a=l.useMemo(()=>ms(e),[e]),c=Qx[t],i=t==="memory"?{basename:n,initialEntries:s}:{basename:n};return o.jsx(c,{...i,children:o.jsx(l.Suspense,{fallback:r,children:o.jsx(I.Routes,{children:a})})})}function Vx(e,t={}){if(!t.persist)return Ot.create()(e);const{name:n,storage:s="local",partialize:r,version:a,migrate:c}=t.persist,i=s==="session"?()=>sessionStorage:()=>localStorage;return Ot.create()(wt.persist(e,{name:n,storage:wt.createJSONStorage(i),...r?{partialize:r}:{},...a!==void 0?{version:a}:{},...c?{migrate:c}:{}}))}function Xx(e){const t=e;t.use={};for(const n of Object.keys(e.getState()))t.use[n]=()=>e(s=>s[n]);return t}const fs=l.createContext(null);function Sn(e){return e==="dark"||e==="light"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Cn(e,t,n,s){const r=Array.isArray(n)?n:[n];for(const a of r)e.setAttribute(a,t);if(s&&typeof document<"u"){const a=document.querySelector('meta[name="theme-color"]');a&&(a.content=s[t])}}function Zx(e){if(!e||typeof window>"u")return null;try{const t=window.localStorage.getItem(e);return t==="light"||t==="dark"||t==="system"?t:null}catch{return null}}function hs({children:e,defaultTheme:t="system",storageKey:n="tempest-theme",target:s,attribute:r="data-tempest-theme",themeColor:a}){const[c,i]=l.useState(()=>Zx(n)??t),[u,d]=l.useState(()=>Sn(c)),p=l.useRef(s);p.current=s;const m=Array.isArray(r)?r.join(","):r,f=l.useRef(a);f.current=a,l.useEffect(()=>{const y=p.current?.()??document.documentElement;if(!y)return;const g=Sn(c);Cn(y,g,r,f.current),d(g)},[c,m]),l.useEffect(()=>{if(c!=="system"||typeof window>"u")return;const y=window.matchMedia("(prefers-color-scheme: dark)"),g=()=>{const w=p.current?.()??document.documentElement;if(!w)return;const v=y.matches?"dark":"light";Cn(w,v,r,f.current),d(v)};return y.addEventListener("change",g),()=>y.removeEventListener("change",g)},[c,m]);const h=l.useCallback(y=>{if(i(y),n&&typeof window<"u")try{window.localStorage.setItem(n,y)}catch{}},[n]),_=l.useCallback(()=>{h(u==="dark"?"light":"dark")},[u,h]),b=l.useMemo(()=>({theme:c,resolvedTheme:u,setTheme:h,toggle:_}),[c,u,h,_]);return o.jsx(fs.Provider,{value:b,children:e})}function ej(){const e=l.useContext(fs);if(!e)throw new Error("useTheme must be used inside a <ThemeProvider>");return e}function En(e,t){return t?e.replace(/\{(\w+)\}/g,(n,s)=>{const r=t[s];return r===void 0?`{${s}}`:String(r)}):e}function At(e,t,n,s){const r=e[t]?.[s];if(r!==void 0)return r;if(n){const a=e[n]?.[s];if(a!==void 0)return a}return null}function Zt(e){const{locale:t,fallbackLocale:n=null,messages:s}=e;function r(u,d){const p=At(s,t,n,u);return p===null?u:En(p,d)}function a(u,d,p){const f=At(s,t,n,`${u}${d===1?"_one":"_other"}`)??At(s,t,n,u);return f===null?u:En(f,{count:d,...p??{}})}function c(u,d){return new Intl.NumberFormat(t,d).format(u)}function i(u,d){const p=typeof u=="string"?new Date(u):u;return Number.isNaN(p.getTime())?"":new Intl.DateTimeFormat(t,d).format(p)}return{locale:t,fallbackLocale:n,t:r,plural:a,formatNumber:c,formatDate:i,withLocale:u=>Zt({locale:u,fallbackLocale:n??void 0,messages:s})}}const _s=l.createContext(null);function tj(e,t){if(!e||typeof window>"u")return null;try{const n=window.localStorage.getItem(e);return n&&t.includes(n)?n:null}catch{return null}}function gs({children:e,locale:t,fallbackLocale:n,messages:s,storageKey:r="tempest-locale"}){const a=l.useMemo(()=>Object.keys(s),[s]),[c,i]=l.useState(()=>tj(r,a)??t);l.useEffect(()=>{typeof document<"u"&&document.documentElement.setAttribute("lang",c)},[c]);const u=l.useCallback(p=>{if(i(p),r&&typeof window<"u")try{window.localStorage.setItem(r,p)}catch{}},[r]),d=l.useMemo(()=>({...Zt({locale:c,fallbackLocale:n,messages:s}),setLocale:u,availableLocales:a}),[c,n,s,u,a]);return o.jsx(_s.Provider,{value:d,children:e})}function bs(){const e=l.useContext(_s);if(!e)throw new Error("useI18n must be used inside an <I18nProvider>");return e}function nj(){return bs().t}function sj(e=[],t=[]){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!0;return!1}class ys extends l.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,n){this.props.onError?.(t,n)}componentDidUpdate(t){this.state.error&&sj(t.resetKeys,this.props.resetKeys)&&this.reset()}reset=()=>{this.setState({error:null})};render(){const{error:t}=this.state;if(!t)return this.props.children;const{fallback:n}=this.props;return typeof n=="function"?n({error:t,reset:this.reset}):n}}function rj({children:e,query:t,theme:n,i18n:s,errorBoundary:r}){let a=e;return s&&(a=o.jsx(gs,{...s,children:a})),n!==!1&&(a=o.jsx(hs,{...n||{},children:a})),t!==!1&&(a=o.jsx(ls,{...t||{},children:a})),r&&(a=o.jsx(ys,{...r,children:a})),o.jsx(o.Fragment,{children:a})}function oj(e){try{return JSON.parse(e)}catch{return e}}function vs(e,t={}){const{withCredentials:n=!1,namedEvents:s=[],heartbeatEvents:r=["ping"],maxRetries:a=10,initialBackoff:c=1e3,maxBackoff:i=3e4,parser:u=oj,onOpen:d,onMessage:p,onError:m,onStatusChange:f}=t;let h=null,_=null,b=0,y="idle",g=!1;function w(N){y!==N&&(y=N,f?.(N))}function v(N,k){r.includes(N)||p?.({event:N,data:u(k.data),id:k.lastEventId||void 0,raw:k})}function j(){if(g)return;if(b>=a){w("error");return}const N=Math.min(c*2**b,i);b+=1,_=setTimeout(S,N)}function S(){if(g)return;h&&h.close(),w("connecting");const N=new EventSource(e,{withCredentials:n});h=N,N.onopen=()=>{b=0,w("open"),d?.()},N.onmessage=k=>v("message",k);for(const k of s)N.addEventListener(k,E=>v(k,E));for(const k of r)N.addEventListener(k,()=>{});N.onerror=k=>{m?.(k),N.close(),h=null,w("closed"),j()}}function M(){g=!0,_&&(clearTimeout(_),_=null),b=0,h&&(h.close(),h=null),w("closed")}function T(){_&&(clearTimeout(_),_=null),b=0,g=!1,S()}return S(),{close:M,reconnect:T,get status(){return y}}}function aj(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[a,c]=l.useState("idle"),[i,u]=l.useState(null),d=l.useRef(null),p=l.useRef(s);return p.current=s,l.useEffect(()=>{if(!n||!e){c("idle");return}const m=vs(e,{...r,onStatusChange:c,onMessage:f=>{u(f),p.current?.(f)}});return d.current=m.reconnect,()=>{m.close(),d.current=null}},[e,n]),{status:a,lastMessage:i,reconnect:()=>d.current?.()}}function ws(e){const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(n),r=new ArrayBuffer(s.length),a=new Uint8Array(r);for(let c=0;c<s.length;c++)a[c]=s.charCodeAt(c);return a}function ct(){return typeof window<"u"&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}class Ht extends Error{constructor(){super("Web Push não suportado neste navegador."),this.name="WebPushUnsupportedError"}}class xs extends Error{constructor(){super("Permissão de notificação negada pelo usuário."),this.name="WebPushPermissionDeniedError"}}class js{config;constructor(t){this.config=t}static isSupported(){return ct()}async registration(){if(!ct())throw new Ht;return this.config.getRegistration?await this.config.getRegistration():await navigator.serviceWorker.ready}permission(){return typeof Notification>"u"?"unsupported":Notification.permission}async requestPermission(){if(typeof Notification>"u")throw new Ht;return Notification.requestPermission()}async getSubscription(){return(await this.registration()).pushManager.getSubscription()}async isSubscribed(){return ct()?await this.getSubscription()!==null:!1}async subscribe(){if(await this.requestPermission()!=="granted")throw new xs;const n=await this.registration(),s=await n.pushManager.getSubscription();if(s)return await this.config.onSubscribe(s.toJSON()),s;const r=await n.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:ws(this.config.vapidPublicKey)});return await this.config.onSubscribe(r.toJSON()),r}async unsubscribe(){const t=await this.getSubscription();return t?(this.config.onUnsubscribe&&await this.config.onUnsubscribe(t.toJSON()),t.unsubscribe()):!1}}function cj(e){const t=l.useRef(e);t.current=e;const n=l.useMemo(()=>new js({vapidPublicKey:e.vapidPublicKey,onSubscribe:b=>t.current.onSubscribe(b),onUnsubscribe:b=>t.current.onUnsubscribe?.(b),getRegistration:e.getRegistration}),[e.vapidPublicKey,e.getRegistration]),[s]=l.useState(()=>ct()),[r,a]=l.useState(()=>n.permission()),[c,i]=l.useState(!1),[u,d]=l.useState(!1),[p,m]=l.useState(null),f=l.useCallback(async()=>{if(s){a(n.permission());try{const b=await n.isSubscribed();i(b)}catch(b){m(b instanceof Error?b:new Error(String(b)))}}},[n,s]);l.useEffect(()=>{f()},[f]);const h=l.useCallback(async()=>{if(s){d(!0),m(null);try{await n.subscribe(),i(!0),a(n.permission())}catch(b){throw m(b instanceof Error?b:new Error(String(b))),b}finally{d(!1)}}},[n,s]),_=l.useCallback(async()=>{if(s){d(!0),m(null);try{await n.unsubscribe(),i(!1)}catch(b){throw m(b instanceof Error?b:new Error(String(b))),b}finally{d(!1)}}},[n,s]);return{supported:s,permission:r,subscribed:c,loading:u,error:p,subscribe:h,unsubscribe:_,refresh:f}}function en(){let e=null;async function t(s,{volume:r=1,loop:a=!1,autoplay:c=!0,stopPrevious:i=!1,onEnded:u,onError:d}={}){try{i&&e&&(e.pause(),e.currentTime=0);const p=new Audio(s);return p.volume=Math.max(0,Math.min(1,r)),p.loop=a,p.preload="auto",u&&(p.onended=u),d&&(p.onerror=m=>d(m)),e=p,c&&await p.play(),p}catch(p){return d?.(p),null}}function n(){e&&(e.pause(),e.currentTime=0)}return{play:t,stop:n,current:()=>e}}let Ft=null;function $s(){return Ft||(Ft=en()),Ft}async function ij(e,t){return $s().play(e,t)}function lj(){$s().stop()}function uj(){const e=l.useRef(null),[t,n]=l.useState(!1);e.current||(e.current=en()),l.useEffect(()=>()=>{e.current?.stop()},[]);const s=l.useCallback(async(a,c)=>{await e.current.play(a,c)&&n(!0)},[]),r=l.useCallback(()=>{e.current?.stop()},[]);return{play:s,stop:r,unlocked:t}}class dj extends Is{store;constructor(t,n,s,r){super(t),this.version(n).stores({[s]:r}),this.store=this.table(s)}}function pj(e){const{databaseName:t,version:n,tableName:s,indexes:r,keyPath:a="id",ownerField:c}=e,i=new dj(t,n,s,r),u=i.store;function d(m,f){return!c||!f?m:{...m,[c]:f}}async function p(m,f={}){const{orderBy:h=a,reverse:_=!1,limit:b,offset:y,filter:g}=f;let w=c&&m?u.where(c).equals(m):u.toCollection();g&&(w=w.filter(g));let v=h===a?await w.toArray():await w.sortBy(h);return _&&(v=v.reverse()),y&&(v=v.slice(y)),typeof b=="number"&&(v=v.slice(0,b)),v}return{put:(m,f)=>u.put(d(m,f)),bulkPut:(m,f)=>u.bulkPut(m.map(h=>d(h,f))),get:m=>u.get(m),list:p,update:(m,f)=>u.update(m,f),updateMany:async(m,f)=>{const h=f;return c&&m?u.where(c).equals(m).modify(h):u.toCollection().modify(h)},delete:m=>u.delete(m),clear:async m=>{if(c&&m){await u.where(c).equals(m).delete();return}await u.clear()},count:m=>c&&m?u.where(c).equals(m).count():u.count(),raw:u,db:i}}function mj(){const[,e]=l.useState(null);return l.useCallback(t=>{e(()=>{throw t instanceof Error?t:new Error(String(t))})},[])}function fj({name:e,label:t,helperText:n,required:s,control:r,children:a}){const c=me.useFormContext(),i=r??c?.control;if(!i)throw new Error("FormField requires either a `control` prop or a <FormProvider> in the tree.");return o.jsx(me.Controller,{name:e,control:i,render:({field:u,fieldState:d})=>{if(!l.isValidElement(a))return a;const p=d.error?.message;return l.cloneElement(a,{name:u.name,value:u.value,onChange:u.onChange,onBlur:u.onBlur,ref:u.ref,label:t,helperText:p?void 0:n,error:p,required:s,"aria-invalid":!!p})}})}function hj(e,t){const n=e.safeParse(t);if(n.success)return{success:!0,data:n.data,errors:{}};const s={};for(const r of n.error.issues){const a=r.path.length===0?"_root":r.path.join(".");a in s||(s[a]=r.message)}return{success:!1,errors:s}}function ks(e){return async(t,n,s)=>{const r=e.safeParse(t);if(r.success)return{values:r.data,errors:{}};const a={},c=s.criteriaMode??"firstError";for(const i of r.error.issues){const u=i.path.length===0?"_root":i.path.join(".");c==="firstError"&&a[u]||(a[u]={type:i.code,message:i.message})}return{values:{},errors:a}}}function _j(e,t={}){return me.useForm({...t,resolver:ks(e)})}function lt(e){return e.replace(/\D/g,"")}function gj(e){const t=lt(e);if(t.length!==11||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number);let s=0;for(let a=0;a<9;a++)s+=n[a]*(10-a);let r=s*10%11;if(r===10&&(r=0),r!==n[9])return!1;s=0;for(let a=0;a<10;a++)s+=n[a]*(11-a);return r=s*10%11,r===10&&(r=0),r===n[10]}function bj(e){const t=lt(e);if(t.length!==14||/^(\d)\1+$/.test(t))return!1;const n=t.split("").map(Number),s=[5,4,3,2,9,8,7,6,5,4,3,2],r=[6,5,4,3,2,9,8,7,6,5,4,3,2];let a=0;for(let i=0;i<12;i++)a+=n[i]*s[i];let c=a%11;if(c=c<2?0:11-c,c!==n[12])return!1;a=0;for(let i=0;i<13;i++)a+=n[i]*r[i];return c=a%11,c=c<2?0:11-c,c===n[13]}function Ns(e){return lt(e).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2")}function Ss(e){return lt(e).slice(0,14).replace(/(\d{2})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1/$2").replace(/(\d{4})(\d)/,"$1-$2")}function yj(e){return lt(e)}function St(e,t="numeric"){return l.forwardRef(function({value:s,onChange:r,...a},c){return o.jsx(kt,{...a,ref:c,value:e(s??""),inputMode:t,onChange:i=>r(e(i.target.value))})})}const vj=St(Zn),wj=St(Ss),xj=St(Xn,"tel"),jj=St(Ns);function $j(e,t,n){return new Intl.NumberFormat(t,{style:"currency",currency:n}).format(e/100)}function kj(e){const t=e.replace(/\D/g,"");return t?Number.parseInt(t,10):0}const Nj=l.forwardRef(function({value:t,onChange:n,currency:s="BRL",locale:r="pt-BR",...a},c){return o.jsx(kt,{...a,ref:c,type:"text",inputMode:"numeric",value:$j(t||0,r,s),onChange:i=>n(kj(i.target.value))})});function Sj(){const[e,t]=l.useState(!1),[n,s]=l.useState(null),[r,a]=l.useState(null),c=l.useCallback(async u=>{const d=u.replace(/\D/g,"");if(d.length!==8)return s("CEP inválido."),null;t(!0),s(null);try{const m=await(await fetch(`https://viacep.com.br/ws/${d}/json/`)).json();return"erro"in m&&m.erro?(s("CEP não encontrado."),a(null),null):(a(m),m)}catch(p){return s(p instanceof Error?p.message:String(p)),null}finally{t(!1)}},[]),i=l.useCallback(()=>{t(!1),s(null),a(null)},[]);return{loading:e,error:n,data:r,lookup:c,reset:i}}function Cj(e){try{return JSON.parse(e)}catch{return e}}function Cs(e,t={}){const{protocols:n,maxRetries:s=10,initialBackoff:r=1e3,maxBackoff:a=3e4,pingInterval:c=0,pingPayload:i=JSON.stringify({type:"ping"}),parser:u=Cj,onOpen:d,onMessage:p,onClose:m,onError:f,onStatusChange:h}=t;let _=null,b=null,y=null,g=0,w="idle",v=!1;function j($){w!==$&&(w=$,h?.($))}function S(){y&&(clearInterval(y),y=null)}function M(){!c||c<=0||(S(),y=setInterval(()=>{_?.readyState===WebSocket.OPEN&&_.send(i)},c))}function T(){if(v)return;if(g>=s){j("error");return}const $=Math.min(r*2**g,a);g+=1,b=setTimeout(N,$)}function N(){if(v)return;_&&(_.onopen=null,_.onmessage=null,_.onclose=null,_.onerror=null,_.close()),j("connecting");const $=new WebSocket(e,n);_=$,$.onopen=C=>{g=0,j("open"),M(),d?.(C)},$.onmessage=C=>{const F=typeof C.data=="string"?C.data:"";p?.({data:u(F),raw:C})},$.onerror=C=>{f?.(C)},$.onclose=C=>{S(),m?.(C),_=null,j("closed"),!v&&!C.wasClean&&T()}}function k($){return _?.readyState!==WebSocket.OPEN?!1:(_.send($),!0)}function E($,C){v=!0,b&&(clearTimeout(b),b=null),S(),g=0,_&&(j("closing"),_.close($,C),_=null),j("closed")}function D(){b&&(clearTimeout(b),b=null),g=0,v=!1,N()}return N(),{send:k,close:E,reconnect:D,get status(){return w}}}function Ej(e,t={}){const{enabled:n=!0,onMessage:s,...r}=t,[a,c]=l.useState("idle"),[i,u]=l.useState(null),d=l.useRef(null),p=l.useRef(s);p.current=s,l.useEffect(()=>{if(!n||!e){c("idle");return}const h=Cs(e,{...r,onStatusChange:c,onMessage:_=>{u(_),p.current?.(_)}});return d.current=h,()=>{h.close(),d.current=null}},[e,n]);const m=l.useCallback(h=>d.current?.send(h)??!1,[]),f=l.useCallback(()=>{d.current?.reconnect()},[]);return{status:a,lastMessage:i,send:m,reconnect:f}}function Tj(e={}){const{storageKey:t="tempest-theme",defaultTheme:n="system"}=e;if(typeof window>"u")return n==="dark"?"dark":"light";let s=null;try{s=window.localStorage.getItem(t)}catch{s=null}const r=s??n;return r==="dark"||r==="light"?r:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Mj(e={}){const t=e.storageKey??"tempest-theme",n=e.defaultTheme??"system";return`
|
|
6
6
|
(function(){try{
|
|
7
7
|
var key=${JSON.stringify(t)};
|
|
8
8
|
var def=${JSON.stringify(n)};
|
|
@@ -11,5 +11,5 @@ Raw payload: ${JSON.stringify(t,null,2)}`)}throw new Error(`Resposta inválida d
|
|
|
11
11
|
var resolved=mode==="dark"||mode==="light"?mode:(matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light");
|
|
12
12
|
document.documentElement.setAttribute("data-tempest-theme",resolved);
|
|
13
13
|
}catch(e){}})();
|
|
14
|
-
`.trim()}const kn=["debug","info","warn","error"];function tj(e,t){return kn.indexOf(t)>=kn.indexOf(e)}const js=({level:e,message:t,context:n})=>{const s=e==="debug"?"log":e;n?console[s](t,n):console[s](t)};function $s(e={}){const t=e.level??"info",n=e.sinks??[js],s=e.namespace??"";function r(a,c,i){if(!tj(t,a))return;const u={level:a,message:s?`[${s}] ${c}`:c,context:i,timestamp:Date.now()};for(const d of n)try{d(u)}catch{}}return{debug:(a,c)=>r("debug",a,c),info:(a,c)=>r("info",a,c),warn:(a,c)=>r("warn",a,c),error:(a,c)=>r("error",a,c),child:a=>$s({level:t,sinks:n,namespace:s?`${s}:${a}`:a})}}const ks=l.createContext(null);function nj({adapter:e,children:t}){l.useEffect(()=>(e.init?.(),()=>{e.flush?.()}),[e]);const n=l.useMemo(()=>e,[e]);return o.jsx(ks.Provider,{value:n,children:t})}function sj(){return l.useContext(ks)}const rj={identify(e){console.info("[telemetry] identify",e)},track(e){console.info("[telemetry] track",e.name,e.properties)},captureException(e,t){console.error("[telemetry] exception",e,t)}};function oj(e){if(e===null)return null;const{id:t,email:n,name:s,traits:r}=e;return{...t!==void 0?{id:t}:null,...n!==void 0?{email:n}:null,...s!==void 0?{username:s}:null,...r??null}}function aj(e){const{sentry:t,initOptions:n,flushTimeout:s=2e3,breadcrumbCategory:r="app"}=e;return{init(){n&&t.init&&t.init(n)},identify(a){t.setUser(oj(a))},track(a){t.addBreadcrumb({category:r,message:a.name,level:"info",...a.properties?{data:a.properties}:null})},captureException(a,c){t.captureException(a,c?{extra:c}:void 0)},async flush(){t.flush&&await t.flush(s)}}}function cj(e){const{email:t,name:n,traits:s}=e;return{...t!==void 0?{email:t}:null,...n!==void 0?{name:n}:null,...s??null}}function ij(e){const{posthog:t,init:n}=e;return{init(){n&&t.init&&t.init(n.apiKey,n.options)},identify(s){if(s===null){t.reset?.();return}s.id!==void 0&&t.identify(s.id,cj(s))},track(s){t.capture(s.name,s.properties)},captureException(s,r){if(t.captureException){t.captureException(s,r);return}const a=s instanceof Error?s:new Error(String(s));t.capture("$exception",{$exception_message:a.message,$exception_type:a.name,$exception_stack_trace_raw:a.stack,...r})}}}const Ns=l.createContext(null);function lj({adapter:e,children:t}){const n=l.useMemo(()=>e,[e]);return l.useEffect(()=>{},[n]),o.jsx(Ns.Provider,{value:n,children:t})}function Ss(){const e=l.useContext(Ns);if(!e)throw new Error("useFeatureFlag requires <FeatureFlagsProvider>");return e}function uj(e,t=!1){const n=Ss(),s=a=>n.onChange?n.onChange(a):()=>{},r=()=>n.isEnabled(e,t);return l.useSyncExternalStore(s,r,r)}function dj(e,t){const n=Ss(),s=a=>n.onChange?n.onChange(a):()=>{},r=()=>n.get(e,t);return l.useSyncExternalStore(s,r,r)}function pj(e={}){const t={...e.initial??{}},n=new Set;function s(){for(const r of n)r()}return{isEnabled(r,a=!1){return r in t?!!t[r]:a},get(r,a){return r in t?t[r]:a},onChange(r){return n.add(r),()=>n.delete(r)},set(r,a){t[r]=a,s()}}}function mj(e){const{growthbook:t}=e,n=new Set;let s=!1;function r(){s||!t.setRenderer||(s=!0,t.setRenderer(()=>{for(const a of n)a()}))}return{isEnabled(a,c=!1){const i=t.isOn(a);return typeof i=="boolean"?i:c},get(a,c){return t.getFeatureValue(a,c)},onChange(a){return r(),n.add(a),()=>{n.delete(a)}}}}function fj(e){const{client:t}=e;return{isEnabled(n,s=!1){return t.variation(n,s)===!0},get(n,s){return t.variation(n,s)},onChange(n){return!t.on||!t.off?()=>{}:(t.on("change",n),()=>{t.off("change",n)})}}}async function hj(e){if(typeof navigator>"u"||!("share"in navigator))return{shared:!1,unsupported:!0,cancelled:!1};if(e.files&&!navigator.canShare?.({files:e.files}))return{shared:!1,unsupported:!0,cancelled:!1};try{return await navigator.share(e),{shared:!0,unsupported:!1,cancelled:!1}}catch(t){return t instanceof DOMException&&t.name==="AbortError"?{shared:!1,unsupported:!1,cancelled:!0}:{shared:!1,unsupported:!1,cancelled:!1,error:t}}}function _j(){return typeof navigator<"u"&&"share"in navigator}exports.createPartialResponse=me.createPartialResponse;exports.installBackgroundSync=me.installBackgroundSync;exports.installNotificationClickHandler=me.installNotificationClickHandler;exports.installPrecache=me.installPrecache;exports.installPushHandler=me.installPushHandler;exports.installRuntimeCache=me.installRuntimeCache;exports.installSkipWaitingListener=me.installSkipWaitingListener;exports.registerServiceWorker=me.registerServiceWorker;exports.skipWaiting=me.skipWaiting;exports.unregisterAllServiceWorkers=me.unregisterAllServiceWorkers;exports.cn=x.cn;Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>I.BrowserRouter});Object.defineProperty(exports,"HashRouter",{enumerable:!0,get:()=>I.HashRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>I.Link});Object.defineProperty(exports,"MemoryRouter",{enumerable:!0,get:()=>I.MemoryRouter});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>I.NavLink});Object.defineProperty(exports,"Navigate",{enumerable:!0,get:()=>I.Navigate});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>I.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>I.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>I.Routes});Object.defineProperty(exports,"redirect",{enumerable:!0,get:()=>I.redirect});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>I.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>I.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>I.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>I.useParams});Object.defineProperty(exports,"useRouteError",{enumerable:!0,get:()=>I.useRouteError});Object.defineProperty(exports,"useSearchParams",{enumerable:!0,get:()=>I.useSearchParams});Object.defineProperty(exports,"Controller",{enumerable:!0,get:()=>pe.Controller});Object.defineProperty(exports,"FormProvider",{enumerable:!0,get:()=>pe.FormProvider});Object.defineProperty(exports,"useFieldArray",{enumerable:!0,get:()=>pe.useFieldArray});Object.defineProperty(exports,"useForm",{enumerable:!0,get:()=>pe.useForm});Object.defineProperty(exports,"useFormContext",{enumerable:!0,get:()=>pe.useFormContext});Object.defineProperty(exports,"useFormState",{enumerable:!0,get:()=>pe.useFormState});Object.defineProperty(exports,"useWatch",{enumerable:!0,get:()=>pe.useWatch});exports.AccessControlProvider=Hw;exports.Accordion=As;exports.Alert=Xs;exports.AppProviders=Sx;exports.AppRouter=yx;exports.AppShell=lr;exports.AspectRatio=pr;exports.AuthGuard=Ww;exports.Avatar=Nr;exports.BREAKPOINTS=bt;exports.Badge=zr;exports.Banner=Zr;exports.BottomNavigation=co;exports.BottomSheet=_o;exports.Breadcrumbs=xo;exports.Button=yt;exports.CACHE_TIME=ns;exports.CEPInput=Hx;exports.CNPJInput=Ux;exports.CPFInput=qx;exports.Calendar=Og;exports.Can=Jw;exports.Card=na;exports.Carousel=uy;exports.Center=ca;exports.Checkbox=ha;exports.ChipInput=Sa;exports.ClickOutside=Zh;exports.Collapsible=D_;exports.Combobox=Wa;exports.Command=mg;exports.ConditionalWrapper=e_;exports.ConfirmDialog=Nn;exports.Container=Ml;exports.ContextMenu=z_;exports.CopyButton=zh;exports.DataList=u_;exports.DataTable=nv;exports.DatePicker=jc;exports.DateRangePicker=Db;exports.DescriptionList=f_;exports.Divider=Mc;exports.Drawer=Yc;exports.DropdownMenu=ui;exports.Dropzone=_i;exports.EmptyState=xi;exports.ErrorBoundary=ms;exports.ErrorState=Ci;exports.ErrorText=r_;exports.FeatureFlagsProvider=lj;exports.FileUpload=Ki;exports.FloatingActionButton=Nv;exports.For=t_;exports.Form=il;exports.FormActions=dl;exports.FormField=Ax;exports.FormRow=ul;exports.FormSection=ll;exports.GoogleSignIn=Xw;exports.Grid=Il;exports.Hide=op;exports.HoverCard=Y_;exports.I18nProvider=ds;exports.Image=c_;exports.Input=xt;exports.Kbd=Bl;exports.Label=T_;exports.ListTile=pv;exports.Menubar=Zb;exports.Modal=Ut;exports.ModalsProvider=ql;exports.Money=Hh;exports.MoneyInput=Qx;exports.MultiSelect=pb;exports.NProgressBar=iu;exports.Navbar=nu;exports.NavigationMenu=Wb;exports.NavigationRail=Av;exports.Page=vu;exports.Pagination=Rn;exports.PasswordInput=Yu;exports.PhoneInput=Kx;exports.PinInput=ld;exports.Popover=gd;exports.Portal=zn;exports.Progress=Sd;exports.QueryProvider=ss;exports.REFETCH_TIME=ex;exports.Radio=Ad;exports.RadioGroup=Fd;exports.RangeSlider=Gd;exports.RatingStars=np;exports.RefreshIndicator=tw;exports.RelativeTime=Kh;exports.Resizable=$g;exports.RouteGuard=as;exports.STALE_TIME=ts;exports.SafeArea=mp;exports.ScrollArea=gg;exports.SearchBar=Pn;exports.SegmentedControl=Ep;exports.Select=Op;exports.Show=rp;exports.Sidebar=Vp;exports.Skeleton=tm;exports.Slider=Jg;exports.Spacer=am;exports.Spinner=An;exports.Stack=Ll;exports.Stat=Nm;exports.Stepper=Im;exports.StepperInput=Gm;exports.Switch=ef;exports.Table=Fn;exports.Tabs=Df;exports.Tag=ff;exports.TelemetryProvider=nj;exports.TempestApiError=wt;exports.TempestDataProvider=lx;exports.Textarea=Wf;exports.ThemeProvider=ls;exports.TimePicker=Qv;exports.Timeline=rh;exports.ToastProvider=Th;exports.Toggle=w_;exports.ToggleGroup=N_;exports.ToggleGroupItem=S_;exports.Tooltip=ph;exports.TruncateText=Qh;exports.VirtualList=Fh;exports.VisuallyHidden=Xh;exports.WebPushClient=gs;exports.WebPushPermissionDeniedError=_s;exports.WebPushUnsupportedError=qt;exports.assertNever=$w;exports.buildApiError=Ht;exports.camelCase=uw;exports.capitalize=lw;exports.chunk=hw;exports.clamp=At;exports.consoleSink=js;exports.consoleTelemetryAdapter=rj;exports.createApiClient=_t;exports.createAudioPlayer=Yt;exports.createAuthStore=Qn;exports.createDataProvider=ix;exports.createEventStream=fs;exports.createGrowthBookFeatureFlagsAdapter=mj;exports.createI18n=Qt;exports.createInMemoryFlags=pj;exports.createLaunchDarklyFeatureFlagsAdapter=fj;exports.createLogger=$s;exports.createOfflineStore=Ix;exports.createPostHogTelemetryAdapter=ij;exports.createQueryKeys=tx;exports.createRefreshQueue=Vn;exports.createRoleAccessControl=Yw;exports.createSelectors=wx;exports.createSentryTelemetryAdapter=aj;exports.createStore=vx;exports.createTempestAuth=Kw;exports.createWebSocket=xs;exports.debounce=kw;exports.decodeJWT=Gt;exports.deepMerge=Jn;exports.defineRoutes=hx;exports.emptyOffsetPage=rx;exports.estimatePasswordStrength=Ln;exports.formatBytes=Pm;exports.formatCEP=vs;exports.formatCNPJ=ws;exports.formatCPF=Gn;exports.formatCompactNumber=Am;exports.formatCurrency=nw;exports.formatDate=sw;exports.formatDateTime=rw;exports.formatPercent=ow;exports.formatPhone=Hn;exports.generateIdempotencyKey=Bw;exports.getInitialTheme=Zx;exports.groupBy=mw;exports.isApiError=Mw;exports.isCursorPage=sx;exports.isDefined=vw;exports.isEmpty=yw;exports.isJWTExpired=qw;exports.isNumber=xw;exports.isOffsetPage=nx;exports.isPlainObject=jw;exports.isPushSupported=st;exports.isShareSupported=_j;exports.isString=ww;exports.kebabCase=dw;exports.lazyWithRetry=Yn;exports.listQueryKey=os;exports.memoizeOne=Cw;exports.nprogress=Mn;exports.omit=bw;exports.once=Sw;exports.oneQueryKey=Jt;exports.parseResponse=Iw;exports.permissionsFromToken=Vw;exports.pick=gw;exports.playAudio=Mx;exports.pluralize=pw;exports.randomId=Kt;exports.range=_w;exports.relativeTime=Bn;exports.retry=Ow;exports.share=hj;exports.sleep=Ew;exports.slugify=cw;exports.stopAudio=Rx;exports.storage=aw;exports.themeInitScript=ej;exports.throttle=Nw;exports.truncate=iw;exports.uniqueBy=fw;exports.unmask=Wx;exports.uploadWithProgress=Aw;exports.urlBase64ToUint8Array=hs;exports.useAccessControl=Zn;exports.useAsync=yy;exports.useAudio=Lx;exports.useBeforeInstallPrompt=Cy;exports.useBreakpoint=Fe;exports.useCan=es;exports.useClickOutside=Qy;exports.useClientFilter=py;exports.useClipboard=$y;exports.useCounter=qy;exports.useCreate=px;exports.useCursorQuery=ax;exports.useDataProvider=Ge;exports.useDebounce=dy;exports.useDeepMemo=Ly;exports.useDelete=fx;exports.useDisclosure=zy;exports.useDocumentTitle=Uy;exports.useDocumentVisibility=wy;exports.useErrorHandler=Px;exports.useEventListener=fy;exports.useEventStream=Ex;exports.useFavicon=Ky;exports.useFeatureFlag=uj;exports.useFlagValue=dj;exports.useFocusTrap=qn;exports.useGeolocation=Ty;exports.useHover=Oy;exports.useI18n=ps;exports.useIdle=Ey;exports.useIntersectionObserver=xy;exports.useInterval=Iy;exports.useIsFirstRender=Yy;exports.useKeyboardShortcut=Sy;exports.useList=ux;exports.useListState=Wy;exports.useLocalStorage=gy;exports.useLongPress=By;exports.useMap=Hy;exports.useMediaQuery=my;exports.useModals=Hl;exports.useOAuthCallback=Zw;exports.useOne=dx;exports.useOnline=vy;exports.usePaginatedQuery=ox;exports.usePagination=Kn;exports.usePoll=zw;exports.usePrevious=Dy;exports.usePushSubscription=Tx;exports.useQueue=Jy;exports.useResizeObserver=jy;exports.useScrollLock=My;exports.useSet=Gy;exports.useStableCallback=Ry;exports.useTelemetry=sj;exports.useTheme=jx;exports.useThrottle=Ay;exports.useTimeout=Py;exports.useToast=Eh;exports.useToggle=by;exports.useTranslate=kx;exports.useUpdate=mx;exports.useViaCEP=Yx;exports.useWebSocket=Xx;exports.useWindowSize=Fy;exports.useZodForm=Ox;exports.validateCNPJ=zx;exports.validateCPF=Bx;exports.validateForm=Fx;exports.withTimeout=Tw;exports.zodResolver=ys;
|
|
14
|
+
`.trim()}const Tn=["debug","info","warn","error"];function Rj(e,t){return Tn.indexOf(t)>=Tn.indexOf(e)}const Es=({level:e,message:t,context:n})=>{const s=e==="debug"?"log":e;n?console[s](t,n):console[s](t)};function Ts(e={}){const t=e.level??"info",n=e.sinks??[Es],s=e.namespace??"";function r(a,c,i){if(!Rj(t,a))return;const u={level:a,message:s?`[${s}] ${c}`:c,context:i,timestamp:Date.now()};for(const d of n)try{d(u)}catch{}}return{debug:(a,c)=>r("debug",a,c),info:(a,c)=>r("info",a,c),warn:(a,c)=>r("warn",a,c),error:(a,c)=>r("error",a,c),child:a=>Ts({level:t,sinks:n,namespace:s?`${s}:${a}`:a})}}const Ms=l.createContext(null);function Lj({adapter:e,children:t}){l.useEffect(()=>(e.init?.(),()=>{e.flush?.()}),[e]);const n=l.useMemo(()=>e,[e]);return o.jsx(Ms.Provider,{value:n,children:t})}function Dj(){return l.useContext(Ms)}const Ij={identify(e){console.info("[telemetry] identify",e)},track(e){console.info("[telemetry] track",e.name,e.properties)},captureException(e,t){console.error("[telemetry] exception",e,t)}};function Pj(e){if(e===null)return null;const{id:t,email:n,name:s,traits:r}=e;return{...t!==void 0?{id:t}:null,...n!==void 0?{email:n}:null,...s!==void 0?{username:s}:null,...r??null}}function Aj(e){const{sentry:t,initOptions:n,flushTimeout:s=2e3,breadcrumbCategory:r="app"}=e;return{init(){n&&t.init&&t.init(n)},identify(a){t.setUser(Pj(a))},track(a){t.addBreadcrumb({category:r,message:a.name,level:"info",...a.properties?{data:a.properties}:null})},captureException(a,c){t.captureException(a,c?{extra:c}:void 0)},async flush(){t.flush&&await t.flush(s)}}}function Fj(e){const{email:t,name:n,traits:s}=e;return{...t!==void 0?{email:t}:null,...n!==void 0?{name:n}:null,...s??null}}function Oj(e){const{posthog:t,init:n}=e;return{init(){n&&t.init&&t.init(n.apiKey,n.options)},identify(s){if(s===null){t.reset?.();return}s.id!==void 0&&t.identify(s.id,Fj(s))},track(s){t.capture(s.name,s.properties)},captureException(s,r){if(t.captureException){t.captureException(s,r);return}const a=s instanceof Error?s:new Error(String(s));t.capture("$exception",{$exception_message:a.message,$exception_type:a.name,$exception_stack_trace_raw:a.stack,...r})}}}const Rs=l.createContext(null);function Bj({adapter:e,children:t}){const n=l.useMemo(()=>e,[e]);return l.useEffect(()=>{},[n]),o.jsx(Rs.Provider,{value:n,children:t})}function Ls(){const e=l.useContext(Rs);if(!e)throw new Error("useFeatureFlag requires <FeatureFlagsProvider>");return e}function zj(e,t=!1){const n=Ls(),s=a=>n.onChange?n.onChange(a):()=>{},r=()=>n.isEnabled(e,t);return l.useSyncExternalStore(s,r,r)}function Wj(e,t){const n=Ls(),s=a=>n.onChange?n.onChange(a):()=>{},r=()=>n.get(e,t);return l.useSyncExternalStore(s,r,r)}function qj(e={}){const t={...e.initial??{}},n=new Set;function s(){for(const r of n)r()}return{isEnabled(r,a=!1){return r in t?!!t[r]:a},get(r,a){return r in t?t[r]:a},onChange(r){return n.add(r),()=>n.delete(r)},set(r,a){t[r]=a,s()}}}function Uj(e){const{growthbook:t}=e,n=new Set;let s=!1;function r(){s||!t.setRenderer||(s=!0,t.setRenderer(()=>{for(const a of n)a()}))}return{isEnabled(a,c=!1){const i=t.isOn(a);return typeof i=="boolean"?i:c},get(a,c){return t.getFeatureValue(a,c)},onChange(a){return r(),n.add(a),()=>{n.delete(a)}}}}function Kj(e){const{client:t}=e;return{isEnabled(n,s=!1){return t.variation(n,s)===!0},get(n,s){return t.variation(n,s)},onChange(n){return!t.on||!t.off?()=>{}:(t.on("change",n),()=>{t.off("change",n)})}}}async function Hj(e){if(typeof navigator>"u"||!("share"in navigator))return{shared:!1,unsupported:!0,cancelled:!1};if(e.files&&!navigator.canShare?.({files:e.files}))return{shared:!1,unsupported:!0,cancelled:!1};try{return await navigator.share(e),{shared:!0,unsupported:!1,cancelled:!1}}catch(t){return t instanceof DOMException&&t.name==="AbortError"?{shared:!1,unsupported:!1,cancelled:!0}:{shared:!1,unsupported:!1,cancelled:!1,error:t}}}function Gj(){return typeof navigator<"u"&&"share"in navigator}exports.createPartialResponse=fe.createPartialResponse;exports.installBackgroundSync=fe.installBackgroundSync;exports.installNotificationClickHandler=fe.installNotificationClickHandler;exports.installPrecache=fe.installPrecache;exports.installPushHandler=fe.installPushHandler;exports.installRuntimeCache=fe.installRuntimeCache;exports.installSkipWaitingListener=fe.installSkipWaitingListener;exports.registerServiceWorker=fe.registerServiceWorker;exports.skipWaiting=fe.skipWaiting;exports.unregisterAllServiceWorkers=fe.unregisterAllServiceWorkers;exports.cn=x.cn;Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>I.BrowserRouter});Object.defineProperty(exports,"HashRouter",{enumerable:!0,get:()=>I.HashRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>I.Link});Object.defineProperty(exports,"MemoryRouter",{enumerable:!0,get:()=>I.MemoryRouter});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>I.NavLink});Object.defineProperty(exports,"Navigate",{enumerable:!0,get:()=>I.Navigate});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>I.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>I.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>I.Routes});Object.defineProperty(exports,"redirect",{enumerable:!0,get:()=>I.redirect});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>I.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>I.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>I.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>I.useParams});Object.defineProperty(exports,"useRouteError",{enumerable:!0,get:()=>I.useRouteError});Object.defineProperty(exports,"useSearchParams",{enumerable:!0,get:()=>I.useSearchParams});Object.defineProperty(exports,"Controller",{enumerable:!0,get:()=>me.Controller});Object.defineProperty(exports,"FormProvider",{enumerable:!0,get:()=>me.FormProvider});Object.defineProperty(exports,"useFieldArray",{enumerable:!0,get:()=>me.useFieldArray});Object.defineProperty(exports,"useForm",{enumerable:!0,get:()=>me.useForm});Object.defineProperty(exports,"useFormContext",{enumerable:!0,get:()=>me.useFormContext});Object.defineProperty(exports,"useFormState",{enumerable:!0,get:()=>me.useFormState});Object.defineProperty(exports,"useWatch",{enumerable:!0,get:()=>me.useWatch});exports.AccessControlProvider=jx;exports.Accordion=qs;exports.Alert=rr;exports.AppBar=yr;exports.AppProviders=rj;exports.AppRouter=Yx;exports.AppShell=Er;exports.AspectRatio=Rr;exports.AuthGuard=yx;exports.Avatar=Hr;exports.BREAKPOINTS=xt;exports.Badge=co;exports.Banner=vo;exports.BottomNavigation=Co;exports.BottomSheet=Po;exports.Breadcrumbs=Wo;exports.Button=Qe;exports.CACHE_TIME=is;exports.CEPInput=jj;exports.CNPJInput=wj;exports.CPFInput=vj;exports.Calendar=gb;exports.Can=kx;exports.Card=xa;exports.Carousel=Wy;exports.Center=Sa;exports.Checkbox=Ia;exports.ChipInput=Ga;exports.ClickOutside=M_;exports.Collapsible=pg;exports.Combobox=ic;exports.Command=Kg;exports.ConditionalWrapper=R_;exports.ConfirmDialog=Rn;exports.Container=Vl;exports.ContextMenu=yg;exports.CopyButton=y_;exports.DataList=W_;exports.DataTable=Lv;exports.DatePicker=qc;exports.DateRangePicker=py;exports.DescriptionList=H_;exports.Divider=Vc;exports.Drawer=_i;exports.DropdownMenu=Ti;exports.Dropzone=Pi;exports.EmptyState=Wi;exports.ErrorBoundary=ys;exports.ErrorState=Ji;exports.ErrorText=P_;exports.FeatureFlagsProvider=Bj;exports.FileUpload=dl;exports.FloatingActionButton=sw;exports.For=L_;exports.Form=Cl;exports.FormActions=Ml;exports.FormField=fj;exports.FormRow=Tl;exports.FormSection=El;exports.GoogleSignIn=Ex;exports.Grid=tu;exports.Hide=Dp;exports.HoverCard=Cg;exports.I18nProvider=gs;exports.Image=O_;exports.Input=kt;exports.InstallBanner=lu;exports.InstallButton=uu;exports.Kbd=hu;exports.Label=ig;exports.ListTile=qv;exports.Menubar=My;exports.Modal=Gt;exports.ModalsProvider=bu;exports.Money=$_;exports.MoneyInput=Nj;exports.MultiSelect=Ub;exports.NProgressBar=Au;exports.Navbar=Mu;exports.NavigationMenu=vy;exports.NavigationRail=fw;exports.Page=Qu;exports.Pagination=Fn;exports.PasswordInput=kd;exports.PhoneInput=xj;exports.PinInput=Fd;exports.Popover=Hd;exports.Portal=Gn;exports.Progress=np;exports.QueryProvider=ls;exports.REFETCH_TIME=Mx;exports.Radio=pp;exports.RadioGroup=mp;exports.RangeSlider=xp;exports.RatingStars=Mp;exports.RefreshIndicator=Rw;exports.RelativeTime=j_;exports.Resizable=nb;exports.RouteGuard=ps;exports.STALE_TIME=cs;exports.SafeArea=Wp;exports.ScrollArea=Qg;exports.SearchBar=Wn;exports.SegmentedControl=rm;exports.Select=fm;exports.Show=Lp;exports.Sidebar=Nm;exports.Skeleton=Tm;exports.Slider=Nb;exports.Spacer=Im;exports.Spinner=qn;exports.Stack=Zl;exports.Stat=rf;exports.Stepper=ff;exports.StepperInput=Nf;exports.Switch=Lf;exports.Table=Un;exports.Tabs=ph;exports.Tag=Hf;exports.TelemetryProvider=Lj;exports.TempestApiError=$t;exports.TempestDataProvider=Bx;exports.Textarea=vh;exports.ThemeProvider=hs;exports.TimePicker=Nw;exports.Timeline=Ph;exports.ToastProvider=i_;exports.Toggle=Z_;exports.ToggleGroup=rg;exports.ToggleGroupItem=og;exports.Tooltip=Uh;exports.TruncateText=S_;exports.VirtualList=__;exports.VisuallyHidden=T_;exports.WebPushClient=js;exports.WebPushPermissionDeniedError=xs;exports.WebPushUnsupportedError=Ht;exports.assertNever=tx;exports.buildApiError=Yt;exports.camelCase=zw;exports.capitalize=Bw;exports.chunk=Hw;exports.clamp=Bt;exports.consoleSink=Es;exports.consoleTelemetryAdapter=Ij;exports.createApiClient=vt;exports.createAudioPlayer=en;exports.createAuthStore=ts;exports.createDataProvider=Ox;exports.createEventStream=vs;exports.createGrowthBookFeatureFlagsAdapter=Uj;exports.createI18n=Zt;exports.createInMemoryFlags=qj;exports.createLaunchDarklyFeatureFlagsAdapter=Kj;exports.createLogger=Ts;exports.createOfflineStore=pj;exports.createPostHogTelemetryAdapter=Oj;exports.createQueryKeys=Rx;exports.createRefreshQueue=ss;exports.createRoleAccessControl=Sx;exports.createSelectors=Xx;exports.createSentryTelemetryAdapter=Aj;exports.createStore=Vx;exports.createTempestAuth=xx;exports.createWebSocket=Cs;exports.debounce=nx;exports.decodeJWT=Vt;exports.deepMerge=es;exports.defineRoutes=Hx;exports.emptyOffsetPage=Ix;exports.estimatePasswordStrength=On;exports.formatBytes=hf;exports.formatCEP=Ns;exports.formatCNPJ=Ss;exports.formatCPF=Zn;exports.formatCompactNumber=_f;exports.formatCurrency=Lw;exports.formatDate=Dw;exports.formatDateTime=Iw;exports.formatPercent=Pw;exports.formatPhone=Xn;exports.generateIdempotencyKey=gx;exports.getInitialTheme=Tj;exports.groupBy=Uw;exports.isApiError=ix;exports.isCursorPage=Dx;exports.isDefined=Vw;exports.isEmpty=Yw;exports.isJWTExpired=vx;exports.isNumber=Zw;exports.isOffsetPage=Lx;exports.isPlainObject=ex;exports.isPushSupported=ct;exports.isShareSupported=Gj;exports.isString=Xw;exports.kebabCase=Ww;exports.lazyWithRetry=ns;exports.listQueryKey=ds;exports.memoizeOne=ox;exports.nprogress=An;exports.omit=Qw;exports.once=rx;exports.oneQueryKey=Xt;exports.parseResponse=px;exports.permissionsFromToken=Cx;exports.pick=Jw;exports.playAudio=ij;exports.pluralize=qw;exports.randomId=Qt;exports.range=Gw;exports.relativeTime=Hn;exports.retry=_x;exports.share=Hj;exports.sleep=ax;exports.slugify=Fw;exports.stopAudio=lj;exports.storage=Aw;exports.themeInitScript=Mj;exports.throttle=sx;exports.truncate=Ow;exports.uniqueBy=Kw;exports.unmask=yj;exports.uploadWithProgress=fx;exports.urlBase64ToUint8Array=ws;exports.useAccessControl=os;exports.useAsync=Vy;exports.useAudio=uj;exports.useBeforeInstallPrompt=Jt;exports.useBreakpoint=Be;exports.useCan=as;exports.useClickOutside=Nv;exports.useClientFilter=Uy;exports.useClipboard=nv;exports.useCounter=vv;exports.useCreate=qx;exports.useCursorQuery=Ax;exports.useDataProvider=Ve;exports.useDebounce=qy;exports.useDeepMemo=uv;exports.useDelete=Kx;exports.useDisclosure=bv;exports.useDocumentTitle=wv;exports.useDocumentVisibility=Zy;exports.useErrorHandler=mj;exports.useEventListener=Hy;exports.useEventStream=aj;exports.useFavicon=xv;exports.useFeatureFlag=zj;exports.useFlagValue=Wj;exports.useFocusTrap=Qn;exports.useGeolocation=cv;exports.useHover=_v;exports.useI18n=bs;exports.useIdle=av;exports.useIntersectionObserver=ev;exports.useInterval=pv;exports.useIsFirstRender=Sv;exports.useKeyboardShortcut=ov;exports.useList=zx;exports.useListState=yv;exports.useLocalStorage=Qy;exports.useLongPress=gv;exports.useMap=jv;exports.useMediaQuery=Ky;exports.useModals=wu;exports.useOAuthCallback=Tx;exports.useOne=Wx;exports.useOnline=Xy;exports.usePaginatedQuery=Px;exports.usePagination=Vn;exports.usePoll=bx;exports.usePrevious=dv;exports.usePushSubscription=cj;exports.useQueue=kv;exports.useResizeObserver=tv;exports.useScrollLock=iv;exports.useSet=$v;exports.useStableCallback=lv;exports.useTelemetry=Dj;exports.useTheme=ej;exports.useThrottle=fv;exports.useTimeout=mv;exports.useToast=c_;exports.useToggle=Yy;exports.useTranslate=nj;exports.useUpdate=Ux;exports.useViaCEP=Sj;exports.useWebSocket=Ej;exports.useWindowSize=hv;exports.useZodForm=_j;exports.validateCNPJ=bj;exports.validateCPF=gj;exports.validateForm=hj;exports.withTimeout=cx;exports.zodResolver=ks;
|
|
15
15
|
//# sourceMappingURL=tempest-react-sdk.cjs.map
|