12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- import {
- _
- } from "./chunk-55RWC67C.js";
- import {
- e,
- n5 as n,
- t5 as t,
- y3 as y
- } from "./chunk-2Z2TG5CU.js";
- import {
- d,
- v
- } from "./chunk-V6P2MAQQ.js";
- import {
- s3 as s
- } from "./chunk-E5O6P5I2.js";
- // node_modules/@arcgis/core/core/Loadable.js
- var i = "not-loaded";
- var d2 = "loading";
- var c = "failed";
- var h = "loaded";
- var u = (s2) => {
- let u2 = class extends s2 {
- constructor(...o) {
- super(...o), this._loadController = null, this.loadError = null, this.loadStatus = "not-loaded", this._set("loadWarnings", []), this.addResolvingPromise(new Promise((o2) => {
- const s3 = this.load.bind(this);
- this.load = (l) => {
- const a = new Promise((o3, s4) => {
- const e2 = d(l, s4);
- this.destroyed && s4(new s("load:instance-destroyed", `Instance of '${this.declaredClass || this.constructor.name}' is already destroyed`, { instance: this })), this._promiseProps.when(o3, s4).finally(() => {
- e2 && e2.remove();
- });
- });
- if (this.loadStatus === i) {
- this._set("loadStatus", d2);
- const o3 = this._loadController = new AbortController();
- s3({ signal: o3.signal }), v(o3.signal, () => {
- this._promiseProps.abort();
- });
- }
- return o2(), a;
- };
- })), this.when(() => {
- this._set("loadStatus", h), this._loadController = null;
- }, (o2) => {
- this._set("loadStatus", c), this._set("loadError", o2), this._loadController = null;
- });
- }
- get loaded() {
- return this.loadStatus === h;
- }
- get loadWarnings() {
- return this._get("loadWarnings");
- }
- load() {
- return null;
- }
- cancelLoad() {
- var _a;
- return this.isFulfilled() || (this._set("loadError", new s("load:cancelled", "Cancelled")), (_a = this._loadController) == null ? void 0 : _a.abort()), this;
- }
- };
- return e([y({ readOnly: true })], u2.prototype, "loaded", null), e([y({ readOnly: true })], u2.prototype, "loadError", void 0), e([y({ clonable: false })], u2.prototype, "loadStatus", void 0), e([y({ type: [t], readOnly: true })], u2.prototype, "loadWarnings", null), u2 = e([n("esri.core.Loadable")], u2), u2;
- };
- var p = class extends u(_) {
- };
- p = e([n("esri.core.Loadable")], p), function(o) {
- function t2(o2) {
- return !(!o2 || !o2.load);
- }
- o.LoadableMixin = u, o.isLoadable = t2;
- }(p || (p = {}));
- var m = p;
- export {
- m
- };
- //# sourceMappingURL=chunk-YFSLJIO4.js.map
|