qcobjects 2.5.102-beta → 2.5.104-beta

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.
@@ -1,4 +1,3 @@
1
- "use strict";
2
1
  var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -6,16 +5,18 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
5
  var __getProtoOf = Object.getPrototypeOf;
7
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
7
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
9
14
  var __esm = (fn, res) => function __init() {
10
15
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
16
  };
12
- var __commonJS = (cb, mod) => function __require() {
17
+ var __commonJS = (cb, mod) => function __require2() {
13
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
19
  };
15
- var __export = (target, all) => {
16
- for (var name in all)
17
- __defProp(target, name, { get: all[name], enumerable: true });
18
- };
19
20
  var __copyProps = (to, from, except, desc) => {
20
21
  if (from && typeof from === "object" || typeof from === "function") {
21
22
  for (let key of __getOwnPropNames(from))
@@ -32,7 +33,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
33
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
33
34
  mod
34
35
  ));
35
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
36
36
 
37
37
  // src/assign.ts
38
38
  var require_assign = __commonJS({
@@ -93,7 +93,7 @@ var init_platform = __esm({
93
93
  return isDeno ? deno_require(name) : ((name2) => {
94
94
  let r;
95
95
  try {
96
- r = require(name2);
96
+ r = __require(name2);
97
97
  } catch (e) {
98
98
  logger.debug(`An error ocurred importing module. ${e}`);
99
99
  r = { export: {} };
@@ -629,7 +629,7 @@ var init_InheritClass = __esm({
629
629
  }
630
630
  hierarchy() {
631
631
  const __instance__ = this;
632
- return this.getClass().hierarchy(__instance__);
632
+ return this.constructor.hierarchy(__instance__);
633
633
  }
634
634
  append(_child) {
635
635
  const child = _child || this.body;
@@ -947,7 +947,7 @@ var init_Class = __esm({
947
947
  }
948
948
  hierarchy() {
949
949
  const __instance__ = this;
950
- return this.getClass().hierarchy(__instance__);
950
+ return this.getClass()?.hierarchy(__instance__);
951
951
  }
952
952
  append(_child) {
953
953
  const child = _child || this.body;
@@ -4175,440 +4175,6 @@ var init_Import = __esm({
4175
4175
  }
4176
4176
  });
4177
4177
 
4178
- // src/BackendMicroservice.ts
4179
- var BackendMicroservice;
4180
- var init_BackendMicroservice = __esm({
4181
- "src/BackendMicroservice.ts"() {
4182
- "use strict";
4183
- init_basePath();
4184
- init_DataStringify();
4185
- init_domain();
4186
- init_InheritClass();
4187
- init_Logger();
4188
- init_Package();
4189
- BackendMicroservice = class extends InheritClass {
4190
- static {
4191
- __name(this, "BackendMicroservice");
4192
- }
4193
- stream;
4194
- route;
4195
- headers;
4196
- request;
4197
- constructor({
4198
- domain = _domain_,
4199
- basePath = _basePath_,
4200
- body = null,
4201
- stream = null,
4202
- request = null
4203
- }) {
4204
- super({
4205
- domain,
4206
- basePath,
4207
- body,
4208
- stream,
4209
- request
4210
- });
4211
- logger.debug("Initializing BackendMicroservice...");
4212
- const microservice = this;
4213
- if (typeof this.body === "undefined") {
4214
- this.body = null;
4215
- }
4216
- if (typeof body !== "undefined") {
4217
- this.body = body;
4218
- }
4219
- this.cors();
4220
- microservice.stream = stream;
4221
- stream?.on("data", (data) => {
4222
- const requestMethod2 = request?.method.toLowerCase();
4223
- const supportedMethods2 = {
4224
- "post": microservice.post.bind(microservice)
4225
- };
4226
- if (Object.hasOwn(supportedMethods2, requestMethod2)) {
4227
- supportedMethods2[requestMethod2].call(microservice, data);
4228
- }
4229
- });
4230
- const requestMethod = request?.method.toLowerCase();
4231
- const supportedMethods = {
4232
- "get": microservice.get.bind(microservice),
4233
- "head": microservice.head.bind(microservice),
4234
- "put": microservice.put.bind(microservice),
4235
- "delete": microservice.delete.bind(microservice),
4236
- "connect": microservice.connect.bind(microservice),
4237
- "options": microservice.options.bind(microservice),
4238
- "trace": microservice.trace.bind(microservice),
4239
- "patch": microservice.patch.bind(microservice)
4240
- };
4241
- if (Object.hasOwn(supportedMethods, requestMethod)) {
4242
- supportedMethods[requestMethod].call(microservice);
4243
- }
4244
- }
4245
- cors() {
4246
- if (this.route.cors) {
4247
- logger.debug("Validating CORS...");
4248
- const {
4249
- allow_origins,
4250
- allow_credentials,
4251
- allow_methods,
4252
- allow_headers
4253
- } = this.route.cors;
4254
- const microservice = this;
4255
- if (typeof microservice.headers !== "object") {
4256
- microservice.headers = {};
4257
- }
4258
- if (typeof microservice.route.responseHeaders !== "object") {
4259
- microservice.route.responseHeaders = {};
4260
- }
4261
- if (typeof allow_origins !== "undefined") {
4262
- logger.debug("CORS: allow_origins available. Validating origins...");
4263
- if (allow_origins === "*" || typeof microservice.request.headers.origin === "undefined" || [...allow_origins].indexOf(microservice.request.headers.origin) !== -1) {
4264
- logger.debug("CORS: Adding header Access-Control-Allow-Origin=*");
4265
- microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*";
4266
- } else {
4267
- logger.debug("CORS: Origin is not allowed: " + microservice.request.headers.origin);
4268
- logger.debug("CORS: Forcing to finish the response...");
4269
- this.body = {};
4270
- try {
4271
- this.done();
4272
- } catch (e) {
4273
- logger.debug(`It was not possible to finish the call to the microservice: ${e}`);
4274
- }
4275
- }
4276
- } else {
4277
- logger.debug("CORS: no allow_origins available. Allowing all origins...");
4278
- logger.debug("CORS: Adding header Access-Control-Allow-Origin=*");
4279
- microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*";
4280
- }
4281
- if (typeof allow_credentials !== "undefined") {
4282
- logger.debug(`CORS: allow_credentials present. Allowing ${allow_credentials}...`);
4283
- microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = allow_credentials.toString();
4284
- } else {
4285
- logger.debug("CORS: No allow_credentials present. Allowing all credentials.");
4286
- microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = "true";
4287
- }
4288
- if (typeof allow_methods !== "undefined") {
4289
- logger.debug(`CORS: allow_methods present. Allowing ${allow_methods}...`);
4290
- microservice.route.responseHeaders["Access-Control-Allow-Methods"] = [...allow_methods].join(",");
4291
- } else {
4292
- logger.debug("CORS: No allow_methods present. Allowing only GET, OPTIONS and POST");
4293
- microservice.route.responseHeaders["Access-Control-Allow-Methods"] = "GET, OPTIONS, POST";
4294
- }
4295
- if (typeof allow_headers !== "undefined") {
4296
- logger.debug(`CORS: allow_headers present. Allowing ${allow_headers}...`);
4297
- microservice.route.responseHeaders["Access-Control-Allow-Headers"] = [...allow_headers].join(",");
4298
- } else {
4299
- logger.debug("CORS: No allow_headers present. Allowing all headers...");
4300
- microservice.route.responseHeaders["Access-Control-Allow-Headers"] = "*";
4301
- }
4302
- } else {
4303
- logger.debug("No CORS validation available. You can specify cors in CONFIG.backend.routes[].cors");
4304
- }
4305
- }
4306
- head(formData) {
4307
- logger.debug(`[BackendMicroservice.head] Data received: ${_DataStringify(formData)}`);
4308
- this.done();
4309
- }
4310
- get(formData) {
4311
- logger.debug(`[BackendMicroservice.get] Data received: ${_DataStringify(formData)}`);
4312
- this.done();
4313
- }
4314
- post(formData) {
4315
- logger.debug(`[BackendMicroservice.post] Data received: ${_DataStringify(formData)}`);
4316
- this.done();
4317
- }
4318
- put(formData) {
4319
- logger.debug(`[BackendMicroservice.put] Data received: ${_DataStringify(formData)}`);
4320
- this.done();
4321
- }
4322
- delete(formData) {
4323
- logger.debug(`[BackendMicroservice.delete] Data received: ${_DataStringify(formData)}`);
4324
- this.done();
4325
- }
4326
- connect(formData) {
4327
- logger.debug(`[BackendMicroservice.connect] Data received: ${_DataStringify(formData)}`);
4328
- this.done();
4329
- }
4330
- options(formData) {
4331
- logger.debug(`[BackendMicroservice.options] Data received: ${_DataStringify(formData)}`);
4332
- this.done();
4333
- }
4334
- trace(formData) {
4335
- logger.debug(`[BackendMicroservice.trace] Data received: ${_DataStringify(formData)}`);
4336
- this.done();
4337
- }
4338
- patch(formData) {
4339
- logger.debug(`[BackendMicroservice.patch] Data received: ${_DataStringify(formData)}`);
4340
- this.done();
4341
- }
4342
- finishWithBody(stream) {
4343
- try {
4344
- logger.debug("[BackendMicroservice.finishWithBody] Ending the stream...");
4345
- logger.debug(`[BackendMicroservice.finishWithBody] type of body is: ${typeof this.body}`);
4346
- if (typeof this.body !== "string") {
4347
- this.body = _DataStringify(this.body);
4348
- }
4349
- logger.debug(`[BackendMicroservice.finishWithBody]
4350
- body: ${this.body} `);
4351
- stream?.write(this.body);
4352
- stream?.end();
4353
- logger.debug("[BackendMicroservice.finishWithBody] Stream ended.");
4354
- } catch (e) {
4355
- logger.debug(`[BackendMicroservice.finishWithBody] Something went wrong ending the stream: ${e}`);
4356
- }
4357
- }
4358
- done() {
4359
- logger.debug("[BackendMicroservice.done] Finalizing the response...");
4360
- const microservice = this;
4361
- const stream = microservice.stream;
4362
- try {
4363
- logger.debug("[BackendMicroservice.done] Sending response headers...");
4364
- if (microservice.route.responseHeaders) {
4365
- logger.debug(`[BackendMicroservice.done] Response headers present: ${Object.keys(microservice.route.responseHeaders).join(",")}`);
4366
- stream.respond(microservice.route.responseHeaders);
4367
- } else {
4368
- throw Error("[BackendMicroservice.done] No headers present.");
4369
- }
4370
- } catch (e) {
4371
- logger.debug(`[BackendMicroservice.done] Something went wrong sending response headers: ${e}`);
4372
- }
4373
- if (microservice.body !== null) {
4374
- try {
4375
- logger.debug("[BackendMicroservice.done] A body of message is present. Finalizing the response...");
4376
- microservice.finishWithBody.call(microservice, stream);
4377
- } catch (e) {
4378
- logger.debug(`[BackendMicroservice.done] Something went wrong finalizing the response: ${e}`);
4379
- }
4380
- } else {
4381
- logger.debug("[BackendMicroservice.done] No body present. Ending stream...");
4382
- stream.end();
4383
- }
4384
- }
4385
- };
4386
- Package("com.qcobjects.api", [
4387
- BackendMicroservice
4388
- ]);
4389
- }
4390
- });
4391
-
4392
- // src/DefaultTemplateHandler.ts
4393
- var DefaultTemplateHandler;
4394
- var init_DefaultTemplateHandler = __esm({
4395
- "src/DefaultTemplateHandler.ts"() {
4396
- "use strict";
4397
- init_Logger();
4398
- init_Processor();
4399
- init_RegisterClass();
4400
- DefaultTemplateHandler = class {
4401
- static {
4402
- __name(this, "DefaultTemplateHandler");
4403
- }
4404
- template = "";
4405
- __definition = {};
4406
- static __definition = {};
4407
- component;
4408
- constructor({ component, template }) {
4409
- this.component = component;
4410
- this.template = template;
4411
- }
4412
- assign(data) {
4413
- const templateInstance = this;
4414
- if (typeof templateInstance.component === "undefined") {
4415
- throw new Error("DefaultTemplateHandler.assign: component is undefined");
4416
- }
4417
- if (typeof templateInstance.component.processorHandler === "undefined") {
4418
- throw new Error("DefaultTemplateHandler.assign: component.processorHandler is undefined");
4419
- }
4420
- const processorHandler = templateInstance.component.processorHandler;
4421
- processorHandler.component = templateInstance.component;
4422
- let parsedAssignmentText = typeof templateInstance.template !== "undefined" ? templateInstance.template : "";
4423
- if (typeof data === "object") {
4424
- [...Object.keys(data)].map((k) => {
4425
- let _value = data[k];
4426
- if (typeof _value === "string" || typeof _value === "number" || !isNaN(_value)) {
4427
- try {
4428
- _value = GlobalProcessor.processObject.bind(processorHandler).call(processorHandler, _value, templateInstance.component);
4429
- parsedAssignmentText = parsedAssignmentText.replace(new RegExp(`{{${k}}}`, "g"), _value);
4430
- } catch (e) {
4431
- logger.warn(`${templateInstance.component.name} could not parse processors.`);
4432
- throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`);
4433
- }
4434
- }
4435
- return k;
4436
- });
4437
- } else {
4438
- logger.debug(`${templateInstance.component.name}.data is not an object`);
4439
- }
4440
- try {
4441
- parsedAssignmentText = GlobalProcessor.processObject.call(processorHandler, parsedAssignmentText, templateInstance.component);
4442
- } catch (e) {
4443
- logger.warn(`${templateInstance.component.name} could not parse processors.`);
4444
- throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`);
4445
- }
4446
- return parsedAssignmentText;
4447
- }
4448
- };
4449
- RegisterClass(DefaultTemplateHandler, "com.qcobjects");
4450
- }
4451
- });
4452
-
4453
- // src/SourceJS.ts
4454
- var SourceJS;
4455
- var init_SourceJS = __esm({
4456
- "src/SourceJS.ts"() {
4457
- "use strict";
4458
- init_basePath();
4459
- init_Cast();
4460
- init_domain();
4461
- init_DOMCreateElement();
4462
- init_InheritClass();
4463
- init_Package();
4464
- init_Logger();
4465
- SourceJS = class extends InheritClass {
4466
- static {
4467
- __name(this, "SourceJS");
4468
- }
4469
- domain = _domain_;
4470
- basePath = _basePath_;
4471
- type = "text/javascript";
4472
- containerTag = "body";
4473
- url = "";
4474
- data = {};
4475
- async = false;
4476
- external = false;
4477
- constructor(o) {
4478
- super(o);
4479
- this.body = _DOMCreateElement("script");
4480
- }
4481
- set(name, value) {
4482
- this[name] = value;
4483
- }
4484
- get(name, _default) {
4485
- return this[name] || _default;
4486
- }
4487
- status = false;
4488
- done() {
4489
- }
4490
- fail() {
4491
- }
4492
- rebuild() {
4493
- const context = this;
4494
- try {
4495
- document.getElementsByTagName(context.containerTag)[0].appendChild(
4496
- function(s, url, context2) {
4497
- s.type = context2.type;
4498
- s.src = url;
4499
- s.crossOrigin = Object.hasOwn(context2, "crossOrigin") ? context2.crossOrigin : "anonymous";
4500
- s.async = context2.async;
4501
- s.onreadystatechange = function() {
4502
- if (this.readyState === "complete") {
4503
- context2.done.call(context2);
4504
- }
4505
- };
4506
- s.onload = function(e) {
4507
- context2.status = true;
4508
- context2.done.call(context2, e);
4509
- };
4510
- s.onerror = function(e) {
4511
- context2.status = false;
4512
- context2.fail.call(context2, e);
4513
- };
4514
- context2.body = s;
4515
- return s;
4516
- }.call(
4517
- this,
4518
- _DOMCreateElement("script"),
4519
- this.external ? this.url : this.basePath + this.url,
4520
- context
4521
- )
4522
- );
4523
- } catch (e) {
4524
- context.status = false;
4525
- logger.debug(`An error ocurred: ${e}`);
4526
- context.fail();
4527
- }
4528
- }
4529
- Cast(o) {
4530
- return _Cast(this, o);
4531
- }
4532
- _new_(properties) {
4533
- this.__new__(properties);
4534
- this.rebuild();
4535
- }
4536
- };
4537
- Package("com.qcobjects", [SourceJS]);
4538
- }
4539
- });
4540
-
4541
- // src/SourceCSS.ts
4542
- var SourceCSS;
4543
- var init_SourceCSS = __esm({
4544
- "src/SourceCSS.ts"() {
4545
- "use strict";
4546
- init_basePath();
4547
- init_Cast();
4548
- init_domain();
4549
- init_DOMCreateElement();
4550
- init_InheritClass();
4551
- init_platform();
4552
- init_Package();
4553
- SourceCSS = class extends InheritClass {
4554
- static {
4555
- __name(this, "SourceCSS");
4556
- }
4557
- domain = _domain_;
4558
- basePath = _basePath_;
4559
- url = "";
4560
- data = {};
4561
- async = false;
4562
- external = false;
4563
- constructor(o) {
4564
- super(o);
4565
- this.body = _DOMCreateElement("link");
4566
- }
4567
- fail() {
4568
- throw new Error("Method not implemented.");
4569
- }
4570
- Cast(o) {
4571
- return _Cast(this, o);
4572
- }
4573
- set(name, value) {
4574
- this[name] = value;
4575
- }
4576
- get(name, _default) {
4577
- return this[name] || _default;
4578
- }
4579
- done() {
4580
- }
4581
- rebuild() {
4582
- const context = this;
4583
- if (isBrowser) {
4584
- window.document.getElementsByTagName("head")[0].appendChild(
4585
- function(s, url, context2) {
4586
- s.type = "text/css";
4587
- s.rel = "stylesheet";
4588
- s.href = url;
4589
- s.crossOrigin = "anonymous";
4590
- s.onreadystatechange = function() {
4591
- if (this.readyState === "complete") {
4592
- context2.done.call(context2);
4593
- }
4594
- };
4595
- s.onload = context2.done;
4596
- context2.body = s;
4597
- return s;
4598
- }.call(
4599
- this,
4600
- _DOMCreateElement("link"),
4601
- this.external ? this.url : this.basePath + this.url,
4602
- context
4603
- )
4604
- );
4605
- }
4606
- }
4607
- };
4608
- Package("com.qcobjects", [SourceCSS]);
4609
- }
4610
- });
4611
-
4612
4178
  // src/Service.ts
4613
4179
  var Service, JSONService, ConfigService;
4614
4180
  var init_Service = __esm({
@@ -4851,1238 +4417,218 @@ var init_globalSettings = __esm({
4851
4417
  }
4852
4418
  });
4853
4419
 
4854
- // src/WidgetsFactory.ts
4855
- var QCObjectsWidgetNode, _ComponentWidget_, RegisterWidget, RegisterWidgets;
4856
- var init_WidgetsFactory = __esm({
4857
- "src/WidgetsFactory.ts"() {
4858
- "use strict";
4859
- init_DOMCreateElement();
4860
- init_Export();
4861
- init_introspection();
4862
- init_platform();
4863
- QCObjectsWidgetNode = class {
4864
- static {
4865
- __name(this, "QCObjectsWidgetNode");
4866
- }
4867
- accessKey;
4868
- accessKeyLabel;
4869
- autocapitalize;
4870
- dir;
4871
- draggable;
4872
- hidden;
4873
- inert;
4874
- innerText;
4875
- lang;
4876
- offsetHeight;
4877
- offsetLeft;
4878
- offsetParent;
4879
- offsetTop;
4880
- offsetWidth;
4881
- outerText;
4882
- popover;
4883
- spellcheck;
4884
- title;
4885
- translate;
4886
- attachInternals() {
4887
- throw new Error("Method not implemented.");
4888
- }
4889
- click() {
4890
- throw new Error("Method not implemented.");
4891
- }
4892
- hidePopover() {
4893
- throw new Error("Method not implemented.");
4894
- }
4895
- showPopover() {
4896
- throw new Error("Method not implemented.");
4897
- }
4898
- togglePopover(force) {
4899
- throw new Error("Method not implemented.");
4900
- }
4901
- addEventListener(type, listener, options) {
4902
- throw new Error("Method not implemented.");
4903
- }
4904
- removeEventListener(type, listener, options) {
4905
- throw new Error("Method not implemented.");
4906
- }
4907
- attributes;
4908
- classList;
4909
- className;
4910
- clientHeight;
4911
- clientLeft;
4912
- clientTop;
4913
- clientWidth;
4914
- id;
4915
- innerHTML;
4916
- localName;
4917
- namespaceURI;
4918
- onfullscreenchange;
4919
- onfullscreenerror;
4920
- outerHTML;
4921
- ownerDocument;
4922
- part;
4923
- prefix;
4924
- scrollHeight;
4925
- scrollLeft;
4926
- scrollTop;
4927
- scrollWidth;
4928
- shadowRoot;
4929
- slot;
4930
- tagName;
4931
- attachShadow(init) {
4932
- throw new Error("Method not implemented.");
4933
- }
4934
- checkVisibility(options) {
4935
- throw new Error("Method not implemented.");
4936
- }
4937
- closest(selectors) {
4938
- throw new Error("Method not implemented.");
4420
+ // src/loadSDK.ts
4421
+ function loadSDK() {
4422
+ if (CONFIG.get("useSDK")) {
4423
+ (function() {
4424
+ const remoteImportsPath = CONFIG.get("remoteImportsPath");
4425
+ const external = !CONFIG.get("useLocalSDK");
4426
+ CONFIG.set("remoteImportsPath", CONFIG.get("remoteSDKPath"));
4427
+ let tryImportingSDK = false;
4428
+ let sdkName = "QCObjects-SDK";
4429
+ if (isBrowser) {
4430
+ tryImportingSDK = true;
4431
+ } else {
4432
+ const sdkPath = findPackageNodePath("qcobjects-sdk");
4433
+ if (sdkPath !== null) {
4434
+ sdkName = "qcobjects-sdk";
4435
+ tryImportingSDK = true;
4436
+ } else if (sdkPath !== "") {
4437
+ sdkName = "node_modules/qcobjects-sdk/QCObjects-SDK";
4438
+ tryImportingSDK = true;
4439
+ } else {
4440
+ tryImportingSDK = false;
4441
+ }
4939
4442
  }
4940
- computedStyleMap() {
4941
- throw new Error("Method not implemented.");
4443
+ if (tryImportingSDK) {
4444
+ logger.info("Importing SDK... " + sdkName);
4445
+ if (isNodeCommonJS && typeof __require !== "undefined") {
4446
+ const sdk = _require_("qcobjects-sdk");
4447
+ if (sdk) {
4448
+ logger.debug("QCObjects SDK was loaded OK.");
4449
+ } else {
4450
+ logger.debug("QCObjects SDK could not be imported.");
4451
+ }
4452
+ } else {
4453
+ Import(sdkName, function() {
4454
+ if (external) {
4455
+ logger.debug("QCObjects-SDK.js loaded from remote location");
4456
+ } else {
4457
+ logger.debug("QCObjects-SDK.js loaded from local");
4458
+ }
4459
+ CONFIG.set("remoteImportsPath", remoteImportsPath);
4460
+ }, external)?.catch((e) => {
4461
+ throw new Error(`An error ocurred when trying to import: ${e}`);
4462
+ });
4463
+ }
4464
+ } else {
4465
+ logger.debug("SDK has not been imported as it is not available at the moment");
4942
4466
  }
4943
- getAttribute(qualifiedName) {
4944
- throw new Error("Method not implemented.");
4945
- }
4946
- getAttributeNS(namespace, localName) {
4947
- throw new Error("Method not implemented.");
4948
- }
4949
- getAttributeNames() {
4950
- throw new Error("Method not implemented.");
4951
- }
4952
- getAttributeNode(qualifiedName) {
4953
- throw new Error("Method not implemented.");
4954
- }
4955
- getAttributeNodeNS(namespace, localName) {
4956
- throw new Error("Method not implemented.");
4957
- }
4958
- getBoundingClientRect() {
4959
- throw new Error("Method not implemented.");
4960
- }
4961
- getClientRects() {
4962
- throw new Error("Method not implemented.");
4963
- }
4964
- getElementsByClassName(classNames) {
4965
- throw new Error("Method not implemented.");
4966
- }
4967
- getElementsByTagName(qualifiedName) {
4968
- throw new Error("Method not implemented.");
4969
- }
4970
- getElementsByTagNameNS(namespace, localName) {
4971
- throw new Error("Method not implemented.");
4972
- }
4973
- getHTML(options) {
4974
- throw new Error("Method not implemented.");
4975
- }
4976
- hasAttribute(qualifiedName) {
4977
- throw new Error("Method not implemented.");
4978
- }
4979
- hasAttributeNS(namespace, localName) {
4980
- throw new Error("Method not implemented.");
4981
- }
4982
- hasAttributes() {
4983
- throw new Error("Method not implemented.");
4984
- }
4985
- hasPointerCapture(pointerId) {
4986
- throw new Error("Method not implemented.");
4987
- }
4988
- insertAdjacentElement(where, element) {
4989
- throw new Error("Method not implemented.");
4990
- }
4991
- insertAdjacentHTML(position, string) {
4992
- throw new Error("Method not implemented.");
4993
- }
4994
- insertAdjacentText(where, data) {
4995
- throw new Error("Method not implemented.");
4996
- }
4997
- matches(selectors) {
4998
- throw new Error("Method not implemented.");
4999
- }
5000
- releasePointerCapture(pointerId) {
5001
- throw new Error("Method not implemented.");
5002
- }
5003
- removeAttribute(qualifiedName) {
5004
- throw new Error("Method not implemented.");
5005
- }
5006
- removeAttributeNS(namespace, localName) {
5007
- throw new Error("Method not implemented.");
5008
- }
5009
- removeAttributeNode(attr) {
5010
- throw new Error("Method not implemented.");
5011
- }
5012
- requestFullscreen(options) {
5013
- throw new Error("Method not implemented.");
5014
- }
5015
- requestPointerLock(options) {
5016
- throw new Error("Method not implemented.");
5017
- }
5018
- scroll(x, y) {
5019
- throw new Error("Method not implemented.");
5020
- }
5021
- scrollBy(x, y) {
5022
- throw new Error("Method not implemented.");
5023
- }
5024
- scrollIntoView(arg) {
5025
- throw new Error("Method not implemented.");
5026
- }
5027
- scrollTo(x, y) {
5028
- throw new Error("Method not implemented.");
5029
- }
5030
- setAttribute(qualifiedName, value) {
5031
- throw new Error("Method not implemented.");
5032
- }
5033
- setAttributeNS(namespace, qualifiedName, value) {
5034
- throw new Error("Method not implemented.");
5035
- }
5036
- setAttributeNode(attr) {
5037
- throw new Error("Method not implemented.");
5038
- }
5039
- setAttributeNodeNS(attr) {
5040
- throw new Error("Method not implemented.");
5041
- }
5042
- setHTMLUnsafe(html) {
5043
- throw new Error("Method not implemented.");
5044
- }
5045
- setPointerCapture(pointerId) {
5046
- throw new Error("Method not implemented.");
5047
- }
5048
- toggleAttribute(qualifiedName, force) {
5049
- throw new Error("Method not implemented.");
5050
- }
5051
- webkitMatchesSelector(selectors) {
5052
- throw new Error("Method not implemented.");
5053
- }
5054
- baseURI;
5055
- childNodes;
5056
- firstChild;
5057
- isConnected;
5058
- lastChild;
5059
- nextSibling;
5060
- nodeName;
5061
- nodeType;
5062
- nodeValue;
5063
- parentElement;
5064
- parentNode;
5065
- previousSibling;
5066
- textContent;
5067
- appendChild(node) {
5068
- throw new Error("Method not implemented.");
5069
- }
5070
- cloneNode(deep) {
5071
- throw new Error("Method not implemented.");
5072
- }
5073
- compareDocumentPosition(other) {
5074
- throw new Error("Method not implemented.");
5075
- }
5076
- contains(other) {
5077
- throw new Error("Method not implemented.");
5078
- }
5079
- getRootNode(options) {
5080
- throw new Error("Method not implemented.");
5081
- }
5082
- hasChildNodes() {
5083
- throw new Error("Method not implemented.");
5084
- }
5085
- insertBefore(node, child) {
5086
- throw new Error("Method not implemented.");
5087
- }
5088
- isDefaultNamespace(namespace) {
5089
- throw new Error("Method not implemented.");
5090
- }
5091
- isEqualNode(otherNode) {
5092
- throw new Error("Method not implemented.");
5093
- }
5094
- isSameNode(otherNode) {
5095
- throw new Error("Method not implemented.");
5096
- }
5097
- lookupNamespaceURI(prefix) {
5098
- throw new Error("Method not implemented.");
5099
- }
5100
- lookupPrefix(namespace) {
5101
- throw new Error("Method not implemented.");
5102
- }
5103
- normalize() {
5104
- throw new Error("Method not implemented.");
5105
- }
5106
- removeChild(child) {
5107
- throw new Error("Method not implemented.");
5108
- }
5109
- replaceChild(node, child) {
5110
- throw new Error("Method not implemented.");
5111
- }
5112
- ELEMENT_NODE;
5113
- ATTRIBUTE_NODE;
5114
- TEXT_NODE;
5115
- CDATA_SECTION_NODE;
5116
- ENTITY_REFERENCE_NODE;
5117
- ENTITY_NODE;
5118
- PROCESSING_INSTRUCTION_NODE;
5119
- COMMENT_NODE;
5120
- DOCUMENT_NODE;
5121
- DOCUMENT_TYPE_NODE;
5122
- DOCUMENT_FRAGMENT_NODE;
5123
- NOTATION_NODE;
5124
- DOCUMENT_POSITION_DISCONNECTED;
5125
- DOCUMENT_POSITION_PRECEDING;
5126
- DOCUMENT_POSITION_FOLLOWING;
5127
- DOCUMENT_POSITION_CONTAINS;
5128
- DOCUMENT_POSITION_CONTAINED_BY;
5129
- DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
5130
- dispatchEvent(event) {
5131
- throw new Error("Method not implemented.");
5132
- }
5133
- ariaAtomic;
5134
- ariaAutoComplete;
5135
- ariaBrailleLabel;
5136
- ariaBrailleRoleDescription;
5137
- ariaBusy;
5138
- ariaChecked;
5139
- ariaColCount;
5140
- ariaColIndex;
5141
- ariaColSpan;
5142
- ariaCurrent;
5143
- ariaDescription;
5144
- ariaDisabled;
5145
- ariaExpanded;
5146
- ariaHasPopup;
5147
- ariaHidden;
5148
- ariaInvalid;
5149
- ariaKeyShortcuts;
5150
- ariaLabel;
5151
- ariaLevel;
5152
- ariaLive;
5153
- ariaModal;
5154
- ariaMultiLine;
5155
- ariaMultiSelectable;
5156
- ariaOrientation;
5157
- ariaPlaceholder;
5158
- ariaPosInSet;
5159
- ariaPressed;
5160
- ariaReadOnly;
5161
- ariaRequired;
5162
- ariaRoleDescription;
5163
- ariaRowCount;
5164
- ariaRowIndex;
5165
- ariaRowSpan;
5166
- ariaSelected;
5167
- ariaSetSize;
5168
- ariaSort;
5169
- ariaValueMax;
5170
- ariaValueMin;
5171
- ariaValueNow;
5172
- ariaValueText;
5173
- role;
5174
- animate(keyframes, options) {
5175
- throw new Error("Method not implemented.");
5176
- }
5177
- getAnimations(options) {
5178
- throw new Error("Method not implemented.");
5179
- }
5180
- after(...nodes) {
5181
- throw new Error("Method not implemented.");
5182
- }
5183
- before(...nodes) {
5184
- throw new Error("Method not implemented.");
5185
- }
5186
- remove() {
5187
- throw new Error("Method not implemented.");
5188
- }
5189
- replaceWith(...nodes) {
5190
- throw new Error("Method not implemented.");
5191
- }
5192
- nextElementSibling;
5193
- previousElementSibling;
5194
- childElementCount;
5195
- children;
5196
- firstElementChild;
5197
- lastElementChild;
5198
- append(...nodes) {
5199
- throw new Error("Method not implemented.");
5200
- }
5201
- prepend(...nodes) {
5202
- throw new Error("Method not implemented.");
5203
- }
5204
- querySelector(selectors) {
5205
- throw new Error("Method not implemented.");
5206
- }
5207
- querySelectorAll(selectors) {
5208
- throw new Error("Method not implemented.");
5209
- }
5210
- replaceChildren(...nodes) {
5211
- throw new Error("Method not implemented.");
5212
- }
5213
- assignedSlot;
5214
- attributeStyleMap;
5215
- style;
5216
- contentEditable;
5217
- enterKeyHint;
5218
- inputMode;
5219
- isContentEditable;
5220
- onabort;
5221
- onanimationcancel;
5222
- onanimationend;
5223
- onanimationiteration;
5224
- onanimationstart;
5225
- onauxclick;
5226
- onbeforeinput;
5227
- onbeforetoggle;
5228
- onblur;
5229
- oncancel;
5230
- oncanplay;
5231
- oncanplaythrough;
5232
- onchange;
5233
- onclick;
5234
- onclose;
5235
- oncontextlost;
5236
- oncontextmenu;
5237
- oncontextrestored;
5238
- oncopy;
5239
- oncuechange;
5240
- oncut;
5241
- ondblclick;
5242
- ondrag;
5243
- ondragend;
5244
- ondragenter;
5245
- ondragleave;
5246
- ondragover;
5247
- ondragstart;
5248
- ondrop;
5249
- ondurationchange;
5250
- onemptied;
5251
- onended;
5252
- onerror;
5253
- onfocus;
5254
- onformdata;
5255
- ongotpointercapture;
5256
- oninput;
5257
- oninvalid;
5258
- onkeydown;
5259
- onkeypress;
5260
- onkeyup;
5261
- onload;
5262
- onloadeddata;
5263
- onloadedmetadata;
5264
- onloadstart;
5265
- onlostpointercapture;
5266
- onmousedown;
5267
- onmouseenter;
5268
- onmouseleave;
5269
- onmousemove;
5270
- onmouseout;
5271
- onmouseover;
5272
- onmouseup;
5273
- onpaste;
5274
- onpause;
5275
- onplay;
5276
- onplaying;
5277
- onpointercancel;
5278
- onpointerdown;
5279
- onpointerenter;
5280
- onpointerleave;
5281
- onpointermove;
5282
- onpointerout;
5283
- onpointerover;
5284
- onpointerup;
5285
- onprogress;
5286
- onratechange;
5287
- onreset;
5288
- onresize;
5289
- onscroll;
5290
- onscrollend;
5291
- onsecuritypolicyviolation;
5292
- onseeked;
5293
- onseeking;
5294
- onselect;
5295
- onselectionchange;
5296
- onselectstart;
5297
- onslotchange;
5298
- onstalled;
5299
- onsubmit;
5300
- onsuspend;
5301
- ontimeupdate;
5302
- ontoggle;
5303
- ontouchcancel;
5304
- ontouchend;
5305
- ontouchmove;
5306
- ontouchstart;
5307
- ontransitioncancel;
5308
- ontransitionend;
5309
- ontransitionrun;
5310
- ontransitionstart;
5311
- onvolumechange;
5312
- onwaiting;
5313
- onwebkitanimationend;
5314
- onwebkitanimationiteration;
5315
- onwebkitanimationstart;
5316
- onwebkittransitionend;
5317
- onwheel;
5318
- autofocus;
5319
- dataset;
5320
- nonce;
5321
- tabIndex;
5322
- blur() {
5323
- throw new Error("Method not implemented.");
5324
- }
5325
- focus(options) {
5326
- throw new Error("Method not implemented.");
5327
- }
5328
- };
5329
- if (isBrowser) {
5330
- _ComponentWidget_ = class _ComponentWidget_ extends HTMLElement {
5331
- static {
5332
- __name(this, "_ComponentWidget_");
5333
- }
5334
- constructor() {
5335
- super();
5336
- const componentWidget = this;
5337
- const componentName = componentWidget.nodeName.toLowerCase();
5338
- const componentBody = _DOMCreateElement("quick-component");
5339
- const __enabled__atributes__ = componentWidget.getAttributeNames();
5340
- componentBody.setAttribute("name", componentName);
5341
- if (!componentWidget.hasAttribute("shadowed")) {
5342
- componentBody.setAttribute("shadowed", "true");
5343
- }
5344
- __enabled__atributes__.map(function(attributeName) {
5345
- if (componentWidget.hasAttribute(attributeName)) {
5346
- componentBody.setAttribute(attributeName, componentWidget?.getAttribute(attributeName));
5347
- componentWidget.removeAttribute(attributeName);
5348
- }
5349
- });
5350
- const data_attributenames = componentWidget.getAttributeNames().filter(function(a) {
5351
- return a.startsWith("data-");
5352
- }).map(function(a) {
5353
- return a.split("-")[1];
5354
- });
5355
- data_attributenames.map(function(_attribute_name_) {
5356
- componentBody.setAttribute("data-" + _attribute_name_, componentWidget?.getAttribute("data-" + _attribute_name_));
5357
- componentWidget.removeAttribute("data-" + _attribute_name_);
5358
- });
5359
- [...componentWidget.children].map(function(element) {
5360
- componentBody.appendChild(element.cloneNode(true));
5361
- element.remove();
5362
- });
5363
- componentWidget.append(componentBody);
5364
- }
5365
- };
5366
- } else {
5367
- _ComponentWidget_ = class _ComponentWidget_ extends QCObjectsWidgetNode {
5368
- static {
5369
- __name(this, "_ComponentWidget_");
5370
- }
5371
- constructor() {
5372
- super();
5373
- throw new Error("Class not implemented.");
5374
- }
5375
- };
5376
- }
5377
- Export(_ComponentWidget_);
5378
- RegisterWidget = /* @__PURE__ */ __name(function(widgetName) {
5379
- if (isBrowser) {
5380
- customElements.define(widgetName, class extends _ComponentWidget_ {
5381
- });
5382
- } else {
5383
- throw new Error("RegisterWidget is not implemented for non browser ecosystems yet.");
5384
- }
5385
- }, "RegisterWidget");
5386
- RegisterWidgets = /* @__PURE__ */ __name(function(...args) {
5387
- const widgetList = [...args];
5388
- widgetList.filter(function(widgetName) {
5389
- return typeof widgetName === "string";
5390
- }).map(function(widgetName) {
5391
- return RegisterWidget(widgetName);
5392
- });
5393
- }, "RegisterWidgets");
5394
- _protected_code_(RegisterWidget);
5395
- _protected_code_(RegisterWidgets);
5396
- Export(RegisterWidget);
5397
- Export(RegisterWidgets);
4467
+ })();
4468
+ }
4469
+ }
4470
+ var loadSDK_default;
4471
+ var init_loadSDK = __esm({
4472
+ "src/loadSDK.ts"() {
4473
+ "use strict";
4474
+ init_CONFIG();
4475
+ init_findPackageNodePath();
4476
+ init_Import();
4477
+ init_Logger();
4478
+ init_platform();
4479
+ __name(loadSDK, "loadSDK");
4480
+ loadSDK_default = loadSDK;
5398
4481
  }
5399
4482
  });
5400
4483
 
5401
- // src/Controller.ts
5402
- var Controller;
5403
- var init_Controller = __esm({
5404
- "src/Controller.ts"() {
4484
+ // src/MainProcess.ts
4485
+ var require_MainProcess = __commonJS({
4486
+ "src/MainProcess.ts"() {
5405
4487
  "use strict";
4488
+ init_asyncLoad();
4489
+ init_captureFalseTouch();
4490
+ init_Cast();
4491
+ init_Class();
5406
4492
  init_ClassFactory();
5407
- init_getType();
5408
- init_InheritClass();
4493
+ init_Component();
4494
+ init_ComponentFactory();
4495
+ init_componentLoader();
4496
+ init_CONFIG();
4497
+ init_DataStringify();
4498
+ init_defaultProcessors();
4499
+ init_Export();
4500
+ init_Import();
4501
+ init_introspection();
4502
+ init_isQCObjects();
5409
4503
  init_Logger();
4504
+ init_mathFunctions();
4505
+ init_NamespaceRef();
5410
4506
  init_New();
4507
+ init_ObjectName();
5411
4508
  init_Package();
5412
4509
  init_platform();
5413
- Controller = class extends InheritClass {
5414
- static {
5415
- __name(this, "Controller");
5416
- }
5417
- component;
5418
- dependencies = [];
5419
- constructor({
5420
- component,
5421
- dependencies
5422
- }) {
5423
- super({ component, dependencies });
5424
- this.component = component;
5425
- this.dependencies = dependencies;
5426
- if (typeof this.component === "undefined" || this.component === null) {
5427
- throw Error(`${__getType__(this)} must be called with a component`);
5428
- }
5429
- }
5430
- // eslint-disable-next-line no-unused-vars
5431
- fail(...args) {
5432
- throw new Error("Method not implemented.");
5433
- }
5434
- routingSelectedAttr(attrName) {
5435
- return this.component?.routingSelected.map((r) => {
5436
- return r[attrName];
5437
- }).filter(function(v) {
5438
- return v;
5439
- }).pop();
5440
- }
5441
- isTouchable() {
5442
- return "ontouchstart" in window || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
5443
- }
5444
- onpress(subelementSelector, handler) {
5445
- if (isBrowser) {
5446
- try {
5447
- if (this.isTouchable()) {
5448
- (this.component?.componentRoot?.subelements(subelementSelector))[0].addEventListener("touchstart", handler, {
5449
- passive: true
5450
- });
5451
- } else {
5452
- (this.component?.componentRoot?.subelements(subelementSelector))[0].addEventListener("click", handler, {
5453
- passive: true
5454
- });
5455
- }
5456
- } catch (e) {
5457
- logger.debug(`An error ocurred: ${e}.`);
5458
- logger.debug("No button to assign press event");
4510
+ init_PrimaryCollections();
4511
+ init_Ready();
4512
+ init_serviceLoader();
4513
+ init_Tag();
4514
+ init_top();
4515
+ init_Processor();
4516
+ init_is_a();
4517
+ init_getType();
4518
+ init_shortCode();
4519
+ init_DOMCreateElement();
4520
+ init_ComplexStorageCache();
4521
+ init_super();
4522
+ init_waitUntil();
4523
+ init_subelements();
4524
+ init_globalSettings();
4525
+ init_loadSDK();
4526
+ (/* @__PURE__ */ __name(function __qcobjects__(_top2) {
4527
+ if (typeof Object.defineProperty !== "undefined" && typeof _top2 !== "undefined") {
4528
+ try {
4529
+ Object.defineProperty(_top2, "__qcobjects__", {
4530
+ enumerable: true,
4531
+ configurable: false,
4532
+ writable: false,
4533
+ value: __qcobjects__
4534
+ });
4535
+ } catch (e) {
4536
+ logger.debug(`An error ocurred: ${e}`);
4537
+ if (typeof _top2.__qcobjects__ !== "undefined") {
4538
+ _top2.__qcobjects__.loaded = true;
5459
4539
  }
5460
4540
  }
5461
4541
  }
5462
- createRoutingController() {
5463
- const controller = this;
5464
- const component = controller.component;
5465
- const controllerName = controller.routingSelectedAttr("controllerclass");
5466
- if (typeof controllerName !== "undefined") {
5467
- const _Controller2 = ClassFactory(controllerName);
5468
- if (typeof _Controller2 !== "undefined" && component !== null) {
5469
- component.routingController = New(_Controller2, {
5470
- component
5471
- });
5472
- if (typeof component.routingController !== "undefined" && Object.hasOwn(component.routingController, "done") && typeof component.routingController.done === "function") {
5473
- component.routingController.done.call(component.routingController);
5474
- }
4542
+ if (typeof _top2.__qcobjects__.loaded === "undefined") {
4543
+ _top2.__qcobjects__.loaded = true;
4544
+ const global2 = _top2;
4545
+ _top2.global = global2;
4546
+ if (isBrowser) {
4547
+ Element.prototype.subelements = subelements;
4548
+ Document.prototype.subelements = subelements;
4549
+ HTMLElement.prototype.subelements = subelements;
4550
+ if (typeof ShadowRoot !== "undefined") {
4551
+ ShadowRoot.prototype.subelements = subelements;
5475
4552
  }
5476
4553
  }
5477
- }
5478
- done() {
5479
- }
5480
- };
5481
- Package("com.qcobjects.controllers", [
5482
- Controller
5483
- ]);
5484
- }
5485
- });
5486
-
5487
- // src/View.ts
5488
- var View;
5489
- var init_View = __esm({
5490
- "src/View.ts"() {
5491
- "use strict";
5492
- init_getType();
5493
- init_InheritClass();
5494
- init_Package();
5495
- View = class extends InheritClass {
5496
- static {
5497
- __name(this, "View");
5498
- }
5499
- constructor({ component = void 0, dependencies = [] }) {
5500
- super({ component, dependencies });
5501
- if (typeof this.component === "undefined" || this.component === "null") {
5502
- throw Error(`${__getType__(this)} must be called with a component`);
5503
- }
5504
- }
5505
- };
5506
- Package("com.qcobjects.views", [
5507
- View
5508
- ]);
5509
- }
5510
- });
5511
-
5512
- // src/VO.ts
5513
- var VO;
5514
- var init_VO = __esm({
5515
- "src/VO.ts"() {
5516
- "use strict";
5517
- init_InheritClass();
5518
- init_Package();
5519
- VO = class extends InheritClass {
5520
- static {
5521
- __name(this, "VO");
5522
- }
5523
- };
5524
- Package("com.qcobjects.valueObjects", [
5525
- VO
5526
- ]);
5527
- }
5528
- });
5529
-
5530
- // src/Effect.ts
5531
- var Effect;
5532
- var init_Effect = __esm({
5533
- "src/Effect.ts"() {
5534
- "use strict";
5535
- init_InheritClass();
5536
- init_Package();
5537
- Effect = class extends InheritClass {
5538
- static {
5539
- __name(this, "Effect");
5540
- }
5541
- // eslint-disable-next-line no-unused-vars
5542
- done(...args) {
5543
- throw new Error("Method not implemented.");
5544
- }
5545
- // eslint-disable-next-line no-unused-vars
5546
- apply(...args) {
5547
- throw new Error("Method not implemented.");
5548
- }
5549
- duration = 1e3;
5550
- animate({
5551
- timing,
5552
- draw,
5553
- duration
5554
- }) {
5555
- const _self = this;
5556
- const start = performance.now();
5557
- requestAnimationFrame(/* @__PURE__ */ __name(function animate(time) {
5558
- let timeFraction = (time - start) / duration;
5559
- if (timeFraction > 1) timeFraction = 1;
5560
- const progress = timing(timeFraction);
5561
- draw(Math.round(progress * 100));
5562
- if (timeFraction < 1) {
5563
- requestAnimationFrame(animate);
5564
- } else {
5565
- if (typeof _self !== "undefined" && _self !== null && Object.hasOwn(_self, "done") && (typeof _self.done).toLowerCase() === "function") {
5566
- _self.done.call(_self);
5567
- }
5568
- }
5569
- }, "animate"));
5570
- }
5571
- };
5572
- Package("com.qcobjects.effects.base", [
5573
- Effect
5574
- ]);
5575
- }
5576
- });
5577
-
5578
- // src/TransitionEffect.ts
5579
- var TransitionEffect;
5580
- var init_TransitionEffect = __esm({
5581
- "src/TransitionEffect.ts"() {
5582
- "use strict";
5583
- init_Effect();
5584
- init_Logger();
5585
- init_Package();
5586
- init_ClassFactory();
5587
- TransitionEffect = class extends Effect {
5588
- static {
5589
- __name(this, "TransitionEffect");
5590
- }
5591
- duration = 385;
5592
- defaultParams = {
5593
- alphaFrom: 0,
5594
- alphaTo: 1,
5595
- angleFrom: 180,
5596
- angleTo: 0,
5597
- radiusFrom: 0,
5598
- radiusTo: 30,
5599
- scaleFrom: 0,
5600
- scaleTo: 1
5601
- };
5602
- fitToHeight = false;
5603
- fitToWidth = false;
5604
- component;
5605
- effects;
5606
- apply({
5607
- alphaFrom,
5608
- alphaTo,
5609
- angleFrom,
5610
- angleTo,
5611
- radiusFrom,
5612
- radiusTo,
5613
- scaleFrom,
5614
- scaleTo
5615
- }) {
5616
- const _transition_ = this;
5617
- logger.info("EXECUTING TransitionEffect ");
5618
- const componentRoot = _transition_.component.componentRoot;
5619
- if (typeof componentRoot !== "undefined" && componentRoot !== null) {
5620
- if (_transition_.fitToHeight) {
5621
- componentRoot.height = typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null ? componentRoot.offsetParent?.scrollHeight : componentRoot.getBoundingClientRect().height;
5622
- }
5623
- if (_transition_.fitToWidth) {
5624
- componentRoot.width = typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null ? componentRoot.offsetParent?.scrollWidth : componentRoot.getBoundingClientRect().width;
5625
- }
5626
- if (_transition_.component.shadowed) {
5627
- componentRoot.host.style.display = "block";
5628
- } else {
5629
- componentRoot.style.display = "block";
5630
- }
5631
- _transition_.effects.map((effectClassName) => {
5632
- const __effectClass__ = ClassFactory(effectClassName);
5633
- const effectObj = new __effectClass__({});
5634
- const effectClassMethod = effectObj.apply.bind(_transition_);
5635
- const componentHost = _transition_.component.shadowed ? componentRoot.host : componentRoot;
5636
- const effectParams = {
5637
- alphaFrom,
5638
- alphaTo,
5639
- angleFrom,
5640
- angleTo,
5641
- radiusFrom,
5642
- radiusTo,
5643
- scaleFrom,
5644
- scaleTo
5645
- };
5646
- effectClassMethod(componentHost, ...Object.values(effectParams));
5647
- return effectClassName;
5648
- });
4554
+ logger.debugEnabled = false;
4555
+ logger.infoEnabled = true;
4556
+ _top2.logger = logger;
4557
+ if (isBrowser) {
4558
+ Element.prototype.find = function(tag) {
4559
+ const _self = this;
4560
+ const _oo = [];
4561
+ const _tags = document.subelements(tag);
4562
+ _tags.map((_tt, _t) => {
4563
+ if (typeof _tags[_t] !== "undefined" && _tags[_t].parentNode.tagName === _self.parentNode.tagName) {
4564
+ _oo.push(_Cast(_tt, new Object()));
4565
+ }
4566
+ return _tt;
4567
+ });
4568
+ return _oo;
4569
+ };
5649
4570
  }
5650
- }
5651
- };
5652
- Package("com.qcobjects.effects.transitions.base", [
5653
- TransitionEffect
5654
- ]);
5655
- }
5656
- });
5657
-
5658
- // src/Timer.ts
5659
- var Timer;
5660
- var init_Timer = __esm({
5661
- "src/Timer.ts"() {
5662
- "use strict";
5663
- init_InheritClass();
5664
- init_Package();
5665
- Timer = class extends InheritClass {
5666
- static {
5667
- __name(this, "Timer");
5668
- }
5669
- duration = 1e3;
5670
- alive = true;
5671
- thread({
5672
- timing,
5673
- intervalInterceptor,
5674
- duration
5675
- }) {
5676
- const timer = this;
5677
- const start = performance.now();
5678
- requestAnimationFrame(/* @__PURE__ */ __name(function thread(time) {
5679
- const elapsed = time - start;
5680
- let timeFraction = elapsed / duration;
5681
- if (timeFraction > 1) timeFraction = 1;
5682
- const progress = timing(timeFraction, elapsed);
5683
- intervalInterceptor(Math.round(progress * 100));
5684
- if ((timeFraction < 1 || duration === -1) && timer.alive) {
5685
- requestAnimationFrame(thread);
5686
- }
5687
- }, "thread"));
5688
- }
5689
- };
5690
- Package("com.qcobjects.timing", [
5691
- Timer
5692
- ]);
5693
- }
5694
- });
5695
-
5696
- // src/DDO.ts
5697
- var DDO;
5698
- var init_DDO = __esm({
5699
- "src/DDO.ts"() {
5700
- "use strict";
5701
- init_Export();
5702
- init_InheritClass();
5703
- init_Logger();
5704
- init_ObjectName();
5705
- DDO = class extends InheritClass {
5706
- static {
5707
- __name(this, "DDO");
5708
- }
5709
- constructor({
5710
- instance,
5711
- name,
5712
- fget,
5713
- fset,
5714
- value
5715
- }) {
5716
- super({
5717
- instance,
5718
- name,
5719
- fget,
5720
- fset,
5721
- value
5722
- });
5723
- this._new_({
5724
- instance,
5725
- name,
5726
- fget,
5727
- fset,
5728
- value
5729
- });
5730
- }
5731
- _new_({
5732
- instance,
5733
- name,
5734
- fget,
5735
- fset
5736
- }) {
5737
- const ddoInstance = this;
5738
- var name = typeof name === "undefined" ? ObjectName(ddoInstance) : name;
5739
- Object.defineProperty(instance, name, {
5740
- set(val) {
5741
- const _value = val;
5742
- logger.debug("value changed " + name);
5743
- let ret;
5744
- if (typeof fset !== "undefined" && typeof fset === "function") {
5745
- ret = fset(_value);
4571
+ if (isBrowser) {
4572
+ Element.prototype.append = /* @__PURE__ */ __name(function QC_Append(child) {
4573
+ if (isQCObjects_Object(child) || typeof child.body !== "undefined") {
4574
+ this.appendChild(child.body);
5746
4575
  } else {
5747
- ret = _value;
4576
+ this.appendChild(child);
5748
4577
  }
5749
- instance["_" + name] = ret;
5750
- },
5751
- get() {
5752
- const _value = instance["_" + name];
5753
- logger.debug("returning value " + name);
5754
- const is_ddo = /* @__PURE__ */ __name((v) => {
5755
- if (typeof v === "object" && Object.hasOwn(v, "value")) {
5756
- return v.value;
4578
+ }, "QC_Append");
4579
+ Element.prototype.render = /* @__PURE__ */ __name(function QC_Render(content) {
4580
+ const _self = this;
4581
+ const _appendVDOM = /* @__PURE__ */ __name((_self2, content2) => {
4582
+ if (typeof document.implementation.createHTMLDocument !== "undefined") {
4583
+ const doc = document.implementation.createHTMLDocument("");
4584
+ doc.body.innerHTML = content2;
4585
+ doc.body.subelements("*").map((element) => {
4586
+ return _self2.append(element);
4587
+ });
4588
+ }
4589
+ }, "_appendVDOM");
4590
+ if (typeof this.innerHTML !== "undefined") {
4591
+ try {
4592
+ this.innerHTML += content;
4593
+ } catch (e) {
4594
+ logger.debug(`An error ocurred: ${e}`);
4595
+ _appendVDOM(_self, content);
5757
4596
  }
5758
- return v;
5759
- }, "is_ddo");
5760
- let ret;
5761
- if (typeof fget !== "undefined" && typeof fget === "function") {
5762
- ret = fget(is_ddo(_value));
5763
- } else {
5764
- ret = is_ddo(_value);
5765
- }
5766
- return ret;
5767
- }
5768
- });
5769
- }
5770
- };
5771
- Export(DDO);
5772
- }
5773
- });
5774
-
5775
- // src/Toggle.ts
5776
- var Toggle;
5777
- var init_Toggle = __esm({
5778
- "src/Toggle.ts"() {
5779
- "use strict";
5780
- init_InheritClass();
5781
- init_Logger();
5782
- init_Package();
5783
- Toggle = class extends InheritClass {
5784
- static {
5785
- __name(this, "Toggle");
5786
- }
5787
- _toggle = false;
5788
- _inverse = true;
5789
- _positive = null;
5790
- _negative = null;
5791
- _dispatched = null;
5792
- _args = {};
5793
- constructor(positive, negative, args) {
5794
- super({ positive, negative, args });
5795
- this._new_({ positive, negative, args });
5796
- }
5797
- changeToggle() {
5798
- this._toggle = !this._toggle;
5799
- }
5800
- _new_({
5801
- positive,
5802
- negative,
5803
- args
5804
- }) {
5805
- this._positive = positive;
5806
- this._negative = negative;
5807
- this._args = args;
5808
- }
5809
- fire() {
5810
- const toggle = this;
5811
- var _promise = new Promise(function(resolve, reject) {
5812
- if (typeof toggle._positive === "function" && typeof toggle._negative === "function") {
5813
- if (toggle._inverse) {
5814
- toggle._dispatched = toggle._toggle ? toggle._negative.bind(toggle) : toggle._positive.bind(toggle);
5815
4597
  } else {
5816
- toggle._dispatched = toggle._toggle ? toggle._positive.bind(toggle) : toggle._negative.bind(toggle);
4598
+ _appendVDOM(_self, content);
5817
4599
  }
5818
- toggle._dispatched?.call(toggle, toggle._args);
5819
- resolve.call(_promise, toggle);
5820
- } else {
5821
- logger.debug("Toggle functions are not declared");
5822
- reject.call(_promise, toggle);
5823
- }
5824
- return toggle;
5825
- }).then(function(toggle2) {
5826
- toggle2.changeToggle();
5827
- return toggle2;
5828
- }).catch(function(e) {
5829
- logger.debug(e.toString());
5830
- return toggle;
5831
- }).finally(() => {
5832
- return toggle;
5833
- });
5834
- return _promise;
5835
- }
5836
- };
5837
- Package("com.qcobjects.tools.essentials", [
5838
- Toggle
5839
- ]);
5840
- }
5841
- });
5842
-
5843
- // src/DocumentLayout.ts
5844
- var getDocumentLayout;
5845
- var init_DocumentLayout = __esm({
5846
- "src/DocumentLayout.ts"() {
5847
- "use strict";
5848
- getDocumentLayout = /* @__PURE__ */ __name(function() {
5849
- const h = /* @__PURE__ */ __name((w, h2) => {
5850
- return w > h2 ? "landscape" : null;
5851
- }, "h");
5852
- const v = /* @__PURE__ */ __name((w, h2) => {
5853
- return h2 > w ? "portrait" : null;
5854
- }, "v");
5855
- const square = /* @__PURE__ */ __name((w, h2) => {
5856
- return w === h2 ? "square" : null;
5857
- }, "square");
5858
- return [
5859
- h(document.documentElement.clientWidth, document.documentElement.clientHeight),
5860
- v(document.documentElement.clientWidth, document.documentElement.clientHeight),
5861
- square(document.documentElement.clientWidth, document.documentElement.clientHeight)
5862
- ].filter((e) => e !== null).pop();
5863
- }, "getDocumentLayout");
5864
- }
5865
- });
5866
-
5867
- // src/types/global/index.d.ts
5868
- var init_index_d = __esm({
5869
- "src/types/global/index.d.ts"() {
5870
- "use strict";
5871
- }
5872
- });
5873
-
5874
- // src/loadSDK.ts
5875
- function loadSDK() {
5876
- if (CONFIG.get("useSDK")) {
5877
- (function() {
5878
- const remoteImportsPath = CONFIG.get("remoteImportsPath");
5879
- const external = !CONFIG.get("useLocalSDK");
5880
- CONFIG.set("remoteImportsPath", CONFIG.get("remoteSDKPath"));
5881
- let tryImportingSDK = false;
5882
- let sdkName = "QCObjects-SDK";
5883
- if (isBrowser) {
5884
- tryImportingSDK = true;
5885
- } else {
5886
- const sdkPath = findPackageNodePath("qcobjects-sdk");
5887
- if (sdkPath !== null) {
5888
- sdkName = "qcobjects-sdk";
5889
- tryImportingSDK = true;
5890
- } else if (sdkPath !== "") {
5891
- sdkName = "node_modules/qcobjects-sdk/QCObjects-SDK";
5892
- tryImportingSDK = true;
5893
- } else {
5894
- tryImportingSDK = false;
4600
+ }, "QC_Render");
5895
4601
  }
5896
- }
5897
- if (tryImportingSDK) {
5898
- logger.info("Importing SDK... " + sdkName);
5899
- if (isNodeCommonJS && typeof require !== "undefined") {
5900
- const sdk = _require_("qcobjects-sdk");
5901
- if (sdk) {
5902
- logger.debug("QCObjects SDK was loaded OK.");
5903
- } else {
5904
- logger.debug("QCObjects SDK could not be imported.");
4602
+ Export(waitUntil);
4603
+ Export(_super_);
4604
+ Export(ComplexStorageCache);
4605
+ Export(ClassFactory);
4606
+ Export(_DOMCreateElement);
4607
+ Export(shortCode);
4608
+ Export(__getType__);
4609
+ Export(is_a);
4610
+ Package("com.qcobjects", [Processor]);
4611
+ if (isBrowser) {
4612
+ Element.prototype.Cast = /* @__PURE__ */ __name(function QC_Cast(_o) {
4613
+ const _self = this;
4614
+ return _Cast(_self, _o);
4615
+ }, "QC_Cast");
4616
+ }
4617
+ if (isBrowser) {
4618
+ window.onload = _Ready;
4619
+ if (is_phonegap) {
4620
+ document.addEventListener("deviceready", _Ready, captureFalseTouch);
5905
4621
  }
5906
4622
  } else {
5907
- Import(sdkName, function() {
5908
- if (external) {
5909
- logger.debug("QCObjects-SDK.js loaded from remote location");
5910
- } else {
5911
- logger.debug("QCObjects-SDK.js loaded from local");
5912
- }
5913
- CONFIG.set("remoteImportsPath", remoteImportsPath);
5914
- }, external)?.catch((e) => {
5915
- throw new Error(`An error ocurred when trying to import: ${e}`);
5916
- });
5917
- }
5918
- } else {
5919
- logger.debug("SDK has not been imported as it is not available at the moment");
5920
- }
5921
- })();
5922
- }
5923
- }
5924
- var loadSDK_default;
5925
- var init_loadSDK = __esm({
5926
- "src/loadSDK.ts"() {
5927
- "use strict";
5928
- init_CONFIG();
5929
- init_findPackageNodePath();
5930
- init_Import();
5931
- init_Logger();
5932
- init_platform();
5933
- __name(loadSDK, "loadSDK");
5934
- loadSDK_default = loadSDK;
5935
- }
5936
- });
5937
-
5938
- // src/MainProcess.ts
5939
- var require_MainProcess = __commonJS({
5940
- "src/MainProcess.ts"() {
5941
- "use strict";
5942
- init_asyncLoad();
5943
- init_captureFalseTouch();
5944
- init_Cast();
5945
- init_Class();
5946
- init_ClassFactory();
5947
- init_Component();
5948
- init_ComponentFactory();
5949
- init_componentLoader();
5950
- init_CONFIG();
5951
- init_DataStringify();
5952
- init_defaultProcessors();
5953
- init_Export();
5954
- init_Import();
5955
- init_introspection();
5956
- init_isQCObjects();
5957
- init_Logger();
5958
- init_mathFunctions();
5959
- init_NamespaceRef();
5960
- init_New();
5961
- init_ObjectName();
5962
- init_Package();
5963
- init_platform();
5964
- init_PrimaryCollections();
5965
- init_Ready();
5966
- init_serviceLoader();
5967
- init_Tag();
5968
- init_top();
5969
- init_Processor();
5970
- init_is_a();
5971
- init_getType();
5972
- init_shortCode();
5973
- init_DOMCreateElement();
5974
- init_ComplexStorageCache();
5975
- init_super();
5976
- init_waitUntil();
5977
- init_subelements();
5978
- init_globalSettings();
5979
- init_loadSDK();
5980
- (/* @__PURE__ */ __name(function __qcobjects__(_top2) {
5981
- if (typeof Object.defineProperty !== "undefined" && typeof _top2 !== "undefined") {
5982
- try {
5983
- Object.defineProperty(_top2, "__qcobjects__", {
5984
- enumerable: true,
5985
- configurable: false,
5986
- writable: false,
5987
- value: __qcobjects__
5988
- });
5989
- } catch (e) {
5990
- logger.debug(`An error ocurred: ${e}`);
5991
- if (typeof _top2.__qcobjects__ !== "undefined") {
5992
- _top2.__qcobjects__.loaded = true;
5993
- }
5994
- }
5995
- }
5996
- if (typeof _top2.__qcobjects__.loaded === "undefined") {
5997
- _top2.__qcobjects__.loaded = true;
5998
- const global2 = _top2;
5999
- _top2.global = global2;
6000
- if (isBrowser) {
6001
- Element.prototype.subelements = subelements;
6002
- Document.prototype.subelements = subelements;
6003
- HTMLElement.prototype.subelements = subelements;
6004
- if (typeof ShadowRoot !== "undefined") {
6005
- ShadowRoot.prototype.subelements = subelements;
6006
- }
6007
- }
6008
- logger.debugEnabled = false;
6009
- logger.infoEnabled = true;
6010
- _top2.logger = logger;
6011
- if (isBrowser) {
6012
- Element.prototype.find = function(tag) {
6013
- const _self = this;
6014
- const _oo = [];
6015
- const _tags = document.subelements(tag);
6016
- _tags.map((_tt, _t) => {
6017
- if (typeof _tags[_t] !== "undefined" && _tags[_t].parentNode.tagName === _self.parentNode.tagName) {
6018
- _oo.push(_Cast(_tt, new Object()));
6019
- }
6020
- return _tt;
6021
- });
6022
- return _oo;
6023
- };
6024
- }
6025
- if (isBrowser) {
6026
- Element.prototype.append = /* @__PURE__ */ __name(function QC_Append(child) {
6027
- if (isQCObjects_Object(child) || typeof child.body !== "undefined") {
6028
- this.appendChild(child.body);
6029
- } else {
6030
- this.appendChild(child);
6031
- }
6032
- }, "QC_Append");
6033
- Element.prototype.render = /* @__PURE__ */ __name(function QC_Render(content) {
6034
- const _self = this;
6035
- const _appendVDOM = /* @__PURE__ */ __name((_self2, content2) => {
6036
- if (typeof document.implementation.createHTMLDocument !== "undefined") {
6037
- const doc = document.implementation.createHTMLDocument("");
6038
- doc.body.innerHTML = content2;
6039
- doc.body.subelements("*").map((element) => {
6040
- return _self2.append(element);
6041
- });
6042
- }
6043
- }, "_appendVDOM");
6044
- if (typeof this.innerHTML !== "undefined") {
6045
- try {
6046
- this.innerHTML += content;
6047
- } catch (e) {
6048
- logger.debug(`An error ocurred: ${e}`);
6049
- _appendVDOM(_self, content);
6050
- }
6051
- } else {
6052
- _appendVDOM(_self, content);
6053
- }
6054
- }, "QC_Render");
6055
- }
6056
- Export(waitUntil);
6057
- Export(_super_);
6058
- Export(ComplexStorageCache);
6059
- Export(ClassFactory);
6060
- Export(_DOMCreateElement);
6061
- Export(shortCode);
6062
- Export(__getType__);
6063
- Export(is_a);
6064
- Package("com.qcobjects", [Processor]);
6065
- if (isBrowser) {
6066
- Element.prototype.Cast = /* @__PURE__ */ __name(function QC_Cast(_o) {
6067
- const _self = this;
6068
- return _Cast(_self, _o);
6069
- }, "QC_Cast");
6070
- }
6071
- if (isBrowser) {
6072
- window.onload = _Ready;
6073
- if (is_phonegap) {
6074
- document.addEventListener("deviceready", _Ready, captureFalseTouch);
6075
- }
6076
- } else {
6077
- global2.onload = _Ready;
6078
- }
6079
- if (isBrowser) {
6080
- window.addEventListener("popstate", function(popStateEvent) {
6081
- popStateEvent.stopImmediatePropagation();
6082
- popStateEvent.stopPropagation();
6083
- Component.route().catch((e) => {
6084
- throw new Error(`An error ocurred when trying to load initial routes. ${e}`);
6085
- });
4623
+ global2.onload = _Ready;
4624
+ }
4625
+ if (isBrowser) {
4626
+ window.addEventListener("popstate", function(popStateEvent) {
4627
+ popStateEvent.stopImmediatePropagation();
4628
+ popStateEvent.stopPropagation();
4629
+ Component.route().catch((e) => {
4630
+ throw new Error(`An error ocurred when trying to load initial routes. ${e}`);
4631
+ });
6086
4632
  });
6087
4633
  }
6088
4634
  Export(serviceLoader);
@@ -6416,171 +4962,1522 @@ var require_MainProcess = __commonJS({
6416
4962
  });
6417
4963
 
6418
4964
  // src/QCObjects.ts
6419
- var QCObjects_exports = {};
6420
- __export(QCObjects_exports, {
6421
- ArrayCollection: () => ArrayCollection,
6422
- ArrayList: () => ArrayList,
6423
- AssignPolyfill: () => AssignPolyfill,
6424
- BackendMicroservice: () => BackendMicroservice,
6425
- CONFIG: () => CONFIG,
6426
- Class: () => Class,
6427
- ClassFactory: () => ClassFactory,
6428
- ComplexStorageCache: () => ComplexStorageCache,
6429
- Component: () => Component,
6430
- ComponentURI: () => ComponentURI,
6431
- ConfigService: () => ConfigService,
6432
- Controller: () => Controller,
6433
- DDO: () => DDO,
6434
- DefaultTemplateHandler: () => DefaultTemplateHandler,
6435
- Effect: () => Effect,
6436
- Export: () => Export,
6437
- GlobalSettings: () => GlobalSettings,
6438
- Import: () => Import,
6439
- InheritClass: () => InheritClass,
6440
- JSONService: () => JSONService,
6441
- Logger: () => Logger,
6442
- NamespaceRef: () => NamespaceRef,
6443
- New: () => New,
6444
- ObjectName: () => ObjectName,
6445
- Package: () => Package,
6446
- Processor: () => Processor,
6447
- QCObjects: () => QCObjects,
6448
- Ready: () => Ready,
6449
- RegisterClass: () => RegisterClass,
6450
- RegisterWidget: () => RegisterWidget,
6451
- RegisterWidgets: () => RegisterWidgets,
6452
- Service: () => Service,
6453
- SourceCSS: () => SourceCSS,
6454
- SourceJS: () => SourceJS,
6455
- Tag: () => Tag,
6456
- TagElements: () => TagElements,
6457
- Timer: () => Timer,
6458
- Toggle: () => Toggle,
6459
- TransitionEffect: () => TransitionEffect,
6460
- VO: () => VO,
6461
- View: () => View,
6462
- _Cast: () => _Cast,
6463
- _CastProps: () => _CastProps,
6464
- _ComponentWidget_: () => _ComponentWidget_,
6465
- _Crypt: () => _Crypt,
6466
- _DOMCreateElement: () => _DOMCreateElement,
6467
- _DataStringify: () => _DataStringify,
6468
- _LegacyCopy: () => _LegacyCopy,
6469
- _QC_CLASSES: () => _QC_CLASSES,
6470
- _QC_PACKAGES: () => _QC_PACKAGES,
6471
- _QC_PACKAGES_IMPORTED: () => _QC_PACKAGES_IMPORTED,
6472
- _QC_READY_LISTENERS: () => _QC_READY_LISTENERS,
6473
- _Ready: () => _Ready,
6474
- __getType__: () => __getType__,
6475
- __instanceID: () => __instanceID,
6476
- __is_raw_class__: () => __is_raw_class__,
6477
- __make_global__: () => __make_global__,
6478
- __to_number: () => __to_number,
6479
- _buildComponentsFromElements_: () => _buildComponentsFromElements_,
6480
- _fireAsyncLoad: () => _fireAsyncLoad,
6481
- _methods_: () => _methods_,
6482
- _protected_code_: () => _protected_code_,
6483
- _require_: () => _require_,
6484
- _super_: () => _super_,
6485
- _tag_filter_: () => _tag_filter_,
6486
- _top: () => _top,
6487
- asyncLoad: () => asyncLoad,
6488
- captureFalseTouch: () => captureFalseTouch,
6489
- componentLoader: () => componentLoader,
6490
- findPackageNodePath: () => findPackageNodePath,
6491
- getDocumentLayout: () => getDocumentLayout,
6492
- global: () => _top,
6493
- isBrowser: () => isBrowser,
6494
- isNodeCommonJS: () => isNodeCommonJS,
6495
- isQCObjects_Class: () => isQCObjects_Class,
6496
- isQCObjects_Object: () => isQCObjects_Object,
6497
- is_a: () => is_a,
6498
- is_phonegap: () => is_phonegap,
6499
- logger: () => logger,
6500
- range: () => range,
6501
- ready: () => ready,
6502
- resetTop: () => resetTop,
6503
- serviceLoader: () => serviceLoader,
6504
- setDefaultProcessors: () => setDefaultProcessors,
6505
- shortCode: () => shortCode,
6506
- subelements: () => subelements,
6507
- waitUntil: () => waitUntil
6508
- });
6509
- var AssignPolyfill, QCObjects;
6510
- var init_QCObjects = __esm({
6511
- "src/QCObjects.ts"() {
6512
- "use strict";
6513
- AssignPolyfill = __toESM(require_assign());
6514
- init_top();
6515
- init_PrimaryCollections();
6516
- init_DataStringify();
6517
- init_DOMCreateElement();
6518
- init_introspection();
6519
- init_Logger();
6520
- init_platform();
6521
- init_subelements();
6522
- init_is_raw_class();
6523
- init_LegacyCopy();
6524
- init_asyncLoad();
6525
- init_IncrementInstanceID();
6526
- init_ObjectName();
6527
- init_getType();
6528
- init_is_a();
6529
- init_ComplexStorageCache();
6530
- init_waitUntil();
6531
- init_Cast();
6532
- init_isQCObjects();
6533
- init_Package();
6534
- init_ClassFactory();
6535
- init_Export();
6536
- init_Class();
6537
- init_InheritClass();
6538
- init_super();
6539
- init_shortCode();
6540
- init_Processor();
6541
- init_New();
6542
- init_Ready();
6543
- init_captureFalseTouch();
6544
- init_serviceLoader();
6545
- init_componentLoader();
6546
- init_ComponentFactory();
6547
- init_NamespaceRef();
6548
- init_defaultProcessors();
6549
- init_Tag();
6550
- init_Import();
6551
- init_BackendMicroservice();
6552
- init_Component();
6553
- init_Crypt();
6554
- init_DefaultTemplateHandler();
6555
- init_SourceJS();
6556
- init_SourceCSS();
6557
- init_globalSettings();
6558
- init_RegisterClass();
6559
- init_WidgetsFactory();
6560
- init_CONFIG();
6561
- init_Controller();
6562
- init_View();
6563
- init_Service();
6564
- init_VO();
6565
- init_Effect();
6566
- init_TransitionEffect();
6567
- init_Timer();
6568
- init_tag_filter();
6569
- init_range();
6570
- init_ArrayCollection();
6571
- init_DDO();
6572
- init_Toggle();
6573
- init_findPackageNodePath();
6574
- init_DocumentLayout();
6575
- init_index_d();
6576
- init_mathFunctions();
6577
- init_top();
6578
- init_make_global();
6579
- QCObjects = __toESM(require_MainProcess());
4965
+ var AssignPolyfill = __toESM(require_assign());
4966
+ init_top();
4967
+ init_PrimaryCollections();
4968
+ init_DataStringify();
4969
+ init_DOMCreateElement();
4970
+ init_introspection();
4971
+ init_Logger();
4972
+ init_platform();
4973
+ init_subelements();
4974
+ init_is_raw_class();
4975
+ init_LegacyCopy();
4976
+ init_asyncLoad();
4977
+ init_IncrementInstanceID();
4978
+ init_ObjectName();
4979
+ init_getType();
4980
+ init_is_a();
4981
+ init_ComplexStorageCache();
4982
+ init_waitUntil();
4983
+ init_Cast();
4984
+ init_isQCObjects();
4985
+ init_Package();
4986
+ init_ClassFactory();
4987
+ init_Export();
4988
+ init_Class();
4989
+ init_InheritClass();
4990
+ init_super();
4991
+ init_shortCode();
4992
+ init_Processor();
4993
+ init_New();
4994
+ init_Ready();
4995
+ init_captureFalseTouch();
4996
+ init_serviceLoader();
4997
+ init_componentLoader();
4998
+ init_ComponentFactory();
4999
+ init_NamespaceRef();
5000
+ init_defaultProcessors();
5001
+ init_Tag();
5002
+ init_Import();
5003
+
5004
+ // src/BackendMicroservice.ts
5005
+ init_basePath();
5006
+ init_DataStringify();
5007
+ init_domain();
5008
+ init_InheritClass();
5009
+ init_Logger();
5010
+ init_Package();
5011
+ var BackendMicroservice = class extends InheritClass {
5012
+ static {
5013
+ __name(this, "BackendMicroservice");
6580
5014
  }
6581
- });
5015
+ stream;
5016
+ route;
5017
+ headers;
5018
+ request;
5019
+ constructor({
5020
+ domain = _domain_,
5021
+ basePath = _basePath_,
5022
+ body = null,
5023
+ stream = null,
5024
+ request = null
5025
+ }) {
5026
+ super({
5027
+ domain,
5028
+ basePath,
5029
+ body,
5030
+ stream,
5031
+ request
5032
+ });
5033
+ logger.debug("Initializing BackendMicroservice...");
5034
+ const microservice = this;
5035
+ if (typeof this.body === "undefined") {
5036
+ this.body = null;
5037
+ }
5038
+ if (typeof body !== "undefined") {
5039
+ this.body = body;
5040
+ }
5041
+ this.cors();
5042
+ microservice.stream = stream;
5043
+ stream?.on("data", (data) => {
5044
+ const requestMethod2 = request?.method.toLowerCase();
5045
+ const supportedMethods2 = {
5046
+ "post": microservice.post.bind(microservice)
5047
+ };
5048
+ if (Object.hasOwn(supportedMethods2, requestMethod2)) {
5049
+ supportedMethods2[requestMethod2].call(microservice, data);
5050
+ }
5051
+ });
5052
+ const requestMethod = request?.method.toLowerCase();
5053
+ const supportedMethods = {
5054
+ "get": microservice.get.bind(microservice),
5055
+ "head": microservice.head.bind(microservice),
5056
+ "put": microservice.put.bind(microservice),
5057
+ "delete": microservice.delete.bind(microservice),
5058
+ "connect": microservice.connect.bind(microservice),
5059
+ "options": microservice.options.bind(microservice),
5060
+ "trace": microservice.trace.bind(microservice),
5061
+ "patch": microservice.patch.bind(microservice)
5062
+ };
5063
+ if (Object.hasOwn(supportedMethods, requestMethod)) {
5064
+ supportedMethods[requestMethod].call(microservice);
5065
+ }
5066
+ }
5067
+ cors() {
5068
+ if (this.route.cors) {
5069
+ logger.debug("Validating CORS...");
5070
+ const {
5071
+ allow_origins,
5072
+ allow_credentials,
5073
+ allow_methods,
5074
+ allow_headers
5075
+ } = this.route.cors;
5076
+ const microservice = this;
5077
+ if (typeof microservice.headers !== "object") {
5078
+ microservice.headers = {};
5079
+ }
5080
+ if (typeof microservice.route.responseHeaders !== "object") {
5081
+ microservice.route.responseHeaders = {};
5082
+ }
5083
+ if (typeof allow_origins !== "undefined") {
5084
+ logger.debug("CORS: allow_origins available. Validating origins...");
5085
+ if (allow_origins === "*" || typeof microservice.request.headers.origin === "undefined" || [...allow_origins].indexOf(microservice.request.headers.origin) !== -1) {
5086
+ logger.debug("CORS: Adding header Access-Control-Allow-Origin=*");
5087
+ microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*";
5088
+ } else {
5089
+ logger.debug("CORS: Origin is not allowed: " + microservice.request.headers.origin);
5090
+ logger.debug("CORS: Forcing to finish the response...");
5091
+ this.body = {};
5092
+ try {
5093
+ this.done();
5094
+ } catch (e) {
5095
+ logger.debug(`It was not possible to finish the call to the microservice: ${e}`);
5096
+ }
5097
+ }
5098
+ } else {
5099
+ logger.debug("CORS: no allow_origins available. Allowing all origins...");
5100
+ logger.debug("CORS: Adding header Access-Control-Allow-Origin=*");
5101
+ microservice.route.responseHeaders["Access-Control-Allow-Origin"] = "*";
5102
+ }
5103
+ if (typeof allow_credentials !== "undefined") {
5104
+ logger.debug(`CORS: allow_credentials present. Allowing ${allow_credentials}...`);
5105
+ microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = allow_credentials.toString();
5106
+ } else {
5107
+ logger.debug("CORS: No allow_credentials present. Allowing all credentials.");
5108
+ microservice.route.responseHeaders["Access-Control-Allow-Credentials"] = "true";
5109
+ }
5110
+ if (typeof allow_methods !== "undefined") {
5111
+ logger.debug(`CORS: allow_methods present. Allowing ${allow_methods}...`);
5112
+ microservice.route.responseHeaders["Access-Control-Allow-Methods"] = [...allow_methods].join(",");
5113
+ } else {
5114
+ logger.debug("CORS: No allow_methods present. Allowing only GET, OPTIONS and POST");
5115
+ microservice.route.responseHeaders["Access-Control-Allow-Methods"] = "GET, OPTIONS, POST";
5116
+ }
5117
+ if (typeof allow_headers !== "undefined") {
5118
+ logger.debug(`CORS: allow_headers present. Allowing ${allow_headers}...`);
5119
+ microservice.route.responseHeaders["Access-Control-Allow-Headers"] = [...allow_headers].join(",");
5120
+ } else {
5121
+ logger.debug("CORS: No allow_headers present. Allowing all headers...");
5122
+ microservice.route.responseHeaders["Access-Control-Allow-Headers"] = "*";
5123
+ }
5124
+ } else {
5125
+ logger.debug("No CORS validation available. You can specify cors in CONFIG.backend.routes[].cors");
5126
+ }
5127
+ }
5128
+ head(formData) {
5129
+ logger.debug(`[BackendMicroservice.head] Data received: ${_DataStringify(formData)}`);
5130
+ this.done();
5131
+ }
5132
+ get(formData) {
5133
+ logger.debug(`[BackendMicroservice.get] Data received: ${_DataStringify(formData)}`);
5134
+ this.done();
5135
+ }
5136
+ post(formData) {
5137
+ logger.debug(`[BackendMicroservice.post] Data received: ${_DataStringify(formData)}`);
5138
+ this.done();
5139
+ }
5140
+ put(formData) {
5141
+ logger.debug(`[BackendMicroservice.put] Data received: ${_DataStringify(formData)}`);
5142
+ this.done();
5143
+ }
5144
+ delete(formData) {
5145
+ logger.debug(`[BackendMicroservice.delete] Data received: ${_DataStringify(formData)}`);
5146
+ this.done();
5147
+ }
5148
+ connect(formData) {
5149
+ logger.debug(`[BackendMicroservice.connect] Data received: ${_DataStringify(formData)}`);
5150
+ this.done();
5151
+ }
5152
+ options(formData) {
5153
+ logger.debug(`[BackendMicroservice.options] Data received: ${_DataStringify(formData)}`);
5154
+ this.done();
5155
+ }
5156
+ trace(formData) {
5157
+ logger.debug(`[BackendMicroservice.trace] Data received: ${_DataStringify(formData)}`);
5158
+ this.done();
5159
+ }
5160
+ patch(formData) {
5161
+ logger.debug(`[BackendMicroservice.patch] Data received: ${_DataStringify(formData)}`);
5162
+ this.done();
5163
+ }
5164
+ finishWithBody(stream) {
5165
+ try {
5166
+ logger.debug("[BackendMicroservice.finishWithBody] Ending the stream...");
5167
+ logger.debug(`[BackendMicroservice.finishWithBody] type of body is: ${typeof this.body}`);
5168
+ if (typeof this.body !== "string") {
5169
+ this.body = _DataStringify(this.body);
5170
+ }
5171
+ logger.debug(`[BackendMicroservice.finishWithBody]
5172
+ body: ${this.body} `);
5173
+ stream?.write(this.body);
5174
+ stream?.end();
5175
+ logger.debug("[BackendMicroservice.finishWithBody] Stream ended.");
5176
+ } catch (e) {
5177
+ logger.debug(`[BackendMicroservice.finishWithBody] Something went wrong ending the stream: ${e}`);
5178
+ }
5179
+ }
5180
+ done() {
5181
+ logger.debug("[BackendMicroservice.done] Finalizing the response...");
5182
+ const microservice = this;
5183
+ const stream = microservice.stream;
5184
+ try {
5185
+ logger.debug("[BackendMicroservice.done] Sending response headers...");
5186
+ if (microservice.route.responseHeaders) {
5187
+ logger.debug(`[BackendMicroservice.done] Response headers present: ${Object.keys(microservice.route.responseHeaders).join(",")}`);
5188
+ stream.respond(microservice.route.responseHeaders);
5189
+ } else {
5190
+ throw Error("[BackendMicroservice.done] No headers present.");
5191
+ }
5192
+ } catch (e) {
5193
+ logger.debug(`[BackendMicroservice.done] Something went wrong sending response headers: ${e}`);
5194
+ }
5195
+ if (microservice.body !== null) {
5196
+ try {
5197
+ logger.debug("[BackendMicroservice.done] A body of message is present. Finalizing the response...");
5198
+ microservice.finishWithBody.call(microservice, stream);
5199
+ } catch (e) {
5200
+ logger.debug(`[BackendMicroservice.done] Something went wrong finalizing the response: ${e}`);
5201
+ }
5202
+ } else {
5203
+ logger.debug("[BackendMicroservice.done] No body present. Ending stream...");
5204
+ stream.end();
5205
+ }
5206
+ }
5207
+ };
5208
+ Package("com.qcobjects.api", [
5209
+ BackendMicroservice
5210
+ ]);
5211
+
5212
+ // src/QCObjects.ts
5213
+ init_Component();
5214
+ init_Crypt();
5215
+
5216
+ // src/DefaultTemplateHandler.ts
5217
+ init_Logger();
5218
+ init_Processor();
5219
+ init_RegisterClass();
5220
+ var DefaultTemplateHandler = class {
5221
+ static {
5222
+ __name(this, "DefaultTemplateHandler");
5223
+ }
5224
+ template = "";
5225
+ __definition = {};
5226
+ static __definition = {};
5227
+ component;
5228
+ constructor({ component, template }) {
5229
+ this.component = component;
5230
+ this.template = template;
5231
+ }
5232
+ assign(data) {
5233
+ const templateInstance = this;
5234
+ if (typeof templateInstance.component === "undefined") {
5235
+ throw new Error("DefaultTemplateHandler.assign: component is undefined");
5236
+ }
5237
+ if (typeof templateInstance.component.processorHandler === "undefined") {
5238
+ throw new Error("DefaultTemplateHandler.assign: component.processorHandler is undefined");
5239
+ }
5240
+ const processorHandler = templateInstance.component.processorHandler;
5241
+ processorHandler.component = templateInstance.component;
5242
+ let parsedAssignmentText = typeof templateInstance.template !== "undefined" ? templateInstance.template : "";
5243
+ if (typeof data === "object") {
5244
+ [...Object.keys(data)].map((k) => {
5245
+ let _value = data[k];
5246
+ if (typeof _value === "string" || typeof _value === "number" || !isNaN(_value)) {
5247
+ try {
5248
+ _value = GlobalProcessor.processObject.bind(processorHandler).call(processorHandler, _value, templateInstance.component);
5249
+ parsedAssignmentText = parsedAssignmentText.replace(new RegExp(`{{${k}}}`, "g"), _value);
5250
+ } catch (e) {
5251
+ logger.warn(`${templateInstance.component.name} could not parse processors.`);
5252
+ throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`);
5253
+ }
5254
+ }
5255
+ return k;
5256
+ });
5257
+ } else {
5258
+ logger.debug(`${templateInstance.component.name}.data is not an object`);
5259
+ }
5260
+ try {
5261
+ parsedAssignmentText = GlobalProcessor.processObject.call(processorHandler, parsedAssignmentText, templateInstance.component);
5262
+ } catch (e) {
5263
+ logger.warn(`${templateInstance.component.name} could not parse processors.`);
5264
+ throw Error(`${templateInstance.component.name} could not parse processors. Reason: ${e.message}`);
5265
+ }
5266
+ return parsedAssignmentText;
5267
+ }
5268
+ };
5269
+ RegisterClass(DefaultTemplateHandler, "com.qcobjects");
5270
+
5271
+ // src/SourceJS.ts
5272
+ init_basePath();
5273
+ init_Cast();
5274
+ init_domain();
5275
+ init_DOMCreateElement();
5276
+ init_InheritClass();
5277
+ init_Package();
5278
+ init_Logger();
5279
+ var SourceJS = class extends InheritClass {
5280
+ static {
5281
+ __name(this, "SourceJS");
5282
+ }
5283
+ domain = _domain_;
5284
+ basePath = _basePath_;
5285
+ type = "text/javascript";
5286
+ containerTag = "body";
5287
+ url = "";
5288
+ data = {};
5289
+ async = false;
5290
+ external = false;
5291
+ constructor(o) {
5292
+ super(o);
5293
+ this.body = _DOMCreateElement("script");
5294
+ }
5295
+ set(name, value) {
5296
+ this[name] = value;
5297
+ }
5298
+ get(name, _default) {
5299
+ return this[name] || _default;
5300
+ }
5301
+ status = false;
5302
+ done() {
5303
+ }
5304
+ fail() {
5305
+ }
5306
+ rebuild() {
5307
+ const context = this;
5308
+ try {
5309
+ document.getElementsByTagName(context.containerTag)[0].appendChild(
5310
+ function(s, url, context2) {
5311
+ s.type = context2.type;
5312
+ s.src = url;
5313
+ s.crossOrigin = Object.hasOwn(context2, "crossOrigin") ? context2.crossOrigin : "anonymous";
5314
+ s.async = context2.async;
5315
+ s.onreadystatechange = function() {
5316
+ if (this.readyState === "complete") {
5317
+ context2.done.call(context2);
5318
+ }
5319
+ };
5320
+ s.onload = function(e) {
5321
+ context2.status = true;
5322
+ context2.done.call(context2, e);
5323
+ };
5324
+ s.onerror = function(e) {
5325
+ context2.status = false;
5326
+ context2.fail.call(context2, e);
5327
+ };
5328
+ context2.body = s;
5329
+ return s;
5330
+ }.call(
5331
+ this,
5332
+ _DOMCreateElement("script"),
5333
+ this.external ? this.url : this.basePath + this.url,
5334
+ context
5335
+ )
5336
+ );
5337
+ } catch (e) {
5338
+ context.status = false;
5339
+ logger.debug(`An error ocurred: ${e}`);
5340
+ context.fail();
5341
+ }
5342
+ }
5343
+ Cast(o) {
5344
+ return _Cast(this, o);
5345
+ }
5346
+ _new_(properties) {
5347
+ this.__new__(properties);
5348
+ this.rebuild();
5349
+ }
5350
+ };
5351
+ Package("com.qcobjects", [SourceJS]);
5352
+
5353
+ // src/SourceCSS.ts
5354
+ init_basePath();
5355
+ init_Cast();
5356
+ init_domain();
5357
+ init_DOMCreateElement();
5358
+ init_InheritClass();
5359
+ init_platform();
5360
+ init_Package();
5361
+ var SourceCSS = class extends InheritClass {
5362
+ static {
5363
+ __name(this, "SourceCSS");
5364
+ }
5365
+ domain = _domain_;
5366
+ basePath = _basePath_;
5367
+ url = "";
5368
+ data = {};
5369
+ async = false;
5370
+ external = false;
5371
+ constructor(o) {
5372
+ super(o);
5373
+ this.body = _DOMCreateElement("link");
5374
+ }
5375
+ fail() {
5376
+ throw new Error("Method not implemented.");
5377
+ }
5378
+ Cast(o) {
5379
+ return _Cast(this, o);
5380
+ }
5381
+ set(name, value) {
5382
+ this[name] = value;
5383
+ }
5384
+ get(name, _default) {
5385
+ return this[name] || _default;
5386
+ }
5387
+ done() {
5388
+ }
5389
+ rebuild() {
5390
+ const context = this;
5391
+ if (isBrowser) {
5392
+ window.document.getElementsByTagName("head")[0].appendChild(
5393
+ function(s, url, context2) {
5394
+ s.type = "text/css";
5395
+ s.rel = "stylesheet";
5396
+ s.href = url;
5397
+ s.crossOrigin = "anonymous";
5398
+ s.onreadystatechange = function() {
5399
+ if (this.readyState === "complete") {
5400
+ context2.done.call(context2);
5401
+ }
5402
+ };
5403
+ s.onload = context2.done;
5404
+ context2.body = s;
5405
+ return s;
5406
+ }.call(
5407
+ this,
5408
+ _DOMCreateElement("link"),
5409
+ this.external ? this.url : this.basePath + this.url,
5410
+ context
5411
+ )
5412
+ );
5413
+ }
5414
+ }
5415
+ };
5416
+ Package("com.qcobjects", [SourceCSS]);
5417
+
5418
+ // src/QCObjects.ts
5419
+ init_globalSettings();
5420
+ init_RegisterClass();
5421
+
5422
+ // src/WidgetsFactory.ts
5423
+ init_DOMCreateElement();
5424
+ init_Export();
5425
+ init_introspection();
5426
+ init_platform();
5427
+ var QCObjectsWidgetNode = class {
5428
+ static {
5429
+ __name(this, "QCObjectsWidgetNode");
5430
+ }
5431
+ accessKey;
5432
+ accessKeyLabel;
5433
+ autocapitalize;
5434
+ dir;
5435
+ draggable;
5436
+ hidden;
5437
+ inert;
5438
+ innerText;
5439
+ lang;
5440
+ offsetHeight;
5441
+ offsetLeft;
5442
+ offsetParent;
5443
+ offsetTop;
5444
+ offsetWidth;
5445
+ outerText;
5446
+ popover;
5447
+ spellcheck;
5448
+ title;
5449
+ translate;
5450
+ attachInternals() {
5451
+ throw new Error("Method not implemented.");
5452
+ }
5453
+ click() {
5454
+ throw new Error("Method not implemented.");
5455
+ }
5456
+ hidePopover() {
5457
+ throw new Error("Method not implemented.");
5458
+ }
5459
+ showPopover() {
5460
+ throw new Error("Method not implemented.");
5461
+ }
5462
+ togglePopover(force) {
5463
+ throw new Error("Method not implemented.");
5464
+ }
5465
+ addEventListener(type, listener, options) {
5466
+ throw new Error("Method not implemented.");
5467
+ }
5468
+ removeEventListener(type, listener, options) {
5469
+ throw new Error("Method not implemented.");
5470
+ }
5471
+ attributes;
5472
+ classList;
5473
+ className;
5474
+ clientHeight;
5475
+ clientLeft;
5476
+ clientTop;
5477
+ clientWidth;
5478
+ id;
5479
+ innerHTML;
5480
+ localName;
5481
+ namespaceURI;
5482
+ onfullscreenchange;
5483
+ onfullscreenerror;
5484
+ outerHTML;
5485
+ ownerDocument;
5486
+ part;
5487
+ prefix;
5488
+ scrollHeight;
5489
+ scrollLeft;
5490
+ scrollTop;
5491
+ scrollWidth;
5492
+ shadowRoot;
5493
+ slot;
5494
+ tagName;
5495
+ attachShadow(init) {
5496
+ throw new Error("Method not implemented.");
5497
+ }
5498
+ checkVisibility(options) {
5499
+ throw new Error("Method not implemented.");
5500
+ }
5501
+ closest(selectors) {
5502
+ throw new Error("Method not implemented.");
5503
+ }
5504
+ computedStyleMap() {
5505
+ throw new Error("Method not implemented.");
5506
+ }
5507
+ getAttribute(qualifiedName) {
5508
+ throw new Error("Method not implemented.");
5509
+ }
5510
+ getAttributeNS(namespace, localName) {
5511
+ throw new Error("Method not implemented.");
5512
+ }
5513
+ getAttributeNames() {
5514
+ throw new Error("Method not implemented.");
5515
+ }
5516
+ getAttributeNode(qualifiedName) {
5517
+ throw new Error("Method not implemented.");
5518
+ }
5519
+ getAttributeNodeNS(namespace, localName) {
5520
+ throw new Error("Method not implemented.");
5521
+ }
5522
+ getBoundingClientRect() {
5523
+ throw new Error("Method not implemented.");
5524
+ }
5525
+ getClientRects() {
5526
+ throw new Error("Method not implemented.");
5527
+ }
5528
+ getElementsByClassName(classNames) {
5529
+ throw new Error("Method not implemented.");
5530
+ }
5531
+ getElementsByTagName(qualifiedName) {
5532
+ throw new Error("Method not implemented.");
5533
+ }
5534
+ getElementsByTagNameNS(namespace, localName) {
5535
+ throw new Error("Method not implemented.");
5536
+ }
5537
+ getHTML(options) {
5538
+ throw new Error("Method not implemented.");
5539
+ }
5540
+ hasAttribute(qualifiedName) {
5541
+ throw new Error("Method not implemented.");
5542
+ }
5543
+ hasAttributeNS(namespace, localName) {
5544
+ throw new Error("Method not implemented.");
5545
+ }
5546
+ hasAttributes() {
5547
+ throw new Error("Method not implemented.");
5548
+ }
5549
+ hasPointerCapture(pointerId) {
5550
+ throw new Error("Method not implemented.");
5551
+ }
5552
+ insertAdjacentElement(where, element) {
5553
+ throw new Error("Method not implemented.");
5554
+ }
5555
+ insertAdjacentHTML(position, string) {
5556
+ throw new Error("Method not implemented.");
5557
+ }
5558
+ insertAdjacentText(where, data) {
5559
+ throw new Error("Method not implemented.");
5560
+ }
5561
+ matches(selectors) {
5562
+ throw new Error("Method not implemented.");
5563
+ }
5564
+ releasePointerCapture(pointerId) {
5565
+ throw new Error("Method not implemented.");
5566
+ }
5567
+ removeAttribute(qualifiedName) {
5568
+ throw new Error("Method not implemented.");
5569
+ }
5570
+ removeAttributeNS(namespace, localName) {
5571
+ throw new Error("Method not implemented.");
5572
+ }
5573
+ removeAttributeNode(attr) {
5574
+ throw new Error("Method not implemented.");
5575
+ }
5576
+ requestFullscreen(options) {
5577
+ throw new Error("Method not implemented.");
5578
+ }
5579
+ requestPointerLock(options) {
5580
+ throw new Error("Method not implemented.");
5581
+ }
5582
+ scroll(x, y) {
5583
+ throw new Error("Method not implemented.");
5584
+ }
5585
+ scrollBy(x, y) {
5586
+ throw new Error("Method not implemented.");
5587
+ }
5588
+ scrollIntoView(arg) {
5589
+ throw new Error("Method not implemented.");
5590
+ }
5591
+ scrollTo(x, y) {
5592
+ throw new Error("Method not implemented.");
5593
+ }
5594
+ setAttribute(qualifiedName, value) {
5595
+ throw new Error("Method not implemented.");
5596
+ }
5597
+ setAttributeNS(namespace, qualifiedName, value) {
5598
+ throw new Error("Method not implemented.");
5599
+ }
5600
+ setAttributeNode(attr) {
5601
+ throw new Error("Method not implemented.");
5602
+ }
5603
+ setAttributeNodeNS(attr) {
5604
+ throw new Error("Method not implemented.");
5605
+ }
5606
+ setHTMLUnsafe(html) {
5607
+ throw new Error("Method not implemented.");
5608
+ }
5609
+ setPointerCapture(pointerId) {
5610
+ throw new Error("Method not implemented.");
5611
+ }
5612
+ toggleAttribute(qualifiedName, force) {
5613
+ throw new Error("Method not implemented.");
5614
+ }
5615
+ webkitMatchesSelector(selectors) {
5616
+ throw new Error("Method not implemented.");
5617
+ }
5618
+ baseURI;
5619
+ childNodes;
5620
+ firstChild;
5621
+ isConnected;
5622
+ lastChild;
5623
+ nextSibling;
5624
+ nodeName;
5625
+ nodeType;
5626
+ nodeValue;
5627
+ parentElement;
5628
+ parentNode;
5629
+ previousSibling;
5630
+ textContent;
5631
+ appendChild(node) {
5632
+ throw new Error("Method not implemented.");
5633
+ }
5634
+ cloneNode(deep) {
5635
+ throw new Error("Method not implemented.");
5636
+ }
5637
+ compareDocumentPosition(other) {
5638
+ throw new Error("Method not implemented.");
5639
+ }
5640
+ contains(other) {
5641
+ throw new Error("Method not implemented.");
5642
+ }
5643
+ getRootNode(options) {
5644
+ throw new Error("Method not implemented.");
5645
+ }
5646
+ hasChildNodes() {
5647
+ throw new Error("Method not implemented.");
5648
+ }
5649
+ insertBefore(node, child) {
5650
+ throw new Error("Method not implemented.");
5651
+ }
5652
+ isDefaultNamespace(namespace) {
5653
+ throw new Error("Method not implemented.");
5654
+ }
5655
+ isEqualNode(otherNode) {
5656
+ throw new Error("Method not implemented.");
5657
+ }
5658
+ isSameNode(otherNode) {
5659
+ throw new Error("Method not implemented.");
5660
+ }
5661
+ lookupNamespaceURI(prefix) {
5662
+ throw new Error("Method not implemented.");
5663
+ }
5664
+ lookupPrefix(namespace) {
5665
+ throw new Error("Method not implemented.");
5666
+ }
5667
+ normalize() {
5668
+ throw new Error("Method not implemented.");
5669
+ }
5670
+ removeChild(child) {
5671
+ throw new Error("Method not implemented.");
5672
+ }
5673
+ replaceChild(node, child) {
5674
+ throw new Error("Method not implemented.");
5675
+ }
5676
+ ELEMENT_NODE;
5677
+ ATTRIBUTE_NODE;
5678
+ TEXT_NODE;
5679
+ CDATA_SECTION_NODE;
5680
+ ENTITY_REFERENCE_NODE;
5681
+ ENTITY_NODE;
5682
+ PROCESSING_INSTRUCTION_NODE;
5683
+ COMMENT_NODE;
5684
+ DOCUMENT_NODE;
5685
+ DOCUMENT_TYPE_NODE;
5686
+ DOCUMENT_FRAGMENT_NODE;
5687
+ NOTATION_NODE;
5688
+ DOCUMENT_POSITION_DISCONNECTED;
5689
+ DOCUMENT_POSITION_PRECEDING;
5690
+ DOCUMENT_POSITION_FOLLOWING;
5691
+ DOCUMENT_POSITION_CONTAINS;
5692
+ DOCUMENT_POSITION_CONTAINED_BY;
5693
+ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC;
5694
+ dispatchEvent(event) {
5695
+ throw new Error("Method not implemented.");
5696
+ }
5697
+ ariaAtomic;
5698
+ ariaAutoComplete;
5699
+ ariaBrailleLabel;
5700
+ ariaBrailleRoleDescription;
5701
+ ariaBusy;
5702
+ ariaChecked;
5703
+ ariaColCount;
5704
+ ariaColIndex;
5705
+ ariaColSpan;
5706
+ ariaCurrent;
5707
+ ariaDescription;
5708
+ ariaDisabled;
5709
+ ariaExpanded;
5710
+ ariaHasPopup;
5711
+ ariaHidden;
5712
+ ariaInvalid;
5713
+ ariaKeyShortcuts;
5714
+ ariaLabel;
5715
+ ariaLevel;
5716
+ ariaLive;
5717
+ ariaModal;
5718
+ ariaMultiLine;
5719
+ ariaMultiSelectable;
5720
+ ariaOrientation;
5721
+ ariaPlaceholder;
5722
+ ariaPosInSet;
5723
+ ariaPressed;
5724
+ ariaReadOnly;
5725
+ ariaRequired;
5726
+ ariaRoleDescription;
5727
+ ariaRowCount;
5728
+ ariaRowIndex;
5729
+ ariaRowSpan;
5730
+ ariaSelected;
5731
+ ariaSetSize;
5732
+ ariaSort;
5733
+ ariaValueMax;
5734
+ ariaValueMin;
5735
+ ariaValueNow;
5736
+ ariaValueText;
5737
+ role;
5738
+ animate(keyframes, options) {
5739
+ throw new Error("Method not implemented.");
5740
+ }
5741
+ getAnimations(options) {
5742
+ throw new Error("Method not implemented.");
5743
+ }
5744
+ after(...nodes) {
5745
+ throw new Error("Method not implemented.");
5746
+ }
5747
+ before(...nodes) {
5748
+ throw new Error("Method not implemented.");
5749
+ }
5750
+ remove() {
5751
+ throw new Error("Method not implemented.");
5752
+ }
5753
+ replaceWith(...nodes) {
5754
+ throw new Error("Method not implemented.");
5755
+ }
5756
+ nextElementSibling;
5757
+ previousElementSibling;
5758
+ childElementCount;
5759
+ children;
5760
+ firstElementChild;
5761
+ lastElementChild;
5762
+ append(...nodes) {
5763
+ throw new Error("Method not implemented.");
5764
+ }
5765
+ prepend(...nodes) {
5766
+ throw new Error("Method not implemented.");
5767
+ }
5768
+ querySelector(selectors) {
5769
+ throw new Error("Method not implemented.");
5770
+ }
5771
+ querySelectorAll(selectors) {
5772
+ throw new Error("Method not implemented.");
5773
+ }
5774
+ replaceChildren(...nodes) {
5775
+ throw new Error("Method not implemented.");
5776
+ }
5777
+ assignedSlot;
5778
+ attributeStyleMap;
5779
+ style;
5780
+ contentEditable;
5781
+ enterKeyHint;
5782
+ inputMode;
5783
+ isContentEditable;
5784
+ onabort;
5785
+ onanimationcancel;
5786
+ onanimationend;
5787
+ onanimationiteration;
5788
+ onanimationstart;
5789
+ onauxclick;
5790
+ onbeforeinput;
5791
+ onbeforetoggle;
5792
+ onblur;
5793
+ oncancel;
5794
+ oncanplay;
5795
+ oncanplaythrough;
5796
+ onchange;
5797
+ onclick;
5798
+ onclose;
5799
+ oncontextlost;
5800
+ oncontextmenu;
5801
+ oncontextrestored;
5802
+ oncopy;
5803
+ oncuechange;
5804
+ oncut;
5805
+ ondblclick;
5806
+ ondrag;
5807
+ ondragend;
5808
+ ondragenter;
5809
+ ondragleave;
5810
+ ondragover;
5811
+ ondragstart;
5812
+ ondrop;
5813
+ ondurationchange;
5814
+ onemptied;
5815
+ onended;
5816
+ onerror;
5817
+ onfocus;
5818
+ onformdata;
5819
+ ongotpointercapture;
5820
+ oninput;
5821
+ oninvalid;
5822
+ onkeydown;
5823
+ onkeypress;
5824
+ onkeyup;
5825
+ onload;
5826
+ onloadeddata;
5827
+ onloadedmetadata;
5828
+ onloadstart;
5829
+ onlostpointercapture;
5830
+ onmousedown;
5831
+ onmouseenter;
5832
+ onmouseleave;
5833
+ onmousemove;
5834
+ onmouseout;
5835
+ onmouseover;
5836
+ onmouseup;
5837
+ onpaste;
5838
+ onpause;
5839
+ onplay;
5840
+ onplaying;
5841
+ onpointercancel;
5842
+ onpointerdown;
5843
+ onpointerenter;
5844
+ onpointerleave;
5845
+ onpointermove;
5846
+ onpointerout;
5847
+ onpointerover;
5848
+ onpointerup;
5849
+ onprogress;
5850
+ onratechange;
5851
+ onreset;
5852
+ onresize;
5853
+ onscroll;
5854
+ onscrollend;
5855
+ onsecuritypolicyviolation;
5856
+ onseeked;
5857
+ onseeking;
5858
+ onselect;
5859
+ onselectionchange;
5860
+ onselectstart;
5861
+ onslotchange;
5862
+ onstalled;
5863
+ onsubmit;
5864
+ onsuspend;
5865
+ ontimeupdate;
5866
+ ontoggle;
5867
+ ontouchcancel;
5868
+ ontouchend;
5869
+ ontouchmove;
5870
+ ontouchstart;
5871
+ ontransitioncancel;
5872
+ ontransitionend;
5873
+ ontransitionrun;
5874
+ ontransitionstart;
5875
+ onvolumechange;
5876
+ onwaiting;
5877
+ onwebkitanimationend;
5878
+ onwebkitanimationiteration;
5879
+ onwebkitanimationstart;
5880
+ onwebkittransitionend;
5881
+ onwheel;
5882
+ autofocus;
5883
+ dataset;
5884
+ nonce;
5885
+ tabIndex;
5886
+ blur() {
5887
+ throw new Error("Method not implemented.");
5888
+ }
5889
+ focus(options) {
5890
+ throw new Error("Method not implemented.");
5891
+ }
5892
+ };
5893
+ var _ComponentWidget_;
5894
+ if (isBrowser) {
5895
+ _ComponentWidget_ = class _ComponentWidget_ extends HTMLElement {
5896
+ static {
5897
+ __name(this, "_ComponentWidget_");
5898
+ }
5899
+ constructor() {
5900
+ super();
5901
+ const componentWidget = this;
5902
+ const componentName = componentWidget.nodeName.toLowerCase();
5903
+ const componentBody = _DOMCreateElement("quick-component");
5904
+ const __enabled__atributes__ = componentWidget.getAttributeNames();
5905
+ componentBody.setAttribute("name", componentName);
5906
+ if (!componentWidget.hasAttribute("shadowed")) {
5907
+ componentBody.setAttribute("shadowed", "true");
5908
+ }
5909
+ __enabled__atributes__.map(function(attributeName) {
5910
+ if (componentWidget.hasAttribute(attributeName)) {
5911
+ componentBody.setAttribute(attributeName, componentWidget?.getAttribute(attributeName));
5912
+ componentWidget.removeAttribute(attributeName);
5913
+ }
5914
+ });
5915
+ const data_attributenames = componentWidget.getAttributeNames().filter(function(a) {
5916
+ return a.startsWith("data-");
5917
+ }).map(function(a) {
5918
+ return a.split("-")[1];
5919
+ });
5920
+ data_attributenames.map(function(_attribute_name_) {
5921
+ componentBody.setAttribute("data-" + _attribute_name_, componentWidget?.getAttribute("data-" + _attribute_name_));
5922
+ componentWidget.removeAttribute("data-" + _attribute_name_);
5923
+ });
5924
+ [...componentWidget.children].map(function(element) {
5925
+ componentBody.appendChild(element.cloneNode(true));
5926
+ element.remove();
5927
+ });
5928
+ componentWidget.append(componentBody);
5929
+ }
5930
+ };
5931
+ } else {
5932
+ _ComponentWidget_ = class _ComponentWidget_ extends QCObjectsWidgetNode {
5933
+ static {
5934
+ __name(this, "_ComponentWidget_");
5935
+ }
5936
+ constructor() {
5937
+ super();
5938
+ throw new Error("Class not implemented.");
5939
+ }
5940
+ };
5941
+ }
5942
+ Export(_ComponentWidget_);
5943
+ var RegisterWidget = /* @__PURE__ */ __name(function(widgetName) {
5944
+ if (isBrowser) {
5945
+ customElements.define(widgetName, class extends _ComponentWidget_ {
5946
+ });
5947
+ } else {
5948
+ throw new Error("RegisterWidget is not implemented for non browser ecosystems yet.");
5949
+ }
5950
+ }, "RegisterWidget");
5951
+ var RegisterWidgets = /* @__PURE__ */ __name(function(...args) {
5952
+ const widgetList = [...args];
5953
+ widgetList.filter(function(widgetName) {
5954
+ return typeof widgetName === "string";
5955
+ }).map(function(widgetName) {
5956
+ return RegisterWidget(widgetName);
5957
+ });
5958
+ }, "RegisterWidgets");
5959
+ _protected_code_(RegisterWidget);
5960
+ _protected_code_(RegisterWidgets);
5961
+ Export(RegisterWidget);
5962
+ Export(RegisterWidgets);
5963
+
5964
+ // src/QCObjects.ts
5965
+ init_CONFIG();
5966
+
5967
+ // src/Controller.ts
5968
+ init_ClassFactory();
5969
+ init_getType();
5970
+ init_InheritClass();
5971
+ init_Logger();
5972
+ init_New();
5973
+ init_Package();
5974
+ init_platform();
5975
+ var Controller = class extends InheritClass {
5976
+ static {
5977
+ __name(this, "Controller");
5978
+ }
5979
+ component;
5980
+ dependencies = [];
5981
+ constructor({
5982
+ component,
5983
+ dependencies
5984
+ }) {
5985
+ super({ component, dependencies });
5986
+ this.component = component;
5987
+ this.dependencies = dependencies;
5988
+ if (typeof this.component === "undefined" || this.component === null) {
5989
+ throw Error(`${__getType__(this)} must be called with a component`);
5990
+ }
5991
+ }
5992
+ // eslint-disable-next-line no-unused-vars
5993
+ fail(...args) {
5994
+ throw new Error("Method not implemented.");
5995
+ }
5996
+ routingSelectedAttr(attrName) {
5997
+ return this.component?.routingSelected.map((r) => {
5998
+ return r[attrName];
5999
+ }).filter(function(v) {
6000
+ return v;
6001
+ }).pop();
6002
+ }
6003
+ isTouchable() {
6004
+ return "ontouchstart" in window || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
6005
+ }
6006
+ onpress(subelementSelector, handler) {
6007
+ if (isBrowser) {
6008
+ try {
6009
+ if (this.isTouchable()) {
6010
+ (this.component?.componentRoot?.subelements(subelementSelector))[0].addEventListener("touchstart", handler, {
6011
+ passive: true
6012
+ });
6013
+ } else {
6014
+ (this.component?.componentRoot?.subelements(subelementSelector))[0].addEventListener("click", handler, {
6015
+ passive: true
6016
+ });
6017
+ }
6018
+ } catch (e) {
6019
+ logger.debug(`An error ocurred: ${e}.`);
6020
+ logger.debug("No button to assign press event");
6021
+ }
6022
+ }
6023
+ }
6024
+ createRoutingController() {
6025
+ const controller = this;
6026
+ const component = controller.component;
6027
+ const controllerName = controller.routingSelectedAttr("controllerclass");
6028
+ if (typeof controllerName !== "undefined") {
6029
+ const _Controller2 = ClassFactory(controllerName);
6030
+ if (typeof _Controller2 !== "undefined" && component !== null) {
6031
+ component.routingController = New(_Controller2, {
6032
+ component
6033
+ });
6034
+ if (typeof component.routingController !== "undefined" && Object.hasOwn(component.routingController, "done") && typeof component.routingController.done === "function") {
6035
+ component.routingController.done.call(component.routingController);
6036
+ }
6037
+ }
6038
+ }
6039
+ }
6040
+ done() {
6041
+ }
6042
+ };
6043
+ Package("com.qcobjects.controllers", [
6044
+ Controller
6045
+ ]);
6046
+
6047
+ // src/View.ts
6048
+ init_getType();
6049
+ init_InheritClass();
6050
+ init_Package();
6051
+ var View = class extends InheritClass {
6052
+ static {
6053
+ __name(this, "View");
6054
+ }
6055
+ constructor({ component = void 0, dependencies = [] }) {
6056
+ super({ component, dependencies });
6057
+ if (typeof this.component === "undefined" || this.component === "null") {
6058
+ throw Error(`${__getType__(this)} must be called with a component`);
6059
+ }
6060
+ }
6061
+ };
6062
+ Package("com.qcobjects.views", [
6063
+ View
6064
+ ]);
6065
+
6066
+ // src/QCObjects.ts
6067
+ init_Service();
6068
+
6069
+ // src/VO.ts
6070
+ init_InheritClass();
6071
+ init_Package();
6072
+ var VO = class extends InheritClass {
6073
+ static {
6074
+ __name(this, "VO");
6075
+ }
6076
+ };
6077
+ Package("com.qcobjects.valueObjects", [
6078
+ VO
6079
+ ]);
6080
+
6081
+ // src/Effect.ts
6082
+ init_InheritClass();
6083
+ init_Package();
6084
+ var Effect = class extends InheritClass {
6085
+ static {
6086
+ __name(this, "Effect");
6087
+ }
6088
+ // eslint-disable-next-line no-unused-vars
6089
+ done(...args) {
6090
+ throw new Error("Method not implemented.");
6091
+ }
6092
+ // eslint-disable-next-line no-unused-vars
6093
+ apply(...args) {
6094
+ throw new Error("Method not implemented.");
6095
+ }
6096
+ duration = 1e3;
6097
+ animate({
6098
+ timing,
6099
+ draw,
6100
+ duration
6101
+ }) {
6102
+ const _self = this;
6103
+ const start = performance.now();
6104
+ requestAnimationFrame(/* @__PURE__ */ __name(function animate(time) {
6105
+ let timeFraction = (time - start) / duration;
6106
+ if (timeFraction > 1) timeFraction = 1;
6107
+ const progress = timing(timeFraction);
6108
+ draw(Math.round(progress * 100));
6109
+ if (timeFraction < 1) {
6110
+ requestAnimationFrame(animate);
6111
+ } else {
6112
+ if (typeof _self !== "undefined" && _self !== null && Object.hasOwn(_self, "done") && (typeof _self.done).toLowerCase() === "function") {
6113
+ _self.done.call(_self);
6114
+ }
6115
+ }
6116
+ }, "animate"));
6117
+ }
6118
+ };
6119
+ Package("com.qcobjects.effects.base", [
6120
+ Effect
6121
+ ]);
6122
+
6123
+ // src/TransitionEffect.ts
6124
+ init_Logger();
6125
+ init_Package();
6126
+ init_ClassFactory();
6127
+ var TransitionEffect = class extends Effect {
6128
+ static {
6129
+ __name(this, "TransitionEffect");
6130
+ }
6131
+ duration = 385;
6132
+ defaultParams = {
6133
+ alphaFrom: 0,
6134
+ alphaTo: 1,
6135
+ angleFrom: 180,
6136
+ angleTo: 0,
6137
+ radiusFrom: 0,
6138
+ radiusTo: 30,
6139
+ scaleFrom: 0,
6140
+ scaleTo: 1
6141
+ };
6142
+ fitToHeight = false;
6143
+ fitToWidth = false;
6144
+ component;
6145
+ effects;
6146
+ apply({
6147
+ alphaFrom,
6148
+ alphaTo,
6149
+ angleFrom,
6150
+ angleTo,
6151
+ radiusFrom,
6152
+ radiusTo,
6153
+ scaleFrom,
6154
+ scaleTo
6155
+ }) {
6156
+ const _transition_ = this;
6157
+ logger.info("EXECUTING TransitionEffect ");
6158
+ const componentRoot = _transition_.component.componentRoot;
6159
+ if (typeof componentRoot !== "undefined" && componentRoot !== null) {
6160
+ if (_transition_.fitToHeight) {
6161
+ componentRoot.height = typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null ? componentRoot.offsetParent?.scrollHeight : componentRoot.getBoundingClientRect().height;
6162
+ }
6163
+ if (_transition_.fitToWidth) {
6164
+ componentRoot.width = typeof componentRoot.offsetParent === "object" && componentRoot.offsetParent !== null ? componentRoot.offsetParent?.scrollWidth : componentRoot.getBoundingClientRect().width;
6165
+ }
6166
+ if (_transition_.component.shadowed) {
6167
+ componentRoot.host.style.display = "block";
6168
+ } else {
6169
+ componentRoot.style.display = "block";
6170
+ }
6171
+ _transition_.effects.map((effectClassName) => {
6172
+ const __effectClass__ = ClassFactory(effectClassName);
6173
+ const effectObj = new __effectClass__({});
6174
+ const effectClassMethod = effectObj.apply.bind(_transition_);
6175
+ const componentHost = _transition_.component.shadowed ? componentRoot.host : componentRoot;
6176
+ const effectParams = {
6177
+ alphaFrom,
6178
+ alphaTo,
6179
+ angleFrom,
6180
+ angleTo,
6181
+ radiusFrom,
6182
+ radiusTo,
6183
+ scaleFrom,
6184
+ scaleTo
6185
+ };
6186
+ effectClassMethod(componentHost, ...Object.values(effectParams));
6187
+ return effectClassName;
6188
+ });
6189
+ }
6190
+ }
6191
+ };
6192
+ Package("com.qcobjects.effects.transitions.base", [
6193
+ TransitionEffect
6194
+ ]);
6195
+
6196
+ // src/Timer.ts
6197
+ init_InheritClass();
6198
+ init_Package();
6199
+ var Timer = class extends InheritClass {
6200
+ static {
6201
+ __name(this, "Timer");
6202
+ }
6203
+ duration = 1e3;
6204
+ alive = true;
6205
+ thread({
6206
+ timing,
6207
+ intervalInterceptor,
6208
+ duration
6209
+ }) {
6210
+ const timer = this;
6211
+ const start = performance.now();
6212
+ requestAnimationFrame(/* @__PURE__ */ __name(function thread(time) {
6213
+ const elapsed = time - start;
6214
+ let timeFraction = elapsed / duration;
6215
+ if (timeFraction > 1) timeFraction = 1;
6216
+ const progress = timing(timeFraction, elapsed);
6217
+ intervalInterceptor(Math.round(progress * 100));
6218
+ if ((timeFraction < 1 || duration === -1) && timer.alive) {
6219
+ requestAnimationFrame(thread);
6220
+ }
6221
+ }, "thread"));
6222
+ }
6223
+ };
6224
+ Package("com.qcobjects.timing", [
6225
+ Timer
6226
+ ]);
6227
+
6228
+ // src/QCObjects.ts
6229
+ init_tag_filter();
6230
+ init_range();
6231
+ init_ArrayCollection();
6232
+
6233
+ // src/DDO.ts
6234
+ init_Export();
6235
+ init_InheritClass();
6236
+ init_Logger();
6237
+ init_ObjectName();
6238
+ var DDO = class extends InheritClass {
6239
+ static {
6240
+ __name(this, "DDO");
6241
+ }
6242
+ constructor({
6243
+ instance,
6244
+ name,
6245
+ fget,
6246
+ fset,
6247
+ value
6248
+ }) {
6249
+ super({
6250
+ instance,
6251
+ name,
6252
+ fget,
6253
+ fset,
6254
+ value
6255
+ });
6256
+ this._new_({
6257
+ instance,
6258
+ name,
6259
+ fget,
6260
+ fset,
6261
+ value
6262
+ });
6263
+ }
6264
+ _new_({
6265
+ instance,
6266
+ name,
6267
+ fget,
6268
+ fset
6269
+ }) {
6270
+ const ddoInstance = this;
6271
+ var name = typeof name === "undefined" ? ObjectName(ddoInstance) : name;
6272
+ Object.defineProperty(instance, name, {
6273
+ set(val) {
6274
+ const _value = val;
6275
+ logger.debug("value changed " + name);
6276
+ let ret;
6277
+ if (typeof fset !== "undefined" && typeof fset === "function") {
6278
+ ret = fset(_value);
6279
+ } else {
6280
+ ret = _value;
6281
+ }
6282
+ instance["_" + name] = ret;
6283
+ },
6284
+ get() {
6285
+ const _value = instance["_" + name];
6286
+ logger.debug("returning value " + name);
6287
+ const is_ddo = /* @__PURE__ */ __name((v) => {
6288
+ if (typeof v === "object" && Object.hasOwn(v, "value")) {
6289
+ return v.value;
6290
+ }
6291
+ return v;
6292
+ }, "is_ddo");
6293
+ let ret;
6294
+ if (typeof fget !== "undefined" && typeof fget === "function") {
6295
+ ret = fget(is_ddo(_value));
6296
+ } else {
6297
+ ret = is_ddo(_value);
6298
+ }
6299
+ return ret;
6300
+ }
6301
+ });
6302
+ }
6303
+ };
6304
+ Export(DDO);
6305
+
6306
+ // src/Toggle.ts
6307
+ init_InheritClass();
6308
+ init_Logger();
6309
+ init_Package();
6310
+ var Toggle = class extends InheritClass {
6311
+ static {
6312
+ __name(this, "Toggle");
6313
+ }
6314
+ _toggle = false;
6315
+ _inverse = true;
6316
+ _positive = null;
6317
+ _negative = null;
6318
+ _dispatched = null;
6319
+ _args = {};
6320
+ constructor(positive, negative, args) {
6321
+ super({ positive, negative, args });
6322
+ this._new_({ positive, negative, args });
6323
+ }
6324
+ changeToggle() {
6325
+ this._toggle = !this._toggle;
6326
+ }
6327
+ _new_({
6328
+ positive,
6329
+ negative,
6330
+ args
6331
+ }) {
6332
+ this._positive = positive;
6333
+ this._negative = negative;
6334
+ this._args = args;
6335
+ }
6336
+ fire() {
6337
+ const toggle = this;
6338
+ var _promise = new Promise(function(resolve, reject) {
6339
+ if (typeof toggle._positive === "function" && typeof toggle._negative === "function") {
6340
+ if (toggle._inverse) {
6341
+ toggle._dispatched = toggle._toggle ? toggle._negative.bind(toggle) : toggle._positive.bind(toggle);
6342
+ } else {
6343
+ toggle._dispatched = toggle._toggle ? toggle._positive.bind(toggle) : toggle._negative.bind(toggle);
6344
+ }
6345
+ toggle._dispatched?.call(toggle, toggle._args);
6346
+ resolve.call(_promise, toggle);
6347
+ } else {
6348
+ logger.debug("Toggle functions are not declared");
6349
+ reject.call(_promise, toggle);
6350
+ }
6351
+ return toggle;
6352
+ }).then(function(toggle2) {
6353
+ toggle2.changeToggle();
6354
+ return toggle2;
6355
+ }).catch(function(e) {
6356
+ logger.debug(e.toString());
6357
+ return toggle;
6358
+ }).finally(() => {
6359
+ return toggle;
6360
+ });
6361
+ return _promise;
6362
+ }
6363
+ };
6364
+ Package("com.qcobjects.tools.essentials", [
6365
+ Toggle
6366
+ ]);
6367
+
6368
+ // src/QCObjects.ts
6369
+ init_findPackageNodePath();
6582
6370
 
6583
- // src/index.cts
6584
- var QCObjects2 = (init_QCObjects(), __toCommonJS(QCObjects_exports));
6585
- module.exports = QCObjects2;
6586
- //# sourceMappingURL=index.cjs.map
6371
+ // src/DocumentLayout.ts
6372
+ var getDocumentLayout = /* @__PURE__ */ __name(function() {
6373
+ const h = /* @__PURE__ */ __name((w, h2) => {
6374
+ return w > h2 ? "landscape" : null;
6375
+ }, "h");
6376
+ const v = /* @__PURE__ */ __name((w, h2) => {
6377
+ return h2 > w ? "portrait" : null;
6378
+ }, "v");
6379
+ const square = /* @__PURE__ */ __name((w, h2) => {
6380
+ return w === h2 ? "square" : null;
6381
+ }, "square");
6382
+ return [
6383
+ h(document.documentElement.clientWidth, document.documentElement.clientHeight),
6384
+ v(document.documentElement.clientWidth, document.documentElement.clientHeight),
6385
+ square(document.documentElement.clientWidth, document.documentElement.clientHeight)
6386
+ ].filter((e) => e !== null).pop();
6387
+ }, "getDocumentLayout");
6388
+
6389
+ // src/QCObjects.ts
6390
+ init_mathFunctions();
6391
+ init_top();
6392
+ init_make_global();
6393
+ var QCObjects = __toESM(require_MainProcess());
6394
+ export {
6395
+ ArrayCollection,
6396
+ ArrayList,
6397
+ AssignPolyfill,
6398
+ BackendMicroservice,
6399
+ CONFIG,
6400
+ Class,
6401
+ ClassFactory,
6402
+ ComplexStorageCache,
6403
+ Component,
6404
+ ComponentURI,
6405
+ ConfigService,
6406
+ Controller,
6407
+ DDO,
6408
+ DefaultTemplateHandler,
6409
+ Effect,
6410
+ Export,
6411
+ GlobalSettings,
6412
+ Import,
6413
+ InheritClass,
6414
+ JSONService,
6415
+ Logger,
6416
+ NamespaceRef,
6417
+ New,
6418
+ ObjectName,
6419
+ Package,
6420
+ Processor,
6421
+ QCObjects,
6422
+ Ready,
6423
+ RegisterClass,
6424
+ RegisterWidget,
6425
+ RegisterWidgets,
6426
+ Service,
6427
+ SourceCSS,
6428
+ SourceJS,
6429
+ Tag,
6430
+ TagElements,
6431
+ Timer,
6432
+ Toggle,
6433
+ TransitionEffect,
6434
+ VO,
6435
+ View,
6436
+ _Cast,
6437
+ _CastProps,
6438
+ _ComponentWidget_,
6439
+ _Crypt,
6440
+ _DOMCreateElement,
6441
+ _DataStringify,
6442
+ _LegacyCopy,
6443
+ _QC_CLASSES,
6444
+ _QC_PACKAGES,
6445
+ _QC_PACKAGES_IMPORTED,
6446
+ _QC_READY_LISTENERS,
6447
+ _Ready,
6448
+ __getType__,
6449
+ __instanceID,
6450
+ __is_raw_class__,
6451
+ __make_global__,
6452
+ __to_number,
6453
+ _buildComponentsFromElements_,
6454
+ _fireAsyncLoad,
6455
+ _methods_,
6456
+ _protected_code_,
6457
+ _require_,
6458
+ _super_,
6459
+ _tag_filter_,
6460
+ _top,
6461
+ asyncLoad,
6462
+ captureFalseTouch,
6463
+ componentLoader,
6464
+ findPackageNodePath,
6465
+ getDocumentLayout,
6466
+ _top as global,
6467
+ isBrowser,
6468
+ isNodeCommonJS,
6469
+ isQCObjects_Class,
6470
+ isQCObjects_Object,
6471
+ is_a,
6472
+ is_phonegap,
6473
+ logger,
6474
+ range,
6475
+ ready,
6476
+ resetTop,
6477
+ serviceLoader,
6478
+ setDefaultProcessors,
6479
+ shortCode,
6480
+ subelements,
6481
+ waitUntil
6482
+ };
6483
+ //# sourceMappingURL=QCObjects.mjs.map