{"version":3,"sources":["webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/QueryParameterNames.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/IntentConnectionFactory.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/IntentServiceRecognizer.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/IAuthentication.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/Exports.js","webpack:///./node_modules/microsoft-cognitiveservices-speech-sdk/distrib/es2015/src/common.speech/HeaderNames.js"],"names":["QueryParameterNames","BotId","CustomSpeechDeploymentId","CustomVoiceDeploymentId","EnableAudioLogging","EnableLanguageId","EnableWordLevelTimestamps","EndSilenceTimeoutMs","Format","InitialSilenceTimeoutMs","Language","Profanity","RequestBotStatusMessages","StableIntermediateThreshold","StableTranslation","TestHooks","IntentConnectionFactory","super","arguments","this","create","config","authInfo","connectionId","endpoint","parameters","getProperty","SpeechServiceConnection_Endpoint","region","SpeechServiceConnection_IntentRegion","hostSuffix","toLowerCase","startsWith","host","SpeechServiceConnection_Host","queryParams","format","language","SpeechServiceConnection_RecoLanguage","setCommonUrlParams","headers","undefined","token","headerName","ConnectionId","setProperty","SpeechServiceConnection_Url","enableCompression","fromRecognizerConfig","intentRegion","__awaiter","thisArg","_arguments","P","generator","adopt","value","resolve","Promise","reject","fulfilled","step","next","e","rejected","result","done","then","apply","IntentServiceRecognizer","authentication","connectionFactory","audioSource","recognizerConfig","recognizer","privIntentRecognizer","privIntentDataSent","addedIntents","umbrellaIntent","privAddedLmIntents","privUmbrellaIntent","connectionMessage","ev","processed","resultProps","messageType","Text","SpeechServiceResponse_JsonResult","textBody","path","speechHypothesis","fromJSON","privRequestSession","requestId","RecognizingIntent","Duration","Offset","currentTurnAudioOffset","LanguageDetectionConfidence","onHypothesis","offset","sessionId","recognizing","error","simple","implTranslateRecognitionResult","RecognitionStatus","DisplayText","sendEvent","recognized","privSuccessCallback","privErrorCallback","NoMatch","reason","onPhraseRecognized","duration","privPendingIntentArgs","intentResponse","addedIntent","topScoringIntent","intent","intentId","intentName","RecognizedIntent","properties","LanguageUnderstandingServiceResponse_JsonResult","resultId","text","errorDetails","json","cancellationReason","errorCode","canceled","cancelEvent","_a","Canceled","_b","AuthInfo","privHeaderName","privToken","OutputFormatPropertyName","CancellationErrorCodePropertyName","ServicePropertiesPropertyName","ForceDictationPropertyName","AutoDetectSourceLanguagesOpenRangeOptionName","HeaderNames","AuthKey","ContentType","CustomCommandsAppId","Path","RequestId","RequestStreamId","RequestTimestamp"],"mappings":"wPAAA,kCAEO,MAAMA,GAEbA,EAAoBC,MAAQ,QAC5BD,EAAoBE,yBAA2B,MAC/CF,EAAoBG,wBAA0B,eAC9CH,EAAoBI,mBAAqB,aACzCJ,EAAoBK,iBAAmB,aACvCL,EAAoBM,0BAA4B,sBAChDN,EAAoBO,oBAAsB,sBAC1CP,EAAoBQ,OAAS,SAC7BR,EAAoBS,wBAA0B,0BAC9CT,EAAoBU,SAAW,WAC/BV,EAAoBW,UAAY,YAChCX,EAAoBY,yBAA2B,yBAC/CZ,EAAoBa,4BAA8B,8BAClDb,EAAoBc,kBAAoB,oBACxCd,EAAoBe,UAAY,a,oCClBhC,8GAOO,MAAMC,UAAgC,OACzC,cACIC,SAASC,WACTC,KAAKC,OAAS,CAACC,EAAQC,EAAUC,KAC7B,IAAIC,EAAWH,EAAOI,WAAWC,YAAY,OAAWC,kCACxD,IAAKH,EAAU,CACX,MAAMI,EAASP,EAAOI,WAAWC,YAAY,OAAWG,sCAClDC,EAAcF,GAAUA,EAAOG,cAAcC,WAAW,SAAY,YAAc,iBAClFC,EAAOZ,EAAOI,WAAWC,YAAY,OAAWQ,6BAA8B,SAAWN,EAAS,aAAeE,GACvHN,EAAWS,EAAO,uDAEtB,MAAME,EAAc,CAChBC,OAAQ,SACRC,SAAUhB,EAA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,IAC1EhH,KAAKwD,qBAAqByD,SAAU,CACtC,MAAMC,EAAc,IAAI,OAAmCH,EAAoB3B,EAAO4B,OAAW1F,OAAWA,EAAW4D,GACvH,IACIlF,KAAKwD,qBAAqByD,SAASjH,KAAKwD,qBAAsB0D,GAGlE,MAAOC,KAEX,GAAMnH,KAAK2F,oBAAqB,CAC5B,MAAM7C,EAAS,IAAI,YAAwBxB,EAC3CoD,EAAW,OAAa0C,cAAU9F,OAClCA,OACAA,OACAA,OACAA,EACA8D,OAAO9D,EACPmF,GACA,IACIzG,KAAK2F,oBAAoB7C,GACzB9C,KAAK2F,yBAAsBrE,EAG/B,MAAO+F,S,kCCjMnB,kCAEO,MAAMC,EACT,YAAY9F,EAAYD,GACpBvB,KAAKuH,eAAiB/F,EACtBxB,KAAKwH,UAAYjG,EAErB,iBACI,OAAOvB,KAAKuH,eAEhB,YACI,OAAOvH,KAAKwH,a,kCCXpB,iUAgDO,MAAMC,EAA2B,eAC3BC,EAAoC,wBACpCC,EAAgC,oBAChCC,EAA6B,iBAC7BC,EAA+C,a,kCCpD5D,kCAEO,MAAMC,GAEbA,EAAYC,QAAU,4BACtBD,EAAYrG,aAAe,iBAC3BqG,EAAYE,YAAc,eAC1BF,EAAYG,oBAAsB,kBAClCH,EAAYI,KAAO,OACnBJ,EAAYK,UAAY,cACxBL,EAAYM,gBAAkB,aAC9BN,EAAYO,iBAAmB","file":"js/MockTestView~0a94f252.22205fe3.js","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nexport class QueryParameterNames {\n}\nQueryParameterNames.BotId = \"botid\";\nQueryParameterNames.CustomSpeechDeploymentId = \"cid\";\nQueryParameterNames.CustomVoiceDeploymentId = \"deploymentId\";\nQueryParameterNames.EnableAudioLogging = \"storeAudio\";\nQueryParameterNames.EnableLanguageId = \"lidEnabled\";\nQueryParameterNames.EnableWordLevelTimestamps = \"wordLevelTimestamps\";\nQueryParameterNames.EndSilenceTimeoutMs = \"endSilenceTimeoutMs\";\nQueryParameterNames.Format = \"format\";\nQueryParameterNames.InitialSilenceTimeoutMs = \"initialSilenceTimeoutMs\";\nQueryParameterNames.Language = \"language\";\nQueryParameterNames.Profanity = \"profanity\";\nQueryParameterNames.RequestBotStatusMessages = \"enableBotMessageStatus\";\nQueryParameterNames.StableIntermediateThreshold = \"stableIntermediateThreshold\";\nQueryParameterNames.StableTranslation = \"stableTranslation\";\nQueryParameterNames.TestHooks = \"testhooks\";\n\n//# sourceMappingURL=QueryParameterNames.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nimport { ProxyInfo, WebsocketConnection, } from \"../common.browser/Exports\";\nimport { PropertyId } from \"../sdk/Exports\";\nimport { ConnectionFactoryBase } from \"./ConnectionFactoryBase\";\nimport { WebsocketMessageFormatter, } from \"./Exports\";\nimport { HeaderNames } from \"./HeaderNames\";\nexport class IntentConnectionFactory extends ConnectionFactoryBase {\n constructor() {\n super(...arguments);\n this.create = (config, authInfo, connectionId) => {\n let endpoint = config.parameters.getProperty(PropertyId.SpeechServiceConnection_Endpoint);\n if (!endpoint) {\n const region = config.parameters.getProperty(PropertyId.SpeechServiceConnection_IntentRegion);\n const hostSuffix = (region && region.toLowerCase().startsWith(\"china\")) ? \".azure.cn\" : \".microsoft.com\";\n const host = config.parameters.getProperty(PropertyId.SpeechServiceConnection_Host, \"wss://\" + region + \".sr.speech\" + hostSuffix);\n endpoint = host + \"/speech/recognition/interactive/cognitiveservices/v1\";\n }\n const queryParams = {\n format: \"simple\",\n language: config.parameters.getProperty(PropertyId.SpeechServiceConnection_RecoLanguage),\n };\n this.setCommonUrlParams(config, queryParams, endpoint);\n const headers = {};\n if (authInfo.token !== undefined && authInfo.token !== \"\") {\n headers[authInfo.headerName] = authInfo.token;\n }\n headers[HeaderNames.ConnectionId] = connectionId;\n config.parameters.setProperty(PropertyId.SpeechServiceConnection_Url, endpoint);\n const enableCompression = config.parameters.getProperty(\"SPEECH-EnableWebsocketCompression\", \"false\") === \"true\";\n return new WebsocketConnection(endpoint, queryParams, headers, new WebsocketMessageFormatter(), ProxyInfo.fromRecognizerConfig(config), enableCompression, connectionId);\n };\n }\n getSpeechRegionFromIntentRegion(intentRegion) {\n switch (intentRegion) {\n case \"West US\":\n case \"US West\":\n case \"westus\":\n return \"uswest\";\n case \"West US 2\":\n case \"US West 2\":\n case \"westus2\":\n return \"uswest2\";\n case \"South Central US\":\n case \"US South Central\":\n case \"southcentralus\":\n return \"ussouthcentral\";\n case \"West Central US\":\n case \"US West Central\":\n case \"westcentralus\":\n return \"uswestcentral\";\n case \"East US\":\n case \"US East\":\n case \"eastus\":\n return \"useast\";\n case \"East US 2\":\n case \"US East 2\":\n case \"eastus2\":\n return \"useast2\";\n case \"West Europe\":\n case \"Europe West\":\n case \"westeurope\":\n return \"europewest\";\n case \"North Europe\":\n case \"Europe North\":\n case \"northeurope\":\n return \"europenorth\";\n case \"Brazil South\":\n case \"South Brazil\":\n case \"southbrazil\":\n return \"brazilsouth\";\n case \"Australia East\":\n case \"East Australia\":\n case \"eastaustralia\":\n return \"australiaeast\";\n case \"Southeast Asia\":\n case \"Asia Southeast\":\n case \"southeastasia\":\n return \"asiasoutheast\";\n case \"East Asia\":\n case \"Asia East\":\n case \"eastasia\":\n return \"asiaeast\";\n default:\n return intentRegion;\n }\n }\n}\n\n//# sourceMappingURL=IntentConnectionFactory.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { MessageType, } from \"../common/Exports\";\nimport { CancellationErrorCode, IntentRecognitionCanceledEventArgs, IntentRecognitionEventArgs, IntentRecognitionResult, PropertyCollection, PropertyId, ResultReason, } from \"../sdk/Exports\";\nimport { CancellationErrorCodePropertyName, EnumTranslation, IntentResponse, ServiceRecognizerBase, SimpleSpeechPhrase, SpeechHypothesis, } from \"./Exports\";\n// tslint:disable-next-line:max-classes-per-file\nexport class IntentServiceRecognizer extends ServiceRecognizerBase {\n constructor(authentication, connectionFactory, audioSource, recognizerConfig, recognizer) {\n super(authentication, connectionFactory, audioSource, recognizerConfig, recognizer);\n this.privIntentRecognizer = recognizer;\n this.privIntentDataSent = false;\n }\n setIntents(addedIntents, umbrellaIntent) {\n this.privAddedLmIntents = addedIntents;\n this.privUmbrellaIntent = umbrellaIntent;\n this.privIntentDataSent = true;\n }\n processTypeSpecificMessages(connectionMessage) {\n return __awaiter(this, void 0, void 0, function* () {\n let result;\n let ev;\n let processed = false;\n const resultProps = new PropertyCollection();\n if (connectionMessage.messageType === MessageType.Text) {\n resultProps.setProperty(PropertyId.SpeechServiceResponse_JsonResult, connectionMessage.textBody);\n }\n switch (connectionMessage.path.toLowerCase()) {\n case \"speech.hypothesis\":\n const speechHypothesis = SpeechHypothesis.fromJSON(connectionMessage.textBody);\n result = new IntentRecognitionResult(undefined, this.privRequestSession.requestId, ResultReason.RecognizingIntent, speechHypothesis.Text, speechHypothesis.Duration, speechHypothesis.Offset + this.privRequestSession.currentTurnAudioOffset, speechHypothesis.Language, speechHypothesis.LanguageDetectionConfidence, undefined, connectionMessage.textBody, resultProps);\n this.privRequestSession.onHypothesis(result.offset);\n ev = new IntentRecognitionEventArgs(result, speechHypothesis.Offset + this.privRequestSession.currentTurnAudioOffset, this.privRequestSession.sessionId);\n if (!!this.privIntentRecognizer.recognizing) {\n try {\n this.privIntentRecognizer.recognizing(this.privIntentRecognizer, ev);\n /* tslint:disable:no-empty */\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n processed = true;\n break;\n case \"speech.phrase\":\n const simple = SimpleSpeechPhrase.fromJSON(connectionMessage.textBody);\n result = new IntentRecognitionResult(undefined, this.privRequestSession.requestId, EnumTranslation.implTranslateRecognitionResult(simple.RecognitionStatus), simple.DisplayText, simple.Duration, simple.Offset + this.privRequestSession.currentTurnAudioOffset, simple.Language, simple.LanguageDetectionConfidence, undefined, connectionMessage.textBody, resultProps);\n ev = new IntentRecognitionEventArgs(result, result.offset, this.privRequestSession.sessionId);\n const sendEvent = () => {\n if (!!this.privIntentRecognizer.recognized) {\n try {\n this.privIntentRecognizer.recognized(this.privIntentRecognizer, ev);\n /* tslint:disable:no-empty */\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n // report result to promise.\n if (!!this.privSuccessCallback) {\n try {\n this.privSuccessCallback(result);\n }\n catch (e) {\n if (!!this.privErrorCallback) {\n this.privErrorCallback(e);\n }\n }\n // Only invoke the call back once.\n // and if it's successful don't invoke the\n // error after that.\n this.privSuccessCallback = undefined;\n this.privErrorCallback = undefined;\n }\n };\n // If intent data was sent, the terminal result for this recognizer is an intent being found.\n // If no intent data was sent, the terminal event is speech recognition being successful.\n if (false === this.privIntentDataSent || ResultReason.NoMatch === ev.result.reason) {\n // Advance the buffers.\n this.privRequestSession.onPhraseRecognized(ev.offset + ev.result.duration);\n sendEvent();\n }\n else {\n // Squirrel away the args, when the response event arrives it will build upon them\n // and then return\n this.privPendingIntentArgs = ev;\n }\n processed = true;\n break;\n case \"response\":\n // Response from LUIS\n ev = this.privPendingIntentArgs;\n this.privPendingIntentArgs = undefined;\n if (undefined === ev) {\n if (\"\" === connectionMessage.textBody) {\n // This condition happens if there is nothing but silence in the\n // audio sent to the service.\n return;\n }\n // Odd... Not sure this can happen\n ev = new IntentRecognitionEventArgs(new IntentRecognitionResult(), 0 /*TODO*/, this.privRequestSession.sessionId);\n }\n const intentResponse = IntentResponse.fromJSON(connectionMessage.textBody);\n // If LUIS didn't return anything, send the existing event, else\n // modify it to show the match.\n // See if the intent found is in the list of intents asked for.\n let addedIntent = this.privAddedLmIntents[intentResponse.topScoringIntent.intent];\n if (this.privUmbrellaIntent !== undefined) {\n addedIntent = this.privUmbrellaIntent;\n }\n if (null !== intentResponse && addedIntent !== undefined) {\n const intentId = addedIntent.intentName === undefined ? intentResponse.topScoringIntent.intent : addedIntent.intentName;\n let reason = ev.result.reason;\n if (undefined !== intentId) {\n reason = ResultReason.RecognizedIntent;\n }\n // make sure, properties is set.\n const properties = (undefined !== ev.result.properties) ?\n ev.result.properties : new PropertyCollection();\n properties.setProperty(PropertyId.LanguageUnderstandingServiceResponse_JsonResult, connectionMessage.textBody);\n ev = new IntentRecognitionEventArgs(new IntentRecognitionResult(intentId, ev.result.resultId, reason, ev.result.text, ev.result.duration, ev.result.offset, undefined, undefined, ev.result.errorDetails, ev.result.json, properties), ev.offset, ev.sessionId);\n }\n this.privRequestSession.onPhraseRecognized(ev.offset + ev.result.duration);\n if (!!this.privIntentRecognizer.recognized) {\n try {\n this.privIntentRecognizer.recognized(this.privIntentRecognizer, ev);\n /* tslint:disable:no-empty */\n }\n catch (error) {\n // Not going to let errors in the event handler\n // trip things up.\n }\n }\n // report result to promise.\n if (!!this.privSuccessCallback) {\n try {\n this.privSuccessCallback(ev.result);\n }\n catch (e) {\n if (!!this.privErrorCallback) {\n this.privErrorCallback(e);\n }\n }\n // Only invoke the call back once.\n // and if it's successful don't invoke the\n // error after that.\n this.privSuccessCallback = undefined;\n this.privErrorCallback = undefined;\n }\n processed = true;\n break;\n default:\n break;\n }\n return processed;\n });\n }\n // Cancels recognition.\n cancelRecognition(sessionId, requestId, cancellationReason, errorCode, error) {\n const properties = new PropertyCollection();\n properties.setProperty(CancellationErrorCodePropertyName, CancellationErrorCode[errorCode]);\n if (!!this.privIntentRecognizer.canceled) {\n const cancelEvent = new IntentRecognitionCanceledEventArgs(cancellationReason, error, errorCode, undefined, undefined, sessionId);\n try {\n this.privIntentRecognizer.canceled(this.privIntentRecognizer, cancelEvent);\n /* tslint:disable:no-empty */\n }\n catch (_a) { }\n }\n if (!!this.privSuccessCallback) {\n const result = new IntentRecognitionResult(undefined, // Intent Id\n requestId, ResultReason.Canceled, undefined, // Text\n undefined, // Duration\n undefined, // Offset\n undefined, // Language\n undefined, // LanguageDetectionConfidence\n error, undefined, // Json\n properties);\n try {\n this.privSuccessCallback(result);\n this.privSuccessCallback = undefined;\n /* tslint:disable:no-empty */\n }\n catch (_b) { }\n }\n }\n}\n\n//# sourceMappingURL=IntentServiceRecognizer.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nexport class AuthInfo {\n constructor(headerName, token) {\n this.privHeaderName = headerName;\n this.privToken = token;\n }\n get headerName() {\n return this.privHeaderName;\n }\n get token() {\n return this.privToken;\n }\n}\n\n//# sourceMappingURL=IAuthentication.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\n// Make sure not to export internal modules.\n//\nexport * from \"./CognitiveSubscriptionKeyAuthentication\";\nexport * from \"./CognitiveTokenAuthentication\";\nexport * from \"./IAuthentication\";\nexport * from \"./IConnectionFactory\";\nexport * from \"./ISynthesisConnectionFactory\";\nexport * from \"./IntentConnectionFactory\";\nexport * from \"./RecognitionEvents\";\nexport * from \"./ServiceRecognizerBase\";\nexport * from \"./RecognizerConfig\";\nexport * from \"./SpeechServiceInterfaces\";\nexport * from \"./WebsocketMessageFormatter\";\nexport * from \"./SpeechConnectionFactory\";\nexport * from \"./TranscriberConnectionFactory\";\nexport * from \"./TranslationConnectionFactory\";\nexport * from \"./SpeechSynthesisConnectionFactory\";\nexport * from \"./EnumTranslation\";\nexport * from \"./ServiceMessages/Enums\";\nexport * from \"./ServiceMessages/TranslationSynthesisEnd\";\nexport * from \"./ServiceMessages/TranslationHypothesis\";\nexport * from \"./ServiceMessages/TranslationPhrase\";\nexport * from \"./TranslationServiceRecognizer\";\nexport * from \"./ServiceMessages/SpeechDetected\";\nexport * from \"./ServiceMessages/SpeechHypothesis\";\nexport * from \"./SpeechServiceRecognizer\";\nexport * from \"./TranscriptionServiceRecognizer\";\nexport * from \"./ServiceMessages/DetailedSpeechPhrase\";\nexport * from \"./ServiceMessages/SimpleSpeechPhrase\";\nexport * from \"./AddedLmIntent\";\nexport * from \"./IntentServiceRecognizer\";\nexport * from \"./ServiceMessages/IntentResponse\";\nexport * from \"./RequestSession\";\nexport * from \"./SpeechContext\";\nexport * from \"./DynamicGrammarBuilder\";\nexport * from \"./DynamicGrammarInterfaces\";\nexport * from \"./DialogServiceAdapter\";\nexport * from \"./AgentConfig\";\nexport * from \"./Transcription/Exports\";\nexport * from \"./ServiceMessages/SynthesisAudioMetadata\";\nexport * from \"./SynthesisTurn\";\nexport * from \"./SynthesisAdapterBase\";\nexport * from \"./SynthesizerConfig\";\nexport * from \"./SynthesisContext\";\nexport * from \"./SpeakerRecognitionConfig\";\nexport * from \"./SpeakerIdMessageAdapter\";\nexport const OutputFormatPropertyName = \"OutputFormat\";\nexport const CancellationErrorCodePropertyName = \"CancellationErrorCode\";\nexport const ServicePropertiesPropertyName = \"ServiceProperties\";\nexport const ForceDictationPropertyName = \"ForceDictation\";\nexport const AutoDetectSourceLanguagesOpenRangeOptionName = \"OpenRange\";\n\n//# sourceMappingURL=Exports.js.map\n","// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT license.\nexport class HeaderNames {\n}\nHeaderNames.AuthKey = \"Ocp-Apim-Subscription-Key\";\nHeaderNames.ConnectionId = \"X-ConnectionId\";\nHeaderNames.ContentType = \"Content-Type\";\nHeaderNames.CustomCommandsAppId = \"X-CommandsAppId\";\nHeaderNames.Path = \"Path\";\nHeaderNames.RequestId = \"X-RequestId\";\nHeaderNames.RequestStreamId = \"X-StreamId\";\nHeaderNames.RequestTimestamp = \"X-Timestamp\";\n\n//# sourceMappingURL=HeaderNames.js.map\n"],"sourceRoot":""}