UNPKG

@lanaco/lnc-react-ui

Version:

React component library

1,193 lines (1,170 loc) 40.9 kB
import { jsx as c, jsxs as S } from "react/jsx-runtime"; import Y, { forwardRef as J } from "react"; import Xe from "./TextInput.js"; import Ye from "./Icon.js"; import Je from "./Chip.js"; import { s as q } from "./emotion-styled.browser.esm-DfbrHHed.js"; import { d as pe } from "./breakpoints-BubDitvo.js"; import { a as qe, c as H, g as Ze } from "./_commonjsHelpers-BkfeUUK-.js"; import { r as de } from "./index-wlx30R-h.js"; import { p as Ge } from "./index-CblbdqjE.js"; import { u as Qe } from "./useDetectMobile-B0Jog4jQ.js"; const et = q.div` display: flex; gap: 0.5rem; align-content: center; & .tags__item { color: var(--neutral-600, #0f2a46); background: var(--neutral-50, #eef2f5); font-size: 0.875rem; font-style: normal; font-weight: 400; line-height: 1rem; letter-spacing: 0.025rem; padding: 0.5rem; &:hover { background: var(--gray-200, #e4e9f0); } &:focus { outline: none; } } @media ${pe("S")} { width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; ::-webkit-scrollbar { -webkit-appearance: none; } -ms-overflow-style: none; /* Internet Explorer 10+ */ scrollbar-width: none; /* Firefox */ &::-webkit-scrollbar { display: none; /* Safari and Chrome */ } } `, tt = q.div` position: relative; display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; max-width: 31.25rem; max-height: 18.75rem; border-radius: 1rem; & .section__thumbnail { width: 100%; height: 100%; max-width: 31.25rem; max-height: 18.75rem; border-radius: 1rem; } & .section__play { position: absolute; } `, ae = J( ({ tags: e = [], selectedTagCode: t = null, onSelectTag: r = () => { } }, n) => /* @__PURE__ */ c(et, { ref: n, children: e == null ? void 0 : e.map((a, o) => /* @__PURE__ */ c( Je, { label: a == null ? void 0 : a.name, borderRadius: "curved", color: "neutral", className: `tags__item ${t === (a == null ? void 0 : a.code) ? "active" : ""}`, onClick: () => { r(a); } }, `search-section-tag__${o + 1}` )) }) ); var rt = function(t, r, n) { var a = document.head || document.getElementsByTagName("head")[0], o = document.createElement("script"); typeof r == "function" && (n = r, r = {}), r = r || {}, n = n || function() { }, o.type = r.type || "text/javascript", o.charset = r.charset || "utf8", o.async = "async" in r ? !!r.async : !0, o.src = t, r.attrs && at(o, r.attrs), r.text && (o.text = "" + r.text); var f = "onload" in o ? ne : nt; f(o, n), o.onload || ne(o, n), a.appendChild(o); }; function at(e, t) { for (var r in t) e.setAttribute(r, t[r]); } function ne(e, t) { e.onload = function() { this.onerror = this.onload = null, t(null, e); }, e.onerror = function() { this.onerror = this.onload = null, t(new Error("Failed to load " + this.src), e); }; } function nt(e, t) { e.onreadystatechange = function() { this.readyState != "complete" && this.readyState != "loaded" || (this.onreadystatechange = null, t(null, e)); }; } var ot = function(t) { return it(t) && !st(t); }; function it(e) { return !!e && typeof e == "object"; } function st(e) { var t = Object.prototype.toString.call(e); return t === "[object RegExp]" || t === "[object Date]" || ut(e); } var lt = typeof Symbol == "function" && Symbol.for, ct = lt ? Symbol.for("react.element") : 60103; function ut(e) { return e.$$typeof === ct; } function pt(e) { return Array.isArray(e) ? [] : {}; } function x(e, t) { return t.clone !== !1 && t.isMergeableObject(e) ? C(pt(e), e, t) : e; } function dt(e, t, r) { return e.concat(t).map(function(n) { return x(n, r); }); } function ft(e, t) { if (!t.customMerge) return C; var r = t.customMerge(e); return typeof r == "function" ? r : C; } function yt(e) { return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) { return Object.propertyIsEnumerable.call(e, t); }) : []; } function oe(e) { return Object.keys(e).concat(yt(e)); } function fe(e, t) { try { return t in e; } catch { return !1; } } function ht(e, t) { return fe(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t)); } function mt(e, t, r) { var n = {}; return r.isMergeableObject(e) && oe(e).forEach(function(a) { n[a] = x(e[a], r); }), oe(t).forEach(function(a) { ht(e, a) || (fe(e, a) && r.isMergeableObject(t[a]) ? n[a] = ft(a, r)(e[a], t[a], r) : n[a] = x(t[a], r)); }), n; } function C(e, t, r) { r = r || {}, r.arrayMerge = r.arrayMerge || dt, r.isMergeableObject = r.isMergeableObject || ot, r.cloneUnlessOtherwiseSpecified = x; var n = Array.isArray(t), a = Array.isArray(e), o = n === a; return o ? n ? r.arrayMerge(e, t, r) : mt(e, t, r) : x(t, r); } C.all = function(t, r) { if (!Array.isArray(t)) throw new Error("first argument should be an array"); return t.reduce(function(n, a) { return C(n, a, r); }, {}); }; var _t = C, ye = _t, Pt = Object.create, N = Object.defineProperty, gt = Object.getOwnPropertyDescriptor, bt = Object.getOwnPropertyNames, vt = Object.getPrototypeOf, wt = Object.prototype.hasOwnProperty, Ot = (e, t) => { for (var r in t) N(e, r, { get: t[r], enumerable: !0 }); }, he = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function") for (let a of bt(t)) !wt.call(e, a) && a !== r && N(e, a, { get: () => t[a], enumerable: !(n = gt(t, a)) || n.enumerable }); return e; }, Z = (e, t, r) => (r = e != null ? Pt(vt(e)) : {}, he( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. !e || !e.__esModule ? N(r, "default", { value: e, enumerable: !0 }) : r, e )), St = (e) => he(N({}, "__esModule", { value: !0 }), e), me = {}; Ot(me, { callPlayer: () => Ht, getConfig: () => Ut, getSDK: () => Dt, isBlobUrl: () => Vt, isMediaStream: () => zt, lazy: () => Mt, omit: () => kt, parseEndTime: () => Lt, parseStartTime: () => It, queryString: () => jt, randomString: () => Nt, supportsWebKitPresentationMode: () => Ft }); var j = St(me), Tt = Z(Y), Ct = Z(rt), Et = Z(ye); const Mt = (e) => Tt.default.lazy(async () => { const t = await e(); return typeof t.default == "function" ? t : t.default; }), At = /[?&#](?:start|t)=([0-9hms]+)/, Rt = /[?&#]end=([0-9hms]+)/, B = /(\d+)(h|m|s)/g, xt = /^\d+$/; function _e(e, t) { if (e instanceof Array) return; const r = e.match(t); if (r) { const n = r[1]; if (n.match(B)) return $t(n); if (xt.test(n)) return parseInt(n); } } function $t(e) { let t = 0, r = B.exec(e); for (; r !== null; ) { const [, n, a] = r; a === "h" && (t += parseInt(n, 10) * 60 * 60), a === "m" && (t += parseInt(n, 10) * 60), a === "s" && (t += parseInt(n, 10)), r = B.exec(e); } return t; } function It(e) { return _e(e, At); } function Lt(e) { return _e(e, Rt); } function Nt() { return Math.random().toString(36).substr(2, 5); } function jt(e) { return Object.keys(e).map((t) => `${t}=${e[t]}`).join("&"); } function z(e) { return window[e] ? window[e] : window.exports && window.exports[e] ? window.exports[e] : window.module && window.module.exports && window.module.exports[e] ? window.module.exports[e] : null; } const w = {}, Dt = function(t, r, n = null, a = () => !0, o = Ct.default) { const f = z(r); return f && a(f) ? Promise.resolve(f) : new Promise((y, u) => { if (w[t]) { w[t].push({ resolve: y, reject: u }); return; } w[t] = [{ resolve: y, reject: u }]; const v = (b) => { w[t].forEach((E) => E.resolve(b)); }; if (n) { const b = window[n]; window[n] = function() { b && b(), v(z(r)); }; } o(t, (b) => { b ? (w[t].forEach((E) => E.reject(b)), w[t] = null) : n || v(z(r)); }); }); }; function Ut(e, t) { return (0, Et.default)(t.config, e.config); } function kt(e, ...t) { const r = [].concat(...t), n = {}, a = Object.keys(e); for (const o of a) r.indexOf(o) === -1 && (n[o] = e[o]); return n; } function Ht(e, ...t) { if (!this.player || !this.player[e]) { let r = `ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `; return this.player ? this.player[e] || (r += "The method was not available") : r += "The player was not available", console.warn(r, "font-weight: bold", ""), null; } return this.player[e](...t); } function zt(e) { return typeof window < "u" && typeof window.MediaStream < "u" && e instanceof window.MediaStream; } function Vt(e) { return /^blob:/.test(e); } function Ft(e = document.createElement("video")) { const t = /iPhone|iPod/.test(navigator.userAgent) === !1; return e.webkitSupportsPresentationMode && typeof e.webkitSetPresentationMode == "function" && t; } var G = Object.defineProperty, Bt = Object.getOwnPropertyDescriptor, Kt = Object.getOwnPropertyNames, Wt = Object.prototype.hasOwnProperty, Xt = (e, t) => { for (var r in t) G(e, r, { get: t[r], enumerable: !0 }); }, Yt = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function") for (let a of Kt(t)) !Wt.call(e, a) && a !== r && G(e, a, { get: () => t[a], enumerable: !(n = Bt(t, a)) || n.enumerable }); return e; }, Jt = (e) => Yt(G({}, "__esModule", { value: !0 }), e), Pe = {}; Xt(Pe, { AUDIO_EXTENSIONS: () => Q, DASH_EXTENSIONS: () => $e, FLV_EXTENSIONS: () => Ie, HLS_EXTENSIONS: () => te, MATCH_URL_DAILYMOTION: () => Me, MATCH_URL_FACEBOOK: () => we, MATCH_URL_FACEBOOK_WATCH: () => Oe, MATCH_URL_KALTURA: () => xe, MATCH_URL_MIXCLOUD: () => Ae, MATCH_URL_MUX: () => ve, MATCH_URL_SOUNDCLOUD: () => ge, MATCH_URL_STREAMABLE: () => Se, MATCH_URL_TWITCH_CHANNEL: () => Ee, MATCH_URL_TWITCH_VIDEO: () => Ce, MATCH_URL_VIDYARD: () => Re, MATCH_URL_VIMEO: () => be, MATCH_URL_WISTIA: () => Te, MATCH_URL_YOUTUBE: () => K, VIDEO_EXTENSIONS: () => ee, canPlay: () => Zt }); var qt = Jt(Pe), ie = j; const K = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//, ge = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/, be = /vimeo\.com\/(?!progressive_redirect).+/, ve = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/, we = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/, Oe = /^https?:\/\/fb\.watch\/.+$/, Se = /streamable\.com\/([a-z0-9]+)$/, Te = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/, Ce = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/, Ee = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/, Me = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/, Ae = /mixcloud\.com\/([^/]+\/[^/]+)/, Re = /vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/, xe = /^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/, Q = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i, ee = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i, te = /\.(m3u8)($|\?)/i, $e = /\.(mpd)($|\?)/i, Ie = /\.(flv)($|\?)/i, W = (e) => { if (e instanceof Array) { for (const t of e) if (typeof t == "string" && W(t) || W(t.src)) return !0; return !1; } return (0, ie.isMediaStream)(e) || (0, ie.isBlobUrl)(e) ? !0 : Q.test(e) || ee.test(e) || te.test(e) || $e.test(e) || Ie.test(e); }, Zt = { youtube: (e) => e instanceof Array ? e.every((t) => K.test(t)) : K.test(e), soundcloud: (e) => ge.test(e) && !Q.test(e), vimeo: (e) => be.test(e) && !ee.test(e) && !te.test(e), mux: (e) => ve.test(e), facebook: (e) => we.test(e) || Oe.test(e), streamable: (e) => Se.test(e), wistia: (e) => Te.test(e), twitch: (e) => Ce.test(e) || Ee.test(e), dailymotion: (e) => Me.test(e), mixcloud: (e) => Ae.test(e), vidyard: (e) => Re.test(e), kaltura: (e) => xe.test(e), file: W }; var re = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, Qt = Object.getOwnPropertyNames, er = Object.prototype.hasOwnProperty, tr = (e, t) => { for (var r in t) re(e, r, { get: t[r], enumerable: !0 }); }, rr = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function") for (let a of Qt(t)) !er.call(e, a) && a !== r && re(e, a, { get: () => t[a], enumerable: !(n = Gt(t, a)) || n.enumerable }); return e; }, ar = (e) => rr(re({}, "__esModule", { value: !0 }), e), Le = {}; tr(Le, { default: () => or }); var nr = ar(Le), P = j, m = qt, or = [ { key: "youtube", name: "YouTube", canPlay: m.canPlay.youtube, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerYouTube' */ "./YouTube-D2wx0EoX.js" ).then((e) => e.Y)) }, { key: "soundcloud", name: "SoundCloud", canPlay: m.canPlay.soundcloud, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerSoundCloud' */ "./SoundCloud-CK7NvImk.js" ).then((e) => e.S)) }, { key: "vimeo", name: "Vimeo", canPlay: m.canPlay.vimeo, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerVimeo' */ "./Vimeo-BjGe7JPl.js" ).then((e) => e.V)) }, { key: "mux", name: "Mux", canPlay: m.canPlay.mux, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerMux' */ "./Mux-CBMcNvuK.js" ).then((e) => e.M)) }, { key: "facebook", name: "Facebook", canPlay: m.canPlay.facebook, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerFacebook' */ "./Facebook-o0wYiIu4.js" ).then((e) => e.F)) }, { key: "streamable", name: "Streamable", canPlay: m.canPlay.streamable, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerStreamable' */ "./Streamable-D5oxy9aa.js" ).then((e) => e.S)) }, { key: "wistia", name: "Wistia", canPlay: m.canPlay.wistia, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerWistia' */ "./Wistia-Cnd0mYar.js" ).then((e) => e.W)) }, { key: "twitch", name: "Twitch", canPlay: m.canPlay.twitch, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerTwitch' */ "./Twitch-DtrfG3Wo.js" ).then((e) => e.T)) }, { key: "dailymotion", name: "DailyMotion", canPlay: m.canPlay.dailymotion, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerDailyMotion' */ "./DailyMotion-BcKTajo7.js" ).then((e) => e.D)) }, { key: "mixcloud", name: "Mixcloud", canPlay: m.canPlay.mixcloud, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerMixcloud' */ "./Mixcloud-D2JZtlPe.js" ).then((e) => e.M)) }, { key: "vidyard", name: "Vidyard", canPlay: m.canPlay.vidyard, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerVidyard' */ "./Vidyard-C66crgMN.js" ).then((e) => e.V)) }, { key: "kaltura", name: "Kaltura", canPlay: m.canPlay.kaltura, lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerKaltura' */ "./Kaltura-CA_8jdJe.js" ).then((e) => e.K)) }, { key: "file", name: "FilePlayer", canPlay: m.canPlay.file, canEnablePIP: (e) => m.canPlay.file(e) && (document.pictureInPictureEnabled || (0, P.supportsWebKitPresentationMode)()) && !m.AUDIO_EXTENSIONS.test(e), lazyPlayer: (0, P.lazy)(() => import( /* webpackChunkName: 'reactPlayerFilePlayer' */ "./FilePlayer-Evom9jRl.js" ).then((e) => e.F)) } ], se = Number.isNaN || function(t) { return typeof t == "number" && t !== t; }; function ir(e, t) { return !!(e === t || se(e) && se(t)); } function sr(e, t) { if (e.length !== t.length) return !1; for (var r = 0; r < e.length; r++) if (!ir(e[r], t[r])) return !1; return !0; } function lr(e, t) { t === void 0 && (t = sr); var r, n = [], a, o = !1; function f() { for (var y = [], u = 0; u < arguments.length; u++) y[u] = arguments[u]; return o && r === this && t(y, n) || (a = e.apply(this, y), o = !0, r = this, n = y), a; } return f; } const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, default: lr }, Symbol.toStringTag, { value: "Module" })), ur = /* @__PURE__ */ qe(cr); var pr = Object.create, D = Object.defineProperty, dr = Object.getOwnPropertyDescriptor, fr = Object.getOwnPropertyNames, yr = Object.getPrototypeOf, hr = Object.prototype.hasOwnProperty, mr = (e, t) => { for (var r in t) D(e, r, { get: t[r], enumerable: !0 }); }, Ne = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function") for (let a of fr(t)) !hr.call(e, a) && a !== r && D(e, a, { get: () => t[a], enumerable: !(n = dr(t, a)) || n.enumerable }); return e; }, _r = (e, t, r) => (r = e != null ? pr(yr(e)) : {}, Ne( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. !e || !e.__esModule ? D(r, "default", { value: e, enumerable: !0 }) : r, e )), Pr = (e) => Ne(D({}, "__esModule", { value: !0 }), e), je = {}; mr(je, { defaultProps: () => vr, propTypes: () => br }); var De = Pr(je), gr = _r(Ge); const { string: p, bool: _, number: O, array: V, oneOfType: M, shape: g, object: h, func: l, node: le } = gr.default, br = { url: M([p, V, h]), playing: _, loop: _, controls: _, volume: O, muted: _, playbackRate: O, width: M([p, O]), height: M([p, O]), style: h, progressInterval: O, playsinline: _, pip: _, stopOnUnmount: _, light: M([_, p, h]), playIcon: le, previewTabIndex: O, previewAriaLabel: p, fallback: le, oEmbedUrl: p, wrapper: M([ p, l, g({ render: l.isRequired }) ]), config: g({ soundcloud: g({ options: h }), youtube: g({ playerVars: h, embedOptions: h, onUnstarted: l }), facebook: g({ appId: p, version: p, playerId: p, attributes: h }), dailymotion: g({ params: h }), vimeo: g({ playerOptions: h, title: p }), mux: g({ attributes: h, version: p }), file: g({ attributes: h, tracks: V, forceVideo: _, forceAudio: _, forceHLS: _, forceSafariHLS: _, forceDisableHls: _, forceDASH: _, forceFLV: _, hlsOptions: h, hlsVersion: p, dashVersion: p, flvVersion: p }), wistia: g({ options: h, playerId: p, customControls: V }), mixcloud: g({ options: h }), twitch: g({ options: h, playerId: p }), vidyard: g({ options: h }) }), onReady: l, onStart: l, onPlay: l, onPause: l, onBuffer: l, onBufferEnd: l, onEnded: l, onError: l, onDuration: l, onSeek: l, onPlaybackRateChange: l, onPlaybackQualityChange: l, onProgress: l, onClickPreview: l, onEnablePIP: l, onDisablePIP: l }, d = () => { }, vr = { playing: !1, loop: !1, controls: !1, volume: null, muted: !1, playbackRate: 1, width: "640px", height: "360px", style: {}, progressInterval: 1e3, playsinline: !1, pip: !1, stopOnUnmount: !0, light: !1, fallback: null, wrapper: "div", previewTabIndex: 0, previewAriaLabel: "", oEmbedUrl: "https://noembed.com/embed?url={url}", config: { soundcloud: { options: { visual: !0, // Undocumented, but makes player fill container and look better buying: !1, liking: !1, download: !1, sharing: !1, show_comments: !1, show_playcount: !1 } }, youtube: { playerVars: { playsinline: 1, showinfo: 0, rel: 0, iv_load_policy: 3, modestbranding: 1 }, embedOptions: {}, onUnstarted: d }, facebook: { appId: "1309697205772819", version: "v3.3", playerId: null, attributes: {} }, dailymotion: { params: { api: 1, "endscreen-enable": !1 } }, vimeo: { playerOptions: { autopause: !1, byline: !1, portrait: !1, title: !1 }, title: null }, mux: { attributes: {}, version: "2" }, file: { attributes: {}, tracks: [], forceVideo: !1, forceAudio: !1, forceHLS: !1, forceDASH: !1, forceFLV: !1, hlsOptions: {}, hlsVersion: "1.1.4", dashVersion: "3.1.3", flvVersion: "1.5.0", forceDisableHls: !1 }, wistia: { options: {}, playerId: null, customControls: null }, mixcloud: { options: { hide_cover: 1 } }, twitch: { options: {}, playerId: null }, vidyard: { options: {} } }, onReady: d, onStart: d, onPlay: d, onPause: d, onBuffer: d, onBufferEnd: d, onEnded: d, onError: d, onDuration: d, onSeek: d, onPlaybackRateChange: d, onPlaybackQualityChange: d, onProgress: d, onClickPreview: d, onEnablePIP: d, onDisablePIP: d }; var wr = Object.create, $ = Object.defineProperty, Or = Object.getOwnPropertyDescriptor, Sr = Object.getOwnPropertyNames, Tr = Object.getPrototypeOf, Cr = Object.prototype.hasOwnProperty, Er = (e, t, r) => t in e ? $(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Mr = (e, t) => { for (var r in t) $(e, r, { get: t[r], enumerable: !0 }); }, Ue = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function") for (let a of Sr(t)) !Cr.call(e, a) && a !== r && $(e, a, { get: () => t[a], enumerable: !(n = Or(t, a)) || n.enumerable }); return e; }, ke = (e, t, r) => (r = e != null ? wr(Tr(e)) : {}, Ue( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. !e || !e.__esModule ? $(r, "default", { value: e, enumerable: !0 }) : r, e )), Ar = (e) => Ue($({}, "__esModule", { value: !0 }), e), s = (e, t, r) => (Er(e, typeof t != "symbol" ? t + "" : t, r), r), He = {}; Mr(He, { default: () => U }); var Rr = Ar(He), ce = ke(Y), xr = ke(de), ze = De, $r = j; const Ir = 5e3; class U extends ce.Component { constructor() { super(...arguments), s(this, "mounted", !1), s(this, "isReady", !1), s(this, "isPlaying", !1), s(this, "isLoading", !0), s(this, "loadOnReady", null), s(this, "startOnPlay", !0), s(this, "seekOnPlay", null), s(this, "onDurationCalled", !1), s(this, "handlePlayerMount", (t) => { if (this.player) { this.progress(); return; } this.player = t, this.player.load(this.props.url), this.progress(); }), s(this, "getInternalPlayer", (t) => this.player ? this.player[t] : null), s(this, "progress", () => { if (this.props.url && this.player && this.isReady) { const t = this.getCurrentTime() || 0, r = this.getSecondsLoaded(), n = this.getDuration(); if (n) { const a = { playedSeconds: t, played: t / n }; r !== null && (a.loadedSeconds = r, a.loaded = r / n), (a.playedSeconds !== this.prevPlayed || a.loadedSeconds !== this.prevLoaded) && this.props.onProgress(a), this.prevPlayed = a.playedSeconds, this.prevLoaded = a.loadedSeconds; } } this.progressTimeout = setTimeout(this.progress, this.props.progressFrequency || this.props.progressInterval); }), s(this, "handleReady", () => { if (!this.mounted) return; this.isReady = !0, this.isLoading = !1; const { onReady: t, playing: r, volume: n, muted: a } = this.props; t(), !a && n !== null && this.player.setVolume(n), this.loadOnReady ? (this.player.load(this.loadOnReady, !0), this.loadOnReady = null) : r && this.player.play(), this.handleDurationCheck(); }), s(this, "handlePlay", () => { this.isPlaying = !0, this.isLoading = !1; const { onStart: t, onPlay: r, playbackRate: n } = this.props; this.startOnPlay && (this.player.setPlaybackRate && n !== 1 && this.player.setPlaybackRate(n), t(), this.startOnPlay = !1), r(), this.seekOnPlay && (this.seekTo(this.seekOnPlay), this.seekOnPlay = null), this.handleDurationCheck(); }), s(this, "handlePause", (t) => { this.isPlaying = !1, this.isLoading || this.props.onPause(t); }), s(this, "handleEnded", () => { const { activePlayer: t, loop: r, onEnded: n } = this.props; t.loopOnEnded && r && this.seekTo(0), r || (this.isPlaying = !1, n()); }), s(this, "handleError", (...t) => { this.isLoading = !1, this.props.onError(...t); }), s(this, "handleDurationCheck", () => { clearTimeout(this.durationCheckTimeout); const t = this.getDuration(); t ? this.onDurationCalled || (this.props.onDuration(t), this.onDurationCalled = !0) : this.durationCheckTimeout = setTimeout(this.handleDurationCheck, 100); }), s(this, "handleLoaded", () => { this.isLoading = !1; }); } componentDidMount() { this.mounted = !0; } componentWillUnmount() { clearTimeout(this.progressTimeout), clearTimeout(this.durationCheckTimeout), this.isReady && this.props.stopOnUnmount && (this.player.stop(), this.player.disablePIP && this.player.disablePIP()), this.mounted = !1; } componentDidUpdate(t) { if (!this.player) return; const { url: r, playing: n, volume: a, muted: o, playbackRate: f, pip: y, loop: u, activePlayer: v, disableDeferredLoading: b } = this.props; if (!(0, xr.default)(t.url, r)) { if (this.isLoading && !v.forceLoad && !b && !(0, $r.isMediaStream)(r)) { console.warn(`ReactPlayer: the attempt to load ${r} is being deferred until the player has loaded`), this.loadOnReady = r; return; } this.isLoading = !0, this.startOnPlay = !0, this.onDurationCalled = !1, this.player.load(r, this.isReady); } !t.playing && n && !this.isPlaying && this.player.play(), t.playing && !n && this.isPlaying && this.player.pause(), !t.pip && y && this.player.enablePIP && this.player.enablePIP(), t.pip && !y && this.player.disablePIP && this.player.disablePIP(), t.volume !== a && a !== null && this.player.setVolume(a), t.muted !== o && (o ? this.player.mute() : (this.player.unmute(), a !== null && setTimeout(() => this.player.setVolume(a)))), t.playbackRate !== f && this.player.setPlaybackRate && this.player.setPlaybackRate(f), t.loop !== u && this.player.setLoop && this.player.setLoop(u); } getDuration() { return this.isReady ? this.player.getDuration() : null; } getCurrentTime() { return this.isReady ? this.player.getCurrentTime() : null; } getSecondsLoaded() { return this.isReady ? this.player.getSecondsLoaded() : null; } seekTo(t, r, n) { if (!this.isReady) { t !== 0 && (this.seekOnPlay = t, setTimeout(() => { this.seekOnPlay = null; }, Ir)); return; } if (r ? r === "fraction" : t > 0 && t < 1) { const o = this.player.getDuration(); if (!o) { console.warn("ReactPlayer: could not seek using fraction – duration not yet available"); return; } this.player.seekTo(o * t, n); return; } this.player.seekTo(t, n); } render() { const t = this.props.activePlayer; return t ? /* @__PURE__ */ ce.default.createElement( t, { ...this.props, onMount: this.handlePlayerMount, onReady: this.handleReady, onPlay: this.handlePlay, onPause: this.handlePause, onEnded: this.handleEnded, onLoaded: this.handleLoaded, onError: this.handleError } ) : null; } } s(U, "displayName", "Player"); s(U, "propTypes", ze.propTypes); s(U, "defaultProps", ze.defaultProps); var Lr = Object.create, I = Object.defineProperty, Nr = Object.getOwnPropertyDescriptor, jr = Object.getOwnPropertyNames, Dr = Object.getPrototypeOf, Ur = Object.prototype.hasOwnProperty, kr = (e, t, r) => t in e ? I(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Hr = (e, t) => { for (var r in t) I(e, r, { get: t[r], enumerable: !0 }); }, Ve = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function") for (let a of jr(t)) !Ur.call(e, a) && a !== r && I(e, a, { get: () => t[a], enumerable: !(n = Nr(t, a)) || n.enumerable }); return e; }, L = (e, t, r) => (r = e != null ? Lr(Dr(e)) : {}, Ve( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. !e || !e.__esModule ? I(r, "default", { value: e, enumerable: !0 }) : r, e )), zr = (e) => Ve(I({}, "__esModule", { value: !0 }), e), i = (e, t, r) => (kr(e, typeof t != "symbol" ? t + "" : t, r), r), Fe = {}; Hr(Fe, { createReactPlayer: () => qr }); var Vr = zr(Fe), T = L(Y), Fr = L(ye), F = L(ur), ue = L(de), R = De, Be = j, Br = L(Rr); const Kr = (0, Be.lazy)(() => import( /* webpackChunkName: 'reactPlayerPreview' */ "./Preview-CEZQvDLk.js" ).then((e) => e.P)), Wr = typeof window < "u" && window.document && typeof document < "u", Xr = typeof H < "u" && H.window && H.window.document, Yr = Object.keys(R.propTypes), Jr = Wr || Xr ? T.Suspense : () => null, A = [], qr = (e, t) => { var r; return r = class extends T.Component { constructor() { super(...arguments), i(this, "state", { showPreview: !!this.props.light }), i(this, "references", { wrapper: (n) => { this.wrapper = n; }, player: (n) => { this.player = n; } }), i(this, "handleClickPreview", (n) => { this.setState({ showPreview: !1 }), this.props.onClickPreview(n); }), i(this, "showPreview", () => { this.setState({ showPreview: !0 }); }), i(this, "getDuration", () => this.player ? this.player.getDuration() : null), i(this, "getCurrentTime", () => this.player ? this.player.getCurrentTime() : null), i(this, "getSecondsLoaded", () => this.player ? this.player.getSecondsLoaded() : null), i(this, "getInternalPlayer", (n = "player") => this.player ? this.player.getInternalPlayer(n) : null), i(this, "seekTo", (n, a, o) => { if (!this.player) return null; this.player.seekTo(n, a, o); }), i(this, "handleReady", () => { this.props.onReady(this); }), i(this, "getActivePlayer", (0, F.default)((n) => { for (const a of [...A, ...e]) if (a.canPlay(n)) return a; return t || null; })), i(this, "getConfig", (0, F.default)((n, a) => { const { config: o } = this.props; return Fr.default.all([ R.defaultProps.config, R.defaultProps.config[a] || {}, o, o[a] || {} ]); })), i(this, "getAttributes", (0, F.default)((n) => (0, Be.omit)(this.props, Yr))), i(this, "renderActivePlayer", (n) => { if (!n) return null; const a = this.getActivePlayer(n); if (!a) return null; const o = this.getConfig(n, a.key); return /* @__PURE__ */ T.default.createElement( Br.default, { ...this.props, key: a.key, ref: this.references.player, config: o, activePlayer: a.lazyPlayer || a, onReady: this.handleReady } ); }); } shouldComponentUpdate(n, a) { return !(0, ue.default)(this.props, n) || !(0, ue.default)(this.state, a); } componentDidUpdate(n) { const { light: a } = this.props; !n.light && a && this.setState({ showPreview: !0 }), n.light && !a && this.setState({ showPreview: !1 }); } renderPreview(n) { if (!n) return null; const { light: a, playIcon: o, previewTabIndex: f, oEmbedUrl: y, previewAriaLabel: u } = this.props; return /* @__PURE__ */ T.default.createElement( Kr, { url: n, light: a, playIcon: o, previewTabIndex: f, previewAriaLabel: u, oEmbedUrl: y, onClick: this.handleClickPreview } ); } render() { const { url: n, style: a, width: o, height: f, fallback: y, wrapper: u } = this.props, { showPreview: v } = this.state, b = this.getAttributes(n), E = typeof u == "string" ? this.references.wrapper : void 0; return /* @__PURE__ */ T.default.createElement(u, { ref: E, style: { ...a, width: o, height: f }, ...b }, /* @__PURE__ */ T.default.createElement(Jr, { fallback: y }, v ? this.renderPreview(n) : this.renderActivePlayer(n))); } }, i(r, "displayName", "ReactPlayer"), i(r, "propTypes", R.propTypes), i(r, "defaultProps", R.defaultProps), i(r, "addCustomPlayer", (n) => { A.push(n); }), i(r, "removeCustomPlayers", () => { A.length = 0; }), i(r, "canPlay", (n) => { for (const a of [...A, ...e]) if (a.canPlay(n)) return !0; return !1; }), i(r, "canEnablePIP", (n) => { for (const a of [...A, ...e]) if (a.canEnablePIP && a.canEnablePIP(n)) return !0; return !1; }), r; }; var Zr = Object.create, k = Object.defineProperty, Gr = Object.getOwnPropertyDescriptor, Qr = Object.getOwnPropertyNames, ea = Object.getPrototypeOf, ta = Object.prototype.hasOwnProperty, ra = (e, t) => { for (var r in t) k(e, r, { get: t[r], enumerable: !0 }); }, Ke = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function") for (let a of Qr(t)) !ta.call(e, a) && a !== r && k(e, a, { get: () => t[a], enumerable: !(n = Gr(t, a)) || n.enumerable }); return e; }, aa = (e, t, r) => (r = e != null ? Zr(ea(e)) : {}, Ke( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. !e || !e.__esModule ? k(r, "default", { value: e, enumerable: !0 }) : r, e )), na = (e) => Ke(k({}, "__esModule", { value: !0 }), e), We = {}; ra(We, { default: () => la }); var oa = na(We), X = aa(nr), ia = Vr; const sa = X.default[X.default.length - 1]; var la = (0, ia.createReactPlayer)(X.default, sa); const ca = /* @__PURE__ */ Ze(oa), ua = "data:image/svg+xml,%3csvg%20width='65'%20height='65'%20viewBox='0%200%2065%2065'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='0.253906'%20y='0.5'%20width='64'%20height='64'%20rx='32'%20fill='url(%23paint0_linear_59350_95007)'/%3e%3cpath%20d='M21.0039%2047.5001C20.6724%2047.5001%2020.3544%2047.3684%2020.12%2047.134C19.8856%2046.8996%2019.7539%2046.5816%2019.7539%2046.2501V18.7501C19.7539%2018.5329%2019.8105%2018.3194%2019.9181%2018.1307C20.0257%2017.942%2020.1807%2017.7846%2020.3677%2017.674C20.5546%2017.5635%2020.7672%2017.5035%2020.9844%2017.5002C21.2016%2017.4968%2021.4159%2017.55%2021.6063%2017.6547L46.6063%2031.4047C46.8024%2031.5126%2046.966%2031.6711%2047.0799%2031.8638C47.1939%2032.0565%2047.254%2032.2762%2047.254%2032.5C47.254%2032.7239%2047.1939%2032.9436%2047.0799%2033.1363C46.966%2033.3289%2046.8024%2033.4875%2046.6063%2033.5953L21.6063%2047.3453C21.4217%2047.4468%2021.2145%2047.5001%2021.0039%2047.5001Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_59350_95007'%20x1='32.2539'%20y1='64.5'%20x2='32.254'%20y2='0.499999'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF7621'/%3e%3cstop%20offset='1'%20stop-color='%23FF9706'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e", pa = ({ thumbnail: e }) => /* @__PURE__ */ S(tt, { children: [ /* @__PURE__ */ c("img", { src: e, className: "section__thumbnail", alt: "Thumbnail" }), /* @__PURE__ */ c("img", { src: ua, className: "section__play", alt: "Play" }) ] }), da = J(({ video: e, thumbnail: t }, r) => { const n = Qe(); return /* @__PURE__ */ c( ca, { url: e, playing: !0, controls: !0, width: n ? "100%" : "31.25rem", height: n ? "100%" : "18.75rem", light: !0, playIcon: /* @__PURE__ */ c(pa, { thumbnail: t }) } ); }), fa = q.div` display: flex; justify-content: space-between; align-items: center; & .section__left { display: flex; flex-direction: column; gap: 2rem; &.search { gap: 0.75rem; } & .section__title { color: var(--gray-900, #0c1520); font-size: 1.75rem; font-style: normal; font-weight: 600; line-height: 2.25rem; letter-spacing: -0.0369rem; } & .section__text-input { border-radius: 999px; height: 3rem; min-height: 3rem; border: 1px solid var(--gray-200, #e4e9f0); box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); outline: none; & input::placeholder { color: var(--gray-500, #7a8594); font-size: 0.875rem; font-style: normal; font-weight: 400; line-height: 1.25rem; letter-spacing: 0.0156rem; } & .section__prefix { color: var(--gray-500, #7a8594); } } & .section__description { color: var(--gray-500, #7a8594); font-size: 1rem; font-style: normal; font-weight: 500; line-height: 1.5rem; letter-spacing: -0.0112rem; } & .section__tags { display: flex; align-items: center; gap: 1.25rem; & .section__suggested { color: var(--neutral-900, #0c1520); font-size: 0.75rem; font-style: normal; font-weight: 400; line-height: 1rem; letter-spacing: 0.025rem; } } } & .section__right { & video { border-radius: 1rem; overflow: hidden; object-fit: cover; } } @media ${pe("S")} { flex-direction: column; gap: 1.5rem; & .section__left { width: 100%; text-align: center; & .section__suggested { display: none; } } & .section__text-input { width: 100%; } } `, Ta = J( ({ title: e, description: t, suggestedText: r = "Suggested", searchPlaceholderText: n = "Search for rules, tempates, forms and more", tags: a = [], includeSearch: o = !1, video: f, thumbnail: y }, u) => /* @__PURE__ */ S(fa, { ref: u, children: [ o ? /* @__PURE__ */ S("div", { className: "section__left search", children: [ /* @__PURE__ */ c("div", { children: e && /* @__PURE__ */ c("div", { className: "section__title", children: e }) }), /* @__PURE__ */ c( Xe, { className: "section__text-input", placeholder: n, prefix: /* @__PURE__ */ c( Ye, { icon: " mng-lnc-search", sizeInUnits: "1.25rem", className: "section__prefix" } ), color: "neutral" } ), /* @__PURE__ */ S("div", { className: "section__tags", children: [ /* @__PURE__ */ c("div", { className: "section__suggested", children: r }), /* @__PURE__ */ c(ae, { tags: a }) ] }) ] }) : /* @__PURE__ */ S("div", { className: "section__left", children: [ /* @__PURE__ */ S("div", { children: [ e && /* @__PURE__ */ c("div", { className: "section__title", children: e }), t && /* @__PURE__ */ c("div", { className: "section__description", children: t }) ] }), /* @__PURE__ */ c("div", { className: "section__tags", children: /* @__PURE__ */ c(ae, { tags: a }) }) ] }), /* @__PURE__ */ c("div", { className: "section__right", children: /* @__PURE__ */ c(da, { video: f, thumbnail: y }) }) ] }) ); export { Ta as S, qt as p, j as u };