{"ast":null,"code":"var __assign = this && this.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nimport { bodyRegExps, namedReferences } from './named-references.js';\nimport { numericUnicodeMap } from './numeric-unicode-map.js';\nimport { fromCodePoint, getCodePoint } from './surrogate-pairs.js';\nvar allNamedReferences = __assign(__assign({}, namedReferences), {\n all: namedReferences.html5\n});\nvar encodeRegExps = {\n specialChars: /[<>'\"&]/g,\n nonAscii: /[<>'\"&\\u0080-\\uD7FF\\uE000-\\uFFFF\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,\n nonAsciiPrintable: /[<>'\"&\\x01-\\x08\\x11-\\x15\\x17-\\x1F\\x7f-\\uD7FF\\uE000-\\uFFFF\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,\n nonAsciiPrintableOnly: /[\\x01-\\x08\\x11-\\x15\\x17-\\x1F\\x7f-\\uD7FF\\uE000-\\uFFFF\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,\n extensive: /[\\x01-\\x0c\\x0e-\\x1f\\x21-\\x2c\\x2e-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7d\\x7f-\\uD7FF\\uE000-\\uFFFF\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g\n};\nvar defaultEncodeOptions = {\n mode: 'specialChars',\n level: 'all',\n numeric: 'decimal'\n};\n/** Encodes all the necessary (specified by `level`) characters in the text */\nexport function encode(text, _a) {\n var _b = _a === void 0 ? defaultEncodeOptions : _a,\n _c = _b.mode,\n mode = _c === void 0 ? 'specialChars' : _c,\n _d = _b.numeric,\n numeric = _d === void 0 ? 'decimal' : _d,\n _e = _b.level,\n level = _e === void 0 ? 'all' : _e;\n if (!text) {\n return '';\n }\n var encodeRegExp = encodeRegExps[mode];\n var references = allNamedReferences[level].characters;\n var isHex = numeric === 'hexadecimal';\n return String.prototype.replace.call(text, encodeRegExp, function (input) {\n var result = references[input];\n if (!result) {\n var code = input.length > 1 ? getCodePoint(input, 0) : input.charCodeAt(0);\n result = (isHex ? '&#x' + code.toString(16) : '&#' + code) + ';';\n }\n return result;\n });\n}\nvar defaultDecodeOptions = {\n scope: 'body',\n level: 'all'\n};\nvar strict = /&(?:#\\d+|#[xX][\\da-fA-F]+|[0-9a-zA-Z]+);/g;\nvar attribute = /&(?:#\\d+|#[xX][\\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g;\nvar baseDecodeRegExps = {\n xml: {\n strict: strict,\n attribute: attribute,\n body: bodyRegExps.xml\n },\n html4: {\n strict: strict,\n attribute: attribute,\n body: bodyRegExps.html4\n },\n html5: {\n strict: strict,\n attribute: attribute,\n body: bodyRegExps.html5\n }\n};\nvar decodeRegExps = __assign(__assign({}, baseDecodeRegExps), {\n all: baseDecodeRegExps.html5\n});\nvar fromCharCode = String.fromCharCode;\nvar outOfBoundsChar = fromCharCode(65533);\nvar defaultDecodeEntityOptions = {\n level: 'all'\n};\nfunction getDecodedEntity(entity, references, isAttribute, isStrict) {\n var decodeResult = entity;\n var decodeEntityLastChar = entity[entity.length - 1];\n if (isAttribute && decodeEntityLastChar === '=') {\n decodeResult = entity;\n } else if (isStrict && decodeEntityLastChar !== ';') {\n decodeResult = entity;\n } else {\n var decodeResultByReference = references[entity];\n if (decodeResultByReference) {\n decodeResult = decodeResultByReference;\n } else if (entity[0] === '&' && entity[1] === '#') {\n var decodeSecondChar = entity[2];\n var decodeCode = decodeSecondChar == 'x' || decodeSecondChar == 'X' ? parseInt(entity.substr(3), 16) : parseInt(entity.substr(2));\n decodeResult = decodeCode >= 0x10ffff ? outOfBoundsChar : decodeCode > 65535 ? fromCodePoint(decodeCode) : fromCharCode(numericUnicodeMap[decodeCode] || decodeCode);\n }\n }\n return decodeResult;\n}\n/** Decodes a single entity */\nexport function decodeEntity(entity, _a) {\n var _b = _a === void 0 ? defaultDecodeEntityOptions : _a,\n _c = _b.level,\n level = _c === void 0 ? 'all' : _c;\n if (!entity) {\n return '';\n }\n return getDecodedEntity(entity, allNamedReferences[level].entities, false, false);\n}\n/** Decodes all entities in the text */\nexport function decode(text, _a) {\n var _b = _a === void 0 ? defaultDecodeOptions : _a,\n _c = _b.level,\n level = _c === void 0 ? 'all' : _c,\n _d = _b.scope,\n scope = _d === void 0 ? level === 'xml' ? 'strict' : 'body' : _d;\n if (!text) {\n return '';\n }\n var decodeRegExp = decodeRegExps[level][scope];\n var references = allNamedReferences[level].entities;\n var isAttribute = scope === 'attribute';\n var isStrict = scope === 'strict';\n return text.replace(decodeRegExp, function (entity) {\n return getDecodedEntity(entity, references, isAttribute, isStrict);\n });\n}","map":{"version":3,"names":["bodyRegExps","namedReferences","numericUnicodeMap","fromCodePoint","getCodePoint","allNamedReferences","__assign","all","html5","encodeRegExps","specialChars","nonAscii","nonAsciiPrintable","nonAsciiPrintableOnly","extensive","defaultEncodeOptions","mode","level","numeric","encode","text","_a","_b","_c","_d","_e","encodeRegExp","references","characters","isHex","String","prototype","replace","call","input","result","code","length","charCodeAt","toString","defaultDecodeOptions","scope","strict","attribute","baseDecodeRegExps","xml","body","html4","decodeRegExps","fromCharCode","outOfBoundsChar","defaultDecodeEntityOptions","getDecodedEntity","entity","isAttribute","isStrict","decodeResult","decodeEntityLastChar","decodeResultByReference","decodeSecondChar","decodeCode","parseInt","substr","decodeEntity","entities","decode","decodeRegExp"],"sources":["C:\\Users\\ikhba\\OneDrive\\Documents\\CIS3308\\landing_page\\node_modules\\html-entities\\src\\index.ts"],"sourcesContent":["import {bodyRegExps, namedReferences} from './named-references.js';\r\nimport {numericUnicodeMap} from './numeric-unicode-map.js';\r\nimport {fromCodePoint, getCodePoint} from './surrogate-pairs.js';\r\n\r\nconst allNamedReferences = {\r\n ...namedReferences,\r\n all: namedReferences.html5\r\n};\r\n\r\nexport type Level = 'xml' | 'html4' | 'html5' | 'all';\r\n\r\ninterface CommonOptions {\r\n level?: Level;\r\n}\r\n\r\nexport type EncodeMode = 'specialChars' | 'nonAscii' | 'nonAsciiPrintable' | 'nonAsciiPrintableOnly' | 'extensive';\r\n\r\nexport interface EncodeOptions extends CommonOptions {\r\n mode?: EncodeMode;\r\n numeric?: 'decimal' | 'hexadecimal';\r\n}\r\n\r\nexport type DecodeScope = 'strict' | 'body' | 'attribute';\r\n\r\nexport interface DecodeOptions extends CommonOptions {\r\n scope?: DecodeScope;\r\n}\r\n\r\nconst encodeRegExps: Record = {\r\n specialChars: /[<>'\"&]/g,\r\n nonAscii: /[<>'\"&\\u0080-\\uD7FF\\uE000-\\uFFFF\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,\r\n nonAsciiPrintable: /[<>'\"&\\x01-\\x08\\x11-\\x15\\x17-\\x1F\\x7f-\\uD7FF\\uE000-\\uFFFF\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,\r\n nonAsciiPrintableOnly: /[\\x01-\\x08\\x11-\\x15\\x17-\\x1F\\x7f-\\uD7FF\\uE000-\\uFFFF\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,\r\n extensive: /[\\x01-\\x0c\\x0e-\\x1f\\x21-\\x2c\\x2e-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7d\\x7f-\\uD7FF\\uE000-\\uFFFF\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g\r\n};\r\n\r\nconst defaultEncodeOptions: EncodeOptions = {\r\n mode: 'specialChars',\r\n level: 'all',\r\n numeric: 'decimal'\r\n};\r\n\r\n/** Encodes all the necessary (specified by `level`) characters in the text */\r\nexport function encode(\r\n text: string | undefined | null,\r\n {mode = 'specialChars', numeric = 'decimal', level = 'all'}: EncodeOptions = defaultEncodeOptions\r\n) {\r\n if (!text) {\r\n return '';\r\n }\r\n\r\n const encodeRegExp = encodeRegExps[mode];\r\n const references = allNamedReferences[level].characters;\r\n const isHex = numeric === 'hexadecimal';\r\n\r\n return String.prototype.replace.call(text, encodeRegExp, (input) => {\r\n let result = references[input];\r\n if (!result) {\r\n const code = input.length > 1 ? getCodePoint(input, 0)! : input.charCodeAt(0);\r\n result = (isHex ? '&#x' + code.toString(16) : '&#' + code) + ';';\r\n }\r\n return result;\r\n });\r\n}\r\n\r\nconst defaultDecodeOptions: DecodeOptions = {\r\n scope: 'body',\r\n level: 'all'\r\n};\r\n\r\nconst strict = /&(?:#\\d+|#[xX][\\da-fA-F]+|[0-9a-zA-Z]+);/g;\r\nconst attribute = /&(?:#\\d+|#[xX][\\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g;\r\n\r\nconst baseDecodeRegExps: Record, Record> = {\r\n xml: {\r\n strict,\r\n attribute,\r\n body: bodyRegExps.xml\r\n },\r\n html4: {\r\n strict,\r\n attribute,\r\n body: bodyRegExps.html4\r\n },\r\n html5: {\r\n strict,\r\n attribute,\r\n body: bodyRegExps.html5\r\n }\r\n};\r\n\r\nconst decodeRegExps: Record> = {\r\n ...baseDecodeRegExps,\r\n all: baseDecodeRegExps.html5\r\n};\r\n\r\nconst fromCharCode = String.fromCharCode;\r\nconst outOfBoundsChar = fromCharCode(65533);\r\n\r\nconst defaultDecodeEntityOptions: CommonOptions = {\r\n level: 'all'\r\n};\r\n\r\nfunction getDecodedEntity(\r\n entity: string,\r\n references: Record,\r\n isAttribute: boolean,\r\n isStrict: boolean\r\n): string {\r\n let decodeResult = entity;\r\n const decodeEntityLastChar = entity[entity.length - 1];\r\n if (isAttribute && decodeEntityLastChar === '=') {\r\n decodeResult = entity;\r\n } else if (isStrict && decodeEntityLastChar !== ';') {\r\n decodeResult = entity;\r\n } else {\r\n const decodeResultByReference = references[entity];\r\n if (decodeResultByReference) {\r\n decodeResult = decodeResultByReference;\r\n } else if (entity[0] === '&' && entity[1] === '#') {\r\n const decodeSecondChar = entity[2];\r\n const decodeCode =\r\n decodeSecondChar == 'x' || decodeSecondChar == 'X'\r\n ? parseInt(entity.substr(3), 16)\r\n : parseInt(entity.substr(2));\r\n\r\n decodeResult =\r\n decodeCode >= 0x10ffff\r\n ? outOfBoundsChar\r\n : decodeCode > 65535\r\n ? fromCodePoint(decodeCode)\r\n : fromCharCode(numericUnicodeMap[decodeCode] || decodeCode);\r\n }\r\n }\r\n return decodeResult;\r\n}\r\n\r\n/** Decodes a single entity */\r\nexport function decodeEntity(\r\n entity: string | undefined | null,\r\n {level = 'all'}: CommonOptions = defaultDecodeEntityOptions\r\n): string {\r\n if (!entity) {\r\n return '';\r\n }\r\n return getDecodedEntity(entity, allNamedReferences[level].entities, false, false);\r\n}\r\n\r\n/** Decodes all entities in the text */\r\nexport function decode(\r\n text: string | undefined | null,\r\n {level = 'all', scope = level === 'xml' ? 'strict' : 'body'}: DecodeOptions = defaultDecodeOptions\r\n) {\r\n if (!text) {\r\n return '';\r\n }\r\n\r\n const decodeRegExp = decodeRegExps[level][scope];\r\n const references = allNamedReferences[level].entities;\r\n const isAttribute = scope === 'attribute';\r\n const isStrict = scope === 'strict';\r\n\r\n return text.replace(decodeRegExp, (entity) => getDecodedEntity(entity, references, isAttribute, isStrict));\r\n}\r\n"],"mappings":";;;;;;;;;;AAAA,SAAQA,WAAW,EAAEC,eAAe,QAAO,uBAAuB;AAClE,SAAQC,iBAAiB,QAAO,0BAA0B;AAC1D,SAAQC,aAAa,EAAEC,YAAY,QAAO,sBAAsB;AAEhE,IAAMC,kBAAkB,GAAAC,QAAA,CAAAA,QAAA,KACjBL,eAAe;EAClBM,GAAG,EAAEN,eAAe,CAACO;AAAK,EAC7B;AAqBD,IAAMC,aAAa,GAA+B;EAC9CC,YAAY,EAAE,UAAU;EACxBC,QAAQ,EAAE,iFAAiF;EAC3FC,iBAAiB,EAAE,0G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