static parse(hash, state) {
    decodeURIComponent(hash).replace(
      /#?([^=&]+)=([^=&]+)/gm,
      function (_m0, key, value) {
        let current = state;
        let i;
        while ((i = key.indexOf('.')) > -1) {
          current[key.substr(0, i)] = current[key.substr(0, i)] || {};
          current = current[key.substr(0, i)];
          key = key.substr(i + 1);
        }
        // Parse the value.
        if (value == 'true' || value == 'false') {
          // Boolean.
          value = value == 'true';
        } else if (!isNaN(value)) {
          // Number.
          value = Number(value);
        }
        current[key] = value;
      },
    );
  }
Load the state from the window hash string.
@param {string} hash The hash string.
@param {Object} state The state.