{"ScriptPreparationCode":"window.productTypes = [\r\n \u0022TVProductKind.StreamingOnly\u0022,\r\n \u0022\u0022,\r\n \u0022p\u0022,\r\n \u0022TVProductKind.Digitenne\u0022,\r\n \u0022ProductCategory.TV\u0022,\r\n \u0022TVProductKind.Digitenne\u0022,\r\n \u0022TVProductKind.TVStreaming\u0022,\r\n \u0022TVProductKind.TVStreaming\u0022,\r\n \u0022TVProductKind.StreamingOnly\u0022,\r\n \u0022TVProductKind.Digitenne\u0022,\r\n \u0022ProductCategory.Internet\u0022,\r\n \u0022TVProductKind.TVStreaming\u0022,\r\n \u0022TVProductKind.ITV\u0022,\r\n \u0022ProductCategory.Internet\u0022,\r\n \u0022\u0022,\r\n \u0022ProductCategory.Voice\u0022,\r\n \u0022ProductCategory.TV\u0022,\r\n \u0022TVProductKind.TVStreaming\u0022,\r\n \u0022ProductCategory.TV\u0022,\r\n \u0022ProductCategory.Internet\u0022,\r\n \u0022TVProductKind.TVStreaming\u0022\r\n];\r\n\r\nwindow.tvProductKinds = [\r\n \u0022TVProductKind.ITV\u0022,\r\n \u0022TVProductKind.Digitenne\u0022,\r\n \u0022TVProductKind.TVStrEaming\u0022,\r\n \u0022TVProductKind.StreamingOnly\u0022\r\n];\r\n\r\nwindow.priorityList = [\r\n \u0022ProductCategory.Internet\u0022,\r\n \u0022ProductCategory.TV\u0022,\r\n \u0022ProductCategory.Voice\u0022\r\n];\r\n\r\nwindow.prioritarySorter = (a, b) =\u003E\r\n priorityList.indexOf(a) - priorityList.indexOf(b);\r\n\r\nwindow.reducedProductTypes = productTypes.reduce(\r\n (filtered, prod) =\u003E\r\n tvProductKinds.includes(prod) ?\r\n [...filtered, \u0022ProductCategory.TV\u0022] :\r\n priorityList.includes(prod) ?\r\n [...filtered, prod] :\r\n filtered,\r\n []\r\n);","TestCases":[{"Name":"uniq .sort","Code":"return _.uniq(reducedProductTypes.sort(prioritarySorter))","IsDeferred":false},{"Name":"sortedUniqBy","Code":"return _.sortedUniqBy(\r\n reducedProductTypes,\r\n prioritarySorter\r\n);","IsDeferred":false}]}