import { r as registerInstance, h, H as Host } from './index-e582ed08.js';

const KlevuUtilSsrProvider = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.html = undefined;
    this.packed = undefined;
    this.identifier = undefined;
  }
  /**
   * packed parameter returned by KlevuSSRFetch function
   *
   * @param packed
   */
  async setPacked(packed) {
    this.packed = JSON.stringify(packed).replace(/"/g, "'");
  }
  /**
   *
   * @returns packed parameter returned by KlevuSSRFetch function for KlevuSSRHydrate function
   */
  async getPacked() {
    return JSON.parse(this.packed || "{}").replace(/'/g, '"');
  }
  render() {
    if (this.html) {
      return (h(Host, null, h("div", { innerHTML: this.html })));
    }
    return (h(Host, null, h("slot", null)));
  }
};

export { KlevuUtilSsrProvider as klevu_util_ssr_provider };

//# sourceMappingURL=klevu-util-ssr-provider.entry.js.map