{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/o1PI5S8YtkA5bP5g4dFz/9zLIz4fn80IR9zpOx18Q/Embed.js", "ssg:https://framerusercontent.com/modules/5qWPsNRgba71DOVzLXPJ/N3dCVI0EW3Gy5OlUTOtl/ScrollIntoView.js"],
  "sourcesContent": ["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { addPropertyControls, ControlType } from \"framer\";\nimport { useIsOnCanvas, emptyStateStyle, containerStyles } from \"https://framer.com/m/framer/default-utils.js\"; /**\n                                                                                                                * @framerIntrinsicWidth 600\n                                                                                                                * @framerIntrinsicHeight 400\n                                                                                                                *\n                                                                                                                * @framerSupportedLayoutWidth fixed\n                                                                                                                * @framerSupportedLayoutHeight fixed\n                                                                                                                *\n                                                                                                                * @framerDisableUnlink\n                                                                                                                */\nexport default function Embed({\n  type,\n  url,\n  html\n}) {\n  if (type === \"url\" && url) {\n    return /*#__PURE__*/_jsx(EmbedURL, {\n      url: url\n    });\n  }\n  if (type === \"html\" && html) {\n    return /*#__PURE__*/_jsx(EmbedHTML, {\n      html: html\n    });\n  }\n  return /*#__PURE__*/_jsx(Instructions, {});\n}\n;\naddPropertyControls(Embed, {\n  type: {\n    type: ControlType.Enum,\n    defaultValue: \"url\",\n    displaySegmentedControl: true,\n    options: [\"url\", \"html\"],\n    optionTitles: [\"URL\", \"HTML\"]\n  },\n  url: {\n    title: \"URL\",\n    type: ControlType.String,\n    description: \"Some websites don\u2019t support embedding.\",\n    hidden(props) {\n      return props.type !== \"url\";\n    }\n  },\n  html: {\n    title: \"HTML\",\n    displayTextArea: true,\n    type: ControlType.String,\n    hidden(props) {\n      return props.type !== \"html\";\n    }\n  }\n});\nfunction Instructions() {\n  return /*#__PURE__*/_jsx(\"div\", {\n    style: {\n      ...emptyStateStyle,\n      overflow: \"hidden\"\n    },\n    children: /*#__PURE__*/_jsx(\"div\", {\n      style: centerTextStyle,\n      children: \"To embed a website or widget, add it to the properties\\xa0panel.\"\n    })\n  });\n}\nfunction EmbedURL({\n  url\n}) {\n  // Add https:// if the URL does not have a protocol.\n  if (!/[a-z]+:\\/\\//.test(url)) {\n    url = \"https://\" + url;\n  }\n  const onCanvas = useIsOnCanvas(); // We need to check if the url is blocked inside an iframe by the X-Frame-Options\n  // or Content-Security-Policy headers on the backend.\n  const [state, setState] = useState(onCanvas ? undefined : false);\n  useEffect(() => {\n    // We only want to check on the canvas.\n    // On the website we want to avoid the additional delay.\n    if (!onCanvas) return; // TODO: We could also use AbortController here.\n    let isLastEffect = true;\n    setState(undefined);\n    async function load() {\n      const response = await fetch(\"https://api.framer.com/functions/check-iframe-url?url=\" + encodeURIComponent(url));\n      if (response.status == 200) {\n        const {\n          isBlocked\n        } = await response.json();\n        if (isLastEffect) {\n          setState(isBlocked);\n        }\n      } else {\n        const message = await response.text();\n        console.error(message);\n        const error = new Error(\"This site can\u2019t be reached.\");\n        setState(error);\n      }\n    }\n    load().catch(error => {\n      console.error(error);\n      setState(error);\n    });\n    return () => {\n      isLastEffect = false;\n    };\n  }, [url]);\n  if (!url.startsWith(\"https://\")) {\n    return /*#__PURE__*/_jsx(ErrorMessage, {\n      message: \"Unsupported protocol.\"\n    });\n  }\n  if (state === undefined) {\n    return /*#__PURE__*/_jsx(LoadingIndicator, {});\n  }\n  if (state instanceof Error) {\n    return /*#__PURE__*/_jsx(ErrorMessage, {\n      message: state.message\n    });\n  }\n  if (state === true) {\n    const message = `Can't embed ${url} due to its content security policy.`;\n    return /*#__PURE__*/_jsx(ErrorMessage, {\n      message: message\n    });\n  }\n  return /*#__PURE__*/_jsx(\"iframe\", {\n    src: url,\n    style: iframeStyle,\n    loading: \"lazy\",\n    // @ts-ignore\n    fetchPriority: onCanvas ? \"low\" : \"auto\",\n    referrerPolicy: \"no-referrer\",\n    sandbox: getSandbox(onCanvas)\n  });\n}\nconst iframeStyle = {\n  width: \"100%\",\n  height: \"100%\",\n  border: \"none\"\n};\nfunction getSandbox(onCanvas) {\n  const result = [\"allow-same-origin\", \"allow-scripts\"];\n  if (!onCanvas) {\n    result.push(\"allow-downloads\", \"allow-forms\", \"allow-modals\", \"allow-orientation-lock\", \"allow-pointer-lock\", \"allow-popups\", \"allow-popups-to-escape-sandbox\", \"allow-presentation\", \"allow-storage-access-by-user-activation\", \"allow-top-navigation-by-user-activation\");\n  }\n  return result.join(\" \");\n}\nfunction EmbedHTML({\n  html\n}) {\n  const ref = useRef(); // If the HTML contains a script tag we can't use\n  // dangerouslySetInnerHTML because it doesn't execute\n  // scripts on the client. Otherwise, we can benefit\n  // from SSG by using dangerouslySetInnerHTML.\n  const hasScript = html.includes(\"</script>\");\n  useEffect(() => {\n    if (!hasScript) return;\n    const div = ref.current;\n    div.innerHTML = html;\n    executeScripts(div);\n    return () => {\n      div.innerHTML = \"\";\n    };\n  }, [html, hasScript]);\n  return /*#__PURE__*/_jsx(\"div\", {\n    ref: ref,\n    style: htmlStyle,\n    dangerouslySetInnerHTML: !hasScript ? {\n      __html: html\n    } : undefined\n  });\n}\nconst htmlStyle = {\n  width: \"100%\",\n  height: \"100%\",\n  display: \"flex\",\n  flexDirection: \"column\",\n  justifyContent: \"center\",\n  alignItems: \"center\"\n}; // This function replaces scripts with executable ones.\n// https://stackoverflow.com/questions/1197575/can-scripts-be-inserted-with-innerhtml\nfunction executeScripts(node) {\n  if (node instanceof Element && node.tagName === \"SCRIPT\") {\n    const script = document.createElement(\"script\");\n    script.text = node.innerHTML;\n    for (const {\n      name,\n      value\n    } of node.attributes) {\n      script.setAttribute(name, value);\n    }\n    node.parentElement.replaceChild(script, node);\n  } else {\n    for (const child of node.childNodes) {\n      executeScripts(child);\n    }\n  }\n} // Generic components\nfunction LoadingIndicator() {\n  return /*#__PURE__*/_jsx(\"div\", {\n    className: \"framerInternalUI-componentPlaceholder\",\n    style: {\n      ...containerStyles,\n      overflow: \"hidden\"\n    },\n    children: /*#__PURE__*/_jsx(\"div\", {\n      style: centerTextStyle,\n      children: \"Loading\u2026\"\n    })\n  });\n}\nfunction ErrorMessage({\n  message\n}) {\n  return /*#__PURE__*/_jsx(\"div\", {\n    className: \"framerInternalUI-errorPlaceholder\",\n    style: {\n      ...containerStyles,\n      overflow: \"hidden\"\n    },\n    children: /*#__PURE__*/_jsxs(\"div\", {\n      style: centerTextStyle,\n      children: [\"Error: \", message]\n    })\n  });\n}\nconst centerTextStyle = {\n  textAlign: \"center\",\n  minWidth: 140\n};\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"default\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Embed\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerSupportedLayoutHeight\": \"fixed\",\n        \"framerSupportedLayoutWidth\": \"fixed\",\n        \"framerDisableUnlink\": \"\",\n        \"framerIntrinsicWidth\": \"600\",\n        \"framerIntrinsicHeight\": \"400\",\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Embed.map", "function _defineProperty(obj, key, value) {\n  if (key in obj) {\n    Object.defineProperty(obj, key, {\n      value: value,\n      enumerable: true,\n      configurable: true,\n      writable: true\n    });\n  } else {\n    obj[key] = value;\n  }\n  return obj;\n}\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nimport { ControlType } from \"framer\";\nvar _Component;\nexport class ScrollIntoViewTracker extends (_Component = React.Component) {\n  componentDidMount() {\n    this.observer = new IntersectionObserver(entries => {\n      entries.forEach(entry => {\n        if (entry.isIntersecting) {\n          this.trackEvent();\n        }\n      });\n    });\n    if (this.ref.current) {\n      this.observer.observe(this.ref.current);\n    }\n  }\n  componentWillUnmount() {\n    if (this.observer && this.ref.current) {\n      this.observer.disconnect();\n    }\n  }\n  trackEvent() {\n    const headers = {\n      \"Content-Type\": \"application/json\",\n      Authorization: \"Bearer /xC2oS60RgZlQjiV/3g56th+gm1aVyHY371ctDoB038=\"\n    };\n    const userId = this.getOrCreateUserId();\n    let eventName = \"Section Viewed\";\n    if (this.props.section) {\n      eventName = `${eventName} - ${this.props.section}`;\n    }\n    fetch(\"https://api.usertrail.io/v1/events\", {\n      method: \"POST\",\n      headers: headers,\n      body: JSON.stringify({\n        user_id: userId,\n        event_name: eventName\n      })\n    }).catch(error => console.error(\"Error tracking event:\", error));\n  }\n  getOrCreateUserId() {\n    let userId = localStorage.getItem(\"userId\");\n    if (!userId) {\n      userId = `user-${Math.floor(Math.random() * 1e6)}`;\n      localStorage.setItem(\"userId\", userId);\n    }\n    return userId;\n  }\n  render() {\n    // This component acts as a placeholder that can be placed in the section you want to track\n    return /*#__PURE__*/_jsx(\"div\", {\n      ref: this.ref,\n      style: {\n        opacity: 0,\n        height: 1\n      }\n    });\n  }\n  constructor(...args) {\n    super(...args);\n    _defineProperty(this, \"observer\", null);\n    _defineProperty(this, \"ref\", /*#__PURE__*/React.createRef());\n  }\n}\n_defineProperty(ScrollIntoViewTracker, \"propertyControls\", {\n  section: {\n    type: ControlType.String,\n    title: \"Section\"\n  }\n});\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"ScrollIntoViewTracker\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"ScrollIntoViewTracker\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerContractVersion\": \"1\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./ScrollIntoView.map"],
  "mappings": "0LAYe,SAARA,EAAuB,CAC5B,KAAAC,EACA,IAAAC,EACA,KAAAC,CACF,EAAG,CACD,OAAIF,IAAS,OAASC,EACAE,EAAKC,EAAU,CACjC,IAAKH,CACP,CAAC,EAECD,IAAS,QAAUE,EACDC,EAAKE,EAAW,CAClC,KAAMH,CACR,CAAC,EAEiBC,EAAKG,EAAc,CAAC,CAAC,CAC3C,CAEAC,EAAoBR,EAAO,CACzB,KAAM,CACJ,KAAMS,EAAY,KAClB,aAAc,MACd,wBA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,sBAAuB,CACjB,KAAK,UAAY,KAAK,IAAI,SAC5B,KAAK,SAAS,WAAW,CAE7B,CACA,YAAa,CACX,IAAMC,EAAU,CACd,eAAgB,mBAChB,cAAe,qDACjB,EACMC,EAAS,KAAK,kBAAkB,EAClCC,EAAY,iBACZ,KAAK,MAAM,UACbA,EAAY,GAAGA,OAAe,KAAK,MAAM,WAE3C,MAAM,qCAAsC,CAC1C,OAAQ,OACR,QAASF,EACT,KAAM,KAAK,UAAU,CACnB,QAASC,EACT,WAAYC,CACd,CAAC,CACH,CAAC,EAAE,MAAMC,GAAS,QAAQ,MAAM,wBAAyBA,CAAK,CAAC,CACjE,CACA,mBAAoB,CAClB,IAAIF,EAAS,aAAa,QAAQ,QAAQ,EAC1C,OAAKA,IACHA,EAAS,QAAQ,KAAK,MAAM,KAAK,OAAO,EAAI,GAAG,IAC/C,aAAa,QAAQ,SAAUA,CAAM,GAEhCA,CACT,CACA,QAAS,CAEP,OAAoBG,EAAK,MAAO,CAC9B,IAAK,KAAK,IACV,MAAO,CACL,QAAS,EACT,OAAQ,CACV,CACF,CAAC,CACH,CACA,eAAeC,EAAM,CACnB,MAAM,GAAGA,CAAI,EACbd,EAAgB,KAAM,WAAY,IAAI,EACtCA,EAAgB,KAAM,MAA0Be,EAAU,CAAC,CAC7D,CACF,EACAf,EAAgBK,EAAuB,mBAAoB,CACzD,QAAS,CACP,KAAMW,EAAY,OAClB,MAAO,SACT,CACF,CAAC",
  "names": ["Embed", "type", "url", "html", "p", "EmbedURL", "EmbedHTML", "Instructions", "addPropertyControls", "ControlType", "props", "emptyStateStyle", "centerTextStyle", "onCanvas", "useIsOnCanvas", "state", "setState", "ye", "ue", "isLastEffect", "load", "response", "isBlocked", "message", "error", "ErrorMessage", "LoadingIndicator", "iframeStyle", "getSandbox", "result", "ref", "pe", "hasScript", "div", "executeScripts", "htmlStyle", "node", "script", "name", "value", "child", "containerStyles", "u", "_defineProperty", "obj", "key", "value", "_Component", "ScrollIntoViewTracker", "I", "entries", "entry", "headers", "userId", "eventName", "error", "p", "args", "W", "ControlType"]
}
