"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../node_modules/tslib/tslib.es6.js"),n=require("../node_modules/@rematch/core/dist/core.esm.js");require("react");var i=require("../utils/genericFunctions/eventDispatch.js");require("../store/index.js");var t={view:null,isOpen:!0,actionsExpanded:!1,startPosition:{x:0,y:0},inputOutputOpened:!1,settingsView:"main",contactListView:"main",sideViewIsVisible:!1,transcriptionViewIsVisible:!1,isConferenceList:!1,previousView:null,avoidToShow:!1,isFullScreen:!1,isFromStreaming:!1,isExtraLarge:!1,urlOpened:!1,previewCallFromMobileOrNethlink:!1,forceReload:!1,operatorBusy:{isActive:!1,calledNumber:null,callerNumber:null}},r=n.createModel()({state:t,reducers:{setIslandView:function(n,i){return i===(null==n?void 0:n.view)?n:e.__assign(e.__assign({},n),{view:i,previousView:null==n?void 0:n.view})},toggleIsOpen:function(n,i){return e.__assign(e.__assign({},n),{isOpen:i})},toggleActionsExpanded:function(e,n){return e.actionsExpanded=n,e},toggleInputOutputOpened:function(e,n){return e.inputOutputOpened=n,e},setSettingsView:function(e,n){e.settingsView=n},setContactListView:function(e,n){e.contactListView=n},toggleSideViewVisible:function(e,n){e.sideViewIsVisible=n},toggleTranscriptionViewVisible:function(e,n){e.transcriptionViewIsVisible=n},toggleConferenceList:function(e,n){e.isConferenceList=n},toggleAvoidToShow:function(e,n){e.avoidToShow=n},setUrlOpened:function(e,n){return e.urlOpened=n,e},setPreviewCallFromMobileOrNethlink:function(e,n){return e.previewCallFromMobileOrNethlink=n,e},setForceReload:function(e,n){return e.forceReload=n,e},resetSettingsView:function(e){e.settingsView="main"},setFullScreen:function(n,i){return e.__assign(e.__assign({},n),{isFullScreen:i})},setIsFromStreaming:function(n,i){return e.__assign(e.__assign({},n),{isFromStreaming:i})},setExtraLarge:function(n,i){return e.__assign(e.__assign({},n),{isExtraLarge:i})},resetPlayerClose:function(e){return s(e,!1)},resetIslandStore:function(e){return s(e,!0)},_resetIslandStoreInternal:function(e){return s(e,!0)},_resetPlayerCloseInternal:function(e){return s(e,!1)},setOperatorBusyCalledNumber:function(e,n){return e.operatorBusy.calledNumber=n,e},setOperatorBusyActive:function(e,n){return e.operatorBusy.isActive=!0,e.operatorBusy.callerNumber=n.callerNumber,e},resetOperatorBusy:function(e){return e.operatorBusy.isActive=!1,e.operatorBusy.callerNumber=null,e},resetOperatorBusyCompletely:function(e){return e.operatorBusy.isActive=!1,e.operatorBusy.calledNumber=null,e.operatorBusy.callerNumber=null,e}},effects:function(e){return{handleToggleIsOpen:function(n,t){t.island.isOpen&&t.alerts.status.activeAlertsCount>0&&!t.currentCall.displayName?(i.eventDispatch("phone-island-expanded",{}),e.island.toggleIsOpen(!0)):(i.eventDispatch("phone-island-"+(t.island.isOpen?"compressed":"expanded"),{}),t.island.isOpen&&(i.eventDispatch("phone-island-sideview-close",{}),i.eventDispatch("phone-island-transcription-close",{})),e.island.toggleIsOpen(!t.island.isOpen))},handleResetIslandStore:function(){e.island._resetIslandStoreInternal(),i.eventDispatch("phone-island-transcription-close",{})},handleResetPlayerClose:function(){e.island._resetPlayerCloseInternal(),i.eventDispatch("phone-island-transcription-close",{})}}}});function s(n,i){var r=n.startPosition,s=["waitingConference"];i&&s.push("recorder");var o=s.includes(n.view)?n.view:t.view,l=n.avoidToShow;return e.__assign(e.__assign({},t),{startPosition:r,view:o,avoidToShow:l,isFromStreaming:!1,previewCallFromMobileOrNethlink:!1,forceReload:!1,previousView:"waitingConference"===n.view?n.previousView:t.previousView,operatorBusy:{isActive:!1,calledNumber:n.operatorBusy.calledNumber,callerNumber:null}})}exports.island=r;
//# sourceMappingURL=island.js.map
