@bluepic/embed 0.1.135 → 0.1.137

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.
@@ -8336,7 +8336,7 @@ var util$4 = {}, types$2 = {}, shams$1 = function() {
8336
8336
  return !0;
8337
8337
  }, hasSymbols$2 = shams$1, shams = function() {
8338
8338
  return hasSymbols$2() && !!Symbol.toStringTag;
8339
- }, esObjectAtoms = Object, esErrors = Error, _eval = EvalError, range$1 = RangeError, ref = ReferenceError, syntax = SyntaxError, type = TypeError, uri = URIError, abs$1 = Math.abs, floor$1 = Math.floor, max$2 = Math.max, min$2 = Math.min, pow$1 = Math.pow, round$2 = Math.round, _isNaN = Number.isNaN || function(c) {
8339
+ }, esObjectAtoms = Object, esErrors = Error, _eval = EvalError, range$1 = RangeError, ref = ReferenceError, syntax = SyntaxError, type = TypeError, uri = URIError, abs$1 = Math.abs, floor$1 = Math.floor, max$3 = Math.max, min$2 = Math.min, pow$1 = Math.pow, round$2 = Math.round, _isNaN = Number.isNaN || function(c) {
8340
8340
  return c !== c;
8341
8341
  }, $isNaN = _isNaN, sign$2 = function(c) {
8342
8342
  return $isNaN(c) || c === 0 ? c : c < 0 ? -1 : 1;
@@ -8376,69 +8376,49 @@ function requireObject_getPrototypeOf() {
8376
8376
  var m = esObjectAtoms;
8377
8377
  return Object_getPrototypeOf = m.getPrototypeOf || null, Object_getPrototypeOf;
8378
8378
  }
8379
- var implementation, hasRequiredImplementation;
8380
- function requireImplementation() {
8381
- if (hasRequiredImplementation)
8382
- return implementation;
8383
- hasRequiredImplementation = 1;
8384
- var m = "Function.prototype.bind called on incompatible ", c = Object.prototype.toString, ie = Math.max, we = "[object Function]", $e = function(rr, gr) {
8385
- for (var or = [], _r = 0; _r < rr.length; _r += 1)
8386
- or[_r] = rr[_r];
8387
- for (var Lr = 0; Lr < gr.length; Lr += 1)
8388
- or[Lr + rr.length] = gr[Lr];
8389
- return or;
8390
- }, Me = function(rr, gr) {
8391
- for (var or = [], _r = gr || 0, Lr = 0; _r < rr.length; _r += 1, Lr += 1)
8392
- or[Lr] = rr[_r];
8393
- return or;
8394
- }, Ze = function(ne, rr) {
8395
- for (var gr = "", or = 0; or < ne.length; or += 1)
8396
- gr += ne[or], or + 1 < ne.length && (gr += rr);
8397
- return gr;
8398
- };
8399
- return implementation = function(rr) {
8400
- var gr = this;
8401
- if (typeof gr != "function" || c.apply(gr) !== we)
8402
- throw new TypeError(m + gr);
8403
- for (var or = Me(arguments, 1), _r, Lr = function() {
8404
- if (this instanceof _r) {
8405
- var Yr = gr.apply(
8406
- this,
8407
- $e(or, arguments)
8408
- );
8409
- return Object(Yr) === Yr ? Yr : this;
8410
- }
8411
- return gr.apply(
8412
- rr,
8413
- $e(or, arguments)
8379
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", toStr$4 = Object.prototype.toString, max$2 = Math.max, funcType = "[object Function]", concatty = function(c, ie) {
8380
+ for (var we = [], $e = 0; $e < c.length; $e += 1)
8381
+ we[$e] = c[$e];
8382
+ for (var Me = 0; Me < ie.length; Me += 1)
8383
+ we[Me + c.length] = ie[Me];
8384
+ return we;
8385
+ }, slicy = function(c, ie) {
8386
+ for (var we = [], $e = ie || 0, Me = 0; $e < c.length; $e += 1, Me += 1)
8387
+ we[Me] = c[$e];
8388
+ return we;
8389
+ }, joiny = function(m, c) {
8390
+ for (var ie = "", we = 0; we < m.length; we += 1)
8391
+ ie += m[we], we + 1 < m.length && (ie += c);
8392
+ return ie;
8393
+ }, implementation$1 = function(c) {
8394
+ var ie = this;
8395
+ if (typeof ie != "function" || toStr$4.apply(ie) !== funcType)
8396
+ throw new TypeError(ERROR_MESSAGE + ie);
8397
+ for (var we = slicy(arguments, 1), $e, Me = function() {
8398
+ if (this instanceof $e) {
8399
+ var or = ie.apply(
8400
+ this,
8401
+ concatty(we, arguments)
8414
8402
  );
8415
- }, Ir = ie(0, gr.length - or.length), Ar = [], Rr = 0; Rr < Ir; Rr++)
8416
- Ar[Rr] = "$" + Rr;
8417
- if (_r = Function("binder", "return function (" + Ze(Ar, ",") + "){ return binder.apply(this,arguments); }")(Lr), gr.prototype) {
8418
- var Fr = function() {
8419
- };
8420
- Fr.prototype = gr.prototype, _r.prototype = new Fr(), Fr.prototype = null;
8403
+ return Object(or) === or ? or : this;
8421
8404
  }
8422
- return _r;
8423
- }, implementation;
8424
- }
8425
- var functionBind, hasRequiredFunctionBind;
8426
- function requireFunctionBind() {
8427
- if (hasRequiredFunctionBind)
8428
- return functionBind;
8429
- hasRequiredFunctionBind = 1;
8430
- var m = requireImplementation();
8431
- return functionBind = Function.prototype.bind || m, functionBind;
8432
- }
8433
- var functionCall, hasRequiredFunctionCall;
8434
- function requireFunctionCall() {
8435
- return hasRequiredFunctionCall || (hasRequiredFunctionCall = 1, functionCall = Function.prototype.call), functionCall;
8436
- }
8437
- var functionApply, hasRequiredFunctionApply;
8405
+ return ie.apply(
8406
+ c,
8407
+ concatty(we, arguments)
8408
+ );
8409
+ }, Ze = max$2(0, ie.length - we.length), ne = [], rr = 0; rr < Ze; rr++)
8410
+ ne[rr] = "$" + rr;
8411
+ if ($e = Function("binder", "return function (" + joiny(ne, ",") + "){ return binder.apply(this,arguments); }")(Me), ie.prototype) {
8412
+ var gr = function() {
8413
+ };
8414
+ gr.prototype = ie.prototype, $e.prototype = new gr(), gr.prototype = null;
8415
+ }
8416
+ return $e;
8417
+ }, implementation = implementation$1, functionBind = Function.prototype.bind || implementation, functionCall = Function.prototype.call, functionApply, hasRequiredFunctionApply;
8438
8418
  function requireFunctionApply() {
8439
8419
  return hasRequiredFunctionApply || (hasRequiredFunctionApply = 1, functionApply = Function.prototype.apply), functionApply;
8440
8420
  }
8441
- var reflectApply$1 = typeof Reflect < "u" && Reflect && Reflect.apply, bind$3 = requireFunctionBind(), $apply$2 = requireFunctionApply(), $call$2 = requireFunctionCall(), $reflectApply = reflectApply$1, actualApply$1 = $reflectApply || bind$3.call($call$2, $apply$2), bind$2 = requireFunctionBind(), $TypeError$8 = type, $call$1 = requireFunctionCall(), $actualApply = actualApply$1, callBindApplyHelpers = function(c) {
8421
+ var reflectApply$1 = typeof Reflect < "u" && Reflect && Reflect.apply, bind$3 = functionBind, $apply$2 = requireFunctionApply(), $call$2 = functionCall, $reflectApply = reflectApply$1, actualApply$1 = $reflectApply || bind$3.call($call$2, $apply$2), bind$2 = functionBind, $TypeError$8 = type, $call$1 = functionCall, $actualApply = actualApply$1, callBindApplyHelpers = function(c) {
8442
8422
  if (c.length < 1 || typeof c[0] != "function")
8443
8423
  throw new $TypeError$8("a function is required");
8444
8424
  return $actualApply(bind$2, $call$1, c);
@@ -8480,10 +8460,10 @@ function requireHasown() {
8480
8460
  if (hasRequiredHasown)
8481
8461
  return hasown;
8482
8462
  hasRequiredHasown = 1;
8483
- var m = Function.prototype.call, c = Object.prototype.hasOwnProperty, ie = requireFunctionBind();
8463
+ var m = Function.prototype.call, c = Object.prototype.hasOwnProperty, ie = functionBind;
8484
8464
  return hasown = ie.call(m, c), hasown;
8485
8465
  }
8486
- var undefined$1, $Object = esObjectAtoms, $Error = esErrors, $EvalError = _eval, $RangeError = range$1, $ReferenceError = ref, $SyntaxError$1 = syntax, $TypeError$7 = type, $URIError = uri, abs = abs$1, floor = floor$1, max$1 = max$2, min$1 = min$2, pow = pow$1, round$1 = round$2, sign$1 = sign$2, $Function = Function, getEvalledConstructor = function(m) {
8466
+ var undefined$1, $Object = esObjectAtoms, $Error = esErrors, $EvalError = _eval, $RangeError = range$1, $ReferenceError = ref, $SyntaxError$1 = syntax, $TypeError$7 = type, $URIError = uri, abs = abs$1, floor = floor$1, max$1 = max$3, min$1 = min$2, pow = pow$1, round$1 = round$2, sign$1 = sign$2, $Function = Function, getEvalledConstructor = function(m) {
8487
8467
  try {
8488
8468
  return $Function('"use strict"; return (' + m + ").constructor;")();
8489
8469
  } catch {
@@ -8500,7 +8480,7 @@ var undefined$1, $Object = esObjectAtoms, $Error = esErrors, $EvalError = _eval,
8500
8480
  return throwTypeError;
8501
8481
  }
8502
8482
  }
8503
- }() : throwTypeError, hasSymbols = requireHasSymbols()(), getProto$1 = requireGetProto(), $ObjectGPO = requireObject_getPrototypeOf(), $ReflectGPO = requireReflect_getPrototypeOf(), $apply$1 = requireFunctionApply(), $call = requireFunctionCall(), needsEval = {}, TypedArray = typeof Uint8Array > "u" || !getProto$1 ? undefined$1 : getProto$1(Uint8Array), INTRINSICS = {
8483
+ }() : throwTypeError, hasSymbols = requireHasSymbols()(), getProto$1 = requireGetProto(), $ObjectGPO = requireObject_getPrototypeOf(), $ReflectGPO = requireReflect_getPrototypeOf(), $apply$1 = requireFunctionApply(), $call = functionCall, needsEval = {}, TypedArray = typeof Uint8Array > "u" || !getProto$1 ? undefined$1 : getProto$1(Uint8Array), INTRINSICS = {
8504
8484
  __proto__: null,
8505
8485
  "%AggregateError%": typeof AggregateError > "u" ? undefined$1 : AggregateError,
8506
8486
  "%Array%": Array,
@@ -8658,7 +8638,7 @@ var doEval = function m(c) {
8658
8638
  "%URIErrorPrototype%": ["URIError", "prototype"],
8659
8639
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
8660
8640
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
8661
- }, bind$1 = requireFunctionBind(), hasOwn$2 = requireHasown(), $concat$1 = bind$1.call($call, Array.prototype.concat), $spliceApply = bind$1.call($apply$1, Array.prototype.splice), $replace$1 = bind$1.call($call, String.prototype.replace), $strSlice = bind$1.call($call, String.prototype.slice), $exec$2 = bind$1.call($call, RegExp.prototype.exec), rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, reEscapeChar = /\\(\\)?/g, stringToPath = function(c) {
8641
+ }, bind$1 = functionBind, hasOwn$2 = requireHasown(), $concat$1 = bind$1.call($call, Array.prototype.concat), $spliceApply = bind$1.call($apply$1, Array.prototype.splice), $replace$1 = bind$1.call($call, String.prototype.replace), $strSlice = bind$1.call($call, String.prototype.slice), $exec$2 = bind$1.call($call, RegExp.prototype.exec), rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, reEscapeChar = /\\(\\)?/g, stringToPath = function(c) {
8662
8642
  var ie = $strSlice(c, 0, 1), we = $strSlice(c, -1);
8663
8643
  if (ie === "%" && we !== "%")
8664
8644
  throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");
@@ -8921,7 +8901,7 @@ var hasPropertyDescriptors_1 = hasPropertyDescriptors, GetIntrinsic$2 = getIntri
8921
8901
  Ze && !Ze.configurable && ($e = !1), Ze && !Ze.writable && (Me = !1);
8922
8902
  }
8923
8903
  return ($e || Me || !we) && (hasDescriptors ? define(c, "length", ie, !0, !0) : define(c, "length", ie)), c;
8924
- }, bind = requireFunctionBind(), $apply = requireFunctionApply(), actualApply = actualApply$1, applyBind = function() {
8904
+ }, bind = functionBind, $apply = requireFunctionApply(), actualApply = actualApply$1, applyBind = function() {
8925
8905
  return actualApply(bind, $apply, arguments);
8926
8906
  };
8927
8907
  (function(m) {
@@ -96061,27 +96041,42 @@ async function rasterize(m) {
96061
96041
  async function applyColorMatrix(m, c) {
96062
96042
  return m;
96063
96043
  }
96064
- async function renderRemote(m, c, ie, we, $e, Me, Ze, ne, rr, gr, or) {
96065
- const _r = `https://embed-api-v2.bluepic.workers.dev/api/export/${c}?${new URLSearchParams({
96044
+ async function renderRemote(m, c, ie, we, $e, Me, Ze, ne, rr, gr, or, _r = 1e4) {
96045
+ const Lr = `https://embed-api-v2.bluepic.workers.dev/api/export/${c}?${new URLSearchParams({
96066
96046
  env: "prod",
96067
96047
  embedV2Server: m
96068
- })}`, Lr = {
96048
+ })}`;
96049
+ console.log("rendering...", Lr, {
96050
+ timeout: _r,
96051
+ width: $e,
96052
+ height: Me,
96053
+ templateId: ie,
96054
+ data: we,
96055
+ format: Ze,
96056
+ frames: gr,
96057
+ watermark: or,
96058
+ authorization: rr
96059
+ });
96060
+ const Ir = {
96069
96061
  templateId: ie,
96070
96062
  data: we,
96071
96063
  width: $e,
96072
96064
  height: Me,
96073
96065
  format: Ze,
96074
96066
  frames: gr
96075
- }, Ir = await fetch(_r, {
96067
+ }, Ar = new AbortController(), Rr = setTimeout(() => {
96068
+ console.log(`Rendering request timed out after ${_r}ms`), Ar.abort();
96069
+ }, _r), Fr = await fetch(Lr, {
96076
96070
  method: "POST",
96077
96071
  headers: {
96078
96072
  "Content-Type": "application/json"
96079
96073
  },
96080
- body: JSON.stringify(Lr)
96074
+ body: JSON.stringify(Ir),
96075
+ signal: Ar.signal
96081
96076
  });
96082
- if (!Ir.ok)
96083
- throw new Error(`Failed to start rendering: ${Ir.status}`);
96084
- return await Ir.json();
96077
+ if (clearTimeout(Rr), !Fr.ok)
96078
+ throw new Error(`Failed to start rendering: ${Fr.status}`);
96079
+ return await Fr.json();
96085
96080
  }
96086
96081
  function getSessionState(m, c, ie, we, $e, Me, Ze) {
96087
96082
  return hash$1({ templateId: m, data: c, format: ie, width: we, height: $e, quality: Me });
@@ -96109,7 +96104,9 @@ async function renderRemoteWithRetry(m, c, ie, we, $e, Me, Ze, ne, rr, gr, or =
96109
96104
  $e,
96110
96105
  ne,
96111
96106
  gr,
96112
- rr
96107
+ rr,
96108
+ void 0,
96109
+ 1e4
96113
96110
  );
96114
96111
  return Ir(Fr);
96115
96112
  } catch (Fr) {
@@ -96862,7 +96859,7 @@ const BluepicLogo = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_re
96862
96859
  createVNode(BxButton, {
96863
96860
  secondary: "",
96864
96861
  loading: (jn.value || unref(Yi)) && zn.value === void 0,
96865
- disabled: jn.value || unref(Yi)
96862
+ disabled: jn.value || unref(Yi) || !ne.value
96866
96863
  }, {
96867
96864
  icon: withCtx(() => [
96868
96865
  zn.value !== void 0 ? (openBlock(), createBlock(CircularProgress, {
@@ -97428,7 +97425,7 @@ const BluepicLogo = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_re
97428
97425
  ])
97429
97426
  ], 2));
97430
97427
  }
97431
- }), BluepicEmbeddedEditor_vue_vue_type_style_index_0_scoped_10197507_lang = "", BluepicEmbeddedEditor = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-10197507"]]), _hoisted_1$a = { class: "collection-field-popup" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
97428
+ }), BluepicEmbeddedEditor_vue_vue_type_style_index_0_scoped_5bdf4a3f_lang = "", BluepicEmbeddedEditor = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-5bdf4a3f"]]), _hoisted_1$a = { class: "collection-field-popup" }, _sfc_main$e = /* @__PURE__ */ defineComponent({
97432
97429
  __name: "CollectionFieldPopup",
97433
97430
  props: /* @__PURE__ */ mergeModels({
97434
97431
  layout: {},
@@ -100473,19 +100470,20 @@ class BluepicEmbed extends EventTarget {
100473
100470
  #${c} .fade-spinner-leave-to {
100474
100471
  opacity: 0;
100475
100472
  }
100476
- #${c} {
100477
- > div {
100478
- border: 1px solid var(--bluepic-app-border-color);
100479
- overflow: hidden;
100480
- border-radius: var(--bluepic-app-border-radius);
100481
- margin: 30px auto;
100482
- box-sizing: border-box;
100483
- max-width: calc(100vw - 40px);
100484
- max-height: calc(100vh - 40px);
100485
- }
100473
+ #${c} > div {
100474
+ border: 1px solid var(--bluepic-app-border-color);
100475
+ overflow: hidden;
100476
+ border-radius: var(--bluepic-app-border-radius);
100477
+ margin: 30px auto;
100478
+ box-sizing: border-box;
100479
+ max-width: calc(100vw - 40px);
100480
+ max-height: calc(100vh - 40px);
100481
+ }
100482
+ #${c}.layout-mobile {
100483
+ height: 100%;
100486
100484
  }
100487
100485
  `, document.head.appendChild(ie), this.element.innerHTML = `
100488
- <div id="${c}" class="bluepic-app-wrapper" style="position: relative;" :style="">
100486
+ <div id="${c}" class="bluepic-app-wrapper" style="position: relative;" :style="" :class="{ \`layout-\${embedProject?.config.layout}\`: true }">
100489
100487
  <div v-if="templateId" style="display: flex; flex-direction: column;" :style="{ height: embedProject?.config.layout === 'stack' ? 'auto' : 'calc(100% - 40px)', '--bluepic-app-border-color': borderColor, '--bluepic-app-border-radius': borderRadius }">
100490
100488
  <bluepic-embedded-editor
100491
100489
  v-if="templateId"