,(0,v.gn)([R.LO],I.prototype,"voiceSearchSubmitCallback",void 0),(0,v.gn)([R.LO],I.prototype,"displayedText",void 0),(0,v.gn)([R.LO],I.prototype,"searchText",void 0),(0,v.gn)([R.LO],I.prototype,"recordingState",void 0);var O=r(39181),w=r(13988);const T=O.d`
<div class="voiceSearchBlockedDialog" >
    <div class="voiceSearchBlockedDialogTitle" >
        ${e=>e.strings.micBlockedDialogTitle}
    </div>
    <div class="voiceSearchBlockedDialogBody" >
        ${e=>e.strings.micBlockedDialogBody}
    </div>
    <div>
        <svg
            class="voiceSearchBlockedDialogIcon"
            xmlns="http://www.w3.org/2000/svg"
            viewBox="0 0 2048 2048"
            width="24"
            height="24">
        >
            <path d="M704 1536q-40 0-75-15t-61-41-41-61-15-75V192q0-40 15-75t41-61 61-41 75-15h512q40 0 75 15t61 41 41 61 15 75v834q-34 11-66 25t-62 34V192q0-26-19-45t-45-19H704q-26 0-45 19t-19 45v1152q0 26 19 45t45 19h320v128H704zm896-384q93 0 174 35t143 96 96 142 35 175q0 93-35 174t-96 143-142 96-175 35q-93 0-174-35t-143-96-96-142-35-175q0-93 35-174t96-143 142-96 175-35zm0 768q66 0 124-25t101-68 69-102 26-125q0-66-25-124t-69-101-102-69-124-26q-66 0-124 25t-102 69-69 102-25 124q0 66 25 124t68 102 102 69 125 25zm-515 0q45 71 107 128H640v-128h256v-128H662q-84 0-158-32t-129-87-87-129-32-158v-362h128v362q0 57 22 108t59 88 89 60 108 22h362v256h61zm699-424l-105 104 105 104-80 80-104-105-104 105-80-80 105-104-105-104 80-80 104 105 104-105 80 80z"></path>
        </svg>
        <div class="voiceSearchBlockedDialogGuide" >
            ${e=>e.strings.micBlockedDialogGuide}
        </div>
    </div>
    <button
        type="button"
        title=${e=>e.strings.micBlockedDialogButton}
        class="voiceSearchBlockedDialogDismissButton"
        @click=${e=>e.voiceSearchCancelCallback()}
    >
        ${e=>e.strings.micBlockedDialogButton}
    </button>
</div>
`,E=O.d`
<div
    class="voiceSearchOverlay ${e=>D(e)}" @click=${e=>e.voiceSearchCancelCallback()}>
</div>
`,_=O.d`
<button type="button" class="voiceSearchSubmitButton"
    @click=${e=>e.searchText?e.voiceSearchSubmitCallback(e.searchText):e.voiceSearchCancelCallback()}
    data-t="${e=>e.searchText?e.submitButtonTelemetryTag:e.cancelTelemetryTag}">
    <svg width="90" height="90" viewBox="0 0 90 90" fill="none" xmlns="http://www.w3.org/2000/svg" class="voiceSearchIcon">
        <path
            class=${e=>e.recordingState!==u.Finished?"voiceSearchIconBorder voiceSearchIconBorderAnimate":"voiceSearchIconBorder"}
            d="M45 81.5C65.1584 81.5 81.5 65.1584 81.5 45C81.5 24.8416 65.1584 8.5 45 8.5C24.8416 8.5 8.5 24.8416 8.5 45C8.5 65.1584 24.8416 81.5 45 81.5Z"/>
        <circle cx="45" cy="45" r="32.5" fill="#4377D0"/>
        <path d="M46 26.5C41.8579 26.5 38.5 29.8579 38.5 34V44C38.5 48.1421 41.8579 51.5 46 51.5C50.1421 51.5 53.5 48.1421 53.5 44V34C53.5 29.8579 50.1421 26.5 46 26.5ZM51 44C51 46.7614 48.7614 49 46 49C43.2386 49 41 46.7614 41 44V34C41 31.2386 43.2386 29 46 29C48.7614 29 51 31.2386 51 34V44ZM34.75 42.75C35.4404 42.75 36 43.3096 36 44C36 49.5228 40.4772 54 46 54C51.5228 54 56 49.5228 56 44C56 43.3096 56.5596 42.75 57.25 42.75C57.9404 42.75 58.5 43.3096 58.5 44C58.5 50.4822 53.5659 55.812 47.2485 56.4384C47.2495 56.4588 47.25 56.4794 47.25 56.5V60.25C47.25 60.9404 46.6904 61.5 46 61.5C45.3096 61.5 44.75 60.9404 44.75 60.25V56.5C44.75 56.4794 44.7505 56.4588 44.7515 56.4384C38.4341 55.812 33.5 50.4822 33.5 44C33.5 43.3096 34.0596 42.75 34.75 42.75Z" fill="white"/>
    </svg>
</button>
`,A=O.d`
<div class="voiceSearchDialog">
    <div class="voiceSearchStatusIconContainer">
        <div class="voiceSearchStatus">
            ${e=>e.displayedText}
        </div>
        ${e=>_}
    </div>
</div>
`,M=O.d`
${(0,w.g)((e=>e.openDialog&&e.isMicrophoneBlocked===p.Listening),A)}
${(0,w.g)((e=>e.openDialog&&e.isMicrophoneBlocked===p.Blocked),T)}
${(0,w.g)((e=>e.openDialog),E)}
`,D=e=>{if(e.config.enableSearchBoxOverlay)switch(e.config.searchBoxOverlayOpacity){case"0.2":return"overlayOpacity20";case"0.4":return"overlayOpacity40";case"0.6":return"overlayOpacity60";default:return""}return""};var j=r(53046),k=r(40082);const N=j.i`
.voiceSearchDialog {
    top: 0;
    left: 0;
    width: 100%;
    z-index: 901;
    height: 195px;
    background: #fff;
    position: absolute;
    border-radius: 4px;
    box-shadow: 0px 1.6px 3.6px rgba(0, 0, 0, 0.13), 0px 0px 2.9px rgba(0, 0, 0, 0.11);
}

.voiceSearchStatusIconContainer {
    left: 0;
    top: 65px;
    height: 65px;
    margin: 0 40px;
    position: relative;
}

.voiceSearchSubmitButton {
    top: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    border: none;
    cursor: pointer;
    background: none;
    position: absolute;
}

.voiceSearchSubmitButton:hover {
    transform: translate3d(0, 0, 0) scale(1.2);
}

.voiceSearchIcon {
    height: 65px;
    width: 65px;
}

@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(.8);
    }
    100% {
        opacity: 0.698033;
        transform: scale(1);
    }
}

.voiceSearchIconBorder {
    stroke: #DEECF9;
    stroke-width: 17;
    opacity: 0.698033; 
    transform: scale(.8);
    transform-origin: center;
}

.voiceSearchIconBorderAnimate {
    transition: all .5s;
    animation: pulse .5s alternate infinite;
}

.voiceSearchStatus {
    top: 50%;
    display: flex;
    font-size: 20px;
    overflow: hidden;
    max-height: 84px;
    font-weight: 500;
    line-height: 28px;
    position: absolute;
    width: calc(100% - 90px);
    transform: translateY(-50%);
    flex-direction: column-reverse;
}

.voiceSearchOverlay {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    position: fixed;
    background: rgba(0, 0, 0, 0.4);
}

.voiceSearchBlockedDialog {
    top: 15px;
    right: 15px;
    width: 250px;
    z-index: 901;
    height: 200px;
    padding: 15px;
    position: fixed;
    background: #fff;
    border-radius: 4px;
}

.voiceSearchBlockedDialogTitle {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: initial;
}

.voiceSearchBlockedDialogBody {
    font-size: 13px;
    margin-bottom: 20px;
    line-height: initial;
}

.voiceSearchBlockedDialogIcon {
    float: left;
    fill: undefined;
}

.voiceSearchBlockedDialogGuide {
    float: right;
    width: 220px;
    font-size: 13px;
    line-height: initial;
}

.voiceSearchBlockedDialogDismissButton {
    right: 20px;
    color: #fff;
    width: 100px;
    bottom: 20px;
    height: 30px;
    position: absolute;
    background: #0078D4;
    border-color: #0078D4;
}

.overlayOpacity20 {
    background: rgba(0, 0, 0, 0.2);
}

.overlayOpacity40 {
    background: rgba(0, 0, 0, 0.4);
}

.overlayOpacity60 {
    background: rgba(0, 0, 0, 0.6);
}

`.withBehaviors((0,k.Uu)(j.i`
                .voiceSearchDialog {
                    background: #4a4a4a;
                }

                .voiceSearchBlockedDialog {
                    background: #242424;
                }

                .voiceSearchBlockedDialogIcon {
                    fill: #fff;
                }
            `)),z={experienceConfigSchema:c}},55485:function(){!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){window.SpeechSDK=r(1)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(2),r(4);!function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(30))},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(3)),n(r(23)),n(r(155)),n(r(156)),n(r(157)),n(r(158)),n(r(168)),n(r(169)),n(r(170))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=function(e){var t=this;void 0===e&&(e=n.EventType.Warning),this.onEvent=function(e){if(e.eventType>=t.privLogLevelFilter){var r=t.toString(e);switch(e.eventType){case n.EventType.Debug:console.debug(r);break;case n.EventType.Info:console.info(r);break;case n.EventType.Warning:console.warn(r);break;case n.EventType.Error:console.error(r);break;default:console.log(r)}}},this.toString=function(e){var t=[""+e.EventTime,""+e.Name];for(var r in e)if(r&&e.hasOwnProperty(r)&&"eventTime"!==r&&"eventType"!==r&&"eventId"!==r&&"name"!==r&&"constructor"!==r){var n=e[r],i="<NULL>";null!=n&&(i="number"==typeof n||"string"==typeof n?n.toString():JSON.stringify(n)),t.push(r+": "+i)}return t.join(" | ")},this.privLogLevelFilter=e};t.ConsoleLoggingListener=i},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(5)),n(r(8)),n(r(9)),n(r(11)),n(r(10)),n(r(12)),n(r(13)),n(r(7)),n(r(14)),n(r(15)),n(r(6)),n(r(16)),n(r(17)),n(r(18)),n(r(19)),n(r(20));var i=r(21);t.TranslationStatus=i.TranslationStatus,n(r(22))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),s=function(e){function t(t,r,n){void 0===n&&(n=o.EventType.Info);var i=e.call(this,t,n)||this;return i.privAudioSourceId=r,i}return i(t,e),Object.defineProperty(t.prototype,"audioSourceId",{get:function(){return this.privAudioSourceId},enumerable:!0,configurable:!0}),t}(o.PlatformEvent);t.AudioSourceEvent=s;var a=function(e){function t(t){return e.call(this,"AudioSourceInitializingEvent",t)||this}return i(t,e),t}(s);t.AudioSourceInitializingEvent=a;var c=function(e){function t(t){return e.call(this,"AudioSourceReadyEvent",t)||this}return i(t,e),t}(s);t.AudioSourceReadyEvent=c;var p=function(e){function t(t){return e.call(this,"AudioSourceOffEvent",t)||this}return i(t,e),t}(s);t.AudioSourceOffEvent=p;var u=function(e){function t(t,r){var n=e.call(this,"AudioSourceErrorEvent",t,o.EventType.Error)||this;return n.privError=r,n}return i(t,e),Object.defineProperty(t.prototype,"error",{get:function(){return this.privError},enumerable:!0,configurable:!0}),t}(s);t.AudioSourceErrorEvent=u;var v=function(e){function t(t,r,n){var i=e.call(this,t,r)||this;return i.privAudioNodeId=n,i}return i(t,e),Object.defineProperty(t.prototype,"audioNodeId",{get:function(){return this.privAudioNodeId},enumerable:!0,configurable:!0}),t}(s);t.AudioStreamNodeEvent=v;var h=function(e){function t(t,r){return e.call(this,"AudioStreamNodeAttachingEvent",t,r)||this}return i(t,e),t}(v);t.AudioStreamNodeAttachingEvent=h;var l=function(e){function t(t,r){return e.call(this,"AudioStreamNodeAttachedEvent",t,r)||this}return i(t,e),t}(v);t.AudioStreamNodeAttachedEvent=l;var f=function(e){function t(t,r){return e.call(this,"AudioStreamNodeDetachedEvent",t,r)||this}return i(t,e),t}(v);t.AudioStreamNodeDetachedEvent=f;var d=function(e){function t(t,r,n){var i=e.call(this,"AudioStreamNodeErrorEvent",t,r)||this;return i.privError=n,i}return i(t,e),Object.defineProperty(t.prototype,"error",{get:function(){return this.privError},enumerable:!0,configurable:!0}),t}(v);t.AudioStreamNodeErrorEvent=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7);!function(e){e[e.Debug=0]="Debug",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(t.EventType||(t.EventType={}));var i=function(){function e(e,t){this.privName=e,this.privEventId=n.createNoDashGuid(),this.privEventTime=(new Date).toISOString(),this.privEventType=t,this.privMetadata={}}return Object.defineProperty(e.prototype,"name",{get:function(){return this.privName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventId",{get:function(){return this.privEventId},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventTime",{get:function(){return this.privEventTime},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"eventType",{get:function(){return this.privEventType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"metadata",{get:function(){return this.privMetadata},enumerable:!0,configurable:!0}),e}();t.PlatformEvent=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var r=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?r:3&r|8).toString(16)}))};t.createGuid=n;t.createNoDashGuid=function(){return n().replace(new RegExp("-","g"),"").toUpperCase()}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(6),s=function(e){function t(t,r,n){void 0===n&&(n=o.EventType.Info);var i=e.call(this,t,n)||this;return i.privJsonResult=r,i}return i(t,e),Object.defineProperty(t.prototype,"jsonString",{get:function(){return this.privJsonResult},enumerable:!0,configurable:!0}),t}(o.PlatformEvent);t.ServiceEvent=s;var a=function(e){function t(t,r,n){void 0===n&&(n=o.EventType.Info);var i=e.call(this,t,n)||this;return i.privConnectionId=r,i}return i(t,e),Object.defineProperty(t.prototype,"connectionId",{get:function(){return this.privConnectionId},enumerable:!0,configurable:!0}),t}(o.PlatformEvent);t.ConnectionEvent=a;var c=function(e){function t(t,r,n){var i=e.call(this,"ConnectionStartEvent",t)||this;return i.privUri=r,i.privHeaders=n,i}return i(t,e),Object.defineProperty(t.prototype,"uri",{get:function(){return this.privUri},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"headers",{get:function(){return this.privHeaders},enumerable:!0,configurable:!0}),t}(a);t.ConnectionStartEvent=c;var p=function(e){function t(t,r){return e.call(this,"ConnectionEstablishedEvent",t)||this}return i(t,e),t}(a);t.ConnectionEstablishedEvent=p;var u=function(e){function t(t,r,n){var i=e.call(this,"ConnectionClosedEvent",t,o.EventType.Debug)||this;return i.privRreason=n,i.privStatusCode=r,i}return i(t,e),Object.defineProperty(t.prototype,"reason",{get:function(){return this.privRreason},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusCode",{get:function(){return this.privStatusCode},enumerable:!0,configurable:!0}),t}(a);t.ConnectionClosedEvent=u;var v=function(e){function t(t,r,n){var i=e.call(this,"ConnectionErrorEvent",t,o.EventType.Debug)||this;return i.privMessage=r,i.privType=n,i}return i(t,e),Object.defineProperty(t.prototype,"message",{get:function(){return this.privMessage},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.privType},enumerable:!0,configurable:!0}),t}(a);t.ConnectionErrorEvent=v;var h=function(e){function t(t,r,n){var i=e.call(this,"ConnectionEstablishErrorEvent",t,o.EventType.Error)||this;return i.privStatusCode=r,i.privReason=n,i}return i(t,e),Object.defineProperty(t.prototype,"reason",{get:function(){return this.privReason},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusCode",{get:function(){return this.privStatusCode},enumerable:!0,configurable:!0}),t}(a);t.ConnectionEstablishErrorEvent=h;var l=function(e){function t(t,r,n){var i=e.call(this,"ConnectionMessageReceivedEvent",t)||this;return i.privNetworkReceivedTime=r,i.privMessage=n,i}return i(t,e),Object.defineProperty(t.prototype,"networkReceivedTime",{get:function(){return this.privNetworkReceivedTime},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.privMessage},enumerable:!0,configurable:!0}),t}(a);t.ConnectionMessageReceivedEvent=l;var f=function(e){function t(t,r,n){var i=e.call(this,"ConnectionMessageSentEvent",t)||this;return i.privNetworkSentTime=r,i.privMessage=n,i}return i(t,e),Object.defineProperty(t.prototype,"networkSentTime",{get:function(){return this.privNetworkSentTime},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"message",{get:function(){return this.privMessage},enumerable:!0,configurable:!0}),t}(a);t.ConnectionMessageSentEvent=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(10),o=r(7);!function(e){e[e.Text=0]="Text",e[e.Binary=1]="Binary"}(n=t.MessageType||(t.MessageType={}));var s=function(){function e(e,t,r,s){if(this.privBody=null,e===n.Text&&t&&"string"!=typeof t)throw new i.InvalidOperationError("Payload must be a string");if(e===n.Binary&&t&&!(t instanceof ArrayBuffer))throw new i.InvalidOperationError("Payload must be ArrayBuffer");switch(this.privMessageType=e,this.privBody=t,this.privHeaders=r||{},this.privId=s||o.createNoDashGuid(),this.messageType){case n.Binary:this.privSize=null!==this.binaryBody?this.binaryBody.byteLength:0;break;case n.Text:this.privSize=this.textBody.length}}return Object.defineProperty(e.prototype,"messageType",{get:function(){return this.privMessageType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headers",{get:function(){return this.privHeaders},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return this.privBody},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textBody",{get:function(){if(this.privMessageType===n.Binary)throw new i.InvalidOperationError("Not supported for binary message");return this.privBody},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryBody",{get:function(){if(this.privMessageType===n.Text)throw new i.InvalidOperationError("Not supported for text message");return this.privBody},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privId},enumerable:!0,configurable:!0}),e}();t.ConnectionMessage=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t){var r=e.call(this,t)||this;return r.name="ArgumentNull",r.message=t,r}return i(t,e),t}(Error);t.ArgumentNullError=o;var s=function(e){function t(t){var r=e.call(this,t)||this;return r.name="InvalidOperation",r.message=t,r}return i(t,e),t}(Error);t.InvalidOperationError=s;var a=function(e){function t(t,r){var n=e.call(this,r)||this;return n.name=t+"ObjectDisposed",n.message=r,n}return i(t,e),t}(Error);t.ObjectDisposedError=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.privStatusCode=e,this.privReason=t}return Object.defineProperty(e.prototype,"statusCode",{get:function(){return this.privStatusCode},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reason",{get:function(){return this.privReason},enumerable:!0,configurable:!0}),e}();t.ConnectionOpenResponse=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(10),i=r(13),o=function(){function e(){}return Object.defineProperty(e,"instance",{get:function(){return e.privInstance},enumerable:!0,configurable:!0}),e.privInstance=new i.EventSource,e.setEventSource=function(t){if(!t)throw new n.ArgumentNullError("eventSource");e.privInstance=t},e}();t.Events=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(10),i=r(7),o=function(){function e(e){var t=this;this.privEventListeners={},this.privIsDisposed=!1,this.onEvent=function(e){if(t.isDisposed())throw new n.ObjectDisposedError("EventSource");if(t.metadata)for(var r in t.metadata)r&&e.metadata&&(e.metadata[r]||(e.metadata[r]=t.metadata[r]));for(var i in t.privEventListeners)i&&t.privEventListeners[i]&&t.privEventListeners[i](e)},this.attach=function(e){var r=i.createNoDashGuid();return t.privEventListeners[r]=e,{detach:function(){delete t.privEventListeners[r]}}},this.attachListener=function(e){return t.attach(e.onEvent)},this.isDisposed=function(){return t.privIsDisposed},this.dispose=function(){t.privEventListeners=null,t.privIsDisposed=!0},this.privMetadata=e}return Object.defineProperty(e.prototype,"metadata",{get:function(){return this.privMetadata},enumerable:!0,configurable:!0}),e}();t.EventSource=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.None=0]="None",e[e.Connected=1]="Connected",e[e.Connecting=2]="Connecting",e[e.Disconnected=3]="Disconnected"}(t.ConnectionState||(t.ConnectionState={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(10),i=function e(t){var r=this;if(this.privSubscriptionIdCounter=0,this.privAddSubscriptions={},this.privRemoveSubscriptions={},this.privDisposedSubscriptions={},this.privDisposeReason=null,this.get=function(e){return r.throwIfDisposed(),r.privList[e]},this.first=function(){return r.get(0)},this.last=function(){return r.get(r.length()-1)},this.add=function(e){r.throwIfDisposed(),r.insertAt(r.privList.length,e)},this.insertAt=function(e,t){r.throwIfDisposed(),0===e?r.privList.unshift(t):e===r.privList.length?r.privList.push(t):r.privList.splice(e,0,t),r.triggerSubscriptions(r.privAddSubscriptions)},this.removeFirst=function(){return r.throwIfDisposed(),r.removeAt(0)},this.removeLast=function(){return r.throwIfDisposed(),r.removeAt(r.length()-1)},this.removeAt=function(e){return r.throwIfDisposed(),r.remove(e,1)[0]},this.remove=function(e,t){r.throwIfDisposed();var n=r.privList.splice(e,t);return r.triggerSubscriptions(r.privRemoveSubscriptions),n},this.clear=function(){r.throwIfDisposed(),r.remove(0,r.length())},this.length=function(){return r.throwIfDisposed(),r.privList.length},this.onAdded=function(e){r.throwIfDisposed();var t=r.privSubscriptionIdCounter++;return r.privAddSubscriptions[t]=e,{detach:function(){delete r.privAddSubscriptions[t]}}},this.onRemoved=function(e){r.throwIfDisposed();var t=r.privSubscriptionIdCounter++;return r.privRemoveSubscriptions[t]=e,{detach:function(){delete r.privRemoveSubscriptions[t]}}},this.onDisposed=function(e){r.throwIfDisposed();var t=r.privSubscriptionIdCounter++;return r.privDisposedSubscriptions[t]=e,{detach:function(){delete r.privDisposedSubscriptions[t]}}},this.join=function(e){return r.throwIfDisposed(),r.privList.join(e)},this.toArray=function(){var e=[];return r.privList.forEach((function(t){e.push(t)})),e},this.any=function(e){return r.throwIfDisposed(),e?r.where(e).length()>0:r.length()>0},this.all=function(e){return r.throwIfDisposed(),r.where(e).length()===r.length()},this.forEach=function(e){r.throwIfDisposed();for(var t=0;t<r.length();t++)e(r.privList[t],t)},this.select=function(t){r.throwIfDisposed();for(var n=[],i=0;i<r.privList.length;i++)n.push(t(r.privList[i],i));return new e(n)},this.where=function(t){r.throwIfDisposed();for(var n=new e,i=0;i<r.privList.length;i++)t(r.privList[i],i)&&n.add(r.privList[i]);return n},this.orderBy=function(t){return r.throwIfDisposed(),new e(r.toArray().sort(t))},this.orderByDesc=function(e){return r.throwIfDisposed(),r.orderBy((function(t,r){return e(r,t)}))},this.clone=function(){return r.throwIfDisposed(),new e(r.toArray())},this.concat=function(t){return r.throwIfDisposed(),new e(r.privList.concat(t.toArray()))},this.concatArray=function(t){return r.throwIfDisposed(),new e(r.privList.concat(t))},this.isDisposed=function(){return null==r.privList},this.dispose=function(e){r.isDisposed()||(r.privDisposeReason=e,r.privList=null,r.privAddSubscriptions=null,r.privRemoveSubscriptions=null,r.triggerSubscriptions(r.privDisposedSubscriptions))},this.throwIfDisposed=function(){if(r.isDisposed())throw new n.ObjectDisposedError("List",r.privDisposeReason)},this.triggerSubscriptions=function(e){if(e)for(var t in e)t&&e[t]()},this.privList=[],t)for(var i=0,o=t;i<o.length;i++){var s=o[i];this.privList.push(s)}};t.List=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(10);!function(e){e[e.None=0]="None",e[e.Resolved=1]="Resolved",e[e.Rejected=2]="Rejected"}(n=t.PromiseState||(t.PromiseState={}));var o=function(){function e(e){var t=this;this.throwIfError=function(){if(t.isError)throw t.error},e.on((function(e){t.privIsCompleted||(t.privIsCompleted=!0,t.privIsError=!1,t.privResult=e)}),(function(e){t.privIsCompleted||(t.privIsCompleted=!0,t.privIsError=!0,t.privError=e)}))}return Object.defineProperty(e.prototype,"isCompleted",{get:function(){return this.privIsCompleted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isError",{get:function(){return this.privIsError},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){return this.privError},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"result",{get:function(){return this.privResult},enumerable:!0,configurable:!0}),e}();t.PromiseResult=o;var s=function(){var e=this;this.setResult=function(t){e.privOnSetResult(t)},this.setError=function(t){e.privOnSetError(t)},this.on=function(t,r){e.privOnSetResult=t,e.privOnSetError=r}};t.PromiseResultEventSource=s;var a=function(){function e(){}return e.whenAll=function(e){if(!e||0===e.length)throw new i.ArgumentNullError("promises");for(var t=new p,r=[],n=0,o=function(){++n===e.length&&(0===r.length?t.resolve(!0):t.reject(r.join(", ")))},s=0,a=e;s<a.length;s++){a[s].on((function(e){o()}),(function(e){r.push(e),o()}))}return t.promise()},e.fromResult=function(e){var t=new p;return t.resolve(e),t.promise()},e.fromError=function(e){var t=new p;return t.reject(e),t.promise()},e}();t.PromiseHelper=a;var c=function(e){var t=this;this.result=function(){return t.privSink.result},this.continueWith=function(e){if(!e)throw new i.ArgumentNullError("continuationCallback");var r=new p;return t.privSink.on((function(n){try{var i=e(t.privSink.result);r.resolve(i)}catch(e){r.reject(e)}}),(function(n){try{var i=e(t.privSink.result);r.resolve(i)}catch(e){r.reject("'Error handler for error "+n+" threw error "+e+"'")}})),r.promise()},this.onSuccessContinueWith=function(e){if(!e)throw new i.ArgumentNullError("continuationCallback");var r=new p;return t.privSink.on((function(t){try{var n=e(t);r.resolve(n)}catch(e){r.reject(e)}}),(function(e){r.reject(e)})),r.promise()},this.continueWithPromise=function(e){if(!e)throw new i.ArgumentNullError("continuationCallback");var r=new p;return t.privSink.on((function(n){try{var i=e(t.privSink.result);if(!i)throw new Error("'Continuation callback did not return promise'");i.on((function(e){r.resolve(e)}),(function(e){r.reject(e)}))}catch(e){r.reject(e)}}),(function(n){try{var i=e(t.privSink.result);if(!i)throw new Error("Continuation callback did not return promise");i.on((function(e){r.resolve(e)}),(function(e){r.reject(e)}))}catch(e){r.reject("'Error handler for error "+n+" threw error "+e+"'")}})),r.promise()},this.onSuccessContinueWithPromise=function(e){if(!e)throw new i.ArgumentNullError("continuationCallback");var r=new p;return t.privSink.on((function(t){try{var n=e(t);if(!n)throw new Error("Continuation callback did not return promise");n.on((function(e){r.resolve(e)}),(function(e){r.reject(e)}))}catch(e){r.reject(e)}}),(function(e){r.reject(e)})),r.promise()},this.on=function(e,r){if(!e)throw new i.ArgumentNullError("successCallback");if(!r)throw new i.ArgumentNullError("errorCallback");return t.privSink.on(e,r),t},this.finally=function(e){if(!e)throw new i.ArgumentNullError("callback");var r=function(t){e()};return t.on(r,r)},this.privSink=e};t.Promise=c;var p=function(){var e=this;this.state=function(){return e.privSink.state},this.promise=function(){return e.privPromise},this.resolve=function(t){return e.privSink.resolve(t),e},this.reject=function(t){return e.privSink.reject(t),e},this.privSink=new u,this.privPromise=new c(this.privSink)};t.Deferred=p;var u=function(){function e(){var e=this;this.privState=n.None,this.privPromiseResult=null,this.privPromiseResultEvents=null,this.privSuccessHandlers=[],this.privErrorHandlers=[],this.resolve=function(t){if(e.privState!==n.None)throw new Error("'Cannot resolve a completed promise'");e.privState=n.Resolved,e.privPromiseResultEvents.setResult(t);for(var r=0;r<e.privSuccessHandlers.length;r++)e.executeSuccessCallback(t,e.privSuccessHandlers[r],e.privErrorHandlers[r]);e.detachHandlers()},this.reject=function(t){if(e.privState!==n.None)throw new Error("'Cannot reject a completed promise'");e.privState=n.Rejected,e.privPromiseResultEvents.setError(t);for(var r=0,i=e.privErrorHandlers;r<i.length;r++){var o=i[r];e.executeErrorCallback(t,o)}e.detachHandlers()},this.on=function(t,r){null==t&&(t=function(e){}),e.privState===n.None?(e.privSuccessHandlers.push(t),e.privErrorHandlers.push(r)):(e.privState===n.Resolved?e.executeSuccessCallback(e.privPromiseResult.result,t,r):e.privState===n.Rejected&&e.executeErrorCallback(e.privPromiseResult.error,r),e.detachHandlers())},this.executeSuccessCallback=function(t,r,n){try{r(t)}catch(t){e.executeErrorCallback("'Unhandled callback error: "+t+"'",n)}},this.executeErrorCallback=function(e,t){if(!t)throw new Error("'Unhandled error: "+e+"'");try{t(e)}catch(t){throw new Error("'Unhandled callback error: "+t+". InnerError: "+e+"'")}},this.detachHandlers=function(){e.privErrorHandlers=[],e.privSuccessHandlers=[]},this.privPromiseResultEvents=new s,this.privPromiseResult=new o(this.privPromiseResultEvents)}return Object.defineProperty(e.prototype,"state",{get:function(){return this.privState},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"result",{get:function(){return this.privPromiseResult},enumerable:!0,configurable:!0}),e}();t.Sink=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(10),o=r(15),s=r(16);!function(e){e[e.Dequeue=0]="Dequeue",e[e.Peek=1]="Peek"}(n||(n={}));var a=function(e){var t=this;this.privPromiseStore=new o.List,this.privIsDrainInProgress=!1,this.privIsDisposing=!1,this.privDisposeReason=null,this.enqueue=function(e){t.throwIfDispose(),t.enqueueFromPromise(s.PromiseHelper.fromResult(e))},this.enqueueFromPromise=function(e){t.throwIfDispose(),t.privPromiseStore.add(e),e.finally((function(){for(;t.privPromiseStore.length()>0&&t.privPromiseStore.first().result().isCompleted;){var e=t.privPromiseStore.removeFirst();e.result().isError||t.privList.add(e.result().result)}}))},this.dequeue=function(){t.throwIfDispose();var e=new s.Deferred;return t.privSubscribers&&(t.privSubscribers.add({deferral:e,type:n.Dequeue}),t.drain()),e.promise()},this.peek=function(){t.throwIfDispose();var e=new s.Deferred;return t.privSubscribers&&(t.privSubscribers.add({deferral:e,type:n.Peek}),t.drain()),e.promise()},this.length=function(){return t.throwIfDispose(),t.privList.length()},this.isDisposed=function(){return null==t.privSubscribers},this.drainAndDispose=function(e,r){if(!t.isDisposed()&&!t.privIsDisposing){t.privDisposeReason=r,t.privIsDisposing=!0;var n=t.privSubscribers;if(n){for(;n.length()>0;)n.removeFirst().deferral.resolve(void 0);t.privSubscribers===n&&(t.privSubscribers=n)}for(var i=0,o=t.privDetachables;i<o.length;i++)o[i].detach();if(t.privPromiseStore.length()>0&&e)return s.PromiseHelper.whenAll(t.privPromiseStore.toArray()).continueWith((function(){return t.privSubscribers=null,t.privList.forEach((function(t,r){e(t)})),t.privList=null,!0}));t.privSubscribers=null,t.privList=null}return s.PromiseHelper.fromResult(!0)},this.dispose=function(e){t.drainAndDispose(null,e)},this.drain=function(){if(!t.privIsDrainInProgress&&!t.privIsDisposing){t.privIsDrainInProgress=!0;var e=t.privSubscribers,r=t.privList;if(e&&r){for(;r.length()>0&&e.length()>0&&!t.privIsDisposing;){var i=e.removeFirst();if(i.type===n.Peek)i.deferral.resolve(r.first());else{var o=r.removeFirst();i.deferral.resolve(o)}}t.privSubscribers===e&&(t.privSubscribers=e),t.privList===r&&(t.privList=r)}t.privIsDrainInProgress=!1}},this.throwIfDispose=function(){if(t.isDisposed()){if(t.privDisposeReason)throw new i.InvalidOperationError(t.privDisposeReason);throw new i.ObjectDisposedError("Queue")}if(t.privIsDisposing)throw new i.InvalidOperationError("Queue disposing")},this.privList=e||new o.List,this.privDetachables=[],this.privSubscribers=new o.List,this.privDetachables.push(this.privList.onAdded(this.drain))};t.Queue=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(9),i=r(10),o=r(7),s=function(){function e(e,t,r){if(this.privPayload=null,!t)throw new i.ArgumentNullError("payload");if(e===n.MessageType.Binary&&!(t instanceof ArrayBuffer))throw new i.InvalidOperationError("Payload must be ArrayBuffer");if(e===n.MessageType.Text&&"string"!=typeof t)throw new i.InvalidOperationError("Payload must be a string");this.privMessageType=e,this.privPayload=t,this.privId=r||o.createNoDashGuid()}return Object.defineProperty(e.prototype,"messageType",{get:function(){return this.privMessageType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"payload",{get:function(){return this.privPayload},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"textContent",{get:function(){if(this.privMessageType===n.MessageType.Binary)throw new i.InvalidOperationError("Not supported for binary message");return this.privPayload},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryContent",{get:function(){if(this.privMessageType===n.MessageType.Text)throw new i.InvalidOperationError("Not supported for text message");return this.privPayload},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privId},enumerable:!0,configurable:!0}),e}();t.RawWebsocketMessage=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t){var r=this;this.encode=function(e){var t=r.downSampleAudioFrame(e,r.privActualSampleRate,r.privDesiredSampleRate);if(!t)return null;var n=2*t.length,i=new ArrayBuffer(n),o=new DataView(i);return r.floatTo16BitPCM(o,0,t),i},this.setString=function(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))},this.floatTo16BitPCM=function(e,t,r){for(var n=0;n<r.length;n++,t+=2){var i=Math.max(-1,Math.min(1,r[n]));e.setInt16(t,i<0?32768*i:32767*i,!0)}},this.downSampleAudioFrame=function(e,t,r){if(r===t||r>t)return e;for(var n=t/r,i=Math.round(e.length/n),o=new Float32Array(i),s=0,a=0;a<i;){for(var c=Math.round((a+1)*n),p=0,u=0;s<c&&s<e.length;)p+=e[s++],u++;o[a++]=p/u}return o},this.privActualSampleRate=e,this.privDesiredSampleRate=t};t.RiffPcmEncoder=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(10),i=r(7),o=r(17),s=function(){function e(e){var t=this;this.privReaderIdCounter=1,this.privIsEnded=!1,this.getReader=function(){var e=t.privReaderIdCounter;t.privReaderIdCounter++;var r=new o.Queue,n=t.privStreambuffer.length;t.privReaderQueues[e]=r;for(var i=0;i<n;i++)r.enqueue(t.privStreambuffer[i]);return new a(t.privId,r,(function(){delete t.privReaderQueues[e]}))},this.throwIfClosed=function(){if(t.privIsEnded)throw new n.InvalidOperationError("Stream closed")},this.privId=e||i.createNoDashGuid(),this.privStreambuffer=[],this.privReaderQueues={}}return Object.defineProperty(e.prototype,"isClosed",{get:function(){return this.privIsEnded},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.privId},enumerable:!0,configurable:!0}),e.prototype.close=function(){this.privIsEnded||(this.writeStreamChunk({buffer:null,isEnd:!0,timeReceived:Date.now()}),this.privIsEnded=!0)},e.prototype.writeStreamChunk=function(e){for(var t in this.throwIfClosed(),this.privStreambuffer.push(e),this.privReaderQueues)if(!this.privReaderQueues[t].isDisposed())try{this.privReaderQueues[t].enqueue(e)}catch(e){}},e}();t.Stream=s;var a=function(){function e(e,t,r){var i=this;this.privIsClosed=!1,this.read=function(){if(i.isClosed)throw new n.InvalidOperationError("StreamReader closed");return i.privReaderQueue.dequeue().onSuccessContinueWith((function(e){return(void 0===e||e.isEnd)&&i.privReaderQueue.dispose("End of stream reached"),e}))},this.close=function(){i.privIsClosed||(i.privIsClosed=!0,i.privReaderQueue.dispose("StreamReader closed"),i.privOnClose())},this.privReaderQueue=t,this.privOnClose=r,this.privStreamId=e}return Object.defineProperty(e.prototype,"isClosed",{get:function(){return this.privIsClosed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"streamId",{get:function(){return this.privStreamId},enumerable:!0,configurable:!0}),e}();t.StreamReader=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.Success=0]="Success",e[e.Error=1]="Error"}(t.TranslationStatus||(t.TranslationStatus={}))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(t,r){var n=e.call(this,r)||this;return n.privTargetChunkSize=t,n.privNextBufferReadyBytes=0,n}return i(t,e),t.prototype.writeStreamChunk=function(t){if(t.isEnd||0===this.privNextBufferReadyBytes&&t.buffer.byteLength===this.privTargetChunkSize)e.prototype.writeStreamChunk.call(this,t);else for(var r=0;r<t.buffer.byteLength;){void 0===this.privNextBufferToWrite&&(this.privNextBufferToWrite=new ArrayBuffer(this.privTargetChunkSize),this.privNextBufferStartTime=t.timeReceived);var n=Math.min(t.buffer.byteLength-r,this.privTargetChunkSize-this.privNextBufferReadyBytes),i=new Uint8Array(this.privNextBufferToWrite),o=new Uint8Array(t.buffer.slice(r,n+r));i.set(o,this.privNextBufferReadyBytes),this.privNextBufferReadyBytes+=n,r+=n,this.privNextBufferReadyBytes===this.privTargetChunkSize&&(e.prototype.writeStreamChunk.call(this,{buffer:this.privNextBufferToWrite,isEnd:!1,timeReceived:this.privNextBufferStartTime}),this.privNextBufferReadyBytes=0,this.privNextBufferToWrite=void 0)}},t.prototype.close=function(){0===this.privNextBufferReadyBytes||this.isClosed||e.prototype.writeStreamChunk.call(this,{buffer:this.privNextBufferToWrite.slice(0,this.privNextBufferReadyBytes),isEnd:!1,timeReceived:this.privNextBufferStartTime}),e.prototype.close.call(this)},t}(r(4).Stream);t.ChunkedArrayBufferStream=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(24),i=r(25),o=r(4);t.AudioWorkletSourceURLPropertyName="MICROPHONE-WorkletSourceUrl";var s=function(){function e(t,r,n){var i=this;this.privRecorder=t,this.deviceId=r,this.privStreams={},this.turnOn=function(){if(i.privInitializeDeferral)return i.privInitializeDeferral.promise();i.privInitializeDeferral=new o.Deferred;try{i.createAudioContext()}catch(t){if(t instanceof Error){var e=t;i.privInitializeDeferral.reject(e.name+": "+e.message)}else i.privInitializeDeferral.reject(t);return i.privInitializeDeferral.promise()}var t=window.navigator,r=t.getUserMedia||t.webkitGetUserMedia||t.mozGetUserMedia||t.msGetUserMedia;if(t.mediaDevices&&(r=function(e,r,n){t.mediaDevices.getUserMedia(e).then(r).catch(n)}),r){var n=function(){i.onEvent(new o.AudioSourceInitializingEvent(i.privId)),r({audio:!i.deviceId||{deviceId:i.deviceId},video:!1},(function(e){i.privMediaStream=e,i.onEvent(new o.AudioSourceReadyEvent(i.privId)),i.privInitializeDeferral.resolve(!0)}),(function(e){var t="Error occurred during microphone initialization: "+e,r=i.privInitializeDeferral;i.privInitializeDeferral=null,r.reject(t),i.onEvent(new o.AudioSourceErrorEvent(i.privId,t))}))};"suspended"===i.privContext.state?i.privContext.resume().then(n,(function(e){i.privInitializeDeferral.reject("Failed to initialize audio context: "+e)})):n()}else{var s="Browser does not support getUserMedia.";i.privInitializeDeferral.reject(s),i.onEvent(new o.AudioSourceErrorEvent(s,""))}return i.privInitializeDeferral.promise()},this.id=function(){return i.privId},this.attach=function(e){return i.onEvent(new o.AudioStreamNodeAttachingEvent(i.privId,e)),i.listen(e).onSuccessContinueWith((function(t){return i.onEvent(new o.AudioStreamNodeAttachedEvent(i.privId,e)),{detach:function(){t.close(),i.turnOff(),delete i.privStreams[e],i.onEvent(new o.AudioStreamNodeDetachedEvent(i.privId,e))},id:function(){return e},read:function(){return t.read()}}}))},this.detach=function(e){e&&i.privStreams[e]&&(i.privStreams[e].close(),delete i.privStreams[e],i.onEvent(new o.AudioStreamNodeDetachedEvent(i.privId,e)))},this.turnOff=function(){for(var e in i.privStreams)if(e){var t=i.privStreams[e];t&&t.close()}return i.onEvent(new o.AudioSourceOffEvent(i.privId)),i.privInitializeDeferral=null,i.destroyAudioContext(),o.PromiseHelper.fromResult(!0)},this.listen=function(e){return i.turnOn().onSuccessContinueWith((function(t){var r=new o.ChunkedArrayBufferStream(i.privOutputChunkSize,e);i.privStreams[e]=r;try{i.privRecorder.record(i.privContext,i.privMediaStream,r)}catch(t){throw i.onEvent(new o.AudioStreamNodeErrorEvent(i.privId,e,t)),t}return r.getReader()}))},this.onEvent=function(e){i.privEvents.onEvent(e),o.Events.instance.onEvent(e)},this.createAudioContext=function(){if(!i.privContext){var e=window.AudioContext||window.webkitAudioContext||!1;if(!e)throw new Error("Browser does not support Web Audio API (AudioContext is not available).");i.privContext=new e}},this.destroyAudioContext=function(){if(i.privContext){i.privRecorder.releaseMediaResources(i.privContext);var e=!1;"close"in i.privContext&&(e=!0),e?(i.privContext.close(),i.privContext=null):null!==i.privContext&&"running"===i.privContext.state&&i.privContext.suspend()}},this.privOutputChunkSize=e.AUDIOFORMAT.avgBytesPerSec/10,this.privId=n||o.createNoDashGuid(),this.privEvents=new o.EventSource}return Object.defineProperty(e.prototype,"format",{get:function(){return o.PromiseHelper.fromResult(e.AUDIOFORMAT)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){return this.privEvents},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deviceInfo",{get:function(){return this.getMicrophoneLabel().onSuccessContinueWith((function(t){return{bitspersample:e.AUDIOFORMAT.bitsPerSample,channelcount:e.AUDIOFORMAT.channels,connectivity:i.connectivity.Unknown,manufacturer:"Speech SDK",model:t,samplerate:e.AUDIOFORMAT.samplesPerSec,type:i.type.Microphones}}))},enumerable:!0,configurable:!0}),e.prototype.setProperty=function(e,r){if(e!==t.AudioWorkletSourceURLPropertyName)throw new Error("Property '"+e+"' is not supported on Microphone.");this.privRecorder.setWorkletUrl(r)},e.prototype.getMicrophoneLabel=function(){var e=this,t="microphone";if(void 0!==this.privMicrophoneLabel)return o.PromiseHelper.fromResult(this.privMicrophoneLabel);if(void 0===this.privMediaStream||!this.privMediaStream.active)return o.PromiseHelper.fromResult(t);this.privMicrophoneLabel=t;var r=this.privMediaStream.getTracks()[0].getSettings().deviceId;if(void 0===r)return o.PromiseHelper.fromResult(this.privMicrophoneLabel);var n=new o.Deferred;return navigator.mediaDevices.enumerateDevices().then((function(t){for(var i=0,o=t;i<o.length;i++){var s=o[i];if(s.deviceId===r){e.privMicrophoneLabel=s.label;break}}n.resolve(e.privMicrophoneLabel)}),(function(){return n.resolve(e.privMicrophoneLabel)})),n.promise()},e.AUDIOFORMAT=n.AudioStreamFormat.getDefaultInputFormat(),e}();t.MicAudioSource=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(){function e(){}return e.getDefaultInputFormat=function(){return s.getDefaultInputFormat()},e.getWaveFormatPCM=function(e,t,r){return new s(e,t,r)},e}();t.AudioStreamFormat=o;var s=function(e){function t(t,r,n){void 0===t&&(t=16e3),void 0===r&&(r=16),void 0===n&&(n=1);var i=e.call(this)||this;i.setString=function(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))},i.formatTag=1,i.bitsPerSample=r,i.samplesPerSec=t,i.channels=n,i.avgBytesPerSec=i.samplesPerSec*i.channels*(i.bitsPerSample/8),i.blockAlign=i.channels*Math.max(i.bitsPerSample,8),i.privHeader=new ArrayBuffer(44);var o=new DataView(i.privHeader);return i.setString(o,0,"RIFF"),o.setUint32(4,0,!0),i.setString(o,8,"WAVEfmt "),o.setUint32(16,16,!0),o.setUint16(20,1,!0),o.setUint16(22,i.channels,!0),o.setUint32(24,i.samplesPerSec,!0),o.setUint32(28,i.avgBytesPerSec,!0),o.setUint16(32,i.channels*(i.bitsPerSample/8),!0),o.setUint16(34,i.bitsPerSample,!0),i.setString(o,36,"data"),o.setUint32(40,0,!0),i}return i(t,e),t.getDefaultInputFormat=function(){return new t},t.prototype.close=function(){},Object.defineProperty(t.prototype,"header",{get:function(){return this.privHeader},enumerable:!0,configurable:!0}),t}(o);t.AudioStreamFormatImpl=s},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(26)),n(r(28)),n(r(27)),n(r(29)),n(r(105)),n(r(106)),n(r(108)),n(r(109)),n(r(64)),n(r(110)),n(r(111)),n(r(112)),n(r(113)),n(r(114)),n(r(115)),n(r(116)),n(r(117)),n(r(118)),n(r(119)),n(r(120)),n(r(121)),n(r(122)),n(r(123)),n(r(124)),n(r(125)),n(r(126)),n(r(128)),n(r(129)),n(r(130)),n(r(134)),n(r(135)),n(r(150)),n(r(151)),n(r(152)),n(r(154)),t.OutputFormatPropertyName="OutputFormat",t.CancellationErrorCodePropertyName="CancellationErrorCode",t.ServicePropertiesPropertyName="ServiceProperties",t.ForceDictationPropertyName="ForceDication"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(27),o=function(e){var t=this;if(this.fetch=function(e){return n.PromiseHelper.fromResult(t.privAuthInfo)},this.fetchOnExpiry=function(e){return n.PromiseHelper.fromResult(t.privAuthInfo)},!e)throw new n.ArgumentNullError("subscriptionKey");this.privAuthInfo=new i.AuthInfo("Ocp-Apim-Subscription-Key",e)};t.CognitiveSubscriptionKeyAuthentication=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){this.privHeaderName=e,this.privToken=t}return Object.defineProperty(e.prototype,"headerName",{get:function(){return this.privHeaderName},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"token",{get:function(){return this.privToken},enumerable:!0,configurable:!0}),e}();t.AuthInfo=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4),i=r(27),o="Authorization",s=function(e,t){var r=this;if(this.fetch=function(e){return r.privFetchCallback(e).onSuccessContinueWith((function(e){return new i.AuthInfo(o,e)}))},this.fetchOnExpiry=function(e){return r.privFetchOnExpiryCallback(e).onSuccessContinueWith((function(e){return new i.AuthInfo(o,e)}))},!e)throw new n.ArgumentNullError("fetchCallback");if(!t)throw new n.ArgumentNullError("fetchOnExpiryCallback");this.privFetchCallback=e,this.privFetchOnExpiryCallback=t};t.CognitiveTokenAuthentication=s},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),s=r(30),a=r(65),c=r(25),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.create=function(e,r,n){var i=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Endpoint);if(!i){var a=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_IntentRegion),p=a&&a.toLowerCase().startsWith("china")?".azure.cn":".microsoft.com";i=e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_Host,"wss://"+a+".sr.speech"+p)+"/speech/recognition/interactive/cognitiveservices/v1"}var u={format:"simple",language:e.parameters.getProperty(s.PropertyId.SpeechServiceConnection_RecoLanguage)};t.setCommonUrlParams(e,u,i);var v={};return void 0!==r.token&&""!==r.token&&(v[r.headerName]=r.token),v["X-ConnectionId"]=n,e.parameters.setProperty(s.PropertyId.SpeechServiceConnection_Url,i),new o.WebsocketConnection(i,u,v,new c.WebsocketMessageFormatter,o.ProxyInfo.fromRecognizerConfig(e),n)},t}return i(t,e),t.prototype.getSpeechRegionFromIntentRegion=function(e){switch(e){case"West US":case"US West":case"westus":return"uswest";case"West US 2":case"US West 2":case"westus2":return"uswest2";case"South Central US":case"US South Central":case"southcentralus":return"ussouthcentral";case"West Central US":case"US West Central":case"westcentralus":return"uswestcentral";case"East US":case"US East":case"eastus":return"useast";case"East US 2":case"US East 2":case"eastus2":return"useast2";case"West Europe":case"Europe West":case"westeurope":return"europewest";case"North Europe":case"Europe North":case"northeurope":return"europenorth";case"Brazil South":case"South Brazil":case"southbrazil":return"brazilsouth";case"Australia East":case"East Australia":case"eastaustralia":return"australiaeast";case"Southeast Asia":case"Asia Southeast":case"southeastasia":return"asiasoutheast";case"East Asia":case"Asia East":case"eastasia":return"asiaeast";default:return e}},t}(a.ConnectionFactoryBase);t.IntentConnectionFactory=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(31);t.AudioConfig=n.AudioConfig;var i=r(24);t.AudioStreamFormat=i.AudioStreamFormat;var o=r(35);t.AudioInputStream=o.AudioInputStream,t.PullAudioInputStream=o.PullAudioInputStream,t.PushAudioInputStream=o.PushAudioInputStream;var s=r(36);t.AudioOutputStream=s.AudioOutputStream,t.PullAudioOutputStream=s.PullAudioOutputStream,t.PushAudioOutputStream=s.PushAudioOutputStream;var a=r(39);t.CancellationReason=a.CancellationReason;var c=r(40);t.PullAudioInputStreamCallback=c.PullAudioInputStreamCallback;var p=r(41);t.PushAudioOutputStreamCallback=p.PushAudioOutputStreamCallback;var u=r(42);t.KeywordRecognitionModel=u.KeywordRecognitionModel;var v=r(43);t.SessionEventArgs=v.SessionEventArgs;var h=r(44);t.RecognitionEventArgs=h.RecognitionEventArgs;var l=r(45);t.OutputFormat=l.OutputFormat;var f=r(46);t.IntentRecognitionEventArgs=f.IntentRecognitionEventArgs;var d=r(47);t.RecognitionResult=d.RecognitionResult;var g=r(48);t.SpeechRecognitionResult=g.SpeechRecognitionResult;var y=r(49);t.IntentRecognitionResult=y.IntentRecognitionResult;var m=r(50);t.LanguageUnderstandingModel=m.LanguageUnderstandingModel;var S=r(51);t.SpeechRecognitionEventArgs=S.SpeechRecognitionEventArgs;var C=r(52);t.SpeechRecognitionCanceledEventArgs=C.SpeechRecognitionCanceledEventArgs;var b=r(53);t.TranslationRecognitionEventArgs=b.TranslationRecognitionEventArgs;var P=r(54);t.TranslationSynthesisEventArgs=P.TranslationSynthesisEventArgs;var R=r(55);t.TranslationRecognitionResult=R.TranslationRecognitionResult;var I=r(56);t.TranslationSynthesisResult=I.TranslationSynthesisResult;var O=r(57);t.ResultReason=O.ResultReason;var w=r(58);t.SpeechConfig=w.SpeechConfig,t.SpeechConfigImpl=w.SpeechConfigImpl;var T=r(59);t.SpeechTranslationConfig=T.SpeechTranslationConfig;var E=r(60);t.PropertyCollection=E.PropertyCollection;var _=r(61);t.PropertyId=_.PropertyId;var A=r(62);t.Recognizer=A.Recognizer;var M=r(63);t.SpeechRecognizer=M.SpeechRecognizer;var D=r(67);t.IntentRecognizer=D.IntentRecognizer;var j=r(68);t.TranslationRecognizer=j.TranslationRecognizer;var k=r(69);t.Translations=k.Translations;var N=r(70);t.NoMatchReason=N.NoMatchReason;var z=r(71);t.NoMatchDetails=z.NoMatchDetails;var x=r(72);t.TranslationRecognitionCanceledEventArgs=x.TranslationRecognitionCanceledEventArgs;var L=r(73);t.IntentRecognitionCanceledEventArgs=L.IntentRecognitionCanceledEventArgs;var B=r(74);t.CancellationDetails=B.CancellationDetails;var F=r(75);t.CancellationErrorCode=F.CancellationErrorCode;var q=r(76);t.ConnectionEventArgs=q.ConnectionEventArgs;var U=r(77);t.ServiceEventArgs=U.ServiceEventArgs;var W=r(78);t.Connection=W.Connection;var H=r(80);t.PhraseListGrammar=H.PhraseListGrammar;var K=r(81);t.DialogServiceConfig=K.DialogServiceConfig;var V=r(82);t.BotFrameworkConfig=V.BotFrameworkConfig;var J=r(83);t.CustomCommandsConfig=J.CustomCommandsConfig;var G=r(84);t.DialogServiceConnector=G.DialogServiceConnector;var Q=r(86);t.ActivityReceivedEventArgs=Q.ActivityReceivedEventArgs;var Y=r(87);t.ServicePropertyChannel=Y.ServicePropertyChannel;var X=r(88);t.ProfanityOption=X.ProfanityOption;var $=r(89);t.BaseAudioPlayer=$.BaseAudioPlayer;var Z=r(90);t.ConnectionMessageEventArgs=Z.ConnectionMessageEventArgs;var ee=r(79);t.ConnectionMessage=ee.ConnectionMessage;var te=r(91);t.Conversation=te.Conversation,t.ConversationExpirationEventArgs=te.ConversationExpirationEventArgs,t.ConversationParticipantsChangedEventArgs=te.ConversationParticipantsChangedEventArgs,t.ConversationTranslationCanceledEventArgs=te.ConversationTranslationCanceledEventArgs,t.ConversationTranslationEventArgs=te.ConversationTranslationEventArgs,t.ConversationTranslationResult=te.ConversationTranslationResult,t.ConversationTranslator=te.ConversationTranslator,t.Participant=te.Participant,t.ParticipantChangedReason=te.ParticipantChangedReason,t.User=te.User;var re=r(38);t.SpeechSynthesisOutputFormat=re.SpeechSynthesisOutputFormat;var ne=r(101);t.SpeechSynthesizer=ne.SpeechSynthesizer;var ie=r(102);t.SpeechSynthesisResult=ie.SpeechSynthesisResult;var oe=r(103);t.SpeechSynthesisEventArgs=oe.SpeechSynthesisEventArgs;var se=r(104);t.SpeechSynthesisWordBoundaryEventArgs=se.SpeechSynthesisWordBoundaryEventArgs},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(2),s=r(32),a=r(30),c=r(33),p=r(35),u=r(36),v=function(){function e(){}return e.fromDefaultMicrophoneInput=function(){var e=new o.PcmRecorder;return new h(new o.MicAudioSource(e))},e.fromMicrophoneInput=function(e){var t=new o.PcmRecorder;return new h(new o.MicAudioSource(t,e))},e.fromWavFileInput=function(e){return new h(new o.FileAudioSource(e))},e.fromStreamInput=function(e){if(e instanceof a.PullAudioInputStreamCallback)return new h(new p.PullAudioInputStreamImpl(e));if(e instanceof a.AudioInputStream)return new h(e);throw new Error("Not Supported Type")},e.fromDefaultSpeakerOutput=function(){return new l(new o.SpeakerAudioDestination)},e.fromAudioFileOutput=function(e){return new l(new c.AudioFileWriter(e))},e.fromStreamOutput=function(e){if(e instanceof a.PushAudioOutputStreamCallback)return new l(new u.PushAudioOutputStreamImpl(e));if(e instanceof a.PushAudioOutputStream)return new l(e);if(e instanceof a.PullAudioOutputStream)return new l(e);throw new Error("Not Supported Type")},e}();t.AudioConfig=v;var h=function(e){function t(t){var r=e.call(this)||this;return r.privSource=t,r}return i(t,e),Object.defineProperty(t.prototype,"format",{get:function(){return this.privSource.format},enumerable:!0,configurable:!0}),t.prototype.close=function(){this.privSource.turnOff()},t.prototype.id=function(){return this.privSource.id()},t.prototype.turnOn=function(){return this.privSource.turnOn()},t.prototype.attach=function(e){return this.privSource.attach(e)},t.prototype.detach=function(e){return this.privSource.detach(e)},t.prototype.turnOff=function(){return this.privSource.turnOff()},Object.defineProperty(t.prototype,"events",{get:function(){return this.privSource.events},enumerable:!0,configurable:!0}),t.prototype.setProperty=function(e,t){if(s.Contracts.throwIfNull(t,"value"),void 0===this.privSource.setProperty)throw new Error("This AudioConfig instance does not support setting properties.");this.privSource.setProperty(e,t)},t.prototype.getProperty=function(e,t){if(void 0!==this.privSource.getProperty)return this.privSource.getProperty(e,t);throw new Error("This AudioConfig instance does not support getting properties.")},Object.defineProperty(t.prototype,"deviceInfo",{get:function(){return this.privSource.deviceInfo},enumerable:!0,configurable:!0}),t}(v);t.AudioConfigImpl=h;var l=function(e){function t(t){var r=e.call(this)||this;return r.privDestination=t,r}return i(t,e),Object.defineProperty(t.prototype,"format",{set:function(e){this.privDestination.format=e},enumerable:!0,configurable:!0}),t.prototype.write=function(e){this.privDestination.write(e)},t.prototype.close=function(){this.privDestination.close()},t.prototype.id=function(){return this.privDestination.id()},t.prototype.setProperty=function(e,t){throw new Error("This AudioConfig instance does not support setting properties.")},t.prototype.getProperty=function(e,t){throw new Error("This AudioConfig instance does not support getting properties.")},t}(v);t.AudioOutputConfigImpl=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){}return e.throwIfNullOrUndefined=function(e,t){if(null==e)throw new Error("throwIfNullOrUndefined:"+t)},e.throwIfNull=function(e,t){if(null===e)throw new Error("throwIfNull:"+t)},e.throwIfNullOrWhitespace=function(t,r){if(e.throwIfNullOrUndefined(t,r),(""+t).trim().length<1)throw new Error("throwIfNullOrWhitespace:"+r)},e.throwIfDisposed=function(e){if(e)throw new Error("the object is already disposed")},e.throwIfArrayEmptyOrWhitespace=function(t,r){if(e.throwIfNullOrUndefined(t,r),0===t.length)throw new Error("throwIfArrayEmptyOrWhitespace:"+r);for(var n=0,i=t;n<i.length;n++){var o=i[n];e.throwIfNullOrWhitespace(o,r)}},e.throwIfFileDoesNotExist=function(t,r){e.throwIfNullOrWhitespace(t,r)},e.throwIfNotUndefined=function(e,t){if(void 0!==e)throw new Error("throwIfNotUndefined:"+t)},e}();t.Contracts=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(34),i=r(32),o=function(){function e(e){var t=this;this.id=function(){return t.privId},this.privFd=n.openSync(e,"w")}return Object.defineProperty(e.prototype,"format",{set:function(e){i.Contracts.throwIfNotUndefined(this.privAudioFormat,"format is already set"),this.privAudioFormat=e;var t=0;this.privAudioFormat.hasHeader&&(t=this.privAudioFormat.header.byteLength),void 0!==this.privFd&&(this.privWriteStream=n.createWriteStream("",{fd:this.privFd,start:t,autoClose:!1}))},enumerable:!0,configurable:!0}),e.prototype.write=function(e){i.Contracts.throwIfNullOrUndefined(this.privAudioFormat,"must set format before writing."),void 0!==this.privWriteStream&&this.privWriteStream.write(new Uint8Array(e.slice(0)))},e.prototype.close=function(){var e=this;void 0!==this.privFd&&(this.privWriteStream.on("finish",(function(){e.privAudioFormat.hasHeader&&(e.privAudioFormat.updateHeader(e.privWriteStream.bytesWritten),n.writeSync(e.privFd,new Int8Array(e.privAudioFormat.header),0,e.privAudioFormat.header.byteLength,0)),n.closeSync(e.privFd),e.privFd=void 0})),this.privWriteStream.end())},e}();t.AudioFileWriter=o},function(e,t){},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},n(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=r(25),s=r(4),a=r(7),c=r(30),p=r(24),u=function(){function e(){}return e.createPushStream=function(e){return v.create(e)},e.createPullStream=function(e,t){return l.create(e,t)},e}();t.AudioInputStream=u;var v=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.create=function(e){return new h(e)},t}(u);t.PushAudioInputStream=v;var h=function(e){function t(t){var r=e.call(this)||this;return r.onEvent=function(e){r.privEvents.onEvent(e),s.Events.instance.onEvent(e)},r.privFormat=void 0===t?p.AudioStreamFormatImpl.getDefaultInputFormat():t,r.privEvents=new s.EventSource,r.privId=a.createNoDashGuid(),r.privStream=new s.ChunkedArrayBufferStream(r.privFormat.avgBytesPerSec/10),r}return i(t,e),Object.defineProperty(t.prototype,"format",{get:function(){return s.PromiseHelper.fromResult(this.privFormat)},enumerable:!0,configurable:!0}),t.prototype.write=function(e){this.privStream.writeStreamChunk({buffer:e,isEnd:!1,timeReceived:Date.now()})},t.prototype.close=function(){this.privStream.close()},t.prototype.id=function(){return this.privId},t.prototype.turnOn=function(){return this.onEvent(new s.AudioSourceInitializingEvent(this.privId)),this.onEvent(new s.AudioSourceReadyEvent(this.privId)),s.PromiseHelper.fromResult(!0)},t.prototype.attach=function(e){var t=this;return this.onEvent(new s.AudioStreamNodeAttachingEvent(this.privId,e)),this.turnOn().onSuccessContinueWith((function(e){return t.privStream.getReader()})).onSuccessContinueWith((function(r){return t.onEvent(new s.AudioStreamNodeAttachedEvent(t.privId,e)),{detach:function(){r.close(),t.onEvent(new s.AudioStreamNodeDetachedEvent(t.privId,e)),t.turnOff()},id:function(){return e},read:function(){return r.read()}}}))},t.prototype.detach=function(e){this.onEvent(new s.AudioStreamNodeDetachedEvent(this.privId,e))},t.prototype.turnOff=function(){return s.PromiseHelper.fromResult(!1)},Object.defineProperty(t.prototype,"events",{get:function(){return this.privEvents},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"deviceInfo",{get:function(){return s.PromiseHelper.fromResult({bitspersample:this.privFormat.bitsPerSample,channelcount:this.privFormat.channels,connectivity:o.connectivity.Unknown,manufacturer:"Speech SDK",model:"PushStream",samplerate:this.privFormat.samplesPerSec,type:o.type.Stream})},enumerable:!0,configurable:!0}),t}(v);t.PushAudioInputStreamImpl=h;var l=function(e){function t(){return e.call(this)||this}return i(t,e),t.create=function(e,t){return new f(e,t)},t}(u);t.PullAudioInputStream=l;var f=function(e){function t(t,r){var n=e.call(this)||this;return n.onEvent=function(e){n.privEvents.onEvent(e),s.Events.instance.onEvent(e)},n.privFormat=void 0===r?c.AudioStreamFormat.getDefaultInputFormat():r,n.privEvents=new s.EventSource,n.privId=a.createNoDashGuid(),n.privCallback=t,n.privIsClosed=!1,n.privBufferSize=n.privFormat.avgBytesPerSec/10,n}return i(t,e),Object.defineProperty(t.prototype,"format",{get:function(){return s.PromiseHelper.fromResult(this.privFormat)},enumerable:!0,configurable:!0}),t.prototype.close=function(){this.privIsClosed=!0,this.privCallback.close()},t.prototype.id=function(){return this.privId},t.prototype.turnOn=function(){return this.onEvent(new s.AudioSourceInitializingEvent(this.privId)),this.onEvent(new s.AudioSourceReadyEvent(this.privId)),s.PromiseHelper.fromResult(!0)},t.prototype.attach=function(e){var t=this;return this.onEvent(new s.AudioStreamNodeAttachingEvent(this.privId,e)),this.turnOn().onSuccessContinueWith((function(r){return t[