2024-01-31 07:59:56 -05:00
/******/ ( ( ) => { // webpackBootstrap
2024-09-19 21:55:35 -04:00
/******/ "use strict" ;
/******/ var _ _webpack _modules _ _ = ( { } ) ;
2023-06-27 10:24:19 -04:00
/************************************************************************/
/******/ // The module cache
/******/ var _ _webpack _module _cache _ _ = { } ;
/******/
/******/ // The require function
/******/ function _ _webpack _require _ _ ( moduleId ) {
/******/ // Check if module is in cache
/******/ var cachedModule = _ _webpack _module _cache _ _ [ moduleId ] ;
/******/ if ( cachedModule !== undefined ) {
/******/ return cachedModule . exports ;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = _ _webpack _module _cache _ _ [ moduleId ] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports : { }
/******/ } ;
/******/
/******/ // Execute the module function
/******/ _ _webpack _modules _ _ [ moduleId ] ( module , module . exports , _ _webpack _require _ _ ) ;
/******/
/******/ // Return the exports of the module
/******/ return module . exports ;
/******/ }
/******/
/************************************************************************/
2024-09-19 21:55:35 -04:00
/******/ /* webpack/runtime/create fake namespace object */
2024-01-31 07:59:56 -05:00
/******/ ( ( ) => {
2024-09-19 21:55:35 -04:00
/******/ var getProto = Object . getPrototypeOf ? ( obj ) => ( Object . getPrototypeOf ( obj ) ) : ( obj ) => ( obj . _ _proto _ _ ) ;
/******/ var leafPrototypes ;
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 16: return value when it's Promise-like
/******/ // mode & 8|1: behave like require
/******/ _ _webpack _require _ _ . t = function ( value , mode ) {
/******/ if ( mode & 1 ) value = this ( value ) ;
/******/ if ( mode & 8 ) return value ;
/******/ if ( typeof value === 'object' && value ) {
/******/ if ( ( mode & 4 ) && value . _ _esModule ) return value ;
/******/ if ( ( mode & 16 ) && typeof value . then === 'function' ) return value ;
/******/ }
/******/ var ns = Object . create ( null ) ;
/******/ _ _webpack _require _ _ . r ( ns ) ;
/******/ var def = { } ;
/******/ leafPrototypes = leafPrototypes || [ null , getProto ( { } ) , getProto ( [ ] ) , getProto ( getProto ) ] ;
/******/ for ( var current = mode & 2 && value ; typeof current == 'object' && ! ~ leafPrototypes . indexOf ( current ) ; current = getProto ( current ) ) {
/******/ Object . getOwnPropertyNames ( current ) . forEach ( ( key ) => ( def [ key ] = ( ) => ( value [ key ] ) ) ) ;
/******/ }
/******/ def [ 'default' ] = ( ) => ( value ) ;
/******/ _ _webpack _require _ _ . d ( ns , def ) ;
/******/ return ns ;
2023-06-27 10:24:19 -04:00
/******/ } ;
2024-01-31 07:59:56 -05:00
/******/ } ) ( ) ;
2023-06-27 10:24:19 -04:00
/******/
/******/ /* webpack/runtime/define property getters */
2024-01-31 07:59:56 -05:00
/******/ ( ( ) => {
2023-06-27 10:24:19 -04:00
/******/ // define getter functions for harmony exports
2024-01-31 07:59:56 -05:00
/******/ _ _webpack _require _ _ . d = ( exports , definition ) => {
2023-06-27 10:24:19 -04:00
/******/ for ( var key in definition ) {
/******/ if ( _ _webpack _require _ _ . o ( definition , key ) && ! _ _webpack _require _ _ . o ( exports , key ) ) {
/******/ Object . defineProperty ( exports , key , { enumerable : true , get : definition [ key ] } ) ;
/******/ }
/******/ }
/******/ } ;
2024-01-31 07:59:56 -05:00
/******/ } ) ( ) ;
2023-06-27 10:24:19 -04:00
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
2024-01-31 07:59:56 -05:00
/******/ ( ( ) => {
/******/ _ _webpack _require _ _ . o = ( obj , prop ) => ( Object . prototype . hasOwnProperty . call ( obj , prop ) )
/******/ } ) ( ) ;
2023-06-27 10:24:19 -04:00
/******/
/******/ /* webpack/runtime/make namespace object */
2024-01-31 07:59:56 -05:00
/******/ ( ( ) => {
2023-06-27 10:24:19 -04:00
/******/ // define __esModule on exports
2024-01-31 07:59:56 -05:00
/******/ _ _webpack _require _ _ . r = ( exports ) => {
2023-06-27 10:24:19 -04:00
/******/ if ( typeof Symbol !== 'undefined' && Symbol . toStringTag ) {
/******/ Object . defineProperty ( exports , Symbol . toStringTag , { value : 'Module' } ) ;
/******/ }
/******/ Object . defineProperty ( exports , '__esModule' , { value : true } ) ;
/******/ } ;
2024-01-31 07:59:56 -05:00
/******/ } ) ( ) ;
2023-06-27 10:24:19 -04:00
/******/
/******/ /* webpack/runtime/nonce */
2024-01-31 07:59:56 -05:00
/******/ ( ( ) => {
2023-06-27 10:24:19 -04:00
/******/ _ _webpack _require _ _ . nc = undefined ;
2024-01-31 07:59:56 -05:00
/******/ } ) ( ) ;
2023-06-27 10:24:19 -04:00
/******/
/************************************************************************/
var _ _webpack _exports _ _ = { } ;
// ESM COMPAT FLAG
_ _webpack _require _ _ . r ( _ _webpack _exports _ _ ) ;
// EXPORTS
_ _webpack _require _ _ . d ( _ _webpack _exports _ _ , {
2024-01-31 07:59:56 -05:00
CommandMenu : ( ) => ( /* reexport */ CommandMenu ) ,
privateApis : ( ) => ( /* reexport */ privateApis ) ,
store : ( ) => ( /* reexport */ store ) ,
useCommand : ( ) => ( /* reexport */ useCommand ) ,
useCommandLoader : ( ) => ( /* reexport */ useCommandLoader )
2023-06-27 10:24:19 -04:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/actions.js
var actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( actions _namespaceObject , {
2024-01-31 07:59:56 -05:00
close : ( ) => ( actions _close ) ,
open : ( ) => ( actions _open ) ,
registerCommand : ( ) => ( registerCommand ) ,
registerCommandLoader : ( ) => ( registerCommandLoader ) ,
unregisterCommand : ( ) => ( unregisterCommand ) ,
unregisterCommandLoader : ( ) => ( unregisterCommandLoader )
2023-06-27 10:24:19 -04:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/selectors.js
var selectors _namespaceObject = { } ;
_ _webpack _require _ _ . r ( selectors _namespaceObject ) ;
_ _webpack _require _ _ . d ( selectors _namespaceObject , {
2024-01-31 07:59:56 -05:00
getCommandLoaders : ( ) => ( getCommandLoaders ) ,
getCommands : ( ) => ( getCommands ) ,
getContext : ( ) => ( getContext ) ,
isOpen : ( ) => ( selectors _isOpen )
2023-06-27 10:24:19 -04:00
} ) ;
// NAMESPACE OBJECT: ./node_modules/@wordpress/commands/build-module/store/private-actions.js
var private _actions _namespaceObject = { } ;
_ _webpack _require _ _ . r ( private _actions _namespaceObject ) ;
_ _webpack _require _ _ . d ( private _actions _namespaceObject , {
2024-01-31 07:59:56 -05:00
setContext : ( ) => ( setContext )
2023-06-27 10:24:19 -04:00
} ) ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/cmdk/dist/chunk-NZJY6EH4.mjs
var U = 1 , Y = . 9 , H = . 8 , J = . 17 , p = . 1 , u = . 999 , $ = . 9999 ; var k = . 99 , m = /[\\\/_+.#"@\[\(\{&]/ , B = /[\\\/_+.#"@\[\(\{&]/g , K = /[\s-]/ , X = /[\s-]/g ; function G ( _ , C , h , P , A , f , O ) { if ( f === C . length ) return A === _ . length ? U : k ; var T = ` ${ A } , ${ f } ` ; if ( O [ T ] !== void 0 ) return O [ T ] ; for ( var L = P . charAt ( f ) , c = h . indexOf ( L , A ) , S = 0 , E , N , R , M ; c >= 0 ; ) E = G ( _ , C , h , P , c + 1 , f + 1 , O ) , E > S && ( c === A ? E *= U : m . test ( _ . charAt ( c - 1 ) ) ? ( E *= H , R = _ . slice ( A , c - 1 ) . match ( B ) , R && A > 0 && ( E *= Math . pow ( u , R . length ) ) ) : K . test ( _ . charAt ( c - 1 ) ) ? ( E *= Y , M = _ . slice ( A , c - 1 ) . match ( X ) , M && A > 0 && ( E *= Math . pow ( u , M . length ) ) ) : ( E *= J , A > 0 && ( E *= Math . pow ( u , c - A ) ) ) , _ . charAt ( c ) !== C . charAt ( f ) && ( E *= $ ) ) , ( E < p && h . charAt ( c - 1 ) === P . charAt ( f + 1 ) || P . charAt ( f + 1 ) === P . charAt ( f ) && h . charAt ( c - 1 ) !== P . charAt ( f ) ) && ( N = G ( _ , C , h , P , c + 1 , f + 2 , O ) , N * p > E && ( E = N * p ) ) , E > S && ( S = E ) , c = h . indexOf ( L , c + 1 ) ; return O [ T ] = S , S } function D ( _ ) { return _ . toLowerCase ( ) . replace ( X , " " ) } function W ( _ , C , h ) { return _ = h && h . length > 0 ? ` ${ _ + " " + h . join ( " " ) } ` : _ , G ( _ , C , D ( _ ) , D ( C ) , 0 , 0 , { } ) }
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
function _extends ( ) {
_extends = Object . assign ? Object . assign . bind ( ) : function ( target ) {
for ( var i = 1 ; i < arguments . length ; i ++ ) {
var source = arguments [ i ] ;
for ( var key in source ) {
if ( Object . prototype . hasOwnProperty . call ( source , key ) ) {
target [ key ] = source [ key ] ;
}
}
}
return target ;
} ;
return _extends . apply ( this , arguments ) ;
}
2024-05-31 14:59:00 -04:00
; // CONCATENATED MODULE: external "React"
const external _React _namespaceObject = window [ "React" ] ;
2024-09-19 21:55:35 -04:00
var external _React _namespaceObject _0 = /*#__PURE__*/ _ _webpack _require _ _ . t ( external _React _namespaceObject , 2 ) ;
; // CONCATENATED MODULE: ./node_modules/@radix-ui/primitive/dist/index.mjs
2023-06-27 10:24:19 -04:00
function $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( originalEventHandler , ourEventHandler , { checkForDefaultPrevented : checkForDefaultPrevented = true } = { } ) {
return function handleEvent ( event ) {
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler ( event ) ;
if ( checkForDefaultPrevented === false || ! event . defaultPrevented ) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler ( event ) ;
} ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-compose-refs/dist/index.mjs
2023-06-27 10:24:19 -04:00
/ * *
* Set a given ref to a given value
* This utility takes care of different types of refs : callback refs and RefObject ( s )
* / f u n c t i o n $ 6 e d 0 4 0 6 8 8 8 f 7 3 f c 4 $ v a r $ s e t R e f ( r e f , v a l u e ) {
if ( typeof ref === 'function' ) ref ( value ) ;
else if ( ref !== null && ref !== undefined ) ref . current = value ;
}
/ * *
* A utility to compose multiple refs together
* Accepts callback refs and RefObject ( s )
* / f u n c t i o n $ 6 e d 0 4 0 6 8 8 8 f 7 3 f c 4 $ e x p o r t $ 4 3 e 4 4 6 d 3 2 b 3 d 2 1 a f ( . . . r e f s ) {
return ( node ) => refs . forEach ( ( ref ) => $6ed0406888f73fc4$var$setRef ( ref , node )
)
;
}
/ * *
* A custom hook that composes multiple refs
* Accepts callback refs and RefObject ( s )
* / f u n c t i o n $ 6 e d 0 4 0 6 8 8 8 f 7 3 f c 4 $ e x p o r t $ c 7 b 2 c b e 3 5 5 2 a 0 d 0 5 ( . . . r e f s ) {
// eslint-disable-next-line react-hooks/exhaustive-deps
return ( 0 , external _React _namespaceObject . useCallback ) ( $6ed0406888f73fc4$export$43e446d32b3d21af ( ... refs ) , refs ) ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-context/dist/index.mjs
2023-06-27 10:24:19 -04:00
function $c512c27ab02ef895$export$fd42f52fd3ae1109 ( rootComponentName , defaultContext ) {
const Context = /*#__PURE__*/ ( 0 , external _React _namespaceObject . createContext ) ( defaultContext ) ;
function Provider ( props ) {
const { children : children , ... context } = props ; // Only re-memoize when prop values change
// eslint-disable-next-line react-hooks/exhaustive-deps
const value = ( 0 , external _React _namespaceObject . useMemo ) ( ( ) => context
, Object . values ( context ) ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( Context . Provider , {
value : value
} , children ) ;
}
function useContext ( consumerName ) {
const context = ( 0 , external _React _namespaceObject . useContext ) ( Context ) ;
if ( context ) return context ;
if ( defaultContext !== undefined ) return defaultContext ; // if a defaultContext wasn't specified, it's a required context.
throw new Error ( ` \` ${ consumerName } \` must be used within \` ${ rootComponentName } \` ` ) ;
}
Provider . displayName = rootComponentName + 'Provider' ;
return [
Provider ,
useContext
] ;
}
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* createContextScope
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / f u n c t i o n $ c 5 1 2 c 2 7 a b 0 2 e f 8 9 5 $ e x p o r t $ 5 0 c 7 b 4 e 9 d 9 f 1 9 c 1 ( s c o p e N a m e , c r e a t e C o n t e x t S c o p e D e p s = [ ] ) {
let defaultContexts = [ ] ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* createContext
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / f u n c t i o n $ c 5 1 2 c 2 7 a b 0 2 e f 8 9 5 $ e x p o r t $ f d 4 2 f 5 2 f d 3 a e 1 1 0 9 ( r o o t C o m p o n e n t N a m e , d e f a u l t C o n t e x t ) {
const BaseContext = /*#__PURE__*/ ( 0 , external _React _namespaceObject . createContext ) ( defaultContext ) ;
const index = defaultContexts . length ;
defaultContexts = [
... defaultContexts ,
defaultContext
] ;
function Provider ( props ) {
const { scope : scope , children : children , ... context } = props ;
const Context = ( scope === null || scope === void 0 ? void 0 : scope [ scopeName ] [ index ] ) || BaseContext ; // Only re-memoize when prop values change
// eslint-disable-next-line react-hooks/exhaustive-deps
const value = ( 0 , external _React _namespaceObject . useMemo ) ( ( ) => context
, Object . values ( context ) ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( Context . Provider , {
value : value
} , children ) ;
}
function useContext ( consumerName , scope ) {
const Context = ( scope === null || scope === void 0 ? void 0 : scope [ scopeName ] [ index ] ) || BaseContext ;
const context = ( 0 , external _React _namespaceObject . useContext ) ( Context ) ;
if ( context ) return context ;
if ( defaultContext !== undefined ) return defaultContext ; // if a defaultContext wasn't specified, it's a required context.
throw new Error ( ` \` ${ consumerName } \` must be used within \` ${ rootComponentName } \` ` ) ;
}
Provider . displayName = rootComponentName + 'Provider' ;
return [
Provider ,
useContext
] ;
}
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* createScope
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t c r e a t e S c o p e = ( ) = > {
const scopeContexts = defaultContexts . map ( ( defaultContext ) => {
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createContext ) ( defaultContext ) ;
} ) ;
return function useScope ( scope ) {
const contexts = ( scope === null || scope === void 0 ? void 0 : scope [ scopeName ] ) || scopeContexts ;
return ( 0 , external _React _namespaceObject . useMemo ) ( ( ) => ( {
[ ` __scope ${ scopeName } ` ] : {
... scope ,
[ scopeName ] : contexts
}
} )
, [
scope ,
contexts
] ) ;
} ;
} ;
createScope . scopeName = scopeName ;
return [
$c512c27ab02ef895$export$fd42f52fd3ae1109 ,
$c512c27ab02ef895$var$composeContextScopes ( createScope , ... createContextScopeDeps )
] ;
}
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* composeContextScopes
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / f u n c t i o n $ c 5 1 2 c 2 7 a b 0 2 e f 8 9 5 $ v a r $ c o m p o s e C o n t e x t S c o p e s ( . . . s c o p e s ) {
const baseScope = scopes [ 0 ] ;
if ( scopes . length === 1 ) return baseScope ;
const createScope1 = ( ) => {
const scopeHooks = scopes . map ( ( createScope ) => ( {
useScope : createScope ( ) ,
scopeName : createScope . scopeName
} )
) ;
return function useComposedScopes ( overrideScopes ) {
const nextScopes1 = scopeHooks . reduce ( ( nextScopes , { useScope : useScope , scopeName : scopeName } ) => {
// We are calling a hook inside a callback which React warns against to avoid inconsistent
// renders, however, scoping doesn't have render side effects so we ignore the rule.
// eslint-disable-next-line react-hooks/rules-of-hooks
const scopeProps = useScope ( overrideScopes ) ;
const currentScope = scopeProps [ ` __scope ${ scopeName } ` ] ;
return {
... nextScopes ,
... currentScope
} ;
} , { } ) ;
return ( 0 , external _React _namespaceObject . useMemo ) ( ( ) => ( {
[ ` __scope ${ baseScope . scopeName } ` ] : nextScopes1
} )
, [
nextScopes1
] ) ;
} ;
} ;
createScope1 . scopeName = baseScope . scopeName ;
return createScope1 ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
2023-06-27 10:24:19 -04:00
/ * *
* On the server , React emits a warning when calling ` useLayoutEffect ` .
* This is because neither ` useLayoutEffect ` nor ` useEffect ` run on the server .
* We use this safe version which suppresses the warning by replacing it with a noop on the server .
*
* See : https : //reactjs.org/docs/hooks-reference.html#uselayouteffect
* / c o n s t $ 9 f 7 9 6 5 9 8 8 6 9 4 6 c 1 6 $ e x p o r t $ e 5 c 5 a 5 f 9 1 7 a 5 8 7 1 c = B o o l e a n ( g l o b a l T h i s = = = n u l l | | g l o b a l T h i s = = = v o i d 0 ? v o i d 0 : g l o b a l T h i s . d o c u m e n t ) ? e x t e r n a l _ R e a c t _ n a m e s p a c e O b j e c t . u s e L a y o u t E f f e c t : ( ) = > { } ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-id/dist/index.mjs
2023-06-27 10:24:19 -04:00
2024-09-19 21:55:35 -04:00
const $1746a345f3d73bb7$var$useReactId = external _React _namespaceObject _0 [ 'useId' . toString ( ) ] || ( ( ) => undefined
2023-06-27 10:24:19 -04:00
) ;
let $1746a345f3d73bb7$var$count = 0 ;
function $1746a345f3d73bb7$export$f680877a34711e37 ( deterministicId ) {
const [ id , setId ] = external _React _namespaceObject . useState ( $1746a345f3d73bb7$var$useReactId ( ) ) ; // React versions older than 18 will have client-side ids only.
$9f79659886946c16$export$e5c5a5f917a5871c ( ( ) => {
if ( ! deterministicId ) setId ( ( reactId ) => reactId !== null && reactId !== void 0 ? reactId : String ( $1746a345f3d73bb7$var$count ++ )
) ;
} , [
deterministicId
] ) ;
return deterministicId || ( id ? ` radix- ${ id } ` : '' ) ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
2023-06-27 10:24:19 -04:00
/ * *
* A custom hook that converts a callback to a ref to avoid triggering re - renders when passed as a
* prop or avoid re - executing effects when passed as a dependency
* / f u n c t i o n $ b 1 b 2 3 1 4 f 5 f 9 a 1 d 8 4 $ e x p o r t $ 2 5 b e c 8 c 6 f 5 4 e e 7 9 a ( c a l l b a c k ) {
const callbackRef = ( 0 , external _React _namespaceObject . useRef ) ( callback ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
callbackRef . current = callback ;
} ) ; // https://github.com/facebook/react/issues/19240
return ( 0 , external _React _namespaceObject . useMemo ) ( ( ) => ( ... args ) => {
var _callbackRef$current ;
return ( _callbackRef$current = callbackRef . current ) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current . call ( callbackRef , ... args ) ;
}
, [ ] ) ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
2023-06-27 10:24:19 -04:00
function $71cd76cc60e0454e$export$6f32135080cb4c3 ( { prop : prop , defaultProp : defaultProp , onChange : onChange = ( ) => { } } ) {
const [ uncontrolledProp , setUncontrolledProp ] = $71cd76cc60e0454e$var$useUncontrolledState ( {
defaultProp : defaultProp ,
onChange : onChange
} ) ;
const isControlled = prop !== undefined ;
const value1 = isControlled ? prop : uncontrolledProp ;
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a ( onChange ) ;
const setValue = ( 0 , external _React _namespaceObject . useCallback ) ( ( nextValue ) => {
if ( isControlled ) {
const setter = nextValue ;
const value = typeof nextValue === 'function' ? setter ( prop ) : nextValue ;
if ( value !== prop ) handleChange ( value ) ;
} else setUncontrolledProp ( nextValue ) ;
} , [
isControlled ,
prop ,
setUncontrolledProp ,
handleChange
] ) ;
return [
value1 ,
setValue
] ;
}
function $71cd76cc60e0454e$var$useUncontrolledState ( { defaultProp : defaultProp , onChange : onChange } ) {
const uncontrolledState = ( 0 , external _React _namespaceObject . useState ) ( defaultProp ) ;
const [ value ] = uncontrolledState ;
const prevValueRef = ( 0 , external _React _namespaceObject . useRef ) ( value ) ;
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a ( onChange ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
if ( prevValueRef . current !== value ) {
handleChange ( value ) ;
prevValueRef . current = value ;
}
} , [
value ,
prevValueRef ,
handleChange
] ) ;
return uncontrolledState ;
}
; // CONCATENATED MODULE: external "ReactDOM"
2024-01-31 07:59:56 -05:00
const external _ReactDOM _namespaceObject = window [ "ReactDOM" ] ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-slot/dist/index.mjs
2023-06-27 10:24:19 -04:00
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Slot
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = / * # _ _PURE _ _ * / ( 0 , e x t e r n a l _ R e a c t _ n a m e s p a c e O b j e c t . f o r w a r d R e f ) ( ( p r o p s , f o r w a r d e d R e f ) = > {
const { children : children , ... slotProps } = props ;
const childrenArray = external _React _namespaceObject . Children . toArray ( children ) ;
const slottable = childrenArray . find ( $5e63c961fc1ce211$var$isSlottable ) ;
if ( slottable ) {
// the new element to render is the one passed as a child of `Slottable`
const newElement = slottable . props . children ;
const newChildren = childrenArray . map ( ( child ) => {
if ( child === slottable ) {
// because the new element will be the one rendered, we are only interested
// in grabbing its children (`newElement.props.children`)
if ( external _React _namespaceObject . Children . count ( newElement ) > 1 ) return external _React _namespaceObject . Children . only ( null ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . isValidElement ) ( newElement ) ? newElement . props . children : null ;
} else return child ;
} ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5e63c961fc1ce211$var$SlotClone , _extends ( { } , slotProps , {
ref : forwardedRef
} ) , /*#__PURE__*/ ( 0 , external _React _namespaceObject . isValidElement ) ( newElement ) ? /*#__PURE__*/ ( 0 , external _React _namespaceObject . cloneElement ) ( newElement , undefined , newChildren ) : null ) ;
}
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5e63c961fc1ce211$var$SlotClone , _extends ( { } , slotProps , {
ref : forwardedRef
} ) , children ) ;
} ) ;
$5e63c961fc1ce211$export$8c6ed5c666ac1360 . displayName = 'Slot' ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* SlotClone
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / const $5e63c961fc1ce211$var$SlotClone = / * # _ _PURE _ _ * / ( 0 , e x t e r n a l _ R e a c t _ n a m e s p a c e O b j e c t . f o r w a r d R e f ) ( ( p r o p s , f o r w a r d e d R e f ) = > {
const { children : children , ... slotProps } = props ;
if ( /*#__PURE__*/ ( 0 , external _React _namespaceObject . isValidElement ) ( children ) ) return /*#__PURE__*/ ( 0 , external _React _namespaceObject . cloneElement ) ( children , {
... $5e63c961fc1ce211$var$mergeProps ( slotProps , children . props ) ,
2024-09-19 21:55:35 -04:00
ref : forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af ( forwardedRef , children . ref ) : children . ref
2023-06-27 10:24:19 -04:00
} ) ;
return external _React _namespaceObject . Children . count ( children ) > 1 ? external _React _namespaceObject . Children . only ( null ) : null ;
} ) ;
$5e63c961fc1ce211$var$SlotClone . displayName = 'SlotClone' ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Slottable
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 e 6 3 c 9 6 1 f c 1 c e 2 1 1 $ e x p o r t $ d 9 f 1 c c f 0 b d b 0 5 d 4 5 = ( { c h i l d r e n : c h i l d r e n } ) = > {
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( external _React _namespaceObject . Fragment , null , children ) ;
} ;
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable ( child ) {
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . isValidElement ) ( child ) && child . type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 ;
}
function $5e63c961fc1ce211$var$mergeProps ( slotProps , childProps ) {
// all child props should override
const overrideProps = {
... childProps
} ;
for ( const propName in childProps ) {
const slotPropValue = slotProps [ propName ] ;
const childPropValue = childProps [ propName ] ;
2024-09-19 21:55:35 -04:00
const isHandler = /^on[A-Z]/ . test ( propName ) ;
if ( isHandler ) {
// if the handler exists on both, we compose them
if ( slotPropValue && childPropValue ) overrideProps [ propName ] = ( ... args ) => {
childPropValue ( ... args ) ;
slotPropValue ( ... args ) ;
} ;
else if ( slotPropValue ) overrideProps [ propName ] = slotPropValue ;
} else if ( propName === 'style' ) overrideProps [ propName ] = {
2023-06-27 10:24:19 -04:00
... slotPropValue ,
... childPropValue
} ;
else if ( propName === 'className' ) overrideProps [ propName ] = [
slotPropValue ,
childPropValue
] . filter ( Boolean ) . join ( ' ' ) ;
}
return {
... slotProps ,
... overrideProps
} ;
}
const $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = ( /* unused pure expression or super */ null && ( $5e63c961fc1ce211$export$8c6ed5c666ac1360 ) ) ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-primitive/dist/index.mjs
2023-06-27 10:24:19 -04:00
const $8927f6f2acc4f386$var$NODES = [
'a' ,
'button' ,
'div' ,
2024-09-19 21:55:35 -04:00
'form' ,
2023-06-27 10:24:19 -04:00
'h2' ,
'h3' ,
'img' ,
2024-09-19 21:55:35 -04:00
'input' ,
'label' ,
2023-06-27 10:24:19 -04:00
'li' ,
'nav' ,
'ol' ,
'p' ,
'span' ,
'svg' ,
'ul'
] ; // Temporary while we await merge of this fix:
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396
// prettier-ignore
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Primitive
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 8 9 2 7 f 6 f 2 a c c 4 f 3 8 6 $ e x p o r t $ 2 5 0 f f a 6 3 c d c 0 d 0 3 4 = $ 8 9 2 7 f 6 f 2 a c c 4 f 3 8 6 $ v a r $ N O D E S . r e d u c e ( ( p r i m i t i v e , n o d e ) = > {
const Node = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const { asChild : asChild , ... primitiveProps } = props ;
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
window [ Symbol . for ( 'radix-ui' ) ] = true ;
} , [ ] ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( Comp , _extends ( { } , primitiveProps , {
ref : forwardedRef
} ) ) ;
} ) ;
Node . displayName = ` Primitive. ${ node } ` ;
return {
... primitive ,
[ node ] : Node
} ;
} , { } ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Utils
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / / * *
* Flush custom event dispatch
* https : //github.com/radix-ui/primitives/pull/1378
*
* React batches * all * event handlers since version 18 , this introduces certain considerations when using custom event types .
*
* Internally , React prioritises events in the following order :
* - discrete
* - continuous
* - default
*
* https : //github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350
*
* ` discrete ` is an important distinction as updates within these events are applied immediately .
* React however , is not able to infer the priority of custom event types due to how they are detected internally .
* Because of this , it ' s possible for updates from custom events to be unexpectedly batched when
* dispatched by another ` discrete ` event .
*
* In order to ensure that updates from custom events are applied predictably , we need to manually flush the batch .
* This utility should be used when dispatching a custom event from within another ` discrete ` event , this utility
* is not nessesary when dispatching known event types , or if dispatching a custom type inside a non - discrete event .
* For example :
*
* dispatching a known click 👎
* target . dispatchEvent ( new Event ( ‘ click ’ ) )
*
* dispatching a custom type within a non - discrete event 👎
* onScroll = { ( event ) => event . target . dispatchEvent ( new CustomEvent ( ‘ customType ’ ) ) }
*
* dispatching a custom type within a ` discrete ` event 👍
* onPointerDown = { ( event ) => dispatchDiscreteCustomEvent ( event . target , new CustomEvent ( ‘ customType ’ ) ) }
*
* Note : though React classifies ` focus ` , ` focusin ` and ` focusout ` events as ` discrete ` , it ' s not recommended to use
* this utility with them . This is because it ' s possible for those handlers to be called implicitly during render
* e . g . when focus is within a component as it is unmounted , or when managing focus on mount .
* / f u n c t i o n $ 8 9 2 7 f 6 f 2 a c c 4 f 3 8 6 $ e x p o r t $ 6 d 1 a 0 3 1 7 b d e 7 d e 7 f ( t a r g e t , e v e n t ) {
if ( target ) ( 0 , external _ReactDOM _namespaceObject . flushSync ) ( ( ) => target . dispatchEvent ( event )
) ;
}
/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = ( /* unused pure expression or super */ null && ( $8927f6f2acc4f386$export$250ffa63cdc0d034 ) ) ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
2023-06-27 10:24:19 -04:00
/ * *
* Listens for when the escape key is down
2024-09-19 21:55:35 -04:00
* / f u n c t i o n $ a d d c 1 6 e 1 b b e 5 8 f d 0 $ e x p o r t $ 3 a 7 2 a 5 7 2 4 4 d 6 e 7 6 5 ( o n E s c a p e K e y D o w n P r o p , o w n e r D o c u m e n t = g l o b a l T h i s = = = n u l l | | g l o b a l T h i s = = = v o i d 0 ? v o i d 0 : g l o b a l T h i s . d o c u m e n t ) {
2023-06-27 10:24:19 -04:00
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a ( onEscapeKeyDownProp ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
const handleKeyDown = ( event ) => {
if ( event . key === 'Escape' ) onEscapeKeyDown ( event ) ;
} ;
2024-09-19 21:55:35 -04:00
ownerDocument . addEventListener ( 'keydown' , handleKeyDown ) ;
return ( ) => ownerDocument . removeEventListener ( 'keydown' , handleKeyDown )
2023-06-27 10:24:19 -04:00
;
} , [
2024-09-19 21:55:35 -04:00
onEscapeKeyDown ,
ownerDocument
2023-06-27 10:24:19 -04:00
] ) ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
2023-06-27 10:24:19 -04:00
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DismissableLayer
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 c b 9 2 b e f 7 5 7 7 9 6 0 e $ v a r $ D I S M I S S A B L E _ L A Y E R _ N A M E = ' D i s m i s s a b l e L a y e r ' ;
const $5cb92bef7577960e$var$CONTEXT _UPDATE = 'dismissableLayer.update' ;
const $5cb92bef7577960e$var$POINTER _DOWN _OUTSIDE = 'dismissableLayer.pointerDownOutside' ;
const $5cb92bef7577960e$var$FOCUS _OUTSIDE = 'dismissableLayer.focusOutside' ;
let $5cb92bef7577960e$var$originalBodyPointerEvents ;
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ ( 0 , external _React _namespaceObject . createContext ) ( {
layers : new Set ( ) ,
layersWithOutsidePointerEventsDisabled : new Set ( ) ,
branches : new Set ( )
} ) ;
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
2024-09-19 21:55:35 -04:00
var _node$ownerDocument ;
2023-06-27 10:24:19 -04:00
const { disableOutsidePointerEvents : disableOutsidePointerEvents = false , onEscapeKeyDown : onEscapeKeyDown , onPointerDownOutside : onPointerDownOutside , onFocusOutside : onFocusOutside , onInteractOutside : onInteractOutside , onDismiss : onDismiss , ... layerProps } = props ;
const context = ( 0 , external _React _namespaceObject . useContext ) ( $5cb92bef7577960e$var$DismissableLayerContext ) ;
const [ node1 , setNode ] = ( 0 , external _React _namespaceObject . useState ) ( null ) ;
2024-09-19 21:55:35 -04:00
const ownerDocument = ( _node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1 . ownerDocument ) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis . document ;
2023-06-27 10:24:19 -04:00
const [ , force ] = ( 0 , external _React _namespaceObject . useState ) ( { } ) ;
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05 ( forwardedRef , ( node ) => setNode ( node )
) ;
const layers = Array . from ( context . layers ) ;
const [ highestLayerWithOutsidePointerEventsDisabled ] = [
... context . layersWithOutsidePointerEventsDisabled
] . slice ( - 1 ) ; // prettier-ignore
const highestLayerWithOutsidePointerEventsDisabledIndex = layers . indexOf ( highestLayerWithOutsidePointerEventsDisabled ) ; // prettier-ignore
const index = node1 ? layers . indexOf ( node1 ) : - 1 ;
const isBodyPointerEventsDisabled = context . layersWithOutsidePointerEventsDisabled . size > 0 ;
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex ;
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside ( ( event ) => {
const target = event . target ;
const isPointerDownOnBranch = [
... context . branches
] . some ( ( branch ) => branch . contains ( target )
) ;
if ( ! isPointerEventsEnabled || isPointerDownOnBranch ) return ;
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside ( event ) ;
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside ( event ) ;
if ( ! event . defaultPrevented ) onDismiss === null || onDismiss === void 0 || onDismiss ( ) ;
2024-09-19 21:55:35 -04:00
} , ownerDocument ) ;
2023-06-27 10:24:19 -04:00
const focusOutside = $5cb92bef7577960e$var$useFocusOutside ( ( event ) => {
const target = event . target ;
const isFocusInBranch = [
... context . branches
] . some ( ( branch ) => branch . contains ( target )
) ;
if ( isFocusInBranch ) return ;
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside ( event ) ;
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside ( event ) ;
if ( ! event . defaultPrevented ) onDismiss === null || onDismiss === void 0 || onDismiss ( ) ;
2024-09-19 21:55:35 -04:00
} , ownerDocument ) ;
2023-06-27 10:24:19 -04:00
$addc16e1bbe58fd0$export$3a72a57244d6e765 ( ( event ) => {
const isHighestLayer = index === context . layers . size - 1 ;
if ( ! isHighestLayer ) return ;
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown ( event ) ;
if ( ! event . defaultPrevented && onDismiss ) {
event . preventDefault ( ) ;
onDismiss ( ) ;
}
2024-09-19 21:55:35 -04:00
} , ownerDocument ) ;
2023-06-27 10:24:19 -04:00
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
if ( ! node1 ) return ;
if ( disableOutsidePointerEvents ) {
if ( context . layersWithOutsidePointerEventsDisabled . size === 0 ) {
2024-09-19 21:55:35 -04:00
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument . body . style . pointerEvents ;
ownerDocument . body . style . pointerEvents = 'none' ;
2023-06-27 10:24:19 -04:00
}
context . layersWithOutsidePointerEventsDisabled . add ( node1 ) ;
}
context . layers . add ( node1 ) ;
$5cb92bef7577960e$var$dispatchUpdate ( ) ;
return ( ) => {
2024-09-19 21:55:35 -04:00
if ( disableOutsidePointerEvents && context . layersWithOutsidePointerEventsDisabled . size === 1 ) ownerDocument . body . style . pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents ;
2023-06-27 10:24:19 -04:00
} ;
} , [
node1 ,
2024-09-19 21:55:35 -04:00
ownerDocument ,
2023-06-27 10:24:19 -04:00
disableOutsidePointerEvents ,
context
] ) ;
/ * *
* We purposefully prevent combining this effect with the ` disableOutsidePointerEvents ` effect
* because a change to ` disableOutsidePointerEvents ` would remove this layer from the stack
* and add it to the end again so the layering order wouldn ' t be _creation order _ .
* We only want them to be removed from context stacks when unmounted .
* / ( 0 , e x t e r n a l _ R e a c t _ n a m e s p a c e O b j e c t . u s e E f f e c t ) ( ( ) = > {
return ( ) => {
if ( ! node1 ) return ;
context . layers . delete ( node1 ) ;
context . layersWithOutsidePointerEventsDisabled . delete ( node1 ) ;
$5cb92bef7577960e$var$dispatchUpdate ( ) ;
} ;
} , [
node1 ,
context
] ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
const handleUpdate = ( ) => force ( { } )
;
document . addEventListener ( $5cb92bef7577960e$var$CONTEXT _UPDATE , handleUpdate ) ;
return ( ) => document . removeEventListener ( $5cb92bef7577960e$var$CONTEXT _UPDATE , handleUpdate )
;
} , [ ] ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . div , _extends ( { } , layerProps , {
ref : composedRefs ,
style : {
pointerEvents : isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined ,
... props . style
} ,
onFocusCapture : $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( props . onFocusCapture , focusOutside . onFocusCapture ) ,
onBlurCapture : $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( props . onBlurCapture , focusOutside . onBlurCapture ) ,
onPointerDownCapture : $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( props . onPointerDownCapture , pointerDownOutside . onPointerDownCapture )
} ) ) ;
} ) ;
/*#__PURE__*/ Object . assign ( $5cb92bef7577960e$export$177fb62ff3ec1f22 , {
displayName : $5cb92bef7577960e$var$DISMISSABLE _LAYER _NAME
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DismissableLayerBranch
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 c b 9 2 b e f 7 5 7 7 9 6 0 e $ v a r $ B R A N C H _ N A M E = ' D i s m i s s a b l e L a y e r B r a n c h ' ;
const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const context = ( 0 , external _React _namespaceObject . useContext ) ( $5cb92bef7577960e$var$DismissableLayerContext ) ;
const ref = ( 0 , external _React _namespaceObject . useRef ) ( null ) ;
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05 ( forwardedRef , ref ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
const node = ref . current ;
if ( node ) {
context . branches . add ( node ) ;
return ( ) => {
context . branches . delete ( node ) ;
} ;
}
} , [
context . branches
] ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . div , _extends ( { } , props , {
ref : composedRefs
} ) ) ;
} ) ;
/*#__PURE__*/ Object . assign ( $5cb92bef7577960e$export$4d5eb2109db14228 , {
displayName : $5cb92bef7577960e$var$BRANCH _NAME
} ) ;
/* -----------------------------------------------------------------------------------------------*/ / * *
* Listens for ` pointerdown ` outside a react subtree . We use ` pointerdown ` rather than ` pointerup `
* to mimic layer dismissing behaviour present in OS .
* Returns props to pass to the node we want to check for outside events .
2024-09-19 21:55:35 -04:00
* / f u n c t i o n $ 5 c b 9 2 b e f 7 5 7 7 9 6 0 e $ v a r $ u s e P o i n t e r D o w n O u t s i d e ( o n P o i n t e r D o w n O u t s i d e , o w n e r D o c u m e n t = g l o b a l T h i s = = = n u l l | | g l o b a l T h i s = = = v o i d 0 ? v o i d 0 : g l o b a l T h i s . d o c u m e n t ) {
2023-06-27 10:24:19 -04:00
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a ( onPointerDownOutside ) ;
const isPointerInsideReactTreeRef = ( 0 , external _React _namespaceObject . useRef ) ( false ) ;
const handleClickRef = ( 0 , external _React _namespaceObject . useRef ) ( ( ) => { } ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
const handlePointerDown = ( event ) => {
if ( event . target && ! isPointerInsideReactTreeRef . current ) {
const eventDetail = {
originalEvent : event
} ;
function handleAndDispatchPointerDownOutsideEvent ( ) {
$5cb92bef7577960e$var$handleAndDispatchCustomEvent ( $5cb92bef7577960e$var$POINTER _DOWN _OUTSIDE , handlePointerDownOutside , eventDetail , {
discrete : true
} ) ;
}
/ * *
* On touch devices , we need to wait for a click event because browsers implement
* a ~ 350 ms delay between the time the user stops touching the display and when the
* browser executres events . We need to ensure we don ' t reactivate pointer - events within
* this timeframe otherwise the browser may execute events that should have been prevented .
*
* Additionally , this also lets us deal automatically with cancellations when a click event
* isn ' t raised because the page was considered scrolled / drag - scrolled , long - pressed , etc .
*
* This is why we also continuously remove the previous listener , because we cannot be
* certain that it was raised , and therefore cleaned - up .
* / i f ( e v e n t . p o i n t e r T y p e = = = ' t o u c h ' ) {
2024-09-19 21:55:35 -04:00
ownerDocument . removeEventListener ( 'click' , handleClickRef . current ) ;
2023-06-27 10:24:19 -04:00
handleClickRef . current = handleAndDispatchPointerDownOutsideEvent ;
2024-09-19 21:55:35 -04:00
ownerDocument . addEventListener ( 'click' , handleClickRef . current , {
2023-06-27 10:24:19 -04:00
once : true
} ) ;
} else handleAndDispatchPointerDownOutsideEvent ( ) ;
2024-09-19 21:55:35 -04:00
} else // We need to remove the event listener in case the outside click has been canceled.
// See: https://github.com/radix-ui/primitives/issues/2171
ownerDocument . removeEventListener ( 'click' , handleClickRef . current ) ;
2023-06-27 10:24:19 -04:00
isPointerInsideReactTreeRef . current = false ;
} ;
/ * *
* if this hook executes in a component that mounts via a ` pointerdown ` event , the event
* would bubble up to the document and trigger a ` pointerDownOutside ` event . We avoid
* this by delaying the event listener registration on the document .
* This is not React specific , but rather how the DOM works , ie :
* ` ` `
* button . addEventListener ( 'pointerdown' , ( ) => {
* console . log ( 'I will log' ) ;
* document . addEventListener ( 'pointerdown' , ( ) => {
* console . log ( 'I will also log' ) ;
* } )
* } ) ;
* / c o n s t t i m e r I d = w i n d o w . s e t T i m e o u t ( ( ) = > {
2024-09-19 21:55:35 -04:00
ownerDocument . addEventListener ( 'pointerdown' , handlePointerDown ) ;
2023-06-27 10:24:19 -04:00
} , 0 ) ;
return ( ) => {
window . clearTimeout ( timerId ) ;
2024-09-19 21:55:35 -04:00
ownerDocument . removeEventListener ( 'pointerdown' , handlePointerDown ) ;
ownerDocument . removeEventListener ( 'click' , handleClickRef . current ) ;
2023-06-27 10:24:19 -04:00
} ;
} , [
2024-09-19 21:55:35 -04:00
ownerDocument ,
2023-06-27 10:24:19 -04:00
handlePointerDownOutside
] ) ;
return {
// ensures we check React component tree (not just DOM tree)
onPointerDownCapture : ( ) => isPointerInsideReactTreeRef . current = true
} ;
}
/ * *
* Listens for when focus happens outside a react subtree .
* Returns props to pass to the root ( node ) of the subtree we want to check .
2024-09-19 21:55:35 -04:00
* / f u n c t i o n $ 5 c b 9 2 b e f 7 5 7 7 9 6 0 e $ v a r $ u s e F o c u s O u t s i d e ( o n F o c u s O u t s i d e , o w n e r D o c u m e n t = g l o b a l T h i s = = = n u l l | | g l o b a l T h i s = = = v o i d 0 ? v o i d 0 : g l o b a l T h i s . d o c u m e n t ) {
2023-06-27 10:24:19 -04:00
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a ( onFocusOutside ) ;
const isFocusInsideReactTreeRef = ( 0 , external _React _namespaceObject . useRef ) ( false ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
const handleFocus = ( event ) => {
if ( event . target && ! isFocusInsideReactTreeRef . current ) {
const eventDetail = {
originalEvent : event
} ;
$5cb92bef7577960e$var$handleAndDispatchCustomEvent ( $5cb92bef7577960e$var$FOCUS _OUTSIDE , handleFocusOutside , eventDetail , {
discrete : false
} ) ;
}
} ;
2024-09-19 21:55:35 -04:00
ownerDocument . addEventListener ( 'focusin' , handleFocus ) ;
return ( ) => ownerDocument . removeEventListener ( 'focusin' , handleFocus )
2023-06-27 10:24:19 -04:00
;
} , [
2024-09-19 21:55:35 -04:00
ownerDocument ,
2023-06-27 10:24:19 -04:00
handleFocusOutside
] ) ;
return {
onFocusCapture : ( ) => isFocusInsideReactTreeRef . current = true
,
onBlurCapture : ( ) => isFocusInsideReactTreeRef . current = false
} ;
}
function $5cb92bef7577960e$var$dispatchUpdate ( ) {
const event = new CustomEvent ( $5cb92bef7577960e$var$CONTEXT _UPDATE ) ;
document . dispatchEvent ( event ) ;
}
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent ( name , handler , detail , { discrete : discrete } ) {
const target = detail . originalEvent . target ;
const event = new CustomEvent ( name , {
bubbles : false ,
cancelable : true ,
detail : detail
} ) ;
if ( handler ) target . addEventListener ( name , handler , {
once : true
} ) ;
if ( discrete ) $8927f6f2acc4f386$export$6d1a0317bde7de7f ( target , event ) ;
else target . dispatchEvent ( event ) ;
}
const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = ( /* unused pure expression or super */ null && ( $5cb92bef7577960e$export$177fb62ff3ec1f22 ) ) ;
const $5cb92bef7577960e$export$aecb2ddcb55c95be = ( /* unused pure expression or super */ null && ( $5cb92bef7577960e$export$4d5eb2109db14228 ) ) ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-focus-scope/dist/index.mjs
2023-06-27 10:24:19 -04:00
const $d3863c46a17e8a28$var$AUTOFOCUS _ON _MOUNT = 'focusScope.autoFocusOnMount' ;
const $d3863c46a17e8a28$var$AUTOFOCUS _ON _UNMOUNT = 'focusScope.autoFocusOnUnmount' ;
const $d3863c46a17e8a28$var$EVENT _OPTIONS = {
bubbles : false ,
cancelable : true
} ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* FocusScope
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ d 3 8 6 3 c 4 6 a 1 7 e 8 a 2 8 $ v a r $ F O C U S _ S C O P E _ N A M E = ' F o c u s S c o p e ' ;
const $d3863c46a17e8a28$export$20e40289641fbbb6 = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const { loop : loop = false , trapped : trapped = false , onMountAutoFocus : onMountAutoFocusProp , onUnmountAutoFocus : onUnmountAutoFocusProp , ... scopeProps } = props ;
const [ container1 , setContainer ] = ( 0 , external _React _namespaceObject . useState ) ( null ) ;
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a ( onMountAutoFocusProp ) ;
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a ( onUnmountAutoFocusProp ) ;
const lastFocusedElementRef = ( 0 , external _React _namespaceObject . useRef ) ( null ) ;
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05 ( forwardedRef , ( node ) => setContainer ( node )
) ;
const focusScope = ( 0 , external _React _namespaceObject . useRef ) ( {
paused : false ,
pause ( ) {
this . paused = true ;
} ,
resume ( ) {
this . paused = false ;
}
} ) . current ; // Takes care of trapping focus if focus is moved outside programmatically for example
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
if ( trapped ) {
function handleFocusIn ( event ) {
if ( focusScope . paused || ! container1 ) return ;
const target = event . target ;
if ( container1 . contains ( target ) ) lastFocusedElementRef . current = target ;
else $d3863c46a17e8a28$var$focus ( lastFocusedElementRef . current , {
select : true
} ) ;
}
function handleFocusOut ( event ) {
if ( focusScope . paused || ! container1 ) return ;
2024-09-19 21:55:35 -04:00
const relatedTarget = event . relatedTarget ; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases:
//
// 1. When the user switches app/tabs/windows/the browser itself loses focus.
// 2. In Google Chrome, when the focused element is removed from the DOM.
//
// We let the browser do its thing here because:
//
// 1. The browser already keeps a memory of what's focused for when the page gets refocused.
// 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it
// throws the CPU to 100%, so we avoid doing anything for this reason here too.
if ( relatedTarget === null ) return ; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`)
// that is outside the container, we move focus to the last valid focused element inside.
if ( ! container1 . contains ( relatedTarget ) ) $d3863c46a17e8a28$var$focus ( lastFocusedElementRef . current , {
2023-06-27 10:24:19 -04:00
select : true
} ) ;
2024-09-19 21:55:35 -04:00
} // When the focused element gets removed from the DOM, browsers move focus
// back to the document.body. In this case, we move focus to the container
// to keep focus trapped correctly.
function handleMutations ( mutations ) {
const focusedElement = document . activeElement ;
if ( focusedElement !== document . body ) return ;
for ( const mutation of mutations ) if ( mutation . removedNodes . length > 0 ) $d3863c46a17e8a28$var$focus ( container1 ) ;
2023-06-27 10:24:19 -04:00
}
document . addEventListener ( 'focusin' , handleFocusIn ) ;
document . addEventListener ( 'focusout' , handleFocusOut ) ;
2024-09-19 21:55:35 -04:00
const mutationObserver = new MutationObserver ( handleMutations ) ;
if ( container1 ) mutationObserver . observe ( container1 , {
childList : true ,
subtree : true
} ) ;
2023-06-27 10:24:19 -04:00
return ( ) => {
document . removeEventListener ( 'focusin' , handleFocusIn ) ;
document . removeEventListener ( 'focusout' , handleFocusOut ) ;
2024-09-19 21:55:35 -04:00
mutationObserver . disconnect ( ) ;
2023-06-27 10:24:19 -04:00
} ;
}
} , [
trapped ,
container1 ,
focusScope . paused
] ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
if ( container1 ) {
$d3863c46a17e8a28$var$focusScopesStack . add ( focusScope ) ;
const previouslyFocusedElement = document . activeElement ;
const hasFocusedCandidate = container1 . contains ( previouslyFocusedElement ) ;
if ( ! hasFocusedCandidate ) {
const mountEvent = new CustomEvent ( $d3863c46a17e8a28$var$AUTOFOCUS _ON _MOUNT , $d3863c46a17e8a28$var$EVENT _OPTIONS ) ;
container1 . addEventListener ( $d3863c46a17e8a28$var$AUTOFOCUS _ON _MOUNT , onMountAutoFocus ) ;
container1 . dispatchEvent ( mountEvent ) ;
if ( ! mountEvent . defaultPrevented ) {
$d3863c46a17e8a28$var$focusFirst ( $d3863c46a17e8a28$var$removeLinks ( $d3863c46a17e8a28$var$getTabbableCandidates ( container1 ) ) , {
select : true
} ) ;
if ( document . activeElement === previouslyFocusedElement ) $d3863c46a17e8a28$var$focus ( container1 ) ;
}
}
return ( ) => {
container1 . removeEventListener ( $d3863c46a17e8a28$var$AUTOFOCUS _ON _MOUNT , onMountAutoFocus ) ; // We hit a react bug (fixed in v17) with focusing in unmount.
// We need to delay the focus a little to get around it for now.
// See: https://github.com/facebook/react/issues/17894
setTimeout ( ( ) => {
const unmountEvent = new CustomEvent ( $d3863c46a17e8a28$var$AUTOFOCUS _ON _UNMOUNT , $d3863c46a17e8a28$var$EVENT _OPTIONS ) ;
container1 . addEventListener ( $d3863c46a17e8a28$var$AUTOFOCUS _ON _UNMOUNT , onUnmountAutoFocus ) ;
container1 . dispatchEvent ( unmountEvent ) ;
if ( ! unmountEvent . defaultPrevented ) $d3863c46a17e8a28$var$focus ( previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document . body , {
select : true
} ) ;
// we need to remove the listener after we `dispatchEvent`
container1 . removeEventListener ( $d3863c46a17e8a28$var$AUTOFOCUS _ON _UNMOUNT , onUnmountAutoFocus ) ;
$d3863c46a17e8a28$var$focusScopesStack . remove ( focusScope ) ;
} , 0 ) ;
} ;
}
} , [
container1 ,
onMountAutoFocus ,
onUnmountAutoFocus ,
focusScope
] ) ; // Takes care of looping focus (when tabbing whilst at the edges)
const handleKeyDown = ( 0 , external _React _namespaceObject . useCallback ) ( ( event ) => {
if ( ! loop && ! trapped ) return ;
if ( focusScope . paused ) return ;
const isTabKey = event . key === 'Tab' && ! event . altKey && ! event . ctrlKey && ! event . metaKey ;
const focusedElement = document . activeElement ;
if ( isTabKey && focusedElement ) {
const container = event . currentTarget ;
const [ first , last ] = $d3863c46a17e8a28$var$getTabbableEdges ( container ) ;
const hasTabbableElementsInside = first && last ; // we can only wrap focus if we have tabbable edges
if ( ! hasTabbableElementsInside ) {
if ( focusedElement === container ) event . preventDefault ( ) ;
} else {
if ( ! event . shiftKey && focusedElement === last ) {
event . preventDefault ( ) ;
if ( loop ) $d3863c46a17e8a28$var$focus ( first , {
select : true
} ) ;
} else if ( event . shiftKey && focusedElement === first ) {
event . preventDefault ( ) ;
if ( loop ) $d3863c46a17e8a28$var$focus ( last , {
select : true
} ) ;
}
}
}
} , [
loop ,
trapped ,
focusScope . paused
] ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . div , _extends ( {
tabIndex : - 1
} , scopeProps , {
ref : composedRefs ,
onKeyDown : handleKeyDown
} ) ) ;
} ) ;
/*#__PURE__*/ Object . assign ( $d3863c46a17e8a28$export$20e40289641fbbb6 , {
displayName : $d3863c46a17e8a28$var$FOCUS _SCOPE _NAME
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Utils
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / / * *
* Attempts focusing the first element in a list of candidates .
* Stops when focus has actually moved .
* / f u n c t i o n $ d 3 8 6 3 c 4 6 a 1 7 e 8 a 2 8 $ v a r $ f o c u s F i r s t ( c a n d i d a t e s , { s e l e c t : s e l e c t = f a l s e } = { } ) {
const previouslyFocusedElement = document . activeElement ;
for ( const candidate of candidates ) {
$d3863c46a17e8a28$var$focus ( candidate , {
select : select
} ) ;
if ( document . activeElement !== previouslyFocusedElement ) return ;
}
}
/ * *
* Returns the first and last tabbable elements inside a container .
* / f u n c t i o n $ d 3 8 6 3 c 4 6 a 1 7 e 8 a 2 8 $ v a r $ g e t T a b b a b l e E d g e s ( c o n t a i n e r ) {
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates ( container ) ;
const first = $d3863c46a17e8a28$var$findVisible ( candidates , container ) ;
const last = $d3863c46a17e8a28$var$findVisible ( candidates . reverse ( ) , container ) ;
return [
first ,
last
] ;
}
/ * *
* Returns a list of potential tabbable candidates .
*
* NOTE : This is only a close approximation . For example it doesn ' t take into account cases like when
* elements are not visible . This cannot be worked out easily by just reading a property , but rather
* necessitate runtime knowledge ( computed styles , etc ) . We deal with these cases separately .
*
* See : https : //developer.mozilla.org/en-US/docs/Web/API/TreeWalker
* Credit : https : //github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1
* / f u n c t i o n $ d 3 8 6 3 c 4 6 a 1 7 e 8 a 2 8 $ v a r $ g e t T a b b a b l e C a n d i d a t e s ( c o n t a i n e r ) {
const nodes = [ ] ;
const walker = document . createTreeWalker ( container , NodeFilter . SHOW _ELEMENT , {
acceptNode : ( node ) => {
const isHiddenInput = node . tagName === 'INPUT' && node . type === 'hidden' ;
if ( node . disabled || node . hidden || isHiddenInput ) return NodeFilter . FILTER _SKIP ; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the
// runtime's understanding of tabbability, so this automatically accounts
// for any kind of element that could be tabbed to.
return node . tabIndex >= 0 ? NodeFilter . FILTER _ACCEPT : NodeFilter . FILTER _SKIP ;
}
} ) ;
while ( walker . nextNode ( ) ) nodes . push ( walker . currentNode ) ; // we do not take into account the order of nodes with positive `tabIndex` as it
// hinders accessibility to have tab order different from visual order.
return nodes ;
}
/ * *
* Returns the first visible element in a list .
* NOTE : Only checks visibility up to the ` container ` .
* / f u n c t i o n $ d 3 8 6 3 c 4 6 a 1 7 e 8 a 2 8 $ v a r $ f i n d V i s i b l e ( e l e m e n t s , c o n t a i n e r ) {
for ( const element of elements ) {
// we stop checking if it's hidden at the `container` level (excluding)
if ( ! $d3863c46a17e8a28$var$isHidden ( element , {
upTo : container
} ) ) return element ;
}
}
function $d3863c46a17e8a28$var$isHidden ( node , { upTo : upTo } ) {
if ( getComputedStyle ( node ) . visibility === 'hidden' ) return true ;
while ( node ) {
// we stop at `upTo` (excluding it)
if ( upTo !== undefined && node === upTo ) return false ;
if ( getComputedStyle ( node ) . display === 'none' ) return true ;
node = node . parentElement ;
}
return false ;
}
function $d3863c46a17e8a28$var$isSelectableInput ( element ) {
return element instanceof HTMLInputElement && 'select' in element ;
}
function $d3863c46a17e8a28$var$focus ( element , { select : select = false } = { } ) {
// only focus if that element is focusable
if ( element && element . focus ) {
const previouslyFocusedElement = document . activeElement ; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users
element . focus ( {
preventScroll : true
} ) ; // only select if its not the same element, it supports selection and we need to select
if ( element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput ( element ) && select ) element . select ( ) ;
}
}
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* FocusScope stack
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ d 3 8 6 3 c 4 6 a 1 7 e 8 a 2 8 $ v a r $ f o c u s S c o p e s S t a c k = $ d 3 8 6 3 c 4 6 a 1 7 e 8 a 2 8 $ v a r $ c r e a t e F o c u s S c o p e s S t a c k ( ) ;
function $d3863c46a17e8a28$var$createFocusScopesStack ( ) {
/** A stack of focus scopes, with the active one at the top */ let stack = [ ] ;
return {
add ( focusScope ) {
// pause the currently active focus scope (at the top of the stack)
const activeFocusScope = stack [ 0 ] ;
if ( focusScope !== activeFocusScope ) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope . pause ( ) ;
// remove in case it already exists (because we'll re-add it at the top of the stack)
stack = $d3863c46a17e8a28$var$arrayRemove ( stack , focusScope ) ;
stack . unshift ( focusScope ) ;
} ,
remove ( focusScope ) {
var _stack$ ;
stack = $d3863c46a17e8a28$var$arrayRemove ( stack , focusScope ) ;
( _stack$ = stack [ 0 ] ) === null || _stack$ === void 0 || _stack$ . resume ( ) ;
}
} ;
}
function $d3863c46a17e8a28$var$arrayRemove ( array , item ) {
const updatedArray = [
... array
] ;
const index = updatedArray . indexOf ( item ) ;
if ( index !== - 1 ) updatedArray . splice ( index , 1 ) ;
return updatedArray ;
}
function $d3863c46a17e8a28$var$removeLinks ( items ) {
return items . filter ( ( item ) => item . tagName !== 'A'
) ;
}
const $d3863c46a17e8a28$export$be92b6f5f03c0fe9 = ( /* unused pure expression or super */ null && ( $d3863c46a17e8a28$export$20e40289641fbbb6 ) ) ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-portal/dist/index.mjs
2023-06-27 10:24:19 -04:00
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Portal
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ f 1 7 0 1 b e a e 0 8 3 d b a e $ v a r $ P O R T A L _ N A M E = ' P o r t a l ' ;
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
var _globalThis$document ;
const { container : container = globalThis === null || globalThis === void 0 ? void 0 : ( _globalThis$document = globalThis . document ) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document . body , ... portalProps } = props ;
2024-09-19 21:55:35 -04:00
return container ? /*#__PURE__*/ external _ReactDOM _namespaceObject . createPortal ( /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . div , _extends ( { } , portalProps , {
2023-06-27 10:24:19 -04:00
ref : forwardedRef
} ) ) , container ) : null ;
} ) ;
/*#__PURE__*/ Object . assign ( $f1701beae083dbae$export$602eac185826482c , {
displayName : $f1701beae083dbae$var$PORTAL _NAME
} ) ;
/* -----------------------------------------------------------------------------------------------*/ const $f1701beae083dbae$export$be92b6f5f03c0fe9 = ( /* unused pure expression or super */ null && ( $f1701beae083dbae$export$602eac185826482c ) ) ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-presence/dist/index.mjs
2023-06-27 10:24:19 -04:00
function $fe963b355347cc68$export$3e6543de14f8614f ( initialState , machine ) {
return ( 0 , external _React _namespaceObject . useReducer ) ( ( state , event ) => {
const nextState = machine [ state ] [ event ] ;
return nextState !== null && nextState !== void 0 ? nextState : state ;
} , initialState ) ;
}
const $921a889cee6df7e8$export$99c2b779aa4e8b8b = ( props ) => {
const { present : present , children : children } = props ;
const presence = $921a889cee6df7e8$var$usePresence ( present ) ;
const child = typeof children === 'function' ? children ( {
present : presence . isPresent
} ) : external _React _namespaceObject . Children . only ( children ) ;
const ref = $6ed0406888f73fc4$export$c7b2cbe3552a0d05 ( presence . ref , child . ref ) ;
const forceMount = typeof children === 'function' ;
return forceMount || presence . isPresent ? /*#__PURE__*/ ( 0 , external _React _namespaceObject . cloneElement ) ( child , {
ref : ref
} ) : null ;
} ;
$921a889cee6df7e8$export$99c2b779aa4e8b8b . displayName = 'Presence' ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* usePresence
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / f u n c t i o n $ 9 2 1 a 8 8 9 c e e 6 d f 7 e 8 $ v a r $ u s e P r e s e n c e ( p r e s e n t ) {
const [ node1 , setNode ] = ( 0 , external _React _namespaceObject . useState ) ( ) ;
const stylesRef = ( 0 , external _React _namespaceObject . useRef ) ( { } ) ;
const prevPresentRef = ( 0 , external _React _namespaceObject . useRef ) ( present ) ;
const prevAnimationNameRef = ( 0 , external _React _namespaceObject . useRef ) ( 'none' ) ;
const initialState = present ? 'mounted' : 'unmounted' ;
const [ state , send ] = $fe963b355347cc68$export$3e6543de14f8614f ( initialState , {
mounted : {
UNMOUNT : 'unmounted' ,
ANIMATION _OUT : 'unmountSuspended'
} ,
unmountSuspended : {
MOUNT : 'mounted' ,
ANIMATION _END : 'unmounted'
} ,
unmounted : {
MOUNT : 'mounted'
}
} ) ;
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName ( stylesRef . current ) ;
prevAnimationNameRef . current = state === 'mounted' ? currentAnimationName : 'none' ;
} , [
state
] ) ;
$9f79659886946c16$export$e5c5a5f917a5871c ( ( ) => {
const styles = stylesRef . current ;
const wasPresent = prevPresentRef . current ;
const hasPresentChanged = wasPresent !== present ;
if ( hasPresentChanged ) {
const prevAnimationName = prevAnimationNameRef . current ;
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName ( styles ) ;
if ( present ) send ( 'MOUNT' ) ;
else if ( currentAnimationName === 'none' || ( styles === null || styles === void 0 ? void 0 : styles . display ) === 'none' ) // If there is no exit animation or the element is hidden, animations won't run
// so we unmount instantly
send ( 'UNMOUNT' ) ;
else {
/ * *
* When ` present ` changes to ` false ` , we check changes to animation - name to
* determine whether an animation has started . We chose this approach ( reading
* computed styles ) because there is no ` animationrun ` event and ` animationstart `
* fires after ` animation-delay ` has expired which would be too late .
* / c o n s t i s A n i m a t i n g = p r e v A n i m a t i o n N a m e ! = = c u r r e n t A n i m a t i o n N a m e ;
if ( wasPresent && isAnimating ) send ( 'ANIMATION_OUT' ) ;
else send ( 'UNMOUNT' ) ;
}
prevPresentRef . current = present ;
}
} , [
present ,
send
] ) ;
$9f79659886946c16$export$e5c5a5f917a5871c ( ( ) => {
if ( node1 ) {
/ * *
* Triggering an ANIMATION _OUT during an ANIMATION _IN will fire an ` animationcancel `
* event for ANIMATION _IN after we have entered ` unmountSuspended ` state . So , we
* make sure we only trigger ANIMATION _END for the currently active animation .
* / c o n s t h a n d l e A n i m a t i o n E n d = ( e v e n t ) = > {
const currentAnimationName = $921a889cee6df7e8$var$getAnimationName ( stylesRef . current ) ;
const isCurrentAnimation = currentAnimationName . includes ( event . animationName ) ;
if ( event . target === node1 && isCurrentAnimation ) // With React 18 concurrency this update is applied
// a frame after the animation ends, creating a flash of visible content.
// By manually flushing we ensure they sync within a frame, removing the flash.
( 0 , external _ReactDOM _namespaceObject . flushSync ) ( ( ) => send ( 'ANIMATION_END' )
) ;
} ;
const handleAnimationStart = ( event ) => {
if ( event . target === node1 ) // if animation occurred, store its name as the previous animation.
prevAnimationNameRef . current = $921a889cee6df7e8$var$getAnimationName ( stylesRef . current ) ;
} ;
node1 . addEventListener ( 'animationstart' , handleAnimationStart ) ;
node1 . addEventListener ( 'animationcancel' , handleAnimationEnd ) ;
node1 . addEventListener ( 'animationend' , handleAnimationEnd ) ;
return ( ) => {
node1 . removeEventListener ( 'animationstart' , handleAnimationStart ) ;
node1 . removeEventListener ( 'animationcancel' , handleAnimationEnd ) ;
node1 . removeEventListener ( 'animationend' , handleAnimationEnd ) ;
} ;
} else // Transition to the unmounted state if the node is removed prematurely.
// We avoid doing so during cleanup as the node may change but still exist.
send ( 'ANIMATION_END' ) ;
} , [
node1 ,
send
] ) ;
return {
isPresent : [
'mounted' ,
'unmountSuspended'
] . includes ( state ) ,
ref : ( 0 , external _React _namespaceObject . useCallback ) ( ( node ) => {
if ( node ) stylesRef . current = getComputedStyle ( node ) ;
setNode ( node ) ;
} , [ ] )
} ;
}
/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName ( styles ) {
return ( styles === null || styles === void 0 ? void 0 : styles . animationName ) || 'none' ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-focus-guards/dist/index.mjs
2023-06-27 10:24:19 -04:00
/** Number of components which have requested interest to have focus guards */ let $3db38b7d1fb3fe6a$var$count = 0 ;
function $3db38b7d1fb3fe6a$export$ac5b58043b79449b ( props ) {
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c ( ) ;
return props . children ;
}
/ * *
* Injects a pair of focus guards at the edges of the whole DOM tree
* to ensure ` focusin ` & ` focusout ` events can be caught consistently .
* / f u n c t i o n $ 3 d b 3 8 b 7 d 1 f b 3 f e 6 a $ e x p o r t $ b 7 e c e 2 4 a 2 2 a e d a 8 c ( ) {
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
var _edgeGuards$ , _edgeGuards$2 ;
const edgeGuards = document . querySelectorAll ( '[data-radix-focus-guard]' ) ;
document . body . insertAdjacentElement ( 'afterbegin' , ( _edgeGuards$ = edgeGuards [ 0 ] ) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard ( ) ) ;
document . body . insertAdjacentElement ( 'beforeend' , ( _edgeGuards$2 = edgeGuards [ 1 ] ) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard ( ) ) ;
$3db38b7d1fb3fe6a$var$count ++ ;
return ( ) => {
if ( $3db38b7d1fb3fe6a$var$count === 1 ) document . querySelectorAll ( '[data-radix-focus-guard]' ) . forEach ( ( node ) => node . remove ( )
) ;
$3db38b7d1fb3fe6a$var$count -- ;
} ;
} , [ ] ) ;
}
function $3db38b7d1fb3fe6a$var$createFocusGuard ( ) {
const element = document . createElement ( 'span' ) ;
element . setAttribute ( 'data-radix-focus-guard' , '' ) ;
element . tabIndex = 0 ;
element . style . cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none' ;
return element ;
}
const $3db38b7d1fb3fe6a$export$be92b6f5f03c0fe9 = ( /* unused pure expression or super */ null && ( $3db38b7d1fb3fe6a$export$ac5b58043b79449b ) ) ;
; // CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.mjs
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Copyright ( c ) Microsoft Corporation .
Permission to use , copy , modify , and / or distribute this software for any
purpose with or without fee is hereby granted .
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS . IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL , DIRECT ,
INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE , DATA OR PROFITS , WHETHER IN AN ACTION OF CONTRACT , NEGLIGENCE OR
OTHER TORTIOUS ACTION , ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE .
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /
2024-10-10 11:58:22 -04:00
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
2023-06-27 10:24:19 -04:00
var extendStatics = function ( d , b ) {
extendStatics = Object . setPrototypeOf ||
( { _ _proto _ _ : [ ] } instanceof Array && function ( d , b ) { d . _ _proto _ _ = b ; } ) ||
function ( d , b ) { for ( var p in b ) if ( Object . prototype . hasOwnProperty . call ( b , p ) ) d [ p ] = b [ p ] ; } ;
return extendStatics ( d , b ) ;
} ;
function _ _extends ( d , b ) {
if ( typeof b !== "function" && b !== null )
throw new TypeError ( "Class extends value " + String ( b ) + " is not a constructor or null" ) ;
extendStatics ( d , b ) ;
function _ _ ( ) { this . constructor = d ; }
d . prototype = b === null ? Object . create ( b ) : ( _ _ . prototype = b . prototype , new _ _ ( ) ) ;
}
var _ _assign = function ( ) {
_ _assign = Object . assign || function _ _assign ( t ) {
for ( var s , i = 1 , n = arguments . length ; i < n ; i ++ ) {
s = arguments [ i ] ;
for ( var p in s ) if ( Object . prototype . hasOwnProperty . call ( s , p ) ) t [ p ] = s [ p ] ;
}
return t ;
}
return _ _assign . apply ( this , arguments ) ;
}
function _ _rest ( s , e ) {
var t = { } ;
for ( var p in s ) if ( Object . prototype . hasOwnProperty . call ( s , p ) && e . indexOf ( p ) < 0 )
t [ p ] = s [ p ] ;
if ( s != null && typeof Object . getOwnPropertySymbols === "function" )
for ( var i = 0 , p = Object . getOwnPropertySymbols ( s ) ; i < p . length ; i ++ ) {
if ( e . indexOf ( p [ i ] ) < 0 && Object . prototype . propertyIsEnumerable . call ( s , p [ i ] ) )
t [ p [ i ] ] = s [ p [ i ] ] ;
}
return t ;
}
function _ _decorate ( decorators , target , key , desc ) {
var c = arguments . length , r = c < 3 ? target : desc === null ? desc = Object . getOwnPropertyDescriptor ( target , key ) : desc , d ;
if ( typeof Reflect === "object" && typeof Reflect . decorate === "function" ) r = Reflect . decorate ( decorators , target , key , desc ) ;
else for ( var i = decorators . length - 1 ; i >= 0 ; i -- ) if ( d = decorators [ i ] ) r = ( c < 3 ? d ( r ) : c > 3 ? d ( target , key , r ) : d ( target , key ) ) || r ;
return c > 3 && r && Object . defineProperty ( target , key , r ) , r ;
}
function _ _param ( paramIndex , decorator ) {
return function ( target , key ) { decorator ( target , key , paramIndex ) ; }
}
function _ _esDecorate ( ctor , descriptorIn , decorators , contextIn , initializers , extraInitializers ) {
function accept ( f ) { if ( f !== void 0 && typeof f !== "function" ) throw new TypeError ( "Function expected" ) ; return f ; }
var kind = contextIn . kind , key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value" ;
var target = ! descriptorIn && ctor ? contextIn [ "static" ] ? ctor : ctor . prototype : null ;
var descriptor = descriptorIn || ( target ? Object . getOwnPropertyDescriptor ( target , contextIn . name ) : { } ) ;
var _ , done = false ;
for ( var i = decorators . length - 1 ; i >= 0 ; i -- ) {
var context = { } ;
for ( var p in contextIn ) context [ p ] = p === "access" ? { } : contextIn [ p ] ;
for ( var p in contextIn . access ) context . access [ p ] = contextIn . access [ p ] ;
context . addInitializer = function ( f ) { if ( done ) throw new TypeError ( "Cannot add initializers after decoration has completed" ) ; extraInitializers . push ( accept ( f || null ) ) ; } ;
var result = ( 0 , decorators [ i ] ) ( kind === "accessor" ? { get : descriptor . get , set : descriptor . set } : descriptor [ key ] , context ) ;
if ( kind === "accessor" ) {
if ( result === void 0 ) continue ;
if ( result === null || typeof result !== "object" ) throw new TypeError ( "Object expected" ) ;
if ( _ = accept ( result . get ) ) descriptor . get = _ ;
if ( _ = accept ( result . set ) ) descriptor . set = _ ;
if ( _ = accept ( result . init ) ) initializers . unshift ( _ ) ;
}
else if ( _ = accept ( result ) ) {
if ( kind === "field" ) initializers . unshift ( _ ) ;
else descriptor [ key ] = _ ;
}
}
if ( target ) Object . defineProperty ( target , contextIn . name , descriptor ) ;
done = true ;
} ;
function _ _runInitializers ( thisArg , initializers , value ) {
var useValue = arguments . length > 2 ;
for ( var i = 0 ; i < initializers . length ; i ++ ) {
value = useValue ? initializers [ i ] . call ( thisArg , value ) : initializers [ i ] . call ( thisArg ) ;
}
return useValue ? value : void 0 ;
} ;
function _ _propKey ( x ) {
return typeof x === "symbol" ? x : "" . concat ( x ) ;
} ;
function _ _setFunctionName ( f , name , prefix ) {
if ( typeof name === "symbol" ) name = name . description ? "[" . concat ( name . description , "]" ) : "" ;
return Object . defineProperty ( f , "name" , { configurable : true , value : prefix ? "" . concat ( prefix , " " , name ) : name } ) ;
} ;
function _ _metadata ( metadataKey , metadataValue ) {
if ( typeof Reflect === "object" && typeof Reflect . metadata === "function" ) return Reflect . metadata ( metadataKey , metadataValue ) ;
}
function _ _awaiter ( thisArg , _arguments , P , generator ) {
function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
function fulfilled ( value ) { try { step ( generator . next ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
function rejected ( value ) { try { step ( generator [ "throw" ] ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
function step ( result ) { result . done ? resolve ( result . value ) : adopt ( result . value ) . then ( fulfilled , rejected ) ; }
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
} ) ;
}
function _ _generator ( thisArg , body ) {
2024-10-10 11:58:22 -04:00
var _ = { label : 0 , sent : function ( ) { if ( t [ 0 ] & 1 ) throw t [ 1 ] ; return t [ 1 ] ; } , trys : [ ] , ops : [ ] } , f , y , t , g = Object . create ( ( typeof Iterator === "function" ? Iterator : Object ) . prototype ) ;
return g . next = verb ( 0 ) , g [ "throw" ] = verb ( 1 ) , g [ "return" ] = verb ( 2 ) , typeof Symbol === "function" && ( g [ Symbol . iterator ] = function ( ) { return this ; } ) , g ;
2023-06-27 10:24:19 -04:00
function verb ( n ) { return function ( v ) { return step ( [ n , v ] ) ; } ; }
function step ( op ) {
if ( f ) throw new TypeError ( "Generator is already executing." ) ;
while ( g && ( g = 0 , op [ 0 ] && ( _ = 0 ) ) , _ ) try {
if ( f = 1 , y && ( t = op [ 0 ] & 2 ? y [ "return" ] : op [ 0 ] ? y [ "throw" ] || ( ( t = y [ "return" ] ) && t . call ( y ) , 0 ) : y . next ) && ! ( t = t . call ( y , op [ 1 ] ) ) . done ) return t ;
if ( y = 0 , t ) op = [ op [ 0 ] & 2 , t . value ] ;
switch ( op [ 0 ] ) {
case 0 : case 1 : t = op ; break ;
case 4 : _ . label ++ ; return { value : op [ 1 ] , done : false } ;
case 5 : _ . label ++ ; y = op [ 1 ] ; op = [ 0 ] ; continue ;
case 7 : op = _ . ops . pop ( ) ; _ . trys . pop ( ) ; continue ;
default :
if ( ! ( t = _ . trys , t = t . length > 0 && t [ t . length - 1 ] ) && ( op [ 0 ] === 6 || op [ 0 ] === 2 ) ) { _ = 0 ; continue ; }
if ( op [ 0 ] === 3 && ( ! t || ( op [ 1 ] > t [ 0 ] && op [ 1 ] < t [ 3 ] ) ) ) { _ . label = op [ 1 ] ; break ; }
if ( op [ 0 ] === 6 && _ . label < t [ 1 ] ) { _ . label = t [ 1 ] ; t = op ; break ; }
if ( t && _ . label < t [ 2 ] ) { _ . label = t [ 2 ] ; _ . ops . push ( op ) ; break ; }
if ( t [ 2 ] ) _ . ops . pop ( ) ;
_ . trys . pop ( ) ; continue ;
}
op = body . call ( thisArg , _ ) ;
} catch ( e ) { op = [ 6 , e ] ; y = 0 ; } finally { f = t = 0 ; }
if ( op [ 0 ] & 5 ) throw op [ 1 ] ; return { value : op [ 0 ] ? op [ 1 ] : void 0 , done : true } ;
}
}
var _ _createBinding = Object . create ? ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
var desc = Object . getOwnPropertyDescriptor ( m , k ) ;
if ( ! desc || ( "get" in desc ? ! m . _ _esModule : desc . writable || desc . configurable ) ) {
desc = { enumerable : true , get : function ( ) { return m [ k ] ; } } ;
}
Object . defineProperty ( o , k2 , desc ) ;
} ) : ( function ( o , m , k , k2 ) {
if ( k2 === undefined ) k2 = k ;
o [ k2 ] = m [ k ] ;
} ) ;
function _ _exportStar ( m , o ) {
for ( var p in m ) if ( p !== "default" && ! Object . prototype . hasOwnProperty . call ( o , p ) ) _ _createBinding ( o , m , p ) ;
}
function _ _values ( o ) {
var s = typeof Symbol === "function" && Symbol . iterator , m = s && o [ s ] , i = 0 ;
if ( m ) return m . call ( o ) ;
if ( o && typeof o . length === "number" ) return {
next : function ( ) {
if ( o && i >= o . length ) o = void 0 ;
return { value : o && o [ i ++ ] , done : ! o } ;
}
} ;
throw new TypeError ( s ? "Object is not iterable." : "Symbol.iterator is not defined." ) ;
}
function _ _read ( o , n ) {
var m = typeof Symbol === "function" && o [ Symbol . iterator ] ;
if ( ! m ) return o ;
var i = m . call ( o ) , r , ar = [ ] , e ;
try {
while ( ( n === void 0 || n -- > 0 ) && ! ( r = i . next ( ) ) . done ) ar . push ( r . value ) ;
}
catch ( error ) { e = { error : error } ; }
finally {
try {
if ( r && ! r . done && ( m = i [ "return" ] ) ) m . call ( i ) ;
}
finally { if ( e ) throw e . error ; }
}
return ar ;
}
/** @deprecated */
function _ _spread ( ) {
for ( var ar = [ ] , i = 0 ; i < arguments . length ; i ++ )
ar = ar . concat ( _ _read ( arguments [ i ] ) ) ;
return ar ;
}
/** @deprecated */
function _ _spreadArrays ( ) {
for ( var s = 0 , i = 0 , il = arguments . length ; i < il ; i ++ ) s += arguments [ i ] . length ;
for ( var r = Array ( s ) , k = 0 , i = 0 ; i < il ; i ++ )
for ( var a = arguments [ i ] , j = 0 , jl = a . length ; j < jl ; j ++ , k ++ )
r [ k ] = a [ j ] ;
return r ;
}
function _ _spreadArray ( to , from , pack ) {
if ( pack || arguments . length === 2 ) for ( var i = 0 , l = from . length , ar ; i < l ; i ++ ) {
if ( ar || ! ( i in from ) ) {
if ( ! ar ) ar = Array . prototype . slice . call ( from , 0 , i ) ;
ar [ i ] = from [ i ] ;
}
}
return to . concat ( ar || Array . prototype . slice . call ( from ) ) ;
}
function _ _await ( v ) {
return this instanceof _ _await ? ( this . v = v , this ) : new _ _await ( v ) ;
}
function _ _asyncGenerator ( thisArg , _arguments , generator ) {
if ( ! Symbol . asyncIterator ) throw new TypeError ( "Symbol.asyncIterator is not defined." ) ;
var g = generator . apply ( thisArg , _arguments || [ ] ) , i , q = [ ] ;
2024-10-10 11:58:22 -04:00
return i = Object . create ( ( typeof AsyncIterator === "function" ? AsyncIterator : Object ) . prototype ) , verb ( "next" ) , verb ( "throw" ) , verb ( "return" , awaitReturn ) , i [ Symbol . asyncIterator ] = function ( ) { return this ; } , i ;
function awaitReturn ( f ) { return function ( v ) { return Promise . resolve ( v ) . then ( f , reject ) ; } ; }
function verb ( n , f ) { if ( g [ n ] ) { i [ n ] = function ( v ) { return new Promise ( function ( a , b ) { q . push ( [ n , v , a , b ] ) > 1 || resume ( n , v ) ; } ) ; } ; if ( f ) i [ n ] = f ( i [ n ] ) ; } }
2023-06-27 10:24:19 -04:00
function resume ( n , v ) { try { step ( g [ n ] ( v ) ) ; } catch ( e ) { settle ( q [ 0 ] [ 3 ] , e ) ; } }
function step ( r ) { r . value instanceof _ _await ? Promise . resolve ( r . value . v ) . then ( fulfill , reject ) : settle ( q [ 0 ] [ 2 ] , r ) ; }
function fulfill ( value ) { resume ( "next" , value ) ; }
function reject ( value ) { resume ( "throw" , value ) ; }
function settle ( f , v ) { if ( f ( v ) , q . shift ( ) , q . length ) resume ( q [ 0 ] [ 0 ] , q [ 0 ] [ 1 ] ) ; }
}
function _ _asyncDelegator ( o ) {
var i , p ;
return i = { } , verb ( "next" ) , verb ( "throw" , function ( e ) { throw e ; } ) , verb ( "return" ) , i [ Symbol . iterator ] = function ( ) { return this ; } , i ;
function verb ( n , f ) { i [ n ] = o [ n ] ? function ( v ) { return ( p = ! p ) ? { value : _ _await ( o [ n ] ( v ) ) , done : false } : f ? f ( v ) : v ; } : f ; }
}
function _ _asyncValues ( o ) {
if ( ! Symbol . asyncIterator ) throw new TypeError ( "Symbol.asyncIterator is not defined." ) ;
var m = o [ Symbol . asyncIterator ] , i ;
return m ? m . call ( o ) : ( o = typeof _ _values === "function" ? _ _values ( o ) : o [ Symbol . iterator ] ( ) , i = { } , verb ( "next" ) , verb ( "throw" ) , verb ( "return" ) , i [ Symbol . asyncIterator ] = function ( ) { return this ; } , i ) ;
function verb ( n ) { i [ n ] = o [ n ] && function ( v ) { return new Promise ( function ( resolve , reject ) { v = o [ n ] ( v ) , settle ( resolve , reject , v . done , v . value ) ; } ) ; } ; }
function settle ( resolve , reject , d , v ) { Promise . resolve ( v ) . then ( function ( v ) { resolve ( { value : v , done : d } ) ; } , reject ) ; }
}
function _ _makeTemplateObject ( cooked , raw ) {
if ( Object . defineProperty ) { Object . defineProperty ( cooked , "raw" , { value : raw } ) ; } else { cooked . raw = raw ; }
return cooked ;
} ;
var _ _setModuleDefault = Object . create ? ( function ( o , v ) {
Object . defineProperty ( o , "default" , { enumerable : true , value : v } ) ;
} ) : function ( o , v ) {
o [ "default" ] = v ;
} ;
function _ _importStar ( mod ) {
if ( mod && mod . _ _esModule ) return mod ;
var result = { } ;
if ( mod != null ) for ( var k in mod ) if ( k !== "default" && Object . prototype . hasOwnProperty . call ( mod , k ) ) _ _createBinding ( result , mod , k ) ;
_ _setModuleDefault ( result , mod ) ;
return result ;
}
function _ _importDefault ( mod ) {
return ( mod && mod . _ _esModule ) ? mod : { default : mod } ;
}
function _ _classPrivateFieldGet ( receiver , state , kind , f ) {
if ( kind === "a" && ! f ) throw new TypeError ( "Private accessor was defined without a getter" ) ;
if ( typeof state === "function" ? receiver !== state || ! f : ! state . has ( receiver ) ) throw new TypeError ( "Cannot read private member from an object whose class did not declare it" ) ;
return kind === "m" ? f : kind === "a" ? f . call ( receiver ) : f ? f . value : state . get ( receiver ) ;
}
function _ _classPrivateFieldSet ( receiver , state , value , kind , f ) {
if ( kind === "m" ) throw new TypeError ( "Private method is not writable" ) ;
if ( kind === "a" && ! f ) throw new TypeError ( "Private accessor was defined without a setter" ) ;
if ( typeof state === "function" ? receiver !== state || ! f : ! state . has ( receiver ) ) throw new TypeError ( "Cannot write private member to an object whose class did not declare it" ) ;
return ( kind === "a" ? f . call ( receiver , value ) : f ? f . value = value : state . set ( receiver , value ) ) , value ;
}
function _ _classPrivateFieldIn ( state , receiver ) {
if ( receiver === null || ( typeof receiver !== "object" && typeof receiver !== "function" ) ) throw new TypeError ( "Cannot use 'in' operator on non-object" ) ;
return typeof state === "function" ? receiver === state : state . has ( receiver ) ;
}
function _ _addDisposableResource ( env , value , async ) {
if ( value !== null && value !== void 0 ) {
2023-09-21 09:26:32 -04:00
if ( typeof value !== "object" && typeof value !== "function" ) throw new TypeError ( "Object expected." ) ;
2024-10-10 11:58:22 -04:00
var dispose , inner ;
2023-06-27 10:24:19 -04:00
if ( async ) {
2024-10-10 11:58:22 -04:00
if ( ! Symbol . asyncDispose ) throw new TypeError ( "Symbol.asyncDispose is not defined." ) ;
dispose = value [ Symbol . asyncDispose ] ;
2023-06-27 10:24:19 -04:00
}
if ( dispose === void 0 ) {
2024-10-10 11:58:22 -04:00
if ( ! Symbol . dispose ) throw new TypeError ( "Symbol.dispose is not defined." ) ;
dispose = value [ Symbol . dispose ] ;
if ( async ) inner = dispose ;
2023-06-27 10:24:19 -04:00
}
if ( typeof dispose !== "function" ) throw new TypeError ( "Object not disposable." ) ;
2024-10-10 11:58:22 -04:00
if ( inner ) dispose = function ( ) { try { inner . call ( this ) ; } catch ( e ) { return Promise . reject ( e ) ; } } ;
2023-06-27 10:24:19 -04:00
env . stack . push ( { value : value , dispose : dispose , async : async } ) ;
}
else if ( async ) {
env . stack . push ( { async : true } ) ;
}
return value ;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function ( error , suppressed , message ) {
var e = new Error ( message ) ;
return e . name = "SuppressedError" , e . error = error , e . suppressed = suppressed , e ;
} ;
function _ _disposeResources ( env ) {
function fail ( e ) {
env . error = env . hasError ? new _SuppressedError ( e , env . error , "An error was suppressed during disposal." ) : e ;
env . hasError = true ;
}
2024-10-10 11:58:22 -04:00
var r , s = 0 ;
2023-06-27 10:24:19 -04:00
function next ( ) {
2024-10-10 11:58:22 -04:00
while ( r = env . stack . pop ( ) ) {
2023-06-27 10:24:19 -04:00
try {
2024-10-10 11:58:22 -04:00
if ( ! r . async && s === 1 ) return s = 0 , env . stack . push ( r ) , Promise . resolve ( ) . then ( next ) ;
if ( r . dispose ) {
var result = r . dispose . call ( r . value ) ;
if ( r . async ) return s |= 2 , Promise . resolve ( result ) . then ( next , function ( e ) { fail ( e ) ; return next ( ) ; } ) ;
}
else s |= 1 ;
2023-06-27 10:24:19 -04:00
}
catch ( e ) {
2024-10-10 11:58:22 -04:00
fail ( e ) ;
2023-06-27 10:24:19 -04:00
}
}
2024-10-10 11:58:22 -04:00
if ( s === 1 ) return env . hasError ? Promise . reject ( env . error ) : Promise . resolve ( ) ;
2023-06-27 10:24:19 -04:00
if ( env . hasError ) throw env . error ;
}
return next ( ) ;
}
2024-01-31 07:59:56 -05:00
/* harmony default export */ const tslib _es6 = ( {
2023-06-27 10:24:19 -04:00
_ _extends ,
_ _assign ,
_ _rest ,
_ _decorate ,
_ _param ,
_ _metadata ,
_ _awaiter ,
_ _generator ,
_ _createBinding ,
_ _exportStar ,
_ _values ,
_ _read ,
_ _spread ,
_ _spreadArrays ,
_ _spreadArray ,
_ _await ,
_ _asyncGenerator ,
_ _asyncDelegator ,
_ _asyncValues ,
_ _makeTemplateObject ,
_ _importStar ,
_ _importDefault ,
_ _classPrivateFieldGet ,
_ _classPrivateFieldSet ,
_ _classPrivateFieldIn ,
_ _addDisposableResource ,
_ _disposeResources ,
} ) ;
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/constants.js
var zeroRightClassName = 'right-scroll-bar-position' ;
var fullWidthClassName = 'width-before-scroll-bar' ;
var noScrollbarsClassName = 'with-scroll-bars-hidden' ;
/ * *
* Name of a CSS variable containing the amount of "hidden" scrollbar
* ! might be undefined ! use will fallback !
* /
var removedBarSizeVariable = '--removed-body-scroll-bar-size' ;
; // CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/assignRef.js
/ * *
* Assigns a value for a given ref , no matter of the ref format
* @ param { RefObject } ref - a callback function or ref object
* @ param value - a new value
*
* @ see https : //github.com/theKashey/use-callback-ref#assignref
* @ example
* const refObject = useRef ( ) ;
* const refFn = ( ref ) => { ... . }
*
* assignRef ( refObject , "refValue" ) ;
* assignRef ( refFn , "refValue" ) ;
* /
function assignRef ( ref , value ) {
if ( typeof ref === 'function' ) {
ref ( value ) ;
}
else if ( ref ) {
ref . current = value ;
}
return ref ;
}
; // CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/useRef.js
/ * *
* creates a MutableRef with ref change callback
* @ param initialValue - initial ref value
* @ param { Function } callback - a callback to run when value changes
*
* @ example
* const ref = useCallbackRef ( 0 , ( newValue , oldValue ) => console . log ( oldValue , '->' , newValue ) ;
* ref . current = 1 ;
* // prints 0 -> 1
*
* @ see https : //reactjs.org/docs/hooks-reference.html#useref
* @ see https : //github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref
* @ returns { MutableRefObject }
* /
function useCallbackRef ( initialValue , callback ) {
var ref = ( 0 , external _React _namespaceObject . useState ) ( function ( ) { return ( {
// value
value : initialValue ,
// last callback
callback : callback ,
// "memoized" public interface
facade : {
get current ( ) {
return ref . value ;
} ,
set current ( value ) {
var last = ref . value ;
if ( last !== value ) {
ref . value = value ;
ref . callback ( value , last ) ;
}
} ,
} ,
} ) ; } ) [ 0 ] ;
// update callback
ref . callback = callback ;
return ref . facade ;
}
; // CONCATENATED MODULE: ./node_modules/use-callback-ref/dist/es2015/useMergeRef.js
2024-09-19 21:55:35 -04:00
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? external _React _namespaceObject . useLayoutEffect : external _React _namespaceObject . useEffect ;
var currentValues = new WeakMap ( ) ;
2023-06-27 10:24:19 -04:00
/ * *
* Merges two or more refs together providing a single interface to set their value
* @ param { RefObject | Ref } refs
* @ returns { MutableRefObject } - a new ref , which translates all changes to { refs }
*
* @ see { @ link mergeRefs } a version without buit - in memoization
* @ see https : //github.com/theKashey/use-callback-ref#usemergerefs
* @ example
* const Component = React . forwardRef ( ( props , ref ) => {
* const ownRef = useRef ( ) ;
* const domRef = useMergeRefs ( [ ref , ownRef ] ) ; // 👈 merge together
* return < div ref = { domRef } > ... < / d i v >
* }
* /
function useMergeRefs ( refs , defaultValue ) {
2024-09-19 21:55:35 -04:00
var callbackRef = useCallbackRef ( defaultValue || null , function ( newValue ) {
return refs . forEach ( function ( ref ) { return assignRef ( ref , newValue ) ; } ) ;
} ) ;
// handle refs changes - added or removed
useIsomorphicLayoutEffect ( function ( ) {
var oldValue = currentValues . get ( callbackRef ) ;
if ( oldValue ) {
var prevRefs _1 = new Set ( oldValue ) ;
var nextRefs _1 = new Set ( refs ) ;
var current _1 = callbackRef . current ;
prevRefs _1 . forEach ( function ( ref ) {
if ( ! nextRefs _1 . has ( ref ) ) {
assignRef ( ref , null ) ;
}
} ) ;
nextRefs _1 . forEach ( function ( ref ) {
if ( ! prevRefs _1 . has ( ref ) ) {
assignRef ( ref , current _1 ) ;
}
} ) ;
}
currentValues . set ( callbackRef , refs ) ;
} , [ refs ] ) ;
return callbackRef ;
2023-06-27 10:24:19 -04:00
}
; // CONCATENATED MODULE: ./node_modules/use-sidecar/dist/es2015/medium.js
function ItoI ( a ) {
return a ;
}
function innerCreateMedium ( defaults , middleware ) {
if ( middleware === void 0 ) { middleware = ItoI ; }
var buffer = [ ] ;
var assigned = false ;
var medium = {
read : function ( ) {
if ( assigned ) {
throw new Error ( 'Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.' ) ;
}
if ( buffer . length ) {
return buffer [ buffer . length - 1 ] ;
}
return defaults ;
} ,
useMedium : function ( data ) {
var item = middleware ( data , assigned ) ;
buffer . push ( item ) ;
return function ( ) {
buffer = buffer . filter ( function ( x ) { return x !== item ; } ) ;
} ;
} ,
assignSyncMedium : function ( cb ) {
assigned = true ;
while ( buffer . length ) {
var cbs = buffer ;
buffer = [ ] ;
cbs . forEach ( cb ) ;
}
buffer = {
push : function ( x ) { return cb ( x ) ; } ,
filter : function ( ) { return buffer ; } ,
} ;
} ,
assignMedium : function ( cb ) {
assigned = true ;
var pendingQueue = [ ] ;
if ( buffer . length ) {
var cbs = buffer ;
buffer = [ ] ;
cbs . forEach ( cb ) ;
pendingQueue = buffer ;
}
var executeQueue = function ( ) {
var cbs = pendingQueue ;
pendingQueue = [ ] ;
cbs . forEach ( cb ) ;
} ;
var cycle = function ( ) { return Promise . resolve ( ) . then ( executeQueue ) ; } ;
cycle ( ) ;
buffer = {
push : function ( x ) {
pendingQueue . push ( x ) ;
cycle ( ) ;
} ,
filter : function ( filter ) {
pendingQueue = pendingQueue . filter ( filter ) ;
return buffer ;
} ,
} ;
} ,
} ;
return medium ;
}
function createMedium ( defaults , middleware ) {
if ( middleware === void 0 ) { middleware = ItoI ; }
return innerCreateMedium ( defaults , middleware ) ;
}
// eslint-disable-next-line @typescript-eslint/ban-types
function createSidecarMedium ( options ) {
if ( options === void 0 ) { options = { } ; }
var medium = innerCreateMedium ( null ) ;
medium . options = _ _assign ( { async : true , ssr : false } , options ) ;
return medium ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/medium.js
2023-06-27 10:24:19 -04:00
var effectCar = createSidecarMedium ( ) ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/UI.js
2023-06-27 10:24:19 -04:00
var nothing = function ( ) {
return ;
} ;
/ * *
* Removes scrollbar from the page and contain the scroll within the Lock
* /
var RemoveScroll = external _React _namespaceObject . forwardRef ( function ( props , parentRef ) {
var ref = external _React _namespaceObject . useRef ( null ) ;
var _a = external _React _namespaceObject . useState ( {
onScrollCapture : nothing ,
onWheelCapture : nothing ,
onTouchMoveCapture : nothing ,
} ) , callbacks = _a [ 0 ] , setCallbacks = _a [ 1 ] ;
var forwardProps = props . forwardProps , children = props . children , className = props . className , removeScrollBar = props . removeScrollBar , enabled = props . enabled , shards = props . shards , sideCar = props . sideCar , noIsolation = props . noIsolation , inert = props . inert , allowPinchZoom = props . allowPinchZoom , _b = props . as , Container = _b === void 0 ? 'div' : _b , rest = _ _rest ( props , [ "forwardProps" , "children" , "className" , "removeScrollBar" , "enabled" , "shards" , "sideCar" , "noIsolation" , "inert" , "allowPinchZoom" , "as" ] ) ;
var SideCar = sideCar ;
var containerRef = useMergeRefs ( [ ref , parentRef ] ) ;
var containerProps = _ _assign ( _ _assign ( { } , rest ) , callbacks ) ;
return ( external _React _namespaceObject . createElement ( external _React _namespaceObject . Fragment , null ,
enabled && ( external _React _namespaceObject . createElement ( SideCar , { sideCar : effectCar , removeScrollBar : removeScrollBar , shards : shards , noIsolation : noIsolation , inert : inert , setCallbacks : setCallbacks , allowPinchZoom : ! ! allowPinchZoom , lockRef : ref } ) ) ,
forwardProps ? ( external _React _namespaceObject . cloneElement ( external _React _namespaceObject . Children . only ( children ) , _ _assign ( _ _assign ( { } , containerProps ) , { ref : containerRef } ) ) ) : ( external _React _namespaceObject . createElement ( Container , _ _assign ( { } , containerProps , { className : className , ref : containerRef } ) , children ) ) ) ) ;
} ) ;
RemoveScroll . defaultProps = {
enabled : true ,
removeScrollBar : true ,
inert : false ,
} ;
RemoveScroll . classNames = {
fullWidth : fullWidthClassName ,
zeroRight : zeroRightClassName ,
} ;
; // CONCATENATED MODULE: ./node_modules/use-sidecar/dist/es2015/exports.js
var SideCar = function ( _a ) {
var sideCar = _a . sideCar , rest = _ _rest ( _a , [ "sideCar" ] ) ;
if ( ! sideCar ) {
throw new Error ( 'Sidecar: please provide `sideCar` property to import the right car' ) ;
}
var Target = sideCar . read ( ) ;
if ( ! Target ) {
throw new Error ( 'Sidecar medium not found' ) ;
}
return external _React _namespaceObject . createElement ( Target , _ _assign ( { } , rest ) ) ;
} ;
SideCar . isSideCarExport = true ;
function exportSidecar ( medium , exported ) {
medium . useMedium ( exported ) ;
return SideCar ;
}
; // CONCATENATED MODULE: ./node_modules/get-nonce/dist/es2015/index.js
var currentNonce ;
var setNonce = function ( nonce ) {
currentNonce = nonce ;
} ;
var getNonce = function ( ) {
if ( currentNonce ) {
return currentNonce ;
}
if ( true ) {
return _ _webpack _require _ _ . nc ;
}
return undefined ;
} ;
; // CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/singleton.js
function makeStyleTag ( ) {
if ( ! document )
return null ;
var tag = document . createElement ( 'style' ) ;
tag . type = 'text/css' ;
var nonce = getNonce ( ) ;
if ( nonce ) {
tag . setAttribute ( 'nonce' , nonce ) ;
}
return tag ;
}
function injectStyles ( tag , css ) {
// @ts-ignore
if ( tag . styleSheet ) {
// @ts-ignore
tag . styleSheet . cssText = css ;
}
else {
tag . appendChild ( document . createTextNode ( css ) ) ;
}
}
function insertStyleTag ( tag ) {
var head = document . head || document . getElementsByTagName ( 'head' ) [ 0 ] ;
head . appendChild ( tag ) ;
}
var stylesheetSingleton = function ( ) {
var counter = 0 ;
var stylesheet = null ;
return {
add : function ( style ) {
if ( counter == 0 ) {
if ( ( stylesheet = makeStyleTag ( ) ) ) {
injectStyles ( stylesheet , style ) ;
insertStyleTag ( stylesheet ) ;
}
}
counter ++ ;
} ,
remove : function ( ) {
counter -- ;
if ( ! counter && stylesheet ) {
stylesheet . parentNode && stylesheet . parentNode . removeChild ( stylesheet ) ;
stylesheet = null ;
}
} ,
} ;
} ;
; // CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/hook.js
/ * *
* creates a hook to control style singleton
* @ see { @ link styleSingleton } for a safer component version
* @ example
* ` ` ` tsx
* const useStyle = styleHookSingleton ( ) ;
* ///
* useStyle ( 'body { overflow: hidden}' ) ;
* /
var styleHookSingleton = function ( ) {
var sheet = stylesheetSingleton ( ) ;
return function ( styles , isDynamic ) {
external _React _namespaceObject . useEffect ( function ( ) {
sheet . add ( styles ) ;
return function ( ) {
sheet . remove ( ) ;
} ;
} , [ styles && isDynamic ] ) ;
} ;
} ;
; // CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/component.js
/ * *
* create a Component to add styles on demand
* - styles are added when first instance is mounted
* - styles are removed when the last instance is unmounted
* - changing styles in runtime does nothing unless dynamic is set . But with multiple components that can lead to the undefined behavior
* /
var styleSingleton = function ( ) {
var useStyle = styleHookSingleton ( ) ;
var Sheet = function ( _a ) {
var styles = _a . styles , dynamic = _a . dynamic ;
useStyle ( styles , dynamic ) ;
return null ;
} ;
return Sheet ;
} ;
; // CONCATENATED MODULE: ./node_modules/react-style-singleton/dist/es2015/index.js
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/utils.js
var zeroGap = {
left : 0 ,
top : 0 ,
right : 0 ,
gap : 0 ,
} ;
var parse = function ( x ) { return parseInt ( x || '' , 10 ) || 0 ; } ;
var getOffset = function ( gapMode ) {
var cs = window . getComputedStyle ( document . body ) ;
var left = cs [ gapMode === 'padding' ? 'paddingLeft' : 'marginLeft' ] ;
var top = cs [ gapMode === 'padding' ? 'paddingTop' : 'marginTop' ] ;
var right = cs [ gapMode === 'padding' ? 'paddingRight' : 'marginRight' ] ;
return [ parse ( left ) , parse ( top ) , parse ( right ) ] ;
} ;
var getGapWidth = function ( gapMode ) {
if ( gapMode === void 0 ) { gapMode = 'margin' ; }
if ( typeof window === 'undefined' ) {
return zeroGap ;
}
var offsets = getOffset ( gapMode ) ;
var documentWidth = document . documentElement . clientWidth ;
var windowWidth = window . innerWidth ;
return {
left : offsets [ 0 ] ,
top : offsets [ 1 ] ,
right : offsets [ 2 ] ,
gap : Math . max ( 0 , windowWidth - documentWidth + offsets [ 2 ] - offsets [ 0 ] ) ,
} ;
} ;
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/component.js
var Style = styleSingleton ( ) ;
2024-09-19 21:55:35 -04:00
var lockAttribute = 'data-scroll-locked' ;
2023-06-27 10:24:19 -04:00
// important tip - once we measure scrollBar width and remove them
// we could not repeat this operation
// thus we are using style-singleton - only the first "yet correct" style will be applied.
var getStyles = function ( _a , allowRelative , gapMode , important ) {
var left = _a . left , top = _a . top , right = _a . right , gap = _a . gap ;
if ( gapMode === void 0 ) { gapMode = 'margin' ; }
2024-09-19 21:55:35 -04:00
return "\n ." . concat ( noScrollbarsClassName , " {\n overflow: hidden " ) . concat ( important , ";\n padding-right: " ) . concat ( gap , "px " ) . concat ( important , ";\n }\n body[" ) . concat ( lockAttribute , "] {\n overflow: hidden " ) . concat ( important , ";\n overscroll-behavior: contain;\n " ) . concat ( [
2023-06-27 10:24:19 -04:00
allowRelative && "position: relative " . concat ( important , ";" ) ,
gapMode === 'margin' &&
"\n padding-left: " . concat ( left , "px;\n padding-top: " ) . concat ( top , "px;\n padding-right: " ) . concat ( right , "px;\n margin-left:0;\n margin-top:0;\n margin-right: " ) . concat ( gap , "px " ) . concat ( important , ";\n " ) ,
gapMode === 'padding' && "padding-right: " . concat ( gap , "px " ) . concat ( important , ";" ) ,
]
. filter ( Boolean )
2024-09-19 21:55:35 -04:00
. join ( '' ) , "\n }\n \n ." ) . concat ( zeroRightClassName , " {\n right: " ) . concat ( gap , "px " ) . concat ( important , ";\n }\n \n ." ) . concat ( fullWidthClassName , " {\n margin-right: " ) . concat ( gap , "px " ) . concat ( important , ";\n }\n \n ." ) . concat ( zeroRightClassName , " ." ) . concat ( zeroRightClassName , " {\n right: 0 " ) . concat ( important , ";\n }\n \n ." ) . concat ( fullWidthClassName , " ." ) . concat ( fullWidthClassName , " {\n margin-right: 0 " ) . concat ( important , ";\n }\n \n body[" ) . concat ( lockAttribute , "] {\n " ) . concat ( removedBarSizeVariable , ": " ) . concat ( gap , "px;\n }\n" ) ;
} ;
var getCurrentUseCounter = function ( ) {
var counter = parseInt ( document . body . getAttribute ( lockAttribute ) || '0' , 10 ) ;
return isFinite ( counter ) ? counter : 0 ;
} ;
var useLockAttribute = function ( ) {
external _React _namespaceObject . useEffect ( function ( ) {
document . body . setAttribute ( lockAttribute , ( getCurrentUseCounter ( ) + 1 ) . toString ( ) ) ;
return function ( ) {
var newCounter = getCurrentUseCounter ( ) - 1 ;
if ( newCounter <= 0 ) {
document . body . removeAttribute ( lockAttribute ) ;
}
else {
document . body . setAttribute ( lockAttribute , newCounter . toString ( ) ) ;
}
} ;
} , [ ] ) ;
2023-06-27 10:24:19 -04:00
} ;
/ * *
* Removes page scrollbar and blocks page scroll when mounted
* /
2024-09-19 21:55:35 -04:00
var RemoveScrollBar = function ( _a ) {
var noRelative = _a . noRelative , noImportant = _a . noImportant , _b = _a . gapMode , gapMode = _b === void 0 ? 'margin' : _b ;
useLockAttribute ( ) ;
2023-06-27 10:24:19 -04:00
/ *
gap will be measured on every component mount
however it will be used only by the "first" invocation
due to singleton nature of < Style
* /
var gap = external _React _namespaceObject . useMemo ( function ( ) { return getGapWidth ( gapMode ) ; } , [ gapMode ] ) ;
return external _React _namespaceObject . createElement ( Style , { styles : getStyles ( gap , ! noRelative , gapMode , ! noImportant ? '!important' : '' ) } ) ;
} ;
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll-bar/dist/es2015/index.js
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
2023-06-27 10:24:19 -04:00
var passiveSupported = false ;
if ( typeof window !== 'undefined' ) {
try {
var options = Object . defineProperty ( { } , 'passive' , {
get : function ( ) {
passiveSupported = true ;
return true ;
} ,
} ) ;
// @ts-ignore
window . addEventListener ( 'test' , options , options ) ;
// @ts-ignore
window . removeEventListener ( 'test' , options , options ) ;
}
catch ( err ) {
passiveSupported = false ;
}
}
var nonPassive = passiveSupported ? { passive : false } : false ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/handleScroll.js
var alwaysContainsScroll = function ( node ) {
// textarea will always _contain_ scroll inside self. It only can be hidden
return node . tagName === 'TEXTAREA' ;
2023-06-27 10:24:19 -04:00
} ;
2024-09-19 21:55:35 -04:00
var elementCanBeScrolled = function ( node , overflow ) {
2023-06-27 10:24:19 -04:00
var styles = window . getComputedStyle ( node ) ;
2024-09-19 21:55:35 -04:00
return (
// not-not-scrollable
styles [ overflow ] !== 'hidden' &&
// contains scroll inside self
! ( styles . overflowY === styles . overflowX && ! alwaysContainsScroll ( node ) && styles [ overflow ] === 'visible' ) ) ;
2023-06-27 10:24:19 -04:00
} ;
2024-09-19 21:55:35 -04:00
var elementCouldBeVScrolled = function ( node ) { return elementCanBeScrolled ( node , 'overflowY' ) ; } ;
var elementCouldBeHScrolled = function ( node ) { return elementCanBeScrolled ( node , 'overflowX' ) ; } ;
2023-06-27 10:24:19 -04:00
var locationCouldBeScrolled = function ( axis , node ) {
var current = node ;
do {
// Skip over shadow root
if ( typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot ) {
current = current . host ;
}
var isScrollable = elementCouldBeScrolled ( axis , current ) ;
if ( isScrollable ) {
var _a = getScrollVariables ( axis , current ) , s = _a [ 1 ] , d = _a [ 2 ] ;
if ( s > d ) {
return true ;
}
}
current = current . parentNode ;
} while ( current && current !== document . body ) ;
return false ;
} ;
var getVScrollVariables = function ( _a ) {
var scrollTop = _a . scrollTop , scrollHeight = _a . scrollHeight , clientHeight = _a . clientHeight ;
return [
scrollTop ,
scrollHeight ,
clientHeight ,
] ;
} ;
var getHScrollVariables = function ( _a ) {
var scrollLeft = _a . scrollLeft , scrollWidth = _a . scrollWidth , clientWidth = _a . clientWidth ;
return [
scrollLeft ,
scrollWidth ,
clientWidth ,
] ;
} ;
var elementCouldBeScrolled = function ( axis , node ) {
return axis === 'v' ? elementCouldBeVScrolled ( node ) : elementCouldBeHScrolled ( node ) ;
} ;
var getScrollVariables = function ( axis , node ) {
return axis === 'v' ? getVScrollVariables ( node ) : getHScrollVariables ( node ) ;
} ;
var getDirectionFactor = function ( axis , direction ) {
/ * *
* If the element ' s direction is rtl ( right - to - left ) , then scrollLeft is 0 when the scrollbar is at its rightmost position ,
* and then increasingly negative as you scroll towards the end of the content .
* @ see https : //developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft
* /
return axis === 'h' && direction === 'rtl' ? - 1 : 1 ;
} ;
var handleScroll = function ( axis , endTarget , event , sourceDelta , noOverscroll ) {
var directionFactor = getDirectionFactor ( axis , window . getComputedStyle ( endTarget ) . direction ) ;
var delta = directionFactor * sourceDelta ;
// find scrollable target
var target = event . target ;
var targetInLock = endTarget . contains ( target ) ;
var shouldCancelScroll = false ;
var isDeltaPositive = delta > 0 ;
var availableScroll = 0 ;
var availableScrollTop = 0 ;
do {
var _a = getScrollVariables ( axis , target ) , position = _a [ 0 ] , scroll _1 = _a [ 1 ] , capacity = _a [ 2 ] ;
var elementScroll = scroll _1 - capacity - directionFactor * position ;
if ( position || elementScroll ) {
if ( elementCouldBeScrolled ( axis , target ) ) {
availableScroll += elementScroll ;
availableScrollTop += position ;
}
}
target = target . parentNode ;
} while (
// portaled content
( ! targetInLock && target !== document . body ) ||
// self content
( targetInLock && ( endTarget . contains ( target ) || endTarget === target ) ) ) ;
if ( isDeltaPositive && ( ( noOverscroll && availableScroll === 0 ) || ( ! noOverscroll && delta > availableScroll ) ) ) {
shouldCancelScroll = true ;
}
else if ( ! isDeltaPositive &&
( ( noOverscroll && availableScrollTop === 0 ) || ( ! noOverscroll && - delta > availableScrollTop ) ) ) {
shouldCancelScroll = true ;
}
return shouldCancelScroll ;
} ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/SideEffect.js
2023-06-27 10:24:19 -04:00
var getTouchXY = function ( event ) {
return 'changedTouches' in event ? [ event . changedTouches [ 0 ] . clientX , event . changedTouches [ 0 ] . clientY ] : [ 0 , 0 ] ;
} ;
var getDeltaXY = function ( event ) { return [ event . deltaX , event . deltaY ] ; } ;
var extractRef = function ( ref ) {
return ref && 'current' in ref ? ref . current : ref ;
} ;
var deltaCompare = function ( x , y ) { return x [ 0 ] === y [ 0 ] && x [ 1 ] === y [ 1 ] ; } ;
var generateStyle = function ( id ) { return "\n .block-interactivity-" . concat ( id , " {pointer-events: none;}\n .allow-interactivity-" ) . concat ( id , " {pointer-events: all;}\n" ) ; } ;
var idCounter = 0 ;
var lockStack = [ ] ;
function RemoveScrollSideCar ( props ) {
var shouldPreventQueue = external _React _namespaceObject . useRef ( [ ] ) ;
var touchStartRef = external _React _namespaceObject . useRef ( [ 0 , 0 ] ) ;
var activeAxis = external _React _namespaceObject . useRef ( ) ;
var id = external _React _namespaceObject . useState ( idCounter ++ ) [ 0 ] ;
var Style = external _React _namespaceObject . useState ( function ( ) { return styleSingleton ( ) ; } ) [ 0 ] ;
var lastProps = external _React _namespaceObject . useRef ( props ) ;
external _React _namespaceObject . useEffect ( function ( ) {
lastProps . current = props ;
} , [ props ] ) ;
external _React _namespaceObject . useEffect ( function ( ) {
if ( props . inert ) {
document . body . classList . add ( "block-interactivity-" . concat ( id ) ) ;
var allow _1 = _ _spreadArray ( [ props . lockRef . current ] , ( props . shards || [ ] ) . map ( extractRef ) , true ) . filter ( Boolean ) ;
allow _1 . forEach ( function ( el ) { return el . classList . add ( "allow-interactivity-" . concat ( id ) ) ; } ) ;
return function ( ) {
document . body . classList . remove ( "block-interactivity-" . concat ( id ) ) ;
allow _1 . forEach ( function ( el ) { return el . classList . remove ( "allow-interactivity-" . concat ( id ) ) ; } ) ;
} ;
}
return ;
} , [ props . inert , props . lockRef . current , props . shards ] ) ;
var shouldCancelEvent = external _React _namespaceObject . useCallback ( function ( event , parent ) {
if ( 'touches' in event && event . touches . length === 2 ) {
return ! lastProps . current . allowPinchZoom ;
}
var touch = getTouchXY ( event ) ;
var touchStart = touchStartRef . current ;
var deltaX = 'deltaX' in event ? event . deltaX : touchStart [ 0 ] - touch [ 0 ] ;
var deltaY = 'deltaY' in event ? event . deltaY : touchStart [ 1 ] - touch [ 1 ] ;
var currentAxis ;
var target = event . target ;
var moveDirection = Math . abs ( deltaX ) > Math . abs ( deltaY ) ? 'h' : 'v' ;
// allow horizontal touch move on Range inputs. They will not cause any scroll
if ( 'touches' in event && moveDirection === 'h' && target . type === 'range' ) {
return false ;
}
var canBeScrolledInMainDirection = locationCouldBeScrolled ( moveDirection , target ) ;
if ( ! canBeScrolledInMainDirection ) {
return true ;
}
if ( canBeScrolledInMainDirection ) {
currentAxis = moveDirection ;
}
else {
currentAxis = moveDirection === 'v' ? 'h' : 'v' ;
canBeScrolledInMainDirection = locationCouldBeScrolled ( moveDirection , target ) ;
// other axis might be not scrollable
}
if ( ! canBeScrolledInMainDirection ) {
return false ;
}
if ( ! activeAxis . current && 'changedTouches' in event && ( deltaX || deltaY ) ) {
activeAxis . current = currentAxis ;
}
if ( ! currentAxis ) {
return true ;
}
var cancelingAxis = activeAxis . current || currentAxis ;
return handleScroll ( cancelingAxis , parent , event , cancelingAxis === 'h' ? deltaX : deltaY , true ) ;
} , [ ] ) ;
var shouldPrevent = external _React _namespaceObject . useCallback ( function ( _event ) {
var event = _event ;
if ( ! lockStack . length || lockStack [ lockStack . length - 1 ] !== Style ) {
// not the last active
return ;
}
var delta = 'deltaY' in event ? getDeltaXY ( event ) : getTouchXY ( event ) ;
var sourceEvent = shouldPreventQueue . current . filter ( function ( e ) { return e . name === event . type && e . target === event . target && deltaCompare ( e . delta , delta ) ; } ) [ 0 ] ;
// self event, and should be canceled
if ( sourceEvent && sourceEvent . should ) {
2024-09-19 21:55:35 -04:00
if ( event . cancelable ) {
event . preventDefault ( ) ;
}
2023-06-27 10:24:19 -04:00
return ;
}
// outside or shard event
if ( ! sourceEvent ) {
var shardNodes = ( lastProps . current . shards || [ ] )
. map ( extractRef )
. filter ( Boolean )
. filter ( function ( node ) { return node . contains ( event . target ) ; } ) ;
var shouldStop = shardNodes . length > 0 ? shouldCancelEvent ( event , shardNodes [ 0 ] ) : ! lastProps . current . noIsolation ;
if ( shouldStop ) {
2024-09-19 21:55:35 -04:00
if ( event . cancelable ) {
event . preventDefault ( ) ;
}
2023-06-27 10:24:19 -04:00
}
}
} , [ ] ) ;
var shouldCancel = external _React _namespaceObject . useCallback ( function ( name , delta , target , should ) {
var event = { name : name , delta : delta , target : target , should : should } ;
shouldPreventQueue . current . push ( event ) ;
setTimeout ( function ( ) {
shouldPreventQueue . current = shouldPreventQueue . current . filter ( function ( e ) { return e !== event ; } ) ;
} , 1 ) ;
} , [ ] ) ;
var scrollTouchStart = external _React _namespaceObject . useCallback ( function ( event ) {
touchStartRef . current = getTouchXY ( event ) ;
activeAxis . current = undefined ;
} , [ ] ) ;
var scrollWheel = external _React _namespaceObject . useCallback ( function ( event ) {
shouldCancel ( event . type , getDeltaXY ( event ) , event . target , shouldCancelEvent ( event , props . lockRef . current ) ) ;
} , [ ] ) ;
var scrollTouchMove = external _React _namespaceObject . useCallback ( function ( event ) {
shouldCancel ( event . type , getTouchXY ( event ) , event . target , shouldCancelEvent ( event , props . lockRef . current ) ) ;
} , [ ] ) ;
external _React _namespaceObject . useEffect ( function ( ) {
lockStack . push ( Style ) ;
props . setCallbacks ( {
onScrollCapture : scrollWheel ,
onWheelCapture : scrollWheel ,
onTouchMoveCapture : scrollTouchMove ,
} ) ;
document . addEventListener ( 'wheel' , shouldPrevent , nonPassive ) ;
document . addEventListener ( 'touchmove' , shouldPrevent , nonPassive ) ;
document . addEventListener ( 'touchstart' , scrollTouchStart , nonPassive ) ;
return function ( ) {
lockStack = lockStack . filter ( function ( inst ) { return inst !== Style ; } ) ;
document . removeEventListener ( 'wheel' , shouldPrevent , nonPassive ) ;
document . removeEventListener ( 'touchmove' , shouldPrevent , nonPassive ) ;
document . removeEventListener ( 'touchstart' , scrollTouchStart , nonPassive ) ;
} ;
} , [ ] ) ;
var removeScrollBar = props . removeScrollBar , inert = props . inert ;
return ( external _React _namespaceObject . createElement ( external _React _namespaceObject . Fragment , null ,
inert ? external _React _namespaceObject . createElement ( Style , { styles : generateStyle ( id ) } ) : null ,
removeScrollBar ? external _React _namespaceObject . createElement ( RemoveScrollBar , { gapMode : "margin" } ) : null ) ) ;
}
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/sidecar.js
2023-06-27 10:24:19 -04:00
2024-01-31 07:59:56 -05:00
/* harmony default export */ const sidecar = ( exportSidecar ( effectCar , RemoveScrollSideCar ) ) ;
2023-06-27 10:24:19 -04:00
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/react-remove-scroll/dist/es2015/Combination.js
2023-06-27 10:24:19 -04:00
var ReactRemoveScroll = external _React _namespaceObject . forwardRef ( function ( props , ref ) { return ( external _React _namespaceObject . createElement ( RemoveScroll , _ _assign ( { } , props , { ref : ref , sideCar : sidecar } ) ) ) ; } ) ;
ReactRemoveScroll . classNames = RemoveScroll . classNames ;
2024-01-31 07:59:56 -05:00
/* harmony default export */ const Combination = ( ReactRemoveScroll ) ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: ./node_modules/aria-hidden/dist/es2015/index.js
var getDefaultParent = function ( originalTarget ) {
if ( typeof document === 'undefined' ) {
return null ;
}
var sampleTarget = Array . isArray ( originalTarget ) ? originalTarget [ 0 ] : originalTarget ;
return sampleTarget . ownerDocument . body ;
} ;
var counterMap = new WeakMap ( ) ;
var uncontrolledNodes = new WeakMap ( ) ;
var markerMap = { } ;
var lockCount = 0 ;
var unwrapHost = function ( node ) {
return node && ( node . host || unwrapHost ( node . parentNode ) ) ;
} ;
var correctTargets = function ( parent , targets ) {
return targets
. map ( function ( target ) {
if ( parent . contains ( target ) ) {
return target ;
}
var correctedTarget = unwrapHost ( target ) ;
if ( correctedTarget && parent . contains ( correctedTarget ) ) {
return correctedTarget ;
}
console . error ( 'aria-hidden' , target , 'in not contained inside' , parent , '. Doing nothing' ) ;
return null ;
} )
. filter ( function ( x ) { return Boolean ( x ) ; } ) ;
} ;
/ * *
* Marks everything except given node ( or nodes ) as aria - hidden
* @ param { Element | Element [ ] } originalTarget - elements to keep on the page
* @ param [ parentNode ] - top element , defaults to document . body
* @ param { String } [ markerName ] - a special attribute to mark every node
* @ param { String } [ controlAttribute ] - html Attribute to control
* @ return { Undo } undo command
* /
var applyAttributeToOthers = function ( originalTarget , parentNode , markerName , controlAttribute ) {
var targets = correctTargets ( parentNode , Array . isArray ( originalTarget ) ? originalTarget : [ originalTarget ] ) ;
if ( ! markerMap [ markerName ] ) {
markerMap [ markerName ] = new WeakMap ( ) ;
}
var markerCounter = markerMap [ markerName ] ;
var hiddenNodes = [ ] ;
var elementsToKeep = new Set ( ) ;
var elementsToStop = new Set ( targets ) ;
var keep = function ( el ) {
if ( ! el || elementsToKeep . has ( el ) ) {
return ;
}
elementsToKeep . add ( el ) ;
keep ( el . parentNode ) ;
} ;
targets . forEach ( keep ) ;
var deep = function ( parent ) {
if ( ! parent || elementsToStop . has ( parent ) ) {
return ;
}
Array . prototype . forEach . call ( parent . children , function ( node ) {
if ( elementsToKeep . has ( node ) ) {
deep ( node ) ;
}
else {
2024-09-19 21:55:35 -04:00
try {
var attr = node . getAttribute ( controlAttribute ) ;
var alreadyHidden = attr !== null && attr !== 'false' ;
var counterValue = ( counterMap . get ( node ) || 0 ) + 1 ;
var markerValue = ( markerCounter . get ( node ) || 0 ) + 1 ;
counterMap . set ( node , counterValue ) ;
markerCounter . set ( node , markerValue ) ;
hiddenNodes . push ( node ) ;
if ( counterValue === 1 && alreadyHidden ) {
uncontrolledNodes . set ( node , true ) ;
}
if ( markerValue === 1 ) {
node . setAttribute ( markerName , 'true' ) ;
}
if ( ! alreadyHidden ) {
node . setAttribute ( controlAttribute , 'true' ) ;
}
2023-06-27 10:24:19 -04:00
}
2024-09-19 21:55:35 -04:00
catch ( e ) {
console . error ( 'aria-hidden: cannot operate on ' , node , e ) ;
2023-06-27 10:24:19 -04:00
}
}
} ) ;
} ;
deep ( parentNode ) ;
elementsToKeep . clear ( ) ;
lockCount ++ ;
return function ( ) {
hiddenNodes . forEach ( function ( node ) {
var counterValue = counterMap . get ( node ) - 1 ;
var markerValue = markerCounter . get ( node ) - 1 ;
counterMap . set ( node , counterValue ) ;
markerCounter . set ( node , markerValue ) ;
if ( ! counterValue ) {
if ( ! uncontrolledNodes . has ( node ) ) {
node . removeAttribute ( controlAttribute ) ;
}
uncontrolledNodes . delete ( node ) ;
}
if ( ! markerValue ) {
node . removeAttribute ( markerName ) ;
}
} ) ;
lockCount -- ;
if ( ! lockCount ) {
// clear
counterMap = new WeakMap ( ) ;
counterMap = new WeakMap ( ) ;
uncontrolledNodes = new WeakMap ( ) ;
markerMap = { } ;
}
} ;
} ;
/ * *
* Marks everything except given node ( or nodes ) as aria - hidden
* @ param { Element | Element [ ] } originalTarget - elements to keep on the page
* @ param [ parentNode ] - top element , defaults to document . body
* @ param { String } [ markerName ] - a special attribute to mark every node
* @ return { Undo } undo command
* /
var hideOthers = function ( originalTarget , parentNode , markerName ) {
if ( markerName === void 0 ) { markerName = 'data-aria-hidden' ; }
var targets = Array . from ( Array . isArray ( originalTarget ) ? originalTarget : [ originalTarget ] ) ;
var activeParentNode = parentNode || getDefaultParent ( originalTarget ) ;
if ( ! activeParentNode ) {
return function ( ) { return null ; } ;
}
// we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10
targets . push . apply ( targets , Array . from ( activeParentNode . querySelectorAll ( '[aria-live]' ) ) ) ;
return applyAttributeToOthers ( targets , activeParentNode , markerName , 'aria-hidden' ) ;
} ;
/ * *
* Marks everything except given node ( or nodes ) as inert
* @ param { Element | Element [ ] } originalTarget - elements to keep on the page
* @ param [ parentNode ] - top element , defaults to document . body
* @ param { String } [ markerName ] - a special attribute to mark every node
* @ return { Undo } undo command
* /
var inertOthers = function ( originalTarget , parentNode , markerName ) {
if ( markerName === void 0 ) { markerName = 'data-inert-ed' ; }
var activeParentNode = parentNode || getDefaultParent ( originalTarget ) ;
if ( ! activeParentNode ) {
return function ( ) { return null ; } ;
}
return applyAttributeToOthers ( originalTarget , activeParentNode , markerName , 'inert' ) ;
} ;
/ * *
* @ returns if current browser supports inert
* /
var supportsInert = function ( ) {
return typeof HTMLElement !== 'undefined' && HTMLElement . prototype . hasOwnProperty ( 'inert' ) ;
} ;
/ * *
* Automatic function to "suppress" DOM elements - _hide _ or _inert _ in the best possible way
* @ param { Element | Element [ ] } originalTarget - elements to keep on the page
* @ param [ parentNode ] - top element , defaults to document . body
* @ param { String } [ markerName ] - a special attribute to mark every node
* @ return { Undo } undo command
* /
var suppressOthers = function ( originalTarget , parentNode , markerName ) {
if ( markerName === void 0 ) { markerName = 'data-suppressed' ; }
return ( supportsInert ( ) ? inertOthers : hideOthers ) ( originalTarget , parentNode , markerName ) ;
} ;
2024-09-19 21:55:35 -04:00
; // CONCATENATED MODULE: ./node_modules/@radix-ui/react-dialog/dist/index.mjs
2023-06-27 10:24:19 -04:00
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* Dialog
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 d 3 8 5 0 c 4 d 0 b 4 e 6 c 7 $ v a r $ D I A L O G _ N A M E = ' D i a l o g ' ;
const [ $5d3850c4d0b4e6c7$var$createDialogContext , $5d3850c4d0b4e6c7$export$cc702773b8ea3e41 ] = $c512c27ab02ef895$export$50c7b4e9d9f19c1 ( $5d3850c4d0b4e6c7$var$DIALOG _NAME ) ;
const [ $5d3850c4d0b4e6c7$var$DialogProvider , $5d3850c4d0b4e6c7$var$useDialogContext ] = $5d3850c4d0b4e6c7$var$createDialogContext ( $5d3850c4d0b4e6c7$var$DIALOG _NAME ) ;
const $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 = ( props ) => {
const { _ _scopeDialog : _ _scopeDialog , children : children , open : openProp , defaultOpen : defaultOpen , onOpenChange : onOpenChange , modal : modal = true } = props ;
const triggerRef = ( 0 , external _React _namespaceObject . useRef ) ( null ) ;
const contentRef = ( 0 , external _React _namespaceObject . useRef ) ( null ) ;
const [ open = false , setOpen ] = $71cd76cc60e0454e$export$6f32135080cb4c3 ( {
prop : openProp ,
defaultProp : defaultOpen ,
onChange : onOpenChange
} ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5d3850c4d0b4e6c7$var$DialogProvider , {
scope : _ _scopeDialog ,
triggerRef : triggerRef ,
contentRef : contentRef ,
contentId : $1746a345f3d73bb7$export$f680877a34711e37 ( ) ,
titleId : $1746a345f3d73bb7$export$f680877a34711e37 ( ) ,
descriptionId : $1746a345f3d73bb7$export$f680877a34711e37 ( ) ,
open : open ,
onOpenChange : setOpen ,
onOpenToggle : ( 0 , external _React _namespaceObject . useCallback ) ( ( ) => setOpen ( ( prevOpen ) => ! prevOpen
)
, [
setOpen
] ) ,
modal : modal
} , children ) ;
} ;
/*#__PURE__*/ Object . assign ( $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 , {
displayName : $5d3850c4d0b4e6c7$var$DIALOG _NAME
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DialogTrigger
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 d 3 8 5 0 c 4 d 0 b 4 e 6 c 7 $ v a r $ T R I G G E R _ N A M E = ' D i a l o g T r i g g e r ' ;
const $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const { _ _scopeDialog : _ _scopeDialog , ... triggerProps } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$TRIGGER _NAME , _ _scopeDialog ) ;
const composedTriggerRef = $6ed0406888f73fc4$export$c7b2cbe3552a0d05 ( forwardedRef , context . triggerRef ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . button , _extends ( {
type : "button" ,
"aria-haspopup" : "dialog" ,
"aria-expanded" : context . open ,
"aria-controls" : context . contentId ,
"data-state" : $5d3850c4d0b4e6c7$var$getState ( context . open )
} , triggerProps , {
ref : composedTriggerRef ,
onClick : $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( props . onClick , context . onOpenToggle )
} ) ) ;
} ) ;
/*#__PURE__*/ Object . assign ( $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 , {
displayName : $5d3850c4d0b4e6c7$var$TRIGGER _NAME
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DialogPortal
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 d 3 8 5 0 c 4 d 0 b 4 e 6 c 7 $ v a r $ P O R T A L _ N A M E = ' D i a l o g P o r t a l ' ;
const [ $5d3850c4d0b4e6c7$var$PortalProvider , $5d3850c4d0b4e6c7$var$usePortalContext ] = $5d3850c4d0b4e6c7$var$createDialogContext ( $5d3850c4d0b4e6c7$var$PORTAL _NAME , {
forceMount : undefined
} ) ;
const $5d3850c4d0b4e6c7$export$dad7c95542bacce0 = ( props ) => {
const { _ _scopeDialog : _ _scopeDialog , forceMount : forceMount , children : children , container : container } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$PORTAL _NAME , _ _scopeDialog ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5d3850c4d0b4e6c7$var$PortalProvider , {
scope : _ _scopeDialog ,
forceMount : forceMount
} , external _React _namespaceObject . Children . map ( children , ( child ) => /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $921a889cee6df7e8$export$99c2b779aa4e8b8b , {
present : forceMount || context . open
} , /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $f1701beae083dbae$export$602eac185826482c , {
asChild : true ,
container : container
} , child ) )
) ) ;
} ;
/*#__PURE__*/ Object . assign ( $5d3850c4d0b4e6c7$export$dad7c95542bacce0 , {
displayName : $5d3850c4d0b4e6c7$var$PORTAL _NAME
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DialogOverlay
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 d 3 8 5 0 c 4 d 0 b 4 e 6 c 7 $ v a r $ O V E R L A Y _ N A M E = ' D i a l o g O v e r l a y ' ;
const $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext ( $5d3850c4d0b4e6c7$var$OVERLAY _NAME , props . _ _scopeDialog ) ;
const { forceMount : forceMount = portalContext . forceMount , ... overlayProps } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$OVERLAY _NAME , props . _ _scopeDialog ) ;
return context . modal ? /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $921a889cee6df7e8$export$99c2b779aa4e8b8b , {
present : forceMount || context . open
} , /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5d3850c4d0b4e6c7$var$DialogOverlayImpl , _extends ( { } , overlayProps , {
ref : forwardedRef
} ) ) ) : null ;
} ) ;
/*#__PURE__*/ Object . assign ( $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 , {
displayName : $5d3850c4d0b4e6c7$var$OVERLAY _NAME
} ) ;
const $5d3850c4d0b4e6c7$var$DialogOverlayImpl = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const { _ _scopeDialog : _ _scopeDialog , ... overlayProps } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$OVERLAY _NAME , _ _scopeDialog ) ;
return ( /*#__PURE__*/ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
// ie. when `Overlay` and `Content` are siblings
( 0 , external _React _namespaceObject . createElement ) ( Combination , {
as : $5e63c961fc1ce211$export$8c6ed5c666ac1360 ,
allowPinchZoom : true ,
shards : [
context . contentRef
]
} , /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . div , _extends ( {
"data-state" : $5d3850c4d0b4e6c7$var$getState ( context . open )
} , overlayProps , {
ref : forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
,
style : {
pointerEvents : 'auto' ,
... overlayProps . style
}
} ) ) ) ) ;
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DialogContent
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 d 3 8 5 0 c 4 d 0 b 4 e 6 c 7 $ v a r $ C O N T E N T _ N A M E = ' D i a l o g C o n t e n t ' ;
const $5d3850c4d0b4e6c7$export$b6d9565de1e068cf = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const portalContext = $5d3850c4d0b4e6c7$var$usePortalContext ( $5d3850c4d0b4e6c7$var$CONTENT _NAME , props . _ _scopeDialog ) ;
const { forceMount : forceMount = portalContext . forceMount , ... contentProps } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$CONTENT _NAME , props . _ _scopeDialog ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $921a889cee6df7e8$export$99c2b779aa4e8b8b , {
present : forceMount || context . open
} , context . modal ? /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5d3850c4d0b4e6c7$var$DialogContentModal , _extends ( { } , contentProps , {
ref : forwardedRef
} ) ) : /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5d3850c4d0b4e6c7$var$DialogContentNonModal , _extends ( { } , contentProps , {
ref : forwardedRef
} ) ) ) ;
} ) ;
/*#__PURE__*/ Object . assign ( $5d3850c4d0b4e6c7$export$b6d9565de1e068cf , {
displayName : $5d3850c4d0b4e6c7$var$CONTENT _NAME
} ) ;
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentModal = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$CONTENT _NAME , props . _ _scopeDialog ) ;
const contentRef = ( 0 , external _React _namespaceObject . useRef ) ( null ) ;
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05 ( forwardedRef , context . contentRef , contentRef ) ; // aria-hide everything except the content (better supported equivalent to setting aria-modal)
( 0 , external _React _namespaceObject . useEffect ) ( ( ) => {
const content = contentRef . current ;
if ( content ) return hideOthers ( content ) ;
} , [ ] ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5d3850c4d0b4e6c7$var$DialogContentImpl , _extends ( { } , props , {
ref : composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed
,
trapFocus : context . open ,
disableOutsidePointerEvents : true ,
onCloseAutoFocus : $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( props . onCloseAutoFocus , ( event ) => {
var _context$triggerRef$c ;
event . preventDefault ( ) ;
( _context$triggerRef$c = context . triggerRef . current ) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c . focus ( ) ;
} ) ,
onPointerDownOutside : $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( props . onPointerDownOutside , ( event ) => {
const originalEvent = event . detail . originalEvent ;
const ctrlLeftClick = originalEvent . button === 0 && originalEvent . ctrlKey === true ;
const isRightClick = originalEvent . button === 2 || ctrlLeftClick ; // If the event is a right-click, we shouldn't close because
// it is effectively as if we right-clicked the `Overlay`.
if ( isRightClick ) event . preventDefault ( ) ;
} ) // When focus is trapped, a `focusout` event may still happen.
,
onFocusOutside : $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( props . onFocusOutside , ( event ) => event . preventDefault ( )
)
} ) ) ;
} ) ;
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentNonModal = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$CONTENT _NAME , props . _ _scopeDialog ) ;
const hasInteractedOutsideRef = ( 0 , external _React _namespaceObject . useRef ) ( false ) ;
2024-09-19 21:55:35 -04:00
const hasPointerDownOutsideRef = ( 0 , external _React _namespaceObject . useRef ) ( false ) ;
2023-06-27 10:24:19 -04:00
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5d3850c4d0b4e6c7$var$DialogContentImpl , _extends ( { } , props , {
ref : forwardedRef ,
trapFocus : false ,
disableOutsidePointerEvents : false ,
onCloseAutoFocus : ( event ) => {
var _props$onCloseAutoFoc ;
( _props$onCloseAutoFoc = props . onCloseAutoFocus ) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc . call ( props , event ) ;
if ( ! event . defaultPrevented ) {
var _context$triggerRef$c2 ;
if ( ! hasInteractedOutsideRef . current ) ( _context$triggerRef$c2 = context . triggerRef . current ) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2 . focus ( ) ; // Always prevent auto focus because we either focus manually or want user agent focus
event . preventDefault ( ) ;
}
hasInteractedOutsideRef . current = false ;
2024-09-19 21:55:35 -04:00
hasPointerDownOutsideRef . current = false ;
2023-06-27 10:24:19 -04:00
} ,
onInteractOutside : ( event ) => {
var _props$onInteractOuts , _context$triggerRef$c3 ;
( _props$onInteractOuts = props . onInteractOutside ) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts . call ( props , event ) ;
2024-09-19 21:55:35 -04:00
if ( ! event . defaultPrevented ) {
hasInteractedOutsideRef . current = true ;
if ( event . detail . originalEvent . type === 'pointerdown' ) hasPointerDownOutsideRef . current = true ;
} // Prevent dismissing when clicking the trigger.
2023-06-27 10:24:19 -04:00
// As the trigger is already setup to close, without doing so would
// cause it to close and immediately open.
const target = event . target ;
const targetIsTrigger = ( _context$triggerRef$c3 = context . triggerRef . current ) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3 . contains ( target ) ;
2024-09-19 21:55:35 -04:00
if ( targetIsTrigger ) event . preventDefault ( ) ; // On Safari if the trigger is inside a container with tabIndex={0}, when clicked
// we will get the pointer down outside event on the trigger, but then a subsequent
// focus outside event on the container, we ignore any focus outside event when we've
// already had a pointer down outside event.
if ( event . detail . originalEvent . type === 'focusin' && hasPointerDownOutsideRef . current ) event . preventDefault ( ) ;
2023-06-27 10:24:19 -04:00
}
} ) ) ;
} ) ;
/* -----------------------------------------------------------------------------------------------*/ const $5d3850c4d0b4e6c7$var$DialogContentImpl = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const { _ _scopeDialog : _ _scopeDialog , trapFocus : trapFocus , onOpenAutoFocus : onOpenAutoFocus , onCloseAutoFocus : onCloseAutoFocus , ... contentProps } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$CONTENT _NAME , _ _scopeDialog ) ;
const contentRef = ( 0 , external _React _namespaceObject . useRef ) ( null ) ;
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05 ( forwardedRef , contentRef ) ; // Make sure the whole tree has focus guards as our `Dialog` will be
// the last element in the DOM (beacuse of the `Portal`)
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c ( ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( external _React _namespaceObject . Fragment , null , /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $d3863c46a17e8a28$export$20e40289641fbbb6 , {
asChild : true ,
loop : true ,
trapped : trapFocus ,
onMountAutoFocus : onOpenAutoFocus ,
onUnmountAutoFocus : onCloseAutoFocus
} , /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $5cb92bef7577960e$export$177fb62ff3ec1f22 , _extends ( {
role : "dialog" ,
id : context . contentId ,
"aria-describedby" : context . descriptionId ,
"aria-labelledby" : context . titleId ,
"data-state" : $5d3850c4d0b4e6c7$var$getState ( context . open )
} , contentProps , {
ref : composedRefs ,
onDismiss : ( ) => context . onOpenChange ( false )
} ) ) ) , false ) ;
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DialogTitle
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 d 3 8 5 0 c 4 d 0 b 4 e 6 c 7 $ v a r $ T I T L E _ N A M E = ' D i a l o g T i t l e ' ;
const $5d3850c4d0b4e6c7$export$16f7638e4a34b909 = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const { _ _scopeDialog : _ _scopeDialog , ... titleProps } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$TITLE _NAME , _ _scopeDialog ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . h2 , _extends ( {
id : context . titleId
} , titleProps , {
ref : forwardedRef
} ) ) ;
} ) ;
/*#__PURE__*/ Object . assign ( $5d3850c4d0b4e6c7$export$16f7638e4a34b909 , {
displayName : $5d3850c4d0b4e6c7$var$TITLE _NAME
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DialogDescription
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 d 3 8 5 0 c 4 d 0 b 4 e 6 c 7 $ v a r $ D E S C R I P T I O N _ N A M E = ' D i a l o g D e s c r i p t i o n ' ;
const $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const { _ _scopeDialog : _ _scopeDialog , ... descriptionProps } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$DESCRIPTION _NAME , _ _scopeDialog ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . p , _extends ( {
id : context . descriptionId
} , descriptionProps , {
ref : forwardedRef
} ) ) ;
} ) ;
/*#__PURE__*/ Object . assign ( $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 , {
displayName : $5d3850c4d0b4e6c7$var$DESCRIPTION _NAME
} ) ;
/ * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* DialogClose
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - * / c o n s t $ 5 d 3 8 5 0 c 4 d 0 b 4 e 6 c 7 $ v a r $ C L O S E _ N A M E = ' D i a l o g C l o s e ' ;
const $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac = /*#__PURE__*/ ( 0 , external _React _namespaceObject . forwardRef ) ( ( props , forwardedRef ) => {
const { _ _scopeDialog : _ _scopeDialog , ... closeProps } = props ;
const context = $5d3850c4d0b4e6c7$var$useDialogContext ( $5d3850c4d0b4e6c7$var$CLOSE _NAME , _ _scopeDialog ) ;
return /*#__PURE__*/ ( 0 , external _React _namespaceObject . createElement ) ( $8927f6f2acc4f386$export$250ffa63cdc0d034 . button , _extends ( {
type : "button"
} , closeProps , {
ref : forwardedRef ,
onClick : $e42e1063c40fb3ef$export$b9ecd428b558ff10 ( props . onClick , ( ) => context . onOpenChange ( false )
)
} ) ) ;
} ) ;
/*#__PURE__*/ Object . assign ( $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac , {
displayName : $5d3850c4d0b4e6c7$var$CLOSE _NAME
} ) ;
/* -----------------------------------------------------------------------------------------------*/ function $5d3850c4d0b4e6c7$var$getState ( open ) {
return open ? 'open' : 'closed' ;
}
const $5d3850c4d0b4e6c7$var$TITLE _WARNING _NAME = 'DialogTitleWarning' ;
const [ $5d3850c4d0b4e6c7$export$69b62a49393917d6 , $5d3850c4d0b4e6c7$var$useWarningContext ] = $c512c27ab02ef895$export$fd42f52fd3ae1109 ( $5d3850c4d0b4e6c7$var$TITLE _WARNING _NAME , {
contentName : $5d3850c4d0b4e6c7$var$CONTENT _NAME ,
titleName : $5d3850c4d0b4e6c7$var$TITLE _NAME ,
docsSlug : 'dialog'
} ) ;
const $5d3850c4d0b4e6c7$var$TitleWarning = ( { titleId : titleId } ) => {
const titleWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext ( $5d3850c4d0b4e6c7$var$TITLE _WARNING _NAME ) ;
const MESSAGE = ` \` ${ titleWarningContext . contentName } \` requires a \` ${ titleWarningContext . titleName } \` for the component to be accessible for screen reader users.
If you want to hide the \ ` ${ titleWarningContext . titleName } \` , you can wrap it with our VisuallyHidden component.
For more information , see https : //radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
$67UHm$useEffect ( ( ) => {
if ( titleId ) {
const hasTitle = document . getElementById ( titleId ) ;
if ( ! hasTitle ) throw new Error ( MESSAGE ) ;
}
} , [
MESSAGE ,
titleId
] ) ;
return null ;
} ;
const $5d3850c4d0b4e6c7$var$DESCRIPTION _WARNING _NAME = 'DialogDescriptionWarning' ;
const $5d3850c4d0b4e6c7$var$DescriptionWarning = ( { contentRef : contentRef , descriptionId : descriptionId } ) => {
const descriptionWarningContext = $5d3850c4d0b4e6c7$var$useWarningContext ( $5d3850c4d0b4e6c7$var$DESCRIPTION _WARNING _NAME ) ;
const MESSAGE = ` Warning: Missing \` Description \` or \` aria-describedby={undefined} \` for { ${ descriptionWarningContext . contentName } }. ` ;
$67UHm$useEffect ( ( ) => {
var _contentRef$current ;
const describedById = ( _contentRef$current = contentRef . current ) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current . getAttribute ( 'aria-describedby' ) ; // if we have an id and the user hasn't set aria-describedby={undefined}
if ( descriptionId && describedById ) {
const hasDescription = document . getElementById ( descriptionId ) ;
if ( ! hasDescription ) console . warn ( MESSAGE ) ;
}
} , [
MESSAGE ,
contentRef ,
descriptionId
] ) ;
return null ;
} ;
const $5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9 = $5d3850c4d0b4e6c7$export$3ddf2d174ce01153 ;
const $5d3850c4d0b4e6c7$export$41fb9f06171c75f4 = ( /* unused pure expression or super */ null && ( $5d3850c4d0b4e6c7$export$2e1e1122cf0cba88 ) ) ;
const $5d3850c4d0b4e6c7$export$602eac185826482c = $5d3850c4d0b4e6c7$export$dad7c95542bacce0 ;
const $5d3850c4d0b4e6c7$export$c6fdb837b070b4ff = $5d3850c4d0b4e6c7$export$bd1d06c79be19e17 ;
const $5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2 = $5d3850c4d0b4e6c7$export$b6d9565de1e068cf ;
const $5d3850c4d0b4e6c7$export$f99233281efd08a0 = ( /* unused pure expression or super */ null && ( $5d3850c4d0b4e6c7$export$16f7638e4a34b909 ) ) ;
const $5d3850c4d0b4e6c7$export$393edc798c47379d = ( /* unused pure expression or super */ null && ( $5d3850c4d0b4e6c7$export$94e94c2ec2c954d5 ) ) ;
const $5d3850c4d0b4e6c7$export$f39c2d165cd861fe = ( /* unused pure expression or super */ null && ( $5d3850c4d0b4e6c7$export$fba2fb7cd781b7ac ) ) ;
; // CONCATENATED MODULE: ./node_modules/cmdk/dist/index.mjs
2024-09-19 21:55:35 -04:00
var V = '[cmdk-group=""]' , dist _X = '[cmdk-group-items=""]' , ge = '[cmdk-group-heading=""]' , dist _Y = '[cmdk-item=""]' , le = ` ${ dist _Y } :not([aria-disabled="true"]) ` , Q = "cmdk-item-select" , M = "data-value" , Re = ( r , o , n ) => W ( r , o , n ) , ue = external _React _namespaceObject . createContext ( void 0 ) , dist _G = ( ) => external _React _namespaceObject . useContext ( ue ) , de = external _React _namespaceObject . createContext ( void 0 ) , Z = ( ) => external _React _namespaceObject . useContext ( de ) , fe = external _React _namespaceObject . createContext ( void 0 ) , me = external _React _namespaceObject . forwardRef ( ( r , o ) => { let n = dist _k ( ( ) => { var e , s ; return { search : "" , value : ( s = ( e = r . value ) != null ? e : r . defaultValue ) != null ? s : "" , filtered : { count : 0 , items : new Map , groups : new Set } } } ) , u = dist _k ( ( ) => new Set ) , c = dist _k ( ( ) => new Map ) , d = dist _k ( ( ) => new Map ) , f = dist _k ( ( ) => new Set ) , p = pe ( r ) , { label : v , children : b , value : l , onValueChange : y , filter : S , shouldFilter : C , loop : L , disablePointerSelection : ee = ! 1 , vimBindings : j = ! 0 , ... H } = r , te = external _React _namespaceObject . useId ( ) , $ = external _React _namespaceObject . useId ( ) , K = external _React _namespaceObject . useId ( ) , x = external _React _namespaceObject . useRef ( null ) , g = Me ( ) ; T ( ( ) => { if ( l !== void 0 ) { let e = l . trim ( ) ; n . current . value = e , h . emit ( ) } } , [ l ] ) , T ( ( ) => { g ( 6 , re ) } , [ ] ) ; let h = external _React _namespaceObject . useMemo ( ( ) => ( { subscribe : e => ( f . current . add ( e ) , ( ) => f . current . delete ( e ) ) , snapshot : ( ) => n . current , setState : ( e , s , i ) => { var a , m , R ; if ( ! Object . is ( n . current [ e ] , s ) ) { if ( n . current [ e ] = s , e === "search" ) z ( ) , q ( ) , g ( 1 , U ) ; else if ( e === "value" && ( i || g ( 5 , re ) , ( ( a = p . current ) == null ? void 0 : a . value ) !== void 0 ) ) { let E = s != null ? s : "" ; ( R = ( m = p . current ) . onValueChange ) == null || R . call ( m , E ) ; return } h . emit ( ) } } , emit : ( ) => { f . current . forEach ( e => e ( ) ) } } ) , [ ] ) , B = external _React _namespaceObject . useMemo ( ( ) => ( { value : ( e , s , i ) => { var a ; s !== ( ( a = d . current . get ( e ) ) == null ? void 0 : a . value ) && ( d . current . set ( e , { value : s , keywords : i } ) , n . current . filtered . items . set ( e , ne ( s , i ) ) , g ( 2 , ( ) => { q ( ) , h . emit ( ) } ) ) } , item : ( e , s ) => ( u . current . add ( e ) , s && ( c . current . has ( s ) ? c . current . get ( s ) . add ( e ) : c . current . set ( s , new Set ( [ e ] ) ) ) , g ( 3 , ( ) => { z ( ) , q ( ) , n . current . value || U ( ) , h . emit ( ) } ) , ( ) => { d . current . delete ( e ) , u . current . delete ( e ) , n . current . filtered . items . delete ( e ) ; let i = O ( ) ; g ( 4 , ( ) => { z ( ) , ( i == null ? void 0 : i . getAttribute ( "id" ) ) === e && U ( ) , h . emit ( ) } ) } ) , group : e => ( c . current . has ( e ) || c . current . set ( e , new Set ) , ( ) => { d . current . delete ( e ) , c . current . delete ( e ) } ) , filter : ( ) => p . current . shouldFilter , label : v || r [ "aria-label" ] , disablePointerSelection : ee , listId : te , inputId : K , labelId : $ , listInnerRef : x } ) , [ ] ) ; function ne ( e , s ) { var a , m ; let i = ( m = ( a = p . current ) == null ? void 0 : a . filter ) != null ? m : Re ; return e ? i ( e , n . current . search , s ) : 0 } function q ( ) { if ( ! n . current . search || p . current . shouldFilter === ! 1 ) return ; let e = n . current . filtered . items , s = [ ] ; n . current . filtered . groups . forEach ( a => { let m = c . current . get ( a ) , R = 0 ; m . forEach ( E => { let P = e . get ( E ) ; R = Math . max ( P , R ) } ) , s . push ( [ a , R ] ) } ) ; let i = x . current ; A ( ) . sort ( ( a , m ) => { var P , _ ; let R = a . getAttribute ( "id" ) , E = m . getAttribute ( "id" ) ; return ( ( P = e . get ( E ) ) != null ? P : 0 ) - ( ( _ = e . get ( R ) ) != null ? _ : 0 ) } ) . forEach ( a => { let m = a . closest ( dist _X ) ; m ? m . appendChild ( a . parentElement === m ? a : a . closest ( ` ${ dist _X } > * ` ) ) : i . appendChild ( a . parentElement === i ? a : a . closest ( ` ${ dist _X } > * ` ) ) } ) , s . sort ( ( a , m ) => m [ 1 ] - a [ 1 ] ) . forEach ( a => { let m = x . current . querySelector ( ` ${ V } [ ${ M } =" ${ encodeURIComponent ( a [ 0 ] ) } "] ` ) ; m == null || m . parentElement . appendChild ( m ) } ) } function U ( ) { let e = A ( ) . find ( i => i . getAttribute ( "aria-disabled" ) !== "true" ) , s = e == null ? void 0 : e . getAttribute ( M ) ; h . setState ( "value" , s || void 0 ) } function z ( ) { var s , i , a , m ; if ( ! n . current . search || p . current . shouldFilter === ! 1 ) { n . current . filtered . count = u . current . size ; return } n . current . filtered . groups = new Set ; let e = 0 ; for ( let R of u . current ) { let E = ( i = ( s = d . current . get ( R ) ) == null ? void 0 : s . value ) != null ? i : "" , P = ( m = ( a = d . current . get ( R ) ) == null ? void 0 : a . keywords ) != null ? m : [ ] , _ = ne ( E , P ) ; n . current . filtered . items . set ( R , _ ) , _ > 0 && e ++ } for ( let [ R , E ] of c . current ) for ( let P of E ) if ( n . current . filtered . items . get ( P ) > 0 ) { n . current . filtered . groups . add ( R ) ; break } n . current . filtered . count = e } function re ( ) { var s , i , a ; let e = O ( ) ; e && ( ( ( s = e . parentElement ) == null ? void 0 : s . firstChild ) === e && ( ( a = ( i = e . closest ( V ) ) == null ? void 0 : i . querySelector ( ge ) ) == null || a . scrollIntoView ( { block : "nearest" } ) ) , e . scrollIntoView ( { block : " ne
2023-06-27 10:24:19 -04:00
2024-05-23 15:39:28 -04:00
; // CONCATENATED MODULE: ./node_modules/clsx/dist/clsx.mjs
function r ( e ) { var t , f , n = "" ; if ( "string" == typeof e || "number" == typeof e ) n += e ; else if ( "object" == typeof e ) if ( Array . isArray ( e ) ) { var o = e . length ; for ( t = 0 ; t < o ; t ++ ) e [ t ] && ( f = r ( e [ t ] ) ) && ( n && ( n += " " ) , n += f ) } else for ( f in e ) e [ f ] && ( n && ( n += " " ) , n += f ) ; return n } function clsx ( ) { for ( var e , t , f = 0 , n = "" , o = arguments . length ; f < o ; f ++ ) ( e = arguments [ f ] ) && ( t = r ( e ) ) && ( n && ( n += " " ) , n += t ) ; return n } /* harmony default export */ const dist _clsx = ( clsx ) ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: external ["wp","data"]
2024-01-31 07:59:56 -05:00
const external _wp _data _namespaceObject = window [ "wp" ] [ "data" ] ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
; // CONCATENATED MODULE: external ["wp","element"]
2024-01-31 07:59:56 -05:00
const external _wp _element _namespaceObject = window [ "wp" ] [ "element" ] ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: external ["wp","i18n"]
2024-01-31 07:59:56 -05:00
const external _wp _i18n _namespaceObject = window [ "wp" ] [ "i18n" ] ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: external ["wp","components"]
2024-01-31 07:59:56 -05:00
const external _wp _components _namespaceObject = window [ "wp" ] [ "components" ] ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: external ["wp","keyboardShortcuts"]
2024-01-31 07:59:56 -05:00
const external _wp _keyboardShortcuts _namespaceObject = window [ "wp" ] [ "keyboardShortcuts" ] ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/icon/index.js
/ * *
* WordPress dependencies
* /
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */
/ * *
* Return an SVG icon .
*
2023-09-26 10:23:26 -04:00
* @ param { IconProps } props icon is the SVG component to render
* size is a number specifiying the icon size in pixels
* Other props will be passed to wrapped SVG component
* @ param { import ( 'react' ) . ForwardedRef < HTMLElement > } ref The forwarded ref to the SVG element .
2023-06-27 10:24:19 -04:00
*
* @ return { JSX . Element } Icon component
* /
function Icon ( {
icon ,
size = 24 ,
... props
2023-09-26 10:23:26 -04:00
} , ref ) {
2023-06-27 10:24:19 -04:00
return ( 0 , external _wp _element _namespaceObject . cloneElement ) ( icon , {
width : size ,
height : size ,
2023-09-26 10:23:26 -04:00
... props ,
ref
2023-06-27 10:24:19 -04:00
} ) ;
}
2024-01-31 07:59:56 -05:00
/* harmony default export */ const icon = ( ( 0 , external _wp _element _namespaceObject . forwardRef ) ( Icon ) ) ;
2023-09-26 10:23:26 -04:00
; // CONCATENATED MODULE: external ["wp","primitives"]
2024-01-31 07:59:56 -05:00
const external _wp _primitives _namespaceObject = window [ "wp" ] [ "primitives" ] ;
2024-05-31 14:59:00 -04:00
; // CONCATENATED MODULE: external "ReactJSXRuntime"
const external _ReactJSXRuntime _namespaceObject = window [ "ReactJSXRuntime" ] ;
2023-09-26 10:23:26 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/search.js
/ * *
* WordPress dependencies
* /
2023-06-27 10:24:19 -04:00
2024-05-31 14:59:00 -04:00
const search = /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _primitives _namespaceObject . SVG , {
2023-09-26 10:23:26 -04:00
xmlns : "http://www.w3.org/2000/svg" ,
2024-05-31 14:59:00 -04:00
viewBox : "0 0 24 24" ,
children : /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _primitives _namespaceObject . Path , {
d : "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"
} )
} ) ;
2024-01-31 07:59:56 -05:00
/* harmony default export */ const library _search = ( search ) ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/store/reducer.js
/ * *
* WordPress dependencies
* /
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Reducer returning the registered commands
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
function commands ( state = { } , action ) {
switch ( action . type ) {
case 'REGISTER_COMMAND' :
2023-09-26 10:23:26 -04:00
return {
... state ,
2023-06-27 10:24:19 -04:00
[ action . name ] : {
name : action . name ,
label : action . label ,
searchLabel : action . searchLabel ,
context : action . context ,
callback : action . callback ,
icon : action . icon
}
} ;
case 'UNREGISTER_COMMAND' :
{
const {
[ action . name ] : _ ,
... remainingState
} = state ;
return remainingState ;
}
}
return state ;
}
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Reducer returning the command loaders
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { Object } Updated state .
* /
function commandLoaders ( state = { } , action ) {
switch ( action . type ) {
case 'REGISTER_COMMAND_LOADER' :
2023-09-26 10:23:26 -04:00
return {
... state ,
2023-06-27 10:24:19 -04:00
[ action . name ] : {
name : action . name ,
context : action . context ,
hook : action . hook
}
} ;
case 'UNREGISTER_COMMAND_LOADER' :
{
const {
[ action . name ] : _ ,
... remainingState
} = state ;
return remainingState ;
}
}
return state ;
}
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
2023-07-07 03:21:17 -04:00
* Reducer returning the command palette open state .
2023-06-27 10:24:19 -04:00
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { boolean } Updated state .
* /
function isOpen ( state = false , action ) {
switch ( action . type ) {
case 'OPEN' :
return true ;
case 'CLOSE' :
return false ;
}
return state ;
}
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
2023-07-07 03:21:17 -04:00
* Reducer returning the command palette ' s active context .
2023-06-27 10:24:19 -04:00
*
* @ param { Object } state Current state .
* @ param { Object } action Dispatched action .
*
* @ return { boolean } Updated state .
* /
function context ( state = 'root' , action ) {
switch ( action . type ) {
case 'SET_CONTEXT' :
return action . context ;
}
return state ;
}
const reducer = ( 0 , external _wp _data _namespaceObject . combineReducers ) ( {
commands ,
commandLoaders ,
isOpen ,
context
} ) ;
2024-01-31 07:59:56 -05:00
/* harmony default export */ const store _reducer = ( reducer ) ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/store/actions.js
/** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */
/ * *
* Configuration of a registered keyboard shortcut .
*
* @ typedef { Object } WPCommandConfig
*
* @ property { string } name Command name .
* @ property { string } label Command label .
* @ property { string = } searchLabel Command search label .
* @ property { string = } context Command context .
* @ property { JSX . Element } icon Command icon .
* @ property { Function } callback Command callback .
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* @ property { boolean } disabled Whether to disable the command .
2023-06-27 10:24:19 -04:00
* /
/ * *
* @ typedef { ( search : string ) => WPCommandConfig [ ] } WPCommandLoaderHook hoo
* /
/ * *
* Command loader config .
*
* @ typedef { Object } WPCommandLoaderConfig
*
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
* @ property { string } name Command loader name .
* @ property { string = } context Command loader context .
* @ property { WPCommandLoaderHook } hook Command loader hook .
* @ property { boolean } disabled Whether to disable the command loader .
2023-06-27 10:24:19 -04:00
* /
/ * *
* Returns an action object used to register a new command .
*
* @ param { WPCommandConfig } config Command config .
*
* @ return { Object } action .
* /
function registerCommand ( config ) {
return {
type : 'REGISTER_COMMAND' ,
... config
} ;
}
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Returns an action object used to unregister a command .
*
* @ param { string } name Command name .
*
* @ return { Object } action .
* /
function unregisterCommand ( name ) {
return {
type : 'UNREGISTER_COMMAND' ,
name
} ;
}
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Register command loader .
*
* @ param { WPCommandLoaderConfig } config Command loader config .
*
* @ return { Object } action .
* /
function registerCommandLoader ( config ) {
return {
type : 'REGISTER_COMMAND_LOADER' ,
... config
} ;
}
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Unregister command loader hook .
*
* @ param { string } name Command loader name .
*
* @ return { Object } action .
* /
function unregisterCommandLoader ( name ) {
return {
type : 'UNREGISTER_COMMAND_LOADER' ,
name
} ;
}
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
2023-07-07 03:21:17 -04:00
* Opens the command palette .
2023-06-27 10:24:19 -04:00
*
* @ return { Object } action .
* /
function actions _open ( ) {
return {
type : 'OPEN'
} ;
}
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
2023-07-07 03:21:17 -04:00
* Closes the command palette .
2023-06-27 10:24:19 -04:00
*
* @ return { Object } action .
* /
function actions _close ( ) {
return {
type : 'CLOSE'
} ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/store/selectors.js
/ * *
2024-05-23 15:39:28 -04:00
* WordPress dependencies
2023-06-27 10:24:19 -04:00
* /
2023-09-26 10:23:26 -04:00
/ * *
* Returns the registered static commands .
*
* @ param { Object } state State tree .
* @ param { boolean } contextual Whether to return only contextual commands .
*
* @ return { import ( './actions' ) . WPCommandConfig [ ] } The list of registered commands .
* /
2024-05-23 15:39:28 -04:00
const getCommands = ( 0 , external _wp _data _namespaceObject . createSelector ) ( ( state , contextual = false ) => Object . values ( state . commands ) . filter ( command => {
2023-06-27 10:24:19 -04:00
const isContextual = command . context && command . context === state . context ;
return contextual ? isContextual : ! isContextual ;
} ) , state => [ state . commands , state . context ] ) ;
2023-09-26 10:23:26 -04:00
/ * *
* Returns the registered command loaders .
*
* @ param { Object } state State tree .
* @ param { boolean } contextual Whether to return only contextual command loaders .
*
* @ return { import ( './actions' ) . WPCommandLoaderConfig [ ] } The list of registered command loaders .
* /
2024-05-23 15:39:28 -04:00
const getCommandLoaders = ( 0 , external _wp _data _namespaceObject . createSelector ) ( ( state , contextual = false ) => Object . values ( state . commandLoaders ) . filter ( loader => {
2023-06-27 10:24:19 -04:00
const isContextual = loader . context && loader . context === state . context ;
return contextual ? isContextual : ! isContextual ;
} ) , state => [ state . commandLoaders , state . context ] ) ;
2023-09-26 10:23:26 -04:00
/ * *
* Returns whether the command palette is open .
*
* @ param { Object } state State tree .
*
* @ return { boolean } Returns whether the command palette is open .
* /
2023-06-27 10:24:19 -04:00
function selectors _isOpen ( state ) {
return state . isOpen ;
}
2023-09-26 10:23:26 -04:00
/ * *
* Returns whether the active context .
*
* @ param { Object } state State tree .
*
* @ return { string } Context .
* /
2023-06-27 10:24:19 -04:00
function getContext ( state ) {
return state . context ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/store/private-actions.js
/ * *
* Sets the active context .
*
* @ param { string } context Context .
*
* @ return { Object } action .
* /
function setContext ( context ) {
return {
type : 'SET_CONTEXT' ,
context
} ;
}
; // CONCATENATED MODULE: external ["wp","privateApis"]
2024-01-31 07:59:56 -05:00
const external _wp _privateApis _namespaceObject = window [ "wp" ] [ "privateApis" ] ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/lock-unlock.js
/ * *
* WordPress dependencies
* /
const {
lock ,
unlock
2024-06-18 09:19:30 -04:00
} = ( 0 , external _wp _privateApis _namespaceObject . _ _dangerousOptInToUnstableAPIsOnlyForCoreModules ) ( 'I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.' , '@wordpress/commands' ) ;
2023-06-27 10:24:19 -04:00
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/store/index.js
/ * *
* WordPress dependencies
* /
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Internal dependencies
* /
const STORE _NAME = 'core/commands' ;
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Store definition for the commands namespace .
*
* @ see https : //github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @ type { Object }
2023-09-26 10:23:26 -04:00
*
* @ example
* ` ` ` js
* import { store as commandsStore } from '@wordpress/commands' ;
* import { useDispatch } from '@wordpress/data' ;
* ...
* const { open : openCommandCenter } = useDispatch ( commandsStore ) ;
* ` ` `
2023-06-27 10:24:19 -04:00
* /
const store = ( 0 , external _wp _data _namespaceObject . createReduxStore ) ( STORE _NAME , {
reducer : store _reducer ,
actions : actions _namespaceObject ,
selectors : selectors _namespaceObject
} ) ;
( 0 , external _wp _data _namespaceObject . register ) ( store ) ;
unlock ( store ) . registerPrivateActions ( private _actions _namespaceObject ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/components/command-menu.js
/ * *
* External dependencies
* /
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* WordPress dependencies
* /
/ * *
* Internal dependencies
* /
2024-05-31 14:59:00 -04:00
2024-05-23 15:39:28 -04:00
const inputLabel = ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Search commands and settings' ) ;
2023-06-27 10:24:19 -04:00
function CommandMenuLoader ( {
name ,
search ,
hook ,
setLoader ,
close
} ) {
var _hook ;
const {
isLoading ,
commands = [ ]
} = ( _hook = hook ( {
search
} ) ) !== null && _hook !== void 0 ? _hook : { } ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
setLoader ( name , isLoading ) ;
} , [ setLoader , name , isLoading ] ) ;
if ( ! commands . length ) {
return null ;
}
2024-05-31 14:59:00 -04:00
return /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _ReactJSXRuntime _namespaceObject . Fragment , {
children : commands . map ( command => {
var _command$searchLabel ;
2024-09-19 21:55:35 -04:00
return /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( He . Item , {
2024-05-31 14:59:00 -04:00
value : ( _command$searchLabel = command . searchLabel ) !== null && _command$searchLabel !== void 0 ? _command$searchLabel : command . label ,
onSelect : ( ) => command . callback ( {
close
} ) ,
id : command . name ,
children : /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
alignment : "left" ,
className : dist _clsx ( 'commands-command-menu__item' , {
'has-icon' : command . icon
} ) ,
children : [ command . icon && /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( icon , {
icon : command . icon
} ) , /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "span" , {
children : /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . TextHighlight , {
text : command . label ,
highlight : search
} )
} ) ]
} )
} , command . name ) ;
} )
} ) ;
2023-06-27 10:24:19 -04:00
}
function CommandMenuLoaderWrapper ( {
hook ,
search ,
setLoader ,
close
} ) {
// The "hook" prop is actually a custom React hook
// so to avoid breaking the rules of hooks
// the CommandMenuLoaderWrapper component need to be
// remounted on each hook prop change
// We use the key state to make sure we do that properly.
2024-09-19 21:55:35 -04:00
const currentLoaderRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( hook ) ;
2023-06-27 10:24:19 -04:00
const [ key , setKey ] = ( 0 , external _wp _element _namespaceObject . useState ) ( 0 ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2024-09-19 21:55:35 -04:00
if ( currentLoaderRef . current !== hook ) {
currentLoaderRef . current = hook ;
2023-06-27 10:24:19 -04:00
setKey ( prevKey => prevKey + 1 ) ;
}
} , [ hook ] ) ;
2024-05-31 14:59:00 -04:00
return /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( CommandMenuLoader , {
2024-09-19 21:55:35 -04:00
hook : currentLoaderRef . current ,
2023-06-27 10:24:19 -04:00
search : search ,
setLoader : setLoader ,
close : close
2024-05-31 14:59:00 -04:00
} , key ) ;
2023-06-27 10:24:19 -04:00
}
function CommandMenuGroup ( {
isContextual ,
search ,
setLoader ,
close
} ) {
const {
commands ,
loaders
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => {
const {
getCommands ,
getCommandLoaders
} = select ( store ) ;
return {
commands : getCommands ( isContextual ) ,
loaders : getCommandLoaders ( isContextual )
} ;
} , [ isContextual ] ) ;
if ( ! commands . length && ! loaders . length ) {
return null ;
}
2024-09-19 21:55:35 -04:00
return /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( He . Group , {
2024-05-31 14:59:00 -04:00
children : [ commands . map ( command => {
var _command$searchLabel2 ;
2024-09-19 21:55:35 -04:00
return /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( He . Item , {
2024-05-31 14:59:00 -04:00
value : ( _command$searchLabel2 = command . searchLabel ) !== null && _command$searchLabel2 !== void 0 ? _command$searchLabel2 : command . label ,
onSelect : ( ) => command . callback ( {
close
} ) ,
id : command . name ,
children : /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( external _wp _components _namespaceObject . _ _experimentalHStack , {
alignment : "left" ,
className : dist _clsx ( 'commands-command-menu__item' , {
'has-icon' : command . icon
} ) ,
children : [ command . icon && /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( icon , {
icon : command . icon
} ) , /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "span" , {
children : /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . TextHighlight , {
text : command . label ,
highlight : search
} )
} ) ]
} )
} , command . name ) ;
} ) , loaders . map ( loader => /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( CommandMenuLoaderWrapper , {
hook : loader . hook ,
search : search ,
setLoader : setLoader ,
close : close
} , loader . name ) ) ]
} ) ;
2023-06-27 10:24:19 -04:00
}
2023-09-26 10:23:26 -04:00
function CommandInput ( {
isOpen ,
search ,
setSearch
} ) {
const commandMenuInput = ( 0 , external _wp _element _namespaceObject . useRef ) ( ) ;
2024-09-19 21:55:35 -04:00
const _value = dist _D ( state => state . value ) ;
2023-09-26 10:23:26 -04:00
const selectedItemId = ( 0 , external _wp _element _namespaceObject . useMemo ) ( ( ) => {
const item = document . querySelector ( ` [cmdk-item=""][data-value=" ${ _value } "] ` ) ;
return item ? . getAttribute ( 'id' ) ;
} , [ _value ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
// Focus the command palette input when mounting the modal.
if ( isOpen ) {
commandMenuInput . current . focus ( ) ;
}
} , [ isOpen ] ) ;
2024-09-19 21:55:35 -04:00
return /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( He . Input , {
2023-09-26 10:23:26 -04:00
ref : commandMenuInput ,
value : search ,
onValueChange : setSearch ,
2024-02-09 13:22:22 -05:00
placeholder : inputLabel ,
2023-09-26 10:23:26 -04:00
"aria-activedescendant" : selectedItemId ,
icon : search
} ) ;
}
/ * *
* @ ignore
* /
2023-06-27 10:24:19 -04:00
function CommandMenu ( ) {
const {
registerShortcut
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( external _wp _keyboardShortcuts _namespaceObject . store ) ;
const [ search , setSearch ] = ( 0 , external _wp _element _namespaceObject . useState ) ( '' ) ;
const isOpen = ( 0 , external _wp _data _namespaceObject . useSelect ) ( select => select ( store ) . isOpen ( ) , [ ] ) ;
const {
open ,
close
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
const [ loaders , setLoaders ] = ( 0 , external _wp _element _namespaceObject . useState ) ( { } ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
registerShortcut ( {
name : 'core/commands' ,
category : 'global' ,
2023-09-26 10:23:26 -04:00
description : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Open the command palette.' ) ,
2023-06-27 10:24:19 -04:00
keyCombination : {
modifier : 'primary' ,
character : 'k'
}
} ) ;
} , [ registerShortcut ] ) ;
2023-09-26 10:23:26 -04:00
( 0 , external _wp _keyboardShortcuts _namespaceObject . useShortcut ) ( 'core/commands' , /** @type {import('react').KeyboardEventHandler} */
2023-08-01 04:01:54 -04:00
event => {
// Bails to avoid obscuring the effect of the preceding handler(s).
2024-05-23 15:39:28 -04:00
if ( event . defaultPrevented ) {
return ;
}
2023-06-27 10:24:19 -04:00
event . preventDefault ( ) ;
if ( isOpen ) {
close ( ) ;
} else {
open ( ) ;
}
} , {
bindGlobal : true
} ) ;
2023-09-26 10:23:26 -04:00
const setLoader = ( 0 , external _wp _element _namespaceObject . useCallback ) ( ( name , value ) => setLoaders ( current => ( {
... current ,
2023-06-27 10:24:19 -04:00
[ name ] : value
} ) ) , [ ] ) ;
const closeAndReset = ( ) => {
setSearch ( '' ) ;
close ( ) ;
} ;
if ( ! isOpen ) {
return false ;
}
2023-07-28 03:40:16 -04:00
const onKeyDown = event => {
2023-09-26 10:23:26 -04:00
if (
// Ignore keydowns from IMEs
event . nativeEvent . isComposing ||
// Workaround for Mac Safari where the final Enter/Backspace of an IME composition
2023-07-28 03:40:16 -04:00
// is `isComposing=false`, even though it's technically still part of the composition.
// These can only be detected by keyCode.
event . keyCode === 229 ) {
event . preventDefault ( ) ;
}
} ;
2023-06-27 10:24:19 -04:00
const isLoading = Object . values ( loaders ) . some ( Boolean ) ;
2024-05-31 14:59:00 -04:00
return /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( external _wp _components _namespaceObject . Modal , {
2023-06-27 10:24:19 -04:00
className : "commands-command-menu" ,
overlayClassName : "commands-command-menu__overlay" ,
onRequestClose : closeAndReset ,
2024-02-09 13:22:22 -05:00
_ _experimentalHideHeader : true ,
2024-05-31 14:59:00 -04:00
contentLabel : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Command palette' ) ,
children : /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( "div" , {
className : "commands-command-menu__container" ,
2024-09-19 21:55:35 -04:00
children : /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( He , {
2024-05-31 14:59:00 -04:00
label : inputLabel ,
onKeyDown : onKeyDown ,
children : [ /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( "div" , {
className : "commands-command-menu__header" ,
children : [ /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( CommandInput , {
search : search ,
setSearch : setSearch ,
isOpen : isOpen
} ) , /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( icon , {
icon : library _search
} ) ]
2024-09-19 21:55:35 -04:00
} ) , /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsxs ) ( He . List , {
label : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'Command suggestions' ) ,
children : [ search && ! isLoading && /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( He . Empty , {
2024-05-31 14:59:00 -04:00
children : ( 0 , external _wp _i18n _namespaceObject . _ _ ) ( 'No results found.' )
} ) , /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( CommandMenuGroup , {
search : search ,
setLoader : setLoader ,
close : closeAndReset ,
isContextual : true
} ) , search && /*#__PURE__*/ ( 0 , external _ReactJSXRuntime _namespaceObject . jsx ) ( CommandMenuGroup , {
search : search ,
setLoader : setLoader ,
close : closeAndReset
} ) ]
} ) ]
} )
} )
} ) ;
2023-06-27 10:24:19 -04:00
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/hooks/use-command-context.js
/ * *
* WordPress dependencies
* /
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Internal dependencies
* /
/ * *
2023-07-07 03:21:17 -04:00
* Sets the active context of the command palette
2023-06-27 10:24:19 -04:00
*
* @ param { string } context Context to set .
* /
function useCommandContext ( context ) {
const {
getContext
} = ( 0 , external _wp _data _namespaceObject . useSelect ) ( store ) ;
const initialContext = ( 0 , external _wp _element _namespaceObject . useRef ) ( getContext ( ) ) ;
const {
setContext
} = unlock ( ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
setContext ( context ) ;
2023-09-26 10:23:26 -04:00
} , [ context , setContext ] ) ;
2023-06-27 10:24:19 -04:00
2023-09-26 10:23:26 -04:00
// This effects ensures that on unmount, we restore the context
// that was set before the component actually mounts.
2023-06-27 10:24:19 -04:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
const initialContextRef = initialContext . current ;
return ( ) => setContext ( initialContextRef ) ;
} , [ setContext ] ) ;
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/private-apis.js
/ * *
* Internal dependencies
* /
2023-09-26 10:23:26 -04:00
/ * *
* @ private
* /
2023-06-27 10:24:19 -04:00
const privateApis = { } ;
lock ( privateApis , {
useCommandContext : useCommandContext
} ) ;
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/hooks/use-command.js
/ * *
* WordPress dependencies
* /
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Internal dependencies
* /
/ * *
2023-09-26 10:23:26 -04:00
* Attach a command to the command palette . Used for static commands .
2023-06-27 10:24:19 -04:00
*
* @ param { import ( '../store/actions' ) . WPCommandConfig } command command config .
2023-09-26 10:23:26 -04:00
*
* @ example
* ` ` ` js
* import { useCommand } from '@wordpress/commands' ;
* import { plus } from '@wordpress/icons' ;
*
* useCommand ( {
* name : 'myplugin/my-command-name' ,
* label : _ _ ( 'Add new post' ) ,
* icon : plus ,
* callback : ( { close } ) => {
* document . location . href = 'post-new.php' ;
* close ( ) ;
* } ,
* } ) ;
* ` ` `
2023-06-27 10:24:19 -04:00
* /
function useCommand ( command ) {
const {
registerCommand ,
unregisterCommand
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
2024-09-19 21:55:35 -04:00
const currentCallbackRef = ( 0 , external _wp _element _namespaceObject . useRef ) ( command . callback ) ;
2023-06-27 10:24:19 -04:00
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
2024-09-19 21:55:35 -04:00
currentCallbackRef . current = command . callback ;
2023-06-27 10:24:19 -04:00
} , [ command . callback ] ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
if ( command . disabled ) {
return ;
}
2023-06-27 10:24:19 -04:00
registerCommand ( {
name : command . name ,
context : command . context ,
label : command . label ,
searchLabel : command . searchLabel ,
icon : command . icon ,
2024-09-19 21:55:35 -04:00
callback : ( ... args ) => currentCallbackRef . current ( ... args )
2023-06-27 10:24:19 -04:00
} ) ;
return ( ) => {
unregisterCommand ( command . name ) ;
} ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} , [ command . name , command . label , command . searchLabel , command . icon , command . context , command . disabled , registerCommand , unregisterCommand ] ) ;
2023-06-27 10:24:19 -04:00
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/hooks/use-command-loader.js
/ * *
* WordPress dependencies
* /
2023-09-26 10:23:26 -04:00
2023-06-27 10:24:19 -04:00
/ * *
* Internal dependencies
* /
/ * *
2023-09-26 10:23:26 -04:00
* Attach a command loader to the command palette . Used for dynamic commands .
2023-06-27 10:24:19 -04:00
*
* @ param { import ( '../store/actions' ) . WPCommandLoaderConfig } loader command loader config .
2023-09-26 10:23:26 -04:00
*
* @ example
* ` ` ` js
* import { useCommandLoader } from '@wordpress/commands' ;
* import { post , page , layout , symbolFilled } from '@wordpress/icons' ;
*
* const icons = {
* post ,
* page ,
* wp _template : layout ,
* wp _template _part : symbolFilled ,
* } ;
*
* function usePageSearchCommandLoader ( { search } ) {
* // Retrieve the pages for the "search" term.
* const { records , isLoading } = useSelect ( ( select ) => {
* const { getEntityRecords } = select ( coreStore ) ;
* const query = {
* search : ! ! search ? search : undefined ,
* per _page : 10 ,
* orderby : search ? 'relevance' : 'date' ,
* } ;
* return {
* records : getEntityRecords ( 'postType' , 'page' , query ) ,
* isLoading : ! select ( coreStore ) . hasFinishedResolution (
* 'getEntityRecords' ,
* 'postType' , 'page' , query ]
* ) ,
* } ;
* } , [ search ] ) ;
*
* // Create the commands.
* const commands = useMemo ( ( ) => {
* return ( records ? ? [ ] ) . slice ( 0 , 10 ) . map ( ( record ) => {
* return {
* name : record . title ? . rendered + ' ' + record . id ,
* label : record . title ? . rendered
* ? record . title ? . rendered
* : _ _ ( '(no title)' ) ,
* icon : icons [ postType ] ,
* callback : ( { close } ) => {
* const args = {
* postType ,
* postId : record . id ,
* ... extraArgs ,
* } ;
* document . location = addQueryArgs ( 'site-editor.php' , args ) ;
* close ( ) ;
* } ,
* } ;
* } ) ;
* } , [ records , history ] ) ;
*
* return {
* commands ,
* isLoading ,
* } ;
* }
*
* useCommandLoader ( {
* name : 'myplugin/page-search' ,
* hook : usePageSearchCommandLoader ,
* } ) ;
* ` ` `
2023-06-27 10:24:19 -04:00
* /
function useCommandLoader ( loader ) {
const {
registerCommandLoader ,
unregisterCommandLoader
} = ( 0 , external _wp _data _namespaceObject . useDispatch ) ( store ) ;
( 0 , external _wp _element _namespaceObject . useEffect ) ( ( ) => {
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
if ( loader . disabled ) {
return ;
}
2023-06-27 10:24:19 -04:00
registerCommandLoader ( {
name : loader . name ,
hook : loader . hook ,
context : loader . context
} ) ;
return ( ) => {
unregisterCommandLoader ( loader . name ) ;
} ;
Editor: Update the WordPress packages to the Gutenberg 16.7 RC2 version.
This patch, somewhat small brings a lot to WordPress.
This includes features like:
- DataViews.
- Customization tools like box shadow, background size and repeat.
- UI improvements in the site editor.
- Preferences sharing between the post and site editors.
- Unified panels and editors between post and site editors.
- Improved template mode in the post editor.
- Iterations to multiple interactive blocks.
- Preparing the blocks and UI for pattern overrides.
- and a lot more.
Props luisherranz, gziolo, isabel_brison, costdev, jonsurrell, peterwilsoncc, get_dave, antonvlasenko, desrosj.
See #60315.
Built from https://develop.svn.wordpress.org/trunk@57377
git-svn-id: http://core.svn.wordpress.org/trunk@56883 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-01-29 16:07:12 -05:00
} , [ loader . name , loader . hook , loader . context , loader . disabled , registerCommandLoader , unregisterCommandLoader ] ) ;
2023-06-27 10:24:19 -04:00
}
; // CONCATENATED MODULE: ./node_modules/@wordpress/commands/build-module/index.js
( window . wp = window . wp || { } ) . commands = _ _webpack _exports _ _ ;
/******/ } ) ( )
;