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AAM+C,EAAM,IAAkB,QAAZA,EAAM,GAAe,QAAU,SAMhF,SAASd,IACHvD,MAAMgB,KAAKC,SAASsD,KAAM,eAAe,IAI9C,CAACA,KAAMH,EAAgBG,OAAOzC,SAAQ,SAAUC,GAC/CA,EAAEC,UAAUxB,IAAIgB,EAAa,mBAM/B,SAASgC,IACR,CAACe,KAAMH,EAAgBG,OAAOzC,SAAQ,SAAUC,GAC/CA,EAAEC,UAAUC,OAAOT,EAAa,mBAMlC,SAASiC,IACHzD,MAAMgB,KAAKC,SAASsD,KAAM,gBAAgB,IAI/C,CAACA,KAAMH,EAAgBG,OAAOzC,SAAQ,SAAUC,GAC/CA,EAAEC,UAAUxB,IAAIgB,EAAa,uBAlFhC","sources":["webpack://sakurairo-scripts/./node_modules/prismjs/plugins/match-braces/prism-match-braces.js"],"sourcesContent":["(function () {\n\n\tif (typeof Prism === 'undefined' || typeof document === 'undefined') {\n\t\treturn;\n\t}\n\n\tfunction mapClassName(name) {\n\t\tvar customClass = Prism.plugins.customClass;\n\t\tif (customClass) {\n\t\t\treturn customClass.apply(name, 'none');\n\t\t} else {\n\t\t\treturn name;\n\t\t}\n\t}\n\n\tvar PARTNER = {\n\t\t'(': ')',\n\t\t'[': ']',\n\t\t'{': '}',\n\t};\n\n\t// The names for brace types.\n\t// These names have two purposes: 1) they can be used for styling and 2) they are used to pair braces. Only braces\n\t// of the same type are paired.\n\tvar NAMES = {\n\t\t'(': 'brace-round',\n\t\t'[': 'brace-square',\n\t\t'{': 'brace-curly',\n\t};\n\n\t// A map for brace aliases.\n\t// This is useful for when some braces have a prefix/suffix as part of the punctuation token.\n\tvar BRACE_ALIAS_MAP = {\n\t\t'${': '{', // JS template punctuation (e.g. `foo ${bar + 1}`)\n\t};\n\n\tvar LEVEL_WARP = 12;\n\n\tvar pairIdCounter = 0;\n\n\tvar BRACE_ID_PATTERN = /^(pair-\\d+-)(close|open)$/;\n\n\t/**\n\t * Returns the brace partner given one brace of a brace pair.\n\t *\n\t * @param {HTMLElement} brace\n\t * @returns {HTMLElement}\n\t */\n\tfunction getPartnerBrace(brace) {\n\t\tvar match = BRACE_ID_PATTERN.exec(brace.id);\n\t\treturn document.querySelector('#' + match[1] + (match[2] == 'open' ? 'close' : 'open'));\n\t}\n\n\t/**\n\t * @this {HTMLElement}\n\t */\n\tfunction hoverBrace() {\n\t\tif (!Prism.util.isActive(this, 'brace-hover', true)) {\n\t\t\treturn;\n\t\t}\n\n\t\t[this, getPartnerBrace(this)].forEach(function (e) {\n\t\t\te.classList.add(mapClassName('brace-hover'));\n\t\t});\n\t}\n\t/**\n\t * @this {HTMLElement}\n\t */\n\tfunction leaveBrace() {\n\t\t[this, getPartnerBrace(this)].forEach(function (e) {\n\t\t\te.classList.remove(mapClassName('brace-hover'));\n\t\t});\n\t}\n\t/**\n\t * @this {HTMLElement}\n\t */\n\tfunction clickBrace() {\n\t\tif (!Prism.util.isActive(this, 'brace-select', true)) {\n\t\t\treturn;\n\t\t}\n\n\t\t[this, getPartnerBrace(this)].forEach(function (e) {\n\t\t\te.classList.add(mapClassName('brace-selected'));\n\t\t});\n\t}\n\n\tPrism.hooks.add('complete', function (env) {\n\n\t\t/** @type {HTMLElement} */\n\t\tvar code = env.element;\n\t\tvar pre = code.parentElement;\n\n\t\tif (!pre || pre.tagName != 'PRE') {\n\t\t\treturn;\n\t\t}\n\n\t\t// find the braces to match\n\t\t/** @type {string[]} */\n\t\tvar toMatch = [];\n\t\tif (Prism.util.isActive(code, 'match-braces')) {\n\t\t\ttoMatch.push('(', '[', '{');\n\t\t}\n\n\t\tif (toMatch.length == 0) {\n\t\t\t// nothing to match\n\t\t\treturn;\n\t\t}\n\n\t\tif (!pre.__listenerAdded) {\n\t\t\t// code blocks might be highlighted more than once\n\t\t\tpre.addEventListener('mousedown', function removeBraceSelected() {\n\t\t\t\t// the code element might have been replaced\n\t\t\t\tvar code = pre.querySelector('code');\n\t\t\t\tvar className = mapClassName('brace-selected');\n\t\t\t\tArray.prototype.slice.call(code.querySelectorAll('.' + className)).forEach(function (e) {\n\t\t\t\t\te.classList.remove(className);\n\t\t\t\t});\n\t\t\t});\n\t\t\tObject.defineProperty(pre, '__listenerAdded', { value: true });\n\t\t}\n\n\t\t/** @type {HTMLSpanElement[]} */\n\t\tvar punctuation = Array.prototype.slice.call(\n\t\t\tcode.querySelectorAll('span.' + mapClassName('token') + '.' + mapClassName('punctuation'))\n\t\t);\n\n\t\t/** @type {{ index: number, open: boolean, element: HTMLElement }[]} */\n\t\tvar allBraces = [];\n\n\t\ttoMatch.forEach(function (open) {\n\t\t\tvar close = PARTNER[open];\n\t\t\tvar name = mapClassName(NAMES[open]);\n\n\t\t\t/** @type {[number, number][]} */\n\t\t\tvar pairs = [];\n\t\t\t/** @type {number[]} */\n\t\t\tvar openStack = [];\n\n\t\t\tfor (var i = 0; i < punctuation.length; i++) {\n\t\t\t\tvar element = punctuation[i];\n\t\t\t\tif (element.childElementCount == 0) {\n\t\t\t\t\tvar text = element.textContent;\n\t\t\t\t\ttext = BRACE_ALIAS_MAP[text] || text;\n\t\t\t\t\tif (text === open) {\n\t\t\t\t\t\tallBraces.push({ index: i, open: true, element: element });\n\t\t\t\t\t\telement.classList.add(name);\n\t\t\t\t\t\telement.classList.add(mapClassName('brace-open'));\n\t\t\t\t\t\topenStack.push(i);\n\t\t\t\t\t} else if (text === close) {\n\t\t\t\t\t\tallBraces.push({ index: i, open: false, element: element });\n\t\t\t\t\t\telement.classList.add(name);\n\t\t\t\t\t\telement.classList.add(mapClassName('brace-close'));\n\t\t\t\t\t\tif (openStack.length) {\n\t\t\t\t\t\t\tpairs.push([i, openStack.pop()]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpairs.forEach(function (pair) {\n\t\t\t\tvar pairId = 'pair-' + (pairIdCounter++) + '-';\n\n\t\t\t\tvar opening = punctuation[pair[0]];\n\t\t\t\tvar closing = punctuation[pair[1]];\n\n\t\t\t\topening.id = pairId + 'open';\n\t\t\t\tclosing.id = pairId + 'close';\n\n\t\t\t\t[opening, closing].forEach(function (e) {\n\t\t\t\t\te.addEventListener('mouseenter', hoverBrace);\n\t\t\t\t\te.addEventListener('mouseleave', leaveBrace);\n\t\t\t\t\te.addEventListener('click', clickBrace);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\tvar level = 0;\n\t\tallBraces.sort(function (a, b) { return a.index - b.index; });\n\t\tallBraces.forEach(function (brace) {\n\t\t\tif (brace.open) {\n\t\t\t\tbrace.element.classList.add(mapClassName('brace-level-' + (level % LEVEL_WARP + 1)));\n\t\t\t\tlevel++;\n\t\t\t} else {\n\t\t\t\tlevel = Math.max(0, level - 1);\n\t\t\t\tbrace.element.classList.add(mapClassName('brace-level-' + (level % LEVEL_WARP + 1)));\n\t\t\t}\n\t\t});\n\t});\n\n}());\n"],"names":["Prism","document","PARTNER","NAMES","BRACE_ALIAS_MAP","pairIdCounter","BRACE_ID_PATTERN","hooks","add","env","code","element","pre","parentElement","tagName","toMatch","util","isActive","push","length","__listenerAdded","addEventListener","querySelector","className","mapClassName","Array","prototype","slice","call","querySelectorAll","forEach","e","classList","remove","Object","defineProperty","value","punctuation","allBraces","open","close","name","pairs","openStack","i","childElementCount","text","textContent","index","pop","pair","pairId","opening","closing","id","hoverBrace","leaveBrace","clickBrace","level","sort","a","b","brace","Math","max","customClass","plugins","apply","getPartnerBrace","match","exec","this"],"sourceRoot":""}