tevrocsdk 0.1.49 → 0.1.51

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/tevroc-sdk.umd.js CHANGED
@@ -198,7 +198,7 @@ var Tevroc = (() => {
198
198
  callbackId
199
199
  }, callback);
200
200
  };
201
- const p3 = new Promise((resolve2) => call.then(() => resolve2({ remove: remove2 })));
201
+ const p3 = new Promise((resolve3) => call.then(() => resolve3({ remove: remove2 })));
202
202
  p3.remove = async () => {
203
203
  console.warn(`Using addListener() without 'await' is deprecated.`);
204
204
  await remove2();
@@ -402,11 +402,11 @@ var Tevroc = (() => {
402
402
  CapacitorCookies = registerPlugin("CapacitorCookies", {
403
403
  web: () => new CapacitorCookiesPluginWeb()
404
404
  });
405
- readBlobAsBase64 = async (blob) => new Promise((resolve2, reject) => {
405
+ readBlobAsBase64 = async (blob) => new Promise((resolve3, reject) => {
406
406
  const reader = new FileReader();
407
407
  reader.onload = () => {
408
408
  const base64String = reader.result;
409
- resolve2(base64String.indexOf(",") >= 0 ? base64String.split(",")[1] : base64String);
409
+ resolve3(base64String.indexOf(",") >= 0 ? base64String.split(",")[1] : base64String);
410
410
  };
411
411
  reader.onerror = (error) => reject(error);
412
412
  reader.readAsDataURL(blob);
@@ -2377,11 +2377,11 @@ var Tevroc = (() => {
2377
2377
  };
2378
2378
  function __awaiter(thisArg, _arguments, P2, generator) {
2379
2379
  function adopt(value) {
2380
- return value instanceof P2 ? value : new P2(function(resolve2) {
2381
- resolve2(value);
2380
+ return value instanceof P2 ? value : new P2(function(resolve3) {
2381
+ resolve3(value);
2382
2382
  });
2383
2383
  }
2384
- return new (P2 || (P2 = Promise))(function(resolve2, reject) {
2384
+ return new (P2 || (P2 = Promise))(function(resolve3, reject) {
2385
2385
  function fulfilled(value) {
2386
2386
  try {
2387
2387
  step(generator.next(value));
@@ -2397,7 +2397,7 @@ var Tevroc = (() => {
2397
2397
  }
2398
2398
  }
2399
2399
  function step(result) {
2400
- result.done ? resolve2(result.value) : adopt(result.value).then(fulfilled, rejected);
2400
+ result.done ? resolve3(result.value) : adopt(result.value).then(fulfilled, rejected);
2401
2401
  }
2402
2402
  step((generator = generator.apply(thisArg, _arguments || [])).next());
2403
2403
  });
@@ -6526,10 +6526,10 @@ var Tevroc = (() => {
6526
6526
  return svg2;
6527
6527
  };
6528
6528
  var loadSerializedSVG$1 = function(svg2) {
6529
- return new Promise(function(resolve2, reject) {
6529
+ return new Promise(function(resolve3, reject) {
6530
6530
  var img = new Image();
6531
6531
  img.onload = function() {
6532
- return resolve2(img);
6532
+ return resolve3(img);
6533
6533
  };
6534
6534
  img.onerror = reject;
6535
6535
  img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg2));
@@ -7891,24 +7891,24 @@ var Tevroc = (() => {
7891
7891
  return cloneIframeContainer;
7892
7892
  };
7893
7893
  var imageReady = function(img) {
7894
- return new Promise(function(resolve2) {
7894
+ return new Promise(function(resolve3) {
7895
7895
  if (img.complete) {
7896
- resolve2();
7896
+ resolve3();
7897
7897
  return;
7898
7898
  }
7899
7899
  if (!img.src) {
7900
- resolve2();
7900
+ resolve3();
7901
7901
  return;
7902
7902
  }
7903
- img.onload = resolve2;
7904
- img.onerror = resolve2;
7903
+ img.onload = resolve3;
7904
+ img.onerror = resolve3;
7905
7905
  });
7906
7906
  };
7907
7907
  var imagesReady = function(document2) {
7908
7908
  return Promise.all([].slice.call(document2.images, 0).map(imageReady));
7909
7909
  };
7910
7910
  var iframeLoader = function(iframe) {
7911
- return new Promise(function(resolve2, reject) {
7911
+ return new Promise(function(resolve3, reject) {
7912
7912
  var cloneWindow = iframe.contentWindow;
7913
7913
  if (!cloneWindow) {
7914
7914
  return reject("No window assigned for iframe");
@@ -7919,7 +7919,7 @@ var Tevroc = (() => {
7919
7919
  var interval = setInterval(function() {
7920
7920
  if (documentClone.body.childNodes.length > 0 && documentClone.readyState === "complete") {
7921
7921
  clearInterval(interval);
7922
- resolve2(iframe);
7922
+ resolve3(iframe);
7923
7923
  }
7924
7924
  }, 50);
7925
7925
  };
@@ -8058,10 +8058,10 @@ var Tevroc = (() => {
8058
8058
  _a2.label = 2;
8059
8059
  case 2:
8060
8060
  this.context.logger.debug("Added image " + key.substring(0, 256));
8061
- return [4, new Promise(function(resolve2, reject) {
8061
+ return [4, new Promise(function(resolve3, reject) {
8062
8062
  var img = new Image();
8063
8063
  img.onload = function() {
8064
- return resolve2(img);
8064
+ return resolve3(img);
8065
8065
  };
8066
8066
  img.onerror = reject;
8067
8067
  if (isInlineBase64Image(src) || useCORS) {
@@ -8070,7 +8070,7 @@ var Tevroc = (() => {
8070
8070
  img.src = src;
8071
8071
  if (img.complete === true) {
8072
8072
  setTimeout(function() {
8073
- return resolve2(img);
8073
+ return resolve3(img);
8074
8074
  }, 500);
8075
8075
  }
8076
8076
  if (_this._options.imageTimeout > 0) {
@@ -8098,17 +8098,17 @@ var Tevroc = (() => {
8098
8098
  throw new Error("No proxy defined");
8099
8099
  }
8100
8100
  var key = src.substring(0, 256);
8101
- return new Promise(function(resolve2, reject) {
8101
+ return new Promise(function(resolve3, reject) {
8102
8102
  var responseType = FEATURES.SUPPORT_RESPONSE_TYPE ? "blob" : "text";
8103
8103
  var xhr = new XMLHttpRequest();
8104
8104
  xhr.onload = function() {
8105
8105
  if (xhr.status === 200) {
8106
8106
  if (responseType === "text") {
8107
- resolve2(xhr.response);
8107
+ resolve3(xhr.response);
8108
8108
  } else {
8109
8109
  var reader_1 = new FileReader();
8110
8110
  reader_1.addEventListener("load", function() {
8111
- return resolve2(reader_1.result);
8111
+ return resolve3(reader_1.result);
8112
8112
  }, false);
8113
8113
  reader_1.addEventListener("error", function(e3) {
8114
8114
  return reject(e3);
@@ -9923,10 +9923,10 @@ var Tevroc = (() => {
9923
9923
  })(Renderer)
9924
9924
  );
9925
9925
  var loadSerializedSVG = function(svg2) {
9926
- return new Promise(function(resolve2, reject) {
9926
+ return new Promise(function(resolve3, reject) {
9927
9927
  var img = new Image();
9928
9928
  img.onload = function() {
9929
- resolve2(img);
9929
+ resolve3(img);
9930
9930
  };
9931
9931
  img.onerror = reject;
9932
9932
  img.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(new XMLSerializer().serializeToString(svg2));
@@ -12430,7 +12430,7 @@ var Tevroc = (() => {
12430
12430
  var defineProperty = Object.defineProperty;
12431
12431
  var stringSlice = uncurryThis("".slice);
12432
12432
  var replace = uncurryThis("".replace);
12433
- var join = uncurryThis([].join);
12433
+ var join2 = uncurryThis([].join);
12434
12434
  var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
12435
12435
  return defineProperty(function() {
12436
12436
  }, "length", { value: 8 }).length !== 8;
@@ -12457,7 +12457,7 @@ var Tevroc = (() => {
12457
12457
  }
12458
12458
  var state = enforceInternalState(value);
12459
12459
  if (!hasOwn(state, "source")) {
12460
- state.source = join(TEMPLATE, typeof name == "string" ? name : "");
12460
+ state.source = join2(TEMPLATE, typeof name == "string" ? name : "");
12461
12461
  }
12462
12462
  return value;
12463
12463
  };
@@ -12709,10 +12709,10 @@ var Tevroc = (() => {
12709
12709
  var isCallable = require_is_callable();
12710
12710
  var replacement = /#|\.prototype\./;
12711
12711
  var isForced = function(feature, detection) {
12712
- var value = data[normalize(feature)];
12712
+ var value = data[normalize2(feature)];
12713
12713
  return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
12714
12714
  };
12715
- var normalize = isForced.normalize = function(string) {
12715
+ var normalize2 = isForced.normalize = function(string) {
12716
12716
  return String(string).replace(replacement, ".").toLowerCase();
12717
12717
  };
12718
12718
  var data = isForced.data = {};
@@ -13437,8 +13437,8 @@ var Tevroc = (() => {
13437
13437
  if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
13438
13438
  if (IS_PURE && !(NativePromisePrototype["catch"] && NativePromisePrototype["finally"])) return true;
13439
13439
  if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
13440
- var promise = new NativePromiseConstructor(function(resolve2) {
13441
- resolve2(1);
13440
+ var promise = new NativePromiseConstructor(function(resolve3) {
13441
+ resolve3(1);
13442
13442
  });
13443
13443
  var FakePromise = function(exec) {
13444
13444
  exec(function() {
@@ -13468,13 +13468,13 @@ var Tevroc = (() => {
13468
13468
  var aCallable = require_a_callable();
13469
13469
  var $TypeError = TypeError;
13470
13470
  var PromiseCapability = function(C2) {
13471
- var resolve2, reject;
13471
+ var resolve3, reject;
13472
13472
  this.promise = new C2(function($$resolve, $$reject) {
13473
- if (resolve2 !== void 0 || reject !== void 0) throw new $TypeError("Bad Promise constructor");
13474
- resolve2 = $$resolve;
13473
+ if (resolve3 !== void 0 || reject !== void 0) throw new $TypeError("Bad Promise constructor");
13474
+ resolve3 = $$resolve;
13475
13475
  reject = $$reject;
13476
13476
  });
13477
- this.resolve = aCallable(resolve2);
13477
+ this.resolve = aCallable(resolve3);
13478
13478
  this.reject = aCallable(reject);
13479
13479
  };
13480
13480
  module.exports.f = function(C2) {
@@ -13545,7 +13545,7 @@ var Tevroc = (() => {
13545
13545
  var value = state.value;
13546
13546
  var ok = state.state === FULFILLED;
13547
13547
  var handler = ok ? reaction.ok : reaction.fail;
13548
- var resolve2 = reaction.resolve;
13548
+ var resolve3 = reaction.resolve;
13549
13549
  var reject = reaction.reject;
13550
13550
  var domain = reaction.domain;
13551
13551
  var result, then, exited;
@@ -13567,8 +13567,8 @@ var Tevroc = (() => {
13567
13567
  if (result === reaction.promise) {
13568
13568
  reject(new TypeError2("Promise-chain cycle"));
13569
13569
  } else if (then = isThenable(result)) {
13570
- call(then, result, resolve2, reject);
13571
- } else resolve2(result);
13570
+ call(then, result, resolve3, reject);
13571
+ } else resolve3(result);
13572
13572
  } else reject(value);
13573
13573
  } catch (error) {
13574
13574
  if (domain && !exited) domain.exit();
@@ -13724,8 +13724,8 @@ var Tevroc = (() => {
13724
13724
  if (!NATIVE_PROMISE_SUBCLASSING) {
13725
13725
  defineBuiltIn(NativePromisePrototype, "then", function then(onFulfilled, onRejected) {
13726
13726
  var that = this;
13727
- return new PromiseConstructor(function(resolve2, reject) {
13728
- call(nativeThen, that, resolve2, reject);
13727
+ return new PromiseConstructor(function(resolve3, reject) {
13728
+ call(nativeThen, that, resolve3, reject);
13729
13729
  }).then(onFulfilled, onRejected);
13730
13730
  }, { unsafe: true });
13731
13731
  }
@@ -13985,7 +13985,7 @@ var Tevroc = (() => {
13985
13985
  all: function all(iterable) {
13986
13986
  var C2 = this;
13987
13987
  var capability = newPromiseCapabilityModule.f(C2);
13988
- var resolve2 = capability.resolve;
13988
+ var resolve3 = capability.resolve;
13989
13989
  var reject = capability.reject;
13990
13990
  var result = perform(function() {
13991
13991
  var $promiseResolve = aCallable(C2.resolve);
@@ -14000,10 +14000,10 @@ var Tevroc = (() => {
14000
14000
  if (alreadyCalled) return;
14001
14001
  alreadyCalled = true;
14002
14002
  values[index2] = value;
14003
- --remaining || resolve2(values);
14003
+ --remaining || resolve3(values);
14004
14004
  }, reject);
14005
14005
  });
14006
- --remaining || resolve2(values);
14006
+ --remaining || resolve3(values);
14007
14007
  });
14008
14008
  if (result.error) reject(result.value);
14009
14009
  return capability.promise;
@@ -14097,8 +14097,8 @@ var Tevroc = (() => {
14097
14097
  anObject(C2);
14098
14098
  if (isObject(x3) && x3.constructor === C2) return x3;
14099
14099
  var promiseCapability = newPromiseCapability.f(C2);
14100
- var resolve2 = promiseCapability.resolve;
14101
- resolve2(x3);
14100
+ var resolve3 = promiseCapability.resolve;
14101
+ resolve3(x3);
14102
14102
  return promiseCapability.promise;
14103
14103
  };
14104
14104
  }
@@ -14117,7 +14117,7 @@ var Tevroc = (() => {
14117
14117
  var PromiseConstructorWrapper = getBuiltIn("Promise");
14118
14118
  var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
14119
14119
  $2({ target: "Promise", stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
14120
- resolve: function resolve2(x3) {
14120
+ resolve: function resolve3(x3) {
14121
14121
  return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x3);
14122
14122
  }
14123
14123
  });
@@ -17125,9 +17125,9 @@ var Tevroc = (() => {
17125
17125
  if (anonymousCrossOrigin) {
17126
17126
  image.crossOrigin = "Anonymous";
17127
17127
  }
17128
- return new Promise((resolve2, reject) => {
17128
+ return new Promise((resolve3, reject) => {
17129
17129
  image.onload = () => {
17130
- resolve2(image);
17130
+ resolve3(image);
17131
17131
  };
17132
17132
  image.onerror = (_event, _source, _lineno, _colno, error) => {
17133
17133
  reject(error);
@@ -17842,8 +17842,8 @@ var Tevroc = (() => {
17842
17842
  } = this;
17843
17843
  var frameDuration = 1e3 / FRAMERATE;
17844
17844
  this.frameDuration = frameDuration;
17845
- this.readyPromise = new Promise((resolve2) => {
17846
- this.resolveReady = resolve2;
17845
+ this.readyPromise = new Promise((resolve3) => {
17846
+ this.resolveReady = resolve3;
17847
17847
  });
17848
17848
  if (this.isReady()) {
17849
17849
  this.render(element, ignoreDimensions, ignoreClear, scaleWidth, scaleHeight, offsetX, offsetY);
@@ -22278,12 +22278,12 @@ var Tevroc = (() => {
22278
22278
  if (!("indexedDB" in window)) {
22279
22279
  throw this.unavailable("This browser doesn't support IndexedDB");
22280
22280
  }
22281
- return new Promise((resolve2, reject) => {
22281
+ return new Promise((resolve3, reject) => {
22282
22282
  const request = indexedDB.open(this.DB_NAME, this.DB_VERSION);
22283
22283
  request.onupgradeneeded = _FilesystemWeb.doUpgrade;
22284
22284
  request.onsuccess = () => {
22285
22285
  this._db = request.result;
22286
- resolve2(request.result);
22286
+ resolve3(request.result);
22287
22287
  };
22288
22288
  request.onerror = () => reject(request.error);
22289
22289
  request.onblocked = () => {
@@ -22309,11 +22309,11 @@ var Tevroc = (() => {
22309
22309
  async dbRequest(cmd, args) {
22310
22310
  const readFlag = this._writeCmds.indexOf(cmd) !== -1 ? "readwrite" : "readonly";
22311
22311
  return this.initDb().then((conn) => {
22312
- return new Promise((resolve2, reject) => {
22312
+ return new Promise((resolve3, reject) => {
22313
22313
  const tx = conn.transaction(["FileStorage"], readFlag);
22314
22314
  const store = tx.objectStore("FileStorage");
22315
22315
  const req = store[cmd](...args);
22316
- req.onsuccess = () => resolve2(req.result);
22316
+ req.onsuccess = () => resolve3(req.result);
22317
22317
  req.onerror = () => reject(req.error);
22318
22318
  });
22319
22319
  });
@@ -22321,12 +22321,12 @@ var Tevroc = (() => {
22321
22321
  async dbIndexRequest(indexName, cmd, args) {
22322
22322
  const readFlag = this._writeCmds.indexOf(cmd) !== -1 ? "readwrite" : "readonly";
22323
22323
  return this.initDb().then((conn) => {
22324
- return new Promise((resolve2, reject) => {
22324
+ return new Promise((resolve3, reject) => {
22325
22325
  const tx = conn.transaction(["FileStorage"], readFlag);
22326
22326
  const store = tx.objectStore("FileStorage");
22327
22327
  const index2 = store.index(indexName);
22328
22328
  const req = index2[cmd](...args);
22329
- req.onsuccess = () => resolve2(req.result);
22329
+ req.onsuccess = () => resolve3(req.result);
22330
22330
  req.onerror = () => reject(req.error);
22331
22331
  });
22332
22332
  });
@@ -22909,6 +22909,191 @@ var Tevroc = (() => {
22909
22909
  });
22910
22910
 
22911
22911
  // node_modules/@tauri-apps/api/path.js
22912
+ var path_exports = {};
22913
+ __export(path_exports, {
22914
+ BaseDirectory: () => BaseDirectory,
22915
+ appCacheDir: () => appCacheDir,
22916
+ appConfigDir: () => appConfigDir,
22917
+ appDataDir: () => appDataDir,
22918
+ appLocalDataDir: () => appLocalDataDir,
22919
+ appLogDir: () => appLogDir,
22920
+ audioDir: () => audioDir,
22921
+ basename: () => basename,
22922
+ cacheDir: () => cacheDir,
22923
+ configDir: () => configDir,
22924
+ dataDir: () => dataDir,
22925
+ delimiter: () => delimiter,
22926
+ desktopDir: () => desktopDir,
22927
+ dirname: () => dirname,
22928
+ documentDir: () => documentDir,
22929
+ downloadDir: () => downloadDir,
22930
+ executableDir: () => executableDir,
22931
+ extname: () => extname,
22932
+ fontDir: () => fontDir,
22933
+ homeDir: () => homeDir,
22934
+ isAbsolute: () => isAbsolute,
22935
+ join: () => join,
22936
+ localDataDir: () => localDataDir,
22937
+ normalize: () => normalize,
22938
+ pictureDir: () => pictureDir,
22939
+ publicDir: () => publicDir,
22940
+ resolve: () => resolve2,
22941
+ resolveResource: () => resolveResource,
22942
+ resourceDir: () => resourceDir,
22943
+ runtimeDir: () => runtimeDir,
22944
+ sep: () => sep,
22945
+ tempDir: () => tempDir,
22946
+ templateDir: () => templateDir,
22947
+ videoDir: () => videoDir
22948
+ });
22949
+ async function appConfigDir() {
22950
+ return invoke("plugin:path|resolve_directory", {
22951
+ directory: BaseDirectory.AppConfig
22952
+ });
22953
+ }
22954
+ async function appDataDir() {
22955
+ return invoke("plugin:path|resolve_directory", {
22956
+ directory: BaseDirectory.AppData
22957
+ });
22958
+ }
22959
+ async function appLocalDataDir() {
22960
+ return invoke("plugin:path|resolve_directory", {
22961
+ directory: BaseDirectory.AppLocalData
22962
+ });
22963
+ }
22964
+ async function appCacheDir() {
22965
+ return invoke("plugin:path|resolve_directory", {
22966
+ directory: BaseDirectory.AppCache
22967
+ });
22968
+ }
22969
+ async function audioDir() {
22970
+ return invoke("plugin:path|resolve_directory", {
22971
+ directory: BaseDirectory.Audio
22972
+ });
22973
+ }
22974
+ async function cacheDir() {
22975
+ return invoke("plugin:path|resolve_directory", {
22976
+ directory: BaseDirectory.Cache
22977
+ });
22978
+ }
22979
+ async function configDir() {
22980
+ return invoke("plugin:path|resolve_directory", {
22981
+ directory: BaseDirectory.Config
22982
+ });
22983
+ }
22984
+ async function dataDir() {
22985
+ return invoke("plugin:path|resolve_directory", {
22986
+ directory: BaseDirectory.Data
22987
+ });
22988
+ }
22989
+ async function desktopDir() {
22990
+ return invoke("plugin:path|resolve_directory", {
22991
+ directory: BaseDirectory.Desktop
22992
+ });
22993
+ }
22994
+ async function documentDir() {
22995
+ return invoke("plugin:path|resolve_directory", {
22996
+ directory: BaseDirectory.Document
22997
+ });
22998
+ }
22999
+ async function downloadDir() {
23000
+ return invoke("plugin:path|resolve_directory", {
23001
+ directory: BaseDirectory.Download
23002
+ });
23003
+ }
23004
+ async function executableDir() {
23005
+ return invoke("plugin:path|resolve_directory", {
23006
+ directory: BaseDirectory.Executable
23007
+ });
23008
+ }
23009
+ async function fontDir() {
23010
+ return invoke("plugin:path|resolve_directory", {
23011
+ directory: BaseDirectory.Font
23012
+ });
23013
+ }
23014
+ async function homeDir() {
23015
+ return invoke("plugin:path|resolve_directory", {
23016
+ directory: BaseDirectory.Home
23017
+ });
23018
+ }
23019
+ async function localDataDir() {
23020
+ return invoke("plugin:path|resolve_directory", {
23021
+ directory: BaseDirectory.LocalData
23022
+ });
23023
+ }
23024
+ async function pictureDir() {
23025
+ return invoke("plugin:path|resolve_directory", {
23026
+ directory: BaseDirectory.Picture
23027
+ });
23028
+ }
23029
+ async function publicDir() {
23030
+ return invoke("plugin:path|resolve_directory", {
23031
+ directory: BaseDirectory.Public
23032
+ });
23033
+ }
23034
+ async function resourceDir() {
23035
+ return invoke("plugin:path|resolve_directory", {
23036
+ directory: BaseDirectory.Resource
23037
+ });
23038
+ }
23039
+ async function resolveResource(resourcePath) {
23040
+ return invoke("plugin:path|resolve_directory", {
23041
+ directory: BaseDirectory.Resource,
23042
+ path: resourcePath
23043
+ });
23044
+ }
23045
+ async function runtimeDir() {
23046
+ return invoke("plugin:path|resolve_directory", {
23047
+ directory: BaseDirectory.Runtime
23048
+ });
23049
+ }
23050
+ async function templateDir() {
23051
+ return invoke("plugin:path|resolve_directory", {
23052
+ directory: BaseDirectory.Template
23053
+ });
23054
+ }
23055
+ async function videoDir() {
23056
+ return invoke("plugin:path|resolve_directory", {
23057
+ directory: BaseDirectory.Video
23058
+ });
23059
+ }
23060
+ async function appLogDir() {
23061
+ return invoke("plugin:path|resolve_directory", {
23062
+ directory: BaseDirectory.AppLog
23063
+ });
23064
+ }
23065
+ async function tempDir() {
23066
+ return invoke("plugin:path|resolve_directory", {
23067
+ directory: BaseDirectory.Temp
23068
+ });
23069
+ }
23070
+ function sep() {
23071
+ return window.__TAURI_INTERNALS__.plugins.path.sep;
23072
+ }
23073
+ function delimiter() {
23074
+ return window.__TAURI_INTERNALS__.plugins.path.delimiter;
23075
+ }
23076
+ async function resolve2(...paths) {
23077
+ return invoke("plugin:path|resolve", { paths });
23078
+ }
23079
+ async function normalize(path) {
23080
+ return invoke("plugin:path|normalize", { path });
23081
+ }
23082
+ async function join(...paths) {
23083
+ return invoke("plugin:path|join", { paths });
23084
+ }
23085
+ async function dirname(path) {
23086
+ return invoke("plugin:path|dirname", { path });
23087
+ }
23088
+ async function extname(path) {
23089
+ return invoke("plugin:path|extname", { path });
23090
+ }
23091
+ async function basename(path, ext) {
23092
+ return invoke("plugin:path|basename", { path, ext });
23093
+ }
23094
+ async function isAbsolute(path) {
23095
+ return invoke("plugin:path|is_absolute", { path });
23096
+ }
22912
23097
  var BaseDirectory;
22913
23098
  var init_path = __esm({
22914
23099
  "node_modules/@tauri-apps/api/path.js"() {
@@ -23433,58 +23618,6 @@ var Tevroc = (() => {
23433
23618
  }
23434
23619
  });
23435
23620
 
23436
- // node_modules/@capacitor/browser/dist/esm/definitions.js
23437
- var init_definitions6 = __esm({
23438
- "node_modules/@capacitor/browser/dist/esm/definitions.js"() {
23439
- }
23440
- });
23441
-
23442
- // node_modules/@capacitor/browser/dist/esm/web.js
23443
- var web_exports6 = {};
23444
- __export(web_exports6, {
23445
- Browser: () => Browser,
23446
- BrowserWeb: () => BrowserWeb
23447
- });
23448
- var BrowserWeb, Browser;
23449
- var init_web6 = __esm({
23450
- "node_modules/@capacitor/browser/dist/esm/web.js"() {
23451
- init_dist();
23452
- BrowserWeb = class extends WebPlugin {
23453
- constructor() {
23454
- super();
23455
- this._lastWindow = null;
23456
- }
23457
- async open(options) {
23458
- this._lastWindow = window.open(options.url, options.windowName || "_blank");
23459
- }
23460
- async close() {
23461
- return new Promise((resolve2, reject) => {
23462
- if (this._lastWindow != null) {
23463
- this._lastWindow.close();
23464
- this._lastWindow = null;
23465
- resolve2();
23466
- } else {
23467
- reject("No active window to close!");
23468
- }
23469
- });
23470
- }
23471
- };
23472
- Browser = new BrowserWeb();
23473
- }
23474
- });
23475
-
23476
- // node_modules/@capacitor/browser/dist/esm/index.js
23477
- var Browser2;
23478
- var init_esm6 = __esm({
23479
- "node_modules/@capacitor/browser/dist/esm/index.js"() {
23480
- init_dist();
23481
- init_definitions6();
23482
- Browser2 = registerPlugin("Browser", {
23483
- web: () => Promise.resolve().then(() => (init_web6(), web_exports6)).then((m4) => new m4.BrowserWeb())
23484
- });
23485
- }
23486
- });
23487
-
23488
23621
  // node_modules/@tauri-apps/api/dpi.js
23489
23622
  var LogicalSize, PhysicalSize, Size, LogicalPosition, PhysicalPosition, Position;
23490
23623
  var init_dpi = __esm({
@@ -26078,6 +26211,12 @@ var Tevroc = (() => {
26078
26211
  });
26079
26212
 
26080
26213
  // node_modules/@tauri-apps/api/webviewWindow.js
26214
+ var webviewWindow_exports = {};
26215
+ __export(webviewWindow_exports, {
26216
+ WebviewWindow: () => WebviewWindow,
26217
+ getAllWebviewWindows: () => getAllWebviewWindows,
26218
+ getCurrentWebviewWindow: () => getCurrentWebviewWindow
26219
+ });
26081
26220
  function getCurrentWebviewWindow() {
26082
26221
  const webview = getCurrentWebview();
26083
26222
  return new WebviewWindow(webview.label, { skip: true });
@@ -26261,6 +26400,58 @@ var Tevroc = (() => {
26261
26400
  }
26262
26401
  });
26263
26402
 
26403
+ // node_modules/@capacitor/browser/dist/esm/definitions.js
26404
+ var init_definitions6 = __esm({
26405
+ "node_modules/@capacitor/browser/dist/esm/definitions.js"() {
26406
+ }
26407
+ });
26408
+
26409
+ // node_modules/@capacitor/browser/dist/esm/web.js
26410
+ var web_exports6 = {};
26411
+ __export(web_exports6, {
26412
+ Browser: () => Browser,
26413
+ BrowserWeb: () => BrowserWeb
26414
+ });
26415
+ var BrowserWeb, Browser;
26416
+ var init_web6 = __esm({
26417
+ "node_modules/@capacitor/browser/dist/esm/web.js"() {
26418
+ init_dist();
26419
+ BrowserWeb = class extends WebPlugin {
26420
+ constructor() {
26421
+ super();
26422
+ this._lastWindow = null;
26423
+ }
26424
+ async open(options) {
26425
+ this._lastWindow = window.open(options.url, options.windowName || "_blank");
26426
+ }
26427
+ async close() {
26428
+ return new Promise((resolve3, reject) => {
26429
+ if (this._lastWindow != null) {
26430
+ this._lastWindow.close();
26431
+ this._lastWindow = null;
26432
+ resolve3();
26433
+ } else {
26434
+ reject("No active window to close!");
26435
+ }
26436
+ });
26437
+ }
26438
+ };
26439
+ Browser = new BrowserWeb();
26440
+ }
26441
+ });
26442
+
26443
+ // node_modules/@capacitor/browser/dist/esm/index.js
26444
+ var Browser2;
26445
+ var init_esm6 = __esm({
26446
+ "node_modules/@capacitor/browser/dist/esm/index.js"() {
26447
+ init_dist();
26448
+ init_definitions6();
26449
+ Browser2 = registerPlugin("Browser", {
26450
+ web: () => Promise.resolve().then(() => (init_web6(), web_exports6)).then((m4) => new m4.BrowserWeb())
26451
+ });
26452
+ }
26453
+ });
26454
+
26264
26455
  // src/services/useGoogleAuth.js
26265
26456
  var useGoogleAuth_exports = {};
26266
26457
  __export(useGoogleAuth_exports, {
@@ -40944,12 +41135,12 @@ var Tevroc = (() => {
40944
41135
 
40945
41136
  // src/services/pdf.js
40946
41137
  init_usePlatform();
40947
- var blobToBase64 = (blob) => new Promise((resolve2, reject) => {
41138
+ var blobToBase64 = (blob) => new Promise((resolve3, reject) => {
40948
41139
  const reader = new FileReader();
40949
41140
  reader.onloadend = () => {
40950
41141
  const data = reader.result;
40951
41142
  if (typeof data === "string") {
40952
- resolve2(data.split(",")[1]);
41143
+ resolve3(data.split(",")[1]);
40953
41144
  } else {
40954
41145
  reject(new Error("Unable to encode PDF blob to base64"));
40955
41146
  }
@@ -41061,21 +41252,64 @@ var Tevroc = (() => {
41061
41252
  await writeFile2(filePath, uint83);
41062
41253
  return filePath;
41063
41254
  };
41064
- var openBlobTauri = async (blob, fileName, action = "preview") => {
41065
- const invoke2 = typeof window !== "undefined" ? window.__TAURI__?.core?.invoke : void 0;
41066
- if (typeof invoke2 !== "function") return void 0;
41067
- const payload = await blobToBase64(blob);
41068
- const finalName = getFinalFileName(fileName || "document.pdf");
41069
- return await invoke2("open_pdf_file", {
41070
- fileName: finalName,
41071
- action,
41072
- payload
41255
+ var createTauriPdfUrl = async (blob, fileName = "document.pdf") => {
41256
+ const { writeFile: writeFile2 } = await Promise.resolve().then(() => (init_dist_js3(), dist_js_exports3));
41257
+ const { tempDir: tempDir2, join: join2 } = await Promise.resolve().then(() => (init_path(), path_exports));
41258
+ const safeName = String(fileName || "document.pdf").trim().replace(/[^a-zA-Z0-9._-]+/g, "_");
41259
+ const tempFolder = await tempDir2();
41260
+ const filePath = await join2(tempFolder, `${Date.now()}-${safeName}`);
41261
+ const buffer = await blob.arrayBuffer();
41262
+ await writeFile2(filePath, new Uint8Array(buffer));
41263
+ const normalizedPath = filePath.replace(/\\/g, "/");
41264
+ return normalizedPath.startsWith("/") ? `file://${normalizedPath}` : `file:///${normalizedPath}`;
41265
+ };
41266
+ var openBlobTauri = async (blob, fileName = "document.pdf", autoPrint = false) => {
41267
+ const { WebviewWindow: WebviewWindow2 } = await Promise.resolve().then(() => (init_webviewWindow(), webviewWindow_exports));
41268
+ const pdfUrl = await createTauriPdfUrl(blob, fileName);
41269
+ console.log(
41270
+ "Opening Tauri PDF webview from local file URL"
41271
+ );
41272
+ const label = `pdf-print-${Date.now()}`;
41273
+ const windowInstance = new WebviewWindow2(label, {
41274
+ url: pdfUrl,
41275
+ title: "Print PDF",
41276
+ width: 1e3,
41277
+ height: 800,
41278
+ resizable: true,
41279
+ center: true,
41280
+ focus: true,
41281
+ visible: true
41073
41282
  });
41283
+ windowInstance.once(
41284
+ "tauri://created",
41285
+ () => {
41286
+ console.log(
41287
+ "Tauri PDF print webview opened:",
41288
+ label
41289
+ );
41290
+ try {
41291
+ windowInstance.show?.();
41292
+ windowInstance.setFocus?.();
41293
+ } catch (error) {
41294
+ console.warn("Unable to focus PDF print window:", error);
41295
+ }
41296
+ }
41297
+ );
41298
+ windowInstance.once(
41299
+ "tauri://error",
41300
+ (error) => {
41301
+ console.error(
41302
+ "Tauri PDF print webview error:",
41303
+ error
41304
+ );
41305
+ }
41306
+ );
41307
+ return windowInstance;
41074
41308
  };
41075
41309
  var openPreview = async (blob, fileName) => {
41076
- if (isTauri && typeof window !== "undefined" && window.__TAURI__?.core?.invoke) {
41310
+ if (isTauri && typeof window !== "undefined" && (window.__TAURI__ || window.__TAURI_INTERNALS__)) {
41077
41311
  try {
41078
- const opened = await openBlobTauri(blob, fileName, "preview");
41312
+ const opened = await openBlobTauri(blob, fileName, false);
41079
41313
  if (opened) return opened;
41080
41314
  } catch (err2) {
41081
41315
  }
@@ -41114,10 +41348,10 @@ var Tevroc = (() => {
41114
41348
  }
41115
41349
  return url;
41116
41350
  };
41117
- var printBlob = async (blob) => {
41118
- if (isTauri && typeof window !== "undefined" && window.__TAURI__?.core?.invoke) {
41351
+ var printBlob = async (blob, fileName) => {
41352
+ if (isTauri && typeof window !== "undefined" && (window.__TAURI__ || window.__TAURI_INTERNALS__)) {
41119
41353
  try {
41120
- const opened = await openBlobTauri(blob, "document.pdf", "print");
41354
+ const opened = await openBlobTauri(blob, fileName, true);
41121
41355
  if (opened) return opened;
41122
41356
  } catch (err2) {
41123
41357
  }
@@ -41138,15 +41372,7 @@ var Tevroc = (() => {
41138
41372
  printWindow.print?.();
41139
41373
  } catch (err2) {
41140
41374
  }
41141
- try {
41142
- printWindow.close?.();
41143
- } catch (err2) {
41144
- }
41145
- try {
41146
- URL.revokeObjectURL(url);
41147
- } catch (err2) {
41148
- }
41149
- }, 600);
41375
+ }, 800);
41150
41376
  return;
41151
41377
  }
41152
41378
  } catch (err2) {
@@ -41163,24 +41389,18 @@ var Tevroc = (() => {
41163
41389
  iframe.style.height = "0";
41164
41390
  iframe.style.border = "0";
41165
41391
  iframe.src = url;
41166
- const cleanup = () => {
41167
- if (iframe.parentNode) {
41168
- iframe.parentNode.removeChild(iframe);
41169
- }
41170
- try {
41171
- URL.revokeObjectURL(url);
41172
- } catch (err2) {
41173
- }
41174
- };
41175
- return new Promise((resolve2, reject) => {
41392
+ return new Promise((resolve3, reject) => {
41176
41393
  iframe.onload = () => {
41177
41394
  try {
41178
41395
  iframe.contentWindow.focus();
41179
- iframe.contentWindow.print();
41180
- setTimeout(cleanup, 1e3);
41181
- resolve2();
41396
+ setTimeout(() => {
41397
+ try {
41398
+ iframe.contentWindow.print();
41399
+ } catch (err2) {
41400
+ }
41401
+ resolve3();
41402
+ }, 800);
41182
41403
  } catch (err2) {
41183
- cleanup();
41184
41404
  reject(err2);
41185
41405
  }
41186
41406
  };
@@ -41244,9 +41464,9 @@ var Tevroc = (() => {
41244
41464
  const pdfBlob = await normalizePdfBlob(source);
41245
41465
  return await openPreview(pdfBlob, fileName);
41246
41466
  },
41247
- async printPdf(source) {
41467
+ async printPdf(source, fileName = "print.pdf") {
41248
41468
  const pdfBlob = await normalizePdfBlob(source);
41249
- return await printBlob(pdfBlob);
41469
+ return await printBlob(pdfBlob, fileName);
41250
41470
  }
41251
41471
  };
41252
41472
  }