@car-cutter/react-webplayer 3.2.4 → 3.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-BUcu6Hvu.cjs");require("react/jsx-runtime");const S=require("react"),W=require("react-dom/client");var V=Object.defineProperty,D=(e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=(e,t,r)=>D(e,typeof t!="symbol"?t+"":t,r);const v={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},w={stringify:e=>e.name,parse:(e,t,r)=>{const i=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof i=="function"?i.bind(r):void 0}},M={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)};function Y(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,r,i)=>`${r}-${i.toLowerCase()}`)}function P(e){return e.replace(/[-:]([a-z])/g,(t,r)=>`${r.toUpperCase()}`)}const G={stringify:e=>e.name,parse:(e,t,r)=>{const i=(()=>{const _=P(t);if(typeof r<"u"&&_ in r.container)return r.container[_]})();return typeof i=="function"?i.bind(r):void 0}},F={stringify:e=>`${e}`,parse:e=>parseFloat(e)},j={stringify:e=>e,parse:e=>e},A={string:j,number:F,boolean:v,function:w,method:G,json:M},O=Symbol.for("r2wc.render"),N=Symbol.for("r2wc.connected"),p=Symbol.for("r2wc.context"),a=Symbol.for("r2wc.props");function k(e,t,r){var i,_,C;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const m=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),g=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),b={},L={},h={},y={};for(const s of m){b[s]=Array.isArray(t.props)?"string":t.props[s];const o=Y(s);h[s]=o,y[o]=s}for(const s of g)L[s]=Array.isArray(t.events)?{}:t.events[s];class I extends HTMLElement{constructor(){super(),f(this,C,!0),f(this,_),f(this,i,{}),f(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[a].container=this.container;for(const o of m){const l=h[o],E=this.getAttribute(l),c=b[o],u=c?A[c]:null;if(c==="method"){const T=P(l);Object.defineProperty(this[a].container,T,{enumerable:!0,configurable:!0,get(){return this[a][T]},set(R){this[a][T]=R,this[O]()}}),this[a][o]=u.parse(E,l,this)}u!=null&&u.parse&&E&&(this[a][o]=u.parse(E,l,this))}for(const o of g)this[a][o]=l=>{const E=o.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(E,{detail:l,...L[o]}))}}static get observedAttributes(){return Object.keys(y)}connectedCallback(){this[N]=!0,this[O]()}disconnectedCallback(){this[N]=!1,this[p]&&r.unmount(this[p]),delete this[p]}attributeChangedCallback(o,l,E){const c=y[o],u=b[c],T=u?A[u]:null;c in b&&T!=null&&T.parse&&E&&(this[a][c]=T.parse(E,o,this),this[O]())}[(C=N,_=p,i=a,O)](){this[N]&&(this[p]?r.update(this[p],this[a]):this[p]=r.mount(this.container,e,this[a]))}}for(const s of m){const o=h[s],l=b[s];Object.defineProperty(I.prototype,s,{enumerable:!0,configurable:!0,get(){return this[a][s]},set(E){this[a][s]=E;const c=l?A[l]:null;if(c!=null&&c.stringify){const u=c.stringify(E,o,this);this.getAttribute(o)!==u&&this.setAttribute(o,u)}else this[O]()}})}return I}function x(e,t,r){const i=W.createRoot(e),_=S.createElement(t,r);return i.render(_),{root:i,ReactComponent:t}}function B({root:e,ReactComponent:t},r){const i=S.createElement(t,r);e.render(i)}function U({root:e}){setTimeout(()=>{e.unmount()},0)}function d(e,t={}){return k(e,t,{mount:x,update:B,unmount:U})}const $=d(n.WebPlayerWithInjectedStyles,{shadow:"closed",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",integration:"boolean",maxItemsShown:"number",themeConfig:"string",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",autoLoadInterior360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean",spinCursor:"string",analyticsEventPrefix:"string",analyticsUrl:"string",analyticsBearer:"string",analyticsSimpleRequestsOnly:"boolean",analyticsDryRun:"boolean",analyticsDebug:"boolean",monitoring:"boolean"}}),H=d(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),X=d(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function q(){customElements.define(n.WEB_PLAYER_WC_TAG,$),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,H),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,X)}function z(){n.checkCustomElementsDefinition()||q()}z();exports.ANALYTICS_EVENT_DISPLAY=n.ANALYTICS_EVENT_DISPLAY;exports.ANALYTICS_EVENT_ERROR=n.ANALYTICS_EVENT_ERROR;exports.ANALYTICS_EVENT_INTERACTION=n.ANALYTICS_EVENT_INTERACTION;exports.ANALYTICS_EVENT_LOAD=n.ANALYTICS_EVENT_LOAD;exports.DEFAULT_EVENT_PREFIX=n.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=n.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=n.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=n.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=n.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=n.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=n.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=n.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=n.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=n.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=n.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=n.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=n.WEB_PLAYER_WC_TAG;exports.WebPlayer=n.WebPlayer;exports.WebPlayerCustomMedia=n.WebPlayerCustomMedia$1;exports.WebPlayerIcon=n.WebPlayerIcon$1;exports.generateCompositionUrl=n.generateCompositionUrl;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-CiiFL5oT.cjs");require("react/jsx-runtime");const g=require("react"),V=require("react-dom/client");var D=Object.defineProperty,v=(e,t,r)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t,r)=>v(e,typeof t!="symbol"?t+"":t,r);const w={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},M={stringify:e=>e.name,parse:(e,t,r)=>{const o=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof o=="function"?o.bind(r):void 0}},Y={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)};function G(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,r,o)=>`${r}-${o.toLowerCase()}`)}function R(e){return e.replace(/[-:]([a-z])/g,(t,r)=>`${r.toUpperCase()}`)}const F={stringify:e=>e.name,parse:(e,t,r)=>{const o=(()=>{const _=R(t);if(typeof r<"u"&&_ in r.container)return r.container[_]})();return typeof o=="function"?o.bind(r):void 0}},j={stringify:e=>`${e}`,parse:e=>parseFloat(e)},k={stringify:e=>e,parse:e=>e},C={string:k,number:j,boolean:w,function:M,method:F,json:Y},O=Symbol.for("r2wc.render"),N=Symbol.for("r2wc.connected"),T=Symbol.for("r2wc.context"),a=Symbol.for("r2wc.props");function x(e,t,r){var o,_,d;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const f=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),I=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),b={},S={},h={},A={};for(const s of f){b[s]=Array.isArray(t.props)?"string":t.props[s];const i=G(s);h[s]=i,A[i]=s}for(const s of I)S[s]=Array.isArray(t.events)?{}:t.events[s];class P extends HTMLElement{constructor(){super(),m(this,d,!0),m(this,_),m(this,o,{}),m(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[a].container=this.container;for(const i of f){const l=h[i],c=this.getAttribute(l),E=b[i],u=E?C[E]:null;if(E==="method"){const p=R(l);Object.defineProperty(this[a].container,p,{enumerable:!0,configurable:!0,get(){return this[a][p]},set(W){this[a][p]=W,this[O]()}}),this[a][i]=u.parse(c,l,this)}u!=null&&u.parse&&c&&(this[a][i]=u.parse(c,l,this))}for(const i of I)this[a][i]=l=>{const c=i.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(c,{detail:l,...S[i]}))}}static get observedAttributes(){return Object.keys(A)}connectedCallback(){this[N]=!0,this[O]()}disconnectedCallback(){this[N]=!1,this[T]&&r.unmount(this[T]),delete this[T]}attributeChangedCallback(i,l,c){const E=A[i],u=b[E],p=u?C[u]:null;E in b&&p!=null&&p.parse&&c&&(this[a][E]=p.parse(c,i,this),this[O]())}[(d=N,_=T,o=a,O)](){this[N]&&(this[T]?r.update(this[T],this[a]):this[T]=r.mount(this.container,e,this[a]))}}for(const s of f){const i=h[s],l=b[s];Object.defineProperty(P.prototype,s,{enumerable:!0,configurable:!0,get(){return this[a][s]},set(c){this[a][s]=c;const E=l?C[l]:null;if(E!=null&&E.stringify){const u=E.stringify(c,i,this);this.getAttribute(i)!==u&&this.setAttribute(i,u)}else this[O]()}})}return P}const y=new Map;function B(e,t,r){const o=y.get(e);if(o){o.tid!==null&&clearTimeout(o.tid),o.tid=null;const f=g.createElement(t,r);return o.root.render(f),{root:o.root,ReactComponent:t}}const _=V.createRoot(e);y.set(e,{root:_,tid:null});const d=g.createElement(t,r);return _.render(d),{root:_,ReactComponent:t}}function $({root:e,ReactComponent:t},r){const o=g.createElement(t,r);e.render(o)}function H({root:e}){for(const[t,r]of y)if(r.root===e){r.tid=setTimeout(()=>{y.delete(t),e.unmount()},0);return}setTimeout(()=>{e.unmount()},0)}function L(e,t={}){return x(e,t,{mount:B,update:$,unmount:H})}const U=L(n.WebPlayerWithInjectedStyles,{shadow:"closed",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",integration:"boolean",maxItemsShown:"number",themeConfig:"string",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",autoLoadInterior360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean",spinCursor:"string",analyticsEventPrefix:"string",analyticsUrl:"string",analyticsBearer:"string",analyticsSimpleRequestsOnly:"boolean",analyticsDryRun:"boolean",analyticsDebug:"boolean",monitoring:"boolean"}}),X=L(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),q=L(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function z(){customElements.define(n.WEB_PLAYER_WC_TAG,U),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,X),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,q)}function J(){n.checkCustomElementsDefinition()||z()}J();exports.ANALYTICS_EVENT_DISPLAY=n.ANALYTICS_EVENT_DISPLAY;exports.ANALYTICS_EVENT_ERROR=n.ANALYTICS_EVENT_ERROR;exports.ANALYTICS_EVENT_INTERACTION=n.ANALYTICS_EVENT_INTERACTION;exports.ANALYTICS_EVENT_LOAD=n.ANALYTICS_EVENT_LOAD;exports.DEFAULT_EVENT_PREFIX=n.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=n.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=n.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=n.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=n.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=n.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=n.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=n.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=n.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=n.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=n.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=n.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=n.WEB_PLAYER_WC_TAG;exports.WebPlayer=n.WebPlayer;exports.WebPlayerCustomMedia=n.WebPlayerCustomMedia$1;exports.WebPlayerIcon=n.WebPlayerIcon$1;exports.generateCompositionUrl=n.generateCompositionUrl;
package/dist/index.js CHANGED
@@ -1,125 +1,125 @@
1
- import { W as I, a as w, b as W, c as R, d as D, e as V, f as M } from "./shared-4nfP-R6L.js";
2
- import { A as ce, g as le, h as ue, i as pe, D as fe, E as me, j as Ee, k as be, l as he, m as ye, n as de, o as ge, p as _e, q as Oe, r as Te, s as Ae, t as Ce, u as Ne, v as Se } from "./shared-4nfP-R6L.js";
1
+ import { W as w, a as W, b as R, c as D, d as V, e as M, f as j } from "./shared-zi1amD4C.js";
2
+ import { A as le, g as ue, h as pe, i as fe, D as me, E as Ee, j as be, k as de, l as he, m as ye, n as ge, o as _e, p as Ce, q as Oe, r as Te, s as Ae, t as Ne, u as Se, v as Le } from "./shared-zi1amD4C.js";
3
3
  import "react/jsx-runtime";
4
- import L from "react";
5
- import { createRoot as j } from "react-dom/client";
6
- var x = Object.defineProperty, k = (e, t, n) => t in e ? x(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, h = (e, t, n) => k(e, typeof t != "symbol" ? t + "" : t, n);
7
- const Y = {
4
+ import A from "react";
5
+ import { createRoot as x } from "react-dom/client";
6
+ var k = Object.defineProperty, Y = (e, t, n) => t in e ? k(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, y = (e, t, n) => Y(e, typeof t != "symbol" ? t + "" : t, n);
7
+ const F = {
8
8
  stringify: (e) => e ? "true" : "false",
9
9
  parse: (e) => /^[ty1-9]/i.test(e)
10
- }, F = {
10
+ }, G = {
11
11
  stringify: (e) => e.name,
12
12
  parse: (e, t, n) => {
13
- const r = (() => {
13
+ const o = (() => {
14
14
  if (typeof window < "u" && e in window)
15
15
  return window[e];
16
16
  if (typeof global < "u" && e in global)
17
17
  return global[e];
18
18
  })();
19
- return typeof r == "function" ? r.bind(n) : void 0;
19
+ return typeof o == "function" ? o.bind(n) : void 0;
20
20
  }
21
- }, G = {
21
+ }, $ = {
22
22
  stringify: (e) => JSON.stringify(e),
23
23
  parse: (e) => JSON.parse(e)
24
24
  };
25
- function U(e) {
25
+ function B(e) {
26
26
  return e.replace(
27
27
  /([a-z0-9])([A-Z])/g,
28
- (t, n, r) => `${n}-${r.toLowerCase()}`
28
+ (t, n, o) => `${n}-${o.toLowerCase()}`
29
29
  );
30
30
  }
31
- function P(e) {
31
+ function v(e) {
32
32
  return e.replace(/[-:]([a-z])/g, (t, n) => `${n.toUpperCase()}`);
33
33
  }
34
- const $ = {
34
+ const H = {
35
35
  stringify: (e) => e.name,
36
36
  parse: (e, t, n) => {
37
- const r = (() => {
38
- const p = P(t);
37
+ const o = (() => {
38
+ const p = v(t);
39
39
  if (typeof n < "u" && p in n.container)
40
40
  return n.container[p];
41
41
  })();
42
- return typeof r == "function" ? r.bind(n) : void 0;
42
+ return typeof o == "function" ? o.bind(n) : void 0;
43
43
  }
44
- }, B = {
44
+ }, U = {
45
45
  stringify: (e) => `${e}`,
46
46
  parse: (e) => parseFloat(e)
47
- }, H = {
47
+ }, z = {
48
48
  stringify: (e) => e,
49
49
  parse: (e) => e
50
- }, O = {
51
- string: H,
52
- number: B,
53
- boolean: Y,
54
- function: F,
55
- method: $,
56
- json: G
57
- }, b = Symbol.for("r2wc.render"), y = Symbol.for("r2wc.connected"), m = Symbol.for("r2wc.context"), i = Symbol.for("r2wc.props");
58
- function z(e, t, n) {
59
- var r, p, A;
50
+ }, T = {
51
+ string: z,
52
+ number: U,
53
+ boolean: F,
54
+ function: G,
55
+ method: H,
56
+ json: $
57
+ }, d = Symbol.for("r2wc.render"), g = Symbol.for("r2wc.connected"), m = Symbol.for("r2wc.context"), i = Symbol.for("r2wc.props");
58
+ function J(e, t, n) {
59
+ var o, p, h;
60
60
  t.props || (t.props = e.propTypes ? Object.keys(e.propTypes) : []), t.events || (t.events = []);
61
- const d = Array.isArray(t.props) ? t.props.slice() : Object.keys(t.props), C = Array.isArray(t.events) ? t.events.slice() : Object.keys(t.events), E = {}, N = {}, g = {}, _ = {};
62
- for (const s of d) {
63
- E[s] = Array.isArray(t.props) ? "string" : t.props[s];
64
- const o = U(s);
65
- g[s] = o, _[o] = s;
61
+ const E = Array.isArray(t.props) ? t.props.slice() : Object.keys(t.props), S = Array.isArray(t.events) ? t.events.slice() : Object.keys(t.events), b = {}, L = {}, C = {}, O = {};
62
+ for (const s of E) {
63
+ b[s] = Array.isArray(t.props) ? "string" : t.props[s];
64
+ const r = B(s);
65
+ C[s] = r, O[r] = s;
66
66
  }
67
- for (const s of C)
68
- N[s] = Array.isArray(t.events) ? {} : t.events[s];
69
- class S extends HTMLElement {
67
+ for (const s of S)
68
+ L[s] = Array.isArray(t.events) ? {} : t.events[s];
69
+ class P extends HTMLElement {
70
70
  constructor() {
71
- super(), h(this, A, !0), h(this, p), h(this, r, {}), h(this, "container"), t.shadow ? this.container = this.attachShadow({
71
+ super(), y(this, h, !0), y(this, p), y(this, o, {}), y(this, "container"), t.shadow ? this.container = this.attachShadow({
72
72
  mode: t.shadow
73
73
  }) : this.container = this, this[i].container = this.container;
74
- for (const o of d) {
75
- const l = g[o], a = this.getAttribute(l), c = E[o], u = c ? O[c] : null;
74
+ for (const r of E) {
75
+ const l = C[r], a = this.getAttribute(l), c = b[r], u = c ? T[c] : null;
76
76
  if (c === "method") {
77
- const f = P(l);
77
+ const f = v(l);
78
78
  Object.defineProperty(this[i].container, f, {
79
79
  enumerable: !0,
80
80
  configurable: !0,
81
81
  get() {
82
82
  return this[i][f];
83
83
  },
84
- set(v) {
85
- this[i][f] = v, this[b]();
84
+ set(I) {
85
+ this[i][f] = I, this[d]();
86
86
  }
87
- }), this[i][o] = u.parse(a, l, this);
87
+ }), this[i][r] = u.parse(a, l, this);
88
88
  }
89
- u != null && u.parse && a && (this[i][o] = u.parse(a, l, this));
89
+ u != null && u.parse && a && (this[i][r] = u.parse(a, l, this));
90
90
  }
91
- for (const o of C)
92
- this[i][o] = (l) => {
93
- const a = o.replace(/^on/, "").toLowerCase();
91
+ for (const r of S)
92
+ this[i][r] = (l) => {
93
+ const a = r.replace(/^on/, "").toLowerCase();
94
94
  this.dispatchEvent(
95
- new CustomEvent(a, { detail: l, ...N[o] })
95
+ new CustomEvent(a, { detail: l, ...L[r] })
96
96
  );
97
97
  };
98
98
  }
99
99
  static get observedAttributes() {
100
- return Object.keys(_);
100
+ return Object.keys(O);
101
101
  }
102
102
  connectedCallback() {
103
- this[y] = !0, this[b]();
103
+ this[g] = !0, this[d]();
104
104
  }
105
105
  disconnectedCallback() {
106
- this[y] = !1, this[m] && n.unmount(this[m]), delete this[m];
106
+ this[g] = !1, this[m] && n.unmount(this[m]), delete this[m];
107
107
  }
108
- attributeChangedCallback(o, l, a) {
109
- const c = _[o], u = E[c], f = u ? O[u] : null;
110
- c in E && f != null && f.parse && a && (this[i][c] = f.parse(a, o, this), this[b]());
108
+ attributeChangedCallback(r, l, a) {
109
+ const c = O[r], u = b[c], f = u ? T[u] : null;
110
+ c in b && f != null && f.parse && a && (this[i][c] = f.parse(a, r, this), this[d]());
111
111
  }
112
- [(A = y, p = m, r = i, b)]() {
113
- this[y] && (this[m] ? n.update(this[m], this[i]) : this[m] = n.mount(
112
+ [(h = g, p = m, o = i, d)]() {
113
+ this[g] && (this[m] ? n.update(this[m], this[i]) : this[m] = n.mount(
114
114
  this.container,
115
115
  e,
116
116
  this[i]
117
117
  ));
118
118
  }
119
119
  }
120
- for (const s of d) {
121
- const o = g[s], l = E[s];
122
- Object.defineProperty(S.prototype, s, {
120
+ for (const s of E) {
121
+ const r = C[s], l = b[s];
122
+ Object.defineProperty(P.prototype, s, {
123
123
  enumerable: !0,
124
124
  configurable: !0,
125
125
  get() {
@@ -127,37 +127,50 @@ function z(e, t, n) {
127
127
  },
128
128
  set(a) {
129
129
  this[i][s] = a;
130
- const c = l ? O[l] : null;
130
+ const c = l ? T[l] : null;
131
131
  if (c != null && c.stringify) {
132
- const u = c.stringify(a, o, this);
133
- this.getAttribute(o) !== u && this.setAttribute(o, u);
132
+ const u = c.stringify(a, r, this);
133
+ this.getAttribute(r) !== u && this.setAttribute(r, u);
134
134
  } else
135
- this[b]();
135
+ this[d]();
136
136
  }
137
137
  });
138
138
  }
139
- return S;
139
+ return P;
140
140
  }
141
- function J(e, t, n) {
142
- const r = j(e), p = L.createElement(t, n);
143
- return r.render(p), {
144
- root: r,
145
- ReactComponent: t
146
- };
141
+ const _ = /* @__PURE__ */ new Map();
142
+ function X(e, t, n) {
143
+ const o = _.get(e);
144
+ if (o) {
145
+ o.tid !== null && clearTimeout(o.tid), o.tid = null;
146
+ const E = A.createElement(t, n);
147
+ return o.root.render(E), { root: o.root, ReactComponent: t };
148
+ }
149
+ const p = x(e);
150
+ _.set(e, { root: p, tid: null });
151
+ const h = A.createElement(t, n);
152
+ return p.render(h), { root: p, ReactComponent: t };
147
153
  }
148
- function X({ root: e, ReactComponent: t }, n) {
149
- const r = L.createElement(t, n);
150
- e.render(r);
154
+ function q({ root: e, ReactComponent: t }, n) {
155
+ const o = A.createElement(t, n);
156
+ e.render(o);
151
157
  }
152
- function q({ root: e }) {
158
+ function Z({ root: e }) {
159
+ for (const [t, n] of _)
160
+ if (n.root === e) {
161
+ n.tid = setTimeout(() => {
162
+ _.delete(t), e.unmount();
163
+ }, 0);
164
+ return;
165
+ }
153
166
  setTimeout(() => {
154
167
  e.unmount();
155
168
  }, 0);
156
169
  }
157
- function T(e, t = {}) {
158
- return z(e, t, { mount: J, update: X, unmount: q });
170
+ function N(e, t = {}) {
171
+ return J(e, t, { mount: X, update: q, unmount: Z });
159
172
  }
160
- const Z = T(I, {
173
+ const K = N(w, {
161
174
  shadow: "closed",
162
175
  props: {
163
176
  compositionUrl: "string",
@@ -192,48 +205,48 @@ const Z = T(I, {
192
205
  // Monitoring
193
206
  monitoring: "boolean"
194
207
  }
195
- }), K = T(w, {
208
+ }), Q = N(W, {
196
209
  shadow: "closed",
197
210
  props: {
198
211
  index: "number",
199
212
  thumbnailSrc: "string"
200
213
  }
201
- }), Q = T(W, {
214
+ }), ee = N(R, {
202
215
  shadow: "closed",
203
216
  props: {
204
217
  name: "string"
205
218
  }
206
219
  });
207
- function ee() {
208
- customElements.define(D, Z), customElements.define(
209
- V,
210
- K
211
- ), customElements.define(M, Q);
212
- }
213
220
  function te() {
214
- R() || ee();
221
+ customElements.define(V, K), customElements.define(
222
+ M,
223
+ Q
224
+ ), customElements.define(j, ee);
225
+ }
226
+ function ne() {
227
+ D() || te();
215
228
  }
216
- te();
229
+ ne();
217
230
  export {
218
- ce as ANALYTICS_EVENT_DISPLAY,
219
- le as ANALYTICS_EVENT_ERROR,
220
- ue as ANALYTICS_EVENT_INTERACTION,
221
- pe as ANALYTICS_EVENT_LOAD,
222
- fe as DEFAULT_EVENT_PREFIX,
223
- me as EVENT_COMPOSITION_LOADED,
224
- Ee as EVENT_COMPOSITION_LOADING,
225
- be as EVENT_COMPOSITION_LOAD_ERROR,
231
+ le as ANALYTICS_EVENT_DISPLAY,
232
+ ue as ANALYTICS_EVENT_ERROR,
233
+ pe as ANALYTICS_EVENT_INTERACTION,
234
+ fe as ANALYTICS_EVENT_LOAD,
235
+ me as DEFAULT_EVENT_PREFIX,
236
+ Ee as EVENT_COMPOSITION_LOADED,
237
+ be as EVENT_COMPOSITION_LOADING,
238
+ de as EVENT_COMPOSITION_LOAD_ERROR,
226
239
  he as EVENT_EXTEND_MODE_OFF,
227
240
  ye as EVENT_EXTEND_MODE_ON,
228
- de as EVENT_GALLERY_CLOSE,
229
- ge as EVENT_GALLERY_OPEN,
230
- _e as EVENT_HOTSPOTS_OFF,
241
+ ge as EVENT_GALLERY_CLOSE,
242
+ _e as EVENT_GALLERY_OPEN,
243
+ Ce as EVENT_HOTSPOTS_OFF,
231
244
  Oe as EVENT_HOTSPOTS_ON,
232
245
  Te as EVENT_ITEM_CHANGE,
233
- M as WEB_PLAYER_ICON_WC_TAG,
234
- D as WEB_PLAYER_WC_TAG,
246
+ j as WEB_PLAYER_ICON_WC_TAG,
247
+ V as WEB_PLAYER_WC_TAG,
235
248
  Ae as WebPlayer,
236
- Ce as WebPlayerCustomMedia,
237
- Ne as WebPlayerIcon,
238
- Se as generateCompositionUrl
249
+ Ne as WebPlayerCustomMedia,
250
+ Se as WebPlayerIcon,
251
+ Le as generateCompositionUrl
239
252
  };
package/dist/legacy.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-BUcu6Hvu.cjs");require("react/jsx-runtime");const P=require("react"),m=require("react-dom");var V=Object.defineProperty,D=(e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=(e,t,r)=>D(e,typeof t!="symbol"?t+"":t,r);const v={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},M={stringify:e=>e.name,parse:(e,t,r)=>{const s=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof s=="function"?s.bind(r):void 0}},w={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)};function Y(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,r,s)=>`${r}-${s.toLowerCase()}`)}function R(e){return e.replace(/[-:]([a-z])/g,(t,r)=>`${r.toUpperCase()}`)}const G={stringify:e=>e.name,parse:(e,t,r)=>{const s=(()=>{const T=R(t);if(typeof r<"u"&&T in r.container)return r.container[T]})();return typeof s=="function"?s.bind(r):void 0}},F={stringify:e=>`${e}`,parse:e=>parseFloat(e)},j={stringify:e=>e,parse:e=>e},d={string:j,number:F,boolean:v,function:M,method:G,json:w},b=Symbol.for("r2wc.render"),N=Symbol.for("r2wc.connected"),p=Symbol.for("r2wc.context"),a=Symbol.for("r2wc.props");function k(e,t,r){var s,T,g;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const y=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),L=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),O={},I={},A={},h={};for(const i of y){O[i]=Array.isArray(t.props)?"string":t.props[i];const o=Y(i);A[i]=o,h[o]=i}for(const i of L)I[i]=Array.isArray(t.events)?{}:t.events[i];class S extends HTMLElement{constructor(){super(),f(this,g,!0),f(this,T),f(this,s,{}),f(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[a].container=this.container;for(const o of y){const l=A[o],E=this.getAttribute(l),c=O[o],u=c?d[c]:null;if(c==="method"){const _=R(l);Object.defineProperty(this[a].container,_,{enumerable:!0,configurable:!0,get(){return this[a][_]},set(W){this[a][_]=W,this[b]()}}),this[a][o]=u.parse(E,l,this)}u!=null&&u.parse&&E&&(this[a][o]=u.parse(E,l,this))}for(const o of L)this[a][o]=l=>{const E=o.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(E,{detail:l,...I[o]}))}}static get observedAttributes(){return Object.keys(h)}connectedCallback(){this[N]=!0,this[b]()}disconnectedCallback(){this[N]=!1,this[p]&&r.unmount(this[p]),delete this[p]}attributeChangedCallback(o,l,E){const c=h[o],u=O[c],_=u?d[u]:null;c in O&&_!=null&&_.parse&&E&&(this[a][c]=_.parse(E,o,this),this[b]())}[(g=N,T=p,s=a,b)](){this[N]&&(this[p]?r.update(this[p],this[a]):this[p]=r.mount(this.container,e,this[a]))}}for(const i of y){const o=A[i],l=O[i];Object.defineProperty(S.prototype,i,{enumerable:!0,configurable:!0,get(){return this[a][i]},set(E){this[a][i]=E;const c=l?d[l]:null;if(c!=null&&c.stringify){const u=c.stringify(E,o,this);this.getAttribute(o)!==u&&this.setAttribute(o,u)}else this[b]()}})}return S}function B(e,t,r){const s=P.createElement(t,r);return m.render(s,e),{container:e,ReactComponent:t}}function $({container:e,ReactComponent:t},r){const s=P.createElement(t,r);m.render(s,e)}function x({container:e}){m.unmountComponentAtNode(e)}function C(e,t={}){return k(e,t,{mount:B,update:$,unmount:x})}const U=C(n.WebPlayerWithInjectedStyles,{shadow:"closed",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",themeConfig:"string",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",autoLoadInterior360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean",spinCursor:"string",analyticsEventPrefix:"string",analyticsUrl:"string",analyticsBearer:"string",analyticsSimpleRequestsOnly:"boolean",analyticsDryRun:"boolean",analyticsDebug:"boolean",monitoring:"boolean"}}),H=C(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),X=C(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function q(){customElements.define(n.WEB_PLAYER_WC_TAG,U),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,H),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,X)}function z(){n.checkCustomElementsDefinition()||q()}z();exports.ANALYTICS_EVENT_DISPLAY=n.ANALYTICS_EVENT_DISPLAY;exports.ANALYTICS_EVENT_ERROR=n.ANALYTICS_EVENT_ERROR;exports.ANALYTICS_EVENT_INTERACTION=n.ANALYTICS_EVENT_INTERACTION;exports.ANALYTICS_EVENT_LOAD=n.ANALYTICS_EVENT_LOAD;exports.DEFAULT_EVENT_PREFIX=n.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=n.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=n.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=n.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=n.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=n.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=n.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=n.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=n.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=n.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=n.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=n.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=n.WEB_PLAYER_WC_TAG;exports.WebPlayer=n.WebPlayer;exports.WebPlayerCustomMedia=n.WebPlayerCustomMedia$1;exports.WebPlayerIcon=n.WebPlayerIcon$1;exports.generateCompositionUrl=n.generateCompositionUrl;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./shared-CiiFL5oT.cjs");require("react/jsx-runtime");const P=require("react"),m=require("react-dom");var V=Object.defineProperty,D=(e,t,r)=>t in e?V(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,f=(e,t,r)=>D(e,typeof t!="symbol"?t+"":t,r);const v={stringify:e=>e?"true":"false",parse:e=>/^[ty1-9]/i.test(e)},M={stringify:e=>e.name,parse:(e,t,r)=>{const s=(()=>{if(typeof window<"u"&&e in window)return window[e];if(typeof global<"u"&&e in global)return global[e]})();return typeof s=="function"?s.bind(r):void 0}},w={stringify:e=>JSON.stringify(e),parse:e=>JSON.parse(e)};function Y(e){return e.replace(/([a-z0-9])([A-Z])/g,(t,r,s)=>`${r}-${s.toLowerCase()}`)}function R(e){return e.replace(/[-:]([a-z])/g,(t,r)=>`${r.toUpperCase()}`)}const G={stringify:e=>e.name,parse:(e,t,r)=>{const s=(()=>{const T=R(t);if(typeof r<"u"&&T in r.container)return r.container[T]})();return typeof s=="function"?s.bind(r):void 0}},F={stringify:e=>`${e}`,parse:e=>parseFloat(e)},j={stringify:e=>e,parse:e=>e},d={string:j,number:F,boolean:v,function:M,method:G,json:w},b=Symbol.for("r2wc.render"),N=Symbol.for("r2wc.connected"),p=Symbol.for("r2wc.context"),a=Symbol.for("r2wc.props");function k(e,t,r){var s,T,g;t.props||(t.props=e.propTypes?Object.keys(e.propTypes):[]),t.events||(t.events=[]);const y=Array.isArray(t.props)?t.props.slice():Object.keys(t.props),L=Array.isArray(t.events)?t.events.slice():Object.keys(t.events),O={},I={},A={},h={};for(const i of y){O[i]=Array.isArray(t.props)?"string":t.props[i];const o=Y(i);A[i]=o,h[o]=i}for(const i of L)I[i]=Array.isArray(t.events)?{}:t.events[i];class S extends HTMLElement{constructor(){super(),f(this,g,!0),f(this,T),f(this,s,{}),f(this,"container"),t.shadow?this.container=this.attachShadow({mode:t.shadow}):this.container=this,this[a].container=this.container;for(const o of y){const l=A[o],E=this.getAttribute(l),c=O[o],u=c?d[c]:null;if(c==="method"){const _=R(l);Object.defineProperty(this[a].container,_,{enumerable:!0,configurable:!0,get(){return this[a][_]},set(W){this[a][_]=W,this[b]()}}),this[a][o]=u.parse(E,l,this)}u!=null&&u.parse&&E&&(this[a][o]=u.parse(E,l,this))}for(const o of L)this[a][o]=l=>{const E=o.replace(/^on/,"").toLowerCase();this.dispatchEvent(new CustomEvent(E,{detail:l,...I[o]}))}}static get observedAttributes(){return Object.keys(h)}connectedCallback(){this[N]=!0,this[b]()}disconnectedCallback(){this[N]=!1,this[p]&&r.unmount(this[p]),delete this[p]}attributeChangedCallback(o,l,E){const c=h[o],u=O[c],_=u?d[u]:null;c in O&&_!=null&&_.parse&&E&&(this[a][c]=_.parse(E,o,this),this[b]())}[(g=N,T=p,s=a,b)](){this[N]&&(this[p]?r.update(this[p],this[a]):this[p]=r.mount(this.container,e,this[a]))}}for(const i of y){const o=A[i],l=O[i];Object.defineProperty(S.prototype,i,{enumerable:!0,configurable:!0,get(){return this[a][i]},set(E){this[a][i]=E;const c=l?d[l]:null;if(c!=null&&c.stringify){const u=c.stringify(E,o,this);this.getAttribute(o)!==u&&this.setAttribute(o,u)}else this[b]()}})}return S}function B(e,t,r){const s=P.createElement(t,r);return m.render(s,e),{container:e,ReactComponent:t}}function $({container:e,ReactComponent:t},r){const s=P.createElement(t,r);m.render(s,e)}function x({container:e}){m.unmountComponentAtNode(e)}function C(e,t={}){return k(e,t,{mount:B,update:$,unmount:x})}const U=C(n.WebPlayerWithInjectedStyles,{shadow:"closed",props:{compositionUrl:"string",hideCategoriesNav:"boolean",infiniteCarrousel:"boolean",permanentGallery:"boolean",themeConfig:"string",minMediaWidth:"number",maxMediaWidth:"number",mediaLoadStrategy:"string",preloadRange:"number",autoLoad360:"boolean",autoLoadInterior360:"boolean",categoriesFilter:"string",extendBehavior:"string",eventPrefix:"string",demoSpin:"boolean",reverse360:"boolean",spinCursor:"string",analyticsEventPrefix:"string",analyticsUrl:"string",analyticsBearer:"string",analyticsSimpleRequestsOnly:"boolean",analyticsDryRun:"boolean",analyticsDebug:"boolean",monitoring:"boolean"}}),H=C(n.WebPlayerCustomMedia,{shadow:"closed",props:{index:"number",thumbnailSrc:"string"}}),X=C(n.WebPlayerIcon,{shadow:"closed",props:{name:"string"}});function q(){customElements.define(n.WEB_PLAYER_WC_TAG,U),customElements.define(n.WEB_PLAYER_CUSTOM_MEDIA_WC_TAG,H),customElements.define(n.WEB_PLAYER_ICON_WC_TAG,X)}function z(){n.checkCustomElementsDefinition()||q()}z();exports.ANALYTICS_EVENT_DISPLAY=n.ANALYTICS_EVENT_DISPLAY;exports.ANALYTICS_EVENT_ERROR=n.ANALYTICS_EVENT_ERROR;exports.ANALYTICS_EVENT_INTERACTION=n.ANALYTICS_EVENT_INTERACTION;exports.ANALYTICS_EVENT_LOAD=n.ANALYTICS_EVENT_LOAD;exports.DEFAULT_EVENT_PREFIX=n.DEFAULT_EVENT_PREFIX;exports.EVENT_COMPOSITION_LOADED=n.EVENT_COMPOSITION_LOADED;exports.EVENT_COMPOSITION_LOADING=n.EVENT_COMPOSITION_LOADING;exports.EVENT_COMPOSITION_LOAD_ERROR=n.EVENT_COMPOSITION_LOAD_ERROR;exports.EVENT_EXTEND_MODE_OFF=n.EVENT_EXTEND_MODE_OFF;exports.EVENT_EXTEND_MODE_ON=n.EVENT_EXTEND_MODE_ON;exports.EVENT_GALLERY_CLOSE=n.EVENT_GALLERY_CLOSE;exports.EVENT_GALLERY_OPEN=n.EVENT_GALLERY_OPEN;exports.EVENT_HOTSPOTS_OFF=n.EVENT_HOTSPOTS_OFF;exports.EVENT_HOTSPOTS_ON=n.EVENT_HOTSPOTS_ON;exports.EVENT_ITEM_CHANGE=n.EVENT_ITEM_CHANGE;exports.WEB_PLAYER_ICON_WC_TAG=n.WEB_PLAYER_ICON_WC_TAG;exports.WEB_PLAYER_WC_TAG=n.WEB_PLAYER_WC_TAG;exports.WebPlayer=n.WebPlayer;exports.WebPlayerCustomMedia=n.WebPlayerCustomMedia$1;exports.WebPlayerIcon=n.WebPlayerIcon$1;exports.generateCompositionUrl=n.generateCompositionUrl;
package/dist/legacy.js CHANGED
@@ -1,5 +1,5 @@
1
- import { W, a as w, b as R, c as D, d as V, e as M, f as j } from "./shared-4nfP-R6L.js";
2
- import { A as ce, g as le, h as ue, i as pe, D as fe, E as me, j as Ee, k as be, l as he, m as de, n as ye, o as ge, p as _e, q as Ae, r as Ce, s as Oe, t as Te, u as Ne, v as Se } from "./shared-4nfP-R6L.js";
1
+ import { W, a as w, b as R, c as D, d as V, e as M, f as j } from "./shared-zi1amD4C.js";
2
+ import { A as ce, g as le, h as ue, i as pe, D as fe, E as me, j as Ee, k as be, l as he, m as de, n as ye, o as ge, p as _e, q as Ae, r as Ce, s as Oe, t as Te, u as Ne, v as Se } from "./shared-zi1amD4C.js";
3
3
  import "react/jsx-runtime";
4
4
  import P from "react";
5
5
  import C from "react-dom";