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eAAU,KAAK,2EACtD,CAAC;QAClE,CAAC;QACD,IAAI,CAAC,CAAC;YACJ,MAAM,CAAC,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;IAEa,yBAAa,GAA3B,UAA4B,QAAgB;QAC1C,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACjB,KAAK,IAAI;gBACP,MAAM,CAAC,QAAQ,CAAC;YAClB,KAAK,IAAI;gBACP,MAAM,CAAC,UAAU,CAAC;YACpB;gBACE,MAAM,CAAC,EAAE,CAAC;QACd,CAAC;IACH,CAAC;IACH,kBAAC;AAAD,CAzCA,AAyCC,IAAA;AAzCY,kCAAW","file":"webparts/SearchUtils.js","sourcesContent":["export interface ISearchQueryResponse {\n PrimaryQueryResult: IPrimaryQueryResult;\n}\n\nexport interface IPrimaryQueryResult {\n RelevantResults?: IRelevantResults;\n}\n\nexport interface IRelevantResults {\n RowCount: number;\n Table?: ITable;\n}\n\nexport interface ITable {\n Rows?: IRow[];\n}\n\nexport interface IRow {\n Cells: ICell[];\n}\n\nexport interface ICell {\n Key: string;\n Value: string;\n ValueType: string;\n}\n\nexport interface IEdge {\n ActorId: number;\n ObjectId: number;\n Properties: IEdgeProperties;\n}\n\nexport interface IEdgeProperties {\n Action: number;\n Blob: any[];\n BlobContent: string;\n ObjectSource: number;\n Time: string;\n Weight: number;\n}\n\nexport class SearchUtils {\n public static getValueFromResults(key: string, results: ICell[]): string {\n let value: string = undefined;\n\n if (results && results.length > 0 && key) {\n for (let i: number = 0; i < results.length; i++) {\n const resultItem: ICell = results[i];\n if (resultItem.Key === key) {\n value = resultItem.Value;\n break;\n }\n }\n }\n\n return value;\n }\n\n public static getPreviewImageUrl(result: ICell[], siteUrl: string): string {\n const uniqueID: string = SearchUtils.getValueFromResults('uniqueID', result);\n const siteId: string = SearchUtils.getValueFromResults('siteID', result);\n const webId: string = SearchUtils.getValueFromResults('webID', result);\n const docId: string = SearchUtils.getValueFromResults('DocId', result);\n if (uniqueID && siteId && webId && docId) {\n return `${siteUrl}/_layouts/15/getpreview.ashx?guidFile=${uniqueID}&guidSite=${siteId}&guidWeb=${webId}&docid=${docId}\n &metadatatoken=300x424x2&ClientType=CodenameOsloWeb&size=small`;\n }\n else {\n return '';\n }\n }\n\n public static getActionName(actionId: number): string {\n switch (actionId) {\n case 1001:\n return 'Viewed';\n case 1003:\n return 'Modified';\n default:\n return '';\n }\n }\n}"],"sourceRoot":"..\\..\\src"}