nsd-ble 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- "use strict";const m=require("./enums.cjs");let I=!1,T=[],j,te,B=new Map;async function fe(a){try{if(j=await navigator.bluetooth.requestDevice(a),j.gatt===void 0)throw new Error("Device does not support GATT");te=await j.gatt.connect(),j.addEventListener("gattserverdisconnected",ve),I=!0}catch(h){throw h}}function ve(){B.clear(),I=!1,T.forEach(a=>a())}function de(a){T.push(a)}function ye(a){T=T.filter(h=>h!==a)}async function F(a,h){if(B.has(h)){const d=B.get(h);if(d===void 0)throw new Error("Characteristic not found");return d}const c=await(await te.getPrimaryService(a)).getCharacteristic(h);return B.set(h,c),c}async function pe(a,h){return await(await F(a,h)).readValue()}async function ge(a,h,r){const c=new DataView(new ArrayBuffer(r.length));for(let l=0;l<r.length;l++)c.setUint8(l,r[l]);await(await F(a,h)).writeValue(c)}async function _e(a,h,r){const c=await F(a,h);c.addEventListener("characteristicvaluechanged",d=>{let l=d.target.value;l===void 0&&(l=new DataView(new ArrayBuffer(0))),r(l)}),await c.startNotifications()}function ne(){return{connected:I,connect:fe,readCharacteristic:pe,writeCharacteristic:ge,subscribe:_e,setDisconnectCallback:de,removeDisconnectCallback:ye}}const re="19b10000-e8f2-537e-4f6c-d104768a1214",Ee="6b061bdc-9bc1-4952-a96f-c6ed551b2c3e",we="998ff920-81af-42a9-a915-f88025f9647d",be={filters:[{namePrefix:"BLE-STANDEE"}],optionalServices:[re]};function se(){return{serviceUuid:re,messageCharUuid:Ee,handshakeCharUuid:we,options:be}}var S={},O={},Y;function V(){if(Y)return O;Y=1,Object.defineProperty(O,"__esModule",{value:!0}),O.BaseEvent=void 0;var a=(function(){function h(){}return h.prototype.attach=function(r,c){return this._attach(r,c,!1)},h.prototype.once=function(r,c){return this._attach(r,c,!0)},h.prototype._attach=function(r,c,d){var l=this,u,i,s,o;if(typeof r=="function")i=r,o=function(){return l.detach(i)};else if(!c&&typeof r.post=="function")s=r,o=function(){return l.detach(s)};else{if(typeof r!="object"||r===void 0)throw new Error("Expect a function or object as first argument");if(typeof c!="function")throw new Error("Expect a function as second argument");u=r,i=c,o=function(){return l.detach(u,i)}}return this._listeners?this._listeners=this._listeners.slice():this._listeners=[],this._listeners.push({deleted:!1,boundTo:u,handler:i,event:s,once:d}),o},h.prototype.detach=function(){for(var r=[],c=0;c<arguments.length;c++)r[c]=arguments[c];this._detach.apply(this,r)},h.prototype._detach=function(){for(var r=[],c=0;c<arguments.length;c++)r[c]=arguments[c];if(!(!this._listeners||this._listeners.length===0)){var d,l,u;r.length>=1&&(typeof r[0]=="function"?l=r[0]:r.length===1&&typeof r[0].post=="function"?u=r[0]:d=r[0]),r.length>=2&&(l=r[1]),this._listeners=this._listeners.filter(function(i){return(typeof l>"u"||i.handler===l)&&(typeof u>"u"||i.event===u)&&(typeof d>"u"||i.boundTo===d)?(i.deleted=!0,!1):!0}),this._listeners.length===0&&delete this._listeners}},h.prototype.post=function(r){throw new Error("abstract")},h.prototype.listenerCount=function(){return this._listeners?this._listeners.length:0},h.prototype._call=function(r,c){this._listeners&&(r.deleted||(r.once&&(r.deleted=!0,this._listeners=this._listeners.filter(function(d){return d!==r}),this._listeners.length===0&&delete this._listeners),r.event?r.event.post.apply(r.event,c):r.handler&&r.handler.apply(typeof r.boundTo=="object"?r.boundTo:this,c)))},h})();return O.BaseEvent=a,O}var E={},z;function L(){if(z)return E;z=1;var a=E&&E.__extends||(function(){var l=function(u,i){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,o){s.__proto__=o}||function(s,o){for(var t in o)o.hasOwnProperty(t)&&(s[t]=o[t])},l(u,i)};return function(u,i){l(u,i);function s(){this.constructor=u}u.prototype=i===null?Object.create(i):(s.prototype=i.prototype,new s)}})();Object.defineProperty(E,"__esModule",{value:!0}),E.ErrorSyncEvent=E.VoidSyncEvent=E.SyncEvent=void 0;var h=V(),r=(function(l){a(u,l);function u(){var i=l!==null&&l.apply(this,arguments)||this;return i._recursion=0,i}return Object.defineProperty(u.prototype,"evtListenersChanged",{get:function(){return this._listenersChanged||(this._listenersChanged=new c),this._listenersChanged},enumerable:!1,configurable:!0}),u.prototype.post=function(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];if(!(!this._listeners||this._listeners.length===0)){if(this._recursion++,typeof u.MAX_RECURSION_DEPTH=="number"&&Number.isInteger(u.MAX_RECURSION_DEPTH)&&u.MAX_RECURSION_DEPTH>0&&this._recursion>u.MAX_RECURSION_DEPTH)throw new Error("event fired recursively");for(var o=this._listeners,t=0;t<o.length;++t){var e=o[t];this._call(e,i)}this._recursion--}},u.prototype._attach=function(i,s,o){var t,e,n,f,v=(e=(t=this._listeners)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0,y=l.prototype._attach.call(this,i,s,o);return this.evtListenersChanged&&v!==((f=(n=this._listeners)===null||n===void 0?void 0:n.length)!==null&&f!==void 0?f:0)&&this.evtListenersChanged.post(),y},u.prototype._detach=function(){for(var i,s,o,t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var f=(s=(i=this._listeners)===null||i===void 0?void 0:i.length)!==null&&s!==void 0?s:0,v=l.prototype._detach.apply(this,e);return this.evtListenersChanged&&f!==((t=(o=this._listeners)===null||o===void 0?void 0:o.length)!==null&&t!==void 0?t:0)&&this.evtListenersChanged.post(),v},u.MAX_RECURSION_DEPTH=10,u})(h.BaseEvent);E.SyncEvent=r;var c=(function(l){a(u,l);function u(){return l!==null&&l.apply(this,arguments)||this}return u.prototype.post=function(){l.prototype.post.call(this,void 0)},u})(r);E.VoidSyncEvent=c;var d=(function(l){a(u,l);function u(){return l!==null&&l.apply(this,arguments)||this}return u.prototype.post=function(i){if(this.listenerCount()===0)throw new Error("error event posted while no listeners attached. Error: "+i.message);l.prototype.post.call(this,i)},u})(r);return E.ErrorSyncEvent=d,E}var w={},Q={},J;function N(){if(J)return Q;J=1,Object.defineProperty(Q,"__esModule",{value:!0});var a=L(),h=(function(){function r(){this.evtFilled=new a.SyncEvent,this.evtDrained=new a.SyncEvent,this._queue=[],this._flushing=!1}return r.global=function(){return r._instance||r.resetGlobal(),r._instance},r.resetGlobal=function(){r._instance=new r},r.prototype.empty=function(){return this._queue.length===0},r.prototype.add=function(c){this._queue.push(c),this._queue.length===1&&!this._flushing&&this.evtFilled.post(this)},r.prototype.flushOnce=function(){var c=this._queue.length===0,d=this._flushing;this._flushing=!0;try{var l=this._queue;this._queue=[];for(var u=0;u<l.length;++u)l[u]()}finally{this._flushing=d,!c&&!d&&this._queue.length===0&&this.evtDrained.post(this)}},r.prototype.flush=function(c){c===void 0&&(c=10);var d=this._queue.length===0,l=this._flushing;this._flushing=!0;try{for(var u=0;this._queue.length>0;){if(typeof c=="number"&&u>=c)throw this._queue=[],new Error("unable to flush the queue due to recursively added event. Clearing queue now");this.flushOnce(),++u}}finally{this._flushing=l,!d&&!l&&this._queue.length===0&&this.evtDrained.post(this)}},r})();return Q.default=h,Q}var K;function ie(){if(K)return w;K=1;var a=w&&w.__extends||(function(){var i=function(s,o){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},i(s,o)};return function(s,o){i(s,o);function t(){this.constructor=s}s.prototype=o===null?Object.create(o):(t.prototype=o.prototype,new t)}})();Object.defineProperty(w,"__esModule",{value:!0}),w.ErrorQueuedEvent=w.VoidQueuedEvent=w.QueuedEvent=void 0;var h=V(),r=N(),c=L(),d=(function(i){a(s,i);function s(o){o===void 0&&(o={});var t=i.call(this)||this;return t._queued=!1,t.options=o,typeof o.condensed=="boolean"?t._condensed=o.condensed:t._condensed=!1,typeof o.queue=="object"&&o.queue!==null&&(t._queue=o.queue),t}return Object.defineProperty(s.prototype,"evtListenersChanged",{get:function(){return this._listenersChanged||(this._listenersChanged=new c.VoidSyncEvent),this._listenersChanged},enumerable:!1,configurable:!0}),s.prototype.post=function(){for(var o=this,t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!(!this._listeners||this._listeners.length===0)){var n=this._queue?this._queue:r.default.global();if(this._condensed){if(this._queuedData=t,this._queuedListeners=this._listeners,this._queued)return;this._queued=!0,n.add(function(){o._queued=!1;for(var v=o._queuedData,y=o._queuedListeners,p=0;p<y.length;++p){var g=y[p];o._call(g,v)}})}else{var f=this._listeners;n.add(function(){for(var v=0;v<f.length;++v){var y=f[v];o._call(y,t)}})}}},s.prototype._attach=function(o,t,e){var n,f,v,y,p=(f=(n=this._listeners)===null||n===void 0?void 0:n.length)!==null&&f!==void 0?f:0,g=i.prototype._attach.call(this,o,t,e);return this.evtListenersChanged&&p!==((y=(v=this._listeners)===null||v===void 0?void 0:v.length)!==null&&y!==void 0?y:0)&&this.evtListenersChanged.post(),g},s.prototype._detach=function(){for(var o,t,e,n,f=[],v=0;v<arguments.length;v++)f[v]=arguments[v];var y=(t=(o=this._listeners)===null||o===void 0?void 0:o.length)!==null&&t!==void 0?t:0,p=i.prototype._detach.apply(this,f);return this.evtListenersChanged&&y!==((n=(e=this._listeners)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)&&this.evtListenersChanged.post(),p},s})(h.BaseEvent);w.QueuedEvent=d;var l=(function(i){a(s,i);function s(){return i!==null&&i.apply(this,arguments)||this}return s.prototype.post=function(){i.prototype.post.call(this,void 0)},s})(d);w.VoidQueuedEvent=l;var u=(function(i){a(s,i);function s(){return i!==null&&i.apply(this,arguments)||this}return s.prototype.post=function(o){if(!this._listeners||this._listeners.length===0)throw new Error("error event posted while no listeners attached. Error: "+o.message);i.prototype.post.call(this,o)},s})(d);return w.ErrorQueuedEvent=u,w}var b={},W;function oe(){if(W)return b;W=1;var a=b&&b.__extends||(function(){var u=function(i,s){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,t){o.__proto__=t}||function(o,t){for(var e in t)t.hasOwnProperty(e)&&(o[e]=t[e])},u(i,s)};return function(i,s){u(i,s);function o(){this.constructor=i}i.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)}})();Object.defineProperty(b,"__esModule",{value:!0}),b.ErrorAsyncEvent=b.VoidAsyncEvent=b.AsyncEvent=void 0;var h=V(),r=L(),c=(function(u){a(i,u);function i(s){s===void 0&&(s={});var o=u.call(this)||this;return o._queued=!1,o.options=s,typeof s.condensed=="boolean"?o._condensed=s.condensed:o._condensed=!1,o}return Object.defineProperty(i.prototype,"evtListenersChanged",{get:function(){return this._listenersChanged||(this._listenersChanged=new r.VoidSyncEvent),this._listenersChanged},enumerable:!1,configurable:!0}),i.defaultScheduler=function(s){typeof window<"u"?setTimeout(s,0):setImmediate(s)},i.setScheduler=function(s){i._scheduler=s},i.prototype.post=function(){for(var s=this,o=[],t=0;t<arguments.length;t++)o[t]=arguments[t];if(!(!this._listeners||this._listeners.length===0))if(this._condensed){if(this._queuedData=o,this._queuedListeners=this._listeners,this._queued)return;this._queued=!0,i._scheduler(function(){s._queued=!1;for(var n=s._queuedData,f=s._queuedListeners,v=0;v<f.length;++v){var y=f[v];s._call(y,n)}})}else{var e=this._listeners;i._scheduler(function(){for(var n=0;n<e.length;++n){var f=e[n];s._call(f,o)}})}},i.prototype._call=function(s,o){s.event&&s.event instanceof i?s.event._postDirect(o):u.prototype._call.call(this,s,o)},i.prototype._postDirect=function(s){if(!(!this._listeners||this._listeners.length===0))for(var o=this._listeners,t=0;t<o.length;++t){var e=o[t];this._call(e,s)}},i.prototype._attach=function(s,o,t){var e,n,f,v,y=(n=(e=this._listeners)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0,p=u.prototype._attach.call(this,s,o,t);return this.evtListenersChanged&&y!==((v=(f=this._listeners)===null||f===void 0?void 0:f.length)!==null&&v!==void 0?v:0)&&this.evtListenersChanged.post(),p},i.prototype._detach=function(){for(var s,o,t,e,n=[],f=0;f<arguments.length;f++)n[f]=arguments[f];var v=(o=(s=this._listeners)===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0,y=u.prototype._detach.apply(this,n);return this.evtListenersChanged&&v!==((e=(t=this._listeners)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)&&this.evtListenersChanged.post(),y},i._scheduler=i.defaultScheduler,i})(h.BaseEvent);b.AsyncEvent=c;var d=(function(u){a(i,u);function i(){return u!==null&&u.apply(this,arguments)||this}return i.prototype.post=function(){u.prototype.post.call(this,void 0)},i})(c);b.VoidAsyncEvent=d;var l=(function(u){a(i,u);function i(){return u!==null&&u.apply(this,arguments)||this}return i.prototype.post=function(s){if(this.listenerCount()===0)throw new Error("error event posted while no listeners attached. Error: "+s.message);u.prototype.post.call(this,s)},i})(c);return b.ErrorAsyncEvent=l,b}var D={},P={},Z;function Ce(){if(Z)return P;Z=1,Object.defineProperty(P,"__esModule",{value:!0}),P.shallowEquals=void 0;function a(h,r){if(h===r)return!0;if(typeof h!=typeof r)return!1;switch(typeof h){case"boolean":case"number":case"string":case"function":case"symbol":case"undefined":return!1;case"object":if(h===null||r===null)return!1;if(Array.isArray(h)||Array.isArray(r)){if(!Array.isArray(h)||!Array.isArray(r)||h.length!==r.length)return!1;for(var c=0;c<h.length;++c)if(h[c]!==r[c])return!1;return!0}var d=[],l=[];for(var u in h)h.hasOwnProperty(u)&&d.push(u);for(var i in r)r.hasOwnProperty(i)&&l.push(i);if(d.sort(),l.sort(),d.join(",")!==l.join(","))return!1;for(var c=0;c<d.length;++c)if(h[d[c]]!==r[d[c]])return!1;return!0;default:return!1}}return P.shallowEquals=a,P}var x;function me(){return x||(x=1,(function(a){var h=D&&D.__extends||(function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,v){f.__proto__=v}||function(f,v){for(var y in v)v.hasOwnProperty(y)&&(f[y]=v[y])},t(e,n)};return function(e,n){t(e,n);function f(){this.constructor=e}e.prototype=n===null?Object.create(n):(f.prototype=n.prototype,new f)}})();Object.defineProperty(a,"__esModule",{value:!0}),a.ErrorAnyEvent=a.VoidAnyEvent=a.AnyEvent=a.EventType=void 0;var r=Ce(),c=L(),d=oe(),l=ie(),u;(function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async",t[t.Queued=2]="Queued"})(u=a.EventType||(a.EventType={}));var i=(function(){function t(e){this._events=[],e&&e.monitorAttach&&(this.evtFirstAttached=new s,this.evtLastDetached=new s)}return Object.defineProperty(t.prototype,"evtListenersChanged",{get:function(){return this._listenersChanged||(this._listenersChanged=new c.VoidSyncEvent),this._listenersChanged},enumerable:!1,configurable:!0}),t.prototype.attach=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var f=u.Sync;e.length>0&&typeof e[0]=="number"&&(f=e.shift());var v=this,y,p,g;return typeof e[0]=="function"||e[0]&&typeof e[0]=="object"&&typeof e[0].post=="function"?(typeof e[0]=="function"?y=e[0]:g=e[0],p=e[1]):(v=e[0],y=e[1],p=e[2]),this._attach(f,v,y,g,p,!1)},t.prototype.once=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var f=u.Sync;e.length>0&&typeof e[0]=="number"&&(f=e.shift());var v=this,y,p,g;return typeof e[0]=="function"||e[0]&&typeof e[0]=="object"&&typeof e[0].post=="function"?(typeof e[0]=="function"?y=e[0]:g=e[0],p=e[1]):(v=e[0],y=e[1],p=e[2]),this._attach(f,v,y,g,p,!0)},t.prototype._attach=function(e,n,f,v,y,p){var g=this,H=this.evtFirstAttached?this.listenerCount():0,_;switch(e){case u.Sync:{for(var M=0,X=this._events;M<X.length;M++){var C=X[M];C instanceof c.SyncEvent&&(_=C)}_||(_=new c.SyncEvent,this._events.push(_))}break;case u.Async:{for(var U=0,G=this._events;U<G.length;U++){var C=G[U];C instanceof d.AsyncEvent&&r.shallowEquals(C.options,y)&&(_=C)}_||(_=new d.AsyncEvent(y),this._events.push(_))}break;case u.Queued:{for(var R=0,$=this._events;R<$.length;R++){var C=$[R];C instanceof l.QueuedEvent&&r.shallowEquals(C.options,y)&&(_=C)}_||(_=new l.QueuedEvent(y),this._events.push(_))}break;default:throw new Error("unknown EventType")}var q;return p?v?q=_.once(v):q=_.once(n,f):v?q=_.attach(v):q=_.attach(n,f),this.evtFirstAttached&&H===0&&this.evtFirstAttached.post(),this.evtListenersChanged&&H!==this.listenerCount()&&this.evtListenersChanged.post(),function(){var k=g.evtLastDetached?g.listenerCount():0;q(),g.evtLastDetached&&k>0&&g.listenerCount()===0&&g.evtLastDetached.post(),g.evtListenersChanged&&k!==g.listenerCount()&&g.evtListenersChanged.post()}},t.prototype.attachSync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.unshift(u.Sync),this.attach.apply(this,e)},t.prototype.onceSync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.unshift(u.Sync),this.once.apply(this,e)},t.prototype.attachAsync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.unshift(u.Async),this.attach.apply(this,e)},t.prototype.onceAsync=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.unshift(u.Async),this.once.apply(this,e)},t.prototype.attachQueued=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.unshift(u.Queued),this.attach.apply(this,e)},t.prototype.onceQueued=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e.unshift(u.Queued),this.once.apply(this,e)},t.prototype.detach=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var f=this.listenerCount(),v=0;v<this._events.length;++v)this._events[v].detach.apply(this._events[v],e);this.evtListenersChanged&&f!==this.listenerCount()&&this.evtListenersChanged.post(),this.evtLastDetached&&f>0&&this.listenerCount()===0&&this.evtLastDetached.post()},t.prototype.post=function(e){for(var n=[],f=0;f<this._events.length;++f)n.push(this._events[f]);for(var f=0;f<n.length;++f)n[f].post(e)},t.prototype.listenerCount=function(){for(var e=0,n=0;n<this._events.length;++n)e+=this._events[n].listenerCount();return e},t})();a.AnyEvent=i;var s=(function(t){h(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.post=function(){t.prototype.post.call(this,void 0)},e})(i);a.VoidAnyEvent=s;var o=(function(t){h(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.post=function(n){if(this.listenerCount()===0)throw new Error("error event posted while no listeners attached. Error: "+n.message);t.prototype.post.call(this,n)},e})(i);a.ErrorAnyEvent=o})(D)),D}var ee;function Se(){return ee||(ee=1,(function(a){var h=S&&S.__createBinding||(Object.create?(function(s,o,t,e){e===void 0&&(e=t),Object.defineProperty(s,e,{enumerable:!0,get:function(){return o[t]}})}):(function(s,o,t,e){e===void 0&&(e=t),s[e]=o[t]})),r=S&&S.__exportStar||function(s,o){for(var t in s)t!=="default"&&!o.hasOwnProperty(t)&&h(o,s,t)};Object.defineProperty(a,"__esModule",{value:!0}),a.flush=a.flushOnce=a.queue=void 0,r(V(),a),r(L(),a),r(ie(),a),r(oe(),a),r(me(),a);var c=N(),d=N();Object.defineProperty(a,"EventQueue",{enumerable:!0,get:function(){return d.default}});function l(){return c.default.global()}a.queue=l;function u(){c.default.global().flushOnce()}a.flushOnce=u;function i(s){s===void 0&&(s=10),c.default.global().flush(s)}a.flush=i})(S)),S}var A=Se();class ue{id;data;constructor(h,r){this.id=h,this.data=r}}const{serviceUuid:Ae,messageCharUuid:qe}=se(),ae=new A.SyncEvent,ce=new A.SyncEvent,he=new A.SyncEvent,le=new A.SyncEvent;function Oe(){return new Promise((a,h)=>{ne().subscribe(Ae,qe,De).then(()=>a()).catch(r=>h(r))})}function De(a){a!==void 0&&(a.getUint8(m.Data.TYPE)===m.DataType.BUTTON_PRESS&&Pe(a),a.getUint8(m.Data.TYPE)===m.DataType.MESSAGE_DONE&&le.post(a.getUint8(m.Data.DATA)))}function Pe(a){const h=a.getUint8(m.Data.DATA),r=new ue(a.getUint8(m.Data.ID),Le(a));h===m.Button.MINUS&&ce.post(r),h===m.Button.PLUS&&ae.post(r),h===m.Button.EITHER&&he.post(r)}function Le(a){const h=a.buffer,r=7,c=a.byteLength-7;return Array.from(new Uint8Array(h,r,c)).map(d=>String.fromCharCode(d)).join("").replace(/\0/g,"").trim()}function je(){return{subscribe:Oe,onPlusButton:ae,onMinButton:ce,onEitherButton:he,onMessageDone:le}}class Qe{id;elements=[];onPlus=new A.SyncEvent;onMin=new A.SyncEvent;constructor(h){this.id=h}name(){return this.id.toString(16).padStart(2,"0")}}exports.ButtonResult=ue;exports.Standee=Qe;exports.libExports=A;exports.useBluetooth=ne;exports.useBluetoothSettings=se;exports.useMessageCharacteristic=je;