System.register([], function (_export, _context) {
  "use strict";

  return {
    setters: [],
    execute: function () {
      const __SystemJSRewritingHack = {};
      _recorder_._src_babylonian_programming_editor_utils_utils_js = _recorder_._src_babylonian_programming_editor_utils_utils_js || {};
      const maybeUnpackString = value => {
        if (!value) {
          return value;
        }

        if (typeof value === "string") {
          return value;
        } else if (typeof value.value === "string") {
          return value.value;
        }

        return null;
      };

      _export("maybeUnpackString", maybeUnpackString);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "maybeUnpackString", {
        get() {
          return maybeUnpackString;
        },

        set(thisIsVererySecretVariableName) {
          _export("maybeUnpackString", maybeUnpackString = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
      const guid = () => {
        // from https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript
        function s4() {
          return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
        }
        return s4() + '_' + s4() + '_' + s4();
      };

      _export("guid", guid);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "guid", {
        get() {
          return guid;
        },

        set(thisIsVererySecretVariableName) {
          _export("guid", guid = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
      const abstract = () => {
        throw Error("This function is abstract");
      };

      _export("abstract", abstract);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "abstract", {
        get() {
          return abstract;
        },

        set(thisIsVererySecretVariableName) {
          _export("abstract", abstract = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
      const compareKeyLocations = (a, b) => {
        return a[0] - b[0] ? a[0] - b[0] : a[1] - b[1] ? a[1] - b[1] : a[2] - b[2] ? a[2] - b[2] : a[3] - b[3] ? a[3] - b[3] : 0;
      };

      _export("compareKeyLocations", compareKeyLocations);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "compareKeyLocations", {
        get() {
          return compareKeyLocations;
        },

        set(thisIsVererySecretVariableName) {
          _export("compareKeyLocations", compareKeyLocations = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
      const keyLocationsAreEqual = (a, b) => {
        return compareKeyLocations(a, b) === 0;
      };

      _export("keyLocationsAreEqual", keyLocationsAreEqual);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "keyLocationsAreEqual", {
        get() {
          return keyLocationsAreEqual;
        },

        set(thisIsVererySecretVariableName) {
          _export("keyLocationsAreEqual", keyLocationsAreEqual = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
      const stringInsert = (baseString, insertString, index) => {
        return baseString.slice(0, index) + insertString + baseString.slice(index);
      };

      _export("stringInsert", stringInsert);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "stringInsert", {
        get() {
          return stringInsert;
        },

        set(thisIsVererySecretVariableName) {
          _export("stringInsert", stringInsert = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
      const stringRemove = (baseString, startIndex, endIndex) => {
        return baseString.slice(0, startIndex) + baseString.slice(endIndex);
      };

      _export("stringRemove", stringRemove);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "stringRemove", {
        get() {
          return stringRemove;
        },

        set(thisIsVererySecretVariableName) {
          _export("stringRemove", stringRemove = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
      const normalizePath = path => path.split("/").reduce((acc, part) => {
        if (part === "..") {
          acc.pop();
        } else if (part !== ".") {
          acc.push(part);
        }
        return acc;
      }, []).join("/");

      _export("normalizePath", normalizePath);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "normalizePath", {
        get() {
          return normalizePath;
        },

        set(thisIsVererySecretVariableName) {
          _export("normalizePath", normalizePath = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
      const deepCopy = obj => {
        try {
          if (obj instanceof HTMLElement) {
            /*probe:*/return (/*{}*/obj.cloneNode(true)
            );
          } else if (obj && obj.clone) {
            // (A) #TODO this is not a deep copy... 
            return obj.clone // why not....        
            ();
          } else {
            // (C) only this is a deep copy, but besides very simple objects... this will break... 
            // and this will really consume a lot of data if you probe a very big object
            /*probe:*/return (/*{}*/JSON.parse(JSON.stringify(obj))
            );
          }
        } catch (e) {
          // (B) this is not a deep copy either
          console.warn("Could not deeply clone object", obj);
          /*probe:*/return (/*{}*/Object.assign({}, obj)
          );
        }
      };

      _export("deepCopy", deepCopy);

      Object.defineProperty(_recorder_._src_babylonian_programming_editor_utils_utils_js, "deepCopy", {
        get() {
          return deepCopy;
        },

        set(thisIsVererySecretVariableName) {
          _export("deepCopy", deepCopy = thisIsVererySecretVariableName);

          return true;
        },

        enumerable: true,
        configurable: true
      });
    }
  };
});