@liascript/exporter 2.6.6--0.11.0 → 2.6.7--0.11.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.
Files changed (98) hide show
  1. package/README.md +14 -2
  2. package/dist/assets/indexeddb/Beaker.becbdce1.js +1 -0
  3. package/dist/assets/indexeddb/Beaker.fb6f1ed7.js +1 -0
  4. package/dist/assets/indexeddb/Gun.b4a8b12a.js +1 -0
  5. package/dist/assets/indexeddb/Gun.dfece915.js +1 -0
  6. package/dist/assets/indexeddb/{Jitsi.8033a133.js → Jitsi.1c0a2389.js} +1 -1
  7. package/dist/assets/indexeddb/Jitsi.4f241ff6.js +1 -0
  8. package/dist/assets/indexeddb/index.7555c632.js +1 -0
  9. package/dist/assets/indexeddb/index.9d0c93a8.css +1 -0
  10. package/dist/assets/indexeddb/index.c9e0eee5.js +1 -0
  11. package/dist/assets/indexeddb/index.cd20f880.js +1 -0
  12. package/dist/assets/indexeddb/index.fdc63b6b.js +1 -0
  13. package/dist/assets/indexeddb/index.html +1 -1
  14. package/dist/assets/scorm1.2/Beaker.becbdce1.js +1 -0
  15. package/dist/assets/scorm1.2/Beaker.fb6f1ed7.js +1 -0
  16. package/dist/assets/scorm1.2/Gun.b4a8b12a.js +1 -0
  17. package/dist/assets/scorm1.2/Gun.dfece915.js +1 -0
  18. package/dist/assets/scorm1.2/{Jitsi.8033a133.js → Jitsi.1c0a2389.js} +1 -1
  19. package/dist/assets/scorm1.2/Jitsi.4f241ff6.js +1 -0
  20. package/dist/assets/scorm1.2/index.43be91bb.js +1 -0
  21. package/dist/assets/scorm1.2/index.7555c632.js +1 -0
  22. package/dist/assets/scorm1.2/index.9d0c93a8.css +1 -0
  23. package/dist/assets/scorm1.2/index.c9e0eee5.js +1 -0
  24. package/dist/assets/scorm1.2/index.f7835cb5.js +1 -0
  25. package/dist/assets/scorm1.2/index.html +1 -1
  26. package/dist/assets/scorm2004/Beaker.becbdce1.js +1 -0
  27. package/dist/assets/scorm2004/Beaker.fb6f1ed7.js +1 -0
  28. package/dist/assets/scorm2004/Gun.b4a8b12a.js +1 -0
  29. package/dist/assets/scorm2004/Gun.dfece915.js +1 -0
  30. package/dist/assets/scorm2004/{Jitsi.8033a133.js → Jitsi.1c0a2389.js} +1 -1
  31. package/dist/assets/scorm2004/Jitsi.4f241ff6.js +1 -0
  32. package/dist/assets/scorm2004/index.138ccbc7.js +1 -0
  33. package/dist/assets/scorm2004/index.7555c632.js +1 -0
  34. package/dist/assets/scorm2004/index.9d0c93a8.css +1 -0
  35. package/dist/assets/scorm2004/index.c9e0eee5.js +1 -0
  36. package/dist/assets/scorm2004/index.f55780b6.js +1 -0
  37. package/dist/assets/scorm2004/index.html +1 -1
  38. package/dist/assets/web/Beaker.becbdce1.js +1 -0
  39. package/dist/assets/web/Beaker.fb6f1ed7.js +1 -0
  40. package/dist/assets/web/Gun.b4a8b12a.js +1 -0
  41. package/dist/assets/web/Gun.dfece915.js +1 -0
  42. package/dist/assets/web/{Jitsi.8033a133.js → Jitsi.1c0a2389.js} +1 -1
  43. package/dist/assets/web/Jitsi.4f241ff6.js +1 -0
  44. package/dist/assets/web/index.01978564.js +1 -0
  45. package/dist/assets/web/index.7555c632.js +1 -0
  46. package/dist/assets/web/index.9d0c93a8.css +1 -0
  47. package/dist/assets/web/index.c28ff9a6.js +1 -0
  48. package/dist/assets/web/index.c9e0eee5.js +1 -0
  49. package/dist/assets/web/index.html +1 -1
  50. package/dist/index.js +1 -1
  51. package/package.json +1 -1
  52. package/src/export/android.ts +22 -0
  53. package/src/export/helper.ts +8 -2
  54. package/src/export/ims.ts +21 -0
  55. package/src/export/pdf.ts +68 -0
  56. package/src/export/scorm12.ts +35 -2
  57. package/src/export/scorm2004.ts +13 -1
  58. package/src/index.ts +18 -119
  59. package/dist/assets/indexeddb/Beaker.109d4501.js +0 -1
  60. package/dist/assets/indexeddb/Beaker.cad85351.js +0 -1
  61. package/dist/assets/indexeddb/Gun.3d0f8b5c.js +0 -1
  62. package/dist/assets/indexeddb/Gun.8d521e41.js +0 -1
  63. package/dist/assets/indexeddb/Jitsi.7c705568.js +0 -1
  64. package/dist/assets/indexeddb/index.3e300789.js +0 -1
  65. package/dist/assets/indexeddb/index.9bace6c1.js +0 -1
  66. package/dist/assets/indexeddb/index.9c382600.css +0 -1
  67. package/dist/assets/indexeddb/index.bd52f66c.js +0 -1
  68. package/dist/assets/indexeddb/index.cf54bb07.js +0 -1
  69. package/dist/assets/scorm1.2/Beaker.109d4501.js +0 -1
  70. package/dist/assets/scorm1.2/Beaker.cad85351.js +0 -1
  71. package/dist/assets/scorm1.2/Gun.3d0f8b5c.js +0 -1
  72. package/dist/assets/scorm1.2/Gun.8d521e41.js +0 -1
  73. package/dist/assets/scorm1.2/Jitsi.7c705568.js +0 -1
  74. package/dist/assets/scorm1.2/index.73b34686.js +0 -1
  75. package/dist/assets/scorm1.2/index.9bace6c1.js +0 -1
  76. package/dist/assets/scorm1.2/index.9c382600.css +0 -1
  77. package/dist/assets/scorm1.2/index.bd52f66c.js +0 -1
  78. package/dist/assets/scorm1.2/index.f180d4ec.js +0 -1
  79. package/dist/assets/scorm2004/Beaker.109d4501.js +0 -1
  80. package/dist/assets/scorm2004/Beaker.cad85351.js +0 -1
  81. package/dist/assets/scorm2004/Gun.3d0f8b5c.js +0 -1
  82. package/dist/assets/scorm2004/Gun.8d521e41.js +0 -1
  83. package/dist/assets/scorm2004/Jitsi.7c705568.js +0 -1
  84. package/dist/assets/scorm2004/index.70023c6e.js +0 -1
  85. package/dist/assets/scorm2004/index.9bace6c1.js +0 -1
  86. package/dist/assets/scorm2004/index.9c382600.css +0 -1
  87. package/dist/assets/scorm2004/index.aa80d76c.js +0 -1
  88. package/dist/assets/scorm2004/index.bd52f66c.js +0 -1
  89. package/dist/assets/web/Beaker.109d4501.js +0 -1
  90. package/dist/assets/web/Beaker.cad85351.js +0 -1
  91. package/dist/assets/web/Gun.3d0f8b5c.js +0 -1
  92. package/dist/assets/web/Gun.8d521e41.js +0 -1
  93. package/dist/assets/web/Jitsi.7c705568.js +0 -1
  94. package/dist/assets/web/index.9bace6c1.js +0 -1
  95. package/dist/assets/web/index.9c382600.css +0 -1
  96. package/dist/assets/web/index.bd52f66c.js +0 -1
  97. package/dist/assets/web/index.dd7c6355.js +0 -1
  98. package/dist/assets/web/index.fe7e12cf.js +0 -1
@@ -0,0 +1 @@
1
+ function t(t,e,n,r){Object.defineProperty(t,e,{get:n,set:r,enumerable:!0,configurable:!0})}var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;e.register("1dThA",(function(n,r){t(n.exports,"Sync",(function(){return u}));var s=e("2Xs1f"),o=e("5Owdb"),i=e("2O3kG");Object.defineProperty(Array.prototype,"flat",{value:function(t=1){return this.reduce((function(e,n){return e.concat(Array.isArray(n)&&t>1?n.flat(t-1):n)}),[])}});class u extends o.Sync{destroy(){this.gunServer=[],delete this.gun,super.destroy()}uniqueID(){const t=super.uniqueID();return t?btoa(t+(this.persistent?"p":"")):null}async connect(t){var e,n;super.connect(t),this.gunServer=(null===(e=t.config)||void 0===e?void 0:e.urls)||[],this.persistent=(null===(n=t.config)||void 0===n?void 0:n.persistent)||!1,window.Gun?this.init(!0):this.load(["https://cdn.jsdelivr.net/npm/gun/gun.js",i.Crypto.url],this)}init(t,e){if(0==this.gunServer.length)return this.sendDisconnectError("You have to provide at least one relay server.");const n=this.uniqueID();if(t&&window.Gun&&n){this.gun=window.Gun({peers:this.gunServer}),this.store=n,i.Crypto.init(this.password);let t=this;this.persistent&&this.gun.get(this.store).once((e=>{if(e&&e.msg)try{const[n,r]=i.Crypto.decode(e.msg);setTimeout((function(){var e;null===(e=t.gun)||void 0===e||e.get(t.store).put({msg:i.Crypto.encode(["",r])})}),1e3)}catch(t){console.warn("GunDB:",t.message)}})),this.gun.get(this.store).on((function(e,n){try{const[n,r]=i.Crypto.decode(e.msg);n!=t.token&&null!=r&&t.applyUpdate(o.base64_to_unit8(r))}catch(t){console.warn("GunDB",t.message)}})),this.persistent||this.broadcast(null),this.sendConnect()}else{let t="GunDB unknown error";e?t="Could not load resource: "+e:window.Gun||(t="Could not load GunDB interface"),this.sendDisconnectError(t)}}broadcast(t){if(this.gun){const e=null==t?null:o.uint8_to_base64(t);this.gun.get(this.store).put({msg:i.Crypto.encode([this.token,e])})}}constructor(...t){super(...t),(0,s.default)(this,"store",""),(0,s.default)(this,"gunServer",[]),(0,s.default)(this,"persistent",!1)}}})),e.register("2O3kG",(function(e,n){t(e.exports,"Crypto",(function(){return r}));const r={url:"https://cdn.jsdelivr.net/npm/simple-crypto-js@2.5.0/dist/SimpleCrypto.min.js",crypt:null,check:function(){return!!window.SimpleCrypto},init:function(t){try{"string"==typeof t&&t.length>0?this.crypt=new SimpleCrypto(t):this.crypt=null}catch(t){console.warn("Crypto: ",t),this.crypt=null}},encode:function(t){return this.crypt?this.crypt.encrypt(btoa(encodeURIComponent(JSON.stringify(t)))):JSON.stringify(t)},decode:function(t){return this.crypt?JSON.parse(decodeURIComponent(atob(this.crypt.decrypt(t)))):JSON.parse(t)}}}));
@@ -0,0 +1 @@
1
+ !function(){function t(t,e,n,r){Object.defineProperty(t,e,{get:n,set:r,enumerable:!0,configurable:!0})}var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;e.register("izF7z",(function(n,r){t(n.exports,"Sync",(function(){return g}));var i=e("f1evb"),o=e("hnmIs"),u=e("9Klpk"),s=e("3bWnf"),l=e("eT7f3"),a=e("9WzNc"),c=e("div3d"),d=e("kb0qF"),f=e("5ENmm"),p=e("bWNdT"),h=e("32Euv"),y=e("auvHb"),v=e("i4ll7");Object.defineProperty(Array.prototype,"flat",{value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.reduce((function(e,n){return e.concat(Array.isArray(n)&&t>1?n.flat(t-1):n)}),[])}});var g=function(t){"use strict";(0,d.default)(n,t);var e=(0,p.default)(n);function n(){var t;return(0,u.default)(this,n),t=e.apply(this,arguments),(0,l.default)((0,i.default)(t),"store",""),(0,l.default)((0,i.default)(t),"gunServer",[]),(0,l.default)((0,i.default)(t),"persistent",!1),t}return(0,s.default)(n,[{key:"destroy",value:function(){this.gunServer=[],delete this.gun,(0,a.default)((0,c.default)(n.prototype),"destroy",this).call(this)}},{key:"uniqueID",value:function(){var t=(0,a.default)((0,c.default)(n.prototype),"uniqueID",this).call(this);return t?btoa(t+(this.persistent?"p":"")):null}},{key:"connect",value:function(t){var e=this,r=this;return(0,o.default)((function(){var i,o;return(0,h.__generator)(this,(function(u){return(0,a.default)((0,c.default)(n.prototype),"connect",e).call(r,t),r.gunServer=(null===(i=t.config)||void 0===i?void 0:i.urls)||[],r.persistent=(null===(o=t.config)||void 0===o?void 0:o.persistent)||!1,window.Gun?r.init(!0):r.load(["https://cdn.jsdelivr.net/npm/gun/gun.js",v.Crypto.url],r),[2]}))}))()}},{key:"init",value:function(t,e){if(0==this.gunServer.length)return this.sendDisconnectError("You have to provide at least one relay server.");var n=this.uniqueID();if(t&&window.Gun&&n){this.gun=window.Gun({peers:this.gunServer}),this.store=n,v.Crypto.init(this.password);var r=this;this.persistent&&this.gun.get(this.store).once((function(t){if(t&&t.msg)try{var e=(0,f.default)(v.Crypto.decode(t.msg),2),n=(e[0],e[1]);setTimeout((function(){var t;null===(t=r.gun)||void 0===t||t.get(r.store).put({msg:v.Crypto.encode(["",n])})}),1e3)}catch(t){console.warn("GunDB:",t.message)}})),this.gun.get(this.store).on((function(t,e){try{var n=(0,f.default)(v.Crypto.decode(t.msg),2),i=n[0],o=n[1];i!=r.token&&null!=o&&r.applyUpdate(y.base64_to_unit8(o))}catch(t){console.warn("GunDB",t.message)}})),this.persistent||this.broadcast(null),this.sendConnect()}else{var i="GunDB unknown error";e?i="Could not load resource: "+e:window.Gun||(i="Could not load GunDB interface"),this.sendDisconnectError(i)}}},{key:"broadcast",value:function(t){if(this.gun){var e=null==t?null:y.uint8_to_base64(t);this.gun.get(this.store).put({msg:v.Crypto.encode([this.token,e])})}}}]),n}(y.Sync)})),e.register("i4ll7",(function(e,n){t(e.exports,"Crypto",(function(){return r}));var r={url:"https://cdn.jsdelivr.net/npm/simple-crypto-js@2.5.0/dist/SimpleCrypto.min.js",crypt:null,check:function(){return!!window.SimpleCrypto},init:function(t){try{"string"==typeof t&&t.length>0?this.crypt=new SimpleCrypto(t):this.crypt=null}catch(t){console.warn("Crypto: ",t),this.crypt=null}},encode:function(t){return this.crypt?this.crypt.encrypt(btoa(encodeURIComponent(JSON.stringify(t)))):JSON.stringify(t)},decode:function(t){return this.crypt?JSON.parse(decodeURIComponent(atob(this.crypt.decrypt(t)))):JSON.parse(t)}}}))}();
@@ -1 +1 @@
1
- !function(){var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;e.register("9c9W2",(function(n,t){var o,i,c,s;o=n.exports,i="Sync",c=function(){return p},Object.defineProperty(o,i,{get:c,set:s,enumerable:!0,configurable:!0});var r=e("f1evb"),d=e("hnmIs"),a=e("9Klpk"),u=e("3bWnf"),f=e("eT7f3"),l=e("9WzNc"),w=e("div3d"),v=e("kb0qF"),J=e("bWNdT"),E=e("32Euv"),h=e("auvHb"),p=function(e){"use strict";(0,v.default)(t,e);var n=(0,J.default)(t);function t(){var e;return(0,a.default)(this,t),e=n.apply(this,arguments),(0,f.default)((0,r.default)(e),"users",{}),e}return(0,u.default)(t,[{key:"destroy",value:function(){var e;null===(e=this.connection)||void 0===e||e.disconnect(),(0,l.default)((0,w.default)(t.prototype),"destroy",this).call(this)}},{key:"connect",value:function(e){var n=this,o=this;return(0,d.default)((function(){return(0,E.__generator)(this,(function(i){return(0,l.default)((0,w.default)(t.prototype),"connect",n).call(o,e),o.domain=e.config||"meet.jit.si",window.JitsiMeetJS?o.init(!0):o.load(["https://meet.jit.si/libs/lib-jitsi-meet.min.js"],o),[2]}))}))()}},{key:"init",value:function(e,n){var t=this.uniqueID();if(e&&window.JitsiMeetJS&&t){window.LIA.debug||window.JitsiMeetJS.setLogLevel(window.JitsiMeetJS.logLevels.ERROR),this.connection=new window.JitsiMeetJS.JitsiConnection(null,null,{hosts:{domain:this.domain,muc:"conference.".concat(this.domain),focus:"focus.".concat(this.domain)},configOverwrite:{openBridgeChannel:!0},serviceUrl:"https://".concat(this.domain,"/http-bind?room=").concat(btoa(t)),clientNode:"http://jitsi.org/jitsimeet"});var o=this;this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,(function(){o.conferenceRoom=o.connection.initJitsiConference(btoa(t).toLowerCase(),{configOverwrite:{openBridgeChannel:!0},enableLayerSuspension:!0,p2p:{enabled:!1}}),o.conferenceRoom.setDisplayName(o.token),o.conferenceRoom.on(window.JitsiMeetJS.events.conference.CONFERENCE_JOINED,(function(){o.sendConnect()})),o.conferenceRoom.on(window.JitsiMeetJS.errors.conference.PASSWORD_REQUIRED,(function(){o.sendDisconnectError("password required")})),o.conferenceRoom.on(window.JitsiMeetJS.events.conference.USER_JOINED,(function(e){o.users[e]=null})),o.conferenceRoom.on(window.JitsiMeetJS.events.conference.USER_LEFT,(function(e){var n=o.users[e];n&&o.db.removePeer(n),delete o.users[e]})),o.conferenceRoom.on(window.JitsiMeetJS.events.conference.ENDPOINT_MESSAGE_RECEIVED,(function(e,n){o.users[e.getId()]=e.getDisplayName(),o.applyUpdate(h.base64_to_unit8(n))})),o.conferenceRoom.join()})),this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_FAILED,(function(e){o.sendDisconnectError("Connection failed"+e)})),this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,(function(e){o.disconnect()})),this.connection.connect()}else{var i="Jitsi unknown error";n?i="Could not load resource: "+n:void 0===window.JitsiMeetJS&&(i="Could not load Jitsi interface"),this.sendDisconnectError(i)}}},{key:"broadcast",value:function(e){try{var n;null===(n=this.conferenceRoom)||void 0===n||n.sendEndpointMessage("",h.uint8_to_base64(e))}catch(e){}}}]),t}(h.Sync)}))}();
1
+ !function(){var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;e.register("9c9W2",(function(n,t){var o,i,c,s;o=n.exports,i="Sync",c=function(){return p},Object.defineProperty(o,i,{get:c,set:s,enumerable:!0,configurable:!0});var r=e("f1evb"),a=e("hnmIs"),d=e("9Klpk"),u=e("3bWnf"),f=e("eT7f3"),l=e("9WzNc"),w=e("div3d"),v=e("kb0qF"),J=e("bWNdT"),h=e("32Euv"),E=e("auvHb"),p=function(e){"use strict";(0,v.default)(t,e);var n=(0,J.default)(t);function t(){var e;return(0,d.default)(this,t),e=n.apply(this,arguments),(0,f.default)((0,r.default)(e),"users",{}),e}return(0,u.default)(t,[{key:"destroy",value:function(){var e;null===(e=this.connection)||void 0===e||e.disconnect(),(0,l.default)((0,w.default)(t.prototype),"destroy",this).call(this)}},{key:"connect",value:function(e){var n=this,o=this;return(0,a.default)((function(){return(0,h.__generator)(this,(function(i){return(0,l.default)((0,w.default)(t.prototype),"connect",n).call(o,e),o.domain=e.config||"meet.jit.si",window.JitsiMeetJS?o.init(!0):o.load(["https://meet.jit.si/libs/lib-jitsi-meet.min.js"],o),[2]}))}))()}},{key:"init",value:function(e,n){var t=this.uniqueID();if(e&&window.JitsiMeetJS&&t){window.LIA.debug||window.JitsiMeetJS.setLogLevel(window.JitsiMeetJS.logLevels.ERROR),this.connection=new window.JitsiMeetJS.JitsiConnection(null,null,{hosts:{domain:this.domain,muc:"conference.".concat(this.domain),focus:"focus.".concat(this.domain)},configOverwrite:{openBridgeChannel:!1},serviceUrl:"https://".concat(this.domain,"/http-bind?room=").concat(btoa(t)),clientNode:"http://jitsi.org/jitsimeet"});var o=this;this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,(function(){o.conferenceRoom=o.connection.initJitsiConference(btoa(t).toLowerCase(),{configOverwrite:{openBridgeChannel:!1},enableLayerSuspension:!0,p2p:{enabled:!0}}),o.conferenceRoom.setDisplayName(o.token),o.conferenceRoom.on(window.JitsiMeetJS.events.conference.CONFERENCE_JOINED,(function(){o.sendConnect()})),o.conferenceRoom.on(window.JitsiMeetJS.errors.conference.PASSWORD_REQUIRED,(function(){o.sendDisconnectError("password required")})),o.conferenceRoom.on(window.JitsiMeetJS.events.conference.USER_JOINED,(function(e){o.users[e]||(o.users[e]=null)})),o.conferenceRoom.on(window.JitsiMeetJS.events.conference.USER_LEFT,(function(e){var n=o.users[e];n&&o.db.removePeer(n),delete o.users[e]})),o.conferenceRoom.on(window.JitsiMeetJS.events.conference.MESSAGE_RECEIVED,(function(e,n){for(var t=o.conferenceRoom.getParticipants(),i=0;i<t.length;i++)if(e===t[i].getId()){o.users[e]=t[i].getDisplayName();break}o.applyUpdate(E.base64_to_unit8(n))})),o.conferenceRoom.join()})),this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_FAILED,(function(e){o.sendDisconnectError("Connection failed"+e)})),this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,(function(e){o.disconnect()})),this.connection.connect()}else{var i="Jitsi unknown error";n?i="Could not load resource: "+n:void 0===window.JitsiMeetJS&&(i="Could not load Jitsi interface"),this.sendDisconnectError(i)}}},{key:"broadcast",value:function(e){try{var n;null===(n=this.conferenceRoom)||void 0===n||n.sendTextMessage(E.uint8_to_base64(e))}catch(e){console.warn("Jitsi: broadcast =>",e.message)}}}]),t}(E.Sync)}))}();
@@ -0,0 +1 @@
1
+ var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire55a5;e.register("eSzt7",(function(n,o){var t,i,s,c;t=n.exports,i="Sync",s=function(){return a},Object.defineProperty(t,i,{get:s,set:c,enumerable:!0,configurable:!0});var r=e("2Xs1f"),d=e("5Owdb");class a extends d.Sync{destroy(){var e;null===(e=this.connection)||void 0===e||e.disconnect(),super.destroy()}async connect(e){super.connect(e),this.domain=e.config||"meet.jit.si",window.JitsiMeetJS?this.init(!0):this.load(["https://meet.jit.si/libs/lib-jitsi-meet.min.js"],this)}init(e,n){const o=this.uniqueID();if(e&&window.JitsiMeetJS&&o){window.LIA.debug||window.JitsiMeetJS.setLogLevel(window.JitsiMeetJS.logLevels.ERROR),this.connection=new window.JitsiMeetJS.JitsiConnection(null,null,{hosts:{domain:this.domain,muc:`conference.${this.domain}`,focus:`focus.${this.domain}`},configOverwrite:{openBridgeChannel:!1},serviceUrl:`https://${this.domain}/http-bind?room=${btoa(o)}`,clientNode:"http://jitsi.org/jitsimeet"});const e=this;this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED,(function(){e.conferenceRoom=e.connection.initJitsiConference(btoa(o).toLowerCase(),{configOverwrite:{openBridgeChannel:!1},enableLayerSuspension:!0,p2p:{enabled:!0}}),e.conferenceRoom.setDisplayName(e.token),e.conferenceRoom.on(window.JitsiMeetJS.events.conference.CONFERENCE_JOINED,(()=>{e.sendConnect()})),e.conferenceRoom.on(window.JitsiMeetJS.errors.conference.PASSWORD_REQUIRED,(()=>{e.sendDisconnectError("password required")})),e.conferenceRoom.on(window.JitsiMeetJS.events.conference.USER_JOINED,(n=>{e.users[n]||(e.users[n]=null)})),e.conferenceRoom.on(window.JitsiMeetJS.events.conference.USER_LEFT,(n=>{const o=e.users[n];o&&e.db.removePeer(o),delete e.users[n]})),e.conferenceRoom.on(window.JitsiMeetJS.events.conference.MESSAGE_RECEIVED,((n,o)=>{const t=e.conferenceRoom.getParticipants();for(let o=0;o<t.length;o++)if(n===t[o].getId()){e.users[n]=t[o].getDisplayName();break}e.applyUpdate(d.base64_to_unit8(o))})),e.conferenceRoom.join()})),this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_FAILED,(n=>{e.sendDisconnectError("Connection failed"+n)})),this.connection.addEventListener(window.JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED,(n=>{e.disconnect()})),this.connection.connect()}else{let e="Jitsi unknown error";n?e="Could not load resource: "+n:void 0===window.JitsiMeetJS&&(e="Could not load Jitsi interface"),this.sendDisconnectError(e)}}broadcast(e){try{var n;null===(n=this.conferenceRoom)||void 0===n||n.sendTextMessage(d.uint8_to_base64(e))}catch(e){console.warn("Jitsi: broadcast =>",e.message)}}constructor(...e){super(...e),(0,r.default)(this,"users",{})}}}));