Files

1 line
8.3 KiB
JavaScript
Raw Permalink Normal View History

2025-12-10 12:17:30 -05:00
"use strict";(globalThis.webpackChunkcomplianz_gdpr=globalThis.webpackChunkcomplianz_gdpr||[]).push([[2848],{7971:(e,n,t)=>{t.d(n,{C:()=>c});var r=t(51609),o=t(75795),a=t(91071),u=t(88200);const c=e=>{const{present:n,children:t}=e,c=function(e){const[n,t]=(0,r.useState)(),a=(0,r.useRef)({}),c=(0,r.useRef)(e),i=(0,r.useRef)("none"),d=e?"mounted":"unmounted",[l,f]=function(e,n){return(0,r.useReducer)(((e,t)=>{const r=n[e][t];return null!=r?r:e}),e)}(d,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return(0,r.useEffect)((()=>{const e=s(a.current);i.current="mounted"===l?e:"none"}),[l]),(0,u.N)((()=>{const n=a.current,t=c.current;if(t!==e){const r=i.current,o=s(n);e?f("MOUNT"):"none"===o||"none"===(null==n?void 0:n.display)?f("UNMOUNT"):f(t&&r!==o?"ANIMATION_OUT":"UNMOUNT"),c.current=e}}),[e,f]),(0,u.N)((()=>{if(n){const e=e=>{const t=s(a.current).includes(e.animationName);e.target===n&&t&&(0,o.flushSync)((()=>f("ANIMATION_END")))},t=e=>{e.target===n&&(i.current=s(a.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),()=>{n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}f("ANIMATION_END")}),[n,f]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:(0,r.useCallback)((e=>{e&&(a.current=getComputedStyle(e)),t(e)}),[])}}(n),i="function"==typeof t?t({present:c.isPresent}):r.Children.only(t),d=(0,a.s)(c.ref,i.ref);return"function"==typeof t||c.isPresent?(0,r.cloneElement)(i,{ref:d}):null};function s(e){return(null==e?void 0:e.animationName)||"none"}c.displayName="Presence"},62848:(e,n,t)=>{t.d(n,{C1:()=>$,q7:()=>Y,bL:()=>W});var r=t(58168),o=t(51609),a=t(9957),u=t(91071),c=t(62133),s=t(12579),i=t(16214),d=t(18723),l=t(10263),f=t(81351),m=t(71427);const p="rovingFocusGroup.onEntryFocus",v={bubbles:!1,cancelable:!0},b="RovingFocusGroup",[E,w,h]=(0,i.N)(b),[A,R]=(0,c.A)(b,[h]),[g,k]=A(b),I=(0,o.forwardRef)(((e,n)=>(0,o.createElement)(E.Provider,{scope:e.__scopeRovingFocusGroup},(0,o.createElement)(E.Slot,{scope:e.__scopeRovingFocusGroup},(0,o.createElement)(y,(0,r.A)({},e,{ref:n})))))),y=(0,o.forwardRef)(((e,n)=>{const{__scopeRovingFocusGroup:t,orientation:c,loop:i=!1,dir:d,currentTabStopId:b,defaultCurrentTabStopId:E,onCurrentTabStopIdChange:h,onEntryFocus:A,...R}=e,k=(0,o.useRef)(null),I=(0,u.s)(n,k),y=(0,m.jH)(d),[T=null,C]=(0,f.i)({prop:b,defaultProp:E,onChange:h}),[_,F]=(0,o.useState)(!1),S=(0,l.c)(A),L=w(t),D=(0,o.useRef)(!1),[G,M]=(0,o.useState)(0);return(0,o.useEffect)((()=>{const e=k.current;if(e)return e.addEventListener(p,S),()=>e.removeEventListener(p,S)}),[S]),(0,o.createElement)(g,{scope:t,orientation:c,dir:y,loop:i,currentTabStopId:T,onItemFocus:(0,o.useCallback)((e=>C(e)),[C]),onItemShiftTab:(0,o.useCallback)((()=>F(!0)),[]),onFocusableItemAdd:(0,o.useCallback)((()=>M((e=>e+1))),[]),onFocusableItemRemove:(0,o.useCallback)((()=>M((e=>e-1))),[])},(0,o.createElement)(s.sG.div,(0,r.A)({tabIndex:_||0===G?-1:0,"data-orientation":c},R,{ref:I,style:{outline:"none",...e.style},onMouseDown:(0,a.m)(e.onMouseDown,(()=>{D.current=!0})),onFocus:(0,a.m)(e.onFocus,(e=>{const n=!D.current;if(e.target===e.currentTarget&&n&&!_){const n=new CustomEvent(p,v);if(e.currentTarget.dispatchEvent(n),!n.defaultPrevented){const e=L().filter((e=>e.focusable));N([e.find((e=>e.active)),e.find((e=>e.id===T)),...e].filter(Boolean).map((e=>e.ref.current)))}}D.current=!1})),onBlur:(0,a.m)(e.onBlur,(()=>F(!1)))})))})),T=(0,o.forwardRef)(((e,n)=>{const{__scopeRovingFocusGroup:t,focusable:u=!0,active:c=!1,tabStopId:i,...l}=e,f=(0,d.B)(),m=i||f,p=k("RovingFocusGroupItem",t),v=p.currentTabStopId===m,b=w(t),{onFocusableItemAdd:h,onFocusableItemRemove:A}=p;return(0,o.useEffect)((()=>{if(u)return h(),()=>A()}),[u,h,A]),(0,o.createElement)(E.ItemSlot,{scope:t,id:m,focusable:u,active:c},(0,o.createElement)(s.sG.span,(0,r.A)({tabIndex:v?0:-1,"data-orientation":p.orientation},l,{ref:n,onMouseDow