/**
 * initializes the globalThis.ibgib.scope = value ?? {}
 *
 * does NOT throw if globalThis.ibgib already exists.
 *
 * @throws if ibgib.scope already exists
 */
export function initGlobalThisIbGib({ scope, value, }) {
    if (!globalThis.ibgib) {
        console.log('initializing globalThis.ibgib (I: e355f8be5fa7488daebcce443f3c0bd6)');
        globalThis.ibgib = {};
    }
    else {
        console.warn(`globalThis.ibgib already initialized (E: 549bd138f7b04595a420e09f841fcbc8)`);
    }
    if (!globalThis.ibgib[scope]) {
        globalThis.ibgib[scope] = value ?? {};
    }
    else {
        console.error(`globalThis.ibgib[${scope}] already initialized (E: 1e710dd83fd4420fb06c5aafd381e849)`);
    }
}
/**
 * Retrieves the global application object.
 *
 * @returns The global application object.
 */
export function getGlobalThisIbGib() {
    return globalThis.ibgib;
}
export function getLinkGibState() {
    const globalStateIbGib = getGlobalThisIbGib();
    if (!globalStateIbGib.linkGib) {
        throw new Error(`(UNEXPECTED) !globalStateIbGib.linkGib? (E: 9098972e34c9447e86c702d3637c639c)`);
    }
    return globalStateIbGib.linkGib;
}
export function getRandomInRange({ min, max }) {
    return min + (Math.random() * (max - min));
}
