12 |
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[87373],{87373:function(e,o,t){t.d(o,{Eh:function(){return U},VY:function(){return S},fC:function(){return W},h_:function(){return B},xz:function(){return Y}});var n=t(57384),r=t(67597),a=t(90149),c=t(71641),u=t(61544),s=t(30945),i=t(57565),l=t(98791),p=t(57458),d=t(26550),f=t(74431),v=t(8591),h=t(4300),g=t(12189),E=t(82305),m=t(78440),P=t(76444);const C="Popover",[O,_]=(0,u.b)(C,[d.D7]),w=(0,d.D7)(),[b,R]=O(C),F=e=>{const{__scopePopover:o,children:t,open:n,defaultOpen:a,onOpenChange:c,modal:u=!1}=e,s=w(o),i=(0,r.useRef)(null),[l,f]=(0,r.useState)(!1),[v=!1,h]=(0,E.T)({prop:n,defaultProp:a,onChange:c});return(0,r.createElement)(d.fC,s,(0,r.createElement)(b,{scope:o,contentId:(0,p.M)(),triggerRef:i,open:v,onOpenChange:h,onOpenToggle:(0,r.useCallback)((()=>h((e=>!e))),[h]),hasCustomAnchor:l,onCustomAnchorAdd:(0,r.useCallback)((()=>f(!0)),[]),onCustomAnchorRemove:(0,r.useCallback)((()=>f(!1)),[]),modal:u},t))},D="PopoverTrigger",A=(0,r.forwardRef)(((e,o)=>{const{__scopePopover:t,...u}=e,s=R(D,t),i=w(t),l=(0,c.e)(o,s.triggerRef),p=(0,r.createElement)(h.WV.button,(0,n.Z)({type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":N(s.open)},u,{ref:l,onClick:(0,a.M)(e.onClick,s.onOpenToggle)}));return s.hasCustomAnchor?p:(0,r.createElement)(d.ee,(0,n.Z)({asChild:!0},i),p)})),x="PopoverPortal",[M,k]=O(x,{forceMount:void 0}),Z=e=>{const{__scopePopover:o,forceMount:t,children:n,container:a}=e,c=R(x,o);return(0,r.createElement)(M,{scope:o,forceMount:t},(0,r.createElement)(v.z,{present:t||c.open},(0,r.createElement)(f.h,{asChild:!0,container:a},n)))},y="PopoverContent",I=(0,r.forwardRef)(((e,o)=>{const t=k(y,e.__scopePopover),{forceMount:a=t.forceMount,...c}=e,u=R(y,e.__scopePopover);return(0,r.createElement)(v.z,{present:a||u.open},u.modal?(0,r.createElement)(T,(0,n.Z)({},c,{ref:o})):(0,r.createElement)(z,(0,n.Z)({},c,{ref:o})))})),T=(0,r.forwardRef)(((e,o)=>{const t=R(y,e.__scopePopover),u=(0,r.useRef)(null),s=(0,c.e)(o,u),i=(0,r.useRef)(!1);return(0,r.useEffect)((()=>{const e=u.current;if(e)return(0,m.Ry)(e)}),[]),(0,r.createElement)(P.Z,{as:g.g7,allowPinchZoom:!0},(0,r.createElement)(K,(0,n.Z)({},e,{ref:s,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.M)(e.onCloseAutoFocus,(e=>{var o;e.preventDefault(),i.current||null===(o=t.triggerRef.current)||void 0===o||o.focus()})),onPointerDownOutside:(0,a.M)(e.onPointerDownOutside,(e=>{const o=e.detail.originalEvent,t=0===o.button&&!0===o.ctrlKey,n=2===o.button||t;i.current=n}),{checkForDefaultPrevented:!1}),onFocusOutside:(0,a.M)(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})))})),z=(0,r.forwardRef)(((e,o)=>{const t=R(y,e.__scopePopover),a=(0,r.useRef)(!1),c=(0,r.useRef)(!1);return(0,r.createElement)(K,(0,n.Z)({},e,{ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var n,r;(null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,o),o.defaultPrevented)||(a.current||null===(r=t.triggerRef.current)||void 0===r||r.focus(),o.preventDefault());a.current=!1,c.current=!1},onInteractOutside:o=>{var n,r;null===(n=e.onInteractOutside)||void 0===n||n.call(e,o),o.defaultPrevented||(a.current=!0,"pointerdown"===o.detail.originalEvent.type&&(c.current=!0));const u=o.target;(null===(r=t.triggerRef.current)||void 0===r?void 0:r.contains(u))&&o.preventDefault(),"focusin"===o.detail.originalEvent.type&&c.current&&o.preventDefault()}}))})),K=(0,r.forwardRef)(((e,o)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:c,onCloseAutoFocus:u,disableOutsidePointerEvents:p,onEscapeKeyDown:f,onPointerDownOutside:v,onFocusOutside:h,onInteractOutside:g,...E}=e,m=R(y,t),P=w(t);return(0,i.EW)(),(0,r.createElement)(l.M,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:c,onUnmountAutoFocus:u},(0,r.createElement)(s.XB,{asChild:!0,disableOutsidePointerEvents:p,onInteractOutside:g,onEscapeKeyDown:f,onPointerDownOutside:v,onFocusOutside:h,onDismiss:()=>m.onOpenChange(!1)},(0,r.createElement)(d.VY,(0,n.Z)({"data-state":N(m.open),role:"dialog",id:m.contentId},P,E,{ref:o,style:{...E.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}}))))})),V=(0,r.forwardRef)(((e,o)=>{const{__scopePopover:t,...a}=e,c=w(t);return(0,r.createElement)(d.Eh,(0,n.Z)({},c,a,{ref:o}))}));function N(e){return e?"open":"closed"}const W=F,Y=A,B=Z,S=I,U=V}}]);
- //# sourceMappingURL=87373-f5928cded20f4167.js.map
|