HEX
Server: nginx
System: Linux pool195-106-36.bur.atomicsites.net 6.12.57+deb12-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.57-1~bpo12+1 (2025-11-17) x86_64
User: (0)
PHP: 8.3.32
Disabled: pcntl_fork
Upload Files
File: //srv/htdocs/wp-content/themes/Divi/core/code-snippets/app/lib/code-snippets-library.js
// Set global variable to detect new library item creation.
window.CodeSnippetItemsLoaded = {};

export const setCodeSnippetItemsLoaded = (context, flag) => {
  window.CodeSnippetItemsLoaded = {
    ...CodeSnippetItemsLoaded,
    [context] : flag,
  };
};

/* eslint-disable import/prefer-default-export */
export const getItemTypeByContext = context => {
  let type;

  switch (context) {
    case 'code_html':
      type = 'et_code_snippet_html_js';
      break;
    case 'code_css_no_selector':
      type = 'et_code_snippet_css_no_selector';
      break;
    default:
      type = 'et_code_snippet_css';
      break;
  }

  return type;
};

export const setCodeSnippetsLibraryToken = (token) => {
  window.globalCloudToken = token;
};