



export function jsVar(variableName) {
    if (!(window["neoGlobalEnqueueBackendNeoLibraryFull"] || window["neoGlobalEnqueueFrontendNeoLibraryFull"])) { throw new Error("The neoWP JS variables have not been initialized yet. Problem with the enqueue global?"); }
    if (window["neoGlobalEnqueueBackendNeoLibraryFull"]  && window["neoGlobalEnqueueBackendNeoLibraryFull"][variableName]  !== undefined) { return window["neoGlobalEnqueueBackendNeoLibraryFull"][variableName]; }
    if (window["neoGlobalEnqueueFrontendNeoLibraryFull"] && window["neoGlobalEnqueueFrontendNeoLibraryFull"][variableName] !== undefined) { return window["neoGlobalEnqueueFrontendNeoLibraryFull"][variableName]; }
    throw new Error("Missing JS variable: " + variableName + ". Make sure it is registered via enqueue_js_variable_backend(...) or enqueue_js_variable_frontend(...).");
}


export function jsVarExists(variableName) {
    if (!(window["neoGlobalEnqueueBackendNeoLibraryFull"] || window["neoGlobalEnqueueFrontendNeoLibraryFull"])) { throw new Error("The neoWP JS variables have not been initialized yet. Problem with the enqueue global?"); }
    return (window["neoGlobalEnqueueBackendNeoLibraryFull"] || window["neoGlobalEnqueueFrontendNeoLibraryFull"])?.[variableName] !== undefined;
}
