| 1 {"version":3,"sources":["classList.js"],"names":["self","document","createElemen
t","createElementNS","view","elemCtrProto","Element","objCtr","Object","strTrim"
,"String","trim","this","replace","arrIndexOf","Array","indexOf","item","i","len
","length","DOMEx","type","message","name","code","DOMException","checkTokenAndG
etIndex","classList","token","test","call","ClassList","elem","trimmedClasses","
getAttribute","classes","split","push","_updateClassName","setAttribute","toStri
ng","classListProto","classListGetter","Error","contains","add","tokens","argume
nts","l","updated","remove","index","splice","toggle","force","result","method",
"replacement_token","join","defineProperty","classListPropDesc","get","enumerabl
e","configurable","ex","undefined","number","__defineGetter__","testElement","cr
eateMethod","original","DOMTokenList","prototype","_toggle","slice","apply"],"ma
ppings":";;;;;;;;;AAaI,YAAcA,QAKT,aAAeC,UAASC,cAAc,QACxCD,SAASE,iBACP,aAAeF,UAAS
E,gBAAgB,6BAA6B,OAG3E,SAAUC,GAEX,YAEA,IAAM,WAAaA,GAAnB,CAEA,GAGIC,GAAeD,EAAKE,QA
AiB,UACrCC,EAASC,OACTC,EAAUC,OAAgB,UAAEC,MAAQ,WACpC,MAAOC,MAAKC,QAAQ,aAAc,KAElCC
,EAAaC,MAAe,UAAEC,SAAW,SAAUC,GAKnD,IAJA,GACIC,GAAI,EACJC,EAAMP,KAAKQ,OAERF,EAAIC
,EAAKD,IACd,GAAIA,IAAKN,OAAQA,KAAKM,KAAOD,EAC3B,MAAOC,EAGX,QAAQ,GAGRG,EAAQ,SAAUC
,EAAMC,GACxBX,KAAKY,KAAOF,EACZV,KAAKa,KAAOC,aAAaJ,GACzBV,KAAKW,QAAUA,GAEfI,EAAwB
,SAAUC,EAAWC,GAC7C,GAAc,KAAVA,EACF,KAAM,IAAIR,GACN,aACA,+BAGN,IAAI,KAAKS,KAAKD,G
ACZ,KAAM,IAAIR,GACN,wBACA,+CAGN,OAAOP,GAAWiB,KAAKH,EAAWC,IAElCG,EAAY,SAAUC,GAOtB
,IANA,GACIC,GAAiBzB,EAAQsB,KAAKE,EAAKE,aAAa,UAAY,I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6B,WAAWJ,MAAM,KAC/Be
,EAAQL,EAAO/B,QAAQa,EAAQ,KAE9BuB,IACHL,EAASA,EAAO4B,MAAMvB,GACtBxC,KAAKuC,OAAOyB
,MAAMhE,KAAMmC,GACxBnC,KAAKkC,IAAIY,GACT9C,KAAKkC,IAAI8B,MAAMhE,KAAMmC,EAAO4B,MA
AM,OAKxCN,EAAc","file":"classList.min.js","sourcesContent":["/*!\n * classList.j
s: Cross-browser full element.classList implementation.\n * 1.2.201711092\n *\n
* By Eli Grey, http://eligrey.com\n * License: Dedicated to the public domain.\n
* See https://github.com/eligrey/classList.js/blob/master/LICENSE.md\n */\n\n
/*global self, document, DOMException */\n\n/*! @source http://purl.eligrey.com/
github/classList.js/blob/master/classList.js */\n\nif (\"document\" in self) {\n
\n // Full polyfill for browsers with no classList support\n // Including IE
< Edge missing SVGElement.classList\n if (\n !(\"classList\" in document
.createElement(\"_\")) \n || document.createElementNS\n && !(\"classList\"
in document.createElementNS(\"http://www.w3.org/2000/svg\",\"g\"))\n ) {\n \n
(function (view) {\n \n \"use strict\";\n \n if (!('Element' in view)) ret
urn;\n \n var\n classListProp = \"classList\"\n , protoProp = \"protot
ype\"\n , elemCtrProto = view.Element[protoProp]\n , objCtr = Object\n
, strTrim = String[protoProp].trim || function () {\n return this.replace(/
^\\s+|\\s+$/g, \"\");\n }\n , arrIndexOf = Array[protoProp].indexOf || fun
ction (item) {\n var\n i = 0\n , len = this.length\n ;
\n for (; i < len; i++) {\n if (i in this && this[i] === item) {\n
return i;\n }\n }\n return -1;\n }\n // Vendors:
please allow content code to instantiate DOMExceptions\n , DOMEx = function (
type, message) {\n this.name = type;\n this.code = DOMException[type];
\n this.message = message;\n }\n , checkTokenAndGetIndex = function (
classList, token) {\n if (token === \"\") {\n throw new DOMEx(\n
\"SYNTAX_ERR\"\n , \"The token must not be empty.\"\n );
\n }\n if (/\\s/.test(token)) {\n throw new DOMEx(\n
\"INVALID_CHARACTER_ERR\"\n , \"The token must not contain space chara
cters.\"\n );\n }\n return arrIndexOf.call(classList, token);\n
}\n , ClassList = function (elem) {\n var\n trimmedClasses
= strTrim.call(elem.getAttribute(\"class\") || \"\")\n , classes = trimme
dClasses ? trimmedClasses.split(/\\s+/) : []\n , i = 0\n , len = c
lasses.length\n ;\n for (; i < len; i++) {\n this.push(classes[
i]);\n }\n this._updateClassName = function () {\n elem.setAttr
ibute(\"class\", this.toString());\n };\n }\n , classListProto = Clas
sList[protoProp] = []\n , classListGetter = function () {\n return new C
lassList(this);\n }\n ;\n // Most DOMException implementations don't allow
calling DOMException's toString()\n // on non-DOMExceptions. Error's toString()
is sufficient here.\n DOMEx[protoProp] = Error[protoProp];\n classListProto.i
tem = function (i) {\n return this[i] || null;\n };\n classListProto.contai
ns = function (token) {\n return !~checkTokenAndGetIndex(this, token + \"\");
\n };\n classListProto.add = function () {\n var\n tokens = argument
s\n , i = 0\n , l = tokens.length\n , token\n , updated = fa
lse\n ;\n do {\n token = tokens[i] + \"\";\n if (~checkTokenAndG
etIndex(this, token)) {\n this.push(token);\n updated = true;\n
}\n }\n while (++i < l);\n \n if (updated) {\n this._updateCla
ssName();\n }\n };\n classListProto.remove = function () {\n var\n
tokens = arguments\n , i = 0\n , l = tokens.length\n , token\n
, updated = false\n , index\n ;\n do {\n token = tokens[i]
+ \"\";\n index = checkTokenAndGetIndex(this, token);\n while (~index)
{\n this.splice(index, 1);\n updated = true;\n index = che
ckTokenAndGetIndex(this, token);\n }\n }\n while (++i < l);\n \n
if (updated) {\n this._updateClassName();\n }\n };\n classListProto.to
ggle = function (token, force) {\n var\n result = this.contains(token)
\n , method = result ?\n force !== true && \"remove\"\n :\n
force !== false && \"add\"\n ;\n \n if (method) {\n this[method]
(token);\n }\n \n if (force === true || force === false) {\n return
force;\n } else {\n return !result;\n }\n };\n classListProto.repla
ce = function (token, replacement_token) {\n var index = checkTokenAndGetInde
x(token + \"\");\n if (~index) {\n this.splice(index, 1, replacement_tok
en);\n this._updateClassName();\n }\n }\n classListProto.toString = fu
nction () {\n return this.join(\" \");\n };\n \n if (objCtr.defineProperty
) {\n var classListPropDesc = {\n get: classListGetter\n , enumer
able: true\n , configurable: true\n };\n try {\n objCtr.definePr
operty(elemCtrProto, classListProp, classListPropDesc);\n } catch (ex) { // I
E 8 doesn't support enumerable:true\n // adding undefined to fight this iss
ue https://github.com/eligrey/classList.js/issues/36\n // modernie IE8-MSW7
machine has IE8 8.0.6001.18702 and is affected\n if (ex.number === undefin
ed || ex.number === -0x7FF5EC54) {\n classListPropDesc.enumerable = false
;\n objCtr.defineProperty(elemCtrProto, classListProp, classListPropDesc)
;\n }\n }\n } else if (objCtr[protoProp].__defineGetter__) {\n elemC
trProto.__defineGetter__(classListProp, classListGetter);\n }\n \n }(self));\
n \n }\n \n // There is full or partial native classList support, so just ch
eck if we need\n // to normalize the add/remove and toggle APIs.\n \n (functi
on () {\n \"use strict\";\n \n var testElement = document.createElement(\
"_\");\n \n testElement.classList.add(\"c1\", \"c2\");\n \n // Polyfill
for IE 10/11 and Firefox <26, where classList.add and\n // classList.remove e
xist but support only one argument at a time.\n if (!testElement.classList.co
ntains(\"c2\")) {\n var createMethod = function(method) {\n var orig
inal = DOMTokenList.prototype[method];\n \n DOMTokenList.prototype[metho
d] = function(token) {\n var i, len = arguments.length;\n \n
for (i = 0; i < len; i++) {\n token = arguments[i];\n orig
inal.call(this, token);\n }\n };\n };\n createMethod('
add');\n createMethod('remove');\n }\n \n testElement.classList.togg
le(\"c3\", false);\n \n // Polyfill for IE 10 and Firefox <24, where classLi
st.toggle does not\n // support the second argument.\n if (testElement.cla
ssList.contains(\"c3\")) {\n var _toggle = DOMTokenList.prototype.toggle;\n
\n DOMTokenList.prototype.toggle = function(token, force) {\n if (
1 in arguments && !this.contains(token) === !force) {\n return force;\n
} else {\n return _toggle.call(this, token);\n }\n
};\n \n }\n \n // replace() polyfill\n if (!(\"replace\" in document.
createElement(\"_\").classList)) {\n DOMTokenList.prototype.replace = funct
ion (token, replacement_token) {\n var\n tokens = this.toStrin
g().split(\" \")\n , index = tokens.indexOf(token + \"\")\n ;\n
if (~index) {\n tokens = tokens.slice(index);\n this.re
move.apply(this, tokens);\n this.add(replacement_token);\n thi
s.add.apply(this, tokens.slice(1));\n }\n }\n }\n \n testElem
ent = null;\n }());\n \n }"]} |