demoway-sdk
Advanced tools
Comparing version 0.0.2 to 0.1.0
342
dist/sdk.js
@@ -1,48 +0,48 @@ | ||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".demo-dialog-overlay.svelte-170r52r{position:fixed;width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;top:0;left:0;background-color:#ffffffb3}.demo-dialog-container.svelte-170r52r{width:80%;height:80%;overflow:visible;position:relative}.demo-dialog-content.svelte-170r52r{border:none}.demo-dialog-close.svelte-170r52r{position:absolute;width:30px;height:30px;border-radius:50%;top:0;right:0;transform:translate(50%,-50%);border:none;cursor:pointer;background-color:#333}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})(); | ||
var B = Object.defineProperty; | ||
var F = (e, t, n) => t in e ? B(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; | ||
var O = (e, t, n) => (F(e, typeof t != "symbol" ? t + "" : t, n), n); | ||
let T = null; | ||
function M(e) { | ||
T = e; | ||
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".demo-dialog-overlay.svelte-170r52r{position:fixed;width:100vw;height:100vh;display:flex;align-items:center;justify-content:center;top:0;left:0;background-color:#ffffffb3}.demo-dialog-container.svelte-170r52r{width:80%;height:80%;overflow:visible;position:relative}.demo-dialog-content.svelte-170r52r{border:none}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})(); | ||
var P = Object.defineProperty; | ||
var B = (e, t, n) => t in e ? P(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n; | ||
var C = (e, t, n) => (B(e, typeof t != "symbol" ? t + "" : t, n), n); | ||
let I = null; | ||
function F(e) { | ||
I = e; | ||
} | ||
function U() { | ||
if (!T) | ||
function M() { | ||
if (!I) | ||
throw new Error("sdk is not initialized"); | ||
return T; | ||
return I; | ||
} | ||
function p() { | ||
function g() { | ||
} | ||
function L(e) { | ||
function q(e) { | ||
return e(); | ||
} | ||
function A() { | ||
function O() { | ||
return /* @__PURE__ */ Object.create(null); | ||
} | ||
function $(e) { | ||
e.forEach(L); | ||
function b(e) { | ||
e.forEach(q); | ||
} | ||
function z(e) { | ||
function S(e) { | ||
return typeof e == "function"; | ||
} | ||
function G(e, t) { | ||
function U(e, t) { | ||
return e != e ? t == t : e !== t || e && typeof e == "object" || typeof e == "function"; | ||
} | ||
let v; | ||
function N(e, t) { | ||
function A(e, t) { | ||
return v || (v = document.createElement("a")), v.href = t, e === v.href; | ||
} | ||
function H(e) { | ||
function G(e) { | ||
return Object.keys(e).length === 0; | ||
} | ||
function J(e) { | ||
return e && z(e.destroy) ? e.destroy : p; | ||
function H(e) { | ||
return e && S(e.destroy) ? e.destroy : g; | ||
} | ||
function w(e, t) { | ||
function j(e, t) { | ||
e.appendChild(t); | ||
} | ||
function K(e, t, n) { | ||
function J(e, t, n) { | ||
e.insertBefore(t, n || null); | ||
} | ||
function P(e) { | ||
function L(e) { | ||
e.parentNode && e.parentNode.removeChild(e); | ||
@@ -53,38 +53,32 @@ } | ||
} | ||
function Q(e) { | ||
return document.createTextNode(e); | ||
} | ||
function V() { | ||
return Q(" "); | ||
} | ||
function j(e, t, n, o) { | ||
function K(e, t, n, o) { | ||
return e.addEventListener(t, n, o), () => e.removeEventListener(t, n, o); | ||
} | ||
function l(e, t, n) { | ||
function f(e, t, n) { | ||
n == null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n); | ||
} | ||
function W(e) { | ||
function Q(e) { | ||
return Array.from(e.childNodes); | ||
} | ||
function X(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) { | ||
const c = document.createEvent("CustomEvent"); | ||
return c.initCustomEvent(e, n, o, t), c; | ||
function V(e, t, { bubbles: n = !1, cancelable: o = !1 } = {}) { | ||
const r = document.createEvent("CustomEvent"); | ||
return r.initCustomEvent(e, n, o, t), r; | ||
} | ||
let b; | ||
let $; | ||
function y(e) { | ||
b = e; | ||
$ = e; | ||
} | ||
function Y() { | ||
if (!b) | ||
function W() { | ||
if (!$) | ||
throw new Error("Function called outside component initialization"); | ||
return b; | ||
return $; | ||
} | ||
function Z() { | ||
const e = Y(); | ||
function X() { | ||
const e = W(); | ||
return (t, n, { cancelable: o = !1 } = {}) => { | ||
const c = e.$$.callbacks[t]; | ||
if (c) { | ||
const i = X(t, n, { cancelable: o }); | ||
return c.slice().forEach((s) => { | ||
s.call(e, i); | ||
const r = e.$$.callbacks[t]; | ||
if (r) { | ||
const i = V(t, n, { cancelable: o }); | ||
return r.slice().forEach((c) => { | ||
c.call(e, i); | ||
}), !i.defaultPrevented; | ||
@@ -95,72 +89,72 @@ } | ||
} | ||
const _ = [], R = []; | ||
let g = []; | ||
const q = [], ee = /* @__PURE__ */ Promise.resolve(); | ||
let D = !1; | ||
function te() { | ||
D || (D = !0, ee.then(x)); | ||
const m = [], N = []; | ||
let _ = []; | ||
const R = [], Y = /* @__PURE__ */ Promise.resolve(); | ||
let T = !1; | ||
function Z() { | ||
T || (T = !0, Y.then(w)); | ||
} | ||
function S(e) { | ||
g.push(e); | ||
function D(e) { | ||
_.push(e); | ||
} | ||
const I = /* @__PURE__ */ new Set(); | ||
let m = 0; | ||
function x() { | ||
if (m !== 0) | ||
const x = /* @__PURE__ */ new Set(); | ||
let h = 0; | ||
function w() { | ||
if (h !== 0) | ||
return; | ||
const e = b; | ||
const e = $; | ||
do { | ||
try { | ||
for (; m < _.length; ) { | ||
const t = _[m]; | ||
m++, y(t), ne(t.$$); | ||
for (; h < m.length; ) { | ||
const t = m[h]; | ||
h++, y(t), ee(t.$$); | ||
} | ||
} catch (t) { | ||
throw _.length = 0, m = 0, t; | ||
throw m.length = 0, h = 0, t; | ||
} | ||
for (y(null), _.length = 0, m = 0; R.length; ) | ||
R.pop()(); | ||
for (let t = 0; t < g.length; t += 1) { | ||
const n = g[t]; | ||
I.has(n) || (I.add(n), n()); | ||
for (y(null), m.length = 0, h = 0; N.length; ) | ||
N.pop()(); | ||
for (let t = 0; t < _.length; t += 1) { | ||
const n = _[t]; | ||
x.has(n) || (x.add(n), n()); | ||
} | ||
g.length = 0; | ||
} while (_.length); | ||
for (; q.length; ) | ||
q.pop()(); | ||
D = !1, I.clear(), y(e); | ||
_.length = 0; | ||
} while (m.length); | ||
for (; R.length; ) | ||
R.pop()(); | ||
T = !1, x.clear(), y(e); | ||
} | ||
function ne(e) { | ||
function ee(e) { | ||
if (e.fragment !== null) { | ||
e.update(), $(e.before_update); | ||
e.update(), b(e.before_update); | ||
const t = e.dirty; | ||
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(S); | ||
e.dirty = [-1], e.fragment && e.fragment.p(e.ctx, t), e.after_update.forEach(D); | ||
} | ||
} | ||
function oe(e) { | ||
function te(e) { | ||
const t = [], n = []; | ||
g.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), g = t; | ||
_.forEach((o) => e.indexOf(o) === -1 ? t.push(o) : n.push(o)), n.forEach((o) => o()), _ = t; | ||
} | ||
const re = /* @__PURE__ */ new Set(); | ||
function ce(e, t) { | ||
e && e.i && (re.delete(e), e.i(t)); | ||
const ne = /* @__PURE__ */ new Set(); | ||
function oe(e, t) { | ||
e && e.i && (ne.delete(e), e.i(t)); | ||
} | ||
function se(e, t, n, o) { | ||
const { fragment: c, after_update: i } = e.$$; | ||
c && c.m(t, n), o || S(() => { | ||
const s = e.$$.on_mount.map(L).filter(z); | ||
e.$$.on_destroy ? e.$$.on_destroy.push(...s) : $(s), e.$$.on_mount = []; | ||
}), i.forEach(S); | ||
function re(e, t, n, o) { | ||
const { fragment: r, after_update: i } = e.$$; | ||
r && r.m(t, n), o || D(() => { | ||
const c = e.$$.on_mount.map(q).filter(S); | ||
e.$$.on_destroy ? e.$$.on_destroy.push(...c) : b(c), e.$$.on_mount = []; | ||
}), i.forEach(D); | ||
} | ||
function ie(e, t) { | ||
function se(e, t) { | ||
const n = e.$$; | ||
n.fragment !== null && (oe(n.after_update), $(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []); | ||
n.fragment !== null && (te(n.after_update), b(n.on_destroy), n.fragment && n.fragment.d(t), n.on_destroy = n.fragment = null, n.ctx = []); | ||
} | ||
function le(e, t) { | ||
e.$$.dirty[0] === -1 && (_.push(e), te(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31; | ||
function ce(e, t) { | ||
e.$$.dirty[0] === -1 && (m.push(e), Z(), e.$$.dirty.fill(0)), e.$$.dirty[t / 31 | 0] |= 1 << t % 31; | ||
} | ||
function ue(e, t, n, o, c, i, s, h = [-1]) { | ||
const a = b; | ||
function ie(e, t, n, o, r, i, c, l = [-1]) { | ||
const u = $; | ||
y(e); | ||
const r = e.$$ = { | ||
const s = e.$$ = { | ||
fragment: null, | ||
@@ -170,5 +164,5 @@ ctx: [], | ||
props: i, | ||
update: p, | ||
not_equal: c, | ||
bound: A(), | ||
update: g, | ||
not_equal: r, | ||
bound: O(), | ||
// lifecycle | ||
@@ -180,42 +174,42 @@ on_mount: [], | ||
after_update: [], | ||
context: new Map(t.context || (a ? a.$$.context : [])), | ||
context: new Map(t.context || (u ? u.$$.context : [])), | ||
// everything else | ||
callbacks: A(), | ||
dirty: h, | ||
callbacks: O(), | ||
dirty: l, | ||
skip_bound: !1, | ||
root: t.target || a.$$.root | ||
root: t.target || u.$$.root | ||
}; | ||
s && s(r.root); | ||
let u = !1; | ||
if (r.ctx = n ? n(e, t.props || {}, (f, k, ...d) => { | ||
const C = d.length ? d[0] : k; | ||
return r.ctx && c(r.ctx[f], r.ctx[f] = C) && (!r.skip_bound && r.bound[f] && r.bound[f](C), u && le(e, f)), k; | ||
}) : [], r.update(), u = !0, $(r.before_update), r.fragment = o ? o(r.ctx) : !1, t.target) { | ||
c && c(s.root); | ||
let p = !1; | ||
if (s.ctx = n ? n(e, t.props || {}, (a, k, ...d) => { | ||
const z = d.length ? d[0] : k; | ||
return s.ctx && r(s.ctx[a], s.ctx[a] = z) && (!s.skip_bound && s.bound[a] && s.bound[a](z), p && ce(e, a)), k; | ||
}) : [], s.update(), p = !0, b(s.before_update), s.fragment = o ? o(s.ctx) : !1, t.target) { | ||
if (t.hydrate) { | ||
const f = W(t.target); | ||
r.fragment && r.fragment.l(f), f.forEach(P); | ||
const a = Q(t.target); | ||
s.fragment && s.fragment.l(a), a.forEach(L); | ||
} else | ||
r.fragment && r.fragment.c(); | ||
t.intro && ce(e.$$.fragment), se(e, t.target, t.anchor, t.customElement), x(); | ||
s.fragment && s.fragment.c(); | ||
t.intro && oe(e.$$.fragment), re(e, t.target, t.anchor, t.customElement), w(); | ||
} | ||
y(a); | ||
y(u); | ||
} | ||
class ae { | ||
class le { | ||
$destroy() { | ||
ie(this, 1), this.$destroy = p; | ||
se(this, 1), this.$destroy = g; | ||
} | ||
$on(t, n) { | ||
if (!z(n)) | ||
return p; | ||
if (!S(n)) | ||
return g; | ||
const o = this.$$.callbacks[t] || (this.$$.callbacks[t] = []); | ||
return o.push(n), () => { | ||
const c = o.indexOf(n); | ||
c !== -1 && o.splice(c, 1); | ||
const r = o.indexOf(n); | ||
r !== -1 && o.splice(r, 1); | ||
}; | ||
} | ||
$set(t) { | ||
this.$$set && !H(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1); | ||
this.$$set && !G(t) && (this.$$.skip_bound = !0, this.$$set(t), this.$$.skip_bound = !1); | ||
} | ||
} | ||
const fe = (e, t) => { | ||
const ue = (e, t) => { | ||
const n = new ResizeObserver(() => { | ||
@@ -230,8 +224,8 @@ const o = e.getBoundingClientRect(); | ||
}; | ||
}, de = "https://demoway.co"; | ||
function he(e) { | ||
let t, n, o, c, i, s, h, a; | ||
}, fe = "https://demoway.co"; | ||
function ae(e) { | ||
let t, n, o, r, i, c; | ||
return { | ||
c() { | ||
t = E("div"), n = E("div"), o = E("iframe"), i = V(), s = E("button"), l(o, "class", "demo-dialog-content svelte-170r52r"), l( | ||
t = E("div"), n = E("div"), o = E("iframe"), f(o, "class", "demo-dialog-content svelte-170r52r"), f( | ||
o, | ||
@@ -241,3 +235,3 @@ "width", | ||
e[1] | ||
), l( | ||
), f( | ||
o, | ||
@@ -247,14 +241,8 @@ "height", | ||
e[2] | ||
), l(o, "title", "demo"), N(o.src, c = /*src*/ | ||
e[0]) || l(o, "src", c), o.allowFullscreen = !0, l(o, "allowtransparency", "true"), l(s, "class", "demo-dialog-close svelte-170r52r"), l(n, "class", "demo-dialog-container svelte-170r52r"), l(t, "class", "demo-dialog-overlay svelte-170r52r"), l(t, "role", "button"); | ||
), f(o, "title", "demo"), A(o.src, r = /*src*/ | ||
e[0]) || f(o, "src", r), o.allowFullscreen = !0, f(o, "allowtransparency", "true"), f(n, "class", "demo-dialog-container svelte-170r52r"), f(t, "class", "demo-dialog-overlay svelte-170r52r"), f(t, "role", "button"); | ||
}, | ||
m(r, u) { | ||
K(r, t, u), w(t, n), w(n, o), w(n, i), w(n, s), h || (a = [ | ||
j( | ||
s, | ||
"click", | ||
/*onClose*/ | ||
e[4] | ||
), | ||
J(fe.call( | ||
m(l, u) { | ||
J(l, t, u), j(t, n), j(n, o), i || (c = [ | ||
H(ue.call( | ||
null, | ||
@@ -265,3 +253,3 @@ n, | ||
)), | ||
j( | ||
K( | ||
t, | ||
@@ -272,36 +260,36 @@ "click", | ||
) | ||
], h = !0); | ||
], i = !0); | ||
}, | ||
p(r, [u]) { | ||
p(l, [u]) { | ||
u & /*width*/ | ||
2 && l( | ||
2 && f( | ||
o, | ||
"width", | ||
/*width*/ | ||
r[1] | ||
l[1] | ||
), u & /*height*/ | ||
4 && l( | ||
4 && f( | ||
o, | ||
"height", | ||
/*height*/ | ||
r[2] | ||
l[2] | ||
), u & /*src*/ | ||
1 && !N(o.src, c = /*src*/ | ||
r[0]) && l(o, "src", c); | ||
1 && !A(o.src, r = /*src*/ | ||
l[0]) && f(o, "src", r); | ||
}, | ||
i: p, | ||
o: p, | ||
d(r) { | ||
r && P(t), h = !1, $(a); | ||
i: g, | ||
o: g, | ||
d(l) { | ||
l && L(t), i = !1, b(c); | ||
} | ||
}; | ||
} | ||
function me(e, t, n) { | ||
const o = Z(); | ||
let { demoId: c = "" } = t, { accessToken: i = "" } = t; | ||
const s = new URLSearchParams(); | ||
s.set("browser", String(!0)), s.set("scale", String(100)); | ||
let h = "", a = "", r = 0, u = 0; | ||
function f(d) { | ||
n(1, r = d.width), n(2, u = d.height); | ||
function de(e, t, n) { | ||
const o = X(); | ||
let { demoId: r = "" } = t, { accessToken: i = "" } = t; | ||
const c = new URLSearchParams(); | ||
c.set("browser", String(!0)), c.set("scale", String(100)); | ||
let l = "", u = "", s = 0, p = 0; | ||
function a(d) { | ||
n(1, s = d.width), n(2, p = d.height); | ||
} | ||
@@ -312,12 +300,12 @@ function k() { | ||
return e.$$set = (d) => { | ||
"demoId" in d && n(5, c = d.demoId), "accessToken" in d && n(6, i = d.accessToken); | ||
"demoId" in d && n(5, r = d.demoId), "accessToken" in d && n(6, i = d.accessToken); | ||
}, e.$$.update = () => { | ||
e.$$.dirty & /*accessToken*/ | ||
64 && (s.set("access_token", i), n(7, h = s.toString())), e.$$.dirty & /*demoId, queryString*/ | ||
160 && n(0, a = `${de}/demo/${c}?${h}`); | ||
}, [a, r, u, f, k, c, i, h]; | ||
64 && (c.set("access_token", i), n(7, l = c.toString())), e.$$.dirty & /*demoId, queryString*/ | ||
160 && n(0, u = `${fe}/demo/${r}?${l}`); | ||
}, [u, s, p, a, k, r, i, l]; | ||
} | ||
class _e extends ae { | ||
class he extends le { | ||
constructor(t) { | ||
super(), ue(this, t, me, he, G, { demoId: 5, accessToken: 6 }); | ||
super(), ie(this, t, de, ae, U, { demoId: 5, accessToken: 6 }); | ||
} | ||
@@ -328,3 +316,3 @@ get demoId() { | ||
set demoId(t) { | ||
this.$$set({ demoId: t }), x(); | ||
this.$$set({ demoId: t }), w(); | ||
} | ||
@@ -335,13 +323,13 @@ get accessToken() { | ||
set accessToken(t) { | ||
this.$$set({ accessToken: t }), x(); | ||
this.$$set({ accessToken: t }), w(); | ||
} | ||
} | ||
class ge { | ||
class me { | ||
constructor(t) { | ||
O(this, "component"); | ||
this.component = new _e({ | ||
C(this, "component"); | ||
this.component = new he({ | ||
target: document.body, | ||
props: { | ||
demoId: t, | ||
accessToken: U() | ||
accessToken: M() | ||
} | ||
@@ -365,11 +353,11 @@ }), this.component.$on("close", () => { | ||
} | ||
function ye(e) { | ||
return new ge(e); | ||
function ge(e) { | ||
return new me(e); | ||
} | ||
function be({ accessToken: e }) { | ||
M(e); | ||
function pe({ accessToken: e }) { | ||
F(e); | ||
} | ||
export { | ||
be as initialize, | ||
ye as openDemoDialog | ||
pe as initialize, | ||
ge as openDemoDialog | ||
}; |
{ | ||
"name": "demoway-sdk", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
22693
416