{"version":3,"sources":["../js/Text/GreenlightTextCompare_Report.js"],"names":["g_oTextCompare_Report","TextCompareReport","prototype","printDifferencesReport","lockScreen","iDateTimeZone","Date","getTimezoneOffset","oDifferencesReportData","g_oTextCompareReport","generateDifferencesReportObject","oJSON","timeZone","dateFormat","g_oSettings","c_szDateFormat","reportData","$","post","url","data","JSON","stringify","contentType","dataType","cache","success","oResponse","Success","window","open","parse","Contents","g_oGreenlightMessages","displayErrorBubble","displayErrorContentHTML","Errors","error","g_oAnnotations","c_szPrintAnnotationsFailed","always","unlockScreen","iTotalDifferences","g_oTextCompare","countDifferences","iAdditionDifferences","eDifferenceTypes","Addition","iDeletionDifferences","Deletion","iSubstitutionDifferences","Substitution","WeightSubstitution","StyleSubstitution","WeightStyleSubstitution","iInitialDifferences","eDifferenceStatuses","Initial","iIgnoredDifferences","Ignore","iAcceptedDifferences","Accept","iRejectedDifferences","Reject","ApprovalDocumentName","g_oViewer","g_oArtworkViewer","g_oDoc","documentName","CompareDocumentName","g_oCompare","g_oCompareViewer","ComparisonAccuracy","g_iAccuracy","CaseSensitivity","g_iCaseSensitivity","BoldItalicDetection","g_iBoldItalicDetection","WhitespaceDetection","g_iWhitespaceDetection","DifferenceTotals","TotalDifferences","TotalAdditions","TotalDeletions","TotalSubstitutions","StatusTotals","TotalInitial","TotalIgnored","TotalAccepted","TotalRejected","DifferenceGroups","generateDifferenceGroupsReportObject","oGroupDifferenceGroupReportObjects","iHighestTextSelectionGroup","getHighestTextSelectionGroup","i","push","generateDifferenceGroupReportObject","iGroupOrder","oDifferenceGroupObject","GroupOrder","DifferencesTotal","Differences","ApprovalDifferencePages","ApprovalDifferenceWords","ApprovalDifferenceCharacters","CompareDifferencePages","CompareDifferenceWords","CompareDifferenceCharacters","oApprovalSectionGroup","getTextSelectionGroupFromOrder","oCompareSectionGroup","DifferenceOrder","DifferenceType","FailedToCalculate","DifferenceStatus","DifferenceText","SubstitutionDifferenceText","g_oTextDifferences","length","NoDifference","g_iDifferenceOrder","g_eDifferenceType","g_iDifferenceStatus","g_oFormattedDifferenceText","differenceTypeIsSubstitution","g_oTextSelections","indexOf","g_iPage","eAccuracyLevels","Word","j","g_oSelectionWords","Content","content","status","Bold","bold","Italic","italic","EndOfSelection","g_oSelectionCharacters","EndOfWord","lastInWord"],"mappings":"AAcA,IAAIA,sBAAwB,IAE3B,WACA,aAKA,SAASC,qBAKTA,kBAAkBC,UAAUC,uBAAyB,WAGpDC,aAGA,IAAIC,eAAgB,IAAKC,MAAMC,oBAG3BC,uBAAyBC,qBAAqBC,kCAG9CC,MAAQ,CACXC,SAAUP,cACVQ,WAAYC,YAAYC,eACxBC,WAAYR,wBAIbS,EAAEC,KAAK,CACNC,IAAK,mCACLC,KAAMC,KAAKC,UAAUX,OACrBY,YAAa,kCACbC,SAAU,OACVC,OAAO,EACPC,QAAS,SAAUC,WACdA,UAAUC,QACbC,OAAOC,KAAKT,KAAKU,MAAMJ,UAAUK,UAAW,UAG5CC,sBAAsBC,mBAAmBC,wBAAwBR,UAAUS,UAG7EC,MAAO,WACNJ,sBAAsBC,mBAAmBI,eAAeC,+BAGzDC,OAAO,WACPC,kBAOFxC,kBAAkBC,UAAUQ,gCAAkC,WAG7D,IAAIgC,kBAAoBC,eAAeC,iBAAiB,KAAM,KAAM,MAChEC,qBAAuBF,eAAeC,iBAAiB,KAAMD,eAAeG,iBAAiBC,SAAU,MACvGC,qBAAuBL,eAAeC,iBAAiB,KAAMD,eAAeG,iBAAiBG,SAAU,MACvGC,yBAA2BP,eAAeC,iBAAiB,KAAMD,eAAeG,iBAAiBK,aAAc,MACnHD,0BAA4BP,eAAeC,iBAAiB,KAAMD,eAAeG,iBAAiBM,mBAAoB,MACtHF,0BAA4BP,eAAeC,iBAAiB,KAAMD,eAAeG,iBAAiBO,kBAAmB,MACrHH,0BAA4BP,eAAeC,iBAAiB,KAAMD,eAAeG,iBAAiBQ,wBAAyB,MAG3H,IAAIC,oBAAsBZ,eAAeC,iBAAiB,KAAM,KAAMD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qBAAqBe,kBAAkB/B,GAAGqC,kBAAkBD,GAAGM,KACrEC,OAAQ3B,qBAAqBe,kBAAkB/B,GAAGqC,kBAAkBD,GAAGQ,OACvEC,eAAiBT,EAAI,GAAKpB,qBAAqBe,kBAAkB/B,GAAGqC,kBAAkBb,cAQxF,IAASY,EAAI,EAAGA,EAAIpB,qBAAqBe,kBAAkB/B,GAAG8C,uBAAuBtB,OAAQY,IAG5FhC,uBAAuBS,4BAA4BZ,KAAK,CACvDqC,QAAStB,qBAAqBe,kBAAkB/B,GAAG8C,uBAAuBV,GAAGG,QAC7ErB,eAAgBF,qBAAqBe,kBAAkB/B,GAAG8C,uBAAuBV,GAAGI,OACpFC,KAAMzB,qBAAqBe,kBAAkB/B,GAAG8C,uBAAuBV,GAAGM,KAC1EC,OAAQ3B,qBAAqBe,kBAAkB/B,GAAG8C,uBAAuBV,GAAGQ,OAC5EG,UAAW/B,qBAAqBe,kBAAkB/B,GAAG8C,uBAAuBV,GAAGY,WAC/EH,eAAiBT,EAAI,GAAKpB,qBAAqBe,kBAAkB/B,GAAG8C,uBAAuBtB,SAQhG,OAAOpB,wBAIRtE,OAAO5B,kBAAoBA,kBA5R5B","file":"GreenlightTextCompare_Report-ea1d736b42.js","sourcesContent":["/*\r\n * Copyright (c) 2023 SGS Europe. All rights reserved.\r\n *\r\n * This program is the CONFIDENTIAL and PROPRIETARY property of SGS Europe.\r\n * Any unauthorised use, reproduction, or transfer of this program is strictly\r\n * prohibited.\r\n *\r\n * File Name:\tGreenlightTextCompare_Report.js\r\n *\r\n * Description:\tThe class containing the functionality required for the text compare differences report.\r\n * \r\n */\r\n\r\n// The text compare report object.\r\nvar g_oTextCompare_Report = {};\r\n\r\n(function () {\r\n\t\"use strict\";\r\n\r\n\t/**\r\n\t * Text Compare Report Object.\r\n\t */\r\n\tfunction TextCompareReport() {};\r\n\r\n\t/**\r\n\t * Prints the differences report.\r\n\t */\r\n\tTextCompareReport.prototype.printDifferencesReport = function () {\r\n\r\n\t\t// Lock the screen.\r\n\t\tlockScreen();\r\n\r\n\t\t// Determine the time zone to be used.\r\n\t\tvar iDateTimeZone = (new Date).getTimezoneOffset();\r\n\r\n\t\t// Generate the differences report object to be uploaded.\r\n\t\tvar oDifferencesReportData = g_oTextCompareReport.generateDifferencesReportObject();\r\n\r\n\t\t// Create Server Call for the data.\r\n\t\tvar oJSON = {\r\n\t\t\ttimeZone: iDateTimeZone,\r\n\t\t\tdateFormat: g_oSettings.c_szDateFormat,\r\n\t\t\treportData: oDifferencesReportData\r\n\t\t};\r\n\r\n\t\t// Call the server to create the differences report.\r\n\t\t$.post({\r\n\t\t\turl: \"TextTools/PrintDifferencesReport\",\r\n\t\t\tdata: JSON.stringify(oJSON),\r\n\t\t\tcontentType: \"application/json; charset=utf-8\",\r\n\t\t\tdataType: \"json\",\r\n\t\t\tcache: false,\r\n\t\t\tsuccess: function (oResponse) {\r\n\t\t\t\tif (oResponse.Success) {\r\n\t\t\t\t\twindow.open(JSON.parse(oResponse.Contents), \"_blank\");\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tg_oGreenlightMessages.displayErrorBubble(displayErrorContentHTML(oResponse.Errors));\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\terror: function () {\r\n\t\t\t\tg_oGreenlightMessages.displayErrorBubble(g_oAnnotations.c_szPrintAnnotationsFailed);\r\n\t\t\t}\r\n\t\t})\r\n\t\t.always(function () {\r\n\t\t\tunlockScreen();\r\n\t\t});\r\n\t};\r\n\r\n\t/**\r\n\t * Generates the differences report object.\r\n\t */\r\n\tTextCompareReport.prototype.generateDifferencesReportObject = function () {\r\n\r\n\t\t// Get the number of each type of difference.\r\n\t\tvar iTotalDifferences = g_oTextCompare.countDifferences(null, null, null);\r\n\t\tvar iAdditionDifferences = g_oTextCompare.countDifferences(null, g_oTextCompare.eDifferenceTypes.Addition, null);\r\n\t\tvar iDeletionDifferences = g_oTextCompare.countDifferences(null, g_oTextCompare.eDifferenceTypes.Deletion, null);\r\n\t\tvar iSubstitutionDifferences = g_oTextCompare.countDifferences(null, g_oTextCompare.eDifferenceTypes.Substitution, null);\r\n\t\tiSubstitutionDifferences += g_oTextCompare.countDifferences(null, g_oTextCompare.eDifferenceTypes.WeightSubstitution, null);\r\n\t\tiSubstitutionDifferences += g_oTextCompare.countDifferences(null, g_oTextCompare.eDifferenceTypes.StyleSubstitution, null);\r\n\t\tiSubstitutionDifferences += g_oTextCompare.countDifferences(null, g_oTextCompare.eDifferenceTypes.WeightStyleSubstitution, null);\r\n\r\n\t\t// Get the number of each status type.\r\n\t\tvar iInitialDifferences = g_oTextCompare.countDifferences(null, null, g_oTextCompare.eDifferenceStatuses.Initial);\r\n\t\tvar iIgnoredDifferences = g_oTextCompare.countDifferences(null, null, g_oTextCompare.eDifferenceStatuses.Ignore);\r\n\t\tvar iAcceptedDifferences = g_oTextCompare.countDifferences(null, null, g_oTextCompare.eDifferenceStatuses.Accept);\r\n\t\tvar iRejectedDifferences = g_oTextCompare.countDifferences(null, null, g_oTextCompare.eDifferenceStatuses.Reject);\r\n\r\n\t\t// Build the differences report object.\r\n\t\treturn {\r\n\t\t\tApprovalDocumentName: g_oViewer.g_oArtworkViewer.g_oDoc.documentName,\r\n\t\t\tCompareDocumentName: g_oCompare.g_oCompareViewer.g_oDoc.documentName,\r\n\t\t\tComparisonAccuracy: g_oTextCompare.g_iAccuracy,\r\n\t\t\tCaseSensitivity: g_oTextCompare.g_iCaseSensitivity,\r\n\t\t\tBoldItalicDetection: g_oTextCompare.g_iBoldItalicDetection,\r\n\t\t\tWhitespaceDetection: g_oTextCompare.g_iWhitespaceDetection,\r\n\t\t\tDifferenceTotals: {\r\n\t\t\t\tTotalDifferences: iTotalDifferences,\r\n\t\t\t\tTotalAdditions: iAdditionDifferences,\r\n\t\t\t\tTotalDeletions: iDeletionDifferences,\r\n\t\t\t\tTotalSubstitutions: iSubstitutionDifferences\r\n\t\t\t},\r\n\t\t\tStatusTotals: {\r\n\t\t\t\tTotalInitial: iInitialDifferences,\r\n\t\t\t\tTotalIgnored: iIgnoredDifferences,\r\n\t\t\t\tTotalAccepted: iAcceptedDifferences,\r\n\t\t\t\tTotalRejected: iRejectedDifferences\r\n\t\t\t},\r\n\t\t\tDifferenceGroups: g_oTextCompareReport.generateDifferenceGroupsReportObject()\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t * Generates the differences report group object.\r\n\t */\r\n\tTextCompareReport.prototype.generateDifferenceGroupsReportObject = function () {\r\n\r\n\t\t// Outline the list to be returned.\r\n\t\tvar oGroupDifferenceGroupReportObjects = [];\r\n\r\n\t\t// Get the highest text selection group.\r\n\t\tvar iHighestTextSelectionGroup = g_oTextCompare.getHighestTextSelectionGroup(true, true);\r\n\r\n\t\t// Loop through each of the sections up to the highest.\r\n\t\tfor (var i = 1; i <= iHighestTextSelectionGroup; i++) {\r\n\r\n\t\t\t// Generate the difference object for this group.\r\n\t\t\toGroupDifferenceGroupReportObjects.push(g_oTextCompareReport.generateDifferenceGroupReportObject(i));\r\n\t\t}\r\n\r\n\t\t// Return the list.\r\n\t\treturn oGroupDifferenceGroupReportObjects;\r\n\t};\r\n\r\n\t/**\r\n\t * Generates the difference group report object.\r\n\t * @param {int} iGroupOrder - The group order.\r\n\t */\r\n\tTextCompareReport.prototype.generateDifferenceGroupReportObject = function (iGroupOrder) {\r\n\r\n\t\t// Outline the difference group object to be populated.\r\n\t\tvar oDifferenceGroupObject = {\r\n\t\t\tGroupOrder: iGroupOrder,\r\n\t\t\tDifferencesTotal: g_oTextCompare.countDifferences(iGroupOrder, null, null),\r\n\t\t\tDifferences: [],\r\n\t\t\tApprovalDifferencePages: [],\r\n\t\t\tApprovalDifferenceWords: [],\r\n\t\t\tApprovalDifferenceCharacters: [],\r\n\t\t\tCompareDifferencePages: [],\r\n\t\t\tCompareDifferenceWords: [],\r\n\t\t\tCompareDifferenceCharacters: []\r\n\t\t};\r\n\r\n\t\t// Get the approval group for the order.\r\n\t\tvar oApprovalSectionGroup = g_oTextCompare.getTextSelectionGroupFromOrder(iGroupOrder, false);\r\n\r\n\t\t// Get the comapre group for the order.\r\n\t\tvar oCompareSectionGroup = g_oTextCompare.getTextSelectionGroupFromOrder(iGroupOrder, true);\r\n\r\n\t\t// If we have failed to calculate differences.\r\n\t\tif (oApprovalSectionGroup == null || oCompareSectionGroup == null) {\r\n\r\n\t\t\t// Add that we have failed to calculate the differences.\r\n\t\t\toDifferenceGroupObject.Differences.push({\r\n\t\t\t\tDifferenceOrder: 1,\r\n\t\t\t\tDifferenceType: g_oTextCompare.eDifferenceTypes.FailedToCalculate,\r\n\t\t\t\tDifferenceStatus: g_oTextCompare.eDifferenceStatuses.Reject,\r\n\t\t\t\tDifferenceText: \"\",\r\n\t\t\t\tSubstitutionDifferenceText: \"\"\r\n\t\t\t});\r\n\t\t}\r\n\t\t// If we have no differences.\r\n\t\telse if (oApprovalSectionGroup.g_oTextDifferences.length == 0) {\r\n\r\n\t\t\t// Add that we have no differences.\r\n\t\t\toDifferenceGroupObject.Differences.push({\r\n\t\t\t\tDifferenceOrder: 1,\r\n\t\t\t\tDifferenceType: g_oTextCompare.eDifferenceTypes.NoDifference,\r\n\t\t\t\tDifferenceStatus: g_oTextCompare.eDifferenceStatuses.Accept,\r\n\t\t\t\tDifferenceText: \"\",\r\n\t\t\t\tSubstitutionDifferenceText: \"\"\r\n\t\t\t});\r\n\t\t}\r\n\t\t// If we have calculated differences.\r\n\t\telse {\r\n\r\n\t\t\t// Loop through each of the differences for the group.\r\n\t\t\tfor (var i = 0; i < oApprovalSectionGroup.g_oTextDifferences.length; i++) {\r\n\r\n\t\t\t\t// Add the difference.\r\n\t\t\t\toDifferenceGroupObject.Differences.push({\r\n\t\t\t\t\tDifferenceOrder: oApprovalSectionGroup.g_oTextDifferences[i].g_iDifferenceOrder,\r\n\t\t\t\t\tDifferenceType: oApprovalSectionGroup.g_oTextDifferences[i].g_eDifferenceType,\r\n\t\t\t\t\tDifferenceStatus: oApprovalSectionGroup.g_oTextDifferences[i].g_iDifferenceStatus,\r\n\t\t\t\t\tDifferenceText: oApprovalSectionGroup.g_oTextDifferences[i].g_oFormattedDifferenceText[0],\r\n\t\t\t\t\tSubstitutionDifferenceText: g_oTextCompare.differenceTypeIsSubstitution(oApprovalSectionGroup.g_oTextDifferences[i].g_eDifferenceType) ? oApprovalSectionGroup.g_oTextDifferences[i].g_oFormattedDifferenceText[1] : \"\"\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If we have approval text selections.\r\n\t\tif (oApprovalSectionGroup != null) {\r\n\r\n\t\t\t// Loop through each of the selections for the approval group.\r\n\t\t\tfor (var i = 0; i < oApprovalSectionGroup.g_oTextSelections.length; i++) {\r\n\r\n\t\t\t\t// Add the page number if missing.\r\n\t\t\t\tif (oDifferenceGroupObject.ApprovalDifferencePages.indexOf(oApprovalSectionGroup.g_oTextSelections[i].g_iPage) == -1) {\r\n\t\t\t\t\toDifferenceGroupObject.ApprovalDifferencePages.push(oApprovalSectionGroup.g_oTextSelections[i].g_iPage);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If we are at a word accuracy level.\r\n\t\t\t\tif (g_oTextCompare.g_iAccuracy == g_oTextCompare.eAccuracyLevels.Word) {\r\n\r\n\t\t\t\t\t// Loop through each of the words in the selection.\r\n\t\t\t\t\tfor (var j = 0; j < oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionWords.length; j++) {\r\n\r\n\t\t\t\t\t\t// Add the approval difference word.\r\n\t\t\t\t\t\toDifferenceGroupObject.ApprovalDifferenceWords.push({\r\n\t\t\t\t\t\t\tContent: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionWords[j].content,\r\n\t\t\t\t\t\t\tDifferenceType: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionWords[j].status,\r\n\t\t\t\t\t\t\tBold: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionWords[j].bold,\r\n\t\t\t\t\t\t\tItalic: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionWords[j].italic,\r\n\t\t\t\t\t\t\tEndOfSelection: (j + 1 == oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionWords.length)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// If we are at a character accuracy level.\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t\t// Loop through each of the characters in the selection.\r\n\t\t\t\t\tfor (var j = 0; j < oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionCharacters.length; j++) {\r\n\r\n\t\t\t\t\t\t// Add the approval difference character.\r\n\t\t\t\t\t\toDifferenceGroupObject.ApprovalDifferenceCharacters.push({\r\n\t\t\t\t\t\t\tContent: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].content,\r\n\t\t\t\t\t\t\tDifferenceType: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].status,\r\n\t\t\t\t\t\t\tBold: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].bold,\r\n\t\t\t\t\t\t\tItalic: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].italic,\r\n\t\t\t\t\t\t\tEndOfWord: oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].lastInWord,\r\n\t\t\t\t\t\t\tEndOfSelection: (j + 1 == oApprovalSectionGroup.g_oTextSelections[i].g_oSelectionCharacters.length)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// If we have compare text selections.\r\n\t\tif (oCompareSectionGroup != null) {\r\n\r\n\t\t\t// Loop through each of the difference words for the compare group.\r\n\t\t\tfor (var i = 0; i < oCompareSectionGroup.g_oTextSelections.length; i++) {\r\n\r\n\t\t\t\t// Add the page number if missing.\r\n\t\t\t\tif (oDifferenceGroupObject.CompareDifferencePages.indexOf(oCompareSectionGroup.g_oTextSelections[i].g_iPage) == -1) {\r\n\t\t\t\t\toDifferenceGroupObject.CompareDifferencePages.push(oCompareSectionGroup.g_oTextSelections[i].g_iPage);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If we are at a word accuracy level.\r\n\t\t\t\tif (g_oTextCompare.g_iAccuracy == g_oTextCompare.eAccuracyLevels.Word) {\r\n\r\n\t\t\t\t\t// Loop through each of the words in the selection.\r\n\t\t\t\t\tfor (var j = 0; j < oCompareSectionGroup.g_oTextSelections[i].g_oSelectionWords.length; j++) {\r\n\r\n\t\t\t\t\t\t// Add the compare difference word.\r\n\t\t\t\t\t\toDifferenceGroupObject.CompareDifferenceWords.push({\r\n\t\t\t\t\t\t\tContent: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionWords[j].content,\r\n\t\t\t\t\t\t\tDifferenceType: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionWords[j].status,\r\n\t\t\t\t\t\t\tBold: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionWords[j].bold,\r\n\t\t\t\t\t\t\tItalic: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionWords[j].italic,\r\n\t\t\t\t\t\t\tEndOfSelection: (j + 1 == oCompareSectionGroup.g_oTextSelections[i].g_oSelectionWords.length)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// If we are at a character accuracy level.\r\n\t\t\t\telse {\r\n\r\n\t\t\t\t\t// Loop through each of the characters in the selection.\r\n\t\t\t\t\tfor (var j = 0; j < oCompareSectionGroup.g_oTextSelections[i].g_oSelectionCharacters.length; j++) {\r\n\r\n\t\t\t\t\t\t// Add the compare difference character.\r\n\t\t\t\t\t\toDifferenceGroupObject.CompareDifferenceCharacters.push({\r\n\t\t\t\t\t\t\tContent: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].content,\r\n\t\t\t\t\t\t\tDifferenceType: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].status,\r\n\t\t\t\t\t\t\tBold: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].bold,\r\n\t\t\t\t\t\t\tItalic: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].italic,\r\n\t\t\t\t\t\t\tEndOfWord: oCompareSectionGroup.g_oTextSelections[i].g_oSelectionCharacters[j].lastInWord,\r\n\t\t\t\t\t\t\tEndOfSelection: (j + 1 == oCompareSectionGroup.g_oTextSelections[i].g_oSelectionCharacters.length)\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Return the populated object.\r\n\t\treturn oDifferenceGroupObject;\r\n\t};\r\n\r\n\t// Add the Text Compare UI object to the window.\r\n\twindow.TextCompareReport = TextCompareReport;\r\n}());"]}