{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/NEd4VmDdsxM3StIUbddO/4b2t9Fx4KOsM4G7k9Rv5/Youtube.js"],
  "sourcesContent": ["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { ControlType, addPropertyControls, RenderTarget } from \"framer\";\nimport { defaultEvents } from \"https://framer.com/m/framer/default-utils.js@^0.45.0\";\nvar YoutubeSettings;\n(function (YoutubeSettings) {\n  YoutubeSettings[\"playNormal\"] = \"Off\";\n  YoutubeSettings[\"playAuto\"] = \"On\";\n  YoutubeSettings[\"playLoop\"] = \"Loop\";\n  YoutubeSettings[\"controlsPlayback\"] = \"Playback\";\n  YoutubeSettings[\"controlsInfo\"] = \"Video Info\";\n  YoutubeSettings[\"controlsNone\"] = \"None\";\n})(YoutubeSettings || (YoutubeSettings = {})); /**\n                                               * YOUTUBE\n                                               *\n                                               * @framerIntrinsicWidth 375\n                                               * @framerIntrinsicHeight 210\n                                               *\n                                               * @framerSupportedLayoutWidth fixed\n                                               * @framerSupportedLayoutHeight fixed\n                                               */\nexport function Youtube(props) {\n  const {\n    url,\n    play,\n    shouldMute,\n    controls = false,\n    onClick,\n    onMouseEnter,\n    onMouseLeave,\n    onMouseDown,\n    onMouseUp,\n    canvasPlay\n  } = props;\n  const guessIdentifier = urlMaybe => {\n    if (!urlMaybe) return null;\n    let identifier = \"\"; // https://www.youtube.com/watch?v=cAs3senSITIve\n    const watchPrefix = \"youtube.com/watch?v=\";\n    const watchIndex = urlMaybe.indexOf(watchPrefix);\n    if (watchIndex >= 0) {\n      identifier = urlMaybe.substring(watchIndex + watchPrefix.length);\n    } else {\n      // https://www.youtube.com/embed/cAs3senSITIve\n      const embedPrefix = \"youtube.com/embed/\";\n      const embedIndex = urlMaybe.indexOf(embedPrefix);\n      if (embedIndex >= 0) {\n        identifier = urlMaybe.substring(embedIndex + embedPrefix.length);\n      } else {\n        // https://youtu.be/cAs3senSITIve\n        const shortenedPrefix = \"youtu.be/\";\n        const shortenedIndex = urlMaybe.indexOf(shortenedPrefix);\n        if (shortenedIndex >= 0) {\n          identifier = urlMaybe.substring(shortenedIndex + shortenedPrefix.length);\n        } else {\n          // Everything else\n          identifier = urlMaybe;\n        }\n      }\n    } // Strip off the query string, if any\n    const queryIndex = identifier.indexOf(\"?\");\n    if (queryIndex >= 0) {\n      identifier = identifier.substring(0, queryIndex);\n    } // What's left might be an identifier\n    return identifier.match(/[\\w_]+/) ? identifier : null;\n  };\n  const identifier1 = guessIdentifier(url || Youtube.defaultProps.url) || \"none\";\n  if (RenderTarget.current() === RenderTarget.canvas) {\n    return /*#__PURE__*/_jsx(\"div\", {\n      style: {\n        // https://stackoverflow.com/a/18400445\n        backgroundImage: `url(https://i.ytimg.com/vi/${identifier1}/hqdefault.jpg)`,\n        backgroundPosition: \"center\",\n        backgroundSize: \"cover\",\n        display: \"flex\",\n        justifyContent: \"center\",\n        alignItems: \"center\",\n        width: \"100%\",\n        height: \"100%\"\n      },\n      children: /*#__PURE__*/_jsxs(\"svg\", {\n        xmlns: \"http://www.w3.org/2000/svg\",\n        width: \"68\",\n        height: \"48\",\n        children: [/*#__PURE__*/_jsx(\"path\", {\n          d: \"M 66.52 7.74 C 65.74 4.81 64.03 2.33 61.1 1.55 C 55.79 0.13 34 0 34 0 C 34 0 12.21 0.13 6.9 1.55 C 3.97 2.33 2.27 4.81 1.48 7.74 C 0.06 13.05 0 24 0 24 C 0 24 0.06 34.95 1.48 40.26 C 2.26 43.19 3.97 45.67 6.9 46.45 C 12.21 47.87 34 48 34 48 C 34 48 55.79 47.87 61.1 46.45 C 64.03 45.67 65.74 43.19 66.52 40.26 C 67.94 34.95 68 24 68 24 C 68 24 67.94 13.05 66.52 7.74 Z\",\n          fill: \"rgba(34, 34, 34, 0.85)\"\n        }), /*#__PURE__*/_jsx(\"path\", {\n          d: \"M 45 24 L 27 14 L 27 34\",\n          fill: \"rgb(255,255,255)\"\n        })]\n      })\n    });\n  }\n  const autoplay = RenderTarget.current() == RenderTarget.preview && (play === YoutubeSettings.playAuto || play === YoutubeSettings.playLoop);\n  const loop = autoplay && play === YoutubeSettings.playLoop;\n  const mute = shouldMute && autoplay;\n  const showsInfo = controls === YoutubeSettings.controlsInfo;\n  const showsControls = controls === YoutubeSettings.controlsPlayback; // Notes on https://developers.google.com/youtube/player_parameters\n  // If \"controls\" is defined at all, an inactive video will get a Youtube logo in the corner\n  let src = `https://www.youtube.com/embed/${identifier1}?playlist=${identifier1}&showinfo=${showsInfo ? \"1\" : \"0\"}&autoplay=${autoplay ? \"1\" : \"0\"}&loop=${loop ? \"1\" : \"0\"}&mute=${mute ? \"1\" : \"0\"}&iv_load_policy=3&rel=0&?modestbranding=1&playsinline=1`;\n  if (showsControls || autoplay) {\n    src += \"&controls=\" + (showsControls ? \"1\" : \"0\");\n  }\n  return /*#__PURE__*/_jsx(\"iframe\", {\n    width: \"100%\",\n    height: \"100%\",\n    allowFullScreen: true,\n    onClick,\n    onMouseEnter,\n    onMouseLeave,\n    onMouseDown,\n    onMouseUp,\n    frameBorder: 0,\n    src: src\n  });\n}\nYoutube.displayName = \"YouTube\";\naddPropertyControls(Youtube, {\n  url: {\n    type: ControlType.String,\n    title: \"Video\"\n  },\n  play: {\n    type: ControlType.Enum,\n    title: \"Autoplay\",\n    options: [YoutubeSettings.playNormal, YoutubeSettings.playAuto, YoutubeSettings.playLoop]\n  },\n  canvasPlay: {\n    type: ControlType.Boolean,\n    title: \"On Canvas\",\n    enabledTitle: \"Play\",\n    disabledTitle: \"Pause\"\n  },\n  shouldMute: {\n    title: \"Mute\",\n    type: ControlType.Boolean,\n    enabledTitle: \"Yes\",\n    disabledTitle: \"No\"\n  },\n  ...defaultEvents\n});\nYoutube.defaultProps = {\n  url: \"https://www.youtube.com/watch?v=Fop2oskTug8\",\n  controls: YoutubeSettings.controlsPlayback,\n  play: YoutubeSettings.playNormal,\n  width: 375,\n  height: 210,\n  canvasPlay: false\n};\nexport const __FramerMetadata__ = {\n  \"exports\": {\n    \"Youtube\": {\n      \"type\": \"reactComponent\",\n      \"name\": \"Youtube\",\n      \"slots\": [],\n      \"annotations\": {\n        \"framerSupportedLayoutHeight\": \"fixed\",\n        \"framerContractVersion\": \"1\",\n        \"framerIntrinsicHeight\": \"210\",\n        \"framerSupportedLayoutWidth\": \"fixed\",\n        \"framerIntrinsicWidth\": \"375\"\n      }\n    },\n    \"__FramerMetadata__\": {\n      \"type\": \"variable\"\n    }\n  }\n};\n//# sourceMappingURL=./Youtube.map"],
  "mappings": "gJAGA,IAAIA,GACH,SAAUA,EAAiB,CAC1BA,EAAgB,WAAgB,MAChCA,EAAgB,SAAc,KAC9BA,EAAgB,SAAc,OAC9BA,EAAgB,iBAAsB,WACtCA,EAAgB,aAAkB,aAClCA,EAAgB,aAAkB,MACpC,GAAGA,IAAoBA,EAAkB,CAAC,EAAE,EASrC,SAASC,EAAQC,EAAO,CAC7B,GAAM,CACJ,IAAAC,EACA,KAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,QAAAC,EACA,aAAAC,EACA,aAAAC,EACA,YAAAC,EACA,UAAAC,EACA,WAAAC,CACF,EAAIV,EAgCEW,GA/BkBC,GAAY,CAClC,GAAI,CAACA,EAAU,OAAO,KACtB,IAAIC,EAAa,GACXC,EAAc,uBACdC,EAAaH,EAAS,QAAQE,CAAW,EAC/C,GAAIC,GAAc,EAChBF,EAAaD,EAAS,UAAUG,EAAaD,EAAY,MAAM,MAC1D,CAEL,IAAME,EAAc,qBACdC,EAAaL,EAAS,QAAQI,CAAW,EAC/C,GAAIC,GAAc,EAChBJ,EAAaD,EAAS,UAAUK,EAAaD,EAAY,MAAM,MAC1D,CAEL,IAAME,EAAkB,YAClBC,EAAiBP,EAAS,QAAQM,CAAe,EACnDC,GAAkB,EACpBN,EAAaD,EAAS,UAAUO,EAAiBD,EAAgB,MAAM,EAGvEL,EAAaD,GAInB,IAAMQ,EAAaP,EAAW,QAAQ,GAAG,EACzC,OAAIO,GAAc,IAChBP,EAAa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S,CAACjC,EAAgB,WAAYA,EAAgB,SAAUA,EAAgB,QAAQ,CAC1F,EACA,WAAY,CACV,KAAMiC,EAAY,QAClB,MAAO,YACP,aAAc,OACd,cAAe,OACjB,EACA,WAAY,CACV,MAAO,OACP,KAAMA,EAAY,QAClB,aAAc,MACd,cAAe,IACjB,EACA,GAAGC,CACL,CAAC,EACDjC,EAAQ,aAAe,CACrB,IAAK,8CACL,SAAUD,EAAgB,iBAC1B,KAAMA,EAAgB,WACtB,MAAO,IACP,OAAQ,IACR,WAAY,EACd",
  "names": ["YoutubeSettings", "Youtube", "props", "url", "play", "shouldMute", "controls", "onClick", "onMouseEnter", "onMouseLeave", "onMouseDown", "onMouseUp", "canvasPlay", "identifier1", "urlMaybe", "identifier", "watchPrefix", "watchIndex", "embedPrefix", "embedIndex", "shortenedPrefix", "shortenedIndex", "queryIndex", "RenderTarget", "p", "u", "autoplay", "loop", "mute", "showsInfo", "showsControls", "src", "addPropertyControls", "ControlType", "defaultEvents"]
}
