@opengovsg/confetti 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/{ModalContainer-D7lgJ6Vl.d.ts → ModalContainer-BT1Bys9H.d.ts} +2 -4
- package/build/ModalContainer-DiVIAVi2.js +11 -0
- package/build/{RecordingReplayer-CKYzAfYD.js → RecordingReplayer-BvU_CHwb.js} +8 -8
- package/build/client-internals.d.ts +1 -1
- package/build/client-internals.js +1 -1
- package/build/index.d.ts +34 -30
- package/build/index.js +1 -1
- package/build/internals.d.ts +1 -2
- package/build/internals.js +1 -1
- package/build/{record-CeeyzJpB.js → record-BZwNFiEW.js} +16 -16
- package/build/{snapdom-VnBlM9vL.js → snapdom-BQZEILL6.js} +2 -2
- package/build/{types-JeyKtT3p.d.ts → types-CJY8TUUa.d.ts} +4 -5
- package/package.json +15 -9
- package/build/ModalContainer-b9Zgg8fN.js +0 -11
- /package/build/{internals-Dzl6abGJ.js → internals-B5GhpjgM.js} +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
|
|
3
1
|
//#region src/components/container/ModalContainer.d.ts
|
|
4
2
|
interface ModalContainerProps {
|
|
5
3
|
closeOnFinishMs?: number | null;
|
|
@@ -22,13 +20,13 @@ declare const ModalContent: ({
|
|
|
22
20
|
isDismissable,
|
|
23
21
|
onDismiss,
|
|
24
22
|
closeOnFinishMs
|
|
25
|
-
}: ModalContainerProps & Required<Pick<ModalContainerProps, "closeOnFinishMs" | "isDismissable">>) =>
|
|
23
|
+
}: ModalContainerProps & Required<Pick<ModalContainerProps, "closeOnFinishMs" | "isDismissable">>) => import("react/jsx-runtime").JSX.Element;
|
|
26
24
|
declare const ModalContainer: ({
|
|
27
25
|
children,
|
|
28
26
|
classNames,
|
|
29
27
|
onDismiss,
|
|
30
28
|
isDismissable,
|
|
31
29
|
closeOnFinishMs
|
|
32
|
-
}: ModalContainerProps) =>
|
|
30
|
+
}: ModalContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
31
|
//#endregion
|
|
34
32
|
export { ModalContainerProps as n, ModalContent as r, ModalContainer as t };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{i as e,r as t,t as n}from"./internals-B5GhpjgM.js";import r,{createContext as i,forwardRef as a,useCallback as o,useContext as s,useEffect as c,useMemo as l,useReducer as u,useRef as d,useState as f}from"react";import{z as p}from"zod/v4/mini";import{useLocalStorage as m,useTimeout as h}from"usehooks-ts";import g from"ky";import{Fragment as _,jsx as v,jsxs as y}from"react/jsx-runtime";import b from"clsx";import x,{flushSync as S}from"react-dom";const C=p.object({type:p.literal(`next`)}),w=p.object({type:p.literal(`end`)}),ee=p.object({type:p.literal(`jump`),target:p.number({error:`Target question is required`})}),T=p.discriminatedUnion(`type`,[C,ee,w]),E=p.object({type:p.literal(`value`),value:p.union([p.string().check(p.trim(),p.minLength(1,{error:`Value is required`})),p.number({error:`Value is required`})])}),te=p.object({type:p.literal(`binary-operator`),operator:p.union([p.literal(`equal`),p.literal(`not-equal`),p.literal(`greater`),p.literal(`greater-or-equal`),p.literal(`less`),p.literal(`less-or-equal`),p.literal(`contains`),p.literal(`not-contains`)]),value:E,target:T}),ne=p.object({type:p.literal(`switch`),cases:p.array(te),default:T}),re=p.object({type:p.literal(`always`),target:T}),ie=p.discriminatedUnion(`type`,[re,ne]),ae=p.string().check(p.trim(),p.url({protocol:/^(https|mailto)/,error:`Link must start with https:// or mailto:`})),D=p.optional(p.string().check(p.trim(),p.maxLength(50))),oe=p.object({value:p.string().check(p.trim(),p.minLength(1,{error:`Value is required`})),description:p.optional(p.string().check(p.trim()))}),se=p.nullable(p.object({label:p.string().check(p.trim(),p.minLength(1,{error:`Value is required`})),max:p.number(),description:p.optional(p.string().check(p.trim()))})),ce=p.optional(p.boolean()),le=p.object({type:p.literal(`rating`),buttonLabel:D,shouldAutoProgress:ce,scale:p.number().check(p.minimum(2),p.maximum(10)),labels:p.optional(p.object({lower:p.optional(p.pipe(p.string().check(p.trim()),p.transform(e=>e===``?void 0:e))),upper:p.optional(p.pipe(p.string().check(p.trim()),p.transform(e=>e===``?void 0:e)))})),display:p.optional(p.literal([`star`,`emoji`,`number`]))}),ue=p.object({type:p.literal(`open-ended`),placeholder:p.optional(p.string()),buttonLabel:D,max:p.number()}),de=p.object({type:p.literal(`single-select`),shouldAutoProgress:ce,options:p.array(oe),buttonLabel:D,editable:se}),fe=p.object({type:p.literal(`multi-select`),buttonLabel:D,options:p.array(oe),editable:se,max:p.optional(p.number()),display:p.optional(p.literal([`checkbox`,`tag`]))}),pe=p.object({type:p.literal(`statement`),buttonLabel:D,buttonUrl:p.optional(ae)}),me=p.object({type:p.literal(`bug-report`),placeholder:p.optional(p.string()),buttonLabel:D,enableScreenshot:p.boolean(),enableRecording:p.boolean(),detailsLabel:p.string().check(p.trim(),p.minLength(1,{error:`Label is required`}),p.maxLength(128)),detailsPlaceholder:p.optional(p.string()),redactClasses:p.optional(p.array(p.string()))}),he=p.discriminatedUnion(`type`,[le,de,ue,fe,pe,me]),ge=`__CONFETTI_CHECKBOX_Others`,_e=`__CONFETTI_RADIO_Others`,ve=p.optional(p.catchall(p.partial(p.looseObject({userAgent:p.string().check(p.trim(),p.maxLength(1e3)),screenResolution:p.string().check(p.trim(),p.maxLength(100)),viewportSize:p.string().check(p.trim(),p.maxLength(100)),pageUrl:p.string(),pageTitle:p.string().check(p.trim(),p.maxLength(1e3)),referrer:p.string(),datadogTraceId:p.optional(p.string()),datadogSessionId:p.optional(p.string()),datadogSessionReplayLink:p.optional(p.string())})),p.optional(p.string())));p.cuid2();const ye=p.looseObject({type:p.literal([0,1,2,3,4,5,6]),data:p.unknown(),timestamp:p.number(),delay:p.optional(p.number())});p.array(ye);const be=p.array(ye),xe=p.string().check(p.refine(e=>{try{return be.safeParse(JSON.parse(e)).success}catch{return!1}},{error:`Invalid recording events`})),Se=p.string().check(p.regex(/^data:image\/(png|jpeg|jpg|webp|gif);base64,[A-Za-z0-9+/]+=*$/,{error:`Invalid image data URL`})),Ce=e=>p.object({title:p.string().check(p.trim(),...e?[p.minLength(1,{error:`Title is required`})]:[],p.maxLength(256)),description:p.optional(p.string().check(p.trim(),p.maxLength(4096))),screenshotDataUrl:p.optional(Se),recordingEventsJson:p.optional(xe),metadata:ve}),we=Ce(!0),Te=(e,{required:t})=>Ce(t),Ee=e=>p.number().check(p.int(),p.minimum(1),p.maximum(e)),De=({scale:e},{required:t})=>{let n=Ee(e);return t?n:p.optional(n)},Oe=({maxLength:e},{required:t})=>p.string().check(p.trim(),...t?[p.minLength(1,{error:`This field is required`})]:[],p.maxLength(e??2048,{error:({maximum:e})=>`Please enter less than ${e} characters`})),ke=(e,t)=>p.string().check(p.trim(),...t?[p.minLength(1,{error:`This field is required`})]:[],p.maxLength(e??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),p.refine(e=>e!==_e,{error:`Please fill out the free text field`})),Ae=({maxLength:e},{required:t})=>{let n=ke(e,t);return t?n:p.optional(n)},je=({maxSelected:e,maxLength:t},{required:n})=>p.array(p.string().check(p.trim(),...n?[p.minLength(1,{error:`This field is required`})]:[],p.maxLength(t??1024,{error:({maximum:e})=>`Please enter less than ${e} characters`}),p.refine(e=>e!==ge,{error:`Please fill out the free text field`}))).check(...n?[p.minLength(1,{error:`Please select at least one option`})]:[],p.maxLength(e??1024,{error:({maximum:e})=>`Please select less than ${e} options`})),Me=()=>p.optional(p.string()),Ne=p.cuid2(),Pe=p.object({title:p.string().check(p.trim()),description:p.string().check(p.trim()),buttonText:p.string().check(p.trim())}),Fe=p.object({title:p.string(),description:p.nullable(p.string()),questions:p.array(p.object({id:p.string(),title:p.string(),description:p.nullable(p.string()),position:p.number(),required:p.boolean(),properties:he,routingLogic:ie})),confirmation:Pe});p.object({surveyId:Ne,responseId:p.union([p.cuid2(),p.uuid()])});const Ie=p.catch(p.partial(p.object({type:p.enum([`embedded`,`popover`,`modal`]),version:p.string().check(p.trim(),p.minLength(1),p.maxLength(50))})),{});p.object({respondent:p.string().check(p.trim(),p.minLength(1),p.maxLength(2048)),data:p.record(p.string(),p.union([p.string().check(p.trim(),p.maxLength(2048)),p.number(),p.array(p.string().check(p.trim(),p.maxLength(2048))).check(p.maxLength(1024)),we])),metadata:p.record(p.string().check(p.trim(),p.maxLength(1e3)),p.string().check(p.trim(),p.maxLength(1e3))),telemetry:p.optional(Ie)}),p.object({surveyId:Ne,respondent:p.string().check(p.trim(),p.minLength(1),p.maxLength(2048))}),p.object({surveyId:Ne,respondent:p.string().check(p.trim(),p.minLength(1),p.maxLength(2048))}),p.object({surveyId:Ne});const Le=p.object({lastRespondedAt:p.nullable(p.union([p.iso.datetime(),p.date()])),lastViewedAt:p.nullable(p.union([p.iso.datetime(),p.date()])),lastDismissedAt:p.nullable(p.union([p.iso.datetime(),p.date()]))});p.object({type:p.enum([`view`,`dismiss`])});function Re({surveyId:e,override:t}){let[n,r]=m(`cfti:${e}:respondent`,``);return c(()=>{n||r(crypto.randomUUID())},[n,r]),t||n}const ze={lastRespondedAt:null,lastDismissedAt:null};async function Be({client:e,surveyId:t,respondent:n,signal:r}){try{let i=await e.get(`v1/cfti/${t}/respondent/${n}`,{signal:r}).json(),a=Le.safeParse(i);return a.success?{lastRespondedAt:a.data.lastRespondedAt?new Date(a.data.lastRespondedAt):null,lastDismissedAt:a.data.lastDismissedAt?new Date(a.data.lastDismissedAt):null}:(console.warn(`[confetti] Respondent response failed schema validation`,a.error),ze)}catch{return ze}}function Ve({client:e,surveyId:t,respondent:n}){let[r,i]=f(ze),[a,o]=f(!1),[s,l]=f({client:e,surveyId:t,respondent:n});return(s.client!==e||s.surveyId!==t||s.respondent!==n)&&(l({client:e,surveyId:t,respondent:n}),i(ze),o(!1)),c(()=>{if(!n||typeof window>`u`||typeof document>`u`)return;let r=null,a=()=>{r?.abort(),r=new AbortController;let a=r;Be({client:e,surveyId:t,respondent:n,signal:a.signal}).then(e=>{a.signal.aborted||(i(e),o(!0))})};a();let s=()=>{document.visibilityState===`visible`&&a()};return document.addEventListener(`visibilitychange`,s),()=>{r?.abort(),document.removeEventListener(`visibilitychange`,s)}},[e,t,n]),{state:r,isSettled:a}}const He=g.create({prefixUrl:`https://confetti.gov.sg/api`,retry:{limit:3,methods:[`get`]},timeout:6e4});function Ue(e,t){return t===void 0?!0:typeof t==`boolean`?t:t(e)}const We=i(null),Ge=({type:e,children:t})=>{let n=l(()=>({type:e}),[e]);return v(We.Provider,{value:n,children:t})},Ke=()=>s(We),qe=i(null),Je=({children:e,surveyId:t,publishableKey:n,respondent:r,metadata:i={},isSurveyVisible:a,apiBaseUrl:s,alwaysRenderChildren:u})=>{let p=Ke(),m=d(!1),[h,g]=f(),[_,y]=f(!1),b=Re({surveyId:t,override:r}),x=l(()=>{let e={headers:{"x-cfti-pk":n}};return s&&(e.prefixUrl=s),He.extend(e)},[s,n]),{state:S,isSettled:C}=Ve({client:x,surveyId:t,respondent:b});c(()=>{(async()=>{m.current=!1,y(!1),g(void 0);try{let e=await x.get(`v1/cfti/${t}`).json(),n=Fe.safeParse(e);if(!n.success)return;g(n.data)}catch{}finally{y(!0)}})()},[x,t]);let w=o(async({answers:e})=>{let n=crypto.randomUUID();await x.put(`v1/cfti/${t}/response/${n}`,{json:{respondent:b,data:e,metadata:i,telemetry:{...p!==null&&{type:p.type},version:`0.3.3`}}})},[x,i,b,t,p]),ee=o(()=>{u||g(void 0),x.post(`v1/cfti/${t}/respondent/${b}/event`,{json:{type:`dismiss`}}).catch(()=>{})},[u,x,b,t]),T=l(()=>!_||!C?!1:Ue(S,a),[_,C,a,S]);c(()=>{m.current||T&&h&&b&&(m.current=!0,x.post(`v1/cfti/${t}/respondent/${b}/event`,{json:{type:`view`}}).catch(()=>{}))},[x,T,b,h,t]);let E=T&&!!h;return!u&&!E?null:v(qe.Provider,{value:{submit:w,dismiss:ee,surveyId:t,survey:h,metadata:i,isVisible:E},children:e})},Ye=e=>s(qe)?v(_,{children:e.children}):v(Je,{...e,surveyId:e.surveyId,publishableKey:e.publishableKey}),Xe=()=>{let e=s(qe);if(!e)throw Error(`useConfetti must be used within a ConfettiProvider`);return e},Ze=i(null);i(null),i(null),i(null),i(null);const Qe=i({});i(null);const $e=i(null);function et(e){if(typeof window>`u`||window.navigator==null)return!1;let t=window.navigator.userAgentData?.brands;return Array.isArray(t)&&t.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function tt(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function O(e){let t=null;return()=>(t??=e(),t)}const nt=O(function(){return tt(/^Mac/i)}),rt=O(function(){return tt(/^iPhone/i)}),it=O(function(){return tt(/^iPad/i)||nt()&&navigator.maxTouchPoints>1}),at=O(function(){return rt()||it()}),ot=O(function(){return et(/AppleWebKit/i)&&!st()}),st=O(function(){return et(/Chrome/i)}),ct=O(function(){return et(/Android/i)}),lt=O(function(){return et(/Firefox/i)});function ut(e){if(ft())e.focus({preventScroll:!0});else{let t=pt(e);e.focus(),mt(t)}}let dt=null;function ft(){if(dt==null){dt=!1;try{document.createElement(`div`).focus({get preventScroll(){return dt=!0,!0}})}catch{}}return dt}function pt(e){let t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function mt(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}function k(e,t,n=!0){let{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}=t;lt()&&window.event?.type?.startsWith(`key`)&&e.target===`_blank`&&(nt()?r=!0:i=!0);let s=ot()&&nt()&&!it()?new KeyboardEvent(`keydown`,{keyIdentifier:`Enter`,metaKey:r,ctrlKey:i,altKey:a,shiftKey:o}):new MouseEvent(`click`,{metaKey:r,ctrlKey:i,altKey:a,shiftKey:o,detail:1,bubbles:!0,cancelable:!0});k.isOpening=n,ut(e),e.dispatchEvent(s),k.isOpening=!1}k.isOpening=!1;const A=typeof document<`u`?r.useLayoutEffect:()=>{},ht={prefix:String(Math.round(Math.random()*1e10)),current:0},gt=r.createContext(ht),_t=r.createContext(!1);typeof window<`u`&&window.document&&window.document.createElement;let vt=new WeakMap;function yt(e=!1){let t=s(gt),n=d(null);if(n.current===null&&!e){let e=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED?.ReactCurrentOwner?.current;if(e){let n=vt.get(e);n==null?vt.set(e,{id:t.current,state:e.memoizedState}):e.memoizedState!==n.state&&(t.current=n.id,vt.delete(e))}n.current=++t.current}return n.current}function bt(e){let t=s(gt),n=yt(!!e),r=`react-aria${t.prefix}`;return e||`${r}-${n}`}function xt(e){let t=r.useId(),[n]=f(Et()),i=n?`react-aria`:`react-aria${ht.prefix}`;return e||`${i}-${t}`}const St=typeof r.useId==`function`?xt:bt;function Ct(){return!1}function wt(){return!0}function Tt(e){return()=>{}}function Et(){return typeof r.useSyncExternalStore==`function`?r.useSyncExternalStore(Tt,Ct,wt):s(_t)}function Dt(e){let[t,n]=f(e),r=d(t),i=d(null),a=d(()=>{if(!i.current)return;let e=i.current.next();if(e.done){i.current=null;return}r.current===e.value?a.current():n(e.value)});return A(()=>{r.current=t,i.current&&a.current()}),[t,o(e=>{i.current=e(r.current),a.current()},[a])]}let Ot=!!(typeof window<`u`&&window.document&&window.document.createElement),kt=new Map,At;typeof FinalizationRegistry<`u`&&(At=new FinalizationRegistry(e=>{kt.delete(e)}));function jt(e){let[t,n]=f(e),r=d(null),i=St(t),a=d(null);if(At&&At.register(a,i),Ot){let e=kt.get(i);e&&!e.includes(r)?e.push(r):kt.set(i,[r])}return A(()=>{let e=i;return()=>{At&&At.unregister(a),kt.delete(e)}},[i]),c(()=>{let e=r.current;return e&&n(e),()=>{e&&(r.current=null)}}),i}function Mt(e,t){if(e===t)return e;let n=kt.get(e);if(n)return n.forEach(e=>e.current=t),t;let r=kt.get(t);return r?(r.forEach(t=>t.current=e),e):t}function Nt(e=[]){let t=jt(),[n,r]=Dt(t),i=o(()=>{r(function*(){yield t,yield document.getElementById(t)?t:void 0})},[t,r]);return A(i,[t,i,...e]),n}function Pt(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}const j=e=>e?.ownerDocument??document,M=e=>e&&`window`in e&&e.window===e?e:j(e).defaultView||window;function Ft(e){return typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`number`}function It(e){return Ft(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&`host`in e}function N(){return!1}function P(e,t){if(!N())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n=n.tagName===`SLOT`&&n.assignedSlot?n.assignedSlot.parentNode:It(n)?n.host:n.parentNode}return!1}const F=(e=document)=>{if(!N())return e.activeElement;let t=e.activeElement;for(;t&&`shadowRoot`in t&&t.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t};function I(e){if(N()&&e.target instanceof Element&&e.target.shadowRoot){if(`composedPath`in e)return e.composedPath()[0]??null;if(`composedPath`in e.nativeEvent)return e.nativeEvent.composedPath()[0]??null}return e.target}function Lt(e){if(!e)return!1;let t=e.getRootNode(),n=M(e);if(!(t instanceof n.Document||t instanceof n.ShadowRoot))return!1;let r=t.activeElement;return r!=null&&e.contains(r)}var Rt=class{constructor(e,t,n,r){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=e=>{if(e.nodeType===Node.ELEMENT_NODE){let t=e.shadowRoot;if(t){let e=this._doc.createTreeWalker(t,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(e),NodeFilter.FILTER_ACCEPT}else if(typeof this.filter==`function`)return this.filter(e);else if(this.filter?.acceptNode)return this.filter.acceptNode(e);else if(this.filter===null)return NodeFilter.FILTER_ACCEPT}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=t,this.filter=r??null,this.whatToShow=n??NodeFilter.SHOW_ALL,this._currentNode=t,this._walkerStack.unshift(e.createTreeWalker(t,n,this._acceptNode));let i=t.shadowRoot;if(i){let e=this._doc.createTreeWalker(i,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(e)}}get currentNode(){return this._currentNode}set currentNode(e){if(!P(this.root,e))throw Error(`Cannot set currentNode to a node that is not contained by the root node.`);let t=[],n=e,r=e;for(this._currentNode=e;n&&n!==this.root;)if(n.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=n,i=this._doc.createTreeWalker(e,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),n=r=e.host}else n=n.parentNode;let i=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});t.push(i),i.currentNode=r,this._currentSetFor.add(i),this._walkerStack=t}get doc(){return this._doc}firstChild(){let e=this.currentNode,t=this.nextNode();return P(e,t)?(t&&(this.currentNode=t),t):(this.currentNode=e,null)}lastChild(){let e=this._walkerStack[0].lastChild();return e&&(this.currentNode=e),e}nextNode(){let e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){let t;if(typeof this.filter==`function`?t=this.filter(e):this.filter?.acceptNode&&(t=this.filter.acceptNode(e)),t===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let n=this.nextNode();return n&&(this.currentNode=n),n}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.nextNode();return e&&(this.currentNode=e),e}else return null}previousNode(){let e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null;return null}let t=e.previousNode();if(t){if(t.shadowRoot){let e;if(typeof this.filter==`function`?e=this.filter(t):this.filter?.acceptNode&&(e=this.filter.acceptNode(t)),e===NodeFilter.FILTER_ACCEPT)return t&&(this.currentNode=t),t;let n=this.lastChild();return n&&(this.currentNode=n),n}return t&&(this.currentNode=t),t}else if(this._walkerStack.length>1){this._walkerStack.shift();let e=this.previousNode();return e&&(this.currentNode=e),e}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}};function zt(e,t,n,r){return N()?new Rt(e,t,n,r):e.createTreeWalker(t,n,r)}function Bt(...e){return e.length===1&&e[0]?e[0]:t=>{let n=!1,r=e.map(e=>{let r=Vt(e,t);return n||=typeof r==`function`,r});if(n)return()=>{r.forEach((t,n)=>{typeof t==`function`?t():Vt(e[n],null)})}}}function Vt(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function L(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],i=r[e];typeof n==`function`&&typeof i==`function`&&e[0]===`o`&&e[1]===`n`&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=Pt(n,i):(e===`className`||e===`UNSAFE_className`)&&typeof n==`string`&&typeof i==`string`?t[e]=b(n,i):e===`id`&&n&&i?t.id=Mt(n,i):e===`ref`&&n&&i?t.ref=Bt(n,i):t[e]=i===void 0?n:i}}return t}const Ht=new Set([`id`]),Ut=new Set([`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-details`]),Wt=new Set([`href`,`hrefLang`,`target`,`rel`,`download`,`ping`,`referrerPolicy`]),Gt=new Set([`dir`,`lang`,`hidden`,`inert`,`translate`]),Kt=new Set(`onClick.onAuxClick.onContextMenu.onDoubleClick.onMouseDown.onMouseEnter.onMouseLeave.onMouseMove.onMouseOut.onMouseOver.onMouseUp.onTouchCancel.onTouchEnd.onTouchMove.onTouchStart.onPointerDown.onPointerMove.onPointerUp.onPointerCancel.onPointerEnter.onPointerLeave.onPointerOver.onPointerOut.onGotPointerCapture.onLostPointerCapture.onScroll.onWheel.onAnimationStart.onAnimationEnd.onAnimationIteration.onTransitionCancel.onTransitionEnd.onTransitionRun.onTransitionStart`.split(`.`)),qt=/^(data-.*)$/;function R(e,t={}){let{labelable:n,isLink:r,global:i,events:a=i,propNames:o}=t,s={};for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(Ht.has(t)||n&&Ut.has(t)||r&&Wt.has(t)||i&&Gt.has(t)||a&&(Kt.has(t)||t.endsWith(`Capture`)&&Kt.has(t.slice(0,-7)))||o?.has(t)||qt.test(t))&&(s[t]=e[t]);return s}let z=new Map,Jt=new Set;function Yt(){if(typeof window>`u`)return;function e(e){return`propertyName`in e}let t=t=>{let r=I(t);if(!e(t)||!r)return;let i=z.get(r);i||(i=new Set,z.set(r,i),r.addEventListener(`transitioncancel`,n,{once:!0})),i.add(t.propertyName)},n=t=>{let r=I(t);if(!e(t)||!r)return;let i=z.get(r);if(i&&(i.delete(t.propertyName),i.size===0&&(r.removeEventListener(`transitioncancel`,n),z.delete(r)),z.size===0)){for(let e of Jt)e();Jt.clear()}};document.body.addEventListener(`transitionrun`,t),document.body.addEventListener(`transitionend`,n)}typeof document<`u`&&(document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,Yt):Yt());function Xt(){for(let[e]of z)`isConnected`in e&&!e.isConnected&&z.delete(e)}function Zt(e){requestAnimationFrame(()=>{Xt(),z.size===0?e():Jt.add(e)})}function Qt(){let e=d(new Map),t=o((t,n,r,i)=>{let a=i?.once?(...t)=>{e.current.delete(r),r(...t)}:r;e.current.set(r,{type:n,eventTarget:t,fn:a,options:i}),t.addEventListener(n,a,i)},[]),n=o((t,n,r,i)=>{let a=e.current.get(r)?.fn||r;t.removeEventListener(n,a,i),e.current.delete(r)},[]),r=o(()=>{e.current.forEach((e,t)=>{n(e.eventTarget,e.type,t,e.options)})},[n]);return c(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function $t(e,t){let{id:n,"aria-label":r,"aria-labelledby":i}=e;return n=jt(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(` `):i&&=i.trim().split(/\s+/).join(` `),!r&&!i&&t&&(r=t),{id:n,"aria-label":r,"aria-labelledby":i}}function en(e){let t=d(null),n=d(void 0),r=o(t=>{if(typeof e==`function`){let n=e,r=n(t);return()=>{typeof r==`function`?r():n(null)}}else if(e)return e.current=t,()=>{e.current=null}},[e]);return l(()=>({get current(){return t.current},set current(e){t.current=e,n.current&&=(n.current(),void 0),e!=null&&(n.current=r(e))}}),[r])}const tn=r.useInsertionEffect??A;function B(e){let t=d(null);return tn(()=>{t.current=e},[e]),o((...e)=>{let n=t.current;return n?.(...e)},[])}function nn(e,t){A(()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref&&(e.ref.current=null)}})}function rn(e,t){if(!e)return!1;let n=window.getComputedStyle(e),r=document.scrollingElement||document.documentElement,i=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return e===r&&n.overflow!==`hidden`&&(i=!0),i&&t&&(i=e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth),i}function an(e,t){let n=e;for(rn(n,t)&&(n=n.parentElement);n&&!rn(n,t);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}const on=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function sn(e){return e instanceof HTMLInputElement&&!on.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}let V=typeof document<`u`&&window.visualViewport;function cn(){let e=Et(),[t,n]=f(()=>e?{width:0,height:0}:ln());return c(()=>{let e=e=>{n(t=>e.width===t.width&&e.height===t.height?t:e)},t=()=>{V&&V.scale>1||e(ln())},r,i=t=>{V&&V.scale>1||sn(I(t))&&(r=requestAnimationFrame(()=>{let t=F();(!t||!sn(t))&&e({width:document.documentElement.clientWidth,height:document.documentElement.clientHeight})}))};return e(ln()),at()&&window.addEventListener(`blur`,i,!0),V?V.addEventListener(`resize`,t):window.addEventListener(`resize`,t),()=>{cancelAnimationFrame(r),at()&&window.removeEventListener(`blur`,i,!0),V?V.removeEventListener(`resize`,t):window.removeEventListener(`resize`,t)}},[]),t}function ln(){return{width:V?Math.min(V.width*V.scale,document.documentElement.clientWidth):document.documentElement.clientWidth,height:V?V.height*V.scale:document.documentElement.clientHeight}}function un(e){return e.pointerType===``&&e.isTrusted?!0:ct()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function dn(e){return!ct()&&e.width===0&&e.height===0||e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`}function fn(e,t=!0){let[n,r]=f(!0),i=n&&t;return A(()=>{if(i&&e.current&&`getAnimations`in e.current)for(let t of e.current.getAnimations())t instanceof CSSTransition&&t.cancel()},[e,i]),mn(e,i,o(()=>r(!1),[])),i}function pn(e,t){let[n,r]=f(t?`open`:`closed`);switch(n){case`open`:t||r(`exiting`);break;case`closed`:case`exiting`:t&&r(`open`);break}let i=n===`exiting`;return mn(e,i,o(()=>{r(e=>e===`exiting`?`closed`:e)},[])),i}function mn(e,t,n){A(()=>{if(t&&e.current){if(!(`getAnimations`in e.current)){n();return}let t=e.current.getAnimations();if(t.length===0){n();return}let r=!1;return Promise.allSettled(t.map(e=>e.finished)).then(()=>{r||S(()=>{n()})}),()=>{r=!0}}},[e,t,n])}const hn=typeof Element<`u`&&`checkVisibility`in Element.prototype;function gn(e){let t=M(e);if(!(e instanceof t.HTMLElement)&&!(e instanceof t.SVGElement))return!1;let{display:n,visibility:r}=e.style,i=n!==`none`&&r!==`hidden`&&r!==`collapse`;if(i){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r}=t(e);i=n!==`none`&&r!==`hidden`&&r!==`collapse`}return i}function _n(e,t){return!e.hasAttribute(`hidden`)&&!e.hasAttribute(`data-react-aria-prevent-focus`)&&(e.nodeName===`DETAILS`&&t&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0)}function vn(e,t){return hn?e.checkVisibility({visibilityProperty:!0})&&!e.closest(`[data-react-aria-prevent-focus]`):e.nodeName!==`#comment`&&gn(e)&&_n(e,t)&&(!e.parentElement||vn(e.parentElement,e))}const yn=[`input:not([disabled]):not([type=hidden])`,`select:not([disabled])`,`textarea:not([disabled])`,`button:not([disabled])`,`a[href]`,`area[href]`,`summary`,`iframe`,`object`,`embed`,`audio[controls]`,`video[controls]`,`[contenteditable]:not([contenteditable^="false"])`,`permission`],bn=yn.join(`:not([hidden]),`)+`,[tabindex]:not([disabled]):not([hidden])`;yn.push(`[tabindex]:not([tabindex="-1"]):not([disabled])`);const xn=yn.join(`:not([hidden]):not([tabindex="-1"]),`);function Sn(e,t){return e.matches(bn)&&!wn(e)&&(t?.skipVisibilityCheck||vn(e))}function Cn(e){return e.matches(xn)&&vn(e)&&!wn(e)}function wn(e){let t=e;for(;t!=null;){if(t instanceof t.ownerDocument.defaultView.HTMLElement&&t.inert)return!0;t=t.parentElement}return!1}function Tn(e){return e?.defaultView?.__webpack_nonce__||globalThis.__webpack_nonce__||void 0}let En=new WeakMap;function Dn(e){let t=e??(typeof document<`u`?document:void 0);if(!t)return Tn(t);if(En.has(t))return En.get(t);let n=t.querySelector(`meta[property="csp-nonce"]`),r=n&&n instanceof M(n).HTMLMetaElement&&(n.nonce||n.content)||Tn(t)||void 0;return r!==void 0&&En.set(t,r),r}const On=Symbol(`default`);function kn({values:e,children:t}){for(let[n,i]of e)t=r.createElement(n.Provider,{value:i},t);return t}function An(e){let{className:t,style:n,children:r,defaultClassName:i,defaultChildren:a,defaultStyle:o,values:s,render:c}=e;return l(()=>{let e,l,u;return e=typeof t==`function`?t({...s,defaultClassName:i}):t,l=typeof n==`function`?n({...s,defaultStyle:o||{}}):n,u=typeof r==`function`?r({...s,defaultChildren:a}):r??a,{className:e??i,style:l||o?{...o,...l}:void 0,children:u??a,"data-rac":``,render:c?e=>c(e,s):void 0}},[t,n,r,i,a,o,s,c])}function jn(e,t){return n=>t(typeof e==`function`?e(n):e,n)}function Mn(e,t){let n=s(e);if(t===null)return null;if(n&&typeof n==`object`&&`slots`in n&&n.slots){let e=t||On;if(!n.slots[e]){let e=new Intl.ListFormat().format(Object.keys(n.slots).map(e=>`"${e}"`)),r=t?`Invalid slot "${t}".`:`A slot prop is required.`;throw Error(`${r} Valid slot names are ${e}.`)}return n.slots[e]}return n}function Nn(e,t,n){let{ref:r,...i}=Mn(n,e.slot)||{},a=en(l(()=>Bt(t,r),[t,r])),o=L(i,e);return`style`in i&&i.style&&`style`in e&&e.style&&(typeof i.style==`function`||typeof e.style==`function`?o.style=t=>{let n=typeof i.style==`function`?i.style(t):i.style,r={...t.defaultStyle,...n},a=typeof e.style==`function`?e.style({...t,defaultStyle:r}):e.style;return{...r,...a}}:o.style={...i.style,...e.style}),[o,a]}function Pn(e=!0){let[t,n]=f(e),r=d(!1),i=o(e=>{r.current=!0,n(!!e)},[]);return A(()=>{r.current||n(!1)},[]),[i,t]}function Fn(e){let t=/^(data-.*)$/,n={};for(let r in e)t.test(r)||(n[r]=e[r]);return n}function In(e,t,n){let{render:i,...a}=t,o=d(null),s=l(()=>Bt(n,o),[n,o]);A(()=>{},[e,i]);let c={...a,ref:s};return i?i(c,void 0):r.createElement(e,c)}const Ln={},Rn=new Proxy({},{get(e,t){if(typeof t!=`string`)return;let n=Ln[t];return n||(n=a(In.bind(null,t)),Ln[t]=n),n}}),zn=typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype;function Bn(e){return e.dataset.liveAnnouncer===`true`||e.dataset.reactAriaTopLayer!==void 0}let Vn=new WeakMap,H=[];function Hn(e,t){let n=M(e?.[0]),r=t instanceof n.Element?{root:t}:t,i=r?.root??document.body,a=r?.shouldUseInert&&zn,o=new Set(e),s=new Set,c=e=>a&&e instanceof n.HTMLElement?e.inert:e.getAttribute(`aria-hidden`)===`true`,l=(e,t)=>{a&&e instanceof n.HTMLElement?e.inert=t:t?e.setAttribute(`aria-hidden`,`true`):(e.removeAttribute(`aria-hidden`),e instanceof n.HTMLElement&&(e.inert=!1))},u=new Set;if(N())for(let t of e){let e=t;for(;e&&e!==i;){let t=e.getRootNode();`shadowRoot`in t&&u.add(t.shadowRoot),e=t.parentNode}}let d=e=>{for(let t of e.querySelectorAll(`[data-live-announcer], [data-react-aria-top-layer]`))o.add(t);let t=e=>{if(s.has(e)||o.has(e)||e.parentElement&&s.has(e.parentElement)&&e.parentElement.getAttribute(`role`)!==`row`)return NodeFilter.FILTER_REJECT;for(let t of o)if(P(e,t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},n=zt(j(e),e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),r=t(e);if(r===NodeFilter.FILTER_ACCEPT&&f(e),r!==NodeFilter.FILTER_REJECT){let e=n.nextNode();for(;e!=null;)f(e),e=n.nextNode()}},f=e=>{let t=Vn.get(e)??0;c(e)&&t===0||(t===0&&l(e,!0),s.add(e),Vn.set(e,t+1))};H.length&&H[H.length-1].disconnect(),d(i);let p=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`){if(t.target.isConnected&&![...o,...s].some(e=>P(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&Bn(e)?o.add(e):e instanceof Element&&d(e);if(N()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});p.observe(i,{childList:!0,subtree:!0});let m=new Set;if(N())for(let e of u){let t=new MutationObserver(e=>{for(let t of e)if(t.type===`childList`){if(t.target.isConnected&&![...o,...s].some(e=>P(e,t.target)))for(let e of t.addedNodes)(e instanceof HTMLElement||e instanceof SVGElement)&&Bn(e)?o.add(e):e instanceof Element&&d(e);if(N()){for(let e of u)if(!e.isConnected){p.disconnect();break}}}});t.observe(e,{childList:!0,subtree:!0}),m.add(t)}let h={visibleNodes:o,hiddenNodes:s,observe(){p.observe(i,{childList:!0,subtree:!0})},disconnect(){p.disconnect()}};return H.push(h),()=>{if(p.disconnect(),N())for(let e of m)e.disconnect();for(let e of s){let t=Vn.get(e);t!=null&&(t===1?(l(e,!1),Vn.delete(e)):Vn.set(e,t-1))}h===H[H.length-1]?(H.pop(),H.length&&H[H.length-1].observe()):H.splice(H.indexOf(h),1)}}const Un=new Set([`Arab`,`Syrc`,`Samr`,`Mand`,`Thaa`,`Mend`,`Nkoo`,`Adlm`,`Rohg`,`Hebr`]),Wn=new Set([`ae`,`ar`,`arc`,`bcc`,`bqi`,`ckb`,`dv`,`fa`,`glk`,`he`,`ku`,`mzn`,`nqo`,`pnb`,`ps`,`sd`,`ug`,`ur`,`yi`]);function Gn(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),n=typeof t.getTextInfo==`function`?t.getTextInfo():t.textInfo;if(n)return n.direction===`rtl`;if(t.script)return Un.has(t.script)}let t=e.split(`-`)[0];return Wn.has(t)}const Kn=Symbol.for(`react-aria.i18n.locale`);function qn(){let e=typeof window<`u`&&window[Kn]||typeof navigator<`u`&&(navigator.language||navigator.userLanguage)||`en-US`;try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e=`en-US`}return{locale:e,direction:Gn(e)?`rtl`:`ltr`}}let Jn=qn(),Yn=new Set;function Xn(){Jn=qn();for(let e of Yn)e(Jn)}function Zn(){let e=Et(),[t,n]=f(Jn);return c(()=>(Yn.size===0&&window.addEventListener(`languagechange`,Xn),Yn.add(n),()=>{Yn.delete(n),Yn.size===0&&window.removeEventListener(`languagechange`,Xn)}),[]),e?{locale:typeof window<`u`&&window[Kn]||`en-US`,direction:`ltr`}:t}const Qn=r.createContext(null);function $n(){let e=Zn();return s(Qn)||e}const er=Symbol.for(`react-aria.i18n.locale`),tr=Symbol.for(`react-aria.i18n.strings`);let nr;var rr=class e{constructor(e,t=`en-US`){this.strings=Object.fromEntries(Object.entries(e).filter(([,e])=>e)),this.defaultLocale=t}getStringForLocale(e,t){let n=this.getStringsForLocale(t)[e];if(!n)throw Error(`Could not find intl message ${e} in ${t} locale`);return n}getStringsForLocale(e){let t=this.strings[e];return t||(t=ir(e,this.strings,this.defaultLocale),this.strings[e]=t),t}static getGlobalDictionaryForPackage(t){if(typeof window>`u`)return null;let n=window[er];if(nr===void 0){let t=window[tr];if(!t)return null;nr={};for(let r in t)nr[r]=new e({[n]:t[r]},n)}let r=nr?.[t];if(!r)throw Error(`Strings for package "${t}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}};function ir(e,t,n=`en-US`){if(t[e])return t[e];let r=ar(e);if(t[r])return t[r];for(let e in t)if(e.startsWith(r+`-`))return t[e];return t[n]}function ar(e){return Intl.Locale?new Intl.Locale(e).language:e.split(`-`)[0]}const or=new Map,sr=new Map;var cr=class{constructor(e,t){this.locale=e,this.strings=t}format(e,t){let n=this.strings.getStringForLocale(e,this.locale);return typeof n==`function`?n(t,this):n}plural(e,t,n=`cardinal`){let r=t[`=`+e];if(r)return typeof r==`function`?r():r;let i=this.locale+`:`+n,a=or.get(i);return a||(a=new Intl.PluralRules(this.locale,{type:n}),or.set(i,a)),r=t[a.select(e)]||t.other,typeof r==`function`?r():r}number(e){let t=sr.get(this.locale);return t||(t=new Intl.NumberFormat(this.locale),sr.set(this.locale,t)),t.format(e)}select(e,t){let n=e[t]||e.other;return typeof n==`function`?n():n}};const lr=new WeakMap;function ur(e){let t=lr.get(e);return t||(t=new rr(e),lr.set(e,t)),t}function dr(e,t){return t&&rr.getGlobalDictionaryForPackage(t)||ur(e)}function fr(e,t){let{locale:n}=$n(),r=dr(e,t);return l(()=>new cr(n,r),[n,r])}function pr(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function mr(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function hr(e){let t=d({isFocused:!1,observer:null});return A(()=>{let e=t.current;return()=>{e.observer&&=(e.observer.disconnect(),null)}},[]),o(n=>{let r=I(n);if(r instanceof HTMLButtonElement||r instanceof HTMLInputElement||r instanceof HTMLTextAreaElement||r instanceof HTMLSelectElement){t.current.isFocused=!0;let n=r;n.addEventListener(`focusout`,r=>{if(t.current.isFocused=!1,n.disabled){let t=pr(r);e?.(t)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)},{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&n.disabled){t.current.observer?.disconnect();let e=n===F()?null:F();n.dispatchEvent(new FocusEvent(`blur`,{relatedTarget:e})),n.dispatchEvent(new FocusEvent(`focusout`,{bubbles:!0,relatedTarget:e}))}}),t.current.observer.observe(n,{attributes:!0,attributeFilter:[`disabled`]})}},[e])}let gr=!1;function _r(e){for(;e&&!Sn(e,{skipVisibilityCheck:!0});)e=e.parentElement;let t=M(e),n=t.document.activeElement;if(!n||n===e)return;gr=!0;let r=!1,i=e=>{(I(e)===n||r)&&e.stopImmediatePropagation()},a=t=>{(I(t)===n||r)&&(t.stopImmediatePropagation(),!e&&!r&&(r=!0,ut(n),c()))},o=t=>{(I(t)===e||r)&&t.stopImmediatePropagation()},s=t=>{(I(t)===e||r)&&(t.stopImmediatePropagation(),r||(r=!0,ut(n),c()))};t.addEventListener(`blur`,i,!0),t.addEventListener(`focusout`,a,!0),t.addEventListener(`focusin`,s,!0),t.addEventListener(`focus`,o,!0);let c=()=>{cancelAnimationFrame(l),t.removeEventListener(`blur`,i,!0),t.removeEventListener(`focusout`,a,!0),t.removeEventListener(`focusin`,s,!0),t.removeEventListener(`focus`,o,!0),gr=!1,r=!1},l=requestAnimationFrame(c);return c}let vr=`default`,yr=``,br=new WeakMap;function xr(e){if(at()){if(vr==="default"){let t=j(e);yr=t.documentElement.style.webkitUserSelect,t.documentElement.style.webkitUserSelect=`none`}vr=`disabled`}else if(e instanceof HTMLElement||e instanceof SVGElement){let t=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;br.set(e,e.style[t]),e.style[t]=`none`}}function Sr(e){if(at()){if(vr!==`disabled`)return;vr=`restoring`,setTimeout(()=>{Zt(()=>{if(vr===`restoring`){let t=j(e);t.documentElement.style.webkitUserSelect===`none`&&(t.documentElement.style.webkitUserSelect=yr||``),yr=``,vr=`default`}})},300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&br.has(e)){let t=br.get(e),n=`userSelect`in e.style?`userSelect`:`webkitUserSelect`;e.style[n]===`none`&&(e.style[n]=t),e.getAttribute(`style`)===``&&e.removeAttribute(`style`),br.delete(e)}}const Cr=r.createContext({register:()=>{}});Cr.displayName=`PressResponderContext`;function wr(e){let t=s(Cr);if(t){let{register:n,ref:r,...i}=t;e=L(i,e),n()}return nn(t,e.ref),e}var Tr=class{#e;constructor(e,t,n,r){this.#e=!0;let i=(r?.target??n.currentTarget)?.getBoundingClientRect(),a,o=0,s,c=null;n.clientX!=null&&n.clientY!=null&&(s=n.clientX,c=n.clientY),i&&(s!=null&&c!=null?(a=s-i.left,o=c-i.top):(a=i.width/2,o=i.height/2)),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey,this.x=a,this.y=o,this.key=n.key}continuePropagation(){this.#e=!1}get shouldStopPropagation(){return this.#e}};const Er=Symbol(`linkClicked`),Dr=`react-aria-pressable-style`,Or=`data-react-aria-pressable`;function kr(e){let{onPress:t,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:a,onClick:s,isDisabled:u,isPressed:p,preventFocusOnPress:m,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:g,ref:_,...v}=wr(e),[y,b]=f(!1),x=d({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:S,removeAllGlobalListeners:C}=Qt(),w=o((e,t)=>{let i=x.current;if(u||i.didFirePressStart)return!1;let a=!0;if(i.isTriggeringEvent=!0,r){let n=new Tr(`pressstart`,t,e);r(n),a=n.shouldStopPropagation}return n&&n(!0),i.isTriggeringEvent=!1,i.didFirePressStart=!0,b(!0),a},[u,r,n]),ee=o((e,r,a=!0)=>{let o=x.current;if(!o.didFirePressStart)return!1;o.didFirePressStart=!1,o.isTriggeringEvent=!0;let s=!0;if(i){let t=new Tr(`pressend`,r,e);i(t),s=t.shouldStopPropagation}if(n&&n(!1),b(!1),t&&a&&!u){let n=new Tr(`press`,r,e);t(n),s&&=n.shouldStopPropagation}return o.isTriggeringEvent=!1,s},[u,i,n,t]),T=B(ee),E=B(o((e,t)=>{let n=x.current;if(u)return!1;if(a){n.isTriggeringEvent=!0;let r=new Tr(`pressup`,t,e);return a(r),n.isTriggeringEvent=!1,r.shouldStopPropagation}return!0},[u,a])),te=o(e=>{let t=x.current;if(t.isPressed&&t.target){t.didFirePressStart&&t.pointerType!=null&&ee(U(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,C(),g||Sr(t.target);for(let e of t.disposables)e();t.disposables=[]}},[g,C,ee]),ne=B(te),re=o(e=>{h&&te(e)},[h,te]),ie=o(e=>{u||s?.(e)},[u,s]),ae=o((e,t)=>{if(!u&&s){let n=new MouseEvent(`click`,e);mr(n,t),s(pr(n))}},[u,s]),D=l(()=>{let e=x.current,t={onKeyDown(t){if(jr(t.nativeEvent,t.currentTarget)&&P(t.currentTarget,I(t))){Nr(I(t),t.key)&&t.preventDefault();let r=!0;!e.isPressed&&!t.repeat&&(e.target=t.currentTarget,e.isPressed=!0,e.pointerType=`keyboard`,r=w(t,`keyboard`));let i=t.currentTarget;S(j(t.currentTarget),`keyup`,Pt(t=>{jr(t,i)&&!t.repeat&&P(i,I(t))&&e.target&&E(U(e.target,t),`keyboard`)},n),!0),r&&t.stopPropagation(),t.metaKey&&nt()&&e.metaKeyEvents?.set(t.key,t.nativeEvent)}else t.key===`Meta`&&(e.metaKeyEvents=new Map)},onClick(t){if(!(t&&!P(t.currentTarget,I(t)))&&t&&t.button===0&&!e.isTriggeringEvent&&!k.isOpening){let n=!0;if(u&&t.preventDefault(),!e.ignoreEmulatedMouseEvents&&!e.isPressed&&(e.pointerType===`virtual`||un(t.nativeEvent))){let e=w(t,`virtual`),r=E(t,`virtual`),i=T(t,`virtual`);ie(t),n=e&&r&&i}else if(e.isPressed&&e.pointerType!==`keyboard`){let r=e.pointerType||t.nativeEvent.pointerType||`virtual`,i=E(U(t.currentTarget,t),r),a=T(U(t.currentTarget,t),r,!0);n=i&&a,e.isOverTarget=!1,ie(t),ne(t)}e.ignoreEmulatedMouseEvents=!1,n&&t.stopPropagation()}}},n=t=>{if(e.isPressed&&e.target&&jr(t,e.target)){Nr(I(t),t.key)&&t.preventDefault();let n=I(t),r=P(e.target,n);T(U(e.target,t),`keyboard`,r),r&&ae(t,e.target),C(),t.key!==`Enter`&&Ar(e.target)&&P(e.target,n)&&!t[Er]&&(t[Er]=!0,k(e.target,t,!1)),e.isPressed=!1,e.metaKeyEvents?.delete(t.key)}else if(t.key===`Meta`&&e.metaKeyEvents?.size){let t=e.metaKeyEvents;e.metaKeyEvents=void 0;for(let n of t.values())e.target?.dispatchEvent(new KeyboardEvent(`keyup`,n))}};if(typeof PointerEvent<`u`){t.onPointerDown=t=>{if(t.button!==0||!P(t.currentTarget,I(t)))return;if(dn(t.nativeEvent)){e.pointerType=`virtual`;return}e.pointerType=t.pointerType;let i=!0;if(!e.isPressed){e.isPressed=!0,e.isOverTarget=!0,e.activePointerId=t.pointerId,e.target=t.currentTarget,g||xr(e.target),i=w(t,e.pointerType);let a=I(t);`releasePointerCapture`in a&&(`hasPointerCapture`in a?a.hasPointerCapture(t.pointerId)&&a.releasePointerCapture(t.pointerId):a.releasePointerCapture(t.pointerId)),S(j(t.currentTarget),`pointerup`,n,!1),S(j(t.currentTarget),`pointercancel`,r,!1)}i&&t.stopPropagation()},t.onMouseDown=t=>{if(P(t.currentTarget,I(t))&&t.button===0){if(m){let n=_r(t.target);n&&e.disposables.push(n)}t.stopPropagation()}},t.onPointerUp=t=>{!P(t.currentTarget,I(t))||e.pointerType===`virtual`||t.button===0&&!e.isPressed&&E(t,e.pointerType||t.pointerType)},t.onPointerEnter=t=>{t.pointerId===e.activePointerId&&e.target&&!e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!0,w(U(e.target,t),e.pointerType))},t.onPointerLeave=t=>{t.pointerId===e.activePointerId&&e.target&&e.isOverTarget&&e.pointerType!=null&&(e.isOverTarget=!1,T(U(e.target,t),e.pointerType,!1),re(t))};let n=t=>{if(t.pointerId===e.activePointerId&&e.isPressed&&t.button===0&&e.target){if(P(e.target,I(t))&&e.pointerType!=null){let n=!1,r=setTimeout(()=>{e.isPressed&&e.target instanceof HTMLElement&&(n?ne(t):(ut(e.target),e.target.click()))},80);S(t.currentTarget,`click`,()=>n=!0,!0),e.disposables.push(()=>clearTimeout(r))}else ne(t);e.isOverTarget=!1}},r=e=>{ne(e)};t.onDragStart=e=>{P(e.currentTarget,I(e))&&ne(e)}}return t},[S,u,m,C,g,re,w,ie,ae]);return c(()=>{if(!_)return;let e=j(_.current);if(!e||!e.head||e.getElementById(Dr))return;let t=e.createElement(`style`);t.id=Dr;let n=Dn(e);n&&(t.nonce=n),t.textContent=`
|
|
2
|
+
@layer {
|
|
3
|
+
[${Or}] {
|
|
4
|
+
touch-action: pan-x pan-y pinch-zoom;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
`.trim(),e.head.prepend(t)},[_]),c(()=>{let e=x.current;return()=>{g||Sr(e.target??void 0);for(let t of e.disposables)t();e.disposables=[]}},[g]),{isPressed:p||y,pressProps:L(v,D,{[Or]:!0})}}function Ar(e){return e.tagName===`A`&&e.hasAttribute(`href`)}function jr(e,t){let{key:n,code:r}=e,i=t,a=i.getAttribute(`role`);return(n===`Enter`||n===` `||n===`Spacebar`||r===`Space`)&&!(i instanceof M(i).HTMLInputElement&&!Fr(i,n)||i instanceof M(i).HTMLTextAreaElement||i.isContentEditable)&&!((a===`link`||!a&&Ar(i))&&n!==`Enter`)}function U(e,t){let n=t.clientX,r=t.clientY;return{currentTarget:e,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,metaKey:t.metaKey,altKey:t.altKey,clientX:n,clientY:r,key:t.key}}function Mr(e){return e instanceof HTMLInputElement?!1:e instanceof HTMLButtonElement?e.type!==`submit`&&e.type!==`reset`:!Ar(e)}function Nr(e,t){return e instanceof HTMLInputElement?!Fr(e,t):Mr(e)}const Pr=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function Fr(e,t){return e.type===`checkbox`||e.type===`radio`?t===` `:Pr.has(e.type)}let W=null;const Ir=new Set;let Lr=new Map,G=!1,Rr=!1;const zr={Tab:!0,Escape:!0};function Br(e,t){for(let n of Ir)n(e,t)}function Vr(e){return!(e.metaKey||!nt()&&e.altKey||e.ctrlKey||e.key===`Control`||e.key===`Shift`||e.key===`Meta`)}function Hr(e){G=!0,!k.isOpening&&Vr(e)&&(W=`keyboard`,Br(`keyboard`,e))}function Ur(e){W=`pointer`,`pointerType`in e&&e.pointerType,(e.type===`mousedown`||e.type===`pointerdown`)&&(G=!0,Br(`pointer`,e))}function Wr(e){!k.isOpening&&un(e)&&(G=!0,W=`virtual`)}function Gr(e){let t=M(I(e)),n=j(I(e));I(e)===t||I(e)===n||gr||!e.isTrusted||(!G&&!Rr&&(W=`virtual`,Br(`virtual`,e)),G=!1,Rr=!1)}function Kr(){gr||(G=!1,Rr=!0)}function qr(e){if(typeof window>`u`||typeof document>`u`)return;let t=M(e),n=j(e);if(Lr.get(t))return;let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){G=!0,r.apply(this,arguments)},n.addEventListener(`keydown`,Hr,!0),n.addEventListener(`keyup`,Hr,!0),n.addEventListener(`click`,Wr,!0),t.addEventListener(`focus`,Gr,!0),t.addEventListener(`blur`,Kr,!1),typeof PointerEvent<`u`&&(n.addEventListener(`pointerdown`,Ur,!0),n.addEventListener(`pointermove`,Ur,!0),n.addEventListener(`pointerup`,Ur,!0)),t.addEventListener(`beforeunload`,()=>{Jr(e)},{once:!0}),Lr.set(t,{focus:r})}const Jr=(e,t)=>{let n=M(e),r=j(e);t&&r.removeEventListener(`DOMContentLoaded`,t),Lr.has(n)&&(n.HTMLElement.prototype.focus=Lr.get(n).focus,r.removeEventListener(`keydown`,Hr,!0),r.removeEventListener(`keyup`,Hr,!0),r.removeEventListener(`click`,Wr,!0),n.removeEventListener(`focus`,Gr,!0),n.removeEventListener(`blur`,Kr,!1),typeof PointerEvent<`u`&&(r.removeEventListener(`pointerdown`,Ur,!0),r.removeEventListener(`pointermove`,Ur,!0),r.removeEventListener(`pointerup`,Ur,!0)),Lr.delete(n))};function Yr(e){let t=j(e),n;return t.readyState===`loading`?(n=()=>{qr(e)},t.addEventListener(`DOMContentLoaded`,n)):qr(e),()=>Jr(e,n)}typeof document<`u`&&Yr();function Xr(){return W!==`pointer`}function Zr(){return W}function Qr(e){W=e,Br(e,null)}const $r=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]);function ei(e,t,n){let r=n?I(n):void 0,i=j(r),a=M(r),o=a===void 0?HTMLInputElement:a.HTMLInputElement,s=a===void 0?HTMLTextAreaElement:a.HTMLTextAreaElement,c=a===void 0?HTMLElement:a.HTMLElement,l=a===void 0?KeyboardEvent:a.KeyboardEvent,u=F(i);return e=e||u instanceof o&&!$r.has(u.type)||u instanceof s||u instanceof c&&u.isContentEditable,!(e&&t===`keyboard`&&n instanceof l&&!zr[n.key])}function ti(e,t,n){qr(),c(()=>{if(n?.enabled===!1)return;let t=(t,r)=>{ei(!!n?.isTextInput,t,r)&&e(Xr())};return Ir.add(t),()=>{Ir.delete(t)}},t)}function ni(e){if(!e.isConnected)return;let t=j(e);if(Zr()===`virtual`){let n=F(t);Zt(()=>{let r=F(t);(r===n||r===t.body)&&e.isConnected&&ut(e)})}else ut(e)}const ri=r.createContext(null),ii=`react-aria-focus-scope-restore`;let K=null;function ai(e){let{children:t,contain:n,restoreFocus:i,autoFocus:a}=e,o=d(null),u=d(null),f=d([]),{parentNode:p}=s(ri)||{},m=l(()=>new Si({scopeRef:f}),[f]);A(()=>{let e=p||Q.root;if(Q.getTreeNode(e.scopeRef)&&K&&!pi(K,e.scopeRef)){let t=Q.getTreeNode(K);t&&(e=t)}e.addChild(m),Q.addNode(m)},[m,p]),A(()=>{let e=Q.getTreeNode(f);e&&(e.contain=!!n)},[n]),A(()=>{let e=o.current?.nextSibling,t=[],n=e=>e.stopPropagation();for(;e&&e!==u.current;)t.push(e),e.addEventListener(ii,n),e=e.nextSibling;return f.current=t,()=>{for(let e of t)e.removeEventListener(ii,n)}},[t]),_i(f,i,n),ui(f,n),yi(f,i,n),gi(f,a),c(()=>{let e=F(j(f.current?f.current[0]:void 0)),t=null;if(J(e,f.current)){for(let n of Q.traverse())n.scopeRef&&J(e,n.scopeRef.current)&&(t=n);t===Q.getTreeNode(f)&&(K=t.scopeRef)}},[f]),A(()=>()=>{let e=Q.getTreeNode(f)?.parent?.scopeRef??null;(f===K||pi(f,K))&&(!e||Q.getTreeNode(e))&&(K=e),Q.removeTreeNode(f)},[f]);let h=l(()=>oi(f),[]),g=l(()=>({focusManager:h,parentNode:m}),[m,h]);return r.createElement(ri.Provider,{value:g},r.createElement(`span`,{"data-focus-scope-start":!0,hidden:!0,ref:o}),t,r.createElement(`span`,{"data-focus-scope-end":!0,hidden:!0,ref:u}))}function oi(e){return{focusNext(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||F(j(n[0]??void 0)),c=n[0].previousElementSibling,l=Z(q(n),{tabbable:i,accept:o},n);l.currentNode=J(s,n)?s:c;let u=l.nextNode();return!u&&a&&(l.currentNode=c,u=l.nextNode()),u&&X(u,!0),u},focusPrevious(t={}){let n=e.current,{from:r,tabbable:i,wrap:a,accept:o}=t,s=r||F(j(n[0]??void 0)),c=n[n.length-1].nextElementSibling,l=Z(q(n),{tabbable:i,accept:o},n);l.currentNode=J(s,n)?s:c;let u=l.previousNode();return!u&&a&&(l.currentNode=c,u=l.previousNode()),u&&X(u,!0),u},focusFirst(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Z(q(n),{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let o=a.nextNode();return o&&X(o,!0),o},focusLast(t={}){let n=e.current,{tabbable:r,accept:i}=t,a=Z(q(n),{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let o=a.previousNode();return o&&X(o,!0),o}}}function q(e){return e[0].parentElement}function si(e){let t=Q.getTreeNode(K);for(;t&&t.scopeRef!==e;){if(t.contain)return!1;t=t.parent}return!0}function ci(e){if(!e.form)return Array.from(j(e).querySelectorAll(`input[type="radio"][name="${CSS.escape(e.name)}"]`)).filter(e=>!e.form);let t=e.form.elements.namedItem(e.name),n=M(e);return t instanceof n.RadioNodeList?Array.from(t).filter(e=>e instanceof n.HTMLInputElement):t instanceof n.HTMLInputElement?[t]:[]}function li(e){if(e.checked)return!0;let t=ci(e);return t.length>0&&!t.some(e=>e.checked)}function ui(e,t){let n=d(void 0),r=d(void 0);A(()=>{let i=e.current;if(!t){r.current&&=(cancelAnimationFrame(r.current),void 0);return}let a=j(i?i[0]:void 0),o=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!si(e)||t.isComposing)return;let n=F(a),r=e.current;if(!r||!J(n,r))return;let i=Z(q(r),{tabbable:!0},r);if(!n)return;i.currentNode=n;let o=t.shiftKey?i.previousNode():i.nextNode();o||=(i.currentNode=t.shiftKey?r[r.length-1].nextElementSibling:r[0].previousElementSibling,t.shiftKey?i.previousNode():i.nextNode()),t.preventDefault(),o&&(X(o,!0),o instanceof M(o).HTMLInputElement&&o.select())},s=t=>{(!K||pi(K,e))&&J(I(t),e.current)?(K=e,n.current=I(t)):si(e)&&!Y(I(t),e)?n.current?n.current.focus():K&&K.current&&hi(K.current):si(e)&&(n.current=I(t))},c=t=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let r=Zr(),i=(r===`virtual`||r===null)&&ct()&&st(),o=F(a);if(!i&&o&&si(e)&&!Y(o,e)){K=e;let r=I(t);r&&r.isConnected?(n.current=r,n.current?.focus()):K.current&&hi(K.current)}})};return a.addEventListener(`keydown`,o,!1),a.addEventListener(`focusin`,s,!1),i?.forEach(e=>e.addEventListener(`focusin`,s,!1)),i?.forEach(e=>e.addEventListener(`focusout`,c,!1)),()=>{a.removeEventListener(`keydown`,o,!1),a.removeEventListener(`focusin`,s,!1),i?.forEach(e=>e.removeEventListener(`focusin`,s,!1)),i?.forEach(e=>e.removeEventListener(`focusout`,c,!1))}},[e,t]),A(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function di(e){return Y(e)}function J(e,t){return!e||!t?!1:t.some(t=>P(t,e))}function Y(e,t=null){if(e instanceof Element&&e.closest(`[data-react-aria-top-layer]`))return!0;for(let{scopeRef:n}of Q.traverse(Q.getTreeNode(t)))if(n&&J(e,n.current))return!0;return!1}function fi(e){return Y(e,K)}function pi(e,t){let n=Q.getTreeNode(t)?.parent;for(;n;){if(n.scopeRef===e)return!0;n=n.parent}return!1}function X(e,t=!1){if(e!=null&&!t)try{ni(e)}catch{}else if(e!=null)try{e.focus()}catch{}}function mi(e,t=!0){let n=e[0].previousElementSibling,r=q(e),i=Z(r,{tabbable:t},e);i.currentNode=n;let a=i.nextNode();return t&&!a&&(r=q(e),i=Z(r,{tabbable:!1},e),i.currentNode=n,a=i.nextNode()),a}function hi(e,t=!0){X(mi(e,t))}function gi(e,t){let n=r.useRef(t);c(()=>{n.current&&(K=e,!J(F(j(e.current?e.current[0]:void 0)),K.current)&&e.current&&hi(e.current)),n.current=!1},[e])}function _i(e,t,n){A(()=>{if(t||n)return;let r=e.current,i=j(r?r[0]:void 0),a=t=>{let n=I(t);J(n,e.current)?K=e:di(n)||(K=null)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,t,n])}function vi(e){let t=Q.getTreeNode(K);for(;t&&t.scopeRef!==e;){if(t.nodeToRestore)return!1;t=t.parent}return t?.scopeRef===e}function yi(e,t,n){let r=d(typeof document<`u`?F(j(e.current?e.current[0]:void 0)):null);A(()=>{let r=e.current,i=j(r?r[0]:void 0);if(!t||n)return;let a=()=>{(!K||pi(K,e))&&J(F(i),e.current)&&(K=e)};return i.addEventListener(`focusin`,a,!1),r?.forEach(e=>e.addEventListener(`focusin`,a,!1)),()=>{i.removeEventListener(`focusin`,a,!1),r?.forEach(e=>e.removeEventListener(`focusin`,a,!1))}},[e,n]),A(()=>{let r=j(e.current?e.current[0]:void 0);if(!t)return;let i=t=>{if(t.key!==`Tab`||t.altKey||t.ctrlKey||t.metaKey||!si(e)||t.isComposing)return;let n=r.activeElement;if(!Y(n,e)||!vi(e))return;let i=Q.getTreeNode(e);if(!i)return;let a=i.nodeToRestore,o=Z(r.body,{tabbable:!0});o.currentNode=n;let s=t.shiftKey?o.previousNode():o.nextNode();if((!a||!a.isConnected||a===r.body)&&(a=void 0,i.nodeToRestore=void 0),(!s||!Y(s,e))&&a){o.currentNode=a;do s=t.shiftKey?o.previousNode():o.nextNode();while(Y(s,e));t.preventDefault(),t.stopPropagation(),s?X(s,!0):di(a)?X(a,!0):n.blur()}};return n||r.addEventListener(`keydown`,i,!0),()=>{n||r.removeEventListener(`keydown`,i,!0)}},[e,t,n]),A(()=>{let n=j(e.current?e.current[0]:void 0);if(!t)return;let i=Q.getTreeNode(e);if(i)return i.nodeToRestore=r.current??void 0,()=>{let r=Q.getTreeNode(e);if(!r)return;let i=r.nodeToRestore,a=F(n);if(t&&i&&(a&&Y(a,e)||a===n.body&&vi(e))){let t=Q.clone();requestAnimationFrame(()=>{if(n.activeElement===n.body){let n=t.getTreeNode(e);for(;n;){if(n.nodeToRestore&&n.nodeToRestore.isConnected){bi(n.nodeToRestore);return}n=n.parent}for(n=t.getTreeNode(e);n;){if(n.scopeRef&&n.scopeRef.current&&Q.getTreeNode(n.scopeRef)){bi(mi(n.scopeRef.current,!0));return}n=n.parent}}})}}},[e,t])}function bi(e){e.dispatchEvent(new CustomEvent(ii,{bubbles:!0,cancelable:!0}))&&X(e)}function Z(e,t,n){let r=t?.tabbable?Cn:Sn,i=j(e?.nodeType===Node.ELEMENT_NODE?e:null),a=zt(i,e||i,NodeFilter.SHOW_ELEMENT,{acceptNode(e){return P(t?.from,e)||t?.tabbable&&e.tagName===`INPUT`&&e.getAttribute(`type`)===`radio`&&(!li(e)||a.currentNode.tagName===`INPUT`&&a.currentNode.type===`radio`&&a.currentNode.name===e.name)?NodeFilter.FILTER_REJECT:r(e)&&(!n||J(e,n))&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(a.currentNode=t.from),a}var xi=class e{constructor(){this.fastMap=new Map,this.root=new Si({scopeRef:null}),this.fastMap.set(null,this.root)}get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,t,n){let r=this.fastMap.get(t??null);if(!r)return;let i=new Si({scopeRef:e});r.addChild(i),i.parent=r,this.fastMap.set(e,i),n&&(i.nodeToRestore=n)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let t=this.fastMap.get(e);if(!t)return;let n=t.parent;for(let e of this.traverse())e!==t&&t.nodeToRestore&&e.nodeToRestore&&t.scopeRef&&t.scopeRef.current&&J(e.nodeToRestore,t.scopeRef.current)&&(e.nodeToRestore=t.nodeToRestore);let r=t.children;n&&(n.removeChild(t),r.size>0&&r.forEach(e=>n&&n.addChild(e))),this.fastMap.delete(t.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let t of e.children)yield*this.traverse(t)}clone(){let t=new e;for(let e of this.traverse())t.addTreeNode(e.scopeRef,e.parent?.scopeRef??null,e.nodeToRestore);return t}},Si=class{constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}};let Q=new xi;function Ci(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:i}=e,a=o(e=>{if(I(e)===e.currentTarget)return r&&r(e),i&&i(!1),!0},[r,i]),s=hr(a),c=o(e=>{let t=I(e),r=j(t),a=r?F(r):F();t===e.currentTarget&&t===a&&(n&&n(e),i&&i(!0),s(e))},[i,n,s]);return{focusProps:{onFocus:!t&&(n||i||r)?c:void 0,onBlur:!t&&(r||i)?a:void 0}}}function wi(e){if(!e)return;let t=!0;return n=>{e({...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){t=!0},continuePropagation(){t=!1},isPropagationStopped(){return t}}),t&&n.stopPropagation()}}function Ti(e){return{keyboardProps:e.isDisabled?{}:{onKeyDown:wi(e.onKeyDown),onKeyUp:wi(e.onKeyUp)}}}let Ei=r.createContext(null);function Di(e){let t=s(Ei)||{};nn(t,e);let{ref:n,...r}=t;return r}function Oi(e,t){let{focusProps:n}=Ci(e),{keyboardProps:r}=Ti(e),i=L(n,r),a=Di(t),o=e.isDisabled?{}:a,s=d(e.autoFocus);c(()=>{s.current&&t.current&&ni(t.current),s.current=!1},[t]);let l=e.excludeFromTabOrder?-1:0;return e.isDisabled&&(l=void 0),{focusableProps:L({...i,tabIndex:l},o)}}const ki=typeof document<`u`?r.useInsertionEffect??r.useLayoutEffect:()=>{};function Ai(e,t,n){let[r,i]=f(e||t),a=d(r),s=d(e!==void 0),l=e!==void 0;c(()=>{s.current,s.current=l},[l]);let p=l?e:r;ki(()=>{a.current=p});let[,m]=u(()=>({}),{});return[p,o((e,...t)=>{let r=typeof e==`function`?e(a.current):e;Object.is(a.current,r)||(a.current=r,i(r),m(),n?.(r,...t))},[n])]}function ji(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=e,a=d({isFocusWithin:!1}),{addGlobalListener:s,removeAllGlobalListeners:c}=Qt(),l=o(e=>{P(e.currentTarget,I(e))&&a.current.isFocusWithin&&!P(e.currentTarget,e.relatedTarget)&&(a.current.isFocusWithin=!1,c(),n&&n(e),i&&i(!1))},[n,i,a,c]),u=hr(l),f=o(e=>{if(!P(e.currentTarget,I(e)))return;let t=I(e),n=j(t),o=F(n);if(!a.current.isFocusWithin&&o===t){r&&r(e),i&&i(!0),a.current.isFocusWithin=!0,u(e);let t=e.currentTarget;s(n,`focus`,e=>{let r=I(e);if(a.current.isFocusWithin&&!P(t,r)){let e=new n.defaultView.FocusEvent(`blur`,{relatedTarget:r});mr(e,t),l(pr(e))}},{capture:!0})}},[r,i,u,s,l]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:f,onBlur:l}}}function Mi(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,i=d({isFocused:!1,isFocusVisible:t||Xr()}),[a,s]=f(!1),[c,l]=f(()=>i.current.isFocused&&i.current.isFocusVisible),u=o(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),p=o(e=>{i.current.isFocused=e,i.current.isFocusVisible=Xr(),s(e),u()},[u]);ti(e=>{i.current.isFocusVisible=e,u()},[n,a],{enabled:a,isTextInput:n});let{focusProps:m}=Ci({isDisabled:r,onFocusChange:p}),{focusWithinProps:h}=ji({isDisabled:!r,onFocusWithinChange:p});return{isFocused:a,isFocusVisible:c,focusProps:r?h:m}}function Ni({children:e}){let t=l(()=>({register:()=>{}}),[]);return r.createElement(Cr.Provider,{value:t},e)}let Pi=!1,Fi=0;function Ii(){Pi=!0,setTimeout(()=>{Pi=!1},500)}function Li(e){e.pointerType===`touch`&&Ii()}function Ri(){let e=j(null);if(e!==void 0)return Fi===0&&typeof PointerEvent<`u`&&e.addEventListener(`pointerup`,Li),Fi++,()=>{Fi--,!(Fi>0)&&typeof PointerEvent<`u`&&e.removeEventListener(`pointerup`,Li)}}function zi(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:i}=e,[a,o]=f(!1),s=d({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:``,target:null}).current;c(Ri,[]);let{addGlobalListener:u,removeAllGlobalListeners:p}=Qt(),{hoverProps:m,triggerHoverEnd:h}=l(()=>{let e=(e,r)=>{if(s.pointerType=r,i||r===`touch`||s.isHovered||!P(e.currentTarget,I(e)))return;s.isHovered=!0;let c=e.currentTarget;s.target=c,u(j(I(e)),`pointerover`,e=>{s.isHovered&&s.target&&!P(s.target,I(e))&&a(e,e.pointerType)},{capture:!0}),t&&t({type:`hoverstart`,target:c,pointerType:r}),n&&n(!0),o(!0)},a=(e,t)=>{let i=s.target;s.pointerType=``,s.target=null,!(t===`touch`||!s.isHovered||!i)&&(s.isHovered=!1,p(),r&&r({type:`hoverend`,target:i,pointerType:t}),n&&n(!1),o(!1))},c={};return typeof PointerEvent<`u`&&(c.onPointerEnter=t=>{Pi&&t.pointerType===`mouse`||e(t,t.pointerType)},c.onPointerLeave=e=>{!i&&P(e.currentTarget,I(e))&&a(e,e.pointerType)}),{hoverProps:c,triggerHoverEnd:a}},[t,n,r,i,s,u,p]);return c(()=>{i&&h({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:m,isHovered:a}}function Bi(e){let{ref:t,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=e,a=d({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),o=B(e=>{n&&Vi(e,t)&&(i&&i(e),a.current.isPointerDown=!0)}),s=B(e=>{n&&n(e)});c(()=>{let e=a.current;if(r)return;let n=t.current,i=j(n);if(typeof PointerEvent<`u`){let n=n=>{e.isPointerDown&&Vi(n,t)&&s(n),e.isPointerDown=!1};return i.addEventListener(`pointerdown`,o,!0),i.addEventListener(`click`,n,!0),()=>{i.removeEventListener(`pointerdown`,o,!0),i.removeEventListener(`click`,n,!0)}}},[t,r])}function Vi(e,t){if(e.button>0)return!1;let n=I(e);if(n){let e=n.ownerDocument;if(!e||!P(e.documentElement,n)||n.closest(`[data-react-aria-top-layer]`))return!1}return t.current?!e.composedPath().includes(t.current):!1}typeof HTMLTemplateElement<`u`&&(Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.content.firstChild}}),Object.defineProperty(HTMLTemplateElement.prototype,"appendChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.appendChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"removeChild",{configurable:!0,enumerable:!0,value:function(e){return this.content.removeChild(e)}}),Object.defineProperty(HTMLTemplateElement.prototype,"insertBefore",{configurable:!0,enumerable:!0,value:function(e,t){return this.content.insertBefore(e,t)}}));const Hi=i(!1);function Ui(e){let t=(t,n)=>s(Hi)?null:e(t,n);return t.displayName=e.displayName||e.name,a(t)}function Wi(e,t){let{elementType:n=`button`,isDisabled:r,onPress:i,onPressStart:a,onPressEnd:o,onPressUp:s,onPressChange:c,preventFocusOnPress:l,allowFocusWhenDisabled:u,onClick:d,href:f,target:p,rel:m,type:h=`button`}=e,g;g=n===`button`?{type:h,disabled:r,form:e.form,formAction:e.formAction,formEncType:e.formEncType,formMethod:e.formMethod,formNoValidate:e.formNoValidate,formTarget:e.formTarget,name:e.name,value:e.value}:{role:`button`,href:n===`a`&&!r?f:void 0,target:n===`a`?p:void 0,type:n===`input`?h:void 0,disabled:n===`input`?r:void 0,"aria-disabled":!r||n===`input`?void 0:r,rel:n===`a`?m:void 0};let{pressProps:_,isPressed:v}=kr({onPressStart:a,onPressEnd:o,onPressChange:c,onPress:i,onPressUp:s,onClick:d,isDisabled:r,preventFocusOnPress:l,ref:t}),{focusableProps:y}=Oi(e,t);u&&(y.tabIndex=r?-1:y.tabIndex);let b=L(y,_,R(e,{labelable:!0}));return{isPressed:v,buttonProps:L(g,b,{"aria-haspopup":e[`aria-haspopup`],"aria-expanded":e[`aria-expanded`],"aria-controls":e[`aria-controls`],"aria-pressed":e[`aria-pressed`],"aria-current":e[`aria-current`],"aria-disabled":e[`aria-disabled`]})}}const Gi={border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`};function Ki(e={}){let{style:t,isFocusable:n}=e,[r,i]=f(!1),{focusWithinProps:a}=ji({isDisabled:!n,onFocusWithinChange:e=>i(e)}),o=l(()=>r?t:t?{...Gi,...t}:Gi,[r]);return{visuallyHiddenProps:{...a,style:o}}}function qi(e){let{children:t,elementType:n=`div`,isFocusable:i,style:a,...o}=e,{visuallyHiddenProps:s}=Ki(e);return r.createElement(n,L(o,s),t)}const Ji=i({});function Yi(){return s(Ji)??{}}const Xi=r.createContext(null);function Zi(e){let t=Et(),{portalContainer:n=t?null:document.body,isExiting:i}=e,[a,o]=f(!1),s=l(()=>({contain:a,setContain:o}),[a,o]),{getContainer:c}=Yi();if(!e.portalContainer&&c&&(n=c()),!n)return null;let u=e.children;return e.disableFocusManagement||(u=r.createElement(ai,{restoreFocus:!0,contain:(e.shouldContainFocus||a)&&!i},u)),u=r.createElement(Xi.Provider,{value:s},r.createElement(Ni,null,u)),x.createPortal(u,n)}function Qi(){let e=s(Xi)?.setContain;A(()=>{e?.(!0)},[e])}function $i(e,t){let{role:n=`dialog`}=e,r=Nt();r=e[`aria-label`]?void 0:r;let i=d(!1);return c(()=>{if(t.current&&!Lt(t.current)){ni(t.current);let e=setTimeout(()=>{(F()===t.current||F()===document.body)&&(i.current=!0,t.current&&(t.current.blur(),ni(t.current)),i.current=!1)},500);return()=>{clearTimeout(e)}}},[t]),Qi(),d(!1),c(()=>{}),{dialogProps:{...R(e,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":e[`aria-labelledby`]||r,onBlur:e=>{i.current&&e.stopPropagation()}},titleProps:{id:r}}}var ea={};ea={dismiss:`تجاهل`};var ta={};ta={dismiss:`Отхвърляне`};var na={};na={dismiss:`Odstranit`};var ra={};ra={dismiss:`Luk`};var ia={};ia={dismiss:`Schließen`};var aa={};aa={dismiss:`Απόρριψη`};var oa={};oa={dismiss:`Dismiss`};var sa={};sa={dismiss:`Descartar`};var ca={};ca={dismiss:`Lõpeta`};var la={};la={dismiss:`Hylkää`};var ua={};ua={dismiss:`Rejeter`};var da={};da={dismiss:`התעלם`};var fa={};fa={dismiss:`Odbaci`};var pa={};pa={dismiss:`Elutasítás`};var ma={};ma={dismiss:`Ignora`};var ha={};ha={dismiss:`閉じる`};var ga={};ga={dismiss:`무시`};var _a={};_a={dismiss:`Atmesti`};var va={};va={dismiss:`Nerādīt`};var ya={};ya={dismiss:`Lukk`};var ba={};ba={dismiss:`Negeren`};var xa={};xa={dismiss:`Zignoruj`};var Sa={};Sa={dismiss:`Descartar`};var Ca={};Ca={dismiss:`Dispensar`};var wa={};wa={dismiss:`Revocare`};var Ta={};Ta={dismiss:`Пропустить`};var Ea={};Ea={dismiss:`Zrušiť`};var Da={};Da={dismiss:`Opusti`};var Oa={};Oa={dismiss:`Odbaci`};var ka={};ka={dismiss:`Avvisa`};var Aa={};Aa={dismiss:`Kapat`};var ja={};ja={dismiss:`Скасувати`};var Ma={};Ma={dismiss:`取消`};var Na={};Na={dismiss:`關閉`};var Pa={};Pa={"ar-AE":ea,"bg-BG":ta,"cs-CZ":na,"da-DK":ra,"de-DE":ia,"el-GR":aa,"en-US":oa,"es-ES":sa,"et-EE":ca,"fi-FI":la,"fr-FR":ua,"he-IL":da,"hr-HR":fa,"hu-HU":pa,"it-IT":ma,"ja-JP":ha,"ko-KR":ga,"lt-LT":_a,"lv-LV":va,"nb-NO":ya,"nl-NL":ba,"pl-PL":xa,"pt-BR":Sa,"pt-PT":Ca,"ro-RO":wa,"ru-RU":Ta,"sk-SK":Ea,"sl-SI":Da,"sr-SP":Oa,"sv-SE":ka,"tr-TR":Aa,"uk-UA":ja,"zh-CN":Ma,"zh-TW":Na};function Fa(e){return e&&e.__esModule?e.default:e}function Ia(e){let{onDismiss:t,...n}=e,i=$t(n,fr(Fa(Pa),`@react-aria/overlays`).format(`dismiss`)),a=()=>{t&&t()};return r.createElement(qi,null,r.createElement(`button`,{...i,tabIndex:-1,onClick:a,style:{width:1,height:1}}))}const $=[];function La(e,t){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:a=!1,isKeyboardDismissDisabled:o=!1,shouldCloseOnInteractOutside:s}=e,l=d(void 0);c(()=>{if(i&&!$.includes(t))return $.push(t),()=>{let e=$.indexOf(t);e>=0&&$.splice(e,1)}},[i,t]);let u=()=>{$[$.length-1]===t&&n&&n()},f=e=>{let n=$[$.length-1];l.current=n,(!s||s(I(e)))&&n===t&&e.stopPropagation()},p=e=>{(!s||s(I(e)))&&($[$.length-1]===t&&e.stopPropagation(),l.current===t&&u()),l.current=void 0},m=e=>{e.key===`Escape`&&!o&&!e.nativeEvent.isComposing&&(e.stopPropagation(),e.preventDefault(),u())};Bi({ref:t,onInteractOutside:a&&i?p:void 0,onInteractOutsideStart:f});let{focusWithinProps:h}=ji({isDisabled:!r,onBlurWithin:e=>{!e.relatedTarget||fi(e.relatedTarget)||(!s||s(e.relatedTarget))&&n?.()}});return{overlayProps:{onKeyDown:m,...h},underlayProps:{}}}const Ra=typeof document<`u`&&window.visualViewport;let za=0,Ba;function Va(e={}){let{isDisabled:t}=e;A(()=>{if(!t)return za++,za===1&&(Ba=at()?Ua():Ha()),()=>{za--,za===0&&Ba()}},[t])}function Ha(){let e=window.innerWidth-document.documentElement.clientWidth;return Pt(e>0&&(`scrollbarGutter`in document.documentElement.style?Wa(document.documentElement,`scrollbarGutter`,`stable`):Wa(document.documentElement,`paddingRight`,`${e}px`)),Wa(document.documentElement,`overflow`,`hidden`))}function Ua(){let e=Wa(document.documentElement,`overflow`,`hidden`),t,n=!1,r=e=>{let r=I(e);t=rn(r)?r:an(r,!0),n=!1;let i=r.ownerDocument.defaultView.getSelection();i&&!i.isCollapsed&&i.containsNode(r,!0)&&(n=!0),e.composedPath().some(e=>e instanceof HTMLInputElement&&e.type===`range`)&&(n=!0),`selectionStart`in r&&`selectionEnd`in r&&r.selectionStart<r.selectionEnd&&r.ownerDocument.activeElement===r&&(n=!0)},i=document.createElement(`style`),a=Dn();a&&(i.nonce=a),i.textContent=`@layer {
|
|
8
|
+
* {
|
|
9
|
+
overscroll-behavior: contain;
|
|
10
|
+
}
|
|
11
|
+
}`,document.head.prepend(i);let o=e=>{if(!(e.touches.length===2||n)){if(!t||t===document.documentElement||t===document.body){e.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&e.preventDefault()}},s=e=>{let t=I(e),n=e.relatedTarget;n&&sn(n)?(n.focus({preventScroll:!0}),Ka(n,sn(t))):n||(t.parentElement?.closest(`[tabindex]`))?.focus({preventScroll:!0})},c=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(e){let t=F(),n=t!=null&&sn(t);c.call(this,{...e,preventScroll:!0}),(!e||!e.preventScroll)&&Ka(this,n)};let l=Pt(Ga(document,`touchstart`,r,{passive:!1,capture:!0}),Ga(document,`touchmove`,o,{passive:!1,capture:!0}),Ga(document,`blur`,s,!0));return()=>{e(),l(),i.remove(),HTMLElement.prototype.focus=c}}function Wa(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ga(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ka(e,t){t||!Ra?qa(e):Ra.addEventListener(`resize`,()=>qa(e),{once:!0})}function qa(e){let t=document.scrollingElement||document.documentElement,n=e;for(;n&&n!==t;){let e=an(n);if(e!==document.documentElement&&e!==document.body&&e!==n){let t=e.getBoundingClientRect(),r=n.getBoundingClientRect();if(r.top<t.top||r.bottom>t.top+n.clientHeight){let n=t.bottom;Ra&&(n=Math.min(n,Ra.offsetTop+Ra.height));let i=r.top-t.top-((n-t.top)/2-r.height/2);e.scrollTo({top:Math.max(0,Math.min(e.scrollHeight-e.clientHeight,e.scrollTop+i)),behavior:`smooth`})}}n=e.parentElement}}function Ja(e,t,n){let{overlayProps:r,underlayProps:i}=La({...e,isOpen:t.isOpen,onClose:t.close},n);return Va({isDisabled:!t.isOpen}),Qi(),c(()=>{if(t.isOpen&&n.current)return Hn([n.current],{shouldUseInert:!0})},[t.isOpen,n]),{modalProps:L(r),underlayProps:i}}const Ya=i({}),Xa=Ui(function(e,t){[e,t]=Nn(e,t,Ya);let{elementType:n=`label`,...i}=e,a=Rn[n];return r.createElement(a,{className:`react-aria-Label`,...i,ref:t})}),Za=i(null),Qa=7e3;let $a=null;function eo(e,t=`assertive`,n=Qa){$a?$a.announce(e,t,n):($a=new to,(typeof IS_REACT_ACT_ENVIRONMENT==`boolean`?IS_REACT_ACT_ENVIRONMENT:typeof jest<`u`)?$a.announce(e,t,n):setTimeout(()=>{$a?.isAttached()&&$a?.announce(e,t,n)},100))}var to=class{isAttached(){return this.node?.isConnected}createLog(e){let t=document.createElement(`div`);return t.setAttribute(`role`,`log`),t.setAttribute(`aria-live`,e),t.setAttribute(`aria-relevant`,`additions`),t}destroy(){this.node&&=(document.body.removeChild(this.node),null)}announce(e,t=`assertive`,n=Qa){var r,i;if(!this.node)return;let a=document.createElement(`div`);typeof e==`object`?(a.setAttribute(`role`,`img`),a.setAttribute(`aria-labelledby`,e[`aria-labelledby`])):a.textContent=e,t===`assertive`?(r=this.assertiveLog)==null||r.appendChild(a):(i=this.politeLog)==null||i.appendChild(a),e!==``&&setTimeout(()=>{a.remove()},n)}clear(e){this.node&&((!e||e===`assertive`)&&this.assertiveLog&&(this.assertiveLog.innerHTML=``),(!e||e===`polite`)&&this.politeLog&&(this.politeLog.innerHTML=``))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<`u`&&(this.node=document.createElement(`div`),this.node.dataset.liveAnnouncer=`true`,Object.assign(this.node.style,{border:0,clip:`rect(0 0 0 0)`,clipPath:`inset(50%)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`}),this.assertiveLog=this.createLog(`assertive`),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog(`polite`),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}};const no=i({}),ro=Ui(function(e,t){[e,t]=Nn(e,t,no);let n=e,{isPending:i}=n,{buttonProps:a,isPressed:o}=Wi(e,t);a=ao(a,i);let{focusProps:s,isFocused:l,isFocusVisible:u}=Mi(e),{hoverProps:f,isHovered:p}=zi({...e,isDisabled:e.isDisabled||i}),m={isHovered:p,isPressed:(n.isPressed||o)&&!i,isFocused:l,isFocusVisible:u,isDisabled:e.isDisabled||!1,isPending:i??!1},h=An({...e,values:m,defaultClassName:`react-aria-Button`}),g=jt(a.id),_=jt(),v=a[`aria-labelledby`];i&&(v?v=`${v} ${_}`:a[`aria-label`]&&(v=`${g} ${_}`));let y=d(i);c(()=>{let e={"aria-labelledby":v||g};(!y.current&&l&&i||y.current&&l&&!i)&&eo(e,`assertive`),y.current=i},[i,l,v,g]);let b=R(e,{global:!0});return delete b.onClick,r.createElement(Rn.button,{...L(b,h,a,s,f),type:a.type===`submit`&&i?`button`:a.type,id:g,ref:t,"aria-labelledby":v,slot:e.slot||void 0,"aria-disabled":i?`true`:a[`aria-disabled`],"data-disabled":e.isDisabled||void 0,"data-pressed":m.isPressed||void 0,"data-hovered":p||void 0,"data-focused":l||void 0,"data-pending":i||void 0,"data-focus-visible":u||void 0},r.createElement(Za.Provider,{value:{id:_}},h.children))}),io=/Focus|Blur|Hover|Pointer(Enter|Leave|Over|Out)|Mouse(Enter|Leave|Over|Out)/;function ao(e,t){if(t){for(let t in e)t.startsWith(`on`)&&!io.test(t)&&(e[t]=void 0);e.href=void 0,e.target=void 0}return e}function oo(e){let[t,n]=Ai(e.isOpen,e.defaultOpen||!1,e.onOpenChange);return{isOpen:t,setOpen:n,open:o(()=>{n(!0)},[n]),close:o(()=>{n(!1)},[n]),toggle:o(()=>{n(!t)},[n,t])}}const so=i(null),co=i(null),lo=a(function(e,t){let n=e[`aria-labelledby`];[e,t]=Nn(e,t,so);let{dialogProps:i,titleProps:a}=$i({...e,"aria-labelledby":n},t),o=s(co);!i[`aria-label`]&&!i[`aria-labelledby`]&&e[`aria-labelledby`]&&(i[`aria-labelledby`]=e[`aria-labelledby`]);let c=An({defaultClassName:`react-aria-Dialog`,className:e.className,style:e.style,children:e.children,values:{close:o?.close||(()=>{})}}),l=R(e,{global:!0});return r.createElement(Rn.section,{...L(l,c,i),render:e.render,ref:t,slot:e.slot||void 0},r.createElement(kn,{values:[[Qe,{slots:{[On]:{},title:{...a,level:2}}}],[no,{slots:{[On]:{},close:{onPress:()=>o?.close()}}}]]},c.children))}),uo=i(null),fo=i(null),po=a(function(e,t){if(s(fo))return r.createElement(_o,{...e,modalRef:t},e.children);let{isDismissable:n,isKeyboardDismissDisabled:i,isOpen:a,defaultOpen:o,onOpenChange:c,children:l,isEntering:u,isExiting:d,UNSTABLE_portalContainer:f,shouldCloseOnInteractOutside:p,...m}=e;return r.createElement(ho,{isDismissable:n,isKeyboardDismissDisabled:i,isOpen:a,defaultOpen:o,onOpenChange:c,isEntering:u,isExiting:d,UNSTABLE_portalContainer:f,shouldCloseOnInteractOutside:p},r.createElement(_o,{...m,modalRef:t},l))});function mo(e,t){[e,t]=Nn(e,t,uo);let n=s(co),i=oo(e),a=e.isOpen!=null||e.defaultOpen!=null||!n?i:n,o=en(t),c=d(null),l=pn(o,a.isOpen),u=pn(c,a.isOpen),f=l||u||e.isExiting||!1,p=Et();return!a.isOpen&&!f||p?null:r.createElement(go,{...e,state:a,isExiting:f,overlayRef:o,modalRef:c})}const ho=a(mo);function go({UNSTABLE_portalContainer:e,...t}){let n=t.modalRef,{state:i}=t,{modalProps:a,underlayProps:o}=Ja(t,i,n),s=fn(t.overlayRef)||t.isEntering||!1,c=An({...t,defaultClassName:`react-aria-ModalOverlay`,values:{isEntering:s,isExiting:t.isExiting,state:i}}),l=cn(),u;if(typeof document<`u`){let e=rn(document.body)?document.body:document.scrollingElement||document.documentElement,t=e.getBoundingClientRect().height%1;u=e.scrollHeight-t}let d={...c.style,"--visual-viewport-height":l.height+`px`,"--page-height":u===void 0?void 0:u+`px`};return r.createElement(Zi,{isExiting:t.isExiting,portalContainer:e},r.createElement(Rn.div,{...L(R(t,{global:!0}),o),...c,style:d,ref:t.overlayRef,"data-entering":s||void 0,"data-exiting":t.isExiting||void 0},r.createElement(kn,{values:[[fo,{modalProps:a,modalRef:n,isExiting:t.isExiting,isDismissable:t.isDismissable}],[co,i]]},c.children)))}function _o(e){let{modalProps:t,modalRef:n,isExiting:i,isDismissable:a}=s(fo),o=s(co),c=en(l(()=>Bt(e.modalRef,n),[e.modalRef,n])),u=fn(c),d=An({...e,defaultClassName:`react-aria-Modal`,values:{isEntering:u,isExiting:i,state:o}});return r.createElement(Rn.div,{...L(R(e,{global:!0}),t),...d,ref:c,"data-entering":u||void 0,"data-exiting":i||void 0},a&&r.createElement(Ia,{onDismiss:o.close}),d.children)}const vo=()=>{let[n,r]=f(!1);return c(()=>{let n=t=>{let n=e.safeParse(t);n.error||r(n.data.detail.isRecording)};return document.addEventListener(t,n),()=>{document.removeEventListener(t,n)}},[]),n},yo=({className:e,iconClassName:t,onClose:n})=>vo()?null:v(`button`,{type:`button`,className:e,"aria-label":`Dismiss`,onClick:n,children:v(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`,fill:`none`,className:t,children:v(`path`,{fill:`currentColor`,fillRule:`evenodd`,d:`M3.53 3.529c.26-.26.682-.26.942 0l3.529 3.528 3.528-3.528a.667.667 0 0 1 .943.942L8.943 8l3.53 3.528a.667.667 0 0 1-.944.943L8.001 8.943 4.472 12.47a.667.667 0 1 1-.943-.943L7.058 8 3.529 4.47a.667.667 0 0 1 0-.942Z`,clipRule:`evenodd`})})}),bo=({children:e,classNames:t,isDismissable:r,onDismiss:i,closeOnFinishMs:a})=>{let{survey:o,surveyId:s,dismiss:c}=Xe(),[l,u]=f(!1);return h(()=>{o&&c()},l?a:null),y(lo,{"aria-label":`Survey`,id:`${s}-popover`,className:b(`confetti-modal-dialog ${n}`,t?.dialog),children:[r&&v(yo,{className:b(`confetti-modal-dialog-close`,t?.closeButton),iconClassName:t?.icon,onClose:async()=>{await c(),i?.()}}),typeof e==`function`?e({setIsFinished:()=>u(!0)}):e]})},xo=({children:e,classNames:t,onDismiss:r,isDismissable:i=!0,closeOnFinishMs:a=3e3})=>{let{dismiss:o}=Xe();return v(ho,{isOpen:!0,isDismissable:i,isKeyboardDismissDisabled:!i,onOpenChange:async e=>{e||(await o(),r?.())},className:b(`confetti-modal-overlay ${n}`,t?.overlay),children:v(po,{className:b(`confetti-modal ${n}`,t?.modal),children:v(bo,{classNames:t,isDismissable:i,onDismiss:r,closeOnFinishMs:a,children:e})})})};export{R as A,qe as B,jn as C,B as D,Mn as E,Nt as F,je as G,Xe as H,jt as I,Ae as J,Oe as K,A as L,Bt as M,I as N,en as O,M as P,ae as Q,$e as R,Pn as S,Fn as T,Ge as U,Ye as V,Te as W,ge as X,Me as Y,_e as Z,kr as _,ro as a,Nn as b,qi as c,Mi as d,ji as f,Qr as g,Z as h,vo as i,L as j,$t as k,Ui as l,Oi as m,bo as n,Ya as o,Ai as p,De as q,yo as r,Xa as s,xo as t,zi as u,$n as v,Rn as w,An as x,kn as y,Ze as z};
|