@placeos/ts-client 4.5.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alerts/functions.d.ts +7 -10
- package/dist/alerts/interfaces.d.ts +22 -0
- package/dist/api.d.ts +32 -19
- package/dist/applications/functions.d.ts +2 -5
- package/dist/applications/interfaces.d.ts +5 -11
- package/dist/assets/assets.class.d.ts +62 -0
- package/dist/assets/functions.d.ts +146 -0
- package/dist/assets/interfaces.d.ts +38 -0
- package/dist/clusters/functions.d.ts +16 -7
- package/dist/clusters/interfaces.d.ts +18 -3
- package/dist/domains/functions.d.ts +10 -6
- package/dist/drivers/functions.d.ts +3 -5
- package/dist/drivers/interfaces.d.ts +9 -7
- package/dist/edge/functions.d.ts +8 -7
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2695 -2081
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/ldap-sources/functions.d.ts +2 -5
- package/dist/metadata/functions.d.ts +8 -9
- package/dist/metadata/interfaces.d.ts +18 -4
- package/dist/modules/functions.d.ts +10 -4
- package/dist/modules/interfaces.d.ts +14 -12
- package/dist/oauth-sources/functions.d.ts +2 -5
- package/dist/repositories/functions.d.ts +17 -29
- package/dist/repositories/interfaces.d.ts +31 -3
- package/dist/resources/interface.d.ts +9 -4
- package/dist/saml-sources/functions.d.ts +4 -7
- package/dist/settings/functions.d.ts +6 -8
- package/dist/settings/interfaces.d.ts +7 -0
- package/dist/short-url/functions.d.ts +60 -0
- package/dist/short-url/interfaces.d.ts +22 -0
- package/dist/short-url/short-url.class.d.ts +17 -0
- package/dist/signage/interfaces.d.ts +9 -1
- package/dist/storages/functions.d.ts +31 -0
- package/dist/storages/interfaces.d.ts +6 -0
- package/dist/storages/storage.class.d.ts +18 -0
- package/dist/systems/functions.d.ts +38 -10
- package/dist/systems/interfaces.d.ts +58 -5
- package/dist/triggers/functions.d.ts +5 -7
- package/dist/triggers/interfaces.d.ts +9 -0
- package/dist/users/functions.d.ts +50 -10
- package/dist/users/interfaces.d.ts +35 -2
- package/dist/webrtc/functions.d.ts +52 -0
- package/dist/webrtc/interfaces.d.ts +73 -0
- package/dist/zones/functions.d.ts +12 -6
- package/dist/zones/interfaces.d.ts +9 -4
- package/package.json +1 -1
- package/src/alerts/functions.ts +14 -22
- package/src/alerts/interfaces.ts +25 -0
- package/src/api.ts +148 -3
- package/src/applications/functions.ts +4 -7
- package/src/applications/interfaces.ts +6 -12
- package/src/assets/assets.class.ts +123 -0
- package/src/assets/functions.ts +440 -0
- package/src/assets/interfaces.ts +41 -0
- package/src/clusters/functions.ts +39 -8
- package/src/clusters/interfaces.ts +21 -3
- package/src/domains/functions.ts +17 -6
- package/src/drivers/functions.ts +4 -6
- package/src/drivers/interfaces.ts +11 -7
- package/src/edge/functions.ts +18 -10
- package/src/ldap-sources/functions.ts +4 -7
- package/src/metadata/functions.ts +16 -10
- package/src/metadata/interfaces.ts +20 -4
- package/src/modules/functions.ts +29 -7
- package/src/modules/interfaces.ts +15 -12
- package/src/oauth-sources/functions.ts +4 -7
- package/src/repositories/functions.ts +35 -35
- package/src/repositories/interfaces.ts +35 -3
- package/src/resources/interface.ts +9 -4
- package/src/saml-sources/functions.ts +6 -9
- package/src/settings/functions.ts +14 -10
- package/src/settings/interfaces.ts +8 -0
- package/src/short-url/functions.ts +155 -0
- package/src/short-url/interfaces.ts +25 -0
- package/src/short-url/short-url.class.ts +33 -0
- package/src/signage/interfaces.ts +10 -1
- package/src/storages/functions.ts +88 -0
- package/src/storages/interfaces.ts +7 -0
- package/src/storages/storage.class.ts +34 -0
- package/src/systems/functions.ts +113 -13
- package/src/systems/interfaces.ts +65 -5
- package/src/triggers/functions.ts +9 -8
- package/src/triggers/interfaces.ts +10 -0
- package/src/users/functions.ts +104 -9
- package/src/users/interfaces.ts +40 -2
- package/src/webrtc/functions.ts +120 -0
- package/src/webrtc/interfaces.ts +77 -0
- package/src/zones/functions.ts +28 -7
- package/src/zones/interfaces.ts +10 -4
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`+n.map(function(i
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=n}});function kt(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var ye=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,i,r,o;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var c=Ie(s),a=c.next();!a.done;a=c.next()){var h=a.value;h.remove(this)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}else s.remove(this);var _=this.initialTeardown;if(q(_))try{_()}catch(f){o=f instanceof ln?f.errors:[f]}var y=this._finalizers;if(y){this._finalizers=null;try{for(var m=Ie(y),l=m.next();!l.done;l=m.next()){var d=l.value;try{Vn(d)}catch(f){o=o??[],f instanceof ln?o=St(St([],bt(o)),bt(f.errors)):o.push(f)}}}catch(f){i={error:f}}finally{try{l&&!l.done&&(r=m.return)&&r.call(m)}finally{if(i)throw i.error}}}if(o)throw new ln(o)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Vn(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&kt(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&kt(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),Qn=ye.EMPTY;function Zn(t){return t instanceof ye||t&&"closed"in t&&q(t.remove)&&q(t.add)&&q(t.unsubscribe)}function Vn(t){q(t)?t():t.unsubscribe()}var Hr={Promise:void 0},zr={setTimeout:function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setTimeout.apply(void 0,St([t,e],bt(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function Kn(t){zr.setTimeout(function(){throw t})}function Yn(){}function $t(t){t()}var At=function(t){G(e,t);function e(n){var i=t.call(this)||this;return i.isStopped=!1,n?(i.destination=n,Zn(n)&&n.add(i)):i.destination=xr,i}return e.create=function(n,i,r){return new hn(n,i,r)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(ye),Br=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(i){wt(i)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(i){wt(i)}else wt(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){wt(n)}},t}(),hn=function(t){G(e,t);function e(n,i,r){var o=t.call(this)||this,s;return q(n)||!n?s={next:n??void 0,error:i??void 0,complete:r??void 0}:s=n,o.destination=new Br(s),o}return e}(At);function wt(t){Kn(t)}function Wr(t){throw t}var xr={closed:!0,next:Yn,error:Wr,complete:Yn},fn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function dn(t){return t}function Qr(t){return t.length===0?dn:t.length===1?t[0]:function(n){return t.reduce(function(i,r){return r(i)},n)}}var U=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,i){var r=this,o=Vr(e)?e:new hn(e,n,i);return $t(function(){var s=r,c=s.operator,a=s.source;o.add(c?c.call(o,a):a?r._subscribe(o):r._trySubscribe(o))}),o},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var i=this;return n=Jn(n),new n(function(r,o){var s=new hn({next:function(c){try{e(c)}catch(a){o(a),s.unsubscribe()}},error:o,complete:r});i.subscribe(s)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[fn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return Qr(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=Jn(e),new e(function(i,r){var o;n.subscribe(function(s){return o=s},function(s){return r(s)},function(){return i(o)})})},t.create=function(e){return new t(e)},t}();function Jn(t){var e;return(e=t??Hr.Promise)!==null&&e!==void 0?e:Promise}function Zr(t){return t&&q(t.next)&&q(t.error)&&q(t.complete)}function Vr(t){return t&&t instanceof At||Zr(t)&&Zn(t)}function Kr(t){return q(t?.lift)}function ne(t){return function(e){if(Kr(e))return e.lift(function(n){try{return t(n,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function K(t,e,n,i,r){return new Yr(t,e,n,i,r)}var Yr=function(t){G(e,t);function e(n,i,r,o,s,c){var a=t.call(this,n)||this;return a.onFinalize=s,a.shouldUnsubscribe=c,a._next=i?function(h){try{i(h)}catch(_){n.error(_)}}:t.prototype._next,a._error=o?function(h){try{o(h)}catch(_){n.error(_)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(h){n.error(h)}finally{this.unsubscribe()}}:t.prototype._complete,a}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;t.prototype.unsubscribe.call(this),!i&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(At),Jr=xn(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),ge=function(t){G(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var i=new pn(this,this);return i.operator=n,i},e.prototype._throwIfClosed=function(){if(this.closed)throw new Jr},e.prototype.next=function(n){var i=this;$t(function(){var r,o;if(i._throwIfClosed(),!i.isStopped){i.currentObservers||(i.currentObservers=Array.from(i.observers));try{for(var s=Ie(i.currentObservers),c=s.next();!c.done;c=s.next()){var a=c.value;a.next(n)}}catch(h){r={error:h}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}}})},e.prototype.error=function(n){var i=this;$t(function(){if(i._throwIfClosed(),!i.isStopped){i.hasError=i.isStopped=!0,i.thrownError=n;for(var r=i.observers;r.length;)r.shift().error(n)}})},e.prototype.complete=function(){var n=this;$t(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var i=n.observers;i.length;)i.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var i=this,r=this,o=r.hasError,s=r.isStopped,c=r.observers;return o||s?Qn:(this.currentObservers=null,c.push(n),new ye(function(){i.currentObservers=null,kt(c,n)}))},e.prototype._checkFinalizedStatuses=function(n){var i=this,r=i.hasError,o=i.thrownError,s=i.isStopped;r?n.error(o):s&&n.complete()},e.prototype.asObservable=function(){var n=new U;return n.source=this,n},e.create=function(n,i){return new pn(n,i)},e}(U),pn=function(t){G(e,t);function e(n,i){var r=t.call(this)||this;return r.destination=n,r.source=i,r}return e.prototype.next=function(n){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.next)===null||r===void 0||r.call(i,n)},e.prototype.error=function(n){var i,r;(r=(i=this.destination)===null||i===void 0?void 0:i.error)===null||r===void 0||r.call(i,n)},e.prototype.complete=function(){var n,i;(i=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||i===void 0||i.call(n)},e.prototype._subscribe=function(n){var i,r;return(r=(i=this.source)===null||i===void 0?void 0:i.subscribe(n))!==null&&r!==void 0?r:Qn},e}(ge),ce=function(t){G(e,t);function e(n){var i=t.call(this)||this;return i._value=n,i}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var i=t.prototype._subscribe.call(this,n);return!i.closed&&n.next(this._value),i},e.prototype.getValue=function(){var n=this,i=n.hasError,r=n.thrownError,o=n._value;if(i)throw r;return this._throwIfClosed(),o},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(ge),mn={now:function(){return(mn.delegate||Date).now()},delegate:void 0},_n=function(t){G(e,t);function e(n,i,r){n===void 0&&(n=1/0),i===void 0&&(i=1/0),r===void 0&&(r=mn);var o=t.call(this)||this;return o._bufferSize=n,o._windowTime=i,o._timestampProvider=r,o._buffer=[],o._infiniteTimeWindow=!0,o._infiniteTimeWindow=i===1/0,o._bufferSize=Math.max(1,n),o._windowTime=Math.max(1,i),o}return e.prototype.next=function(n){var i=this,r=i.isStopped,o=i._buffer,s=i._infiniteTimeWindow,c=i._timestampProvider,a=i._windowTime;r||(o.push(n),!s&&o.push(c.now()+a)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var i=this._innerSubscribe(n),r=this,o=r._infiniteTimeWindow,s=r._buffer,c=s.slice(),a=0;a<c.length&&!n.closed;a+=o?1:2)n.next(c[a]);return this._checkFinalizedStatuses(n),i},e.prototype._trimBuffer=function(){var n=this,i=n._bufferSize,r=n._timestampProvider,o=n._buffer,s=n._infiniteTimeWindow,c=(s?1:2)*i;if(i<1/0&&c<o.length&&o.splice(0,o.length-c),!s){for(var a=r.now(),h=0,_=1;_<o.length&&o[_]<=a;_+=2)h=_;h&&o.splice(0,h+1)}},e}(ge),Gr=function(t){G(e,t);function e(n,i){return t.call(this)||this}return e.prototype.schedule=function(n,i){return this},e}(ye),Gn={setInterval:function(t,e){for(var n=[],i=2;i<arguments.length;i++)n[i-2]=arguments[i];return setInterval.apply(void 0,St([t,e],bt(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},Xr=function(t){G(e,t);function e(n,i){var r=t.call(this,n,i)||this;return r.scheduler=n,r.work=i,r.pending=!1,r}return e.prototype.schedule=function(n,i){var r;if(i===void 0&&(i=0),this.closed)return this;this.state=n;var o=this.id,s=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(s,o,i)),this.pending=!0,this.delay=i,this.id=(r=this.id)!==null&&r!==void 0?r:this.requestAsyncId(s,this.id,i),this},e.prototype.requestAsyncId=function(n,i,r){return r===void 0&&(r=0),Gn.setInterval(n.flush.bind(n,this),r)},e.prototype.recycleAsyncId=function(n,i,r){if(r===void 0&&(r=0),r!=null&&this.delay===r&&this.pending===!1)return i;i!=null&&Gn.clearInterval(i)},e.prototype.execute=function(n,i){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(n,i);if(r)return r;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,i){var r=!1,o;try{this.work(n)}catch(s){r=!0,o=s||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),o},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,i=n.id,r=n.scheduler,o=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,kt(o,this),i!=null&&(this.id=this.recycleAsyncId(r,i,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(Gr),Xn=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,i){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(i,n)},t.now=mn.now,t}(),eo=function(t){G(e,t);function e(n,i){i===void 0&&(i=Xn.now);var r=t.call(this,n,i)||this;return r.actions=[],r._active=!1,r}return e.prototype.flush=function(n){var i=this.actions;if(this._active){i.push(n);return}var r;this._active=!0;do if(r=n.execute(n.state,n.delay))break;while(n=i.shift());if(this._active=!1,r){for(;n=i.shift();)n.unsubscribe();throw r}},e}(Xn),ei=new eo(Xr),to=ei,no=new U(function(t){return t.complete()});function io(t){return t&&q(t.schedule)}var ti=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function ni(t){return q(t?.then)}function ii(t){return q(t[fn])}function ri(t){return Symbol.asyncIterator&&q(t?.[Symbol.asyncIterator])}function oi(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function ro(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var si=ro();function ui(t){return q(t?.[si])}function ci(t){return jr(this,arguments,function(){var n,i,r,o;return Wn(this,function(s){switch(s.label){case 0:n=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,Me(n.read())];case 3:return i=s.sent(),r=i.value,o=i.done,o?[4,Me(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,Me(r)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function ai(t){return q(t?.getReader)}function ie(t){if(t instanceof U)return t;if(t!=null){if(ii(t))return oo(t);if(ti(t))return so(t);if(ni(t))return uo(t);if(ri(t))return li(t);if(ui(t))return co(t);if(ai(t))return ao(t)}throw oi(t)}function oo(t){return new U(function(e){var n=t[fn]();if(q(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function so(t){return new U(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function uo(t){return new U(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,Kn)})}function co(t){return new U(function(e){var n,i;try{for(var r=Ie(t),o=r.next();!o.done;o=r.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(c){n={error:c}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}e.complete()})}function li(t){return new U(function(e){lo(t,e).catch(function(n){return e.error(n)})})}function ao(t){return li(ci(t))}function lo(t,e){var n,i,r,o;return Fr(this,void 0,void 0,function(){var s,c;return Wn(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),n=Lr(t),a.label=1;case 1:return[4,n.next()];case 2:if(i=a.sent(),!!i.done)return[3,4];if(s=i.value,e.next(s),e.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=a.sent(),r={error:c},[3,11];case 6:return a.trys.push([6,,9,10]),i&&!i.done&&(o=n.return)?[4,o.call(n)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(r)throw r.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function ve(t,e,n,i,r){i===void 0&&(i=0),r===void 0&&(r=!1);var o=e.schedule(function(){n(),r?t.add(this.schedule(null,i)):this.unsubscribe()},i);if(t.add(o),!r)return o}function hi(t,e){return e===void 0&&(e=0),ne(function(n,i){n.subscribe(K(i,function(r){return ve(i,t,function(){return i.next(r)},e)},function(){return ve(i,t,function(){return i.complete()},e)},function(r){return ve(i,t,function(){return i.error(r)},e)}))})}function fi(t,e){return e===void 0&&(e=0),ne(function(n,i){i.add(t.schedule(function(){return n.subscribe(i)},e))})}function ho(t,e){return ie(t).pipe(fi(e),hi(e))}function fo(t,e){return ie(t).pipe(fi(e),hi(e))}function po(t,e){return new U(function(n){var i=0;return e.schedule(function(){i===t.length?n.complete():(n.next(t[i++]),n.closed||this.schedule())})})}function mo(t,e){return new U(function(n){var i;return ve(n,e,function(){i=t[si](),ve(n,e,function(){var r,o,s;try{r=i.next(),o=r.value,s=r.done}catch(c){n.error(c);return}s?n.complete():n.next(o)},0,!0)}),function(){return q(i?.return)&&i.return()}})}function di(t,e){if(!t)throw new Error("Iterable cannot be null");return new U(function(n){ve(n,e,function(){var i=t[Symbol.asyncIterator]();ve(n,e,function(){i.next().then(function(r){r.done?n.complete():n.next(r.value)})},0,!0)})})}function _o(t,e){return di(ci(t),e)}function yo(t,e){if(t!=null){if(ii(t))return ho(t,e);if(ti(t))return po(t,e);if(ni(t))return fo(t,e);if(ri(t))return di(t,e);if(ui(t))return mo(t,e);if(ai(t))return _o(t,e)}throw oi(t)}function go(t,e){return e?yo(t,e):ie(t)}function pi(t,e){var n=q(t)?t:function(){return t},i=function(r){return r.error(n())};return new U(i)}function vo(t){return t instanceof Date&&!isNaN(t)}function I(t,e){return ne(function(n,i){var r=0;n.subscribe(K(i,function(o){i.next(t.call(e,o,r++))}))})}function bo(t,e,n,i,r,o,s,c){var a=[],h=0,_=0,y=!1,m=function(){y&&!a.length&&!h&&e.complete()},l=function(f){return h<i?d(f):a.push(f)},d=function(f){h++;var k=!1;ie(n(f,_++)).subscribe(K(e,function(v){e.next(v)},function(){k=!0},void 0,function(){if(k)try{h--;for(var v=function(){var $=a.shift();s||d($)};a.length&&h<i;)v();m()}catch($){e.error($)}}))};return t.subscribe(K(e,l,function(){y=!0,m()})),function(){}}function mi(t,e,n){return n===void 0&&(n=1/0),q(e)?mi(function(i,r){return I(function(o,s){return e(i,o,r,s)})(ie(t(i,r)))},n):(typeof e=="number"&&(n=e),ne(function(i,r){return bo(i,r,t,n)}))}function _i(t,e,n){t===void 0&&(t=0),n===void 0&&(n=to);var i=-1;return e!=null&&(io(e)?n=e:i=e),new U(function(r){var o=vo(t)?+t-n.now():t;o<0&&(o=0);var s=0;return n.schedule(function(){r.closed||(r.next(s++),0<=i?this.schedule(void 0,i):r.complete())},o)})}function So(t,e){return ne(function(n,i){var r=0;n.subscribe(K(i,function(o){return t.call(e,o,r++)&&i.next(o)}))})}function yi(t){return t<=0?function(){return no}:ne(function(e,n){var i=0;e.subscribe(K(n,function(r){++i<=t&&(n.next(r),t<=i&&n.complete())}))})}function ko(t){return I(function(){return t})}function $o(t,e){return mi(function(n,i){return ie(t(n,i)).pipe(yi(1),ko(n))})}function Ao(t,e){e===void 0&&(e=ei);var n=_i(t,e);return $o(function(){return n})}function wo(t,e){return e===void 0&&(e=dn),t=t??Po,ne(function(n,i){var r,o=!0;n.subscribe(K(i,function(s){var c=e(s);(o||!t(r,c))&&(o=!1,r=c,i.next(s))}))})}function Po(t,e){return t===e}function To(t){t===void 0&&(t=1/0);var e;t&&typeof t=="object"?e=t:e={count:t};var n=e.count,i=n===void 0?1/0:n,r=e.delay,o=e.resetOnSuccess,s=o===void 0?!1:o;return i<=0?dn:ne(function(c,a){var h=0,_,y=function(){var m=!1;_=c.subscribe(K(a,function(l){s&&(h=0),a.next(l)},void 0,function(l){if(h++<i){var d=function(){_?(_.unsubscribe(),_=null,y()):m=!0};if(r!=null){var f=typeof r=="number"?_i(r):ie(r(l,h)),k=K(a,function(){k.unsubscribe(),d()},function(){a.complete()});f.subscribe(k)}else d()}else a.error(l)})),m&&(_.unsubscribe(),_=null,y())};y()})}function gi(t,e){return ne(function(n,i){var r=null,o=0,s=!1,c=function(){return s&&!r&&i.complete()};n.subscribe(K(i,function(a){r?.unsubscribe();var h=0,_=o++;ie(t(a,_)).subscribe(r=K(i,function(y){return i.next(e?e(a,y,_,h++):y)},function(){r=null,c()}))},function(){s=!0,c()}))})}function yn(t,e){e===void 0&&(e={});var n=e.selector,i=Nr(e,["selector"]);return new U(function(r){var o=new AbortController,s=o.signal,c=!0,a=i.signal;if(a)if(a.aborted)o.abort();else{var h=function(){s.aborted||o.abort()};a.addEventListener("abort",h),r.add(function(){return a.removeEventListener("abort",h)})}var _=Be(Be({},i),{signal:s}),y=function(m){c=!1,r.error(m)};return fetch(t,_).then(function(m){n?ie(n(m)).subscribe(K(r,void 0,function(){c=!1,r.complete()},y)):(c=!1,r.next(m),r.complete())}).catch(y),function(){c&&o.abort()}})}const re=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],vi=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function Pt(t){if(t>=vi.length)throw new Error("Unable to parse base64 string.");const e=vi[t];if(e===255)throw new Error("Unable to parse base64 string.");return e}function bi(t){let e="",n,i=t.length;for(n=2;n<i;n+=3)e+=re[t[n-2]>>2],e+=re[(t[n-2]&3)<<4|t[n-1]>>4],e+=re[(t[n-1]&15)<<2|t[n]>>6],e+=re[t[n]&63];return n===i+1&&(e+=re[t[n-2]>>2],e+=re[(t[n-2]&3)<<4],e+="=="),n===i&&(e+=re[t[n-2]>>2],e+=re[(t[n-2]&3)<<4|t[n-1]>>4],e+=re[(t[n-1]&15)<<2],e+="="),e}function Oo(t){if(t.length%4!==0)throw new Error("Unable to parse base64 string.");const e=t.indexOf("=");if(e!==-1&&e<t.length-2)throw new Error("Unable to parse base64 string.");let n=t.endsWith("==")?2:t.endsWith("=")?1:0,i=t.length,r=new Uint8Array(3*(i/4)),o;for(let s=0,c=0;s<i;s+=4,c+=3)o=Pt(t.charCodeAt(s))<<18|Pt(t.charCodeAt(s+1))<<12|Pt(t.charCodeAt(s+2))<<6|Pt(t.charCodeAt(s+3)),r[c]=o>>16,r[c+1]=o>>8&255,r[c+2]=o&255;return r.subarray(0,r.length-n)}function Eo(t,e=new TextEncoder){return bi(e.encode(t))}var Tt={exports:{}},Io=Tt.exports,Si;function Mo(){return Si||(Si=1,function(t){(function(e,n){var i={};n(i);var r=i.default;for(var o in i)r[o]=i[o];t.exports=r})(Io,function(e){e.__esModule=!0,e.digestLength=32,e.blockSize=64;var n=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function i(m,l,d,f,k){for(var v,$,A,Z,F,E,te,j,B,L,gt,vt,an;k>=64;){for(v=l[0],$=l[1],A=l[2],Z=l[3],F=l[4],E=l[5],te=l[6],j=l[7],L=0;L<16;L++)gt=f+L*4,m[L]=(d[gt]&255)<<24|(d[gt+1]&255)<<16|(d[gt+2]&255)<<8|d[gt+3]&255;for(L=16;L<64;L++)B=m[L-2],vt=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10,B=m[L-15],an=(B>>>7|B<<25)^(B>>>18|B<<14)^B>>>3,m[L]=(vt+m[L-7]|0)+(an+m[L-16]|0);for(L=0;L<64;L++)vt=(((F>>>6|F<<26)^(F>>>11|F<<21)^(F>>>25|F<<7))+(F&E^~F&te)|0)+(j+(n[L]+m[L]|0)|0)|0,an=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&$^v&A^$&A)|0,j=te,te=E,E=F,F=Z+vt|0,Z=A,A=$,$=v,v=vt+an|0;l[0]+=v,l[1]+=$,l[2]+=A,l[3]+=Z,l[4]+=F,l[5]+=E,l[6]+=te,l[7]+=j,f+=64,k-=64}return f}var r=function(){function m(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return m.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},m.prototype.clean=function(){for(var l=0;l<this.buffer.length;l++)this.buffer[l]=0;for(var l=0;l<this.temp.length;l++)this.temp[l]=0;this.reset()},m.prototype.update=function(l,d){if(d===void 0&&(d=l.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=d,this.bufferLength>0){for(;this.bufferLength<64&&d>0;)this.buffer[this.bufferLength++]=l[f++],d--;this.bufferLength===64&&(i(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(d>=64&&(f=i(this.temp,this.state,l,f,d),d%=64);d>0;)this.buffer[this.bufferLength++]=l[f++],d--;return this},m.prototype.finish=function(l){if(!this.finished){var d=this.bytesHashed,f=this.bufferLength,k=d/536870912|0,v=d<<3,$=d%64<56?64:128;this.buffer[f]=128;for(var A=f+1;A<$-8;A++)this.buffer[A]=0;this.buffer[$-8]=k>>>24&255,this.buffer[$-7]=k>>>16&255,this.buffer[$-6]=k>>>8&255,this.buffer[$-5]=k>>>0&255,this.buffer[$-4]=v>>>24&255,this.buffer[$-3]=v>>>16&255,this.buffer[$-2]=v>>>8&255,this.buffer[$-1]=v>>>0&255,i(this.temp,this.state,this.buffer,0,$),this.finished=!0}for(var A=0;A<8;A++)l[A*4+0]=this.state[A]>>>24&255,l[A*4+1]=this.state[A]>>>16&255,l[A*4+2]=this.state[A]>>>8&255,l[A*4+3]=this.state[A]>>>0&255;return this},m.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},m.prototype._saveState=function(l){for(var d=0;d<this.state.length;d++)l[d]=this.state[d]},m.prototype._restoreState=function(l,d){for(var f=0;f<this.state.length;f++)this.state[f]=l[f];this.bytesHashed=d,this.finished=!1,this.bufferLength=0},m}();e.Hash=r;var o=function(){function m(l){this.inner=new r,this.outer=new r,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var d=new Uint8Array(this.blockSize);if(l.length>this.blockSize)new r().update(l).finish(d).clean();else for(var f=0;f<l.length;f++)d[f]=l[f];for(var f=0;f<d.length;f++)d[f]^=54;this.inner.update(d);for(var f=0;f<d.length;f++)d[f]^=106;this.outer.update(d),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<d.length;f++)d[f]=0}return m.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},m.prototype.clean=function(){for(var l=0;l<this.istate.length;l++)this.ostate[l]=this.istate[l]=0;this.inner.clean(),this.outer.clean()},m.prototype.update=function(l){return this.inner.update(l),this},m.prototype.finish=function(l){return this.outer.finished?this.outer.finish(l):(this.inner.finish(l),this.outer.update(l,this.digestLength).finish(l)),this},m.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},m}();e.HMAC=o;function s(m){var l=new r().update(m),d=l.digest();return l.clean(),d}e.hash=s,e.default=s;function c(m,l){var d=new o(m).update(l),f=d.digest();return d.clean(),f}e.hmac=c;function a(m,l,d,f){var k=f[0];if(k===0)throw new Error("hkdf: cannot expand more");l.reset(),k>1&&l.update(m),d&&l.update(d),l.update(f),l.finish(m),f[0]++}var h=new Uint8Array(e.digestLength);function _(m,l,d,f){l===void 0&&(l=h),f===void 0&&(f=32);for(var k=new Uint8Array([1]),v=c(l,m),$=new o(v),A=new Uint8Array($.digestLength),Z=A.length,F=new Uint8Array(f),E=0;E<f;E++)Z===A.length&&(a(A,$,d,k),Z=0),F[E]=A[Z++];return $.clean(),A.fill(0),k.fill(0),F}e.hkdf=_;function y(m,l,d,f){for(var k=new o(m),v=k.digestLength,$=new Uint8Array(4),A=new Uint8Array(v),Z=new Uint8Array(v),F=new Uint8Array(f),E=0;E*v<f;E++){var te=E+1;$[0]=te>>>24&255,$[1]=te>>>16&255,$[2]=te>>>8&255,$[3]=te>>>0&255,k.reset(),k.update(l),k.update($),k.finish(Z);for(var j=0;j<v;j++)A[j]=Z[j];for(var j=2;j<=d;j++){k.reset(),k.update(Z).finish(Z);for(var B=0;B<v;B++)A[B]^=Z[B]}for(var j=0;j<v&&E*v+j<f;j++)F[E*v+j]=A[j]}for(var E=0;E<v;E++)A[E]=Z[E]=0;for(var E=0;E<4;E++)$[E]=0;return k.clean(),F}e.pbkdf2=y})}(Tt)),Tt.exports}var Ro=Mo();const Do=new Int32Array(4);class x{static hashStr(e,n=!1){return this.onePassHasher.start().appendStr(e).end(n)}static hashAsciiStr(e,n=!1){return this.onePassHasher.start().appendAsciiStr(e).end(n)}static stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]);static buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);static hexChars="0123456789abcdef";static hexOut=[];static onePassHasher=new x;static _hex(e){const n=x.hexChars,i=x.hexOut;let r,o,s,c;for(c=0;c<4;c+=1)for(o=c*8,r=e[c],s=0;s<8;s+=2)i[o+1+s]=n.charAt(r&15),r>>>=4,i[o+0+s]=n.charAt(r&15),r>>>=4;return i.join("")}static _md5cycle(e,n){let i=e[0],r=e[1],o=e[2],s=e[3];i+=(r&o|~r&s)+n[0]-680876936|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&o)+n[1]-389564586|0,s=(s<<12|s>>>20)+i|0,o+=(s&i|~s&r)+n[2]+606105819|0,o=(o<<17|o>>>15)+s|0,r+=(o&s|~o&i)+n[3]-1044525330|0,r=(r<<22|r>>>10)+o|0,i+=(r&o|~r&s)+n[4]-176418897|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&o)+n[5]+1200080426|0,s=(s<<12|s>>>20)+i|0,o+=(s&i|~s&r)+n[6]-1473231341|0,o=(o<<17|o>>>15)+s|0,r+=(o&s|~o&i)+n[7]-45705983|0,r=(r<<22|r>>>10)+o|0,i+=(r&o|~r&s)+n[8]+1770035416|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&o)+n[9]-1958414417|0,s=(s<<12|s>>>20)+i|0,o+=(s&i|~s&r)+n[10]-42063|0,o=(o<<17|o>>>15)+s|0,r+=(o&s|~o&i)+n[11]-1990404162|0,r=(r<<22|r>>>10)+o|0,i+=(r&o|~r&s)+n[12]+1804603682|0,i=(i<<7|i>>>25)+r|0,s+=(i&r|~i&o)+n[13]-40341101|0,s=(s<<12|s>>>20)+i|0,o+=(s&i|~s&r)+n[14]-1502002290|0,o=(o<<17|o>>>15)+s|0,r+=(o&s|~o&i)+n[15]+1236535329|0,r=(r<<22|r>>>10)+o|0,i+=(r&s|o&~s)+n[1]-165796510|0,i=(i<<5|i>>>27)+r|0,s+=(i&o|r&~o)+n[6]-1069501632|0,s=(s<<9|s>>>23)+i|0,o+=(s&r|i&~r)+n[11]+643717713|0,o=(o<<14|o>>>18)+s|0,r+=(o&i|s&~i)+n[0]-373897302|0,r=(r<<20|r>>>12)+o|0,i+=(r&s|o&~s)+n[5]-701558691|0,i=(i<<5|i>>>27)+r|0,s+=(i&o|r&~o)+n[10]+38016083|0,s=(s<<9|s>>>23)+i|0,o+=(s&r|i&~r)+n[15]-660478335|0,o=(o<<14|o>>>18)+s|0,r+=(o&i|s&~i)+n[4]-405537848|0,r=(r<<20|r>>>12)+o|0,i+=(r&s|o&~s)+n[9]+568446438|0,i=(i<<5|i>>>27)+r|0,s+=(i&o|r&~o)+n[14]-1019803690|0,s=(s<<9|s>>>23)+i|0,o+=(s&r|i&~r)+n[3]-187363961|0,o=(o<<14|o>>>18)+s|0,r+=(o&i|s&~i)+n[8]+1163531501|0,r=(r<<20|r>>>12)+o|0,i+=(r&s|o&~s)+n[13]-1444681467|0,i=(i<<5|i>>>27)+r|0,s+=(i&o|r&~o)+n[2]-51403784|0,s=(s<<9|s>>>23)+i|0,o+=(s&r|i&~r)+n[7]+1735328473|0,o=(o<<14|o>>>18)+s|0,r+=(o&i|s&~i)+n[12]-1926607734|0,r=(r<<20|r>>>12)+o|0,i+=(r^o^s)+n[5]-378558|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^o)+n[8]-2022574463|0,s=(s<<11|s>>>21)+i|0,o+=(s^i^r)+n[11]+1839030562|0,o=(o<<16|o>>>16)+s|0,r+=(o^s^i)+n[14]-35309556|0,r=(r<<23|r>>>9)+o|0,i+=(r^o^s)+n[1]-1530992060|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^o)+n[4]+1272893353|0,s=(s<<11|s>>>21)+i|0,o+=(s^i^r)+n[7]-155497632|0,o=(o<<16|o>>>16)+s|0,r+=(o^s^i)+n[10]-1094730640|0,r=(r<<23|r>>>9)+o|0,i+=(r^o^s)+n[13]+681279174|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^o)+n[0]-358537222|0,s=(s<<11|s>>>21)+i|0,o+=(s^i^r)+n[3]-722521979|0,o=(o<<16|o>>>16)+s|0,r+=(o^s^i)+n[6]+76029189|0,r=(r<<23|r>>>9)+o|0,i+=(r^o^s)+n[9]-640364487|0,i=(i<<4|i>>>28)+r|0,s+=(i^r^o)+n[12]-421815835|0,s=(s<<11|s>>>21)+i|0,o+=(s^i^r)+n[15]+530742520|0,o=(o<<16|o>>>16)+s|0,r+=(o^s^i)+n[2]-995338651|0,r=(r<<23|r>>>9)+o|0,i+=(o^(r|~s))+n[0]-198630844|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~o))+n[7]+1126891415|0,s=(s<<10|s>>>22)+i|0,o+=(i^(s|~r))+n[14]-1416354905|0,o=(o<<15|o>>>17)+s|0,r+=(s^(o|~i))+n[5]-57434055|0,r=(r<<21|r>>>11)+o|0,i+=(o^(r|~s))+n[12]+1700485571|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~o))+n[3]-1894986606|0,s=(s<<10|s>>>22)+i|0,o+=(i^(s|~r))+n[10]-1051523|0,o=(o<<15|o>>>17)+s|0,r+=(s^(o|~i))+n[1]-2054922799|0,r=(r<<21|r>>>11)+o|0,i+=(o^(r|~s))+n[8]+1873313359|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~o))+n[15]-30611744|0,s=(s<<10|s>>>22)+i|0,o+=(i^(s|~r))+n[6]-1560198380|0,o=(o<<15|o>>>17)+s|0,r+=(s^(o|~i))+n[13]+1309151649|0,r=(r<<21|r>>>11)+o|0,i+=(o^(r|~s))+n[4]-145523070|0,i=(i<<6|i>>>26)+r|0,s+=(r^(i|~o))+n[11]-1120210379|0,s=(s<<10|s>>>22)+i|0,o+=(i^(s|~r))+n[2]+718787259|0,o=(o<<15|o>>>17)+s|0,r+=(s^(o|~i))+n[9]-343485551|0,r=(r<<21|r>>>11)+o|0,e[0]=i+e[0]|0,e[1]=r+e[1]|0,e[2]=o+e[2]|0,e[3]=s+e[3]|0}_dataLength=0;_bufferLength=0;_state=new Int32Array(4);_buffer=new ArrayBuffer(68);_buffer8;_buffer32;constructor(){this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(x.stateIdentity),this}appendStr(e){const n=this._buffer8,i=this._buffer32;let r=this._bufferLength,o,s;for(s=0;s<e.length;s+=1){if(o=e.charCodeAt(s),o<128)n[r++]=o;else if(o<2048)n[r++]=(o>>>6)+192,n[r++]=o&63|128;else if(o<55296||o>56319)n[r++]=(o>>>12)+224,n[r++]=o>>>6&63|128,n[r++]=o&63|128;else{if(o=(o-55296)*1024+(e.charCodeAt(++s)-56320)+65536,o>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");n[r++]=(o>>>18)+240,n[r++]=o>>>12&63|128,n[r++]=o>>>6&63|128,n[r++]=o&63|128}r>=64&&(this._dataLength+=64,x._md5cycle(this._state,i),r-=64,i[0]=i[16])}return this._bufferLength=r,this}appendAsciiStr(e){const n=this._buffer8,i=this._buffer32;let r=this._bufferLength,o,s=0;for(;;){for(o=Math.min(e.length-s,64-r);o--;)n[r++]=e.charCodeAt(s++);if(r<64)break;this._dataLength+=64,x._md5cycle(this._state,i),r=0}return this._bufferLength=r,this}appendByteArray(e){const n=this._buffer8,i=this._buffer32;let r=this._bufferLength,o,s=0;for(;;){for(o=Math.min(e.length-s,64-r);o--;)n[r++]=e[s++];if(r<64)break;this._dataLength+=64,x._md5cycle(this._state,i),r=0}return this._bufferLength=r,this}getState(){const e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){const n=e.buffer,i=e.state,r=this._state;let o;for(this._dataLength=e.length,this._bufferLength=e.buflen,r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],o=0;o<n.length;o+=1)this._buffer8[o]=n.charCodeAt(o)}end(e=!1){const n=this._bufferLength,i=this._buffer8,r=this._buffer32,o=(n>>2)+1;this._dataLength+=n;const s=this._dataLength*8;if(i[n]=128,i[n+1]=i[n+2]=i[n+3]=0,r.set(x.buffer32Identity.subarray(o),o),n>55&&(x._md5cycle(this._state,r),r.set(x.buffer32Identity)),s<=4294967295)r[14]=s;else{const c=s.toString(16).match(/(.*?)(.{0,8})$/);if(c===null)return e?Do:"";const a=parseInt(c[2],16),h=parseInt(c[1],16)||0;r[14]=a,r[15]=h}return x._md5cycle(this._state,r),e?this._state:x._hex(this._state)}}if(x.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592")throw new Error("Md5 self test failed.");const qo=36e5,ki=Symbol.for("constructDateFrom");function Ot(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&ki in t?t[ki](e):t instanceof Date?new t.constructor(e):new Date(e)}function We(t,e){return Ot(t,t)}function Uo(t,e,n){const i=We(t);if(isNaN(e))return Ot(t,NaN);const r=i.getDate(),o=Ot(t,i.getTime());o.setMonth(i.getMonth()+e+1,0);const s=o.getDate();return r>=s?o:(i.setFullYear(o.getFullYear(),o.getMonth(),r),i)}function $i(t,e,n){return Ot(t,+We(t)+e)}function Co(t,e,n){return $i(t,e*qo)}function No(t,e,n){return $i(t,e*1e3)}function Fo(t,e,n){return Uo(t,e*12)}function Ai(t){return Math.trunc(+We(t)/1e3)}function jo(t,e){return+We(t)<+We(e)}function p(t,e,n,i="debug",r){if(window.debug){const s=["color: #0288D1",`color:${r||"#009688"}`,"color: default"];n?gn()?console[i](`%c[PlaceOS]%c[${t}] %c${e}`,...s,n):console[i](`[PlaceOS][${t}] ${e}`,n):gn()?console[i](`%c[PlaceOS]%c[${t}] %c${e}`,...s):console[i](`[PlaceOS][${t}] ${e}`)}}function gn(){return!(document.documentMode||/Edge/.test(navigator.userAgent))}function vn(){const t=window.location?.hash?window.location?.hash.slice(1):window.location?.href.split("#")[1]||"";let e=window.location?.search?window.location?.search.slice(1):window.location?.href.split("?")[1]||"",n={};if(t)if(t.indexOf("?")>=0){const r=t.split("?");n=Re(r[0]),e||(e=r[1])}else n=Re(t);let i={};return e&&(i=Re(e)),{...n,...i}}function Re(t){const e={},n=t.split("&");for(const i of n){const r=i.split("=");r[1]&&(e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]))}return e}const wi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function Pi(t=40){let e="";for(let n=0;n<t;n++)e+=wi.charAt(Math.floor(Math.random()*wi.length));return e}function ae(t){const e=(window.location?.hash||"").replace(new RegExp(`${t}[a-zA-Z0-9_+-.%=]*&?`,"g"),"").replace(/&&/g,"&").replace(/#&/g,"#").replace(/&$/g,"#"),n=(window.location?.search||"").replace(new RegExp(`${t}[a-zA-Z0-9_+-.%=]*&?`,"g"),"").replace(/&&/g,"&").replace(/\?&/g,"#").replace(/&$/g,"#");window.history?.replaceState&&window.history?.replaceState(null,"",`${window.location?.pathname}${e}${n}`)}function xe(t,e=!1){const n=e?1e3:1024;if(t<n)return t+(e?" iB":" B");const i=Math.floor(Math.log(t)/Math.log(n)),r=(e?"kMGTPE":"KMGTPE").charAt(i-1)+(e?"iB":"B");return(t/Math.pow(n,i)).toFixed(2)+" "+r}function Ti(t){if(t.length===0)throw new Error("Input must not be of zero length");const e=t.split(","),n={};for(const i of e){const r=i.split(";");if(r.length!==2)throw new Error("Section could not be split on ';'");const o=r[0].replace(/<(.*)>/,"$1").trim(),s=r[1].replace(/rel="(.*)"/,"$1").trim();n[s]=o}return n}function Oi(t,e){for(const n in t)t.hasOwnProperty(n)&&e.indexOf(t[n])>=0&&delete t[n];return t}function Ei(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Ii(){return window.location!==window.parent.location}function Mi(t=Date.now(),e=60*1e3){return Math.floor(t/e)}class Lo{abort(){p("Stub","Aborted")}}function H(t){let e="";if(t)for(const n in t)t.hasOwnProperty(n)&&t[n]!==void 0&&t[n]!==null&&(e+=`${e?"&":""}${n}=${encodeURIComponent(t[n])}`);return e}const be={},Qe={},le={};function Ho(){for(const t in be)be.hasOwnProperty(t)&&Se(t);for(const t in Qe)Qe.hasOwnProperty(t)&&zo(t);for(const t in le)le.hasOwnProperty(t)&&Bo(t)}function oe(t,e,n=300){if(t&&e&&e instanceof Function)Se(t),be[t]=setTimeout(()=>{e(),delete be[t]},n);else throw new Error(t?"Cannot create named timeout without a name":"Cannot create a timeout without a callback")}function Se(t){be[t]&&(clearTimeout(be[t]),delete be[t])}function zo(t){Qe[t]&&(clearInterval(Qe[t]),delete Qe[t])}function Bo(t){le&&le[t]&&(le[t]instanceof ye?le[t].unsubscribe():le[t](),delete le[t])}const Wo={id:"mock-authority",name:"localhost:4200",description:"",domain:"localhost:4200",login_url:"/login?continue={{url}}",logout_url:"/logout",session:!0,production:!1,config:{},version:"2.0.0"};let b={},T,z;const S={};let O="",ke="";const De=new ce(""),Et=new ce("");let bn="/api/engine/v2";const he=new ce(!1),xo=he.asObservable();let It=0;function fe(){return`${`${b.secure||window.location?.protocol.indexOf("https")>=0?"https:":"http:"}//${b.host||window.location?.host}`}${Sn()}`}function Sn(){return b.version==="ACA Engine"?"/control/api":bn}function Qo(){return!!b.token_header}function Ri(){return O}function Zo(){return b.redirect_uri}function Vo(t,e=!0){T.setItem(`${O}_x-api-key`,`${t}`),T.setItem("trusted",`${e}`),Di("x-api-key",Fo(new Date,5).valueOf())}function Ze(){return Ut("x-api-key",!1)||""}function Di(t,e=Co(new Date,2).valueOf()){b.ignore_api_key&&t==="x-api-key"||(T.setItem(`${O}_expires_at`,`${e}`),T.setItem(`${O}_access_token`,t))}function V(t=!0){if(b.mock)return"mock-token";if(!T)return"";if(Ze()&&!b.ignore_api_key)return"x-api-key";const e=T.getItem(`${O}_expires_at`)||"",n=De.getValue();return jo(+e,new Date)&&(p("Auth","Token expired. Requesting new token..."),Ct(),S.load_authority||(It+=1,oe("re-authorise",()=>An().catch(i=>p("Auth",`Failed to get token: ${i}`)),200*Math.min(20,It))),!t)?"":n||T.getItem(`${O}_access_token`)||""}function Mt(){return Et.getValue()||T.getItem(`${O}_refresh_token`)||""}function Rt(){return b.host||window.location?.host}function qi(){return!!V()}function Ui(){return De.pipe(I(t=>!!qi()))}function Ve(){return z}function Ko(){return he.getValue()}function Dt(){return!!b.mock}function Ci(){return!!b.secure}function Yo(){return xo}function qt(){return Ut("trust")==="true"||Ut("trusted")==="true"}function kn(){return!!Ze()&&!b.ignore_api_key||Ut("fixed_device")==="true"}function Ut(t,e=!0){let i=vn()[t];if(T){const r=`${Ri()}_${t}`;i=i||T.getItem(r)||T.getItem(t)||"",e&&T.setItem(r,`${i}`)}return i}function Jo(t){return b=t||b,b.token_header=b.token_header??Ii(),window.AbortController||(window.AbortController=Lo),T=b.storage==="session"?sessionStorage:localStorage,O=x.hashStr(b.redirect_uri,!1),wn()}function Go(){b={},z=void 0,De.next(""),Et.next(""),he.next(!1),O="",ke="",bn="/api/engine/v2";for(const t in S)t in S&&delete S[t];Ho()}function $n(){return p("Auth","Refreshing authorty."),z=void 0,wn()}function Ct(){p("Auth","Invalidating tokens."),T.removeItem(`${O}_access_token`),T.removeItem(`${O}_expires_at`),De.getValue()&&De.next("")}function An(t,e=z){return S.authorise||(S.authorise=new Promise((n,i)=>{if(!e)return delete S.authorise,i("Authority is not loaded");p("Auth","Authorising user...");const r=()=>{if(V(!1))p("Auth","Valid token found."),delete S.authorise,n(V());else{const o=[()=>{p("Auth","Successfully generated token."),n(V()),delete S.authorise},()=>{p("Auth","Failed to generate token."),i("Failed to generate token"),setTimeout(()=>delete S.authorise,200)}];b&&b.auth_type==="password"?(p("Auth","Logging in with credentials."),cs(b).then(...o),It=0):ke||Mt()?(p("Auth",`Generating token with ${ke?"code":"refresh token"}`),Li().then(...o),It=0):e.session?(p("Auth","Users has session. Authorising application..."),es(t).then(...o)):(p("Auth","No user session"),Fi(e),i("No user session"),setTimeout(()=>delete S.authorise,200))}};ns().then(r,r)})),S.authorise}function Xo(){const t=z?z.logout_url:"/logout";fetch(t,{method:"GET",redirect:"manual",headers:{Authorization:"Bearer "+V()}}).then(e=>{const n=e.headers.get("Location")||t;for(let i=0;i<T.length;i++){const r=T.key(i);r&&r.indexOf(O)>=0&&T.removeItem(r)}window.location?.assign(n)})}function wn(t=0){return S.load_authority||(S.load_authority=new Promise(e=>{if(he.next(!1),b.mock){z=Wo,p("Auth","System in mock mode"),he.next(!0),e();return}p("Auth",`Fixed: ${kn()} | Trusted: ${qt()}`),p("Auth","Loading authority...");const n=b.secure||window.location?.protocol.indexOf("https")>=0,i=r=>{p("Auth",`Failed to load authority(${r})`),he.next(!1),oe("load_authority",()=>{delete S.load_authority,wn(t).then(o=>e())},300*Math.min(20,++t))};yn(`${n?"https:":"http:"}//${Rt()}/auth/authority`,{credentials:"same-origin"}).subscribe(async r=>{if(!r.ok)return i(await r.text().catch(s=>s));z=await r.json(),bn=/[2-9]\.[0-9]+\.[0-9]+/g.test(z.version||"")?"/api/engine/v2":"/control/api",p("Auth","Loaded authority.",[],"group"),z&&(p("Auth",`Name: ${z.name}`),p("Auth",`Version: ${z.version}`),p("Auth",`Domain: ${z.domain}`),p("Auth",`Session: ${z.session}`),p("Auth",`Production: ${z.production}`),p("Auth",`Config Keys: ${Object.keys(z.config||{}).length}`)),p("Auth","",[],"groupEnd");const o=()=>{he.next(!0),p("Auth","Application set online."),e()};delete S.load_authority,An("").then(o,o)},i)})),S.load_authority}async function es(t){const e=rs(t);if(b.use_iframe)return ts(e);window.location?.assign(e)}function ts(t){return S.iframe_auth||(S.iframe_auth=new Promise((e,n)=>{p("Auth","Authorizing in an iFrame...");const i=document.createElement("iframe");i.style.position="absolute",i.style.top="0",i.style.left="0",i.style.height="1px",i.style.width="1px",i.style.zIndex="-1",i.id="place-authorize",i.src=`${t}`;const r=o=>{if(o.origin===window.location?.origin&&o.data.type==="place-os"){const s=o.data;if(p("Auth","Received credentials from iFrame..."),document.body.removeChild(i),Se("iframe_auth"),window.removeEventListener("message",r),delete S.iframe_auth,s.token)return e(),Pn({access_token:s.token,...s});ke=s.code||"",Li().then(c=>e(c),c=>n(c))}};oe("iframe_auth",()=>{p("Auth","Unable to resolve iFrame after 15 seconds..."),n()},15*1e3),window.addEventListener("message",r),i.onerror=o=>{p("Auth","iFrame error.",o),delete S.iframe_auth,n()},document.body.appendChild(i)})),S.iframe_auth}let Ni=!1;function Fi(t){if(b.handle_login!==!1&&!Ni){p("Auth","Redirecting to login page...");const e=t.login_url?.replace("{{url}}",encodeURIComponent(window.location?.href));throw setTimeout(()=>window.location?.assign(e),300),Ni=!0,new Error("Redirecting to login page...")}else p("Auth","Login being handled locally.");delete S.authorise}function ns(){return S.check_token||(S.check_token=new Promise(async(t,e)=>{V()?(p("Auth","Valid token found."),t(V())):(p("Auth","No token. Checking URL for auth credentials..."),await is()?t(!0):e()),delete S.check_token})),S.check_token}function is(){return S.check_params||(S.check_params=new Promise(t=>{p("Auth","Checking for auth parameters...");let e=vn();if((!e||Object.keys(e).length<=0)&&sessionStorage&&(e=JSON.parse(sessionStorage.getItem("ENGINE.auth.params")||"{}")),e&&(e.code||e.access_token||e.refresh_token)){e.code&&(ke=e.code,ae("code")),e.refresh_token&&(T.setItem(`${O}_refresh_token`,e.refresh_token),ae("refresh_token"));const n=T.getItem(`${O}_nonce`)||"",i=(e.state||"").split(";");ae("state"),ae("token_type");const r=i[0];n===r?(Pn(e),t(!!e.access_token)):t(!1)}else t(!1);oe("check_params_promise",()=>delete S.check_params,50)})),S.check_params}function rs(t){const e=as();t=t?`${e};${t}`:e;const n=b?(b.auth_uri||"").indexOf("?")>=0:!1,i=(b?b.auth_uri:null)||"/auth/oauth/authorize",r=qt()||b.auth_type==="auth_code"?"code":"token";let o=`${i}${n?"&":"?"}response_type=${encodeURIComponent(r)}&client_id=${encodeURIComponent(O)}&state=${encodeURIComponent(t)}&redirect_uri=${encodeURIComponent(b.redirect_uri)}&scope=${encodeURIComponent(b.scope)}`;if(b.auth_type==="auth_code"){const{challenge:s,verify:c}=os();sessionStorage.setItem(`${O}_challenge`,s),o+="&code_challenge_method=S256",o+=`&code_challenge=${c}`}return o}const ji="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("");function os(t=43){const e=new Array(t).fill(0).map(()=>ji[Math.floor(Math.random()*ji.length)]).join(""),n=Oo(Eo(e)),i=bi(Ro.hash(n)).split("=")[0].replace(/\//g,"_").replace(/\+/g,"-");return{challenge:e,verify:i}}function ss(){let e=(b.token_uri||"/auth/token")+`?client_id=${encodeURIComponent(O)}`,n="";if(e+=`&redirect_uri=${encodeURIComponent(b.redirect_uri)}`,Mt()){e+=`&refresh_token=${encodeURIComponent(Mt())}`,e+="&grant_type=refresh_token";const i=e.split("?");e=i[0],n=i[1]}else{e+=`&code=${encodeURIComponent(ke)}`,e+="&grant_type=authorization_code";const i=sessionStorage.getItem(`${O}_challenge`);i&&(e+=`&code_verifier=${i}`,sessionStorage.removeItem(`${O}_challenge`)),ke=""}return[e,n]}function us(t){const e=t.token_uri||"/auth/token",n=H({grant_type:"password",client_id:O,client_secret:t.client_secret,redirect_uri:t.redirect_uri,authority:z?.id,scope:t.scope,username:t.username,password:t.password});return`${e}?${n}`}function Li(){return Hi(...ss())}function cs(t){return Hi(us(t))}function Hi(t,e=""){return S.generate_tokens||(S.generate_tokens=new Promise((n,i)=>{p("Auth","Generating new token...");const r=o=>{p("Auth","Error generating new tokens.",o),T.removeItem(`${O}_refresh_token`),Et.next(""),i(),delete S.generate_tokens};yn(t,{method:"POST",body:e,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).subscribe(async o=>{if(!o.ok)return r(o);const s=await o.json();Pn(s),n(),delete S.generate_tokens},r)})),S.generate_tokens}function Pn(t){const e=No(new Date,Math.max(60,parseInt(t.expires_in,10)-300));p("Auth","Tokens generated storing..."),qt()&&(t.access_token&&(T.setItem(`${O}_access_token`,t.access_token),ae("access_token")),t.refresh_token&&(T.setItem(`${O}_refresh_token`,t.refresh_token),ae("refresh_token"))),t.expires_in&&(T.setItem(`${O}_expires_at`,`${e.valueOf()}`),ae("expires_in")),he.next(!0),De.next(t.access_token||""),Et.next(t.refresh_token||"")}function as(){const t=Pi();return T.setItem(`${O}_nonce`,t),t}const Nt={};let zi=(t,e)=>{const n=new Error(`Mock endpoint not found: ${t} ${e}`);return n.status=404,p("HTTP(M)",`404 ${t}:`,e),pi(n)};function ls(t){zi=t}function hs(t,e=Nt){Bi(t.method,t.path,e);const n=`${t.method}|${t.path}`,i=t.path.replace(/(http|https):\/\/[a-zA-Z0-9.-]*:?([0-9]*)?/g,"").replace(/^\//,"").split("/"),r={...t,path_parts:i,path_structure:i.map(o=>o[0]===":"?o.replace(":",""):"")};e[n]=r,p("HTTP(M)",`+ ${t.method} ${t.path}`)}function Bi(t,e,n=Nt){const i=`${t}|${e}`;n[i]&&(delete n[i],p("HTTP(M)",`- ${t} ${e}`))}function fs(t,e,n,i=Nt){const r=ds(t,e,i);if(r){const o=ps(e,r,n);return ms(r,o)}return zi(t,e)}function ds(t,e,n=Nt){const r=e.replace(/(http|https):\/\/[a-zA-Z0-9.-]*:?([0-9]*)?/g,"").replace(/^\//,"").split("?")[0].split("/"),o=Object.keys(n).reduce((s,c)=>(c.indexOf(`${t}|`)===0&&s.push(n[c]),s),[]);for(const s of o)if(s.path_structure.length===r.length){let c=!0;for(let a=0;a<s.path_structure.length;a++)if(!s.path_structure[a]&&s.path_parts[a]!==r[a]){c=!1;break}if(c)return s}return null}function ps(t,e,n){const i=t.replace(/(http|https):\/\/[a-zA-Z0-9.-]*:?([0-9]*)?/g,"").split("?"),r=i[0].replace(/^\//,""),o=i[1]||"",s=Re(o),c=r.split("/"),a={};for(let _=0;_<e.path_structure.length;_++){const y=e.path_structure[_];y&&(a[y]=c[_])}const h={url:t,path:e.path,method:e.method,metadata:e.metadata,route_params:a,query_params:s,body:n};return p("HTTP(M)",`MATCHED ${h.method}:`,h),h}function ms(t,e){let n;try{n=t.callback?t.callback(e):t.metadata}catch(s){throw p("HTTP(M)",`ERROR ${e.method}:`,[e.url,s]),s}const i=t.delay_variance||100,r=t.delay||300,o=Math.floor(Math.random()*i-i/2)+r;return p("HTTP(M)",`RESP ${e.method}:`,[e.url,n]),go([n]).pipe(Ao(Math.max(200,o)))}const Wi={};function xi(t,e=Wi){return e[t]||{}}function X(t,e,n=Ye){return e||(e={response_type:"json"}),n("GET",t,{response_type:"json",...e})}function $e(t,e,n,i=Ye){return n||(n={response_type:"json"}),i("POST",t,{body:e,response_type:"json",...n})}function qe(t,e,n,i=Ye){return n||(n={response_type:"json"}),i("PUT",t,{body:e,response_type:"json",...n})}function Ke(t,e,n,i=Ye){return n||(n={response_type:"json"}),i("PATCH",t,{body:e,response_type:"json",...n})}function Ue(t,e,n=Ye){return e||(e={response_type:"void"}),n("DELETE",t,{response_type:"void",...e})}async function _s(t,e,n=Wi){if(t.headers){const i={};t.headers.forEach?t.headers.forEach((r,o)=>i[o.toLowerCase()]=r):Object.keys(t.headers).forEach(r=>i[r.toLowerCase()]=t.headers[r]),n[t.url||""]=i}switch(e){case"json":return await t.json().catch(()=>({}));case"text":return await t.text();case"void":return;default:return await t.json().catch(()=>({}))}}const Qi=()=>(Ct(),$n().then(()=>Promise.resolve(),()=>new Promise(t=>{setTimeout(()=>{Qi().then(()=>t())},1e3)})));function Ye(t,e,n,i=Dt,r=fs,o=_s){if(i()){const s=r(t,e,n?.body);if(s)return s}return n.headers=n.headers||{},!n.headers["Content-Type"]&&!n.headers["content-type"]&&(n.headers["Content-Type"]="application/json"),Ui().pipe(So(s=>s),yi(1),gi(s=>{V()==="x-api-key"?n.headers["X-API-Key"]=Ze():n.headers.Authorization=`Bearer ${V()}`;const c={...n,method:t,credentials:"same-origin"};return["POST","PUT","PATCH"].includes(t)&&n.body!==void 0&&(c.body=typeof n.body=="string"?n.body:JSON.stringify(n.body)),yn(e,c)}),gi(s=>s.ok?o(s,n.response_type):pi(s)),To({count:4,delay:(s,c)=>new U(a=>{if(s.status===511){Fi(Ve()),a.error(s);return}if(s.status!==401){a.error(s||{});return}p("HTTP","Auth error",s);const h=Math.pow(2,c-1)*1e3;Qi().then(()=>{a.next(h),a.complete()}).catch(()=>{a.error(s)})})}))}class N{id;name;created_at;updated_at;version;constructor(e={}){this.id=e.id||"",this.name=e.name||"",this.created_at=e.created_at||0,this.updated_at=e.updated_at||0,this.version=e.version||0}toJSON(){const e={...this};return e.version=this.version,delete e.created_at,Oi(e,[void 0,null,""])}}class Zi extends N{alert_dashboard_id;alert_dashboard_details;authority_id;description;enabled;conditions;severity;alert_type;debounce_period;constructor(e){super(e),this.authority_id=e.authority_id||"",this.description=e.description||"",this.enabled=e.enabled||!1,this.conditions=e.conditions||{time_dependents:[],comparisons:[]},this.severity=e.severity||"low",this.alert_type=e.alert_type||"threshold",this.debounce_period=e.debounce_period||0,this.alert_dashboard_id=e.alert_dashboard_id||"",this.alert_dashboard_details=e.alert_dashboard_details||void 0}}class Vi extends N{authority_id;description;enabled;constructor(e){super(e),this.authority_id=e.authority_id||"",this.description=e.description||"",this.enabled=e.enabled||!1}}const Ce="alert_dashboards";function Ft(t){return new Vi(t)}function ys(t={}){return P({query_params:t,fn:Ft,path:Ce})}function gs(t,e={}){return w({id:t,query_params:e,fn:Ft,path:Ce})}function vs(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Ft,path:Ce})}function bs(t){return R({form_data:t,query_params:{},fn:Ft,path:Ce})}function Ss(t,e={}){return M({id:t,query_params:e,path:Ce})}function ks(t){return P({query_params:{},fn:Ge,path:`${Ce}/${t}/alerts`})}const Je="alerts";function Ge(t){return new Zi(t)}function $s(t={}){return P({query_params:t,fn:Ge,path:Je})}function As(t,e={}){return w({id:t,query_params:e,fn:Ge,path:Je})}function ws(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Ge,path:Je})}function Ps(t){return R({form_data:t,query_params:{},fn:Ge,path:Je})}function Ts(t,e={}){return M({id:t,query_params:e,path:Je})}class Ki extends N{uid;secret;owner_id;scopes;redirect_uri;skip_authorization;preserve_client_id;constructor(e={}){super(e),this.uid=e.uid||"",this.secret=e.secret||"",this.owner_id=e.owner_id||"",this.scopes=e.scopes||"",this.redirect_uri=e.redirect_uri||"",this.skip_authorization=e.skip_authorization||!1,this.preserve_client_id=e.preserve_client_id||!1}}function Os(t){return Yi[t]||0}function Es(t){return Ji[t]||0}let Yi={},Ji={},Gi="";const jt=t=>t;function P(t){const{query_params:e,fn:n,path:i,endpoint:r}=t,o=H(e),s=`${r||fe()}${i?"/"+i:""}${o?"?"+o:""}`;return X(s).pipe(I(c=>{const a=Is(s,o,i);return{total:a.total||0,next:a.next?()=>P({query_params:a.next,fn:n,endpoint:r,path:i}):null,data:c&&c instanceof Array?c.map(h=>(n||jt)(h)):c&&!(c instanceof Array)&&c.results?c.results.map(h=>h):[]}}))}function w(t){const{query_params:e,id:n,path:i,fn:r,options:o}=t,s=H(e),c=`${fe()}/${i}/${n}${s?"?"+s:""}`;return X(c,o).pipe(I(a=>(r||jt)(a)))}function R(t){const{query_params:e,form_data:n,path:i,fn:r}=t,o=H(e),s=`${fe()}/${i}${o?"?"+o:""}`;return $e(s,n).pipe(I(a=>(r||jt)(a)))}function g(t){const{id:e,task_name:n,form_data:i,method:r,path:o,callback:s}=t,c=H(i),a=`${fe()}/${o}/${e}/${n}`;return(r==="post"||r==="put"||!r?(r==="put"?qe:$e)(a,i):(r==="del"?Ue:X)(`${a}${c?"?"+c:""}`,{response_type:"json"})).pipe(I(_=>(s||(y=>y))(_)))}function D(t){const{id:e,query_params:n,form_data:i,method:r,path:o,fn:s}=t,c=H({...n,version:i.version||0}),a=`${fe()}/${o}/${e}${c?"?"+c:""}`;return(r==="put"?qe:Ke)(a,i).pipe(I(h=>(s||jt)(h)))}function M(t){const{id:e,query_params:n,path:i}=t,r=H(n),o=`${fe()}/${i}/${e}${r?"?"+r:""}`;return Ue(o)}function Is(t,e,n){const i=xi(t[0]==="/"?`${location.origin}${t}`:t),r={total:0,next:null};if(i&&i["x-total-count"]){const o=+(i["x-total-count"]||0);(e.length<2||e.length<12&&e.indexOf("offset=")>=0)&&(Yi[n]=o),Ji[n]=o,r.total=o}return i&&i.link&&(Gi=Ti(i.link||"").next,r.next=Re(Gi.split("?")[1])),r}function Ka(t){return t}const Xe="oauth_apps";function Lt(t){return new Ki(t)}function Ms(t={}){return P({query_params:t,fn:Lt,path:Xe})}function Rs(t,e={}){return w({id:t,query_params:e,fn:Lt,path:Xe})}function Ds(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Lt,path:Xe})}function qs(t){return R({form_data:t,query_params:{},fn:Lt,path:Xe})}function Us(t,e={}){return M({id:t,query_params:e,path:Xe})}var Xi=(t=>(t[t.Certificate=0]="Certificate",t[t.NoAuth=1]="NoAuth",t[t.UserPassword=2]="UserPassword",t))(Xi||{});class er extends N{id;name;auth_type;description;host;port;tls;username;password;certificate;secret;filters;constructor(e={}){super(),this.id=e.id||"",this.name=e.name||"",this.auth_type=e.auth_type||2,this.description=e.description||"",this.host=e.host||"",this.port=e.port||1883,this.tls=e.tls||!1,this.username=e.username||"",this.password=e.password||"",this.certificate=e.certificate||"",this.secret=e.secret||"",this.filters=e.filters||[]}}const et="brokers";function Ht(t){return new er(t)}function Cs(t={}){return P({query_params:t,fn:Ht,path:et})}function Ns(t,e={}){return w({id:t,query_params:e,fn:Ht,path:et})}function Fs(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Ht,path:et})}function js(t){return R({form_data:t,query_params:{},fn:Ht,path:et})}function Ls(t,e={}){return M({id:t,query_params:e,path:et})}class tr{id;compiled_drivers;available_repositories;running_drivers;module_instances;unavailable_repositories;unavailable_drivers;hostname;cpu_count;core_cpu;total_cpu;memory_total;memory_usage;core_memory;memory_percentage;used_memory;total_memory;edge_nodes;run_counts;constructor(e={}){this.id=e.id||e.core_id||"",this.compiled_drivers=e.compiled_drivers||[],this.available_repositories=e.available_repositories||e.status?.available_repositories||[],this.running_drivers=e.running_drivers||e.status?.running_drivers||0,this.module_instances=e.module_instances||e.status?.module_instances||0,this.unavailable_repositories=e.unavailable_repositories||e.status?.unavailable_repositories||[],this.unavailable_drivers=e.unavailable_drivers||e.status?.unavailable_drivers||[],this.hostname=e.hostname||e.load?.local.hostname||"",this.cpu_count=e.cpu_count||e.load?.local.cpu_count||0,this.core_cpu=e.core_cpu||e.load?.local.core_cpu||0,this.total_cpu=e.total_cpu||e.load?.local.total_cpu||0,this.memory_total=e.memory_total||e.load?.local.memory_total||0,this.memory_usage=e.memory_usage||e.load?.local.memory_usage||0,this.core_memory=e.core_memory||e.load?.local.core_memory||0,this.run_counts=e.run_counts||e.status?.run_counts?.local||{modules:0,drivers:0},this.memory_percentage=+(this.memory_usage/this.memory_total*100).toFixed(4),this.used_memory=xe(this.memory_usage*1024),this.total_memory=xe(this.memory_total*1024);const n=e.load?.edge||{};this.edge_nodes=e.edge_nodes||Object.keys(n).map(i=>({id:i,...n[i],run_count:e.status?.run_count?.edge[i]||{}}))||[]}}class nr{cluster_id;id;modules;running;module_instances;last_exit_code;launch_count;launch_time;cpu_usage;memory_total;memory_usage;used_memory;total_memory;constructor(e,n={}){this.cluster_id=e,this.id=n.id||n.driver||"",this.modules=n.modules||[],this.running=n.running||!1,this.module_instances=n.module_instances||n.edge?.status?.module_instances||n.local?.status?.module_instances||0,this.last_exit_code=n.last_exit_code||n.edge?.status?.last_exit_code||n.local?.status?.last_exit_code||0,this.launch_count=n.launch_count||n.edge?.status?.launch_count||n.local?.status?.launch_count||0,this.launch_time=n.launch_time||n.edge?.status?.launch_time||n.local?.status?.launch_time||0,this.cpu_usage=n.cpu_usage||n.percentage_cpu||n.edge?.status?.percentage_cpu||n.local?.status?.percentage_cpu||0,this.memory_total=n.memory_total||n.edge?.status?.memory_total||n.local?.status?.memory_total||0,this.memory_usage=n.memory_usage||n.edge?.status?.memory_usage||n.local?.status?.memory_usage||0,this.used_memory=xe(this.memory_usage*1024),this.total_memory=xe(this.memory_total*1024)}}const zt="cluster";function ir(t){return new tr(t)}function Hs(t={}){return P({query_params:t,fn:ir,path:zt})}function zs(t,e={}){return w({id:t,query_params:e,fn:ir,path:zt})}function Bs(t,e={}){return w({id:t,query_params:e,fn:n=>n.map(i=>new nr(t,i)),path:zt})}function Ws(t,e){return M({id:t,query_params:{driver:e},path:zt})}class rr extends N{domain;login_url;logout_url;description;config;internals;email_domains;constructor(e={}){super(e),this.description=e.description||"",this.domain=e.domain||"",this.login_url=e.login_url||"",this.logout_url=e.logout_url||"",this.config=e.config||{},this.internals=e.internals||{},this.email_domains=e.email_domains||[]}}const tt="domains";function Bt(t){return new rr(t)}function xs(t={}){return P({query_params:t,fn:Bt,path:tt})}function Qs(t,e={}){return w({id:t,query_params:e,fn:Bt,path:tt})}function Zs(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Bt,path:tt})}function Vs(t){return R({form_data:t,query_params:{},fn:Bt,path:tt})}function Ks(t,e={}){return M({id:t,query_params:e,path:tt})}var Ae=(t=>(t[t.None=0]="None",t[t.Support=1]="Support",t[t.Admin=2]="Admin",t[t.NeverDisplay=3]="NeverDisplay",t))(Ae||{});class de extends N{parent_id;updated_at;encryption_level;settings_string;keys;modified_by_id;get value(){return this.settings_string}constructor(e={}){super(e),this.parent_id=e.parent_id||"",this.updated_at=e.updated_at||Math.floor(new Date().getTime()/1e3),this.settings_string=e.settings_string||"",this.encryption_level=e.encryption_level||Ae.None,this.keys=e.keys||[],this.modified_by_id=e.modified_by_id||""}}var nt=(t=>(t[t.SSH=0]="SSH",t[t.Device=1]="Device",t[t.Service=2]="Service",t[t.Websocket=3]="Websocket",t[t.Logic=99]="Logic",t))(nt||{});class Tn extends N{class_name;description;module_name;role;default_uri;default_port;repository_id;file_name;commit;ignore_connected;update_available;update_info;settings;constructor(e={}){super(e),this.description=e.description||"",this.module_name=e.module_name||"",this.role=e.role??nt.Logic,this.default_uri=e.default_uri||"",this.default_port=e.default_port||1,this.ignore_connected=e.ignore_connected||!1,this.class_name=e.class_name||"",this.repository_id=e.repository_id||"",this.file_name=e.file_name||"",this.commit=e.commit||"",this.update_available=e.update_available||!1,this.update_info=e.update_info,this.settings=e.settings||[null,null,null,null],typeof this.settings!="object"&&(this.settings=[null,null,null,null]);for(const n in Ae)!isNaN(Number(n))&&!this.settings[n]&&(this.settings[n]=new de({parent_id:this.id,encryption_level:+n}))}}const se="drivers";function Wt(t){return new Tn(t)}function Ys(t={}){return P({query_params:t,fn:Wt,path:se})}function Js(t,e={}){return w({id:t,query_params:e,fn:Wt,path:se})}function Gs(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Wt,path:se})}function Xs(t){return R({form_data:t,query_params:{},fn:Wt,path:se})}function eu(t,e={}){return M({id:t,query_params:e,path:se})}function tu(t){return g({id:t,task_name:"recompile",path:se})}function nu(t){return g({id:t,task_name:"reload",path:se})}function iu(t){return g({id:t,task_name:"compiled",method:"get",path:se})}function ru(t){return g({id:t,task_name:"readme",method:"get",path:se})}class or extends N{description;secret;x_api_key;online;last_seen;constructor(e={}){super(e),this.description=e.description||"",this.secret=e.secret||"",this.x_api_key=e.x_api_key||"",this.last_seen=(e.last_seen||0)*1e3||Date.now(),this.online=e.online||!1}toJSON(){const e=super.toJSON();return delete e.last_seen,e}}const Ne="edges";function xt(t){return new or(t)}function ou(t={}){return P({query_params:t,fn:xt,path:Ne})}function su(t,e={}){return w({id:t,query_params:e,fn:xt,path:Ne})}function uu(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:xt,path:Ne})}function cu(t){return R({form_data:t,query_params:{},fn:xt,path:Ne})}function au(t,e={}){return M({id:t,query_params:e,path:Ne})}function lu(t,e={}){return g({id:t,task_name:"token",form_data:e,method:"get",path:Ne})}class sr extends N{type="ldap";authority_id;host;port;auth_method;uid;base;bind_dn;password;filter;constructor(e={}){super(e),this.authority_id=e.authority_id||"",this.host=e.host||"",this.port=e.port||636,this.auth_method=e.auth_method||"ssl",this.uid=e.uid||"",this.base=e.base||"",this.bind_dn=e.bind_dn||"",this.password=e.password||"",this.filter=e.filter||""}}const it="ldap_auths";function Qt(t){return new sr(t)}function hu(t={}){return P({query_params:t,fn:Qt,path:it})}function fu(t,e={}){return w({id:t,query_params:e,fn:Qt,path:it})}function du(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Qt,path:it})}function pu(t){return R({form_data:t,query_params:{},fn:Qt,path:it})}function mu(t,e={}){return M({id:t,query_params:e,path:it})}class On{id;name;description;details;editors;schema;updated_at;modified_by_id;version;constructor(e={}){this.id=e.id||e.parent_id||"",this.name=e.name||"",this.description=e.description||"";try{this.details=(typeof e.details=="string"?JSON.parse(e.details):e.details)||{}}catch{this.details=e.details||{}}this.editors=e.editors||[],this.schema=e.schema||"",this.updated_at=(e.updated_at||0)*1e3||Date.now(),this.modified_by_id=e.modified_by_id||"",this.version=e.version||0}}class we extends N{system_name;activated_count;description;debounce_period;important;enabled;enable_webhook;exec_enabled;webhook_secret;supported_methods;control_system_id;zone_id;trigger_id;playlists;get system_id(){return this.control_system_id}get actions(){const e=this._actions,n=(e.functions||[]).map(r=>({...r,args:{...r.args}})),i=(e.mailers||[]).map(r=>({...r,emails:[...r.emails]}));return{functions:n,mailers:i}}get conditions(){const e=this._conditions,n=(e.comparisons||[]).map(r=>({...r,left:typeof r.left=="object"?{...r.left}:r.left,right:typeof r.right=="object"?{...r.right}:r.right})),i=(e.time_dependents||[]).map(r=>({...r}));return{comparisons:n,time_dependents:i}}_actions;_conditions;constructor(e={}){super(e),this.description=e.description||"",this._actions=e.actions||{functions:[],mailers:[]},this._conditions=e.conditions||{comparisons:[],time_dependents:[]},this.debounce_period=e.debounce_period||0,this.important=e.important||!1,this.enabled=e.enabled||!1,this.webhook_secret=e.webhook_secret||"",this.control_system_id=e.system_id||e.control_system_id||"",this.zone_id=e.zone_id||"",this.system_name=e.system_name||(e.control_system?e.control_system.name:""),this.enable_webhook=e.enable_webhook||!1,this.exec_enabled=e.exec_enabled||!1,this.supported_methods=e.supported_methods||["POST"],this.activated_count=e.activated_count||e.trigger_count||0,this.playlists=e.playlists||[],this.trigger_id=e.trigger_id||""}}class Zt extends N{settings=[null,null,null,null];description;parent_id;triggers;tags;location;display_name;code;type;count;capacity;map_id;images;timezone;playlists;trigger_list=[];constructor(e={}){super(e),this.description=e.description||"",this.tags=e.tags||[],this.triggers=e.triggers||[],this.settings=e.settings||[null,null,null,null],this.parent_id=e.parent_id||"",this.location=e.location||"",this.display_name=e.display_name||"",this.code=e.code||"",this.type=e.type||"",this.count=e.count||0,this.capacity=e.capacity||0,this.map_id=e.map_id||"",this.timezone=e.timezone||"",this.images=e.images||[],this.playlists=e.playlists||[],typeof this.settings!="object"&&(this.settings=[null,null,null,null]);for(const n in Ae)!isNaN(Number(n))&&!this.settings[n]&&(this.settings[n]=new de({parent_id:this.id,encryption_level:+n}));e.trigger_data&&e.trigger_data instanceof Array&&(this.trigger_list=e.trigger_data.map(n=>new we(n)))}}class ur{zone;metadata;keys;constructor(e={}){this.zone=new Zt(e.zone),this.keys=e.keys||[],this.metadata={};const n=e.metadata||{};for(const i of this.keys)this.metadata[i]=new On(n[i])}}const Pe="metadata";function rt(t){return new On(t)}function _u(t,e={}){return w({id:t,query_params:e,fn:n=>Object.keys(n).map(i=>rt(n[i])),path:Pe})}function yu(t){const e=[...t],n=[];for(;e.length;){const i=e.pop();Array.isArray(i)?e.push(...i):n.push(i)}return n.reverse()}function gu(t,e={}){return g({id:t,task_name:"history",form_data:e,method:"get",callback:n=>yu(Object.keys(n).map(i=>n[i].map(r=>rt(r)))),path:Pe})}function vu(t,e,n={}){return w({id:t,query_params:{...n,name:e},fn:i=>rt(i[e]),path:Pe})}function bu(t,e,n="put"){return D({id:t,form_data:e,query_params:{},method:n,fn:rt,path:Pe})}function Su(t){return R({form_data:t,query_params:{},fn:rt,path:Pe})}function ku(t,e={}){return M({id:t,query_params:e,path:Pe})}function $u(t,e){return g({id:t,task_name:"children",form_data:e,method:"get",callback:n=>n.map(i=>new ur({...i,keys:Object.keys(i.metadata)})),path:Pe})}class En extends N{settings=[null,null,null,null];display_name;description;email;code;capacity;features;bookable;public;installed_ui_devices;support_url;timetable_url;camera_snapshot_url;camera_url;room_booking_url;map_id;modules;images;zones;timezone;module_list=[];signage;playlists;approval;orientation;constructor(e={}){super(e),this.display_name=e.display_name||"",this.description=e.description||"",this.email=e.email||"",this.code=e.code||"",this.capacity=e.capacity||0,this.features=e.features||[],this.bookable=e.bookable||!1,this.public=e.public??!1,this.installed_ui_devices=e.installed_ui_devices||0,this.support_url=e.support_url||"",this.camera_snapshot_url=e.camera_snapshot_url||"",this.camera_url=e.camera_url||"",this.timetable_url=e.timetable_url||"",this.room_booking_url=e.room_booking_url||"",this.map_id=e.map_id||"",this.modules=e.modules||[],this.images=e.images||[],this.zones=e.zones||[],this.settings=e.settings||[null,null,null,null],this.timezone=e.timezone||"",this.signage=e.signage||!1,this.playlists=e.playlists||[],this.orientation=e.orientation||"unspecified",this.approval=e.approval||!1,typeof this.settings!="object"&&(this.settings=[null,null,null,null]);for(const n in Ae)!isNaN(Number(n))&&!this.settings[n]&&(this.settings[n]=new de({parent_id:this.id,encryption_level:+n}));e.module_data&&e.module_data instanceof Array&&(this.module_list=e.module_data.map(n=>new In(n)))}}class In extends N{connected;running;updated_at;edge_id;driver_id;driver;control_system_id;system;ip;tls;udp;port;makebreak;uri;custom_name;role;notes;ignore_connected;settings=[null,null,null,null];has_runtime_error;error_timestamp;get system_id(){return this.control_system_id}constructor(e={}){super(e),this.driver_id=e.driver_id||e.dependency_id||"",this.control_system_id=e.control_system_id||"",this.edge_id=e.edge_id||"",this.ip=e.ip||"",this.tls=e.tls||!1,this.udp=e.udp||!1,this.port=e.port||1,this.makebreak=e.makebreak||!1,this.uri=e.uri||"",this.custom_name=e.custom_name||"",this.role=e.role??nt.Logic,this.notes=e.notes||"",this.ignore_connected=e.ignore_connected||!1,this.connected=e.connected,this.running=e.running||!1,this.updated_at=e.updated_at||0,this.system=new En(e.control_system||e.system),this.has_runtime_error=e.has_runtime_error||!1,this.error_timestamp=e.error_timestamp||0,this.driver=new Tn(e.dependency||e.driver),this.settings=e.settings||[null,null,null,null],typeof this.settings!="object"&&(this.settings=[null,null,null,null]);for(const n in Ae)!isNaN(Number(n))&&!this.settings[n]&&(this.settings[n]=new de({parent_id:this.id,encryption_level:+n}))}toJSON(e=!1){const n=super.toJSON();return(n.role!==nt.Logic&&!e||!n.control_system_id)&&delete n.control_system_id,delete n.driver,delete n.system,delete n.error_timestamp,delete n.has_runtime_error,n}}const Y="modules";function Vt(t){return new In(t)}function Au(t={}){return P({query_params:t,fn:Vt,path:Y})}function wu(t,e={}){return w({id:t,query_params:e,fn:Vt,path:Y})}function Pu(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Vt,path:Y})}function Tu(t){return R({form_data:t,query_params:{},fn:Vt,path:Y})}function Ou(t,e={}){return M({id:t,query_params:e,path:Y})}function Eu(t){return g({id:t,task_name:"start",path:Y})}function Iu(t){return g({id:t,task_name:"stop",path:Y})}function Mu(t){return g({id:t,task_name:"state",method:"get",path:Y})}function Ru(t,e){return g({id:t,task_name:`state${e}`,method:"get",path:Y})}function Du(t){return g({id:t,task_name:"load",method:"post",path:Y})}function qu(t){return g({id:t,task_name:"settings",method:"get",callback:e=>e.map(n=>new de(n)),path:Y})}function Uu(t){return g({id:t,task_name:"error",method:"get",path:Y})}class cr extends N{type="oauth";authority_id;client_id;client_secret;info_mappings;site;authorize_url;token_method;token_url;auth_scheme;scope;raw_info_url;authorize_params;ensure_matching;constructor(e={}){super(e),this.authority_id=e.authority_id||"",this.client_id=e.client_id||"",this.client_secret=e.client_secret||"",this.info_mappings=e.info_mappings||{},this.authorize_params=e.authorize_params||{},this.ensure_matching=e.ensure_matching||{},this.site=e.site||"",this.authorize_url=e.authorize_url||"oauth/authorize",this.token_method=e.token_method||"post",this.token_url=e.token_url||"oauth/token",this.auth_scheme=e.auth_scheme||"request_body",this.scope=e.scope||"",this.raw_info_url=e.raw_info_url||"",this.authorize_params=e.authorize_params||{},this.ensure_matching=e.ensure_matching||{}}}const ot="oauth_auths";function Kt(t){return new cr(t)}function Cu(t={}){return P({query_params:t,fn:Kt,path:ot})}function Nu(t,e={}){return w({id:t,query_params:e,fn:Kt,path:ot})}function Fu(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Kt,path:ot})}function ju(t){return R({form_data:t,query_params:{},fn:Kt,path:ot})}function Lu(t,e={}){return M({id:t,query_params:e,path:ot})}var Mn=(t=>(t.Driver="driver",t.Interface="interface",t))(Mn||{});class ar extends N{folder_name;description;uri;branch;commit_hash;repo_type;username;password;root_path;get type(){return this.repo_type}constructor(e={}){super(e),this.folder_name=e.folder_name||"",this.description=e.description||"",this.uri=e.uri||"",this.branch=e.branch||"",this.commit_hash=e.commit_hash||"",this.repo_type=e.repo_type||Mn.Driver,this.username=e.username||"",this.password=e.password||"",this.root_path=e.root_path||""}}const Q="repositories";function Yt(t){return new ar(t)}function Hu(t={}){return P({query_params:t,fn:Yt,path:Q})}function zu(t,e={}){return w({id:t,query_params:e,fn:Yt,path:Q})}function Bu(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Yt,path:Q})}function Wu(t){return R({form_data:t,query_params:{},fn:Yt,path:Q})}function xu(t,e={}){return M({id:t,query_params:e,path:Q})}function Qu(t={}){return w({id:"interfaces",query_params:t,path:Q})}function Zu(t){return w({id:"remote_default_branch",query_params:t,path:Q})}function Vu(t){return w({id:"remote_branches",query_params:t,path:Q})}function Ku(t){return w({id:"remote_commits",query_params:t,path:Q})}function Yu(t,e){return g({id:t,task_name:"drivers",form_data:e,method:"get",path:Q})}function Ju(t,e){return g({id:t,task_name:"commits",form_data:e,method:"get",path:Q})}function Gu(t){return g({id:t,task_name:"branches",method:"get",path:Q})}function Xu(t){return g({id:t,task_name:"default_branch",method:"get",path:Q})}function ec(t,e){return g({id:t,task_name:"details",form_data:e,method:"get",path:Q})}function tc(t,e){return g({id:t,task_name:"pull",form_data:e,method:"post",path:Q})}class lr extends N{type="saml";authority_id;issuer;idp_sso_target_url_runtime_params;name_identifier_format;uid_attribute;assertion_consumer_service_url;idp_sso_target_url;idp_cert;idp_cert_fingerprint;attribute_service_name;attribute_statements;request_attributes;idp_slo_target_url;slo_default_relay_state;constructor(e={}){super(e),this.authority_id=e.authority_id||"",this.issuer=e.issuer||"",this.idp_sso_target_url_runtime_params=e.idp_sso_target_url_runtime_params||{},this.name_identifier_format=e.name_identifier_format||"",this.uid_attribute=e.uid_attribute||"",this.assertion_consumer_service_url=e.assertion_consumer_service_url||"",this.idp_sso_target_url=e.idp_sso_target_url||"",this.idp_cert=e.idp_cert||"",this.idp_cert_fingerprint=e.idp_cert_fingerprint||"",this.attribute_service_name=e.attribute_service_name||"",this.attribute_statements=e.attribute_statements||{},this.request_attributes=e.request_attributes||[],this.idp_slo_target_url=e.idp_slo_target_url||"",this.slo_default_relay_state=e.slo_default_relay_state||""}}const st="saml_auths";function Jt(t){return new lr(t)}function nc(t={}){return P({query_params:t,fn:Jt,path:st})}function ic(t,e={}){return w({id:t,query_params:e,fn:Jt,path:st})}function rc(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Jt,path:st})}function oc(t){return R({form_data:t,query_params:{},fn:Jt,path:st})}function sc(t,e={}){return M({id:t,query_params:e,path:st})}const Fe="settings";function ut(t){return new de(t)}function uc(t={}){return P({query_params:t,fn:ut,path:Fe})}function cc(t,e={}){return w({id:t,query_params:e,fn:ut,path:Fe})}function ac(t,e,n={},i="patch"){return D({id:t,form_data:e,query_params:n,method:i,fn:ut,path:Fe})}function lc(t,e={}){return R({form_data:t,query_params:e,fn:ut,path:Fe})}function hc(t,e={}){return M({id:t,query_params:e,path:Fe})}function fc(t,e={}){return g({id:t,task_name:"history",form_data:e,method:"get",callback:n=>n.map(i=>ut(i)),path:Fe})}const C="systems";function Te(t){return new En(t)}function dc(t={}){return P({query_params:t,fn:Te,path:C})}function pc(t={}){return P({query_params:t,fn:Te,path:`${C}/with_emails`})}function mc(t,e={}){return w({id:t,query_params:e,fn:Te,path:C})}function _c(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Te,path:C})}function yc(t){return R({form_data:t,query_params:{},fn:Te,path:C})}function gc(t,e={}){return M({id:t,query_params:e,path:C})}function vc(t,e,n={}){return g({id:t,task_name:`module/${e}`,form_data:n,method:"put",callback:i=>Te(i),path:C})}function bc(t,e){return g({id:t,task_name:`module/${e}`,form_data:{},method:"del",callback:n=>Te(n),path:C})}function Sc(t){return g({id:t,task_name:"start",form_data:{},path:C})}function kc(t){return g({id:t,task_name:"stop",path:C})}function $c(t,e,n,i=1,r=[]){return g({id:t,task_name:`${n}_${i}/${encodeURIComponent(e)}`,form_data:r,path:C})}function Ac(t,e,n=1){return g({id:t,task_name:`${e}_${n}`,method:"get",path:C})}function wc(t,e,n=1,i){return g({id:t,task_name:`${e}_${n}/${i}`,method:"get",path:C})}function Pc(t,e,n=1){return g({id:t,task_name:`functions/${e}_${n}`,method:"get",path:C})}function Tc(t){return P({query_params:{},fn:e=>new Zt(e),path:`${C}/${t}/zones`})}function Oc(t){return P({query_params:{},fn:e=>new we(e),path:`${C}/${t}/triggers`})}function Ec(t,e){return g({id:t,task_name:"triggers",form_data:e,method:"post",callback:n=>new we(n),path:C})}function Ic(t,e){return g({id:t,task_name:`triggers/${e}`,method:"del",path:C})}function Mc(t){return g({id:t,task_name:"settings",method:"get",callback:e=>e.map(n=>new de(n)),path:C})}const je="triggers";function Gt(t){return new we(t)}function Rc(t={}){return P({query_params:t,fn:Gt,path:je})}function Dc(t,e={}){return w({id:t,query_params:e,fn:Gt,path:je})}function qc(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Gt,path:je})}function Uc(t){return R({form_data:t,query_params:{},fn:Gt,path:je})}function Cc(t,e={}){return M({id:t,query_params:e,path:je})}function Nc(t){return g({id:t,task_name:"instances",form_data:{},method:"get",callback:e=>e.map(n=>new we(n)),path:je})}var hr=(t=>(t.EQ="equal",t.NEQ="not_equal",t.GT="greater_than",t.GTE="greater_than_or_equal",t.LT="less_than",t.LTE="less_than_or_equal",t.AND="and",t.OR="or",t.XOR="exclusive_or",t))(hr||{}),fr=(t=>(t.AT="at",t.CRON="cron",t))(fr||{}),dr=(t=>(t[t.ExecuteBefore=0]="ExecuteBefore",t[t.ExecuteAfter=1]="ExecuteAfter",t[t.PayloadOnly=2]="PayloadOnly",t[t.IgnorePayload=3]="IgnorePayload",t))(dr||{});class pr extends N{email_digest;authority_id;email;phone;country;building;groups;image;metadata;login_name;staff_id;first_name;last_name;support;sys_admin;ui_theme;card_number;department;work_preferences;work_overrides;photo_upload_id;locatable;password="";confirm_password="";constructor(e={}){super(e),this.authority_id=e.authority_id||"",this.email=e.email||"",this.email_digest=e.email_digest||"",this.phone=e.phone||"",this.country=e.country||"",this.building=e.building||"",this.image=e.image||"",this.metadata=e.metadata||"",this.login_name=e.login_name||"",this.staff_id=e.staff_id||"",this.first_name=e.first_name||"",this.last_name=e.last_name||"",this.support=!!e.support,this.sys_admin=!!e.sys_admin,this.ui_theme=e.ui_theme||"",this.card_number=e.card_number||"",this.groups=e.groups||[],this.department=e.department||"",this.photo_upload_id=e.photo_upload_id||"",this.work_preferences=e.work_preferences||[],this.work_overrides=e.work_overrides||{},this.locatable=e.locatable??!0}}const Le="users";function ct(t){return new pr(t)}function Fc(t={}){return P({query_params:t,fn:ct,path:Le})}function jc(t,e={}){return w({id:t,query_params:e,fn:ct,path:Le})}function Lc(t={}){return w({id:"current",query_params:t,fn:ct,path:Le})}function Hc(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:ct,path:Le})}function zc(t){return R({form_data:t,query_params:{},fn:ct,path:Le})}function Bc(t,e={}){return M({id:t,query_params:e,path:Le})}const pe="zones";function Xt(t){return new Zt(t)}function Wc(t={}){return P({query_params:t,fn:Xt,path:pe})}function xc(t={}){return w({id:"tags",query_params:t,fn:e=>e,path:pe})}function Qc(t,e={}){return w({id:t,query_params:e,fn:Xt,path:pe})}function Zc(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:Xt,path:pe})}function Vc(t){return R({form_data:t,query_params:{},fn:Xt,path:pe})}function Kc(t,e={}){return M({id:t,query_params:e,path:pe})}function Yc(t,e={}){return P({query_params:e,fn:n=>new we(n),path:`${pe}/${t}/triggers`})}function Jc(t,e,n,i=1,r=[]){return g({id:t,task_name:`exec/${encodeURIComponent(n+"_"+i)}/${encodeURIComponent(e)}`,form_data:r,path:pe})}var Rn=(t=>(t[t.Default=0]="Default",t[t.Cut=1]="Cut",t[t.CrossFade=2]="CrossFade",t[t.SlideTop=3]="SlideTop",t[t.SlideLeft=4]="SlideLeft",t[t.SlideRight=5]="SlideRight",t[t.SlideBottom=6]="SlideBottom",t))(Rn||{});class mr{id;created_at;updated_at;name;description;authority_id;start_time;play_time;video_length;animation;media_type;orientation;media_uri;media_id;thumbnail_id;play_count;valid_from;valid_until;get media_url(){return this.media_id?`/api/engine/v2/uploads/${this.media_id}/url`:this.media_uri}get thumbnail_url(){return`/api/engine/v2/uploads/${this.thumbnail_id}/url`}constructor(e){this.id=e.id||"",this.created_at=e.created_at||Ai(Date.now()),this.updated_at=e.updated_at||Ai(Date.now()),this.name=e.name||"",this.description=e.description||"",this.authority_id=e.authority_id||"",this.start_time=e.start_time||0,this.play_time=e.play_time||0,this.video_length=e.video_length||0,this.animation=e.animation,this.media_type=e.media_type||"unknown",this.orientation=e.orientation||"unspecified",this.media_uri=e.media_uri||"",this.media_id=e.media_id||"",this.thumbnail_id=e.thumbnail_id||"",this.play_count=e.play_count||0,this.valid_from=e.valid_from,this.valid_until=e.valid_until}}class en{id;playlist_id;items;created_at;updated_at;user_id;user_name;user_email;approved;approved_by_id;approved_by_email;approved_by_name;constructor(e={}){this.id=e.id||"",this.playlist_id=e.playlist_id||"",this.created_at=e.created_at||0,this.updated_at=e.updated_at||0,this.items=e.items||[],this.approved=!!e.approved,this.approved_by_id=e.approved_by_id||"",this.approved_by_email=e.approved_by_email||"",this.approved_by_name=e.approved_by_name||"",this.user_id=e.user_id||"",this.user_name=e.user_name||"",this.user_email=e.user_email||""}}class _r{id;created_at;updated_at;name;description;authority_id;orientation;play_count;play_through_count;default_animation;random;enabled;default_duration;play_hours;play_at;play_cron;valid_from;valid_until;constructor(e){this.id=e.id||"",this.created_at=e.created_at||0,this.updated_at=e.updated_at||0,this.name=e.name||"",this.description=e.description||"",this.authority_id=e.authority_id||"",this.orientation=e.orientation||"",this.play_count=e.play_count||0,this.play_through_count=e.play_through_count||0,this.default_animation=e.default_animation||Rn.Cut,this.random=e.random||!1,this.enabled=e.enabled??!0,this.default_duration=e.default_duration??15*1e3,this.valid_from=e.valid_from,this.valid_until=e.valid_until,this.play_hours=e.play_hours||"",this.play_at=e.play_at||"",this.play_cron=e.play_cron||""}}const yr="signage";function Gc(t,e={},n){return w({id:t,query_params:e,fn:i=>i,path:`${yr}`,options:n})}function Xc(t){return g({id:t,task_name:"metrics",form_data:{},method:"post",callback:e=>e,path:yr})}const at="signage/media";function tn(t){return new mr(t)}function ea(t={}){return P({query_params:t,fn:tn,path:at})}function ta(t,e={}){return w({id:t,query_params:e,fn:tn,path:at})}function na(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:tn,path:at})}function ia(t){return R({form_data:t,query_params:{},fn:tn,path:at})}function ra(t,e={}){return M({id:t,query_params:e,path:at})}const ue="signage/playlists";function nn(t){return new _r(t)}function oa(t={}){return P({query_params:t,fn:nn,path:ue})}function sa(t,e={}){return w({id:t,query_params:e,fn:nn,path:ue})}function ua(t,e,n="patch"){return D({id:t,form_data:e,query_params:{},method:n,fn:nn,path:ue})}function ca(t){return R({form_data:t,query_params:{},fn:nn,path:ue})}function aa(t,e={}){return M({id:t,query_params:e,path:ue})}function la(t,e={}){return g({id:t,task_name:"media",form_data:e,method:"get",callback:n=>new en(n),path:ue})}function ha(t,e={}){return g({id:t,task_name:"media/revisions",form_data:e,method:"get",callback:n=>n.map(i=>new en(i)),path:ue})}function fa(t){return g({id:t,task_name:"media/approve",method:"post",path:ue})}function da(t,e){return g({id:t,task_name:"media",form_data:e,method:"post",path:ue,callback:n=>new en(n)})}class Dn{id;question_id;survey_id;type;answer_json;constructor(e){this.id=e.id||0,this.question_id=e.question_id||0,this.survey_id=e.survey_id||0,this.type=e.type||"",this.answer_json=e.answer_json||{}}}const gr="/api/staff/v1/surveys/answers";function pa(t={}){const e=H(t);return X(`${gr}${e?"?"+e:""}`).pipe(I(n=>n.map(i=>new Dn(i))))}function ma(t){return $e(`${gr}`,t).pipe(I(e=>e.map(n=>new Dn(n))))}class lt{id;survey_id;token;email;sent;constructor(e){this.id=e.id||0,this.survey_id=e.survey_id||0,this.token=e.token||"",this.email=e.email||"",this.sent=e.sent??!1}}const ht="/api/staff/v1/surveys/invitations";function _a(t={}){const e=H(t);return X(`${ht}${e?"?"+e:""}`).pipe(I(n=>n.map(i=>new lt(i))))}function ya(t,e={}){const n=H(e);return X(`${ht}/${t}${n?"?"+n:""}`).pipe(I(i=>new lt(i)))}function ga(t,e,n="patch"){return(n==="put"?qe:Ke)(`${ht}/${t}`,e).pipe(I(i=>new lt(i)))}function va(t){return $e(`${ht}`,t).pipe(I(e=>new lt(e)))}function ba(t,e={}){const n=H(e);return Ue(`${ht}/${t}${n?"?"+n:""}`)}class ft{id;title;description;type;options;required;max_rating;choices;tags;deleted;constructor(e){this.id=e.id||0,this.title=e.title||"",this.description=e.description||"",this.type=e.type||"",this.options=e.options||{},this.required=e.required||!1,this.max_rating=e.max_rating||0,this.choices=e.choices||[],this.tags=e.tags||[],this.deleted=e.deleted||!1}}const dt="/api/staff/v1/surveys/questions";function Sa(t={}){const e=H(t);return X(`${dt}${e?"?"+e:""}`).pipe(I(n=>n.map(i=>new ft(i))))}function ka(t,e={}){const n=H(e);return X(`${dt}/${t}${n?"?"+n:""}`).pipe(I(i=>new ft(i)))}function $a(t){return $e(`${dt}`,t).pipe(I(e=>new ft(e)))}function Aa(t,e,n="patch"){return(n==="put"?qe:Ke)(`${dt}/${t}`,e).pipe(I(i=>new ft(i)))}function wa(t,e={}){const n=H(e);return Ue(`${dt}/${t}${n?"?"+n:""}`)}class pt{id;title;description;trigger;building_id;zone_id;pages;constructor(e){this.id=e.id||0,this.title=e.title||"",this.description=e.description||"",this.building_id=e.building_id||"",this.zone_id=e.zone_id||"",this.pages=e.pages||[],this.trigger=e.trigger||"NONE"}}const mt="/api/staff/v1/surveys";function Pa(t={}){const e=H(t);return X(`${mt}${e?"?"+e:""}`).pipe(I(n=>n.map(i=>new pt(i))))}function Ta(t,e={}){const n=H(e);return X(`${mt}/${t}${n?"?"+n:""}`).pipe(I(i=>new pt(i)))}function Oa(t,e,n="patch"){return(n==="put"?qe:Ke)(`${mt}/${t}`,e).pipe(I(i=>new pt(i)))}function Ea(t){return $e(`${mt}`,t).pipe(I(e=>new pt(e)))}function Ia(t,e={}){const n=H(e);return Ue(`${mt}/${t}${n?"?"+n:""}`)}var Ma={url:"",deserializer:function(t){return JSON.parse(t.data)},serializer:function(t){return JSON.stringify(t)}},Ra="WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }",Da=function(t){G(e,t);function e(n,i){var r=t.call(this)||this;if(r._socket=null,n instanceof U)r.destination=i,r.source=n;else{var o=r._config=Be({},Ma);if(r._output=new ge,typeof n=="string")o.url=n;else for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);if(!o.WebSocketCtor&&WebSocket)o.WebSocketCtor=WebSocket;else if(!o.WebSocketCtor)throw new Error("no WebSocket constructor can be found");r.destination=new _n}return r}return e.prototype.lift=function(n){var i=new e(this._config,this.destination);return i.operator=n,i.source=this,i},e.prototype._resetState=function(){this._socket=null,this.source||(this.destination=new _n),this._output=new ge},e.prototype.multiplex=function(n,i,r){var o=this;return new U(function(s){try{o.next(n())}catch(a){s.error(a)}var c=o.subscribe({next:function(a){try{r(a)&&s.next(a)}catch(h){s.error(h)}},error:function(a){return s.error(a)},complete:function(){return s.complete()}});return function(){try{o.next(i())}catch(a){s.error(a)}c.unsubscribe()}})},e.prototype._connectSocket=function(){var n=this,i=this._config,r=i.WebSocketCtor,o=i.protocol,s=i.url,c=i.binaryType,a=this._output,h=null;try{h=o?new r(s,o):new r(s),this._socket=h,c&&(this._socket.binaryType=c)}catch(y){a.error(y);return}var _=new ye(function(){n._socket=null,h&&h.readyState===1&&h.close()});h.onopen=function(y){var m=n._socket;if(!m){h.close(),n._resetState();return}var l=n._config.openObserver;l&&l.next(y);var d=n.destination;n.destination=At.create(function(f){if(h.readyState===1)try{var k=n._config.serializer;h.send(k(f))}catch(v){n.destination.error(v)}},function(f){var k=n._config.closingObserver;k&&k.next(void 0),f&&f.code?h.close(f.code,f.reason):a.error(new TypeError(Ra)),n._resetState()},function(){var f=n._config.closingObserver;f&&f.next(void 0),h.close(),n._resetState()}),d&&d instanceof _n&&_.add(d.subscribe(n.destination))},h.onerror=function(y){n._resetState(),a.error(y)},h.onclose=function(y){h===n._socket&&n._resetState();var m=n._config.closeObserver;m&&m.next(y),y.wasClean?a.complete():a.error(y)},h.onmessage=function(y){try{var m=n._config.deserializer;a.next(m(y))}catch(l){a.error(l)}}},e.prototype._subscribe=function(n){var i=this,r=this.source;return r?r.subscribe(n):(this._socket||this._connectSocket(),this._output.subscribe(n),n.add(function(){var o=i._socket;i._output.observers.length===0&&(o&&(o.readyState===1||o.readyState===0)&&o.close(),i._resetState())}),n)},e.prototype.unsubscribe=function(){var n=this._socket;n&&(n.readyState===1||n.readyState===0)&&n.close(),this._resetState(),t.prototype.unsubscribe.call(this)},e}(pn);function qa(t){return new Da(t)}var ee=(t=>(t[t.PARSE_ERROR=0]="PARSE_ERROR",t[t.BAD_REQUEST=1]="BAD_REQUEST",t[t.ACCESS_DENIED=2]="ACCESS_DENIED",t[t.REQUEST_FAILED=3]="REQUEST_FAILED",t[t.UNKNOWN_CMD=4]="UNKNOWN_CMD",t[t.SYS_NOT_FOUND=5]="SYS_NOT_FOUND",t[t.MOD_NOT_FOUND=6]="MOD_NOT_FOUND",t[t.UNEXPECTED_FAILURE=7]="UNEXPECTED_FAILURE",t))(ee||{}),qn=(t=>(t.Info="info",t.Debug="debug",t.Warning="warn",t.Error="error",t.Fatal="fatal",t.Trace="trace",t))(qn||{});class vr{constructor(e,n){this._system=e;const i=Object.getOwnPropertyNames(Object.getPrototypeOf(n)).filter(r=>r.startsWith("$"));for(const r in n)n.hasOwnProperty(r)&&n[r]!==void 0&&(n[r]instanceof Function?this.addMethod(r,n[r]):this.addProperty(r,n[r]));for(const r of i)n[r]instanceof Function&&this.addMethod(r,n[r])}call(e,n=[]){return this[`$${e}`]instanceof Function?this[`$${e}`](...n):null}listen(e){return!this[`_${e}`]&&!(this[`_${e}_obs`]instanceof U)&&!this[e]&&this.addProperty(e,null),this[`_${e}_obs`]}addMethod(e,n){e[0]!=="$"&&(e=`$${e}`),this[e]=n}addProperty(e,n){e[0]==="$"&&(e=e.replace("$","")),this[`_${e}`]=new ce(n),this[`_${e}_obs`]=this[`_${e}`].asObservable(),Object.defineProperty(this,e,{get:()=>this[`_${e}`].getValue(),set:i=>this[`_${e}`].next(i)})}}class br{constructor(e){for(const n in e)e.hasOwnProperty(n)&&e[n]&&e[n]instanceof Array&&e[n].forEach(i=>{this.addModule(n,i)})}addModule(e,n){this[e]||(this[e]=[]),this[e].push(new vr(this,n))}}const rn={};function Ua(t,e){return rn[t]=new br(e),rn[t]}function Sr(t){return rn[t]}function Ca(t){delete rn[t]}const kr=15;let _t=0,J,$r=0;const W={},Un={},Oe={},Na={},Ee=new ce(!1);Oe._place_os_status=Ee.asObservable();const Ar=new ce([0,0]);Oe._place_os_sync=Ar.asObservable();let wr=Date.now(),He,on=0,me=null,sn,Cn=0;const yt=10*1e3,Nn=new ge;Oe._place_os_debug_events=Nn.asObservable();function un(){return fe().indexOf("/control/")>=0?"/control/websocket":`${Sn()}/systems/control`}function Fn(){return Ee.getValue()}function Pr(){return Oe._place_os_status}function Fa(){return Oe._place_os_sync}function Tr(t,e=Un,n=Oe){const i=`${t.sys}|${t.mod}_${t.index}|${t.name}`;return e[i]||(e[i]=new ce(void 0),n[i]=e[i].asObservable()),n[i]}function Or(t,e=Un){const n=`${t.sys}|${t.mod}_${t.index}|${t.name}`;if(e[n])return e[n].getValue()}function jn(t,e=0,n=ze){const i={id:++_t,cmd:"bind",...t};return n(i,e)}function Er(t,e=0,n=ze){const i={id:++_t,cmd:"unbind",...t};return n(i,e)}function Ir(t,e=yt,n=ze){const i={id:++_t,cmd:"exec",...t};return n(i,e)}function ja(t,e=yt,n=ze){const i={id:++_t,cmd:"debug",...t};return n(i,e)}function La(t,e=yt,n=ze){const i={id:++_t,cmd:"ignore",...t};return n(i,e)}function ze(t,e=yt,n=0){const i=`${t.cmd}|${t.sys}|${t.mod}${t.index}|${t.name}|${t.args}|${Mi()}`;if(W[i])p("WS","Request already in progress. Waiting...",t);else{const r={...t,key:i};r.promise=new Promise((o,s)=>{const c=()=>{delete W[i],W[i]=null,ze(t,e,n).then(a=>o(a),a=>s(a))};if(J&&Fn()){Dt()&&Za(t,J,Na),r.resolve=o,r.reject=s;const a=`${t.sys}, ${t.mod}_${t.index}, ${t.name}`;p("WS",`[${t.cmd.toUpperCase()}](${t.id}) ${a}`,t.args),J.next(t),e>0&&oe(`${i}`,()=>{s("Request timed out."),delete W[i],W[i]=null},e)}else me?setTimeout(()=>c(),1e3):Ln().then(()=>c())}),W[i]=r}return W[i].promise}function Mr(t){if(t!=="pong"&&t instanceof Object){if(t.type==="notify"&&t.meta)Ba(t.meta,t.value);else if(t.type==="success")Ha(t);else if(t.type==="debug"){p("WS",`[DEBUG] ${t.mod}${t.klass||""} →`,t.msg);const e=t.meta||{mod:"",index:""};Nn.next({mod_id:t.mod||"<empty>",module:`${e.mod}_${e.index}`,class_name:t.klass||"<empty>",message:t.msg||"<empty>",level:t.level||qn.Debug,time:Math.floor(new Date().getTime()/1e3)})}else t.type==="error"?za(t):t.cmd||p("WS","Invalid websocket message",t,"error");Se(`${t.id}`)}else t==="pong"&&(Cn=Date.now(),p("WS","Pong!"))}function Ha(t){const e=Object.keys(W).map(n=>W[n]).find(n=>n?.id===t.id);p("WS",`[SUCCESS](${t.id})`),e&&e.resolve&&(e.resolve(t.value),delete W[e.key])}function za(t){let e="UNEXPECTED FAILURE";switch(t.code){case ee.ACCESS_DENIED:e="ACCESS DENIED";break;case ee.BAD_REQUEST:e="BAD REQUEST";break;case ee.MOD_NOT_FOUND:e="MODULE NOT FOUND";break;case ee.SYS_NOT_FOUND:e="SYSTEM NOT FOUND";break;case ee.PARSE_ERROR:e="PARSE ERROR";break;case ee.REQUEST_FAILED:e="REQUEST FAILED";break;case ee.UNKNOWN_CMD:e="UNKNOWN COMMAND";break}p("WS",`[ERROR] ${e}(${t.id}): ${t.msg}`,void 0,"error");const n=Object.keys(W).map(i=>W[i]).filter(i=>i).find(i=>i.id===t.id);n&&n.reject&&(n.reject(t),Se(`${n.key}`),delete W[n.key])}function Ba(t,e,n=Un,i=Oe){const r=`${t.sys}|${t.mod}_${t.index}|${t.name}`;n[r]||(n[r]=new ce(null),i[r]=n[r].asObservable());const o=`${t.sys}, ${t.mod}_${t.index}, ${t.name}`;p("WS",`[NOTIFY] ${o} changed`,[n[r].getValue(),"→",e]),n[r].next(e)}function Ln(t=0){return me==null&&(me=new Promise(e=>{if(t>40)return location.reload();on++,wr=Date.now(),J=Dt()?Qa():Wa(),J?(p("WS(Debug)","Authority:",[Ve()]),p("WS","Connecting to websocket..."),J.subscribe(n=>{Ee.getValue()||(p("WS","Connection established."),e()),Ee.next(!0),on=0,Hn(),Mr(n)},n=>{J=void 0,me=null,Dr(),Hn(),xa(n)},()=>{J=void 0,me=null,Dr(),p("WS","Connection closed by browser."),Ee.next(!1),cn()}),He&&clearInterval(He),Cn=Date.now(),Rr(),He=setInterval(()=>Rr(),kr*1e3),Hn(),$r+=1,sn=setTimeout(()=>{p("WS","Unhealthy connection. Reconnecting..."),Ee.next(!1),me=null,cn()},30*1e3)):(J?p("WS",`Waiting on auth(${t}). Retrying in ${1e3*Math.min(10,t+1)}ms...`,[!!V(),!!Ve()],"info"):p("WS",`Failed to create websocket(${t}). Retrying in ${1e3*Math.min(10,t+1)}ms...`,void 0,"error"),setTimeout(()=>{me=null,Ln(t).then(n=>e(n))},1e3*Math.min(10,++t)))})),me}function Wa(){if(!Ve()||!V())return null;const t=Ci()||location.protocol.indexOf("https")>=0;let e=`ws${t?"s":""}://${Rt()}${un()}${kn()?"?fixed_device=true":""}`;const n=V();let i=n==="x-api-key"?`api-key=${Ze()}`:`bearer_token=${n}`;return!Qo()&&!Ei()?(p("WS","Authenticating through cookie..."),i+=`;max-age=120;path=${un()};`,i+=`${t?"secure;":""}samesite=strict`,document.cookie=i,p("WS","Cookies:",[document.cookie,i])):(p("WS","Authenticating through URL query parameter..."),e+=`${e.indexOf("?")>=0?"&":"?"}${i}`),p("WS",`Creating websocket connection to ws${t?"s":""}://${Rt()}${un()}`),qa({url:e,serializer:r=>typeof r=="object"?JSON.stringify(r):r,deserializer:r=>{let o=r.data;if(o==="pong")return o;try{return JSON.parse(r.data)}catch{return o}}})}function cn(){Ar.next([$r,Date.now()-wr]),J&&Fn()&&(J.complete(),He&&(clearInterval(He),He=void 0)),p("WS",`Reconnecting in ${Math.min(5e3,on*300||1e3)}ms...`),oe("reconnect",()=>Ln(),Math.min(5e3,(on+1)*300||1e3))}function Rr(){if(Date.now()-Cn>4*kr*1e3)return cn();J?.next("ping")}function xa(t){Ee.next(!1),p("WS","Websocket error:",t,void 0,"error"),t.status===401&&Ct(),$n(),cn()}function Hn(){sn&&(clearTimeout(sn),sn=void 0)}function Qa(){const t=new ge;return t.subscribe(e=>Mr(e)),t}function Za(t,e,n){const i=`${t.sys}|${t.mod}_${t.index}|${t.name}`,r=Sr(t.sys),o=r&&r[t.mod]?r[t.mod][t.index-1||0]:null;if(o){switch(t.cmd){case"bind":n[i]=o.listen(t.name).subscribe(s=>{setTimeout(()=>{e.next({type:"notify",value:s,meta:t})},Math.floor(Math.random()*100+50))});break;case"unbind":n[i]&&(n[i].unsubscribe(),delete n[i],Se(`${i}`));break}oe(`${t.id}-response`,()=>{const s={id:t.id,type:"success",value:t.cmd==="exec"?o.call(t.name,t.args):null};e.next(s)},10)}else oe(`${t.id}-error`,()=>e.next({id:t.id,type:"error",code:r?ee.SYS_NOT_FOUND:ee.MOD_NOT_FOUND}),10)}function Dr(){for(const t in W)W[t]&&delete W[t]}class zn{constructor(e,n){this._module=e,this.name=n,Pr().pipe(wo()).subscribe(i=>{i&&(this._stale_bindings||this._pending===1)?(p("VAR","Re-binding to status variable",this.binding()),this.rebind()):i||(Se(`rebind:${JSON.stringify(this.binding())}`),p("VAR","Binding dropped due to disconnection, re-binding when possible.",this.binding()),this._stale_bindings=this._binding_count||this._stale_bindings,this._binding_count=0)})}name;_pending=0;_binding_count=0;_stale_bindings=0;get count(){return this._binding_count}get value(){return Or(this.binding())}listen(){return Tr(this.binding())}subscribe(e){return this.listen().subscribe(e)}bindThenSubscribe(e){const n=this.bind();return this.listen().subscribe({next:e,complete:()=>n(),error:()=>n()})}bind(){return(this._binding_count<=0&&this._stale_bindings<=0||this._pending===2)&&(this._pending=1,jn(this.binding()).then(()=>{this._binding_count++,this._pending=0}).catch(()=>null)),()=>this.unbind()}unbind(){this._binding_count===1&&this._pending===0?(this._pending=2,Er(this.binding()).then(()=>{this._pending===2&&(this._pending=0),this._binding_count--})):this._binding_count=Math.max(this._binding_count-1,0)}async rebind(){!this._stale_bindings&&this._pending!==1||oe(`rebind:${JSON.stringify(this.binding())}`,async()=>{await jn(this.binding()),this._binding_count=this._stale_bindings||1,this._stale_bindings=0},100)}binding(){return{sys:this._module.system.id,mod:this._module.name,index:this._module.index,name:this.name}}}class qr{constructor(e,n){this._system=e,this._id=n}_bindings={};get id(){return`${this.name}_${this.index}`}get system(){return this._system}get index(){const n=this._id.split("_").pop();return parseInt(n||"",10)||1}get name(){const e=this._id.split("_");return e.pop(),e.join("_")}binding(e){return this._bindings[e]||(this._bindings[e]=new zn(this,e)),this._bindings[e]}variable(e){return this._bindings[e]||(this._bindings[e]=new zn(this,e)),this._bindings[e]}execute(e,n,i=yt){return Ir({sys:this._system.id,mod:this.name,index:this.index,name:e,args:n},i)}}class Ur{id;_module_list={};constructor(e){this.id=e}module(e,n=1){if(!e)throw new Error("Invalid module ID");const i=e.split("_");i.length>1&&Number.isInteger(+i[i.length-1])&&(n=+i[i.length-1],i.pop()),n<1&&(n=1);const r=i.join("_");for(this._module_list[r]||(this._module_list[r]=[]);this._module_list[r].length<n;)this._module_list[r].push(new qr(this,`${r}_${this._module_list[r].length+1}`));return this._module_list[r][n-1]}}const Bn={};function Cr(t){return Bn[t]||(Bn[t]=new Ur(t)),Bn[t]}function Va(t,e,n=1){return Cr(t).module(e,n)}u.AuthType=Xi,u.EncryptionLevel=Ae,u.MediaAnimation=Rn,u.MockPlaceWebsocketModule=vr,u.MockPlaceWebsocketSystem=br,u.PlaceAlert=Zi,u.PlaceAlertDashboard=Vi,u.PlaceApplication=Ki,u.PlaceCluster=tr,u.PlaceDomain=rr,u.PlaceDriver=Tn,u.PlaceDriverRole=nt,u.PlaceEdge=or,u.PlaceErrorCodes=ee,u.PlaceLDAPSource=sr,u.PlaceLogLevel=qn,u.PlaceMQTTBroker=er,u.PlaceMetadata=On,u.PlaceModule=In,u.PlaceModuleBinding=qr,u.PlaceOAuthSource=cr,u.PlaceProcess=nr,u.PlaceRepository=ar,u.PlaceRepositoryType=Mn,u.PlaceResource=N,u.PlaceSAMLSource=lr,u.PlaceSettings=de,u.PlaceSystem=En,u.PlaceSystemBinding=Ur,u.PlaceTrigger=we,u.PlaceUser=pr,u.PlaceVariableBinding=zn,u.PlaceZone=Zt,u.PlaceZoneMetadata=ur,u.SignageMedia=mr,u.SignagePlaylist=_r,u.SignagePlaylistMedia=en,u.Survey=pt,u.SurveyAnswer=Dn,u.SurveyInvitation=lt,u.SurveyQuestion=ft,u.TriggerConditionOperator=hr,u.TriggerTimeConditionType=fr,u.TriggerWebhookType=dr,u.addAlert=Ps,u.addAlertDashboard=bs,u.addAnswer=ma,u.addApplication=qs,u.addBroker=js,u.addDomain=Vs,u.addDriver=Xs,u.addEdge=cu,u.addInvitation=va,u.addLDAPSource=pu,u.addMetadata=Su,u.addModule=Tu,u.addOAuthSource=ju,u.addQuestion=$a,u.addRepository=Wu,u.addSAMLSource=oc,u.addSettings=lc,u.addSignageMedia=ia,u.addSignagePlaylist=ca,u.addSurvey=Ea,u.addSystem=yc,u.addSystemModule=vc,u.addSystemTrigger=Ec,u.addTrigger=Uc,u.addUser=zc,u.addZone=Vc,u.apiEndpoint=fe,u.apiKey=Ze,u.approveSignagePlaylist=fa,u.authorise=An,u.authority=Ve,u.bind=jn,u.cleanObject=Oi,u.cleanupAuth=Go,u.clientId=Ri,u.connectionState=Fa,u.consoleHasColours=gn,u.convertPairStringToMap=Re,u.create=R,u.currentUser=Lc,u.debug=ja,u.debug_events=Nn,u.del=Ue,u.deregisterMockEndpoint=Bi,u.deregisterSystem=Ca,u.driverReadme=ru,u.execute=Ir,u.executeOnSystem=$c,u.executeOnZone=Jc,u.functionList=Pc,u.generateNonce=Pi,u.get=X,u.getFragments=vn,u.getModule=Va,u.getSystem=Cr,u.hasToken=qi,u.host=Rt,u.httpRoute=Sn,u.humanReadableByteCount=xe,u.ignore=La,u.invalidateToken=Ct,u.isDriverCompiled=iu,u.isFixedDevice=kn,u.isMobileSafari=Ei,u.isMock=Dt,u.isNestedFrame=Ii,u.isOnline=Ko,u.isSecure=Ci,u.isTrusted=qt,u.is_connected=Fn,u.lastRequestTotal=Es,u.listChildMetadata=$u,u.listDashboardAlerts=ks,u.listInterfaceRepositories=Qu,u.listMetadata=_u,u.listMetadataHistory=gu,u.listRemoteRepositoryBranches=Vu,u.listRemoteRepositoryCommits=Ku,u.listRemoteRepositoryDefaultBranch=Zu,u.listRepositoryBranches=Gu,u.listRepositoryCommits=Ju,u.listRepositoryDefaultBranch=Xu,u.listRepositoryDriverDetails=ec,u.listRepositoryDrivers=Yu,u.listSignagePlaylistMedia=la,u.listSignagePlaylistMediaRevisions=ha,u.listSystemTriggers=Oc,u.listSystemZones=Tc,u.listTriggerInstances=Nc,u.listZoneTags=xc,u.listZoneTriggers=Yc,u.listen=Tr,u.listenForToken=Ui,u.loadModule=Du,u.log=p,u.logout=Xo,u.lookupModuleState=Ru,u.lookupSystemModuleState=wc,u.mockSystem=Sr,u.moduleRuntimeError=Uu,u.moduleSettings=qu,u.moduleState=Mu,u.onlineState=Yo,u.parseLinkHeader=Ti,u.patch=Ke,u.post=$e,u.pullRepositoryChanges=tc,u.put=qe,u.query=P,u.queryAlertDashboards=ys,u.queryAlerts=$s,u.queryAnswers=pa,u.queryApplications=Ms,u.queryBrokers=Cs,u.queryClusters=Hs,u.queryDomains=xs,u.queryDrivers=Ys,u.queryEdges=ou,u.queryInvitations=_a,u.queryLDAPSources=hu,u.queryModules=Au,u.queryOAuthSources=Cu,u.queryProcesses=Bs,u.queryQuestions=Sa,u.queryRepositories=Hu,u.querySAMLSources=nc,u.querySettings=uc,u.querySignageMedia=ea,u.querySignagePlaylists=oa,u.querySurveys=Pa,u.querySystems=dc,u.querySystemsWithEmails=pc,u.queryTriggers=Rc,u.queryUsers=Fc,u.queryZones=Wc,u.recompileDriver=tu,u.redirectUri=Zo,u.refreshAuthority=$n,u.refreshToken=Mt,u.registerMockEndpoint=hs,u.registerSystem=Ua,u.reloadDriver=nu,u.remove=M,u.removeAlert=Ts,u.removeAlertDashboard=Ss,u.removeApplication=Us,u.removeBroker=Ls,u.removeDomain=Ks,u.removeDriver=eu,u.removeEdge=au,u.removeFragment=ae,u.removeInvitation=ba,u.removeLDAPSource=mu,u.removeMetadata=ku,u.removeModule=Ou,u.removeOAuthSource=Lu,u.removeQuestion=wa,u.removeRepository=xu,u.removeSAMLSource=sc,u.removeSettings=hc,u.removeSignageMedia=ra,u.removeSignagePlaylist=aa,u.removeSurvey=Ia,u.removeSystem=gc,u.removeSystemModule=bc,u.removeSystemTrigger=Ic,u.removeTrigger=Cc,u.removeUser=Bc,u.removeZone=Kc,u.requestTotal=Os,u.responseHeaders=xi,u.retrieveEdgeToken=lu,u.setAPI_Key=Vo,u.setMockNotFoundHandler=ls,u.setToken=Di,u.settingsHistory=fc,u.setup=Jo,u.show=w,u.showAlert=As,u.showAlertDashboard=gs,u.showApplication=Rs,u.showBroker=Ns,u.showCluster=zs,u.showDomain=Qs,u.showDriver=Js,u.showEdge=su,u.showInvitation=ya,u.showLDAPSource=fu,u.showMetadata=vu,u.showModule=wu,u.showOAuthSource=Nu,u.showQuestion=ka,u.showRepository=zu,u.showSAMLSource=ic,u.showSettings=cc,u.showSignage=Gc,u.showSignageMedia=ta,u.showSignageMetrics=Xc,u.showSignagePlaylist=sa,u.showSurvey=Ta,u.showSystem=mc,u.showTrigger=Dc,u.showUser=jc,u.showZone=Qc,u.simplifiedTime=Mi,u.startModule=Eu,u.startSystem=Sc,u.status=Pr,u.stopModule=Iu,u.stopSystem=kc,u.systemModuleState=Ac,u.systemSettings=Mc,u.terminateProcess=Ws,u.token=V,u.unbind=Er,u.update=D,u.updateAlert=ws,u.updateAlertDashboard=vs,u.updateApplication=Ds,u.updateBroker=Fs,u.updateDomain=Zs,u.updateDriver=Gs,u.updateEdge=uu,u.updateInvitation=ga,u.updateLDAPSource=du,u.updateMetadata=bu,u.updateModule=Pu,u.updateOAuthSource=Fu,u.updateQuestion=Aa,u.updateRepository=Bu,u.updateSAMLSource=rc,u.updateSettings=ac,u.updateSignageMedia=na,u.updateSignagePlaylist=ua,u.updateSignagePlaylistMedia=da,u.updateSurvey=Oa,u.updateSystem=_c,u.updateTrigger=qc,u.updateUser=Hc,u.updateZone=Zc,u.value=Or,u.websocketRoute=un,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(o,$e){typeof exports=="object"&&typeof module<"u"?$e(exports):typeof define=="function"&&define.amd?define(["exports"],$e):(o=typeof globalThis<"u"?globalThis:o||self,$e(o.cloud_uploads={}))})(this,function(o){"use strict";var $e=function(t,e){return $e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},$e(t,e)};function ne(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");$e(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var Je=function(){return Je=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Je.apply(this,arguments)};function ns(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function rs(t,e,n,r){function i(s){return s instanceof n?s:new n(function(u){u(s)})}return new(n||(n=Promise))(function(s,u){function c(m){try{h(r.next(m))}catch(g){u(g)}}function a(m){try{h(r.throw(m))}catch(g){u(g)}}function h(m){m.done?s(m.value):i(m.value).then(c,a)}h((r=r.apply(t,e||[])).next())})}function rr(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,u=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(h){return function(m){return a([h,m])}}function a(h){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,h[0]&&(n=0)),n;)try{if(r=1,i&&(s=h[0]&2?i.return:h[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,h[1])).done)return s;switch(i=0,s&&(h=[h[0]&2,s.value]),h[0]){case 0:case 1:s=h;break;case 4:return n.label++,{value:h[1],done:!1};case 5:n.label++,i=h[1],h=[0];continue;case 7:h=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(h[0]===6||h[0]===2)){n=0;continue}if(h[0]===3&&(!s||h[1]>s[0]&&h[1]<s[3])){n.label=h[1];break}if(h[0]===6&&n.label<s[1]){n.label=s[1],s=h;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(h);break}s[2]&&n.ops.pop(),n.trys.pop();continue}h=e.call(t,n)}catch(m){h=[6,m],i=0}finally{r=s=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}function Fe(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function It(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],u;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){u={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(u)throw u.error}}return s}function qt(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function je(t){return this instanceof je?(this.v=t,this):new je(t)}function is(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),c("next"),c("throw"),c("return",u),i[Symbol.asyncIterator]=function(){return this},i;function u(l){return function(d){return Promise.resolve(d).then(l,g)}}function c(l,d){r[l]&&(i[l]=function(f){return new Promise(function(A,S){s.push([l,f,A,S])>1||a(l,f)})},d&&(i[l]=d(i[l])))}function a(l,d){try{h(r[l](d))}catch(f){_(s[0][3],f)}}function h(l){l.value instanceof je?Promise.resolve(l.value.v).then(m,g):_(s[0][2],l)}function m(l){a("next",l)}function g(l){a("throw",l)}function _(l,d){l(d),s.shift(),s.length&&a(s[0][0],s[0][1])}}function ss(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof Fe=="function"?Fe(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(u){return new Promise(function(c,a){u=t[s](u),i(c,a,u.done,u.value)})}}function i(s,u,c,a){Promise.resolve(a).then(function(h){s({value:h,done:c})},u)}}typeof SuppressedError=="function"&&SuppressedError;function N(t){return typeof t=="function"}function ir(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var $n=ir(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
|
|
2
|
+
`+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=n}});function Mt(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var Ae=function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,s;if(!this.closed){this.closed=!0;var u=this._parentage;if(u)if(this._parentage=null,Array.isArray(u))try{for(var c=Fe(u),a=c.next();!a.done;a=c.next()){var h=a.value;h.remove(this)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}else u.remove(this);var m=this.initialTeardown;if(N(m))try{m()}catch(f){s=f instanceof $n?f.errors:[f]}var g=this._finalizers;if(g){this._finalizers=null;try{for(var _=Fe(g),l=_.next();!l.done;l=_.next()){var d=l.value;try{ur(d)}catch(f){s=s??[],f instanceof $n?s=qt(qt([],It(s)),It(f.errors)):s.push(f)}}}catch(f){r={error:f}}finally{try{l&&!l.done&&(i=_.return)&&i.call(_)}finally{if(r)throw r.error}}}if(s)throw new $n(s)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)ur(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&Mt(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&Mt(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=function(){var e=new t;return e.closed=!0,e}(),t}(),sr=Ae.EMPTY;function or(t){return t instanceof Ae||t&&"closed"in t&&N(t.remove)&&N(t.add)&&N(t.unsubscribe)}function ur(t){N(t)?t():t.unsubscribe()}var os={Promise:void 0},us={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,qt([t,e],It(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function cr(t){us.setTimeout(function(){throw t})}function ar(){}function Rt(t){t()}var Ut=function(t){ne(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,or(n)&&n.add(r)):r.destination=ls,r}return e.create=function(n,r,i){return new An(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ae),cs=function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Dt(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Dt(r)}else Dt(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Dt(n)}},t}(),An=function(t){ne(e,t);function e(n,r,i){var s=t.call(this)||this,u;return N(n)||!n?u={next:n??void 0,error:r??void 0,complete:i??void 0}:u=n,s.destination=new cs(u),s}return e}(Ut);function Dt(t){cr(t)}function as(t){throw t}var ls={closed:!0,next:ar,error:as,complete:ar},wn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Pn(t){return t}function hs(t){return t.length===0?Pn:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var j=function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,s=ds(e)?e:new An(e,n,r);return Rt(function(){var u=i,c=u.operator,a=u.source;s.add(c?c.call(s,a):a?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=lr(n),new n(function(i,s){var u=new An({next:function(c){try{e(c)}catch(a){s(a),u.unsubscribe()}},error:s,complete:i});r.subscribe(u)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[wn]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return hs(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=lr(e),new e(function(r,i){var s;n.subscribe(function(u){return s=u},function(u){return i(u)},function(){return r(s)})})},t.create=function(e){return new t(e)},t}();function lr(t){var e;return(e=t??os.Promise)!==null&&e!==void 0?e:Promise}function fs(t){return t&&N(t.next)&&N(t.error)&&N(t.complete)}function ds(t){return t&&t instanceof Ut||fs(t)&&or(t)}function ps(t){return N(t?.lift)}function oe(t){return function(e){if(ps(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function ee(t,e,n,r,i){return new _s(t,e,n,r,i)}var _s=function(t){ne(e,t);function e(n,r,i,s,u,c){var a=t.call(this,n)||this;return a.onFinalize=u,a.shouldUnsubscribe=c,a._next=r?function(h){try{r(h)}catch(m){n.error(m)}}:t.prototype._next,a._error=s?function(h){try{s(h)}catch(m){n.error(m)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=i?function(){try{i()}catch(h){n.error(h)}finally{this.unsubscribe()}}:t.prototype._complete,a}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e}(Ut),ms=ir(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),we=function(t){ne(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new Tn(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new ms},e.prototype.next=function(n){var r=this;Rt(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var u=Fe(r.currentObservers),c=u.next();!c.done;c=u.next()){var a=c.value;a.next(n)}}catch(h){i={error:h}}finally{try{c&&!c.done&&(s=u.return)&&s.call(u)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;Rt(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;Rt(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,s=i.hasError,u=i.isStopped,c=i.observers;return s||u?sr:(this.currentObservers=null,c.push(n),new Ae(function(){r.currentObservers=null,Mt(c,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,s=r.thrownError,u=r.isStopped;i?n.error(s):u&&n.complete()},e.prototype.asObservable=function(){var n=new j;return n.source=this,n},e.create=function(n,r){return new Tn(n,r)},e}(j),Tn=function(t){ne(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:sr},e}(we),pe=function(t){ne(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,s=n._value;if(r)throw i;return this._throwIfClosed(),s},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e}(we),On={now:function(){return(On.delegate||Date).now()},delegate:void 0},En=function(t){ne(e,t);function e(n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=1/0),i===void 0&&(i=On);var s=t.call(this)||this;return s._bufferSize=n,s._windowTime=r,s._timestampProvider=i,s._buffer=[],s._infiniteTimeWindow=!0,s._infiniteTimeWindow=r===1/0,s._bufferSize=Math.max(1,n),s._windowTime=Math.max(1,r),s}return e.prototype.next=function(n){var r=this,i=r.isStopped,s=r._buffer,u=r._infiniteTimeWindow,c=r._timestampProvider,a=r._windowTime;i||(s.push(n),!u&&s.push(c.now()+a)),this._trimBuffer(),t.prototype.next.call(this,n)},e.prototype._subscribe=function(n){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(n),i=this,s=i._infiniteTimeWindow,u=i._buffer,c=u.slice(),a=0;a<c.length&&!n.closed;a+=s?1:2)n.next(c[a]);return this._checkFinalizedStatuses(n),r},e.prototype._trimBuffer=function(){var n=this,r=n._bufferSize,i=n._timestampProvider,s=n._buffer,u=n._infiniteTimeWindow,c=(u?1:2)*r;if(r<1/0&&c<s.length&&s.splice(0,s.length-c),!u){for(var a=i.now(),h=0,m=1;m<s.length&&s[m]<=a;m+=2)h=m;h&&s.splice(0,h+1)}},e}(we),ys=function(t){ne(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e}(Ae),hr={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,qt([t,e],It(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},gs=function(t){ne(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var s=this.id,u=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(u,s,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(u,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),hr.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&hr.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,s;try{this.work(n)}catch(u){i=!0,s=u||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Mt(s,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(ys),fr=function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=On.now,t}(),vs=function(t){ne(e,t);function e(n,r){r===void 0&&(r=fr.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e}(fr),dr=new vs(gs),bs=dr,Ss=new j(function(t){return t.complete()});function ks(t){return t&&N(t.schedule)}var pr=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function _r(t){return N(t?.then)}function mr(t){return N(t[wn])}function yr(t){return Symbol.asyncIterator&&N(t?.[Symbol.asyncIterator])}function gr(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function $s(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var vr=$s();function br(t){return N(t?.[vr])}function Sr(t){return is(this,arguments,function(){var n,r,i,s;return rr(this,function(u){switch(u.label){case 0:n=t.getReader(),u.label=1;case 1:u.trys.push([1,,9,10]),u.label=2;case 2:return[4,je(n.read())];case 3:return r=u.sent(),i=r.value,s=r.done,s?[4,je(void 0)]:[3,5];case 4:return[2,u.sent()];case 5:return[4,je(i)];case 6:return[4,u.sent()];case 7:return u.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function kr(t){return N(t?.getReader)}function ue(t){if(t instanceof j)return t;if(t!=null){if(mr(t))return As(t);if(pr(t))return ws(t);if(_r(t))return Ps(t);if(yr(t))return $r(t);if(br(t))return Ts(t);if(kr(t))return Os(t)}throw gr(t)}function As(t){return new j(function(e){var n=t[wn]();if(N(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function ws(t){return new j(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function Ps(t){return new j(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,cr)})}function Ts(t){return new j(function(e){var n,r;try{for(var i=Fe(t),s=i.next();!s.done;s=i.next()){var u=s.value;if(e.next(u),e.closed)return}}catch(c){n={error:c}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function $r(t){return new j(function(e){Es(t,e).catch(function(n){return e.error(n)})})}function Os(t){return $r(Sr(t))}function Es(t,e){var n,r,i,s;return rs(this,void 0,void 0,function(){var u,c;return rr(this,function(a){switch(a.label){case 0:a.trys.push([0,5,6,11]),n=ss(t),a.label=1;case 1:return[4,n.next()];case 2:if(r=a.sent(),!!r.done)return[3,4];if(u=r.value,e.next(u),e.closed)return[2];a.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return c=a.sent(),i={error:c},[3,11];case 6:return a.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:a.sent(),a.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Pe(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var s=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(s),!i)return s}function Ar(t,e){return e===void 0&&(e=0),oe(function(n,r){n.subscribe(ee(r,function(i){return Pe(r,t,function(){return r.next(i)},e)},function(){return Pe(r,t,function(){return r.complete()},e)},function(i){return Pe(r,t,function(){return r.error(i)},e)}))})}function wr(t,e){return e===void 0&&(e=0),oe(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function Is(t,e){return ue(t).pipe(wr(e),Ar(e))}function qs(t,e){return ue(t).pipe(wr(e),Ar(e))}function Ms(t,e){return new j(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function Rs(t,e){return new j(function(n){var r;return Pe(n,e,function(){r=t[vr](),Pe(n,e,function(){var i,s,u;try{i=r.next(),s=i.value,u=i.done}catch(c){n.error(c);return}u?n.complete():n.next(s)},0,!0)}),function(){return N(r?.return)&&r.return()}})}function Pr(t,e){if(!t)throw new Error("Iterable cannot be null");return new j(function(n){Pe(n,e,function(){var r=t[Symbol.asyncIterator]();Pe(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function Us(t,e){return Pr(Sr(t),e)}function Ds(t,e){if(t!=null){if(mr(t))return Is(t,e);if(pr(t))return Ms(t,e);if(_r(t))return qs(t,e);if(yr(t))return Pr(t,e);if(br(t))return Rs(t,e);if(kr(t))return Us(t,e)}throw gr(t)}function Cs(t,e){return e?Ds(t,e):ue(t)}function Tr(t,e){var n=N(t)?t:function(){return t},r=function(i){return i.error(n())};return new j(r)}function Ns(t){return t instanceof Date&&!isNaN(t)}function v(t,e){return oe(function(n,r){var i=0;n.subscribe(ee(r,function(s){r.next(t.call(e,s,i++))}))})}function Fs(t,e,n,r,i,s,u,c){var a=[],h=0,m=0,g=!1,_=function(){g&&!a.length&&!h&&e.complete()},l=function(f){return h<r?d(f):a.push(f)},d=function(f){h++;var A=!1;ue(n(f,m++)).subscribe(ee(e,function(S){e.next(S)},function(){A=!0},void 0,function(){if(A)try{h--;for(var S=function(){var T=a.shift();u||d(T)};a.length&&h<r;)S();_()}catch(T){e.error(T)}}))};return t.subscribe(ee(e,l,function(){g=!0,_()})),function(){}}function Or(t,e,n){return n===void 0&&(n=1/0),N(e)?Or(function(r,i){return v(function(s,u){return e(r,s,i,u)})(ue(t(r,i)))},n):(typeof e=="number"&&(n=e),oe(function(r,i){return Fs(r,i,t,n)}))}function Er(t,e,n){t===void 0&&(t=0),n===void 0&&(n=bs);var r=-1;return e!=null&&(ks(e)?n=e:r=e),new j(function(i){var s=Ns(t)?+t-n.now():t;s<0&&(s=0);var u=0;return n.schedule(function(){i.closed||(i.next(u++),0<=r?this.schedule(void 0,r):i.complete())},s)})}function js(t,e){return oe(function(n,r){var i=0;n.subscribe(ee(r,function(s){return t.call(e,s,i++)&&r.next(s)}))})}function Ir(t){return t<=0?function(){return Ss}:oe(function(e,n){var r=0;e.subscribe(ee(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function Ls(t){return v(function(){return t})}function Hs(t,e){return Or(function(n,r){return ue(t(n,r)).pipe(Ir(1),Ls(n))})}function zs(t,e){e===void 0&&(e=dr);var n=Er(t,e);return Hs(function(){return n})}function Ws(t,e){return e===void 0&&(e=Pn),t=t??Bs,oe(function(n,r){var i,s=!0;n.subscribe(ee(r,function(u){var c=e(u);(s||!t(i,c))&&(s=!1,i=c,r.next(u))}))})}function Bs(t,e){return t===e}function Qs(t){t===void 0&&(t=1/0);var e;t&&typeof t=="object"?e=t:e={count:t};var n=e.count,r=n===void 0?1/0:n,i=e.delay,s=e.resetOnSuccess,u=s===void 0?!1:s;return r<=0?Pn:oe(function(c,a){var h=0,m,g=function(){var _=!1;m=c.subscribe(ee(a,function(l){u&&(h=0),a.next(l)},void 0,function(l){if(h++<r){var d=function(){m?(m.unsubscribe(),m=null,g()):_=!0};if(i!=null){var f=typeof i=="number"?Er(i):ue(i(l,h)),A=ee(a,function(){A.unsubscribe(),d()},function(){a.complete()});f.subscribe(A)}else d()}else a.error(l)})),_&&(m.unsubscribe(),m=null,g())};g()})}function qr(t,e){return oe(function(n,r){var i=null,s=0,u=!1,c=function(){return u&&!i&&r.complete()};n.subscribe(ee(r,function(a){i?.unsubscribe();var h=0,m=s++;ue(t(a,m)).subscribe(i=ee(r,function(g){return r.next(e?e(a,g,m,h++):g)},function(){i=null,c()}))},function(){u=!0,c()}))})}function In(t,e){e===void 0&&(e={});var n=e.selector,r=ns(e,["selector"]);return new j(function(i){var s=new AbortController,u=s.signal,c=!0,a=r.signal;if(a)if(a.aborted)s.abort();else{var h=function(){u.aborted||s.abort()};a.addEventListener("abort",h),i.add(function(){return a.removeEventListener("abort",h)})}var m=Je(Je({},r),{signal:u}),g=function(_){c=!1,i.error(_)};return fetch(t,m).then(function(_){n?ue(n(_)).subscribe(ee(i,void 0,function(){c=!1,i.complete()},g)):(c=!1,i.next(_),i.complete())}).catch(g),function(){c&&s.abort()}})}const ce=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],Mr=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function Ct(t){if(t>=Mr.length)throw new Error("Unable to parse base64 string.");const e=Mr[t];if(e===255)throw new Error("Unable to parse base64 string.");return e}function Rr(t){let e="",n,r=t.length;for(n=2;n<r;n+=3)e+=ce[t[n-2]>>2],e+=ce[(t[n-2]&3)<<4|t[n-1]>>4],e+=ce[(t[n-1]&15)<<2|t[n]>>6],e+=ce[t[n]&63];return n===r+1&&(e+=ce[t[n-2]>>2],e+=ce[(t[n-2]&3)<<4],e+="=="),n===r&&(e+=ce[t[n-2]>>2],e+=ce[(t[n-2]&3)<<4|t[n-1]>>4],e+=ce[(t[n-1]&15)<<2],e+="="),e}function Vs(t){if(t.length%4!==0)throw new Error("Unable to parse base64 string.");const e=t.indexOf("=");if(e!==-1&&e<t.length-2)throw new Error("Unable to parse base64 string.");let n=t.endsWith("==")?2:t.endsWith("=")?1:0,r=t.length,i=new Uint8Array(3*(r/4)),s;for(let u=0,c=0;u<r;u+=4,c+=3)s=Ct(t.charCodeAt(u))<<18|Ct(t.charCodeAt(u+1))<<12|Ct(t.charCodeAt(u+2))<<6|Ct(t.charCodeAt(u+3)),i[c]=s>>16,i[c+1]=s>>8&255,i[c+2]=s&255;return i.subarray(0,i.length-n)}function Zs(t,e=new TextEncoder){return Rr(e.encode(t))}var Nt={exports:{}},Gs=Nt.exports,Ur;function Ks(){return Ur||(Ur=1,function(t){(function(e,n){var r={};n(r);var i=r.default;for(var s in r)i[s]=r[s];t.exports=i})(Gs,function(e){e.__esModule=!0,e.digestLength=32,e.blockSize=64;var n=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function r(_,l,d,f,A){for(var S,T,O,Y,H,D,se,z,Q,W,Ot,Et,kn;A>=64;){for(S=l[0],T=l[1],O=l[2],Y=l[3],H=l[4],D=l[5],se=l[6],z=l[7],W=0;W<16;W++)Ot=f+W*4,_[W]=(d[Ot]&255)<<24|(d[Ot+1]&255)<<16|(d[Ot+2]&255)<<8|d[Ot+3]&255;for(W=16;W<64;W++)Q=_[W-2],Et=(Q>>>17|Q<<15)^(Q>>>19|Q<<13)^Q>>>10,Q=_[W-15],kn=(Q>>>7|Q<<25)^(Q>>>18|Q<<14)^Q>>>3,_[W]=(Et+_[W-7]|0)+(kn+_[W-16]|0);for(W=0;W<64;W++)Et=(((H>>>6|H<<26)^(H>>>11|H<<21)^(H>>>25|H<<7))+(H&D^~H&se)|0)+(z+(n[W]+_[W]|0)|0)|0,kn=((S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10))+(S&T^S&O^T&O)|0,z=se,se=D,D=H,H=Y+Et|0,Y=O,O=T,T=S,S=Et+kn|0;l[0]+=S,l[1]+=T,l[2]+=O,l[3]+=Y,l[4]+=H,l[5]+=D,l[6]+=se,l[7]+=z,f+=64,A-=64}return f}var i=function(){function _(){this.digestLength=e.digestLength,this.blockSize=e.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return _.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},_.prototype.clean=function(){for(var l=0;l<this.buffer.length;l++)this.buffer[l]=0;for(var l=0;l<this.temp.length;l++)this.temp[l]=0;this.reset()},_.prototype.update=function(l,d){if(d===void 0&&(d=l.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=d,this.bufferLength>0){for(;this.bufferLength<64&&d>0;)this.buffer[this.bufferLength++]=l[f++],d--;this.bufferLength===64&&(r(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(d>=64&&(f=r(this.temp,this.state,l,f,d),d%=64);d>0;)this.buffer[this.bufferLength++]=l[f++],d--;return this},_.prototype.finish=function(l){if(!this.finished){var d=this.bytesHashed,f=this.bufferLength,A=d/536870912|0,S=d<<3,T=d%64<56?64:128;this.buffer[f]=128;for(var O=f+1;O<T-8;O++)this.buffer[O]=0;this.buffer[T-8]=A>>>24&255,this.buffer[T-7]=A>>>16&255,this.buffer[T-6]=A>>>8&255,this.buffer[T-5]=A>>>0&255,this.buffer[T-4]=S>>>24&255,this.buffer[T-3]=S>>>16&255,this.buffer[T-2]=S>>>8&255,this.buffer[T-1]=S>>>0&255,r(this.temp,this.state,this.buffer,0,T),this.finished=!0}for(var O=0;O<8;O++)l[O*4+0]=this.state[O]>>>24&255,l[O*4+1]=this.state[O]>>>16&255,l[O*4+2]=this.state[O]>>>8&255,l[O*4+3]=this.state[O]>>>0&255;return this},_.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},_.prototype._saveState=function(l){for(var d=0;d<this.state.length;d++)l[d]=this.state[d]},_.prototype._restoreState=function(l,d){for(var f=0;f<this.state.length;f++)this.state[f]=l[f];this.bytesHashed=d,this.finished=!1,this.bufferLength=0},_}();e.Hash=i;var s=function(){function _(l){this.inner=new i,this.outer=new i,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var d=new Uint8Array(this.blockSize);if(l.length>this.blockSize)new i().update(l).finish(d).clean();else for(var f=0;f<l.length;f++)d[f]=l[f];for(var f=0;f<d.length;f++)d[f]^=54;this.inner.update(d);for(var f=0;f<d.length;f++)d[f]^=106;this.outer.update(d),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<d.length;f++)d[f]=0}return _.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},_.prototype.clean=function(){for(var l=0;l<this.istate.length;l++)this.ostate[l]=this.istate[l]=0;this.inner.clean(),this.outer.clean()},_.prototype.update=function(l){return this.inner.update(l),this},_.prototype.finish=function(l){return this.outer.finished?this.outer.finish(l):(this.inner.finish(l),this.outer.update(l,this.digestLength).finish(l)),this},_.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},_}();e.HMAC=s;function u(_){var l=new i().update(_),d=l.digest();return l.clean(),d}e.hash=u,e.default=u;function c(_,l){var d=new s(_).update(l),f=d.digest();return d.clean(),f}e.hmac=c;function a(_,l,d,f){var A=f[0];if(A===0)throw new Error("hkdf: cannot expand more");l.reset(),A>1&&l.update(_),d&&l.update(d),l.update(f),l.finish(_),f[0]++}var h=new Uint8Array(e.digestLength);function m(_,l,d,f){l===void 0&&(l=h),f===void 0&&(f=32);for(var A=new Uint8Array([1]),S=c(l,_),T=new s(S),O=new Uint8Array(T.digestLength),Y=O.length,H=new Uint8Array(f),D=0;D<f;D++)Y===O.length&&(a(O,T,d,A),Y=0),H[D]=O[Y++];return T.clean(),O.fill(0),A.fill(0),H}e.hkdf=m;function g(_,l,d,f){for(var A=new s(_),S=A.digestLength,T=new Uint8Array(4),O=new Uint8Array(S),Y=new Uint8Array(S),H=new Uint8Array(f),D=0;D*S<f;D++){var se=D+1;T[0]=se>>>24&255,T[1]=se>>>16&255,T[2]=se>>>8&255,T[3]=se>>>0&255,A.reset(),A.update(l),A.update(T),A.finish(Y);for(var z=0;z<S;z++)O[z]=Y[z];for(var z=2;z<=d;z++){A.reset(),A.update(Y).finish(Y);for(var Q=0;Q<S;Q++)O[Q]^=Y[Q]}for(var z=0;z<S&&D*S+z<f;z++)H[D*S+z]=O[z]}for(var D=0;D<S;D++)O[D]=Y[D]=0;for(var D=0;D<4;D++)T[D]=0;return A.clean(),H}e.pbkdf2=g})}(Nt)),Nt.exports}var Ys=Ks();const Js=new Int32Array(4);class G{static hashStr(e,n=!1){return this.onePassHasher.start().appendStr(e).end(n)}static hashAsciiStr(e,n=!1){return this.onePassHasher.start().appendAsciiStr(e).end(n)}static stateIdentity=new Int32Array([1732584193,-271733879,-1732584194,271733878]);static buffer32Identity=new Int32Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);static hexChars="0123456789abcdef";static hexOut=[];static onePassHasher=new G;static _hex(e){const n=G.hexChars,r=G.hexOut;let i,s,u,c;for(c=0;c<4;c+=1)for(s=c*8,i=e[c],u=0;u<8;u+=2)r[s+1+u]=n.charAt(i&15),i>>>=4,r[s+0+u]=n.charAt(i&15),i>>>=4;return r.join("")}static _md5cycle(e,n){let r=e[0],i=e[1],s=e[2],u=e[3];r+=(i&s|~i&u)+n[0]-680876936|0,r=(r<<7|r>>>25)+i|0,u+=(r&i|~r&s)+n[1]-389564586|0,u=(u<<12|u>>>20)+r|0,s+=(u&r|~u&i)+n[2]+606105819|0,s=(s<<17|s>>>15)+u|0,i+=(s&u|~s&r)+n[3]-1044525330|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&u)+n[4]-176418897|0,r=(r<<7|r>>>25)+i|0,u+=(r&i|~r&s)+n[5]+1200080426|0,u=(u<<12|u>>>20)+r|0,s+=(u&r|~u&i)+n[6]-1473231341|0,s=(s<<17|s>>>15)+u|0,i+=(s&u|~s&r)+n[7]-45705983|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&u)+n[8]+1770035416|0,r=(r<<7|r>>>25)+i|0,u+=(r&i|~r&s)+n[9]-1958414417|0,u=(u<<12|u>>>20)+r|0,s+=(u&r|~u&i)+n[10]-42063|0,s=(s<<17|s>>>15)+u|0,i+=(s&u|~s&r)+n[11]-1990404162|0,i=(i<<22|i>>>10)+s|0,r+=(i&s|~i&u)+n[12]+1804603682|0,r=(r<<7|r>>>25)+i|0,u+=(r&i|~r&s)+n[13]-40341101|0,u=(u<<12|u>>>20)+r|0,s+=(u&r|~u&i)+n[14]-1502002290|0,s=(s<<17|s>>>15)+u|0,i+=(s&u|~s&r)+n[15]+1236535329|0,i=(i<<22|i>>>10)+s|0,r+=(i&u|s&~u)+n[1]-165796510|0,r=(r<<5|r>>>27)+i|0,u+=(r&s|i&~s)+n[6]-1069501632|0,u=(u<<9|u>>>23)+r|0,s+=(u&i|r&~i)+n[11]+643717713|0,s=(s<<14|s>>>18)+u|0,i+=(s&r|u&~r)+n[0]-373897302|0,i=(i<<20|i>>>12)+s|0,r+=(i&u|s&~u)+n[5]-701558691|0,r=(r<<5|r>>>27)+i|0,u+=(r&s|i&~s)+n[10]+38016083|0,u=(u<<9|u>>>23)+r|0,s+=(u&i|r&~i)+n[15]-660478335|0,s=(s<<14|s>>>18)+u|0,i+=(s&r|u&~r)+n[4]-405537848|0,i=(i<<20|i>>>12)+s|0,r+=(i&u|s&~u)+n[9]+568446438|0,r=(r<<5|r>>>27)+i|0,u+=(r&s|i&~s)+n[14]-1019803690|0,u=(u<<9|u>>>23)+r|0,s+=(u&i|r&~i)+n[3]-187363961|0,s=(s<<14|s>>>18)+u|0,i+=(s&r|u&~r)+n[8]+1163531501|0,i=(i<<20|i>>>12)+s|0,r+=(i&u|s&~u)+n[13]-1444681467|0,r=(r<<5|r>>>27)+i|0,u+=(r&s|i&~s)+n[2]-51403784|0,u=(u<<9|u>>>23)+r|0,s+=(u&i|r&~i)+n[7]+1735328473|0,s=(s<<14|s>>>18)+u|0,i+=(s&r|u&~r)+n[12]-1926607734|0,i=(i<<20|i>>>12)+s|0,r+=(i^s^u)+n[5]-378558|0,r=(r<<4|r>>>28)+i|0,u+=(r^i^s)+n[8]-2022574463|0,u=(u<<11|u>>>21)+r|0,s+=(u^r^i)+n[11]+1839030562|0,s=(s<<16|s>>>16)+u|0,i+=(s^u^r)+n[14]-35309556|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^u)+n[1]-1530992060|0,r=(r<<4|r>>>28)+i|0,u+=(r^i^s)+n[4]+1272893353|0,u=(u<<11|u>>>21)+r|0,s+=(u^r^i)+n[7]-155497632|0,s=(s<<16|s>>>16)+u|0,i+=(s^u^r)+n[10]-1094730640|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^u)+n[13]+681279174|0,r=(r<<4|r>>>28)+i|0,u+=(r^i^s)+n[0]-358537222|0,u=(u<<11|u>>>21)+r|0,s+=(u^r^i)+n[3]-722521979|0,s=(s<<16|s>>>16)+u|0,i+=(s^u^r)+n[6]+76029189|0,i=(i<<23|i>>>9)+s|0,r+=(i^s^u)+n[9]-640364487|0,r=(r<<4|r>>>28)+i|0,u+=(r^i^s)+n[12]-421815835|0,u=(u<<11|u>>>21)+r|0,s+=(u^r^i)+n[15]+530742520|0,s=(s<<16|s>>>16)+u|0,i+=(s^u^r)+n[2]-995338651|0,i=(i<<23|i>>>9)+s|0,r+=(s^(i|~u))+n[0]-198630844|0,r=(r<<6|r>>>26)+i|0,u+=(i^(r|~s))+n[7]+1126891415|0,u=(u<<10|u>>>22)+r|0,s+=(r^(u|~i))+n[14]-1416354905|0,s=(s<<15|s>>>17)+u|0,i+=(u^(s|~r))+n[5]-57434055|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~u))+n[12]+1700485571|0,r=(r<<6|r>>>26)+i|0,u+=(i^(r|~s))+n[3]-1894986606|0,u=(u<<10|u>>>22)+r|0,s+=(r^(u|~i))+n[10]-1051523|0,s=(s<<15|s>>>17)+u|0,i+=(u^(s|~r))+n[1]-2054922799|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~u))+n[8]+1873313359|0,r=(r<<6|r>>>26)+i|0,u+=(i^(r|~s))+n[15]-30611744|0,u=(u<<10|u>>>22)+r|0,s+=(r^(u|~i))+n[6]-1560198380|0,s=(s<<15|s>>>17)+u|0,i+=(u^(s|~r))+n[13]+1309151649|0,i=(i<<21|i>>>11)+s|0,r+=(s^(i|~u))+n[4]-145523070|0,r=(r<<6|r>>>26)+i|0,u+=(i^(r|~s))+n[11]-1120210379|0,u=(u<<10|u>>>22)+r|0,s+=(r^(u|~i))+n[2]+718787259|0,s=(s<<15|s>>>17)+u|0,i+=(u^(s|~r))+n[9]-343485551|0,i=(i<<21|i>>>11)+s|0,e[0]=r+e[0]|0,e[1]=i+e[1]|0,e[2]=s+e[2]|0,e[3]=u+e[3]|0}_dataLength=0;_bufferLength=0;_state=new Int32Array(4);_buffer=new ArrayBuffer(68);_buffer8;_buffer32;constructor(){this._buffer8=new Uint8Array(this._buffer,0,68),this._buffer32=new Uint32Array(this._buffer,0,17),this.start()}start(){return this._dataLength=0,this._bufferLength=0,this._state.set(G.stateIdentity),this}appendStr(e){const n=this._buffer8,r=this._buffer32;let i=this._bufferLength,s,u;for(u=0;u<e.length;u+=1){if(s=e.charCodeAt(u),s<128)n[i++]=s;else if(s<2048)n[i++]=(s>>>6)+192,n[i++]=s&63|128;else if(s<55296||s>56319)n[i++]=(s>>>12)+224,n[i++]=s>>>6&63|128,n[i++]=s&63|128;else{if(s=(s-55296)*1024+(e.charCodeAt(++u)-56320)+65536,s>1114111)throw new Error("Unicode standard supports code points up to U+10FFFF");n[i++]=(s>>>18)+240,n[i++]=s>>>12&63|128,n[i++]=s>>>6&63|128,n[i++]=s&63|128}i>=64&&(this._dataLength+=64,G._md5cycle(this._state,r),i-=64,r[0]=r[16])}return this._bufferLength=i,this}appendAsciiStr(e){const n=this._buffer8,r=this._buffer32;let i=this._bufferLength,s,u=0;for(;;){for(s=Math.min(e.length-u,64-i);s--;)n[i++]=e.charCodeAt(u++);if(i<64)break;this._dataLength+=64,G._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}appendByteArray(e){const n=this._buffer8,r=this._buffer32;let i=this._bufferLength,s,u=0;for(;;){for(s=Math.min(e.length-u,64-i);s--;)n[i++]=e[u++];if(i<64)break;this._dataLength+=64,G._md5cycle(this._state,r),i=0}return this._bufferLength=i,this}getState(){const e=this._state;return{buffer:String.fromCharCode.apply(null,Array.from(this._buffer8)),buflen:this._bufferLength,length:this._dataLength,state:[e[0],e[1],e[2],e[3]]}}setState(e){const n=e.buffer,r=e.state,i=this._state;let s;for(this._dataLength=e.length,this._bufferLength=e.buflen,i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],s=0;s<n.length;s+=1)this._buffer8[s]=n.charCodeAt(s)}end(e=!1){const n=this._bufferLength,r=this._buffer8,i=this._buffer32,s=(n>>2)+1;this._dataLength+=n;const u=this._dataLength*8;if(r[n]=128,r[n+1]=r[n+2]=r[n+3]=0,i.set(G.buffer32Identity.subarray(s),s),n>55&&(G._md5cycle(this._state,i),i.set(G.buffer32Identity)),u<=4294967295)i[14]=u;else{const c=u.toString(16).match(/(.*?)(.{0,8})$/);if(c===null)return e?Js:"";const a=parseInt(c[2],16),h=parseInt(c[1],16)||0;i[14]=a,i[15]=h}return G._md5cycle(this._state,i),e?this._state:G._hex(this._state)}}if(G.hashStr("hello")!=="5d41402abc4b2a76b9719d911017c592")throw new Error("Md5 self test failed.");const xs=36e5,Dr=Symbol.for("constructDateFrom");function Ft(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Dr in t?t[Dr](e):t instanceof Date?new t.constructor(e):new Date(e)}function xe(t,e){return Ft(t,t)}function Xs(t,e,n){const r=xe(t);if(isNaN(e))return Ft(t,NaN);const i=r.getDate(),s=Ft(t,r.getTime());s.setMonth(r.getMonth()+e+1,0);const u=s.getDate();return i>=u?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Cr(t,e,n){return Ft(t,+xe(t)+e)}function eo(t,e,n){return Cr(t,e*xs)}function to(t,e,n){return Cr(t,e*1e3)}function no(t,e,n){return Xs(t,e*12)}function Nr(t){return Math.trunc(+xe(t)/1e3)}function ro(t,e){return+xe(t)<+xe(e)}function p(t,e,n,r="debug",i){if(window.debug){const u=["color: #0288D1",`color:${i||"#009688"}`,"color: default"];n?qn()?console[r](`%c[PlaceOS]%c[${t}] %c${e}`,...u,n):console[r](`[PlaceOS][${t}] ${e}`,n):qn()?console[r](`%c[PlaceOS]%c[${t}] %c${e}`,...u):console[r](`[PlaceOS][${t}] ${e}`)}}function qn(){return!(document.documentMode||/Edge/.test(navigator.userAgent))}function Mn(){const t=window.location?.hash?window.location?.hash.slice(1):window.location?.href.split("#")[1]||"";let e=window.location?.search?window.location?.search.slice(1):window.location?.href.split("?")[1]||"",n={};if(t)if(t.indexOf("?")>=0){const i=t.split("?");n=Le(i[0]),e||(e=i[1])}else n=Le(t);let r={};return e&&(r=Le(e)),{...n,...r}}function Le(t){const e={},n=t.split("&");for(const r of n){const i=r.split("=");i[1]&&(e[decodeURIComponent(i[0])]=decodeURIComponent(i[1]))}return e}const Fr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";function jr(t=40){let e="";for(let n=0;n<t;n++)e+=Fr.charAt(Math.floor(Math.random()*Fr.length));return e}function _e(t){const e=(window.location?.hash||"").replace(new RegExp(`${t}[a-zA-Z0-9_+-.%=]*&?`,"g"),"").replace(/&&/g,"&").replace(/#&/g,"#").replace(/&$/g,"#"),n=(window.location?.search||"").replace(new RegExp(`${t}[a-zA-Z0-9_+-.%=]*&?`,"g"),"").replace(/&&/g,"&").replace(/\?&/g,"#").replace(/&$/g,"#");window.history?.replaceState&&window.history?.replaceState(null,"",`${window.location?.pathname}${e}${n}`)}function Xe(t,e=!1){const n=e?1e3:1024;if(t<n)return t+(e?" iB":" B");const r=Math.floor(Math.log(t)/Math.log(n)),i=(e?"kMGTPE":"KMGTPE").charAt(r-1)+(e?"iB":"B");return(t/Math.pow(n,r)).toFixed(2)+" "+i}function Lr(t){if(t.length===0)throw new Error("Input must not be of zero length");const e=t.split(","),n={};for(const r of e){const i=r.split(";");if(i.length!==2)throw new Error("Section could not be split on ';'");const s=i[0].replace(/<(.*)>/,"$1").trim(),u=i[1].replace(/rel="(.*)"/,"$1").trim();n[u]=s}return n}function Hr(t,e){for(const n in t)t.hasOwnProperty(n)&&e.indexOf(t[n])>=0&&delete t[n];return t}function zr(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function Wr(){return window.location!==window.parent.location}function Br(t=Date.now(),e=60*1e3){return Math.floor(t/e)}class io{abort(){p("Stub","Aborted")}}function U(t){let e="";if(t)for(const n in t)t.hasOwnProperty(n)&&t[n]!==void 0&&t[n]!==null&&(e+=`${e?"&":""}${n}=${encodeURIComponent(t[n])}`);return e}const Te={},et={},me={};function so(){for(const t in Te)Te.hasOwnProperty(t)&&Oe(t);for(const t in et)et.hasOwnProperty(t)&&oo(t);for(const t in me)me.hasOwnProperty(t)&&uo(t)}function ae(t,e,n=300){if(t&&e&&e instanceof Function)Oe(t),Te[t]=setTimeout(()=>{e(),delete Te[t]},n);else throw new Error(t?"Cannot create named timeout without a name":"Cannot create a timeout without a callback")}function Oe(t){Te[t]&&(clearTimeout(Te[t]),delete Te[t])}function oo(t){et[t]&&(clearInterval(et[t]),delete et[t])}function uo(t){me&&me[t]&&(me[t]instanceof Ae?me[t].unsubscribe():me[t](),delete me[t])}const co={id:"mock-authority",name:"localhost:4200",description:"",domain:"localhost:4200",login_url:"/login?continue={{url}}",logout_url:"/logout",session:!0,production:!1,config:{},version:"2.0.0"};let k={},M,B;const $={};let R="",Ee="";const He=new pe(""),jt=new pe("");let Rn="/api/engine/v2";const ye=new pe(!1),ao=ye.asObservable();let Lt=0;function w(){return`${`${k.secure||window.location?.protocol.indexOf("https")>=0?"https:":"http:"}//${k.host||window.location?.host}`}${Un()}`}function Un(){return k.version==="ACA Engine"?"/control/api":Rn}function lo(){return!!k.token_header}function Qr(){return R}function ho(){return k.redirect_uri}function fo(t,e=!0){M.setItem(`${R}_x-api-key`,`${t}`),M.setItem("trusted",`${e}`),Vr("x-api-key",no(new Date,5).valueOf())}function tt(){return Qt("x-api-key",!1)||""}function Vr(t,e=eo(new Date,2).valueOf()){k.ignore_api_key&&t==="x-api-key"||(M.setItem(`${R}_expires_at`,`${e}`),M.setItem(`${R}_access_token`,t))}function J(t=!0){if(k.mock)return"mock-token";if(!M)return"";if(tt()&&!k.ignore_api_key)return"x-api-key";const e=M.getItem(`${R}_expires_at`)||"",n=He.getValue();return ro(+e,new Date)&&(p("Auth","Token expired. Requesting new token..."),Vt(),$.load_authority||(Lt+=1,ae("re-authorise",()=>Nn().catch(r=>p("Auth",`Failed to get token: ${r}`)),200*Math.min(20,Lt))),!t)?"":n||M.getItem(`${R}_access_token`)||""}function Ht(){return jt.getValue()||M.getItem(`${R}_refresh_token`)||""}function zt(){return k.host||window.location?.host}function Zr(){return!!J()}function Gr(){return He.pipe(v(t=>!!Zr()))}function nt(){return B}function po(){return ye.getValue()}function Wt(){return!!k.mock}function Kr(){return!!k.secure}function _o(){return ao}function Bt(){return Qt("trust")==="true"||Qt("trusted")==="true"}function Dn(){return!!tt()&&!k.ignore_api_key||Qt("fixed_device")==="true"}function Qt(t,e=!0){let r=Mn()[t];if(M){const i=`${Qr()}_${t}`;r=r||M.getItem(i)||M.getItem(t)||"",e&&M.setItem(i,`${r}`)}return r}function mo(t){return k=t||k,k.token_header=k.token_header??Wr(),window.AbortController||(window.AbortController=io),M=k.storage==="session"?sessionStorage:localStorage,R=G.hashStr(k.redirect_uri,!1),Fn()}function yo(){k={},B=void 0,He.next(""),jt.next(""),ye.next(!1),R="",Ee="",Rn="/api/engine/v2";for(const t in $)t in $&&delete $[t];so()}function Cn(){return p("Auth","Refreshing authorty."),B=void 0,Fn()}function Vt(){p("Auth","Invalidating tokens."),M.removeItem(`${R}_access_token`),M.removeItem(`${R}_expires_at`),He.getValue()&&He.next("")}function Nn(t,e=B){return $.authorise||($.authorise=new Promise((n,r)=>{if(!e)return delete $.authorise,r("Authority is not loaded");p("Auth","Authorising user...");const i=()=>{if(J(!1))p("Auth","Valid token found."),delete $.authorise,n(J());else{const s=[()=>{p("Auth","Successfully generated token."),n(J()),delete $.authorise},()=>{p("Auth","Failed to generate token."),r("Failed to generate token"),setTimeout(()=>delete $.authorise,200)}];k&&k.auth_type==="password"?(p("Auth","Logging in with credentials."),To(k).then(...s),Lt=0):Ee||Ht()?(p("Auth",`Generating token with ${Ee?"code":"refresh token"}`),Xr().then(...s),Lt=0):e.session?(p("Auth","Users has session. Authorising application..."),vo(t).then(...s)):(p("Auth","No user session"),Jr(e),r("No user session"),setTimeout(()=>delete $.authorise,200))}};So().then(i,i)})),$.authorise}function go(){const t=B?B.logout_url:"/logout";fetch(t,{method:"GET",redirect:"manual",headers:{Authorization:"Bearer "+J()}}).then(e=>{const n=e.headers.get("Location")||t;for(let r=0;r<M.length;r++){const i=M.key(r);i&&i.indexOf(R)>=0&&M.removeItem(i)}window.location?.assign(n)})}function Fn(t=0){return $.load_authority||($.load_authority=new Promise(e=>{if(ye.next(!1),k.mock){B=co,p("Auth","System in mock mode"),ye.next(!0),e();return}p("Auth",`Fixed: ${Dn()} | Trusted: ${Bt()}`),p("Auth","Loading authority...");const n=k.secure||window.location?.protocol.indexOf("https")>=0,r=i=>{p("Auth",`Failed to load authority(${i})`),ye.next(!1),ae("load_authority",()=>{delete $.load_authority,Fn(t).then(s=>e())},300*Math.min(20,++t))};In(`${n?"https:":"http:"}//${zt()}/auth/authority`,{credentials:"same-origin"}).subscribe(async i=>{if(!i.ok)return r(await i.text().catch(u=>u));B=await i.json(),Rn=/[2-9]\.[0-9]+\.[0-9]+/g.test(B.version||"")?"/api/engine/v2":"/control/api",p("Auth","Loaded authority.",[],"group"),B&&(p("Auth",`Name: ${B.name}`),p("Auth",`Version: ${B.version}`),p("Auth",`Domain: ${B.domain}`),p("Auth",`Session: ${B.session}`),p("Auth",`Production: ${B.production}`),p("Auth",`Config Keys: ${Object.keys(B.config||{}).length}`)),p("Auth","",[],"groupEnd");const s=()=>{ye.next(!0),p("Auth","Application set online."),e()};delete $.load_authority,Nn("").then(s,s)},r)})),$.load_authority}async function vo(t){const e=$o(t);if(k.use_iframe)return bo(e);window.location?.assign(e)}function bo(t){return $.iframe_auth||($.iframe_auth=new Promise((e,n)=>{p("Auth","Authorizing in an iFrame...");const r=document.createElement("iframe");r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.height="1px",r.style.width="1px",r.style.zIndex="-1",r.id="place-authorize",r.src=`${t}`;const i=s=>{if(s.origin===window.location?.origin&&s.data.type==="place-os"){const u=s.data;if(p("Auth","Received credentials from iFrame..."),document.body.removeChild(r),Oe("iframe_auth"),window.removeEventListener("message",i),delete $.iframe_auth,u.token)return e(),jn({access_token:u.token,...u});Ee=u.code||"",Xr().then(c=>e(c),c=>n(c))}};ae("iframe_auth",()=>{p("Auth","Unable to resolve iFrame after 15 seconds..."),n()},15*1e3),window.addEventListener("message",i),r.onerror=s=>{p("Auth","iFrame error.",s),delete $.iframe_auth,n()},document.body.appendChild(r)})),$.iframe_auth}let Yr=!1;function Jr(t){if(k.handle_login!==!1&&!Yr){p("Auth","Redirecting to login page...");const e=t.login_url?.replace("{{url}}",encodeURIComponent(window.location?.href));throw setTimeout(()=>window.location?.assign(e),300),Yr=!0,new Error("Redirecting to login page...")}else p("Auth","Login being handled locally.");delete $.authorise}function So(){return $.check_token||($.check_token=new Promise(async(t,e)=>{J()?(p("Auth","Valid token found."),t(J())):(p("Auth","No token. Checking URL for auth credentials..."),await ko()?t(!0):e()),delete $.check_token})),$.check_token}function ko(){return $.check_params||($.check_params=new Promise(t=>{p("Auth","Checking for auth parameters...");let e=Mn();if((!e||Object.keys(e).length<=0)&&sessionStorage&&(e=JSON.parse(sessionStorage.getItem("ENGINE.auth.params")||"{}")),e&&(e.code||e.access_token||e.refresh_token)){e.code&&(Ee=e.code,_e("code")),e.refresh_token&&(M.setItem(`${R}_refresh_token`,e.refresh_token),_e("refresh_token"));const n=M.getItem(`${R}_nonce`)||"",r=(e.state||"").split(";");_e("state"),_e("token_type");const i=r[0];n===i?(jn(e),t(!!e.access_token)):t(!1)}else t(!1);ae("check_params_promise",()=>delete $.check_params,50)})),$.check_params}function $o(t){const e=Oo();t=t?`${e};${t}`:e;const n=k?(k.auth_uri||"").indexOf("?")>=0:!1,r=(k?k.auth_uri:null)||"/auth/oauth/authorize",i=Bt()||k.auth_type==="auth_code"?"code":"token";let s=`${r}${n?"&":"?"}response_type=${encodeURIComponent(i)}&client_id=${encodeURIComponent(R)}&state=${encodeURIComponent(t)}&redirect_uri=${encodeURIComponent(k.redirect_uri)}&scope=${encodeURIComponent(k.scope)}`;if(k.auth_type==="auth_code"){const{challenge:u,verify:c}=Ao();sessionStorage.setItem(`${R}_challenge`,u),s+="&code_challenge_method=S256",s+=`&code_challenge=${c}`}return s}const xr="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split("");function Ao(t=43){const e=new Array(t).fill(0).map(()=>xr[Math.floor(Math.random()*xr.length)]).join(""),n=Vs(Zs(e)),r=Rr(Ys.hash(n)).split("=")[0].replace(/\//g,"_").replace(/\+/g,"-");return{challenge:e,verify:r}}function wo(){let e=(k.token_uri||"/auth/token")+`?client_id=${encodeURIComponent(R)}`,n="";if(e+=`&redirect_uri=${encodeURIComponent(k.redirect_uri)}`,Ht()){e+=`&refresh_token=${encodeURIComponent(Ht())}`,e+="&grant_type=refresh_token";const r=e.split("?");e=r[0],n=r[1]}else{e+=`&code=${encodeURIComponent(Ee)}`,e+="&grant_type=authorization_code";const r=sessionStorage.getItem(`${R}_challenge`);r&&(e+=`&code_verifier=${r}`,sessionStorage.removeItem(`${R}_challenge`)),Ee=""}return[e,n]}function Po(t){const e=t.token_uri||"/auth/token",n=U({grant_type:"password",client_id:R,client_secret:t.client_secret,redirect_uri:t.redirect_uri,authority:B?.id,scope:t.scope,username:t.username,password:t.password});return`${e}?${n}`}function Xr(){return ei(...wo())}function To(t){return ei(Po(t))}function ei(t,e=""){return $.generate_tokens||($.generate_tokens=new Promise((n,r)=>{p("Auth","Generating new token...");const i=s=>{p("Auth","Error generating new tokens.",s),M.removeItem(`${R}_refresh_token`),jt.next(""),r(),delete $.generate_tokens};In(t,{method:"POST",body:e,headers:{"Content-Type":"application/x-www-form-urlencoded"}}).subscribe(async s=>{if(!s.ok)return i(s);const u=await s.json();jn(u),n(),delete $.generate_tokens},i)})),$.generate_tokens}function jn(t){const e=to(new Date,Math.max(60,parseInt(t.expires_in,10)-300));p("Auth","Tokens generated storing..."),Bt()&&(t.access_token&&(M.setItem(`${R}_access_token`,t.access_token),_e("access_token")),t.refresh_token&&(M.setItem(`${R}_refresh_token`,t.refresh_token),_e("refresh_token"))),t.expires_in&&(M.setItem(`${R}_expires_at`,`${e.valueOf()}`),_e("expires_in")),ye.next(!0),He.next(t.access_token||""),jt.next(t.refresh_token||"")}function Oo(){const t=jr();return M.setItem(`${R}_nonce`,t),t}const Zt={};let ti=(t,e)=>{const n=new Error(`Mock endpoint not found: ${t} ${e}`);return n.status=404,p("HTTP(M)",`404 ${t}:`,e),Tr(n)};function Eo(t){ti=t}function Io(t,e=Zt){ni(t.method,t.path,e);const n=`${t.method}|${t.path}`,r=t.path.replace(/(http|https):\/\/[a-zA-Z0-9.-]*:?([0-9]*)?/g,"").replace(/^\//,"").split("/"),i={...t,path_parts:r,path_structure:r.map(s=>s[0]===":"?s.replace(":",""):"")};e[n]=i,p("HTTP(M)",`+ ${t.method} ${t.path}`)}function ni(t,e,n=Zt){const r=`${t}|${e}`;n[r]&&(delete n[r],p("HTTP(M)",`- ${t} ${e}`))}function qo(t,e,n,r=Zt){const i=Mo(t,e,r);if(i){const s=Ro(e,i,n);return Uo(i,s)}return ti(t,e)}function Mo(t,e,n=Zt){const i=e.replace(/(http|https):\/\/[a-zA-Z0-9.-]*:?([0-9]*)?/g,"").replace(/^\//,"").split("?")[0].split("/"),s=Object.keys(n).reduce((u,c)=>(c.indexOf(`${t}|`)===0&&u.push(n[c]),u),[]);for(const u of s)if(u.path_structure.length===i.length){let c=!0;for(let a=0;a<u.path_structure.length;a++)if(!u.path_structure[a]&&u.path_parts[a]!==i[a]){c=!1;break}if(c)return u}return null}function Ro(t,e,n){const r=t.replace(/(http|https):\/\/[a-zA-Z0-9.-]*:?([0-9]*)?/g,"").split("?"),i=r[0].replace(/^\//,""),s=r[1]||"",u=Le(s),c=i.split("/"),a={};for(let m=0;m<e.path_structure.length;m++){const g=e.path_structure[m];g&&(a[g]=c[m])}const h={url:t,path:e.path,method:e.method,metadata:e.metadata,route_params:a,query_params:u,body:n};return p("HTTP(M)",`MATCHED ${h.method}:`,h),h}function Uo(t,e){let n;try{n=t.callback?t.callback(e):t.metadata}catch(u){throw p("HTTP(M)",`ERROR ${e.method}:`,[e.url,u]),u}const r=t.delay_variance||100,i=t.delay||300,s=Math.floor(Math.random()*r-r/2)+i;return p("HTTP(M)",`RESP ${e.method}:`,[e.url,n]),Cs([n]).pipe(zs(Math.max(200,s)))}const ri={};function ii(t,e=ri){return e[t]||{}}function F(t,e,n=rt){return e||(e={response_type:"json"}),n("GET",t,{response_type:"json",...e})}function K(t,e,n,r=rt){return n||(n={response_type:"json"}),r("POST",t,{body:e,response_type:"json",...n})}function Ie(t,e,n,r=rt){return n||(n={response_type:"json"}),r("PUT",t,{body:e,response_type:"json",...n})}function ze(t,e,n,r=rt){return n||(n={response_type:"json"}),r("PATCH",t,{body:e,response_type:"json",...n})}function ge(t,e,n=rt){return e||(e={response_type:"void"}),n("DELETE",t,{response_type:"void",...e})}async function Do(t,e,n=ri){if(t.headers){const r={};t.headers.forEach?t.headers.forEach((i,s)=>r[s.toLowerCase()]=i):Object.keys(t.headers).forEach(i=>r[i.toLowerCase()]=t.headers[i]),n[t.url||""]=r}switch(e){case"json":return await t.json().catch(()=>({}));case"text":return await t.text();case"void":return;default:return await t.json().catch(()=>({}))}}const si=()=>(Vt(),Cn().then(()=>Promise.resolve(),()=>new Promise(t=>{setTimeout(()=>{si().then(()=>t())},1e3)})));function rt(t,e,n,r=Wt,i=qo,s=Do){if(r()){const u=i(t,e,n?.body);if(u)return u}return n.headers=n.headers||{},!n.headers["Content-Type"]&&!n.headers["content-type"]&&(n.headers["Content-Type"]="application/json"),Gr().pipe(js(u=>u),Ir(1),qr(u=>{J()==="x-api-key"?n.headers["X-API-Key"]=tt():n.headers.Authorization=`Bearer ${J()}`;const c={...n,method:t,credentials:"same-origin"};return["POST","PUT","PATCH"].includes(t)&&n.body!==void 0&&(c.body=typeof n.body=="string"?n.body:JSON.stringify(n.body)),In(e,c)}),qr(u=>u.ok?s(u,n.response_type):Tr(u)),Qs({count:4,delay:(u,c)=>new j(a=>{if(u.status===511){Jr(nt()),a.error(u);return}if(u.status!==401){a.error(u||{});return}p("HTTP","Auth error",u);const h=Math.pow(2,c-1)*1e3;si().then(()=>{a.next(h),a.complete()}).catch(()=>{a.error(u)})})}))}class L{id;name;created_at;updated_at;version;constructor(e={}){this.id=e.id||"",this.name=e.name||"",this.created_at=e.created_at||0,this.updated_at=e.updated_at||0,this.version=e.version||0}toJSON(){const e={...this};return e.version=this.version,delete e.created_at,Hr(e,[void 0,null,""])}}class oi extends L{alert_dashboard_id;alert_dashboard_details;authority_id;description;enabled;conditions;severity;alert_type;debounce_period;constructor(e){super(e),this.authority_id=e.authority_id||"",this.description=e.description||"",this.enabled=e.enabled||!1,this.conditions=e.conditions||{time_dependents:[],comparisons:[]},this.severity=e.severity||"low",this.alert_type=e.alert_type||"threshold",this.debounce_period=e.debounce_period||0,this.alert_dashboard_id=e.alert_dashboard_id||"",this.alert_dashboard_details=e.alert_dashboard_details||void 0}}class ui extends L{authority_id;description;enabled;constructor(e){super(e),this.authority_id=e.authority_id||"",this.description=e.description||"",this.enabled=e.enabled||!1}}const We="alert_dashboards";function Gt(t){return new ui(t)}function Co(t={}){return P({query_params:t,fn:Gt,path:We})}function No(t){return b({id:t,query_params:{},fn:Gt,path:We})}function Fo(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:Gt,path:We})}function jo(t){return I({form_data:t,query_params:{},fn:Gt,path:We})}function Lo(t){return E({id:t,query_params:{},path:We})}function Ho(t){return P({query_params:{},fn:st,path:`${We}/${t}/alerts`})}const it="alerts";function st(t){return new oi(t)}function zo(t={}){return P({query_params:t,fn:st,path:it})}function Wo(t,e={}){return b({id:t,query_params:e,fn:st,path:it})}function Bo(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:st,path:it})}function Qo(t){return I({form_data:t,query_params:{},fn:st,path:it})}function Vo(t){return E({id:t,query_params:{},path:it})}class ci extends L{uid;secret;owner_id;scopes;redirect_uri;skip_authorization;preserve_client_id;constructor(e={}){super(e),this.uid=e.uid||"",this.secret=e.secret||"",this.owner_id=e.owner_id||"",this.scopes=e.scopes||"",this.redirect_uri=e.redirect_uri||"",this.skip_authorization=e.skip_authorization||!1,this.preserve_client_id=e.preserve_client_id||!1}}function Zo(t){return ai[t]||0}function Go(t){return li[t]||0}let ai={},li={},hi="";const Kt=t=>t;function P(t){const{query_params:e,fn:n,path:r,endpoint:i}=t,s=U(e),u=`${i||w()}${r?"/"+r:""}${s?"?"+s:""}`;return F(u).pipe(v(c=>{const a=Ko(u,s,r);return{total:a.total||0,next:a.next?()=>P({query_params:a.next,fn:n,endpoint:i,path:r}):null,data:c&&c instanceof Array?c.map(h=>(n||Kt)(h)):c&&!(c instanceof Array)&&c.results?c.results.map(h=>h):[]}}))}function b(t){const{query_params:e,id:n,path:r,fn:i,options:s}=t,u=U(e),c=`${w()}/${r}/${n}${u?"?"+u:""}`;return F(c,s).pipe(v(a=>(i||Kt)(a)))}function I(t){const{query_params:e,form_data:n,path:r,fn:i}=t,s=U(e),u=`${w()}/${r}${s?"?"+s:""}`;return K(u,n).pipe(v(a=>(i||Kt)(a)))}function y(t){const{id:e,task_name:n,form_data:r,method:i,path:s,callback:u}=t,c=U(r),a=`${w()}/${s}/${e}/${n}`;return(i==="post"||i==="put"||!i?(i==="put"?Ie:K)(a,r):(i==="del"?ge:F)(`${a}${c?"?"+c:""}`,{response_type:"json"})).pipe(v(m=>(u||(g=>g))(m)))}function q(t){const{id:e,query_params:n,form_data:r,method:i,path:s,fn:u}=t,c=U({...n,version:r.version||0}),a=`${w()}/${s}/${e}${c?"?"+c:""}`;return(i==="put"?Ie:ze)(a,r).pipe(v(h=>(u||Kt)(h)))}function E(t){const{id:e,query_params:n,path:r}=t,i=U(n),s=`${w()}/${r}/${e}${i?"?"+i:""}`;return ge(s)}function Ko(t,e,n){const r=ii(t[0]==="/"?`${location.origin}${t}`:t),i={total:0,next:null};if(r&&r["x-total-count"]){const s=+(r["x-total-count"]||0);(e.length<2||e.length<12&&e.indexOf("offset=")>=0)&&(ai[n]=s),li[n]=s,i.total=s}return r&&r.link&&(hi=Lr(r.link||"").next,i.next=Le(hi.split("?")[1])),i}function Ah(t){return t}const ot="oauth_apps";function Yt(t){return new ci(t)}function Yo(t={}){return P({query_params:t,fn:Yt,path:ot})}function Jo(t){return b({id:t,query_params:{},fn:Yt,path:ot})}function xo(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:Yt,path:ot})}function Xo(t){return I({form_data:t,query_params:{},fn:Yt,path:ot})}function eu(t){return E({id:t,query_params:{},path:ot})}var fi=(t=>(t[t.Certificate=0]="Certificate",t[t.NoAuth=1]="NoAuth",t[t.UserPassword=2]="UserPassword",t))(fi||{});class di extends L{id;name;auth_type;description;host;port;tls;username;password;certificate;secret;filters;constructor(e={}){super(),this.id=e.id||"",this.name=e.name||"",this.auth_type=e.auth_type||2,this.description=e.description||"",this.host=e.host||"",this.port=e.port||1883,this.tls=e.tls||!1,this.username=e.username||"",this.password=e.password||"",this.certificate=e.certificate||"",this.secret=e.secret||"",this.filters=e.filters||[]}}const ut="brokers";function Jt(t){return new di(t)}function tu(t={}){return P({query_params:t,fn:Jt,path:ut})}function nu(t,e={}){return b({id:t,query_params:e,fn:Jt,path:ut})}function ru(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:Jt,path:ut})}function iu(t){return I({form_data:t,query_params:{},fn:Jt,path:ut})}function su(t,e={}){return E({id:t,query_params:e,path:ut})}class pi{id;compiled_drivers;available_repositories;running_drivers;module_instances;unavailable_repositories;unavailable_drivers;hostname;cpu_count;core_cpu;total_cpu;memory_total;memory_usage;core_memory;memory_percentage;used_memory;total_memory;edge_nodes;run_counts;constructor(e={}){this.id=e.id||e.core_id||"",this.compiled_drivers=e.compiled_drivers||[],this.available_repositories=e.available_repositories||e.status?.available_repositories||[],this.running_drivers=e.running_drivers||e.status?.running_drivers||0,this.module_instances=e.module_instances||e.status?.module_instances||0,this.unavailable_repositories=e.unavailable_repositories||e.status?.unavailable_repositories||[],this.unavailable_drivers=e.unavailable_drivers||e.status?.unavailable_drivers||[],this.hostname=e.hostname||e.load?.local.hostname||"",this.cpu_count=e.cpu_count||e.load?.local.cpu_count||0,this.core_cpu=e.core_cpu||e.load?.local.core_cpu||0,this.total_cpu=e.total_cpu||e.load?.local.total_cpu||0,this.memory_total=e.memory_total||e.load?.local.memory_total||0,this.memory_usage=e.memory_usage||e.load?.local.memory_usage||0,this.core_memory=e.core_memory||e.load?.local.core_memory||0,this.run_counts=e.run_counts||e.status?.run_counts?.local||{modules:0,drivers:0},this.memory_percentage=+(this.memory_usage/this.memory_total*100).toFixed(4),this.used_memory=Xe(this.memory_usage*1024),this.total_memory=Xe(this.memory_total*1024);const n=e.load?.edge||{};this.edge_nodes=e.edge_nodes||Object.keys(n).map(r=>({id:r,...n[r],run_count:e.status?.run_count?.edge[r]||{}}))||[]}}class _i{cluster_id;id;modules;running;module_instances;last_exit_code;launch_count;launch_time;cpu_usage;memory_total;memory_usage;used_memory;total_memory;constructor(e,n={}){this.cluster_id=e,this.id=n.id||n.driver||"",this.modules=n.modules||[],this.running=n.running||!1,this.module_instances=n.module_instances||n.edge?.status?.module_instances||n.local?.status?.module_instances||0,this.last_exit_code=n.last_exit_code||n.edge?.status?.last_exit_code||n.local?.status?.last_exit_code||0,this.launch_count=n.launch_count||n.edge?.status?.launch_count||n.local?.status?.launch_count||0,this.launch_time=n.launch_time||n.edge?.status?.launch_time||n.local?.status?.launch_time||0,this.cpu_usage=n.cpu_usage||n.percentage_cpu||n.edge?.status?.percentage_cpu||n.local?.status?.percentage_cpu||0,this.memory_total=n.memory_total||n.edge?.status?.memory_total||n.local?.status?.memory_total||0,this.memory_usage=n.memory_usage||n.edge?.status?.memory_usage||n.local?.status?.memory_usage||0,this.used_memory=Xe(this.memory_usage*1024),this.total_memory=Xe(this.memory_total*1024)}}const Be="cluster";function mi(t){return new pi(t)}function ou(t={}){return P({query_params:t,fn:mi,path:Be})}function uu(t,e={}){return b({id:t,query_params:e,fn:mi,path:Be})}function cu(t,e={}){return b({id:t,query_params:e,fn:n=>n.map(r=>new _i(t,r)),path:Be})}function au(t,e){return E({id:t,query_params:e,path:Be})}function lu(){const t=`${w()}${Be}/rebalance`;return K(t,{}).pipe(v(()=>{}))}function hu(){const t=`${w()}${Be}/versions`;return F(t).pipe(v(e=>e))}class yi extends L{domain;login_url;logout_url;description;config;internals;email_domains;constructor(e={}){super(e),this.description=e.description||"",this.domain=e.domain||"",this.login_url=e.login_url||"",this.logout_url=e.logout_url||"",this.config=e.config||{},this.internals=e.internals||{},this.email_domains=e.email_domains||[]}}const Qe="domains";function ct(t){return new yi(t)}function fu(t={}){return P({query_params:t,fn:ct,path:Qe})}function du(t){return b({id:t,query_params:{},fn:ct,path:Qe})}function pu(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:ct,path:Qe})}function _u(t){return I({form_data:t,query_params:{},fn:ct,path:Qe})}function mu(t){return E({id:t,query_params:{},path:Qe})}function yu(t){const e=`${w()}${Qe}/lookup/${encodeURIComponent(t)}`;return F(e).pipe(v(n=>ct(n)))}var qe=(t=>(t[t.None=0]="None",t[t.Support=1]="Support",t[t.Admin=2]="Admin",t[t.NeverDisplay=3]="NeverDisplay",t))(qe||{});class ve extends L{parent_id;updated_at;encryption_level;settings_string;keys;modified_by_id;get value(){return this.settings_string}constructor(e={}){super(e),this.parent_id=e.parent_id||"",this.updated_at=e.updated_at||Math.floor(new Date().getTime()/1e3),this.settings_string=e.settings_string||"",this.encryption_level=e.encryption_level||qe.None,this.keys=e.keys||[],this.modified_by_id=e.modified_by_id||""}}var at=(t=>(t[t.SSH=0]="SSH",t[t.Device=1]="Device",t[t.Service=2]="Service",t[t.Websocket=3]="Websocket",t[t.Logic=99]="Logic",t))(at||{});class Ln extends L{class_name;description;module_name;role;default_uri;default_port;repository_id;file_name;commit;ignore_connected;update_available;update_info;settings;constructor(e={}){super(e),this.description=e.description||"",this.module_name=e.module_name||"",this.role=e.role??at.Logic,this.default_uri=e.default_uri||"",this.default_port=e.default_port||1,this.ignore_connected=e.ignore_connected||!1,this.class_name=e.class_name||"",this.repository_id=e.repository_id||"",this.file_name=e.file_name||"",this.commit=e.commit||"",this.update_available=e.update_available||!1,this.update_info=e.update_info,this.settings=e.settings||[null,null,null,null],typeof this.settings!="object"&&(this.settings=[null,null,null,null]);for(const n in qe)!isNaN(Number(n))&&!this.settings[n]&&(this.settings[n]=new ve({parent_id:this.id,encryption_level:+n}))}}const le="drivers";function xt(t){return new Ln(t)}function gu(t={}){return P({query_params:t,fn:xt,path:le})}function vu(t,e={}){return b({id:t,query_params:e,fn:xt,path:le})}function bu(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:xt,path:le})}function Su(t){return I({form_data:t,query_params:{},fn:xt,path:le})}function ku(t){return E({id:t,query_params:{},path:le})}function $u(t){return y({id:t,task_name:"recompile",path:le})}function Au(t){return y({id:t,task_name:"reload",path:le})}function wu(t){return y({id:t,task_name:"compiled",method:"get",path:le})}function Pu(t){return y({id:t,task_name:"readme",method:"get",path:le})}class gi extends L{description;secret;x_api_key;online;last_seen;constructor(e={}){super(e),this.description=e.description||"",this.secret=e.secret||"",this.x_api_key=e.x_api_key||"",this.last_seen=(e.last_seen||0)*1e3||Date.now(),this.online=e.online||!1}toJSON(){const e=super.toJSON();return delete e.last_seen,e}}const Me="edges";function Xt(t){return new gi(t)}function Tu(t={}){return P({query_params:t,fn:Xt,path:Me})}function Ou(t){return b({id:t,query_params:{},fn:Xt,path:Me})}function Eu(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:Xt,path:Me})}function Iu(t){return I({form_data:t,query_params:{},fn:Xt,path:Me})}function qu(t){return E({id:t,query_params:{},path:Me})}function Mu(t){return y({id:t,task_name:"token",form_data:{},method:"get",path:Me})}function Ru(){const t=w(),e=t.startsWith("https")?"wss:":"ws:",n=t.startsWith("https")?"https:":"http:";return t.replace(n,e)+`${Me}/control`}class vi extends L{type="ldap";authority_id;host;port;auth_method;uid;base;bind_dn;password;filter;constructor(e={}){super(e),this.authority_id=e.authority_id||"",this.host=e.host||"",this.port=e.port||636,this.auth_method=e.auth_method||"ssl",this.uid=e.uid||"",this.base=e.base||"",this.bind_dn=e.bind_dn||"",this.password=e.password||"",this.filter=e.filter||""}}const lt="ldap_auths";function en(t){return new vi(t)}function Uu(t={}){return P({query_params:t,fn:en,path:lt})}function Du(t){return b({id:t,query_params:{},fn:en,path:lt})}function Cu(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:en,path:lt})}function Nu(t){return I({form_data:t,query_params:{},fn:en,path:lt})}function Fu(t){return E({id:t,query_params:{},path:lt})}class Hn{id;name;description;details;editors;schema;updated_at;modified_by_id;version;constructor(e={}){this.id=e.id||e.parent_id||"",this.name=e.name||"",this.description=e.description||"";try{this.details=(typeof e.details=="string"?JSON.parse(e.details):e.details)||{}}catch{this.details=e.details||{}}this.editors=e.editors||[],this.schema=e.schema||"",this.updated_at=(e.updated_at||0)*1e3||Date.now(),this.modified_by_id=e.modified_by_id||"",this.version=e.version||0}}class he extends L{system_name;activated_count;description;debounce_period;important;enabled;enable_webhook;exec_enabled;webhook_secret;supported_methods;control_system_id;zone_id;trigger_id;playlists;get system_id(){return this.control_system_id}get actions(){const e=this._actions,n=(e.functions||[]).map(i=>({...i,args:{...i.args}})),r=(e.mailers||[]).map(i=>({...i,emails:[...i.emails]}));return{functions:n,mailers:r}}get conditions(){const e=this._conditions,n=(e.comparisons||[]).map(i=>({...i,left:typeof i.left=="object"?{...i.left}:i.left,right:typeof i.right=="object"?{...i.right}:i.right})),r=(e.time_dependents||[]).map(i=>({...i}));return{comparisons:n,time_dependents:r}}_actions;_conditions;constructor(e={}){super(e),this.description=e.description||"",this._actions=e.actions||{functions:[],mailers:[]},this._conditions=e.conditions||{comparisons:[],time_dependents:[]},this.debounce_period=e.debounce_period||0,this.important=e.important||!1,this.enabled=e.enabled||!1,this.webhook_secret=e.webhook_secret||"",this.control_system_id=e.system_id||e.control_system_id||"",this.zone_id=e.zone_id||"",this.system_name=e.system_name||(e.control_system?e.control_system.name:""),this.enable_webhook=e.enable_webhook||!1,this.exec_enabled=e.exec_enabled||!1,this.supported_methods=e.supported_methods||["POST"],this.activated_count=e.activated_count||e.trigger_count||0,this.playlists=e.playlists||[],this.trigger_id=e.trigger_id||""}}class tn extends L{settings=[null,null,null,null];description;parent_id;triggers;tags;location;display_name;code;type;count;capacity;map_id;images;timezone;playlists;trigger_list=[];constructor(e={}){super(e),this.description=e.description||"",this.tags=e.tags||[],this.triggers=e.triggers||[],this.settings=e.settings||[null,null,null,null],this.parent_id=e.parent_id||"",this.location=e.location||"",this.display_name=e.display_name||"",this.code=e.code||"",this.type=e.type||"",this.count=e.count||0,this.capacity=e.capacity||0,this.map_id=e.map_id||"",this.timezone=e.timezone||"",this.images=e.images||[],this.playlists=e.playlists||[],typeof this.settings!="object"&&(this.settings=[null,null,null,null]);for(const n in qe)!isNaN(Number(n))&&!this.settings[n]&&(this.settings[n]=new ve({parent_id:this.id,encryption_level:+n}));e.trigger_data&&e.trigger_data instanceof Array&&(this.trigger_list=e.trigger_data.map(n=>new he(n)))}}class bi{zone;metadata;keys;constructor(e={}){this.zone=new tn(e.zone),this.keys=e.keys||[],this.metadata={};const n=e.metadata||{};for(const r of this.keys)this.metadata[r]=new Hn(n[r])}}const Re="metadata";function ht(t){return new Hn(t)}function ju(t,e={}){return b({id:t,query_params:e,fn:n=>Object.keys(n).map(r=>ht(n[r])),path:Re})}function Lu(t){const e=[...t],n=[];for(;e.length;){const r=e.pop();Array.isArray(r)?e.push(...r):n.push(r)}return n.reverse()}function Hu(t,e={}){return y({id:t,task_name:"history",form_data:e,method:"get",callback:n=>Lu(Object.keys(n).map(r=>n[r].map(i=>ht(i)))),path:Re})}function zu(t,e){return b({id:t,query_params:{name:e},fn:n=>ht(n[e]),path:Re})}function Wu(t,e,n="put"){return q({id:t,form_data:e,query_params:{},method:n,fn:ht,path:Re})}function Bu(t){return I({form_data:t,query_params:{},fn:ht,path:Re})}function Qu(t,e){return E({id:t,query_params:e,path:Re})}function Vu(t,e){return y({id:t,task_name:"children",form_data:e,method:"get",callback:n=>n.map(r=>new bi({...r,keys:Object.keys(r.metadata)})),path:Re})}class zn extends L{settings=[null,null,null,null];display_name;description;email;code;capacity;features;bookable;public;installed_ui_devices;support_url;timetable_url;camera_snapshot_url;camera_url;room_booking_url;map_id;modules;images;zones;timezone;module_list=[];signage;playlists;approval;orientation;constructor(e={}){super(e),this.display_name=e.display_name||"",this.description=e.description||"",this.email=e.email||"",this.code=e.code||"",this.capacity=e.capacity||0,this.features=e.features||[],this.bookable=e.bookable||!1,this.public=e.public??!1,this.installed_ui_devices=e.installed_ui_devices||0,this.support_url=e.support_url||"",this.camera_snapshot_url=e.camera_snapshot_url||"",this.camera_url=e.camera_url||"",this.timetable_url=e.timetable_url||"",this.room_booking_url=e.room_booking_url||"",this.map_id=e.map_id||"",this.modules=e.modules||[],this.images=e.images||[],this.zones=e.zones||[],this.settings=e.settings||[null,null,null,null],this.timezone=e.timezone||"",this.signage=e.signage||!1,this.playlists=e.playlists||[],this.orientation=e.orientation||"unspecified",this.approval=e.approval||!1,typeof this.settings!="object"&&(this.settings=[null,null,null,null]);for(const n in qe)!isNaN(Number(n))&&!this.settings[n]&&(this.settings[n]=new ve({parent_id:this.id,encryption_level:+n}));e.module_data&&e.module_data instanceof Array&&(this.module_list=e.module_data.map(n=>new Wn(n)))}}class Wn extends L{connected;running;updated_at;edge_id;driver_id;driver;control_system_id;system;ip;tls;udp;port;makebreak;uri;custom_name;role;notes;ignore_connected;settings=[null,null,null,null];has_runtime_error;error_timestamp;get system_id(){return this.control_system_id}constructor(e={}){super(e),this.driver_id=e.driver_id||e.dependency_id||"",this.control_system_id=e.control_system_id||"",this.edge_id=e.edge_id||"",this.ip=e.ip||"",this.tls=e.tls||!1,this.udp=e.udp||!1,this.port=e.port||1,this.makebreak=e.makebreak||!1,this.uri=e.uri||"",this.custom_name=e.custom_name||"",this.role=e.role??at.Logic,this.notes=e.notes||"",this.ignore_connected=e.ignore_connected||!1,this.connected=e.connected,this.running=e.running||!1,this.updated_at=e.updated_at||0,this.system=new zn(e.control_system||e.system),this.has_runtime_error=e.has_runtime_error||!1,this.error_timestamp=e.error_timestamp||0,this.driver=new Ln(e.dependency||e.driver),this.settings=e.settings||[null,null,null,null],typeof this.settings!="object"&&(this.settings=[null,null,null,null]);for(const n in qe)!isNaN(Number(n))&&!this.settings[n]&&(this.settings[n]=new ve({parent_id:this.id,encryption_level:+n}))}toJSON(e=!1){const n=super.toJSON();return(n.role!==at.Logic&&!e||!n.control_system_id)&&delete n.control_system_id,delete n.driver,delete n.system,delete n.error_timestamp,delete n.has_runtime_error,n}}const x="modules";function nn(t){return new Wn(t)}function Zu(t={}){return P({query_params:t,fn:nn,path:x})}function Gu(t,e={}){return b({id:t,query_params:e,fn:nn,path:x})}function Ku(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:nn,path:x})}function Yu(t){return I({form_data:t,query_params:{},fn:nn,path:x})}function Ju(t){return E({id:t,query_params:{},path:x})}function xu(t){return y({id:t,task_name:"start",path:x})}function Xu(t){return y({id:t,task_name:"stop",path:x})}function ec(t){return y({id:t,task_name:"state",method:"get",path:x})}function tc(t,e){return y({id:t,task_name:`state/${e}`,method:"get",path:x})}function nc(t){return y({id:t,task_name:"load",method:"post",path:x})}function rc(t){return y({id:t,task_name:"settings",method:"get",callback:e=>e.map(n=>new ve(n)),path:x})}function ic(t){return y({id:t,task_name:"error",method:"get",path:x})}function sc(t,e,n=[]){return y({id:t,task_name:`exec/${encodeURIComponent(e)}`,form_data:n,path:x})}class Si extends L{type="oauth";authority_id;client_id;client_secret;info_mappings;site;authorize_url;token_method;token_url;auth_scheme;scope;raw_info_url;authorize_params;ensure_matching;constructor(e={}){super(e),this.authority_id=e.authority_id||"",this.client_id=e.client_id||"",this.client_secret=e.client_secret||"",this.info_mappings=e.info_mappings||{},this.authorize_params=e.authorize_params||{},this.ensure_matching=e.ensure_matching||{},this.site=e.site||"",this.authorize_url=e.authorize_url||"oauth/authorize",this.token_method=e.token_method||"post",this.token_url=e.token_url||"oauth/token",this.auth_scheme=e.auth_scheme||"request_body",this.scope=e.scope||"",this.raw_info_url=e.raw_info_url||"",this.authorize_params=e.authorize_params||{},this.ensure_matching=e.ensure_matching||{}}}const ft="oauth_auths";function rn(t){return new Si(t)}function oc(t={}){return P({query_params:t,fn:rn,path:ft})}function uc(t){return b({id:t,query_params:{},fn:rn,path:ft})}function cc(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:rn,path:ft})}function ac(t){return I({form_data:t,query_params:{},fn:rn,path:ft})}function lc(t){return E({id:t,query_params:{},path:ft})}var Bn=(t=>(t.Driver="driver",t.Interface="interface",t))(Bn||{});class ki extends L{folder_name;description;uri;branch;commit_hash;repo_type;username;password;root_path;get type(){return this.repo_type}constructor(e={}){super(e),this.folder_name=e.folder_name||"",this.description=e.description||"",this.uri=e.uri||"",this.branch=e.branch||"",this.commit_hash=e.commit_hash||"",this.repo_type=e.repo_type||Bn.Driver,this.username=e.username||"",this.password=e.password||"",this.root_path=e.root_path||""}}const V="repositories";function sn(t){return new ki(t)}function hc(t={}){return P({query_params:t,fn:sn,path:V})}function fc(t){return b({id:t,query_params:{},fn:sn,path:V})}function dc(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:sn,path:V})}function pc(t){return I({form_data:t,query_params:{},fn:sn,path:V})}function _c(t){return E({id:t,query_params:{},path:V})}function mc(){return b({id:"interfaces",query_params:{},path:V})}function yc(t){return b({id:"remote_default_branch",query_params:t,path:V})}function gc(t){return b({id:"remote_branches",query_params:t,path:V})}function vc(t){return b({id:"remote_commits",query_params:t,path:V})}function bc(t,e){return y({id:t,task_name:"drivers",form_data:e,method:"get",path:V})}function Sc(t,e){return y({id:t,task_name:"commits",form_data:e,method:"get",path:V})}function kc(t){return y({id:t,task_name:"branches",method:"get",path:V})}function $c(t){return y({id:t,task_name:"default_branch",method:"get",path:V})}function Ac(t,e){return y({id:t,task_name:"details",form_data:e,method:"get",path:V})}function wc(t,e){return y({id:t,task_name:"pull",form_data:e,method:"post",path:V})}function Pc(t,e){return y({id:t,task_name:"folders",form_data:e,method:"get",path:V})}class $i extends L{type="saml";authority_id;issuer;idp_sso_target_url_runtime_params;name_identifier_format;uid_attribute;assertion_consumer_service_url;idp_sso_target_url;idp_cert;idp_cert_fingerprint;attribute_service_name;attribute_statements;request_attributes;idp_slo_target_url;slo_default_relay_state;constructor(e={}){super(e),this.authority_id=e.authority_id||"",this.issuer=e.issuer||"",this.idp_sso_target_url_runtime_params=e.idp_sso_target_url_runtime_params||{},this.name_identifier_format=e.name_identifier_format||"",this.uid_attribute=e.uid_attribute||"",this.assertion_consumer_service_url=e.assertion_consumer_service_url||"",this.idp_sso_target_url=e.idp_sso_target_url||"",this.idp_cert=e.idp_cert||"",this.idp_cert_fingerprint=e.idp_cert_fingerprint||"",this.attribute_service_name=e.attribute_service_name||"",this.attribute_statements=e.attribute_statements||{},this.request_attributes=e.request_attributes||[],this.idp_slo_target_url=e.idp_slo_target_url||"",this.slo_default_relay_state=e.slo_default_relay_state||""}}const dt="saml_auths";function on(t){return new $i(t)}function Tc(t={}){return P({query_params:t,fn:on,path:dt})}function Oc(t){return b({id:t,query_params:{},fn:on,path:dt})}function Ec(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:on,path:dt})}function Ic(t){return I({form_data:t,query_params:{},fn:on,path:dt})}function qc(t){return E({id:t,query_params:{},path:dt})}const Ve="settings";function pt(t){return new ve(t)}function Mc(t={}){return P({query_params:t,fn:pt,path:Ve})}function Rc(t){return b({id:t,query_params:{},fn:pt,path:Ve})}function Uc(t,e,n={},r="patch"){return q({id:t,form_data:e,query_params:n,method:r,fn:pt,path:Ve})}function Dc(t,e={}){return I({form_data:t,query_params:e,fn:pt,path:Ve})}function Cc(t){return E({id:t,query_params:{},path:Ve})}function Nc(t,e={}){return y({id:t,task_name:"history",form_data:e,method:"get",callback:n=>n.map(r=>pt(r)),path:Ve})}const C="systems";function Ue(t){return new zn(t)}function Fc(t={}){return P({query_params:t,fn:Ue,path:C})}function jc(t){return P({query_params:t,fn:Ue,path:`${C}/with_emails`})}function Lc(t,e={}){return b({id:t,query_params:e,fn:Ue,path:C})}function Hc(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:Ue,path:C})}function zc(t){return I({form_data:t,query_params:{},fn:Ue,path:C})}function Wc(t){return E({id:t,query_params:{},path:C})}function Bc(t,e,n={}){return y({id:t,task_name:`module/${e}`,form_data:n,method:"put",callback:r=>Ue(r),path:C})}function Qc(t,e){return y({id:t,task_name:`module/${e}`,form_data:{},method:"del",callback:n=>Ue(n),path:C})}function Vc(t,e={}){return y({id:t,task_name:"start",form_data:e,path:C})}function Zc(t,e={}){return y({id:t,task_name:"stop",form_data:e,path:C})}function Gc(t,e,n,r=1,i=[]){return y({id:t,task_name:`${n}_${r}/${encodeURIComponent(e)}`,form_data:i,path:C})}function Kc(t,e,n=1){return y({id:t,task_name:`${e}_${n}`,method:"get",path:C})}function Yc(t,e,n=1,r){return y({id:t,task_name:`${e}_${n}/${r}`,method:"get",path:C})}function Jc(t,e,n=1){return y({id:t,task_name:`functions/${e}_${n}`,method:"get",path:C})}function xc(t){return P({query_params:{},fn:e=>new tn(e),path:`${C}/${t}/zones`})}function Xc(t,e={}){return P({query_params:e,fn:n=>new he(n),path:`${C}/${t}/triggers`})}function ea(t,e){return y({id:t,task_name:"triggers",form_data:e,method:"post",callback:n=>new he(n),path:C})}function ta(t,e){return y({id:t,task_name:`triggers/${e}`,method:"del",path:C})}function na(t){return y({id:t,task_name:"settings",method:"get",callback:e=>e.map(n=>new ve(n)),path:C})}function ra(t={}){const e=w(),n=e.startsWith("https")?"wss:":"ws:",r=e.startsWith("https")?"https:":"http:";let i=e.replace(r,n)+`${C}/control`;return t.fixed_device&&(i+=`?fixed_device=${encodeURIComponent(String(t.fixed_device))}`),i}function ia(t,e={}){return y({id:t,task_name:"metadata",form_data:e,method:"get",path:C})}function sa(t,e,n={}){return y({id:t,task_name:`triggers/${encodeURIComponent(e)}`,form_data:n,method:"get",callback:r=>new he(r),path:C})}function oa(t,e,n,r="patch"){return y({id:t,task_name:`triggers/${encodeURIComponent(e)}`,form_data:n,method:r,callback:i=>new he(i),path:C})}const Ze="triggers";function un(t){return new he(t)}function ua(t={}){return P({query_params:t,fn:un,path:Ze})}function ca(t,e={}){return b({id:t,query_params:e,fn:un,path:Ze})}function aa(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:un,path:Ze})}function la(t){return I({form_data:t,query_params:{},fn:un,path:Ze})}function ha(t){return E({id:t,query_params:{},path:Ze})}function fa(t){return y({id:t,task_name:"instances",form_data:{},method:"get",callback:e=>e.map(n=>new he(n)),path:Ze})}var Ai=(t=>(t.EQ="equal",t.NEQ="not_equal",t.GT="greater_than",t.GTE="greater_than_or_equal",t.LT="less_than",t.LTE="less_than_or_equal",t.AND="and",t.OR="or",t.XOR="exclusive_or",t))(Ai||{}),wi=(t=>(t.AT="at",t.CRON="cron",t))(wi||{}),Pi=(t=>(t[t.ExecuteBefore=0]="ExecuteBefore",t[t.ExecuteAfter=1]="ExecuteAfter",t[t.PayloadOnly=2]="PayloadOnly",t[t.IgnorePayload=3]="IgnorePayload",t))(Pi||{});class Ti extends L{email_digest;authority_id;email;phone;country;building;groups;image;metadata;login_name;staff_id;first_name;last_name;support;sys_admin;ui_theme;card_number;department;work_preferences;work_overrides;photo_upload_id;locatable;password="";confirm_password="";constructor(e={}){super(e),this.authority_id=e.authority_id||"",this.email=e.email||"",this.email_digest=e.email_digest||"",this.phone=e.phone||"",this.country=e.country||"",this.building=e.building||"",this.image=e.image||"",this.metadata=e.metadata||"",this.login_name=e.login_name||"",this.staff_id=e.staff_id||"",this.first_name=e.first_name||"",this.last_name=e.last_name||"",this.support=!!e.support,this.sys_admin=!!e.sys_admin,this.ui_theme=e.ui_theme||"",this.card_number=e.card_number||"",this.groups=e.groups||[],this.department=e.department||"",this.photo_upload_id=e.photo_upload_id||"",this.work_preferences=e.work_preferences||[],this.work_overrides=e.work_overrides||{},this.locatable=e.locatable??!0}}const X="users";function Ge(t){return new Ti(t)}function da(t={}){return P({query_params:t,fn:Ge,path:X})}function pa(t,e={}){return b({id:t,query_params:e,fn:Ge,path:X})}function _a(t={}){return b({id:"current",query_params:t,fn:Ge,path:X})}function ma(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:Ge,path:X})}function ya(t){return I({form_data:t,query_params:{},fn:Ge,path:X})}function ga(t,e={}){return E({id:t,query_params:e,path:X})}function va(t){const e=U(t),n=`${w()}${X}/groups${e?"?"+e:""}`;return F(n).pipe(v(r=>r))}function ba(t){const e=U(t),n=`${w()}${X}/metadata/search${e?"?"+e:""}`;return F(n).pipe(v(r=>r))}function Sa(){const t=`${w()}${X}/resource_token`;return K(t,{}).pipe(v(e=>e))}function ka(t,e={}){return y({id:t,task_name:"metadata",form_data:e,method:"get",path:X})}function $a(t){const e=`${w()}${X}/${encodeURIComponent(t)}/resource_token`;return ge(e,{response_type:"void"})}function Aa(t){const e=`${w()}${X}/${encodeURIComponent(t)}/resource_token`;return K(e,{}).pipe(v(n=>n))}function wa(t){return y({id:t,task_name:"revive",form_data:{},method:"post",callback:e=>Ge(e),path:X})}const fe="zones";function cn(t){return new tn(t)}function Pa(t={}){return P({query_params:t,fn:cn,path:fe})}function Ta(t={}){return b({id:"tags",query_params:t,fn:e=>e,path:fe})}function Oa(t,e={}){return b({id:t,query_params:e,fn:cn,path:fe})}function Ea(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:cn,path:fe})}function Ia(t){return I({form_data:t,query_params:{},fn:cn,path:fe})}function qa(t){return E({id:t,query_params:{},path:fe})}function Ma(t,e={}){return P({query_params:e,fn:n=>new he(n),path:`${fe}/${t}/triggers`})}function Ra(t,e,n,r=1,i=[]){return y({id:t,task_name:`exec/${encodeURIComponent(n+"_"+r)}/${encodeURIComponent(e)}`,form_data:i,path:fe})}function Ua(t,e={}){return y({id:t,task_name:"metadata",form_data:e,method:"get",path:fe})}var Qn=(t=>(t[t.Default=0]="Default",t[t.Cut=1]="Cut",t[t.CrossFade=2]="CrossFade",t[t.SlideTop=3]="SlideTop",t[t.SlideLeft=4]="SlideLeft",t[t.SlideRight=5]="SlideRight",t[t.SlideBottom=6]="SlideBottom",t))(Qn||{});class Oi{id;created_at;updated_at;name;description;authority_id;start_time;play_time;video_length;animation;media_type;orientation;media_uri;media_id;thumbnail_id;play_count;valid_from;valid_until;get media_url(){return this.media_id?`/api/engine/v2/uploads/${this.media_id}/url`:this.media_uri}get thumbnail_url(){return`/api/engine/v2/uploads/${this.thumbnail_id}/url`}constructor(e){this.id=e.id||"",this.created_at=e.created_at||Nr(Date.now()),this.updated_at=e.updated_at||Nr(Date.now()),this.name=e.name||"",this.description=e.description||"",this.authority_id=e.authority_id||"",this.start_time=e.start_time||0,this.play_time=e.play_time||0,this.video_length=e.video_length||0,this.animation=e.animation,this.media_type=e.media_type||"unknown",this.orientation=e.orientation||"unspecified",this.media_uri=e.media_uri||"",this.media_id=e.media_id||"",this.thumbnail_id=e.thumbnail_id||"",this.play_count=e.play_count||0,this.valid_from=e.valid_from,this.valid_until=e.valid_until}}class an{id;playlist_id;items;created_at;updated_at;user_id;user_name;user_email;approved;approved_by_id;approved_by_email;approved_by_name;constructor(e={}){this.id=e.id||"",this.playlist_id=e.playlist_id||"",this.created_at=e.created_at||0,this.updated_at=e.updated_at||0,this.items=e.items||[],this.approved=!!e.approved,this.approved_by_id=e.approved_by_id||"",this.approved_by_email=e.approved_by_email||"",this.approved_by_name=e.approved_by_name||"",this.user_id=e.user_id||"",this.user_name=e.user_name||"",this.user_email=e.user_email||""}}class Ei{id;created_at;updated_at;name;description;authority_id;orientation;play_count;play_through_count;default_animation;random;enabled;default_duration;play_hours;play_at;play_cron;valid_from;valid_until;constructor(e){this.id=e.id||"",this.created_at=e.created_at||0,this.updated_at=e.updated_at||0,this.name=e.name||"",this.description=e.description||"",this.authority_id=e.authority_id||"",this.orientation=e.orientation||"",this.play_count=e.play_count||0,this.play_through_count=e.play_through_count||0,this.default_animation=e.default_animation||Qn.Cut,this.random=e.random||!1,this.enabled=e.enabled??!0,this.default_duration=e.default_duration??15*1e3,this.valid_from=e.valid_from,this.valid_until=e.valid_until,this.play_hours=e.play_hours||"",this.play_at=e.play_at||"",this.play_cron=e.play_cron||""}}const Ii="signage";function Da(t,e={},n){return b({id:t,query_params:e,fn:r=>r,path:`${Ii}`,options:n})}function Ca(t){return y({id:t,task_name:"metrics",form_data:{},method:"post",callback:e=>e,path:Ii})}const _t="signage/media";function ln(t){return new Oi(t)}function Na(t={}){return P({query_params:t,fn:ln,path:_t})}function Fa(t,e={}){return b({id:t,query_params:e,fn:ln,path:_t})}function ja(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:ln,path:_t})}function La(t){return I({form_data:t,query_params:{},fn:ln,path:_t})}function Ha(t,e={}){return E({id:t,query_params:e,path:_t})}const de="signage/playlists";function hn(t){return new Ei(t)}function za(t={}){return P({query_params:t,fn:hn,path:de})}function Wa(t,e={}){return b({id:t,query_params:e,fn:hn,path:de})}function Ba(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:hn,path:de})}function Qa(t){return I({form_data:t,query_params:{},fn:hn,path:de})}function Va(t,e={}){return E({id:t,query_params:e,path:de})}function Za(t,e={}){return y({id:t,task_name:"media",form_data:e,method:"get",callback:n=>new an(n),path:de})}function Ga(t,e={}){return y({id:t,task_name:"media/revisions",form_data:e,method:"get",callback:n=>n.map(r=>new an(r)),path:de})}function Ka(t){return y({id:t,task_name:"media/approve",method:"post",path:de})}function Ya(t,e){return y({id:t,task_name:"media",form_data:e,method:"post",path:de,callback:n=>new an(n)})}class Vn{id;question_id;survey_id;type;answer_json;constructor(e){this.id=e.id||0,this.question_id=e.question_id||0,this.survey_id=e.survey_id||0,this.type=e.type||"",this.answer_json=e.answer_json||{}}}const qi="/api/staff/v1/surveys/answers";function Ja(t={}){const e=U(t);return F(`${qi}${e?"?"+e:""}`).pipe(v(n=>n.map(r=>new Vn(r))))}function xa(t){return K(`${qi}`,t).pipe(v(e=>e.map(n=>new Vn(n))))}class mt{id;survey_id;token;email;sent;constructor(e){this.id=e.id||0,this.survey_id=e.survey_id||0,this.token=e.token||"",this.email=e.email||"",this.sent=e.sent??!1}}const yt="/api/staff/v1/surveys/invitations";function Xa(t={}){const e=U(t);return F(`${yt}${e?"?"+e:""}`).pipe(v(n=>n.map(r=>new mt(r))))}function el(t,e={}){const n=U(e);return F(`${yt}/${t}${n?"?"+n:""}`).pipe(v(r=>new mt(r)))}function tl(t,e,n="patch"){return(n==="put"?Ie:ze)(`${yt}/${t}`,e).pipe(v(r=>new mt(r)))}function nl(t){return K(`${yt}`,t).pipe(v(e=>new mt(e)))}function rl(t,e={}){const n=U(e);return ge(`${yt}/${t}${n?"?"+n:""}`)}class gt{id;title;description;type;options;required;max_rating;choices;tags;deleted;constructor(e){this.id=e.id||0,this.title=e.title||"",this.description=e.description||"",this.type=e.type||"",this.options=e.options||{},this.required=e.required||!1,this.max_rating=e.max_rating||0,this.choices=e.choices||[],this.tags=e.tags||[],this.deleted=e.deleted||!1}}const vt="/api/staff/v1/surveys/questions";function il(t={}){const e=U(t);return F(`${vt}${e?"?"+e:""}`).pipe(v(n=>n.map(r=>new gt(r))))}function sl(t,e={}){const n=U(e);return F(`${vt}/${t}${n?"?"+n:""}`).pipe(v(r=>new gt(r)))}function ol(t){return K(`${vt}`,t).pipe(v(e=>new gt(e)))}function ul(t,e,n="patch"){return(n==="put"?Ie:ze)(`${vt}/${t}`,e).pipe(v(r=>new gt(r)))}function cl(t,e={}){const n=U(e);return ge(`${vt}/${t}${n?"?"+n:""}`)}class bt{id;title;description;trigger;building_id;zone_id;pages;constructor(e){this.id=e.id||0,this.title=e.title||"",this.description=e.description||"",this.building_id=e.building_id||"",this.zone_id=e.zone_id||"",this.pages=e.pages||[],this.trigger=e.trigger||"NONE"}}const St="/api/staff/v1/surveys";function al(t={}){const e=U(t);return F(`${St}${e?"?"+e:""}`).pipe(v(n=>n.map(r=>new bt(r))))}function ll(t,e={}){const n=U(e);return F(`${St}/${t}${n?"?"+n:""}`).pipe(v(r=>new bt(r)))}function hl(t,e,n="patch"){return(n==="put"?Ie:ze)(`${St}/${t}`,e).pipe(v(r=>new bt(r)))}function fl(t){return K(`${St}`,t).pipe(v(e=>new bt(e)))}function dl(t,e={}){const n=U(e);return ge(`${St}/${t}${n?"?"+n:""}`)}class Mi{id;parent_category_id;name;description;hidden;created_at;updated_at;constructor(e){this.id=e.id||"",this.parent_category_id=e.parent_category_id||"",this.name=e.name||"",this.description=e.description||"",this.hidden=e.hidden||!1,this.created_at=e.created_at||0,this.updated_at=e.updated_at||0}}class Ri{id;purchase_order_number;invoice_number;supplier_details;purchase_date;unit_price;expected_service_start_date;expected_service_end_date;created_at;updated_at;constructor(e){this.id=e.id||"",this.purchase_order_number=e.purchase_order_number||"",this.invoice_number=e.invoice_number||"",this.supplier_details=e.supplier_details||{},this.purchase_date=e.purchase_date||0,this.unit_price=e.unit_price||0,this.expected_service_start_date=e.expected_service_start_date||0,this.expected_service_end_date=e.expected_service_end_date||0,this.created_at=e.created_at||0,this.updated_at=e.updated_at||0}}class Ui{id;category_id;name;brand;description;model_number;images;created_at;updated_at;constructor(e){this.id=e.id||"",this.category_id=e.category_id||"",this.name=e.name||"",this.brand=e.brand||"",this.description=e.description||"",this.model_number=e.model_number||"",this.images=e.images||[],this.created_at=e.created_at||0,this.updated_at=e.updated_at||0}}class Di{id;parent_id;asset_type_id;purchase_order_id;zone_id;identifier;serial_number;other_data;barcode;name;client_ids;map_id;bookable;accessible;zones;place_groups;assigned_to;assigned_name;features;images;notes;security_system_groups;created_at;updated_at;constructor(e){this.id=e.id||"",this.parent_id=e.parent_id||"",this.asset_type_id=e.asset_type_id||"",this.purchase_order_id=e.purchase_order_id||"",this.zone_id=e.zone_id||"",this.identifier=e.identifier||"",this.serial_number=e.serial_number||"",this.other_data=e.other_data||{},this.barcode=e.barcode||"",this.name=e.name||"",this.client_ids=e.client_ids||{},this.map_id=e.map_id||"",this.bookable=e.bookable||!1,this.accessible=e.accessible||!1,this.zones=e.zones||[],this.place_groups=e.place_groups||[],this.assigned_to=e.assigned_to||"",this.assigned_name=e.assigned_name||"",this.features=e.features||[],this.images=e.images||[],this.notes=e.notes||"",this.security_system_groups=e.security_system_groups||[],this.created_at=e.created_at||0,this.updated_at=e.updated_at||0}}const be="assets";function De(t){return new Di(t)}function pl(t={}){return P({query_params:t,fn:De,path:be})}function _l(t,e={}){return b({id:t,query_params:e,fn:De,path:be})}function ml(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:De,path:be})}function yl(t){return I({form_data:t,query_params:{},fn:De,path:be})}function gl(t,e={}){return E({id:t,query_params:e,path:be})}function vl(t){return K(`${w()}${be}/bulk`,JSON.stringify(t),{}).pipe(v(e=>e.map(n=>De(n))))}function bl(t,e="patch"){return(e==="put"?Ie:ze)(`${w()}${be}/bulk`,JSON.stringify(t),{}).pipe(v(r=>r.map(i=>De(i))))}function Sl(t,e={}){const n=U(e);return ge(`${w()}${be}/bulk${n?"?"+n:""}`,{body:JSON.stringify(t)}).pipe(v(r=>r.map(i=>De(i))))}const kt="asset_types";function fn(t){return new Ui(t)}function kl(t={}){return P({query_params:t,fn,path:kt})}function $l(t,e={}){return b({id:t,query_params:e,fn,path:kt})}function Al(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn,path:kt})}function wl(t){return I({form_data:t,query_params:{},fn,path:kt})}function Pl(t,e={}){return E({id:t,query_params:e,path:kt})}const $t="asset_categories";function dn(t){return new Mi(t)}function Tl(t={}){return P({query_params:t,fn:dn,path:$t})}function Ol(t,e={}){return b({id:t,query_params:e,fn:dn,path:$t})}function El(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:dn,path:$t})}function Il(t){return I({form_data:t,query_params:{},fn:dn,path:$t})}function ql(t,e={}){return E({id:t,query_params:e,path:$t})}const At="asset_purchase_orders";function pn(t){return new Ri(t)}function Ml(t={}){return P({query_params:t,fn:pn,path:At})}function Rl(t,e={}){return b({id:t,query_params:e,fn:pn,path:At})}function Ul(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:pn,path:At})}function Dl(t){return I({form_data:t,query_params:{},fn:pn,path:At})}function Cl(t,e={}){return E({id:t,query_params:e,path:At})}class Ci{id;name;uri;description;user_id;user_email;user_name;redirect_count;enabled;valid_from;valid_until;authority_id;created_at;updated_at;constructor(e){this.id=e.id||"",this.name=e.name||"",this.uri=e.uri||"",this.description=e.description||"",this.user_id=e.user_id||"",this.user_email=e.user_email||"",this.user_name=e.user_name||"",this.redirect_count=e.redirect_count||0,this.enabled=e.enabled??!0,this.valid_from=e.valid_from||"",this.valid_until=e.valid_until||"",this.authority_id=e.authority_id||"",this.created_at=e.created_at||0,this.updated_at=e.updated_at||0}}const ie="short_url";function _n(t){return new Ci(t)}function Nl(t={}){return P({query_params:t,fn:_n,path:ie})}function Fl(t,e={}){return b({id:t,query_params:e,fn:_n,path:ie})}function jl(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:_n,path:ie})}function Ll(t){return I({form_data:t,query_params:{},fn:_n,path:ie})}function Hl(t,e={}){return E({id:t,query_params:e,path:ie})}function zl(t){return`${w()}${ie}/${encodeURIComponent(t)}/redirect`}function Wl(t){return F(`${w()}${ie}/${encodeURIComponent(t)}/qr_code.svg`,{response_type:"text"})}function Bl(t,e={}){const n=U(e);return`${w()}${ie}/${encodeURIComponent(t)}/qr_code.png${n?"?"+n:""}`}function Ql(t){const{format:e="svg",...n}=t,r={...n,format:e},i=U(r);return`${w()}${ie}/qr_code${i?"?"+i:""}`}function Vl(t){const e={...t,format:"svg"},n=U(e);return F(`${w()}${ie}/qr_code${n?"?"+n:""}`,{response_type:"text"})}class Ni{id;storage_type;bucket_name;region;access_key;access_secret;authority_id;endpoint;is_default;ext_filter;mime_filter;created_at;updated_at;constructor(e){this.id=e.id||"",this.storage_type=e.storage_type||null,this.bucket_name=e.bucket_name||"",this.region=e.region||"",this.access_key=e.access_key||"",this.access_secret=e.access_secret||"",this.authority_id=e.authority_id||"",this.endpoint=e.endpoint||"",this.is_default=e.is_default??!1,this.ext_filter=e.ext_filter||[],this.mime_filter=e.mime_filter||[],this.created_at=e.created_at||0,this.updated_at=e.updated_at||0}}const wt="storages";function mn(t){return new Ni(t)}function Zl(t={}){return P({query_params:t,fn:mn,path:wt})}function Gl(t,e={}){return b({id:t,query_params:e,fn:mn,path:wt})}function Kl(t,e,n="patch"){return q({id:t,form_data:e,query_params:{},method:n,fn:mn,path:wt})}function Yl(t){return I({form_data:t,query_params:{},fn:mn,path:wt})}function Jl(t,e={}){return E({id:t,query_params:e,path:wt})}const Se="webrtc";function xl(t={}){const e=U(t),n=`${w()}${Se}/rooms${e?"?"+e:""}`;return F(n).pipe(v(r=>r))}function Xl(t){const e=`${w()}${Se}/room/${encodeURIComponent(t)}`;return F(e).pipe(v(n=>n))}function eh(t){const e=`${w()}${Se}/members/${encodeURIComponent(t)}`;return F(e).pipe(v(n=>n))}function th(t,e){const n=`${w()}${Se}/guest_entry/${encodeURIComponent(t)}`;return K(n,e).pipe(v(()=>{}))}function nh(){const t=`${w()}${Se}/guest/exit`;return K(t,{}).pipe(v(()=>{}))}function rh(t,e,n){const r=`${w()}${Se}/kick/${encodeURIComponent(t)}/${encodeURIComponent(e)}`;return K(r,n).pipe(v(()=>{}))}function ih(t,e,n){const r=`${w()}${Se}/transfer/${encodeURIComponent(t)}/${encodeURIComponent(e)}`;return K(r,n||{}).pipe(v(()=>{}))}function sh(){const t=w(),e=t.startsWith("https")?"wss:":"ws:",n=t.startsWith("https")?"https:":"http:";return t.replace(n,e)+`${Se}/signaller`}var oh={url:"",deserializer:function(t){return JSON.parse(t.data)},serializer:function(t){return JSON.stringify(t)}},uh="WebSocketSubject.error must be called with an object with an error code, and an optional reason: { code: number, reason: string }",ch=function(t){ne(e,t);function e(n,r){var i=t.call(this)||this;if(i._socket=null,n instanceof j)i.destination=r,i.source=n;else{var s=i._config=Je({},oh);if(i._output=new we,typeof n=="string")s.url=n;else for(var u in n)n.hasOwnProperty(u)&&(s[u]=n[u]);if(!s.WebSocketCtor&&WebSocket)s.WebSocketCtor=WebSocket;else if(!s.WebSocketCtor)throw new Error("no WebSocket constructor can be found");i.destination=new En}return i}return e.prototype.lift=function(n){var r=new e(this._config,this.destination);return r.operator=n,r.source=this,r},e.prototype._resetState=function(){this._socket=null,this.source||(this.destination=new En),this._output=new we},e.prototype.multiplex=function(n,r,i){var s=this;return new j(function(u){try{s.next(n())}catch(a){u.error(a)}var c=s.subscribe({next:function(a){try{i(a)&&u.next(a)}catch(h){u.error(h)}},error:function(a){return u.error(a)},complete:function(){return u.complete()}});return function(){try{s.next(r())}catch(a){u.error(a)}c.unsubscribe()}})},e.prototype._connectSocket=function(){var n=this,r=this._config,i=r.WebSocketCtor,s=r.protocol,u=r.url,c=r.binaryType,a=this._output,h=null;try{h=s?new i(u,s):new i(u),this._socket=h,c&&(this._socket.binaryType=c)}catch(g){a.error(g);return}var m=new Ae(function(){n._socket=null,h&&h.readyState===1&&h.close()});h.onopen=function(g){var _=n._socket;if(!_){h.close(),n._resetState();return}var l=n._config.openObserver;l&&l.next(g);var d=n.destination;n.destination=Ut.create(function(f){if(h.readyState===1)try{var A=n._config.serializer;h.send(A(f))}catch(S){n.destination.error(S)}},function(f){var A=n._config.closingObserver;A&&A.next(void 0),f&&f.code?h.close(f.code,f.reason):a.error(new TypeError(uh)),n._resetState()},function(){var f=n._config.closingObserver;f&&f.next(void 0),h.close(),n._resetState()}),d&&d instanceof En&&m.add(d.subscribe(n.destination))},h.onerror=function(g){n._resetState(),a.error(g)},h.onclose=function(g){h===n._socket&&n._resetState();var _=n._config.closeObserver;_&&_.next(g),g.wasClean?a.complete():a.error(g)},h.onmessage=function(g){try{var _=n._config.deserializer;a.next(_(g))}catch(l){a.error(l)}}},e.prototype._subscribe=function(n){var r=this,i=this.source;return i?i.subscribe(n):(this._socket||this._connectSocket(),this._output.subscribe(n),n.add(function(){var s=r._socket;r._output.observers.length===0&&(s&&(s.readyState===1||s.readyState===0)&&s.close(),r._resetState())}),n)},e.prototype.unsubscribe=function(){var n=this._socket;n&&(n.readyState===1||n.readyState===0)&&n.close(),this._resetState(),t.prototype.unsubscribe.call(this)},e}(Tn);function ah(t){return new ch(t)}var re=(t=>(t[t.PARSE_ERROR=0]="PARSE_ERROR",t[t.BAD_REQUEST=1]="BAD_REQUEST",t[t.ACCESS_DENIED=2]="ACCESS_DENIED",t[t.REQUEST_FAILED=3]="REQUEST_FAILED",t[t.UNKNOWN_CMD=4]="UNKNOWN_CMD",t[t.SYS_NOT_FOUND=5]="SYS_NOT_FOUND",t[t.MOD_NOT_FOUND=6]="MOD_NOT_FOUND",t[t.UNEXPECTED_FAILURE=7]="UNEXPECTED_FAILURE",t))(re||{}),Zn=(t=>(t.Info="info",t.Debug="debug",t.Warning="warn",t.Error="error",t.Fatal="fatal",t.Trace="trace",t))(Zn||{});class Fi{constructor(e,n){this._system=e;const r=Object.getOwnPropertyNames(Object.getPrototypeOf(n)).filter(i=>i.startsWith("$"));for(const i in n)n.hasOwnProperty(i)&&n[i]!==void 0&&(n[i]instanceof Function?this.addMethod(i,n[i]):this.addProperty(i,n[i]));for(const i of r)n[i]instanceof Function&&this.addMethod(i,n[i])}call(e,n=[]){return this[`$${e}`]instanceof Function?this[`$${e}`](...n):null}listen(e){return!this[`_${e}`]&&!(this[`_${e}_obs`]instanceof j)&&!this[e]&&this.addProperty(e,null),this[`_${e}_obs`]}addMethod(e,n){e[0]!=="$"&&(e=`$${e}`),this[e]=n}addProperty(e,n){e[0]==="$"&&(e=e.replace("$","")),this[`_${e}`]=new pe(n),this[`_${e}_obs`]=this[`_${e}`].asObservable(),Object.defineProperty(this,e,{get:()=>this[`_${e}`].getValue(),set:r=>this[`_${e}`].next(r)})}}class ji{constructor(e){for(const n in e)e.hasOwnProperty(n)&&e[n]&&e[n]instanceof Array&&e[n].forEach(r=>{this.addModule(n,r)})}addModule(e,n){this[e]||(this[e]=[]),this[e].push(new Fi(this,n))}}const yn={};function lh(t,e){return yn[t]=new ji(e),yn[t]}function Li(t){return yn[t]}function hh(t){delete yn[t]}const Hi=15;let Pt=0,te,zi=0;const Z={},Gn={},Ce={},fh={},Ne=new pe(!1);Ce._place_os_status=Ne.asObservable();const Wi=new pe([0,0]);Ce._place_os_sync=Wi.asObservable();let Bi=Date.now(),Ke,gn=0,ke=null,vn,Kn=0;const Tt=10*1e3,Yn=new we;Ce._place_os_debug_events=Yn.asObservable();function bn(){return w().indexOf("/control/")>=0?"/control/websocket":`${Un()}/systems/control`}function Jn(){return Ne.getValue()}function Qi(){return Ce._place_os_status}function dh(){return Ce._place_os_sync}function Vi(t,e=Gn,n=Ce){const r=`${t.sys}|${t.mod}_${t.index}|${t.name}`;return e[r]||(e[r]=new pe(void 0),n[r]=e[r].asObservable()),n[r]}function Zi(t,e=Gn){const n=`${t.sys}|${t.mod}_${t.index}|${t.name}`;if(e[n])return e[n].getValue()}function xn(t,e=0,n=Ye){const r={id:++Pt,cmd:"bind",...t};return n(r,e)}function Gi(t,e=0,n=Ye){const r={id:++Pt,cmd:"unbind",...t};return n(r,e)}function Ki(t,e=Tt,n=Ye){const r={id:++Pt,cmd:"exec",...t};return n(r,e)}function ph(t,e=Tt,n=Ye){const r={id:++Pt,cmd:"debug",...t};return n(r,e)}function _h(t,e=Tt,n=Ye){const r={id:++Pt,cmd:"ignore",...t};return n(r,e)}function Ye(t,e=Tt,n=0){const r=`${t.cmd}|${t.sys}|${t.mod}${t.index}|${t.name}|${t.args}|${Br()}`;if(Z[r])p("WS","Request already in progress. Waiting...",t);else{const i={...t,key:r};i.promise=new Promise((s,u)=>{const c=()=>{delete Z[r],Z[r]=null,Ye(t,e,n).then(a=>s(a),a=>u(a))};if(te&&Jn()){Wt()&&kh(t,te,fh),i.resolve=s,i.reject=u;const a=`${t.sys}, ${t.mod}_${t.index}, ${t.name}`;p("WS",`[${t.cmd.toUpperCase()}](${t.id}) ${a}`,t.args),te.next(t),e>0&&ae(`${r}`,()=>{u("Request timed out."),delete Z[r],Z[r]=null},e)}else ke?setTimeout(()=>c(),1e3):Xn().then(()=>c())}),Z[r]=i}return Z[r].promise}function Yi(t){if(t!=="pong"&&t instanceof Object){if(t.type==="notify"&&t.meta)gh(t.meta,t.value);else if(t.type==="success")mh(t);else if(t.type==="debug"){p("WS",`[DEBUG] ${t.mod}${t.klass||""} →`,t.msg);const e=t.meta||{mod:"",index:""};Yn.next({mod_id:t.mod||"<empty>",module:`${e.mod}_${e.index}`,class_name:t.klass||"<empty>",message:t.msg||"<empty>",level:t.level||Zn.Debug,time:Math.floor(new Date().getTime()/1e3)})}else t.type==="error"?yh(t):t.cmd||p("WS","Invalid websocket message",t,"error");Oe(`${t.id}`)}else t==="pong"&&(Kn=Date.now(),p("WS","Pong!"))}function mh(t){const e=Object.keys(Z).map(n=>Z[n]).find(n=>n?.id===t.id);p("WS",`[SUCCESS](${t.id})`),e&&e.resolve&&(e.resolve(t.value),delete Z[e.key])}function yh(t){let e="UNEXPECTED FAILURE";switch(t.code){case re.ACCESS_DENIED:e="ACCESS DENIED";break;case re.BAD_REQUEST:e="BAD REQUEST";break;case re.MOD_NOT_FOUND:e="MODULE NOT FOUND";break;case re.SYS_NOT_FOUND:e="SYSTEM NOT FOUND";break;case re.PARSE_ERROR:e="PARSE ERROR";break;case re.REQUEST_FAILED:e="REQUEST FAILED";break;case re.UNKNOWN_CMD:e="UNKNOWN COMMAND";break}p("WS",`[ERROR] ${e}(${t.id}): ${t.msg}`,void 0,"error");const n=Object.keys(Z).map(r=>Z[r]).filter(r=>r).find(r=>r.id===t.id);n&&n.reject&&(n.reject(t),Oe(`${n.key}`),delete Z[n.key])}function gh(t,e,n=Gn,r=Ce){const i=`${t.sys}|${t.mod}_${t.index}|${t.name}`;n[i]||(n[i]=new pe(null),r[i]=n[i].asObservable());const s=`${t.sys}, ${t.mod}_${t.index}, ${t.name}`;p("WS",`[NOTIFY] ${s} changed`,[n[i].getValue(),"→",e]),n[i].next(e)}function Xn(t=0){return ke==null&&(ke=new Promise(e=>{if(t>40)return location.reload();gn++,Bi=Date.now(),te=Wt()?Sh():vh(),te?(p("WS(Debug)","Authority:",[nt()]),p("WS","Connecting to websocket..."),te.subscribe(n=>{Ne.getValue()||(p("WS","Connection established."),e()),Ne.next(!0),gn=0,er(),Yi(n)},n=>{te=void 0,ke=null,xi(),er(),bh(n)},()=>{te=void 0,ke=null,xi(),p("WS","Connection closed by browser."),Ne.next(!1),Sn()}),Ke&&clearInterval(Ke),Kn=Date.now(),Ji(),Ke=setInterval(()=>Ji(),Hi*1e3),er(),zi+=1,vn=setTimeout(()=>{p("WS","Unhealthy connection. Reconnecting..."),Ne.next(!1),ke=null,Sn()},30*1e3)):(te?p("WS",`Waiting on auth(${t}). Retrying in ${1e3*Math.min(10,t+1)}ms...`,[!!J(),!!nt()],"info"):p("WS",`Failed to create websocket(${t}). Retrying in ${1e3*Math.min(10,t+1)}ms...`,void 0,"error"),setTimeout(()=>{ke=null,Xn(t).then(n=>e(n))},1e3*Math.min(10,++t)))})),ke}function vh(){if(!nt()||!J())return null;const t=Kr()||location.protocol.indexOf("https")>=0;let e=`ws${t?"s":""}://${zt()}${bn()}${Dn()?"?fixed_device=true":""}`;const n=J();let r=n==="x-api-key"?`api-key=${tt()}`:`bearer_token=${n}`;return!lo()&&!zr()?(p("WS","Authenticating through cookie..."),r+=`;max-age=120;path=${bn()};`,r+=`${t?"secure;":""}samesite=strict`,document.cookie=r,p("WS","Cookies:",[document.cookie,r])):(p("WS","Authenticating through URL query parameter..."),e+=`${e.indexOf("?")>=0?"&":"?"}${r}`),p("WS",`Creating websocket connection to ws${t?"s":""}://${zt()}${bn()}`),ah({url:e,serializer:i=>typeof i=="object"?JSON.stringify(i):i,deserializer:i=>{let s=i.data;if(s==="pong")return s;try{return JSON.parse(i.data)}catch{return s}}})}function Sn(){Wi.next([zi,Date.now()-Bi]),te&&Jn()&&(te.complete(),Ke&&(clearInterval(Ke),Ke=void 0)),p("WS",`Reconnecting in ${Math.min(5e3,gn*300||1e3)}ms...`),ae("reconnect",()=>Xn(),Math.min(5e3,(gn+1)*300||1e3))}function Ji(){if(Date.now()-Kn>4*Hi*1e3)return Sn();te?.next("ping")}function bh(t){Ne.next(!1),p("WS","Websocket error:",t,void 0,"error"),t.status===401&&Vt(),Cn(),Sn()}function er(){vn&&(clearTimeout(vn),vn=void 0)}function Sh(){const t=new we;return t.subscribe(e=>Yi(e)),t}function kh(t,e,n){const r=`${t.sys}|${t.mod}_${t.index}|${t.name}`,i=Li(t.sys),s=i&&i[t.mod]?i[t.mod][t.index-1||0]:null;if(s){switch(t.cmd){case"bind":n[r]=s.listen(t.name).subscribe(u=>{setTimeout(()=>{e.next({type:"notify",value:u,meta:t})},Math.floor(Math.random()*100+50))});break;case"unbind":n[r]&&(n[r].unsubscribe(),delete n[r],Oe(`${r}`));break}ae(`${t.id}-response`,()=>{const u={id:t.id,type:"success",value:t.cmd==="exec"?s.call(t.name,t.args):null};e.next(u)},10)}else ae(`${t.id}-error`,()=>e.next({id:t.id,type:"error",code:i?re.SYS_NOT_FOUND:re.MOD_NOT_FOUND}),10)}function xi(){for(const t in Z)Z[t]&&delete Z[t]}class tr{constructor(e,n){this._module=e,this.name=n,Qi().pipe(Ws()).subscribe(r=>{r&&(this._stale_bindings||this._pending===1)?(p("VAR","Re-binding to status variable",this.binding()),this.rebind()):r||(Oe(`rebind:${JSON.stringify(this.binding())}`),p("VAR","Binding dropped due to disconnection, re-binding when possible.",this.binding()),this._stale_bindings=this._binding_count||this._stale_bindings,this._binding_count=0)})}name;_pending=0;_binding_count=0;_stale_bindings=0;get count(){return this._binding_count}get value(){return Zi(this.binding())}listen(){return Vi(this.binding())}subscribe(e){return this.listen().subscribe(e)}bindThenSubscribe(e){const n=this.bind();return this.listen().subscribe({next:e,complete:()=>n(),error:()=>n()})}bind(){return(this._binding_count<=0&&this._stale_bindings<=0||this._pending===2)&&(this._pending=1,xn(this.binding()).then(()=>{this._binding_count++,this._pending=0}).catch(()=>null)),()=>this.unbind()}unbind(){this._binding_count===1&&this._pending===0?(this._pending=2,Gi(this.binding()).then(()=>{this._pending===2&&(this._pending=0),this._binding_count--})):this._binding_count=Math.max(this._binding_count-1,0)}async rebind(){!this._stale_bindings&&this._pending!==1||ae(`rebind:${JSON.stringify(this.binding())}`,async()=>{await xn(this.binding()),this._binding_count=this._stale_bindings||1,this._stale_bindings=0},100)}binding(){return{sys:this._module.system.id,mod:this._module.name,index:this._module.index,name:this.name}}}class Xi{constructor(e,n){this._system=e,this._id=n}_bindings={};get id(){return`${this.name}_${this.index}`}get system(){return this._system}get index(){const n=this._id.split("_").pop();return parseInt(n||"",10)||1}get name(){const e=this._id.split("_");return e.pop(),e.join("_")}binding(e){return this._bindings[e]||(this._bindings[e]=new tr(this,e)),this._bindings[e]}variable(e){return this._bindings[e]||(this._bindings[e]=new tr(this,e)),this._bindings[e]}execute(e,n,r=Tt){return Ki({sys:this._system.id,mod:this.name,index:this.index,name:e,args:n},r)}}class es{id;_module_list={};constructor(e){this.id=e}module(e,n=1){if(!e)throw new Error("Invalid module ID");const r=e.split("_");r.length>1&&Number.isInteger(+r[r.length-1])&&(n=+r[r.length-1],r.pop()),n<1&&(n=1);const i=r.join("_");for(this._module_list[i]||(this._module_list[i]=[]);this._module_list[i].length<n;)this._module_list[i].push(new Xi(this,`${i}_${this._module_list[i].length+1}`));return this._module_list[i][n-1]}}const nr={};function ts(t){return nr[t]||(nr[t]=new es(t)),nr[t]}function $h(t,e,n=1){return ts(t).module(e,n)}o.AuthType=fi,o.EncryptionLevel=qe,o.MediaAnimation=Qn,o.MockPlaceWebsocketModule=Fi,o.MockPlaceWebsocketSystem=ji,o.PlaceAlert=oi,o.PlaceAlertDashboard=ui,o.PlaceApplication=ci,o.PlaceAsset=Di,o.PlaceAssetCategory=Mi,o.PlaceAssetPurchaseOrder=Ri,o.PlaceAssetType=Ui,o.PlaceCluster=pi,o.PlaceDomain=yi,o.PlaceDriver=Ln,o.PlaceDriverRole=at,o.PlaceEdge=gi,o.PlaceErrorCodes=re,o.PlaceLDAPSource=vi,o.PlaceLogLevel=Zn,o.PlaceMQTTBroker=di,o.PlaceMetadata=Hn,o.PlaceModule=Wn,o.PlaceModuleBinding=Xi,o.PlaceOAuthSource=Si,o.PlaceProcess=_i,o.PlaceRepository=ki,o.PlaceRepositoryType=Bn,o.PlaceResource=L,o.PlaceSAMLSource=$i,o.PlaceSettings=ve,o.PlaceShortUrl=Ci,o.PlaceStorage=Ni,o.PlaceSystem=zn,o.PlaceSystemBinding=es,o.PlaceTrigger=he,o.PlaceUser=Ti,o.PlaceVariableBinding=tr,o.PlaceZone=tn,o.PlaceZoneMetadata=bi,o.SignageMedia=Oi,o.SignagePlaylist=Ei,o.SignagePlaylistMedia=an,o.Survey=bt,o.SurveyAnswer=Vn,o.SurveyInvitation=mt,o.SurveyQuestion=gt,o.TriggerConditionOperator=Ai,o.TriggerTimeConditionType=wi,o.TriggerWebhookType=Pi,o.addAlert=Qo,o.addAlertDashboard=jo,o.addAnswer=xa,o.addApplication=Xo,o.addAsset=yl,o.addAssetCategory=Il,o.addAssetPurchaseOrder=Dl,o.addAssetType=wl,o.addAssets=vl,o.addBroker=iu,o.addDomain=_u,o.addDriver=Su,o.addEdge=Iu,o.addInvitation=nl,o.addLDAPSource=Nu,o.addMetadata=Bu,o.addModule=Yu,o.addOAuthSource=ac,o.addQuestion=ol,o.addRepository=pc,o.addSAMLSource=Ic,o.addSettings=Dc,o.addShortUrl=Ll,o.addSignageMedia=La,o.addSignagePlaylist=Qa,o.addStorage=Yl,o.addSurvey=fl,o.addSystem=zc,o.addSystemModule=Bc,o.addSystemTrigger=ea,o.addTrigger=la,o.addUser=ya,o.addZone=Ia,o.apiEndpoint=w,o.apiKey=tt,o.approveSignagePlaylist=Ka,o.authorise=Nn,o.authority=nt,o.bind=xn,o.cleanObject=Hr,o.cleanupAuth=yo,o.clientId=Qr,o.clusterRebalance=lu,o.clusterVersions=hu,o.connectionState=dh,o.consoleHasColours=qn,o.convertPairStringToMap=Le,o.create=I,o.currentUser=_a,o.currentUserResourceToken=Sa,o.debug=ph,o.debug_events=Yn,o.del=ge,o.deregisterMockEndpoint=ni,o.deregisterSystem=hh,o.driverReadme=Pu,o.edgeControlUrl=Ru,o.execute=Ki,o.executeOnModule=sc,o.executeOnSystem=Gc,o.executeOnZone=Ra,o.functionList=Jc,o.generateNonce=jr,o.generateQrCode=Vl,o.get=F,o.getFragments=Mn,o.getModule=$h,o.getShortUrlQrCodeSvg=Wl,o.getSystem=ts,o.hasToken=Zr,o.host=zt,o.httpRoute=Un,o.humanReadableByteCount=Xe,o.ignore=_h,o.invalidateToken=Vt,o.isDriverCompiled=wu,o.isFixedDevice=Dn,o.isMobileSafari=zr,o.isMock=Wt,o.isNestedFrame=Wr,o.isOnline=po,o.isSecure=Kr,o.isTrusted=Bt,o.is_connected=Jn,o.lastRequestTotal=Go,o.listChildMetadata=Vu,o.listDashboardAlerts=Ho,o.listInterfaceRepositories=mc,o.listMetadata=ju,o.listMetadataHistory=Hu,o.listRemoteRepositoryBranches=gc,o.listRemoteRepositoryCommits=vc,o.listRemoteRepositoryDefaultBranch=yc,o.listRepositoryBranches=kc,o.listRepositoryCommits=Sc,o.listRepositoryDefaultBranch=$c,o.listRepositoryDriverDetails=Ac,o.listRepositoryDrivers=bc,o.listRepositoryFolders=Pc,o.listSignagePlaylistMedia=Za,o.listSignagePlaylistMediaRevisions=Ga,o.listSystemTriggers=Xc,o.listSystemZones=xc,o.listTriggerInstances=fa,o.listZoneTags=Ta,o.listZoneTriggers=Ma,o.listen=Vi,o.listenForToken=Gr,o.loadModule=nc,o.log=p,o.logout=go,o.lookupDomainByEmail=yu,o.lookupModuleState=tc,o.lookupSystemModuleState=Yc,o.mockSystem=Li,o.moduleRuntimeError=ic,o.moduleSettings=rc,o.moduleState=ec,o.onlineState=_o,o.parseLinkHeader=Lr,o.patch=ze,o.post=K,o.pullRepositoryChanges=wc,o.put=Ie,o.qrCodeUrl=Ql,o.query=P,o.queryAlertDashboards=Co,o.queryAlerts=zo,o.queryAnswers=Ja,o.queryApplications=Yo,o.queryAssetCategories=Tl,o.queryAssetPurchaseOrders=Ml,o.queryAssetTypes=kl,o.queryAssets=pl,o.queryBrokers=tu,o.queryClusters=ou,o.queryDomains=fu,o.queryDrivers=gu,o.queryEdges=Tu,o.queryInvitations=Xa,o.queryLDAPSources=Uu,o.queryModules=Zu,o.queryOAuthSources=oc,o.queryProcesses=cu,o.queryQuestions=il,o.queryRepositories=hc,o.querySAMLSources=Tc,o.querySettings=Mc,o.queryShortUrls=Nl,o.querySignageMedia=Na,o.querySignagePlaylists=za,o.queryStorages=Zl,o.querySurveys=al,o.querySystems=Fc,o.querySystemsWithEmails=jc,o.queryTriggers=ua,o.queryUserGroups=va,o.queryUsers=da,o.queryWebrtcRooms=xl,o.queryZones=Pa,o.recompileDriver=$u,o.redirectUri=ho,o.refreshAuthority=Cn,o.refreshToken=Ht,o.registerMockEndpoint=Io,o.registerSystem=lh,o.reloadDriver=Au,o.remove=E,o.removeAlert=Vo,o.removeAlertDashboard=Lo,o.removeApplication=eu,o.removeAsset=gl,o.removeAssetCategory=ql,o.removeAssetPurchaseOrder=Cl,o.removeAssetType=Pl,o.removeAssets=Sl,o.removeBroker=su,o.removeDomain=mu,o.removeDriver=ku,o.removeEdge=qu,o.removeFragment=_e,o.removeInvitation=rl,o.removeLDAPSource=Fu,o.removeMetadata=Qu,o.removeModule=Ju,o.removeOAuthSource=lc,o.removeQuestion=cl,o.removeRepository=_c,o.removeSAMLSource=qc,o.removeSettings=Cc,o.removeShortUrl=Hl,o.removeSignageMedia=Ha,o.removeSignagePlaylist=Va,o.removeStorage=Jl,o.removeSurvey=dl,o.removeSystem=Wc,o.removeSystemModule=Qc,o.removeSystemTrigger=ta,o.removeTrigger=ha,o.removeUser=ga,o.removeUserResourceToken=$a,o.removeZone=qa,o.requestTotal=Zo,o.responseHeaders=ii,o.retrieveEdgeToken=Mu,o.reviveUser=wa,o.searchUserMetadata=ba,o.setAPI_Key=fo,o.setMockNotFoundHandler=Eo,o.setToken=Vr,o.settingsHistory=Nc,o.setup=mo,o.shortUrlQrCodePngUrl=Bl,o.shortUrlRedirectUrl=zl,o.show=b,o.showAlert=Wo,o.showAlertDashboard=No,o.showApplication=Jo,o.showAsset=_l,o.showAssetCategory=Ol,o.showAssetPurchaseOrder=Rl,o.showAssetType=$l,o.showBroker=nu,o.showCluster=uu,o.showDomain=du,o.showDriver=vu,o.showEdge=Ou,o.showInvitation=el,o.showLDAPSource=Du,o.showMetadata=zu,o.showModule=Gu,o.showOAuthSource=uc,o.showQuestion=sl,o.showRepository=fc,o.showSAMLSource=Oc,o.showSettings=Rc,o.showShortUrl=Fl,o.showSignage=Da,o.showSignageMedia=Fa,o.showSignageMetrics=Ca,o.showSignagePlaylist=Wa,o.showStorage=Gl,o.showSurvey=ll,o.showSystem=Lc,o.showSystemTrigger=sa,o.showTrigger=ca,o.showUser=pa,o.showWebrtcRoom=Xl,o.showZone=Oa,o.simplifiedTime=Br,o.startModule=xu,o.startSystem=Vc,o.status=Qi,o.stopModule=Xu,o.stopSystem=Zc,o.systemControlUrl=ra,o.systemMetadata=ia,o.systemModuleState=Kc,o.systemSettings=na,o.terminateProcess=au,o.token=J,o.unbind=Gi,o.update=q,o.updateAlert=Bo,o.updateAlertDashboard=Fo,o.updateApplication=xo,o.updateAsset=ml,o.updateAssetCategory=El,o.updateAssetPurchaseOrder=Ul,o.updateAssetType=Al,o.updateAssets=bl,o.updateBroker=ru,o.updateDomain=pu,o.updateDriver=bu,o.updateEdge=Eu,o.updateInvitation=tl,o.updateLDAPSource=Cu,o.updateMetadata=Wu,o.updateModule=Ku,o.updateOAuthSource=cc,o.updateQuestion=ul,o.updateRepository=dc,o.updateSAMLSource=Ec,o.updateSettings=Uc,o.updateShortUrl=jl,o.updateSignageMedia=ja,o.updateSignagePlaylist=Ba,o.updateSignagePlaylistMedia=Ya,o.updateStorage=Kl,o.updateSurvey=hl,o.updateSystem=Hc,o.updateSystemTrigger=oa,o.updateTrigger=aa,o.updateUser=ma,o.updateZone=Ea,o.userMetadata=ka,o.userResourceToken=Aa,o.value=Zi,o.webrtcGuestEntry=th,o.webrtcGuestExit=nh,o.webrtcKickUser=rh,o.webrtcSessionMembers=eh,o.webrtcSignallerUrl=sh,o.webrtcTransferUser=ih,o.websocketRoute=bn,o.zoneMetadata=Ua,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
4
4
|
//# sourceMappingURL=index.umd.js.map
|