1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[9546,4e3],{9546:function(e,t,i){i.r(t),i.d(t,{dyte_mic_toggle:function(){return d}});var n=i(5671),s=i(3144),o=i(2304),r=i(5855),a=i(7622),u=i(2274),d=function(){function e(t){var i=this;(0,n.Z)(this,e),(0,o.r)(this,t),this.stateUpdate=(0,o.c)(this,"dyteStateUpdate",7),this.audioUpdateListener=function(e){var t=e.audioEnabled;i.audioEnabled=t},this.selfJoinStateListener=function(){i.updateCanProduce(i.meeting)},this.selfStageLeftListener=function(){i.canProduceAudio=!1},this.selfJoinStateRejectedListener=function(){i.updateCanProduce(i.meeting)},this.mediaPermissionUpdateListener=function(e){var t=e.kind,n=e.message;"audio"===t&&(i.micPermission=n)},this.toggleMic=function(){var e,t,n,s,o,r,a,d,c,l,f,h;if(null===(e=i.meeting)||void 0===e||e.__internals__.logger.info("dyteMicToggle::toggleMic",{media:{audio:{enabled:Boolean(null===(n=null===(t=i.meeting)||void 0===t?void 0:t.self)||void 0===n?void 0:n.audioEnabled),permission:i.micPermission,canProduce:null===(r=null===(o=null===(s=i.meeting)||void 0===s?void 0:s.self)||void 0===o?void 0:o.permissions)||void 0===r?void 0:r.canProduceAudio}},webinar:{stageStatus:null===(d=null===(a=i.meeting)||void 0===a?void 0:a.self)||void 0===d?void 0:d.webinarStageStatus},livestream:{stageStatus:null===(l=null===(c=i.meeting)||void 0===c?void 0:c.stage)||void 0===l?void 0:l.status},moduleExists:{self:Boolean(null===(f=i.meeting)||void 0===f?void 0:f.self)}}),i.hasPermissionError()){var v={enabled:!0,kind:"audio"};return i.stateUpdate.emit({activePermissionsMessage:v}),u.s.activePermissionsMessage=v,!1}var g=null===(h=i.meeting)||void 0===h?void 0:h.self;null!=g&&i.canProduceAudio&&(g.audioEnabled?g.disableAudio():g.enableAudio())},this.variant="button",this.meeting=void 0,this.size=void 0,this.iconPack=r.d,this.t=(0,a.u)(),this.audioEnabled=!1,this.canProduceAudio=!1,this.micPermission="NOT_REQUESTED"}return(0,s.Z)(e,[{key:"connectedCallback",value:function(){this.meetingChanged(this.meeting)}},{key:"disconnectedCallback",value:function(){var e,t,i,n,s,o,r,a,u;null===(e=this.meeting)||void 0===e||e.self.removeListener("audioUpdate",this.audioUpdateListener),null===(t=this.meeting)||void 0===t||t.self.removeListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),null===(i=this.meeting)||void 0===i||i.self.removeListener("joinStageRequestAccepted",this.selfJoinStateListener),null===(n=this.meeting)||void 0===n||n.self.removeListener("joinStageRequestRejected",this.selfJoinStateRejectedListener),null===(s=this.meeting)||void 0===s||s.self.removeListener("stageJoined",this.selfJoinStateListener),null===(o=this.meeting)||void 0===o||o.self.removeListener("stageLeft",this.selfStageLeftListener),null===(r=this.meeting)||void 0===r||r.self.removeListener("removedFromStage",this.selfJoinStateListener),null===(u=null===(a=this.meeting)||void 0===a?void 0:a.stage)||void 0===u||u.removeListener("stageStatusUpdate",this.selfJoinStateListener)}},{key:"meetingChanged",value:function(e){if(null!=e){var t=e.self,i=e.stage;this.canProduceAudio="ALLOWED"===t.permissions.produceAudio,this.updateCanProduce(e),this.micPermission=e.self.mediaPermissions.audio||"NOT_REQUESTED",this.audioEnabled=t.audioEnabled,t.addListener("audioUpdate",this.audioUpdateListener),t.addListener("mediaPermissionUpdate",this.mediaPermissionUpdateListener),t.addListener("joinStageRequestAccepted",this.selfJoinStateListener),t.addListener("joinStageRequestRejected",this.selfJoinStateRejectedListener),t.addListener("stageJoined",this.selfJoinStateListener),t.addListener("stageLeft",this.selfStageLeftListener),t.addListener("removedFromStage",this.selfJoinStateListener),null===i||void 0===i||i.addListener("stageStatusUpdate",this.selfJoinStateListener)}}},{key:"updateCanProduce",value:function(e){var t=e.self,i=e.meta,n=e.stage,s="ALLOWED"===t.permissions.canProduceAudio,o="WEBINAR"===i.viewType,r="LIVESTREAM"===i.viewType;if(this.canProduceAudio=!1,s&&!r)this.canProduceAudio=!0;else if(o||r){s&&"OFF_STAGE"!==n.status&&"REQUESTED_TO_JOIN_STAGE"!==n.status&&(this.canProduceAudio=!0),"CAN_REQUEST"===t.permissions.canProduceAudio&&(o&&("ON_STAGE"===t.webinarStageStatus||"ACCEPTED_TO_JOIN_STAGE"===t.webinarStageStatus)||r&&("ON_STAGE"===n.status||"ACCEPTED_TO_JOIN_STAGE"===n.status))&&(this.canProduceAudio=!0)}}},{key:"hasPermissionError",value:function(){return"DENIED"===this.micPermission||"SYSTEM_DENIED"===this.micPermission}},{key:"getState",value:function(){var e="",t="",i={},n=this.hasPermissionError(),s="COULD_NOT_START"===this.micPermission;return this.audioEnabled&&!n?(e=this.t("mic_on"),t=this.iconPack.mic_on):(e=this.t("mic_off"),t=this.iconPack.mic_off,i["red-icon"]=!0),{tooltipLabel:s?this.t("Unable to capture audio"):"SYSTEM_DENIED"===this.micPermission?this.t("perm_sys_denied"):"DENIED"===this.micPermission?this.t("perm_browser_denied"):this.audioEnabled?this.t("Disable Mic"):this.t("Enable Mic"),label:e,icon:t,classList:i,showWarning:n||s,disable:n}}},{key:"render",value:function(){if(!this.canProduceAudio)return null;var e=this.getState(),t=e.tooltipLabel,i=e.label,n=e.icon,s=e.classList,r=e.showWarning,a=e.disable;return(0,o.h)(o.H,{title:i},(0,o.h)("dyte-tooltip",{kind:"block",label:t,part:"tooltip",iconPack:this.iconPack,t:this.t},(0,o.h)("dyte-controlbar-button",{part:"controlbar-button",icon:n,label:i,size:this.size,iconPack:this.iconPack,t:this.t,variant:this.variant,class:s,onClick:this.toggleMic,showWarning:r,disabled:a})))}}],[{key:"watchers",get:function(){return{meeting:["meetingChanged"]}}}]),e}();d.style=":host{line-height:initial;font-family:var(--dyte-font-family, sans-serif);display:block}:host(.audioDisabled) :slotted(dyte-icon){--tw-text-opacity:1;color:rgba(var(--dyte-colors-danger, 255 45 45) / var(--tw-text-opacity))}"},2274:function(e,t,i){i.d(t,{o:function(){return l},s:function(){return c}});var n=i(7762),s=i(2304),o=function(e){return!("isConnected"in e)||e.isConnected},r=function(e,t){var i;return function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];i&&clearTimeout(i),i=setTimeout((function(){i=0,e.apply(void 0,s)}),t)}}((function(e){var t,i=(0,n.Z)(e.keys());try{for(i.s();!(t=i.n()).done;){var s=t.value;e.set(s,e.get(s).filter(o))}}catch(r){i.e(r)}finally{i.f()}}),2e3),a=function(e){return"function"===typeof e?e():e},u=function(e,t){var i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.length--)},d=function(e,t){var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return e!==t},i=a(e),n=new Map(Object.entries(null!==i&&void 0!==i?i:{})),s={dispose:[],get:[],set:[],reset:[]},o=function(){var t;n=new Map(Object.entries(null!==(t=a(e))&&void 0!==t?t:{})),s.reset.forEach((function(e){return e()}))},r=function(e){return s.get.forEach((function(t){return t(e)})),n.get(e)},d=function(e,i){var o=n.get(e);t(i,o,e)&&(n.set(e,i),s.set.forEach((function(t){return t(e,i,o)})))},c="undefined"===typeof Proxy?{}:new Proxy(i,{get:function(e,t){return r(t)},ownKeys:function(e){return Array.from(n.keys())},getOwnPropertyDescriptor:function(){return{enumerable:!0,configurable:!0}},has:function(e,t){return n.has(t)},set:function(e,t,i){return d(t,i),!0}}),l=function(e,t){return s[e].push(t),function(){u(s[e],t)}};return{state:c,get:r,set:d,on:l,onChange:function(t,i){var n=l("set",(function(e,n){e===t&&i(n)})),s=l("reset",(function(){return i(a(e)[t])}));return function(){n(),s()}},use:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var n=t.reduce((function(e,t){return t.set&&e.push(l("set",t.set)),t.get&&e.push(l("get",t.get)),t.reset&&e.push(l("reset",t.reset)),t.dispose&&e.push(l("dispose",t.dispose)),e}),[]);
1return function(){return n.forEach((function(e){return e()}))}},dispose:function(){s.dispose.forEach((function(e){return e()})),o()},reset:o,forceUpdate:function(e){var t=n.get(e);s.set.forEach((function(i){return i(e,t,t)}))}}}(e,t);return i.use(function(){if("function"!==typeof s.a)return{};var e=new Map;return{dispose:function(){return e.clear()},get:function(t){var i=(0,s.a)();i&&function(e,t,i){var n=e.get(t);n?n.includes(i)||n.push(i):e.set(t,[i])}(e,t,i)},set:function(t){var i=e.get(t);i&&e.set(t,i.filter(s.f)),r(e)},reset:function(){e.forEach((function(e){return e.forEach(s.f)})),r(e)}}}()),i}({}),c=d.state,l=d.onChange}}]); 2//# sourceMappingURL=9546.0482194a.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.