@purpurds/modal 7.6.0 → 7.7.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/dist/LICENSE.txt +5 -5
- package/dist/modal-content.d.ts +92 -4
- package/dist/modal-content.d.ts.map +1 -1
- package/dist/modal-trigger.d.ts +3 -6
- package/dist/modal-trigger.d.ts.map +1 -1
- package/dist/modal.cjs.js +16 -16
- package/dist/modal.cjs.js.map +1 -1
- package/dist/modal.d.ts +35 -4
- package/dist/modal.d.ts.map +1 -1
- package/dist/modal.es.js +630 -648
- package/dist/modal.es.js.map +1 -1
- package/package.json +10 -9
- package/src/modal-content.tsx +26 -12
- package/src/modal-trigger.tsx +6 -9
package/dist/LICENSE.txt
CHANGED
|
@@ -387,35 +387,35 @@ Homepage: https://radix-ui.com/primitives
|
|
|
387
387
|
---
|
|
388
388
|
|
|
389
389
|
Name: @purpurds/button
|
|
390
|
-
Version: 7.
|
|
390
|
+
Version: 7.6.1
|
|
391
391
|
License: AGPL-3.0-only
|
|
392
392
|
Private: false
|
|
393
393
|
|
|
394
394
|
---
|
|
395
395
|
|
|
396
396
|
Name: @purpurds/heading
|
|
397
|
-
Version: 7.
|
|
397
|
+
Version: 7.6.1
|
|
398
398
|
License: AGPL-3.0-only
|
|
399
399
|
Private: false
|
|
400
400
|
|
|
401
401
|
---
|
|
402
402
|
|
|
403
403
|
Name: @purpurds/icon
|
|
404
|
-
Version: 7.
|
|
404
|
+
Version: 7.6.1
|
|
405
405
|
License: AGPL-3.0-only
|
|
406
406
|
Private: false
|
|
407
407
|
|
|
408
408
|
---
|
|
409
409
|
|
|
410
410
|
Name: @purpurds/paragraph
|
|
411
|
-
Version: 7.
|
|
411
|
+
Version: 7.6.1
|
|
412
412
|
License: AGPL-3.0-only
|
|
413
413
|
Private: false
|
|
414
414
|
|
|
415
415
|
---
|
|
416
416
|
|
|
417
417
|
Name: @purpurds/visually-hidden
|
|
418
|
-
Version: 7.
|
|
418
|
+
Version: 7.6.1
|
|
419
419
|
License: AGPL-3.0-only
|
|
420
420
|
Private: false
|
|
421
421
|
|
package/dist/modal-content.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '@purpurds/common-types';
|
|
2
3
|
|
|
3
|
-
export type DefaultProps =
|
|
4
|
-
["data-testid"]?: string;
|
|
4
|
+
export type DefaultProps = Omit<BaseProps, "children"> & {
|
|
5
5
|
/**
|
|
6
6
|
* One or several CTA links or buttons
|
|
7
7
|
* */
|
|
@@ -65,7 +65,95 @@ type CloseButtonProps = {
|
|
|
65
65
|
showCloseButton: true;
|
|
66
66
|
};
|
|
67
67
|
export type ModalContentProps = DefaultProps & (CloseButtonProps | NoCloseButtonProps);
|
|
68
|
-
export declare const ModalContent: React.ForwardRefExoticComponent<
|
|
68
|
+
export declare const ModalContent: React.ForwardRefExoticComponent<(Omit<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
69
|
+
[key: `data-${string}`]: string | undefined;
|
|
70
|
+
}, "children"> & {
|
|
71
|
+
/**
|
|
72
|
+
* One or several CTA links or buttons
|
|
73
|
+
* */
|
|
74
|
+
actions?: ReactNode;
|
|
75
|
+
children: ReactNode;
|
|
76
|
+
/**
|
|
77
|
+
* An optional accessible description to be announced when the dialog is opened.
|
|
78
|
+
* */
|
|
79
|
+
description?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Prevents the modal from closing on click outside if set to `true`.
|
|
82
|
+
* */
|
|
83
|
+
disableCloseOnClickOutside?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Visually hides the description if set to `true`.
|
|
86
|
+
* */
|
|
87
|
+
hideDescription?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* An optional image to be displayed at the top of the modal.
|
|
90
|
+
* */
|
|
91
|
+
image?: ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* Provide a Purpur Notification which will render beneath the modal buttons, otherwise leave it undefined.
|
|
94
|
+
* */
|
|
95
|
+
notification?: ReactNode;
|
|
96
|
+
/**
|
|
97
|
+
* Determines whether the button group should be fixed at the bottom or scroll with the content.
|
|
98
|
+
* */
|
|
99
|
+
stickyButtons?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* An accessible title to be announced when the dialog is opened.
|
|
102
|
+
* */
|
|
103
|
+
title: string;
|
|
104
|
+
/**
|
|
105
|
+
* z-index of the modal
|
|
106
|
+
* */
|
|
107
|
+
zIndex?: number;
|
|
108
|
+
/**
|
|
109
|
+
* Event handler called when focus moves to the trigger after closing.
|
|
110
|
+
* */
|
|
111
|
+
onCloseAutoFocus?: (e: Event) => void;
|
|
112
|
+
} & NoCloseButtonProps, "ref"> | Omit<Omit<React.ClassAttributes<HTMLDivElement> & React.HTMLAttributes<HTMLDivElement> & {
|
|
113
|
+
[key: `data-${string}`]: string | undefined;
|
|
114
|
+
}, "children"> & {
|
|
115
|
+
/**
|
|
116
|
+
* One or several CTA links or buttons
|
|
117
|
+
* */
|
|
118
|
+
actions?: ReactNode;
|
|
119
|
+
children: ReactNode;
|
|
120
|
+
/**
|
|
121
|
+
* An optional accessible description to be announced when the dialog is opened.
|
|
122
|
+
* */
|
|
123
|
+
description?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Prevents the modal from closing on click outside if set to `true`.
|
|
126
|
+
* */
|
|
127
|
+
disableCloseOnClickOutside?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Visually hides the description if set to `true`.
|
|
130
|
+
* */
|
|
131
|
+
hideDescription?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* An optional image to be displayed at the top of the modal.
|
|
134
|
+
* */
|
|
135
|
+
image?: ReactNode;
|
|
136
|
+
/**
|
|
137
|
+
* Provide a Purpur Notification which will render beneath the modal buttons, otherwise leave it undefined.
|
|
138
|
+
* */
|
|
139
|
+
notification?: ReactNode;
|
|
140
|
+
/**
|
|
141
|
+
* Determines whether the button group should be fixed at the bottom or scroll with the content.
|
|
142
|
+
* */
|
|
143
|
+
stickyButtons?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* An accessible title to be announced when the dialog is opened.
|
|
146
|
+
* */
|
|
147
|
+
title: string;
|
|
148
|
+
/**
|
|
149
|
+
* z-index of the modal
|
|
150
|
+
* */
|
|
151
|
+
zIndex?: number;
|
|
152
|
+
/**
|
|
153
|
+
* Event handler called when focus moves to the trigger after closing.
|
|
154
|
+
* */
|
|
155
|
+
onCloseAutoFocus?: (e: Event) => void;
|
|
156
|
+
} & CloseButtonProps, "ref">) & React.RefAttributes<HTMLDivElement>>;
|
|
69
157
|
export declare const MAX_NUMBER_OF_ACTIONS = 3;
|
|
70
158
|
export declare const ModalActions: ({ actions, notification, }: Pick<ModalContentProps, "actions" | "notification">) => React.JSX.Element | null;
|
|
71
159
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../src/modal-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"modal-content.d.ts","sourceRoot":"","sources":["../src/modal-content.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAA4C,MAAM,OAAO,CAAC;AAEpG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAexD,OAAO,+BAA+B,CAAC;AAGvC,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IACvD;;SAEK;IACL,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB;;SAEK;IACL,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;SAEK;IACL,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC;;SAEK;IACL,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;SAEK;IACL,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;SAEK;IACL,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;SAEK;IACL,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;SAEK;IACL,KAAK,EAAE,MAAM,CAAC;IACd;;SAEK;IACL,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;SAEK;IACL,gBAAgB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB;;SAEK;IACL,oBAAoB,CAAC,EAAE,KAAK,CAAC;IAC7B;;SAEK;IACL,eAAe,CAAC,EAAE,KAAK,CAAC;CACzB,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB;;SAEK;IACL,oBAAoB,EAAE,MAAM,CAAC;IAC7B;;SAEK;IACL,eAAe,EAAE,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,YAAY,GAAG,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,CAAC;AASvF,eAAO,MAAM,YAAY;;;IA1EvB;;SAEK;cACK,SAAS;cACT,SAAS;IACnB;;SAEK;kBACS,MAAM;IACpB;;SAEK;iCACwB,OAAO;IACpC;;SAEK;sBACa,OAAO;IACzB;;SAEK;YACG,SAAS;IACjB;;SAEK;mBACU,SAAS;IACxB;;SAEK;oBACW,OAAO;IACvB;;SAEK;WACE,MAAM;IACb;;SAEK;aACI,MAAM;IACf;;SAEK;uBACc,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI;;;;IAxCrC;;SAEK;cACK,SAAS;cACT,SAAS;IACnB;;SAEK;kBACS,MAAM;IACpB;;SAEK;iCACwB,OAAO;IACpC;;SAEK;sBACa,OAAO;IACzB;;SAEK;YACG,SAAS;IACjB;;SAEK;mBACU,SAAS;IACxB;;SAEK;oBACW,OAAO;IACvB;;SAEK;WACE,MAAM;IACb;;SAEK;aACI,MAAM;IACf;;SAEK;uBACc,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI;oEA6MtC,CAAC;AA6BF,eAAO,MAAM,qBAAqB,IAAI,CAAC;AAEvC,eAAO,MAAM,YAAY,+BAGtB,IAAI,CAAC,iBAAiB,EAAE,SAAS,GAAG,cAAc,CAAC,6BAsBrD,CAAC"}
|
package/dist/modal-trigger.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { BaseProps } from '@purpurds/common-types';
|
|
2
3
|
|
|
3
|
-
export type ModalTriggerProps =
|
|
4
|
-
["data-testid"]?: string;
|
|
4
|
+
export type ModalTriggerProps = Omit<BaseProps<"button">, "children"> & {
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
export declare const ModalTrigger: React.ForwardRefExoticComponent<
|
|
8
|
-
"data-testid"?: string;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
} & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const ModalTrigger: React.ForwardRefExoticComponent<Omit<ModalTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
11
8
|
//# sourceMappingURL=modal-trigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modal-trigger.d.ts","sourceRoot":"","sources":["../src/modal-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"modal-trigger.d.ts","sourceRoot":"","sources":["../src/modal-trigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAc,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGxD,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,GAAG;IACtE,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,YAAY,0GAQxB,CAAC"}
|
package/dist/modal.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),O=require("react"),it=require("react-dom");function ut(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=ut(O),Xt=ut(it);function $(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Re(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function st(...e){return t=>{let r=!1;const o=e.map(a=>{const n=Re(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){const n=o[a];typeof n=="function"?n():Re(e[a],null)}}}}function W(...e){return s.useCallback(st(...e),e)}function Zt(e,t){const r=s.createContext(t),o=n=>{const{children:i,...u}=n,p=s.useMemo(()=>u,Object.values(u));return c.jsx(r.Provider,{value:p,children:i})};o.displayName=e+"Provider";function a(n){const i=s.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}return[o,a]}function Qt(e,t=[]){let r=[];function o(n,i){const u=s.createContext(i),p=r.length;r=[...r,i];const d=v=>{var _;const{scope:h,children:g,...b}=v,l=((_=h==null?void 0:h[e])==null?void 0:_[p])||u,m=s.useMemo(()=>b,Object.values(b));return c.jsx(l.Provider,{value:m,children:g})};d.displayName=n+"Provider";function f(v,h){var l;const g=((l=h==null?void 0:h[e])==null?void 0:l[p])||u,b=s.useContext(g);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${v}\` must be used within \`${n}\``)}return[d,f]}const a=()=>{const n=r.map(i=>s.createContext(i));return function(u){const p=(u==null?void 0:u[e])||n;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return a.scopeName=e,[o,Jt(a,...t)]}function Jt(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){const i=o.reduce((u,{useScope:p,scopeName:d})=>{const v=p(n)[`__scope${d}`];return{...u,...v}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var ie=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},er=s.useId||(()=>{}),tr=0;function de(e){const[t,r]=s.useState(er());return ie(()=>{r(o=>o??String(tr++))},[e]),e||(t?`radix-${t}`:"")}function k(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function rr({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,a]=nr({defaultProp:t,onChange:r}),n=e!==void 0,i=n?e:o,u=k(r),p=s.useCallback(d=>{if(n){const v=typeof d=="function"?d(e):d;v!==e&&u(v)}else a(d)},[n,e,a,u]);return[i,p]}function nr({defaultProp:e,onChange:t}){const r=s.useState(e),[o]=r,a=s.useRef(o),n=k(t);return s.useEffect(()=>{a.current!==o&&(n(o),a.current=o)},[o,a,n]),r}var Se=s.forwardRef((e,t)=>{const{children:r,...o}=e,a=s.Children.toArray(r),n=a.find(ar);if(n){const i=n.props.children,u=a.map(p=>p===n?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:p);return c.jsx(be,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return c.jsx(be,{...o,ref:t,children:r})});Se.displayName="Slot";var be=s.forwardRef((e,t)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const a=ur(r),n=ir(o,r.props);return r.type!==s.Fragment&&(n.ref=t?st(t,a):a),s.cloneElement(r,n)}return s.Children.count(r)>1?s.Children.only(null):null});be.displayName="SlotClone";var or=({children:e})=>c.jsx(c.Fragment,{children:e});function ar(e){return s.isValidElement(e)&&e.type===or}function ir(e,t){const r={...t};for(const o in t){const a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...u)=>{n(...u),a(...u)}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function ur(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var sr=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],M=sr.reduce((e,t)=>{const r=s.forwardRef((o,a)=>{const{asChild:n,...i}=o,u=n?Se:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cr(e,t){e&&Xt.flushSync(()=>e.dispatchEvent(t))}function lr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e);s.useEffect(()=>{const o=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var dr="DismissableLayer",we="dismissableLayer.update",pr="dismissableLayer.pointerDownOutside",fr="dismissableLayer.focusOutside",Ae,ct=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lt=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:n,onInteractOutside:i,onDismiss:u,...p}=e,d=s.useContext(ct),[f,v]=s.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=s.useState({}),b=W(t,y=>v(y)),l=Array.from(d.layers),[m]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=l.indexOf(m),S=f?l.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,x=mr(y=>{const A=y.target,R=[...d.branches].some(z=>z.contains(A));!E||R||(a==null||a(y),i==null||i(y),y.defaultPrevented||u==null||u())},h),N=gr(y=>{const A=y.target;[...d.branches].some(z=>z.contains(A))||(n==null||n(y),i==null||i(y),y.defaultPrevented||u==null||u())},h);return lr(y=>{S===d.layers.size-1&&(o==null||o(y),!y.defaultPrevented&&u&&(y.preventDefault(),u()))},h),s.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ae=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),De(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Ae)}},[f,h,r,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),De())},[f,d]),s.useEffect(()=>{const y=()=>g({});return document.addEventListener(we,y),()=>document.removeEventListener(we,y)},[]),c.jsx(M.div,{...p,ref:b,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:$(e.onFocusCapture,N.onFocusCapture),onBlurCapture:$(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:$(e.onPointerDownCapture,x.onPointerDownCapture)})});lt.displayName=dr;var vr="DismissableLayerBranch",hr=s.forwardRef((e,t)=>{const r=s.useContext(ct),o=s.useRef(null),a=W(t,o);return s.useEffect(()=>{const n=o.current;if(n)return r.branches.add(n),()=>{r.branches.delete(n)}},[r.branches]),c.jsx(M.div,{...e,ref:a})});hr.displayName=vr;function mr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e),o=s.useRef(!1),a=s.useRef(()=>{});return s.useEffect(()=>{const n=u=>{if(u.target&&!o.current){let p=function(){dt(pr,r,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=p,t.addEventListener("click",a.current,{once:!0})):p()}else t.removeEventListener("click",a.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",n)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",n),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function gr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e),o=s.useRef(!1);return s.useEffect(()=>{const a=n=>{n.target&&!o.current&&dt(fr,r,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function De(){const e=new CustomEvent(we);document.dispatchEvent(e)}function dt(e,t,r,{discrete:o}){const a=r.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?cr(a,n):a.dispatchEvent(n)}var pe="focusScope.autoFocusOnMount",fe="focusScope.autoFocusOnUnmount",je={bubbles:!1,cancelable:!0},_r="FocusScope",pt=s.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:n,...i}=e,[u,p]=s.useState(null),d=k(a),f=k(n),v=s.useRef(null),h=W(t,l=>p(l)),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let l=function(w){if(g.paused||!u)return;const E=w.target;u.contains(E)?v.current=E:T(v.current,{select:!0})},m=function(w){if(g.paused||!u)return;const E=w.relatedTarget;E!==null&&(u.contains(E)||T(v.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&T(u)};document.addEventListener("focusin",l),document.addEventListener("focusout",m);const S=new MutationObserver(_);return u&&S.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",m),S.disconnect()}}},[o,u,g.paused]),s.useEffect(()=>{if(u){Te.add(g);const l=document.activeElement;if(!u.contains(l)){const _=new CustomEvent(pe,je);u.addEventListener(pe,d),u.dispatchEvent(_),_.defaultPrevented||(yr(Sr(ft(u)),{select:!0}),document.activeElement===l&&T(u))}return()=>{u.removeEventListener(pe,d),setTimeout(()=>{const _=new CustomEvent(fe,je);u.addEventListener(fe,f),u.dispatchEvent(_),_.defaultPrevented||T(l??document.body,{select:!0}),u.removeEventListener(fe,f),Te.remove(g)},0)}}},[u,d,f,g]);const b=s.useCallback(l=>{if(!r&&!o||g.paused)return;const m=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,_=document.activeElement;if(m&&_){const S=l.currentTarget,[w,E]=br(S);w&&E?!l.shiftKey&&_===E?(l.preventDefault(),r&&T(w,{select:!0})):l.shiftKey&&_===w&&(l.preventDefault(),r&&T(E,{select:!0})):_===S&&l.preventDefault()}},[r,o,g.paused]);return c.jsx(M.div,{tabIndex:-1,...i,ref:h,onKeyDown:b})});pt.displayName=_r;function yr(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if(T(o,{select:t}),document.activeElement!==r)return}function br(e){const t=ft(e),r=Me(t,e),o=Me(t.reverse(),e);return[r,o]}function ft(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Me(e,t){for(const r of e)if(!wr(r,{upTo:t}))return r}function wr(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Er(e){return e instanceof HTMLInputElement&&"select"in e}function T(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Er(e)&&t&&e.select()}}var Te=xr();function xr(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=$e(e,t),e.unshift(t)},remove(t){var r;e=$e(e,t),(r=e[0])==null||r.resume()}}}function $e(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function Sr(e){return e.filter(t=>t.tagName!=="A")}var Cr="Portal",vt=s.forwardRef((e,t)=>{var u;const{container:r,...o}=e,[a,n]=s.useState(!1);ie(()=>n(!0),[]);const i=r||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return i?it.createPortal(c.jsx(M.div,{...o,ref:t}),i):null});vt.displayName=Cr;function Nr(e,t){return s.useReducer((r,o)=>t[r][o]??r,e)}var se=e=>{const{present:t,children:r}=e,o=Pr(t),a=typeof r=="function"?r({present:o.isPresent}):s.Children.only(r),n=W(o.ref,Or(a));return typeof r=="function"||o.isPresent?s.cloneElement(a,{ref:n}):null};se.displayName="Presence";function Pr(e){const[t,r]=s.useState(),o=s.useRef({}),a=s.useRef(e),n=s.useRef("none"),i=e?"mounted":"unmounted",[u,p]=Nr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const d=Z(o.current);n.current=u==="mounted"?d:"none"},[u]),ie(()=>{const d=o.current,f=a.current;if(f!==e){const h=n.current,g=Z(d);e?p("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?p("UNMOUNT"):p(f&&h!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,p]),ie(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,v=g=>{const l=Z(o.current).includes(g.animationName);if(g.target===t&&l&&(p("ANIMATION_END"),!a.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=g=>{g.target===t&&(n.current=Z(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(d=>{d&&(o.current=getComputedStyle(d)),r(d)},[])}}function Z(e){return(e==null?void 0:e.animationName)||"none"}function Or(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ve=0;function Rr(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ie()),document.body.insertAdjacentElement("beforeend",e[1]??Ie()),ve++,()=>{ve===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ve--}},[])}function Ie(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var j=function(){return j=Object.assign||function(t){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},j.apply(this,arguments)};function ht(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(r[o[a]]=e[o[a]]);return r}function Ar(e,t,r){if(r||arguments.length===2)for(var o=0,a=t.length,n;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var oe="right-scroll-bar-position",ae="width-before-scroll-bar",Dr="with-scroll-bars-hidden",jr="--removed-body-scroll-bar-size";function he(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Mr(e,t){var r=O.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var a=r.value;a!==o&&(r.value=o,r.callback(o,a))}}}})[0];return r.callback=t,r.facade}var Tr=typeof window<"u"?s.useLayoutEffect:s.useEffect,Le=new WeakMap;function $r(e,t){var r=Mr(null,function(o){return e.forEach(function(a){return he(a,o)})});return Tr(function(){var o=Le.get(r);if(o){var a=new Set(o),n=new Set(e),i=r.current;a.forEach(function(u){n.has(u)||he(u,null)}),n.forEach(function(u){a.has(u)||he(u,i)})}Le.set(r,e)},[e]),r}function Ir(e){return e}function Lr(e,t){t===void 0&&(t=Ir);var r=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(n){var i=t(n,o);return r.push(i),function(){r=r.filter(function(u){return u!==i})}},assignSyncMedium:function(n){for(o=!0;r.length;){var i=r;r=[],i.forEach(n)}r={push:function(u){return n(u)},filter:function(){return r}}},assignMedium:function(n){o=!0;var i=[];if(r.length){var u=r;r=[],u.forEach(n),i=r}var p=function(){var f=i;i=[],f.forEach(n)},d=function(){return Promise.resolve().then(p)};d(),r={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),r}}}};return a}function kr(e){e===void 0&&(e={});var t=Lr(null);return t.options=j({async:!0,ssr:!1},e),t}var mt=function(e){var t=e.sideCar,r=ht(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return s.createElement(o,j({},r))};mt.isSideCarExport=!0;function Fr(e,t){return e.useMedium(t),mt}var gt=kr(),me=function(){},ce=s.forwardRef(function(e,t){var r=s.useRef(null),o=s.useState({onScrollCapture:me,onWheelCapture:me,onTouchMoveCapture:me}),a=o[0],n=o[1],i=e.forwardProps,u=e.children,p=e.className,d=e.removeScrollBar,f=e.enabled,v=e.shards,h=e.sideCar,g=e.noIsolation,b=e.inert,l=e.allowPinchZoom,m=e.as,_=m===void 0?"div":m,S=e.gapMode,w=ht(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,x=$r([r,t]),N=j(j({},w),a);return s.createElement(s.Fragment,null,f&&s.createElement(E,{sideCar:gt,removeScrollBar:d,shards:v,noIsolation:g,inert:b,setCallbacks:n,allowPinchZoom:!!l,lockRef:r,gapMode:S}),i?s.cloneElement(s.Children.only(u),j(j({},N),{ref:x})):s.createElement(_,j({},N,{className:p,ref:x}),u))});ce.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};ce.classNames={fullWidth:ae,zeroRight:oe};var Wr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function qr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Wr();return t&&e.setAttribute("nonce",t),e}function Br(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ur(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Vr=function(){var e=0,t=null;return{add:function(r){e==0&&(t=qr())&&(Br(t,r),Ur(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hr=function(){var e=Vr();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},_t=function(){var e=Hr(),t=function(r){var o=r.styles,a=r.dynamic;return e(o,a),null};return t},zr={left:0,top:0,right:0,gap:0},ge=function(e){return parseInt(e||"",10)||0},Kr=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[ge(r),ge(o),ge(a)]},Gr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return zr;var t=Kr(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},Yr=_t(),H="data-scroll-locked",Xr=function(e,t,r,o){var a=e.left,n=e.top,i=e.right,u=e.gap;return r===void 0&&(r="margin"),`
|
|
2
|
-
.`.concat(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),O=require("react"),at=require("react-dom");function it(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const s=it(O),Yt=it(at);function I(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function Oe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ut(...e){return t=>{let r=!1;const o=e.map(a=>{const n=Oe(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){const n=o[a];typeof n=="function"?n():Oe(e[a],null)}}}}function W(...e){return s.useCallback(ut(...e),e)}function Xt(e,t){const r=s.createContext(t),o=n=>{const{children:i,...u}=n,p=s.useMemo(()=>u,Object.values(u));return c.jsx(r.Provider,{value:p,children:i})};o.displayName=e+"Provider";function a(n){const i=s.useContext(r);if(i)return i;if(t!==void 0)return t;throw new Error(`\`${n}\` must be used within \`${e}\``)}return[o,a]}function Zt(e,t=[]){let r=[];function o(n,i){const u=s.createContext(i),p=r.length;r=[...r,i];const d=v=>{var _;const{scope:h,children:g,...b}=v,l=((_=h==null?void 0:h[e])==null?void 0:_[p])||u,m=s.useMemo(()=>b,Object.values(b));return c.jsx(l.Provider,{value:m,children:g})};d.displayName=n+"Provider";function f(v,h){var l;const g=((l=h==null?void 0:h[e])==null?void 0:l[p])||u,b=s.useContext(g);if(b)return b;if(i!==void 0)return i;throw new Error(`\`${v}\` must be used within \`${n}\``)}return[d,f]}const a=()=>{const n=r.map(i=>s.createContext(i));return function(u){const p=(u==null?void 0:u[e])||n;return s.useMemo(()=>({[`__scope${e}`]:{...u,[e]:p}}),[u,p])}};return a.scopeName=e,[o,Qt(a,...t)]}function Qt(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const o=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){const i=o.reduce((u,{useScope:p,scopeName:d})=>{const v=p(n)[`__scope${d}`];return{...u,...v}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}var ae=globalThis!=null&&globalThis.document?s.useLayoutEffect:()=>{},Jt=s.useId||(()=>{}),er=0;function le(e){const[t,r]=s.useState(Jt());return ae(()=>{r(o=>o??String(er++))},[e]),e||(t?`radix-${t}`:"")}function k(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...r)=>{var o;return(o=t.current)==null?void 0:o.call(t,...r)},[])}function tr({prop:e,defaultProp:t,onChange:r=()=>{}}){const[o,a]=rr({defaultProp:t,onChange:r}),n=e!==void 0,i=n?e:o,u=k(r),p=s.useCallback(d=>{if(n){const v=typeof d=="function"?d(e):d;v!==e&&u(v)}else a(d)},[n,e,a,u]);return[i,p]}function rr({defaultProp:e,onChange:t}){const r=s.useState(e),[o]=r,a=s.useRef(o),n=k(t);return s.useEffect(()=>{a.current!==o&&(n(o),a.current=o)},[o,a,n]),r}var xe=s.forwardRef((e,t)=>{const{children:r,...o}=e,a=s.Children.toArray(r),n=a.find(or);if(n){const i=n.props.children,u=a.map(p=>p===n?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:p);return c.jsx(ye,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return c.jsx(ye,{...o,ref:t,children:r})});xe.displayName="Slot";var ye=s.forwardRef((e,t)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const a=ir(r),n=ar(o,r.props);return r.type!==s.Fragment&&(n.ref=t?ut(t,a):a),s.cloneElement(r,n)}return s.Children.count(r)>1?s.Children.only(null):null});ye.displayName="SlotClone";var nr=({children:e})=>c.jsx(c.Fragment,{children:e});function or(e){return s.isValidElement(e)&&e.type===nr}function ar(e,t){const r={...t};for(const o in t){const a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...u)=>{n(...u),a(...u)}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function ir(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var ur=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],M=ur.reduce((e,t)=>{const r=s.forwardRef((o,a)=>{const{asChild:n,...i}=o,u=n?xe:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function sr(e,t){e&&Yt.flushSync(()=>e.dispatchEvent(t))}function cr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e);s.useEffect(()=>{const o=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var lr="DismissableLayer",be="dismissableLayer.update",dr="dismissableLayer.pointerDownOutside",pr="dismissableLayer.focusOutside",Re,st=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ct=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:n,onInteractOutside:i,onDismiss:u,...p}=e,d=s.useContext(st),[f,v]=s.useState(null),h=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=s.useState({}),b=W(t,y=>v(y)),l=Array.from(d.layers),[m]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=l.indexOf(m),S=f?l.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=S>=_,x=hr(y=>{const A=y.target,R=[...d.branches].some(z=>z.contains(A));!E||R||(a==null||a(y),i==null||i(y),y.defaultPrevented||u==null||u())},h),N=mr(y=>{const A=y.target;[...d.branches].some(z=>z.contains(A))||(n==null||n(y),i==null||i(y),y.defaultPrevented||u==null||u())},h);return cr(y=>{S===d.layers.size-1&&(o==null||o(y),!y.defaultPrevented&&u&&(y.preventDefault(),u()))},h),s.useEffect(()=>{if(f)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Re=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Ae(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Re)}},[f,h,r,d]),s.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Ae())},[f,d]),s.useEffect(()=>{const y=()=>g({});return document.addEventListener(be,y),()=>document.removeEventListener(be,y)},[]),c.jsx(M.div,{...p,ref:b,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:I(e.onFocusCapture,N.onFocusCapture),onBlurCapture:I(e.onBlurCapture,N.onBlurCapture),onPointerDownCapture:I(e.onPointerDownCapture,x.onPointerDownCapture)})});ct.displayName=lr;var fr="DismissableLayerBranch",vr=s.forwardRef((e,t)=>{const r=s.useContext(st),o=s.useRef(null),a=W(t,o);return s.useEffect(()=>{const n=o.current;if(n)return r.branches.add(n),()=>{r.branches.delete(n)}},[r.branches]),c.jsx(M.div,{...e,ref:a})});vr.displayName=fr;function hr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e),o=s.useRef(!1),a=s.useRef(()=>{});return s.useEffect(()=>{const n=u=>{if(u.target&&!o.current){let p=function(){lt(dr,r,d,{discrete:!0})};const d={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=p,t.addEventListener("click",a.current,{once:!0})):p()}else t.removeEventListener("click",a.current);o.current=!1},i=window.setTimeout(()=>{t.addEventListener("pointerdown",n)},0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",n),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function mr(e,t=globalThis==null?void 0:globalThis.document){const r=k(e),o=s.useRef(!1);return s.useEffect(()=>{const a=n=>{n.target&&!o.current&<(pr,r,{originalEvent:n},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Ae(){const e=new CustomEvent(be);document.dispatchEvent(e)}function lt(e,t,r,{discrete:o}){const a=r.originalEvent.target,n=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),o?sr(a,n):a.dispatchEvent(n)}var de="focusScope.autoFocusOnMount",pe="focusScope.autoFocusOnUnmount",De={bubbles:!1,cancelable:!0},gr="FocusScope",dt=s.forwardRef((e,t)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:n,...i}=e,[u,p]=s.useState(null),d=k(a),f=k(n),v=s.useRef(null),h=W(t,l=>p(l)),g=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let l=function(w){if(g.paused||!u)return;const E=w.target;u.contains(E)?v.current=E:$(v.current,{select:!0})},m=function(w){if(g.paused||!u)return;const E=w.relatedTarget;E!==null&&(u.contains(E)||$(v.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&$(u)};document.addEventListener("focusin",l),document.addEventListener("focusout",m);const S=new MutationObserver(_);return u&&S.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",l),document.removeEventListener("focusout",m),S.disconnect()}}},[o,u,g.paused]),s.useEffect(()=>{if(u){Te.add(g);const l=document.activeElement;if(!u.contains(l)){const _=new CustomEvent(de,De);u.addEventListener(de,d),u.dispatchEvent(_),_.defaultPrevented||(_r(xr(pt(u)),{select:!0}),document.activeElement===l&&$(u))}return()=>{u.removeEventListener(de,d),setTimeout(()=>{const _=new CustomEvent(pe,De);u.addEventListener(pe,f),u.dispatchEvent(_),_.defaultPrevented||$(l??document.body,{select:!0}),u.removeEventListener(pe,f),Te.remove(g)},0)}}},[u,d,f,g]);const b=s.useCallback(l=>{if(!r&&!o||g.paused)return;const m=l.key==="Tab"&&!l.altKey&&!l.ctrlKey&&!l.metaKey,_=document.activeElement;if(m&&_){const S=l.currentTarget,[w,E]=yr(S);w&&E?!l.shiftKey&&_===E?(l.preventDefault(),r&&$(w,{select:!0})):l.shiftKey&&_===w&&(l.preventDefault(),r&&$(E,{select:!0})):_===S&&l.preventDefault()}},[r,o,g.paused]);return c.jsx(M.div,{tabIndex:-1,...i,ref:h,onKeyDown:b})});dt.displayName=gr;function _r(e,{select:t=!1}={}){const r=document.activeElement;for(const o of e)if($(o,{select:t}),document.activeElement!==r)return}function yr(e){const t=pt(e),r=je(t,e),o=je(t.reverse(),e);return[r,o]}function pt(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function je(e,t){for(const r of e)if(!br(r,{upTo:t}))return r}function br(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function wr(e){return e instanceof HTMLInputElement&&"select"in e}function $(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&wr(e)&&t&&e.select()}}var Te=Er();function Er(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=Me(e,t),e.unshift(t)},remove(t){var r;e=Me(e,t),(r=e[0])==null||r.resume()}}}function Me(e,t){const r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function xr(e){return e.filter(t=>t.tagName!=="A")}var Sr="Portal",ft=s.forwardRef((e,t)=>{var u;const{container:r,...o}=e,[a,n]=s.useState(!1);ae(()=>n(!0),[]);const i=r||a&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return i?at.createPortal(c.jsx(M.div,{...o,ref:t}),i):null});ft.displayName=Sr;function Cr(e,t){return s.useReducer((r,o)=>t[r][o]??r,e)}var ue=e=>{const{present:t,children:r}=e,o=Nr(t),a=typeof r=="function"?r({present:o.isPresent}):s.Children.only(r),n=W(o.ref,Pr(a));return typeof r=="function"||o.isPresent?s.cloneElement(a,{ref:n}):null};ue.displayName="Presence";function Nr(e){const[t,r]=s.useState(),o=s.useRef({}),a=s.useRef(e),n=s.useRef("none"),i=e?"mounted":"unmounted",[u,p]=Cr(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const d=X(o.current);n.current=u==="mounted"?d:"none"},[u]),ae(()=>{const d=o.current,f=a.current;if(f!==e){const h=n.current,g=X(d);e?p("MOUNT"):g==="none"||(d==null?void 0:d.display)==="none"?p("UNMOUNT"):p(f&&h!==g?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,p]),ae(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,v=g=>{const l=X(o.current).includes(g.animationName);if(g.target===t&&l&&(p("ANIMATION_END"),!a.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},h=g=>{g.target===t&&(n.current=X(o.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else p("ANIMATION_END")},[t,p]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:s.useCallback(d=>{d&&(o.current=getComputedStyle(d)),r(d)},[])}}function X(e){return(e==null?void 0:e.animationName)||"none"}function Pr(e){var o,a;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var fe=0;function Or(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??$e()),document.body.insertAdjacentElement("beforeend",e[1]??$e()),fe++,()=>{fe===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),fe--}},[])}function $e(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var T=function(){return T=Object.assign||function(t){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},T.apply(this,arguments)};function vt(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(r[o[a]]=e[o[a]]);return r}function Rr(e,t,r){if(r||arguments.length===2)for(var o=0,a=t.length,n;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var ne="right-scroll-bar-position",oe="width-before-scroll-bar",Ar="with-scroll-bars-hidden",Dr="--removed-body-scroll-bar-size";function ve(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function jr(e,t){var r=O.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(o){var a=r.value;a!==o&&(r.value=o,r.callback(o,a))}}}})[0];return r.callback=t,r.facade}var Tr=typeof window<"u"?s.useLayoutEffect:s.useEffect,Ie=new WeakMap;function Mr(e,t){var r=jr(null,function(o){return e.forEach(function(a){return ve(a,o)})});return Tr(function(){var o=Ie.get(r);if(o){var a=new Set(o),n=new Set(e),i=r.current;a.forEach(function(u){n.has(u)||ve(u,null)}),n.forEach(function(u){a.has(u)||ve(u,i)})}Ie.set(r,e)},[e]),r}function $r(e){return e}function Ir(e,t){t===void 0&&(t=$r);var r=[],o=!1,a={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(n){var i=t(n,o);return r.push(i),function(){r=r.filter(function(u){return u!==i})}},assignSyncMedium:function(n){for(o=!0;r.length;){var i=r;r=[],i.forEach(n)}r={push:function(u){return n(u)},filter:function(){return r}}},assignMedium:function(n){o=!0;var i=[];if(r.length){var u=r;r=[],u.forEach(n),i=r}var p=function(){var f=i;i=[],f.forEach(n)},d=function(){return Promise.resolve().then(p)};d(),r={push:function(f){i.push(f),d()},filter:function(f){return i=i.filter(f),r}}}};return a}function Lr(e){e===void 0&&(e={});var t=Ir(null);return t.options=T({async:!0,ssr:!1},e),t}var ht=function(e){var t=e.sideCar,r=vt(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return s.createElement(o,T({},r))};ht.isSideCarExport=!0;function kr(e,t){return e.useMedium(t),ht}var mt=Lr(),he=function(){},se=s.forwardRef(function(e,t){var r=s.useRef(null),o=s.useState({onScrollCapture:he,onWheelCapture:he,onTouchMoveCapture:he}),a=o[0],n=o[1],i=e.forwardProps,u=e.children,p=e.className,d=e.removeScrollBar,f=e.enabled,v=e.shards,h=e.sideCar,g=e.noIsolation,b=e.inert,l=e.allowPinchZoom,m=e.as,_=m===void 0?"div":m,S=e.gapMode,w=vt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=h,x=Mr([r,t]),N=T(T({},w),a);return s.createElement(s.Fragment,null,f&&s.createElement(E,{sideCar:mt,removeScrollBar:d,shards:v,noIsolation:g,inert:b,setCallbacks:n,allowPinchZoom:!!l,lockRef:r,gapMode:S}),i?s.cloneElement(s.Children.only(u),T(T({},N),{ref:x})):s.createElement(_,T({},N,{className:p,ref:x}),u))});se.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};se.classNames={fullWidth:oe,zeroRight:ne};var Fr=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Wr(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Fr();return t&&e.setAttribute("nonce",t),e}function qr(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Br(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ur=function(){var e=0,t=null;return{add:function(r){e==0&&(t=Wr())&&(qr(t,r),Br(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Vr=function(){var e=Ur();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},gt=function(){var e=Vr(),t=function(r){var o=r.styles,a=r.dynamic;return e(o,a),null};return t},Hr={left:0,top:0,right:0,gap:0},me=function(e){return parseInt(e||"",10)||0},zr=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[me(r),me(o),me(a)]},Kr=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Hr;var t=zr(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}},Gr=gt(),H="data-scroll-locked",Yr=function(e,t,r,o){var a=e.left,n=e.top,i=e.right,u=e.gap;return r===void 0&&(r="margin"),`
|
|
2
|
+
.`.concat(Ar,` {
|
|
3
3
|
overflow: hidden `).concat(o,`;
|
|
4
4
|
padding-right: `).concat(u,"px ").concat(o,`;
|
|
5
5
|
}
|
|
@@ -16,55 +16,55 @@
|
|
|
16
16
|
`),r==="padding"&&"padding-right: ".concat(u,"px ").concat(o,";")].filter(Boolean).join(""),`
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
.`).concat(
|
|
19
|
+
.`).concat(ne,` {
|
|
20
20
|
right: `).concat(u,"px ").concat(o,`;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.`).concat(
|
|
23
|
+
.`).concat(oe,` {
|
|
24
24
|
margin-right: `).concat(u,"px ").concat(o,`;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
.`).concat(
|
|
27
|
+
.`).concat(ne," .").concat(ne,` {
|
|
28
28
|
right: 0 `).concat(o,`;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
.`).concat(
|
|
31
|
+
.`).concat(oe," .").concat(oe,` {
|
|
32
32
|
margin-right: 0 `).concat(o,`;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
body[`).concat(H,`] {
|
|
36
|
-
`).concat(
|
|
36
|
+
`).concat(Dr,": ").concat(u,`px;
|
|
37
37
|
}
|
|
38
|
-
`)},
|
|
38
|
+
`)},Le=function(){var e=parseInt(document.body.getAttribute(H)||"0",10);return isFinite(e)?e:0},Xr=function(){s.useEffect(function(){return document.body.setAttribute(H,(Le()+1).toString()),function(){var e=Le()-1;e<=0?document.body.removeAttribute(H):document.body.setAttribute(H,e.toString())}},[])},Zr=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,a=o===void 0?"margin":o;Xr();var n=s.useMemo(function(){return Kr(a)},[a]);return s.createElement(Gr,{styles:Yr(n,!t,a,r?"":"!important")})},we=!1;if(typeof window<"u")try{var Z=Object.defineProperty({},"passive",{get:function(){return we=!0,!0}});window.addEventListener("test",Z,Z),window.removeEventListener("test",Z,Z)}catch{we=!1}var B=we?{passive:!1}:!1,Qr=function(e){return e.tagName==="TEXTAREA"},_t=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Qr(e)&&r[t]==="visible")},Jr=function(e){return _t(e,"overflowY")},en=function(e){return _t(e,"overflowX")},ke=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var a=yt(e,o);if(a){var n=bt(e,o),i=n[1],u=n[2];if(i>u)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},tn=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},rn=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},yt=function(e,t){return e==="v"?Jr(t):en(t)},bt=function(e,t){return e==="v"?tn(t):rn(t)},nn=function(e,t){return e==="h"&&t==="rtl"?-1:1},on=function(e,t,r,o,a){var n=nn(e,window.getComputedStyle(t).direction),i=n*o,u=r.target,p=t.contains(u),d=!1,f=i>0,v=0,h=0;do{var g=bt(e,u),b=g[0],l=g[1],m=g[2],_=l-m-n*b;(b||_)&&yt(e,u)&&(v+=_,h+=b),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!p&&u!==document.body||p&&(t.contains(u)||t===u));return(f&&Math.abs(v)<1||!f&&Math.abs(h)<1)&&(d=!0),d},Q=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fe=function(e){return[e.deltaX,e.deltaY]},We=function(e){return e&&"current"in e?e.current:e},an=function(e,t){return e[0]===t[0]&&e[1]===t[1]},un=function(e){return`
|
|
39
39
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
40
40
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
41
|
-
`)},
|
|
41
|
+
`)},sn=0,U=[];function cn(e){var t=s.useRef([]),r=s.useRef([0,0]),o=s.useRef(),a=s.useState(sn++)[0],n=s.useState(gt)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var l=Rr([e.lockRef.current],(e.shards||[]).map(We),!0).filter(Boolean);return l.forEach(function(m){return m.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),l.forEach(function(m){return m.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=s.useCallback(function(l,m){if("touches"in l&&l.touches.length===2||l.type==="wheel"&&l.ctrlKey)return!i.current.allowPinchZoom;var _=Q(l),S=r.current,w="deltaX"in l?l.deltaX:S[0]-_[0],E="deltaY"in l?l.deltaY:S[1]-_[1],x,N=l.target,y=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in l&&y==="h"&&N.type==="range")return!1;var A=ke(y,N);if(!A)return!0;if(A?x=y:(x=y==="v"?"h":"v",A=ke(y,N)),!A)return!1;if(!o.current&&"changedTouches"in l&&(w||E)&&(o.current=x),!x)return!0;var R=o.current||x;return on(R,m,l,R==="h"?w:E)},[]),p=s.useCallback(function(l){var m=l;if(!(!U.length||U[U.length-1]!==n)){var _="deltaY"in m?Fe(m):Q(m),S=t.current.filter(function(x){return x.name===m.type&&(x.target===m.target||m.target===x.shadowParent)&&an(x.delta,_)})[0];if(S&&S.should){m.cancelable&&m.preventDefault();return}if(!S){var w=(i.current.shards||[]).map(We).filter(Boolean).filter(function(x){return x.contains(m.target)}),E=w.length>0?u(m,w[0]):!i.current.noIsolation;E&&m.cancelable&&m.preventDefault()}}},[]),d=s.useCallback(function(l,m,_,S){var w={name:l,delta:m,target:_,should:S,shadowParent:ln(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),f=s.useCallback(function(l){r.current=Q(l),o.current=void 0},[]),v=s.useCallback(function(l){d(l.type,Fe(l),l.target,u(l,e.lockRef.current))},[]),h=s.useCallback(function(l){d(l.type,Q(l),l.target,u(l,e.lockRef.current))},[]);s.useEffect(function(){return U.push(n),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:h}),document.addEventListener("wheel",p,B),document.addEventListener("touchmove",p,B),document.addEventListener("touchstart",f,B),function(){U=U.filter(function(l){return l!==n}),document.removeEventListener("wheel",p,B),document.removeEventListener("touchmove",p,B),document.removeEventListener("touchstart",f,B)}},[]);var g=e.removeScrollBar,b=e.inert;return s.createElement(s.Fragment,null,b?s.createElement(n,{styles:un(a)}):null,g?s.createElement(Zr,{gapMode:e.gapMode}):null)}function ln(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dn=kr(mt,cn);var wt=s.forwardRef(function(e,t){return s.createElement(se,T({},e,{ref:t,sideCar:dn}))});wt.classNames=se.classNames;var pn=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},V=new WeakMap,J=new WeakMap,ee={},ge=0,Et=function(e){return e&&(e.host||Et(e.parentNode))},fn=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=Et(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},vn=function(e,t,r,o){var a=fn(t,Array.isArray(e)?e:[e]);ee[r]||(ee[r]=new WeakMap);var n=ee[r],i=[],u=new Set,p=new Set(a),d=function(v){!v||u.has(v)||(u.add(v),d(v.parentNode))};a.forEach(d);var f=function(v){!v||p.has(v)||Array.prototype.forEach.call(v.children,function(h){if(u.has(h))f(h);else try{var g=h.getAttribute(o),b=g!==null&&g!=="false",l=(V.get(h)||0)+1,m=(n.get(h)||0)+1;V.set(h,l),n.set(h,m),i.push(h),l===1&&b&&J.set(h,!0),m===1&&h.setAttribute(r,"true"),b||h.setAttribute(o,"true")}catch(_){console.error("aria-hidden: cannot operate on ",h,_)}})};return f(t),u.clear(),ge++,function(){i.forEach(function(v){var h=V.get(v)-1,g=n.get(v)-1;V.set(v,h),n.set(v,g),h||(J.has(v)||v.removeAttribute(o),J.delete(v)),g||v.removeAttribute(r)}),ge--,ge||(V=new WeakMap,V=new WeakMap,J=new WeakMap,ee={})}},hn=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),a=pn(e);return a?(o.push.apply(o,Array.from(a.querySelectorAll("[aria-live]"))),vn(o,a,r,"aria-hidden")):function(){return null}},Se="Dialog",[xt,$o]=Zt(Se),[mn,D]=xt(Se),St=e=>{const{__scopeDialog:t,children:r,open:o,defaultOpen:a,onOpenChange:n,modal:i=!0}=e,u=s.useRef(null),p=s.useRef(null),[d=!1,f]=tr({prop:o,defaultProp:a,onChange:n});return c.jsx(mn,{scope:t,triggerRef:u,contentRef:p,contentId:le(),titleId:le(),descriptionId:le(),open:d,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(v=>!v),[f]),modal:i,children:r})};St.displayName=Se;var Ct="DialogTrigger",Nt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=D(Ct,r),n=W(t,a.triggerRef);return c.jsx(M.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Pe(a.open),...o,ref:n,onClick:I(e.onClick,a.onOpenToggle)})});Nt.displayName=Ct;var Ce="DialogPortal",[gn,Pt]=xt(Ce,{forceMount:void 0}),Ot=e=>{const{__scopeDialog:t,forceMount:r,children:o,container:a}=e,n=D(Ce,t);return c.jsx(gn,{scope:t,forceMount:r,children:s.Children.map(o,i=>c.jsx(ue,{present:r||n.open,children:c.jsx(ft,{asChild:!0,container:a,children:i})}))})};Ot.displayName=Ce;var ie="DialogOverlay",Rt=s.forwardRef((e,t)=>{const r=Pt(ie,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=D(ie,e.__scopeDialog);return n.modal?c.jsx(ue,{present:o||n.open,children:c.jsx(_n,{...a,ref:t})}):null});Rt.displayName=ie;var _n=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=D(ie,r);return c.jsx(wt,{as:xe,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(M.div,{"data-state":Pe(a.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),F="DialogContent",At=s.forwardRef((e,t)=>{const r=Pt(F,e.__scopeDialog),{forceMount:o=r.forceMount,...a}=e,n=D(F,e.__scopeDialog);return c.jsx(ue,{present:o||n.open,children:n.modal?c.jsx(yn,{...a,ref:t}):c.jsx(bn,{...a,ref:t})})});At.displayName=F;var yn=s.forwardRef((e,t)=>{const r=D(F,e.__scopeDialog),o=s.useRef(null),a=W(t,r.contentRef,o);return s.useEffect(()=>{const n=o.current;if(n)return hn(n)},[]),c.jsx(Dt,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:I(e.onCloseAutoFocus,n=>{var i;n.preventDefault(),(i=r.triggerRef.current)==null||i.focus()}),onPointerDownOutside:I(e.onPointerDownOutside,n=>{const i=n.detail.originalEvent,u=i.button===0&&i.ctrlKey===!0;(i.button===2||u)&&n.preventDefault()}),onFocusOutside:I(e.onFocusOutside,n=>n.preventDefault())})}),bn=s.forwardRef((e,t)=>{const r=D(F,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return c.jsx(Dt,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var i,u;(i=e.onCloseAutoFocus)==null||i.call(e,n),n.defaultPrevented||(o.current||(u=r.triggerRef.current)==null||u.focus(),n.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:n=>{var p,d;(p=e.onInteractOutside)==null||p.call(e,n),n.defaultPrevented||(o.current=!0,n.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const i=n.target;((d=r.triggerRef.current)==null?void 0:d.contains(i))&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&a.current&&n.preventDefault()}})}),Dt=s.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:n,...i}=e,u=D(F,r),p=s.useRef(null),d=W(t,p);return Or(),c.jsxs(c.Fragment,{children:[c.jsx(dt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:n,children:c.jsx(ct,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":Pe(u.open),...i,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(wn,{titleId:u.titleId}),c.jsx(xn,{contentRef:p,descriptionId:u.descriptionId})]})]})}),Ne="DialogTitle",jt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=D(Ne,r);return c.jsx(M.h2,{id:a.titleId,...o,ref:t})});jt.displayName=Ne;var Tt="DialogDescription",Mt=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=D(Tt,r);return c.jsx(M.p,{id:a.descriptionId,...o,ref:t})});Mt.displayName=Tt;var $t="DialogClose",It=s.forwardRef((e,t)=>{const{__scopeDialog:r,...o}=e,a=D($t,r);return c.jsx(M.button,{type:"button",...o,ref:t,onClick:I(e.onClick,()=>a.onOpenChange(!1))})});It.displayName=$t;function Pe(e){return e?"open":"closed"}var Lt="DialogTitleWarning",[Io,kt]=Xt(Lt,{contentName:F,titleName:Ne,docsSlug:"dialog"}),wn=({titleId:e})=>{const t=kt(Lt),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
42
42
|
|
|
43
43
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
44
44
|
|
|
45
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},
|
|
45
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},En="DialogDescriptionWarning",xn=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${kt(En).contentName}}.`;return s.useEffect(()=>{var n;const a=(n=e.current)==null?void 0:n.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Sn=St,Cn=Nt,Nn=Ot,Pn=Rt,On=At,Rn=jt,qe=Mt,An=It;const Dn={LG:"lg"};function jn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={exports:{}};/*!
|
|
46
46
|
Copyright (c) 2018 Jed Watson.
|
|
47
47
|
Licensed under the MIT License (MIT), see
|
|
48
48
|
http://jedwatson.github.io/classnames
|
|
49
|
-
*/var
|
|
49
|
+
*/var Ue;function Tn(){return Ue||(Ue=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Be)),Be.exports}var Mn=Tn();const $n=jn(Mn),In="_rotate_12t9p_1",Ln="_dash_12t9p_1",kn={"purpur-spinner":"_purpur-spinner_12t9p_2",rotate:In,"purpur-spinner--xxs":"_purpur-spinner--xxs_12t9p_6","purpur-spinner--xs":"_purpur-spinner--xs_12t9p_10","purpur-spinner--sm":"_purpur-spinner--sm_12t9p_14","purpur-spinner--md":"_purpur-spinner--md_12t9p_18","purpur-spinner--lg":"_purpur-spinner--lg_12t9p_22","purpur-spinner__circle":"_purpur-spinner__circle_12t9p_26",dash:Ln,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_12t9p_41","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_12t9p_44"},Ve=$n.bind(kn),K="purpur-spinner",Fn={SM:"sm"},Wn=({disabled:e=!1,negative:t=!1,size:r=Fn.SM,...o})=>c.jsx("div",{className:Ve(K,`${K}--${r}`),...o,children:c.jsx("svg",{viewBox:"0 0 50 50",children:c.jsx("circle",{className:Ve(`${K}__circle`,{[`${K}__circle--disabled`]:e,[`${K}__circle--negative`]:t}),cx:"25",cy:"25",r:"20"})})});function qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var He={exports:{}};/*!
|
|
50
50
|
Copyright (c) 2018 Jed Watson.
|
|
51
51
|
Licensed under the MIT License (MIT), see
|
|
52
52
|
http://jedwatson.github.io/classnames
|
|
53
|
-
*/var
|
|
53
|
+
*/var ze;function Bn(){return ze||(ze=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(He)),He.exports}var Un=Bn();const Vn=qn(Un),Hn={"purpur-button":"_purpur-button_w455q_1","purpur-button--xs":"_purpur-button--xs_w455q_33","purpur-button--icon-only":"_purpur-button--icon-only_w455q_36","purpur-button--sm":"_purpur-button--sm_w455q_39","purpur-button--md":"_purpur-button--md_w455q_45","purpur-button--lg":"_purpur-button--lg_w455q_51","purpur-button--full-width":"_purpur-button--full-width_w455q_57","purpur-button--primary":"_purpur-button--primary_w455q_60","purpur-button--disabled":"_purpur-button--disabled_w455q_64","purpur-button--primary-negative":"_purpur-button--primary-negative_w455q_70","purpur-button--secondary":"_purpur-button--secondary_w455q_82","purpur-button--secondary-negative":"_purpur-button--secondary-negative_w455q_93","purpur-button--expressive":"_purpur-button--expressive_w455q_104","purpur-button--expressive-negative":"_purpur-button--expressive-negative_w455q_114","purpur-button--negative":"_purpur-button--negative_w455q_126","purpur-button--destructive":"_purpur-button--destructive_w455q_133","purpur-button--destructive-negative":"_purpur-button--destructive-negative_w455q_143","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_w455q_153","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_w455q_166","purpur-button--text-negative":"_purpur-button--text-negative_w455q_181","purpur-button--text":"_purpur-button--text_w455q_181"},zn=Vn.bind(Hn),L="purpur-button",Ft=O.forwardRef(({children:e,className:t,disabled:r=!1,fullWidth:o=!1,iconOnly:a,loading:n=!1,negative:i=!1,onClick:u,size:p="md",variant:d,type:f="button",...v},h)=>{if(a&&d==="destructive")return null;const g=zn([L,`${L}--${i?`${d}-negative`:d}`,`${L}--${p}`],{[`${L}--icon-only`]:a,[`${L}--negative`]:i,[`${L}--full-width`]:o,[`${L}--disabled`]:r||n},t),b=m=>{r||n?m.preventDefault():u&&u(m)},l=!!v["aria-disabled"]||r||n;return c.jsxs("button",{className:g,type:f,ref:h,"aria-disabled":l,onClick:b,...v,children:[n&&c.jsx(Wn,{size:p===Dn.LG?"xs":"xxs",negative:i,disabled:l})," ",e]})});Ft.displayName="Button";function Kn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ke={exports:{}};/*!
|
|
54
54
|
Copyright (c) 2018 Jed Watson.
|
|
55
55
|
Licensed under the MIT License (MIT), see
|
|
56
56
|
http://jedwatson.github.io/classnames
|
|
57
|
-
*/var
|
|
57
|
+
*/var Ge;function Gn(){return Ge||(Ge=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o(u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Ke)),Ke.exports}var Yn=Gn();const Xn=Kn(Yn),te={"purpur-heading":"_purpur-heading_k9fhq_1","purpur-heading--hyphens":"_purpur-heading--hyphens_k9fhq_8","purpur-heading--negative":"_purpur-heading--negative_k9fhq_11","purpur-heading--subsection-100":"_purpur-heading--subsection-100_k9fhq_14","purpur-heading--title-100":"_purpur-heading--title-100_k9fhq_20","purpur-heading--title-200":"_purpur-heading--title-200_k9fhq_26","purpur-heading--title-300":"_purpur-heading--title-300_k9fhq_32","purpur-heading--title-400":"_purpur-heading--title-400_k9fhq_38","purpur-heading--title-500":"_purpur-heading--title-500_k9fhq_44","purpur-heading--title-600":"_purpur-heading--title-600_k9fhq_50","purpur-heading--title-700":"_purpur-heading--title-700_k9fhq_56","purpur-heading--display-25":"_purpur-heading--display-25_k9fhq_62","purpur-heading--display-50":"_purpur-heading--display-50_k9fhq_68","purpur-heading--display-100":"_purpur-heading--display-100_k9fhq_74","purpur-heading--display-200":"_purpur-heading--display-200_k9fhq_80"},Zn={TITLE100:"title-100"},re="purpur-heading",Wt=({children:e,className:t="",enableHyphenation:r=!1,negative:o=!1,tag:a,variant:n=Zn.TITLE100,...i})=>{const u=a,p=Xn([t,te[re],te[`${re}--${n}`],{[te[`${re}--hyphens`]]:r,[te[`${re}--negative`]]:o}]);return c.jsx(u,{className:p,...i,children:e})};Wt.displayName="Heading";function Qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ye={exports:{}};/*!
|
|
58
58
|
Copyright (c) 2018 Jed Watson.
|
|
59
59
|
Licensed under the MIT License (MIT), see
|
|
60
60
|
http://jedwatson.github.io/classnames
|
|
61
|
-
*/var
|
|
61
|
+
*/var Xe;function Jn(){return Xe||(Xe=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Ye)),Ye.exports}var eo=Jn();const to=Qn(eo),ro={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},no=to.bind(ro),Ze="purpur-icon",oo="md",ao=e=>e.filter(t=>Object.keys(t).length>=1).map(t=>`${t.name}="${t.value}"`).join(" "),io=({content:e="",title:t}={})=>{const r=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},t?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],o=t?`<title>${t}</title>`:"";return`<svg ${ao(r)}>${o}${e}</svg>`},uo=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),qt=({svg:e,allyTitle:t,className:r,size:o=oo,...a})=>{const n=io({content:uo(e.svg),title:t}),i=no(r,Ze,`${Ze}--${o}`);return c.jsx("span",{className:i,dangerouslySetInnerHTML:{__html:n},...a})};qt.displayName="Icon";const so={name:"close",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["close"],category:"utility"},Bt=e=>c.jsx(qt,{...e,svg:so});Bt.displayName="IconClose";function co(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qe={exports:{}};/*!
|
|
62
62
|
Copyright (c) 2018 Jed Watson.
|
|
63
63
|
Licensed under the MIT License (MIT), see
|
|
64
64
|
http://jedwatson.github.io/classnames
|
|
65
|
-
*/var
|
|
65
|
+
*/var Je;function lo(){return Je||(Je=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(Qe)),Qe.exports}var po=lo();const fo=co(po),vo={"purpur-paragraph":"_purpur-paragraph_1rh57_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_1rh57_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_1rh57_10","purpur-paragraph--negative":"_purpur-paragraph--negative_1rh57_13","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_1rh57_16","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_1rh57_22","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_1rh57_29","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_1rh57_36","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_1rh57_42","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_1rh57_48","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_1rh57_54","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_1rh57_60","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_1rh57_67","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_1rh57_75"},ho=fo.bind(vo),mo={PARAGRAPH100:"paragraph-100"},G="purpur-paragraph",Ut=({children:e,className:t,disabled:r,enableHyphenation:o=!1,negative:a=!1,variant:n=mo.PARAGRAPH100,...i})=>{const u=ho(t,G,`${G}--${n}`,{[`${G}--hyphens`]:o,[`${G}--disabled`]:r,[`${G}--negative`]:a});return c.jsx("p",{...i,className:u,children:e})};Ut.displayName="Paragraph";function et(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function go(...e){return t=>{let r=!1;const o=e.map(a=>{const n=et(a,t);return!r&&typeof n=="function"&&(r=!0),n});if(r)return()=>{for(let a=0;a<o.length;a++){const n=o[a];typeof n=="function"?n():et(e[a],null)}}}}var Vt=s.forwardRef((e,t)=>{const{children:r,...o}=e,a=s.Children.toArray(r),n=a.find(yo);if(n){const i=n.props.children,u=a.map(p=>p===n?s.Children.count(i)>1?s.Children.only(null):s.isValidElement(i)?i.props.children:null:p);return c.jsx(Ee,{...o,ref:t,children:s.isValidElement(i)?s.cloneElement(i,void 0,u):null})}return c.jsx(Ee,{...o,ref:t,children:r})});Vt.displayName="Slot";var Ee=s.forwardRef((e,t)=>{const{children:r,...o}=e;if(s.isValidElement(r)){const a=wo(r),n=bo(o,r.props);return r.type!==s.Fragment&&(n.ref=t?go(t,a):a),s.cloneElement(r,n)}return s.Children.count(r)>1?s.Children.only(null):null});Ee.displayName="SlotClone";var _o=({children:e})=>c.jsx(c.Fragment,{children:e});function yo(e){return s.isValidElement(e)&&e.type===_o}function bo(e,t){const r={...t};for(const o in t){const a=e[o],n=t[o];/^on[A-Z]/.test(o)?a&&n?r[o]=(...i)=>{n(...i),a(...i)}:a&&(r[o]=a):o==="style"?r[o]={...a,...n}:o==="className"&&(r[o]=[a,n].filter(Boolean).join(" "))}return{...e,...r}}function wo(e){var t,r;let o=(t=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:t.get,a=o&&"isReactWarning"in o&&o.isReactWarning;return a?e.ref:(o=(r=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:r.get,a=o&&"isReactWarning"in o&&o.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Eo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],xo=Eo.reduce((e,t)=>{const r=s.forwardRef((o,a)=>{const{asChild:n,...i}=o,u=n?Vt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(u,{...i,ref:a})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),So="VisuallyHidden",Ht=s.forwardRef((e,t)=>c.jsx(xo.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Ht.displayName=So;var Co=Ht;const No=({asChild:e,children:t,...r})=>c.jsx(Co,{asChild:e,...r,children:t});function Po(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _e={exports:{}};/*!
|
|
66
66
|
Copyright (c) 2018 Jed Watson.
|
|
67
67
|
Licensed under the MIT License (MIT), see
|
|
68
68
|
http://jedwatson.github.io/classnames
|
|
69
|
-
*/var
|
|
69
|
+
*/var tt;function Oo(){return tt||(tt=1,function(e){(function(){var t={}.hasOwnProperty;function r(){for(var n="",i=0;i<arguments.length;i++){var u=arguments[i];u&&(n=a(n,o.call(this,u)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return this&&this[n]||n;if(typeof n!="object")return"";if(Array.isArray(n))return r.apply(this,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var u in n)t.call(n,u)&&n[u]&&(i=a(i,this&&this[u]||u));return i}function a(n,i){return i?n?n+" "+i:n+i:n}e.exports?(r.default=r,e.exports=r):window.classNames=r})()}(_e)),_e.exports}var Ro=Oo();const Ao=Po(Ro),Do="_fadeIn_4aird_1",jo={"purpur-modal-content":"_purpur-modal-content_4aird_1",fadeIn:Do,"purpur-modal-content__overlay":"_purpur-modal-content__overlay_4aird_30","purpur-modal-content__close-button":"_purpur-modal-content__close-button_4aird_37","purpur-modal-content__wrapper":"_purpur-modal-content__wrapper_4aird_47","purpur-modal-content__wrapper-inner":"_purpur-modal-content__wrapper-inner_4aird_57","purpur-modal-content__image-wrapper":"_purpur-modal-content__image-wrapper_4aird_61","purpur-modal-content__header":"_purpur-modal-content__header_4aird_84","purpur-modal-content__title":"_purpur-modal-content__title_4aird_97","purpur-modal-content__description":"_purpur-modal-content__description_4aird_100","purpur-modal-content__body":"_purpur-modal-content__body_4aird_103","purpur-modal-content__body-inner":"_purpur-modal-content__body-inner_4aird_111","purpur-modal-content__actions-buttons":"_purpur-modal-content__actions-buttons_4aird_123","purpur-modal-content__notification":"_purpur-modal-content__notification_4aird_141","purpur-modal-content--with-image":"_purpur-modal-content--with-image_4aird_144","purpur-modal-content--overflow":"_purpur-modal-content--overflow_4aird_144","purpur-modal-content__actions":"_purpur-modal-content__actions_4aird_123","purpur-modal-content__actions-separator":"_purpur-modal-content__actions-separator_4aird_175","purpur-modal-content--sticky-footer":"_purpur-modal-content--sticky-footer_4aird_185"},rt=e=>e.showCloseButton===!0,P=Ao.bind(jo),C="purpur-modal-content",To=O.forwardRef(({["data-testid"]:e,actions:t,children:r,className:o,description:a,disableCloseOnClickOutside:n,hideDescription:i,image:u,stickyButtons:p=!0,title:d,notification:f=void 0,zIndex:v,onCloseAutoFocus:h,...g},b)=>{const{closeButtonAriaLabel:l,showCloseButton:m,..._}=g,[S,w]=O.useState(!1),[E,x]=O.useState(0),N=O.useRef(null),y=O.useRef(null),A=P(C,{[`${C}--with-image`]:!!u},{[`${C}--overflow`]:S},{[`${C}--sticky-footer`]:p},o),R=j=>e?`${e} ${j}`:void 0,z=j=>{n&&j.preventDefault()},q=O.useCallback(()=>{if(!N.current||!y.current)return;const j=window.getComputedStyle(N.current,null),Y=parseFloat(j.getPropertyValue("height")),Gt=y.current.offsetHeight;w(Y<Gt),x((N.current.offsetWidth??0)-(N.current.clientWidth??0))},[]),zt=()=>{const j=y.current;if(j){const Y=j.querySelector("h2");Y&&setTimeout(()=>{Y.focus()})}},Kt=j=>{n&&!m&&j.preventDefault()};return O.useEffect(()=>(window.addEventListener("resize",q),()=>{window.removeEventListener("resize",q)}),[q]),O.useEffect(()=>{q()},[f,r,q]),c.jsxs(Nn,{children:[c.jsx(Pn,{className:P(`${C}__overlay`),style:{zIndex:v}}),c.jsxs(On,{..._,className:A,"data-testid":e,ref:b,...!a&&{"aria-describedby":void 0},onPointerDownOutside:z,onOpenAutoFocus:()=>{q(),zt()},onEscapeKeyDown:Kt,onCloseAutoFocus:h,style:{zIndex:`calc(${v} + 1)`},children:[c.jsxs("div",{ref:N,className:P(`${C}__wrapper`),children:[rt(g)&&l&&u&&c.jsx(nt,{"aria-label":l,hasImage:!0,scrollbarWidth:E,"data-testid":R("close-button")}),c.jsxs("div",{ref:y,className:P(`${C}__wrapper-inner`),children:[c.jsxs("div",{className:P(`${C}__header`),children:[rt(g)&&l&&!u&&c.jsx(nt,{"aria-label":l,"data-testid":R("close-button")}),c.jsx(Rn,{asChild:!0,className:P(`${C}__title`),"data-testid":R("title"),children:c.jsx(Wt,{tag:"h2",variant:"title-200",tabIndex:-1,children:d})})]}),u&&c.jsx("div",{className:P(`${C}__image-wrapper`),"data-testid":R("image"),children:u}),c.jsx("div",{className:P(`${C}__body`),children:c.jsxs("div",{className:P(`${C}__body-inner`),children:[a&&i&&c.jsx(No,{asChild:!0,children:c.jsx(qe,{"data-testid":R("description"),children:a})}),a&&!i&&c.jsx(qe,{asChild:!0,className:P(`${C}__description`),"data-testid":R("description"),children:c.jsx(Ut,{variant:"paragraph-100",children:a})}),c.jsx("div",{children:r}),!p&&c.jsx(ot,{actions:t,notification:f})]})})]})]}),p&&c.jsx(ot,{actions:t,notification:f})]})]})}),nt=({["aria-label"]:e,hasImage:t,scrollbarWidth:r,["data-testid"]:o})=>c.jsx(An,{asChild:!0,children:c.jsx(Ft,{variant:t?"primary":"tertiary-purple",negative:t,size:"sm",iconOnly:!0,"aria-label":e,className:P(`${C}__close-button`),style:{right:`calc(var(--purpur-spacing-100) + ${r||0}px)`},"data-testid":o,children:c.jsx(Bt,{})})}),ot=({actions:e,notification:t})=>{const r=O.useRef(null);return O.useEffect(()=>{var o,a;t&&((a=(o=r==null?void 0:r.current)==null?void 0:o.scrollIntoView)==null||a.call(o,!1))},[t]),e?c.jsxs("div",{className:P(`${C}__actions`),children:[c.jsx("div",{className:P(`${C}__actions-buttons`),"data-testid":"modal actions",children:e}),t&&c.jsx("div",{className:P(`${C}__notification`),ref:r,children:t}),c.jsx("span",{className:P(`${C}__actions-separator`)})]}):null},Mo=O.forwardRef(({children:e,...t},r)=>c.jsx(Cn,{asChild:!0,ref:r,...t,children:e})),ce=({["data-testid"]:e,children:t,open:r,onOpenChange:o})=>c.jsx(Sn,{open:r,onOpenChange:o,"data-testid":e,children:t});ce.Trigger=Mo;ce.Content=To;ce.displayName="Modal";exports.Modal=ce;
|
|
70
70
|
//# sourceMappingURL=modal.cjs.js.map
|