forked from zhurui/management
7 lines
205 KiB
JavaScript
7 lines
205 KiB
JavaScript
|
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.csso=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,function(e){var n=t[a][1][e];return o(n||e)},u,u.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){var r=e("css-tree").keyword;t.exports=function(e,t,n){if(e.block&&(null!==this.stylesheet&&(this.stylesheet.firstAtrulesAllowed=!1),e.block.children.isEmpty()))return void n.remove(t);switch(e.name){case"charset":if(!e.prelude||e.prelude.children.isEmpty())return void n.remove(t);if(t.prev)return void n.remove(t);break;case"import":if(null===this.stylesheet||!this.stylesheet.firstAtrulesAllowed)return void n.remove(t);n.prevUntil(t.prev,function(e){if("Atrule"!==e.type||"import"!==e.name&&"charset"!==e.name)return this.root.firstAtrulesAllowed=!1,n.remove(t),!0},this);break;default:var o=r(e.name).basename;"keyframes"!==o&&"media"!==o&&"supports"!==o||e.prelude&&!e.prelude.children.isEmpty()||n.remove(t)}}},{"css-tree":44}],2:[function(e,t,n){t.exports=function(e,t,n){n.remove(t)}},{}],3:[function(e,t,n){t.exports=function(e,t,n){e.value.children&&e.value.children.isEmpty()&&n.remove(t)}},{}],4:[function(e,t,n){t.exports=function(e,t,n){"+"!==e.value&&"-"!==e.value&&(null!==t.prev&&"WhiteSpace"===t.prev.data.type&&n.remove(t.prev),null!==t.next&&"WhiteSpace"===t.next.data.type&&n.remove(t.next))}},{}],5:[function(e,t,n){function r(e,t){return e.children.each(function(n,a,s){var l=!1;i(n,function(n){if(null===this.selector||this.selector===e)switch(n.type){case"SelectorList":null!==this.function&&"not"===this.function.name.toLowerCase()||r(n,t)&&(l=!0);break;case"ClassSelector":null===t.whitelist||null===t.whitelist.classes||o.call(t.whitelist.classes,n.name)||(l=!0),null!==t.blacklist&&null!==t.blacklist.classes&&o.call(t.blacklist.classes,n.name)&&(l=!0);break;case"IdSelector":null===t.whitelist||null===t.whitelist.ids||o.call(t.whitelist.ids,n.name)||(l=!0),null!==t.blacklist&&null!==t.blacklist.ids&&o.call(t.blacklist.ids,n.name)&&(l=!0);break;case"TypeSelector":"*"!==n.name.charAt(n.name.length-1)&&(null===t.whitelist||null===t.whitelist.tags||o.call(t.whitelist.tags,n.name.toLowerCase())||(l=!0),null!==t.blacklist&&null!==t.blacklist.tags&&o.call(t.blacklist.tags,n.name.toLowerCase())&&(l=!0))}}),l&&s.remove(a)}),e.children.isEmpty()}var o=Object.prototype.hasOwnProperty,i=e("css-tree").walk;t.exports=function(e,t,n,o){var i=o.usage;!i||null===i.whitelist&&null===i.blacklist||r(e.prelude,i),(e.prelude.children.isEmpty()||e.block.children.isEmpty())&&n.remove(t)}},{"css-tree":44}],6:[function(e,t,n){t.exports=function(e,t,n){if("*"===t.data.name){var r=t.next&&t.next.data.type;"IdSelector"!==r&&"ClassSelector"!==r&&"AttributeSelector"!==r&&"PseudoClassSelector"!==r&&"PseudoElementSelector"!==r||n.remove(t)}}},{}],7:[function(e,t,n){t.exports=function(e,t,n){return null===t.next||null===t.prev?void n.remove(t):"WhiteSpace"===t.prev.data.type?void n.remove(t):null!==this.stylesheet&&this.stylesheet.children===n||null!==this.block&&this.block.children===n?void n.remove(t):void 0}},{}],8:[function(e,t,n){var r=e("css-tree").walk,o={Atrule:e("./Atrule"),Rule:e("./Rule"),Declaration:e("./Declaration"),TypeSelector:e("./TypeSelector"),Comment:e("./Comment"),Operator:e("./Operator"),WhiteSpace:e("./WhiteSpace")};t.exports=function(e,t){r(e,{leave:function(e,n,r){o.hasOwnProperty(e.type)&&o[e.type].call(this,e,n,r,t)}})}},{"./Atrule":1,"./Comment":2,"./Declaration":3,"./Operator":4,"./Rule":5,"./TypeSelector":6,"./WhiteSpace":7,"css-tree":44}],9:[function(e,t,n){function r(e,t){var n,r=new
|
||
|
var w={type:"Rule",loc:null,prelude:k,block:{type:"Block",loc:null,children:(new a).fromArray(b.eq)},pseudoSignature:e.pseudoSignature};return c.children=(new a).fromArray(b.ne1),g.children=(new a).fromArray(b.ne2.concat(b.ne2overrided)),n.insert(n.createItem(w),f),!0}}}h&&(h=!m.some(function(e){return s.some(function(t){return t.compareMarker===e.compareMarker})})),m.each(function(e){u[e.compareMarker]=!0})})}var a=e("css-tree").List,s=e("css-tree").walk,l=e("./utils");t.exports=function(e){s(e,{visit:"Rule",reverse:!0,enter:i})}},{"./utils":38,"css-tree":44}],33:[function(e,t,n){var r=e("./prepare/index"),o=e("./1-mergeAtrule"),i=e("./2-initialMergeRuleset"),a=e("./3-disjoinRuleset"),s=e("./4-restructShorthand"),l=e("./6-restructBlock"),c=e("./7-mergeRuleset"),u=e("./8-restructRuleset");t.exports=function(e,t){var n=r(e,t);t.logger("prepare",e),o(e,t),t.logger("mergeAtrule",e),i(e),t.logger("initialMergeRuleset",e),a(e),t.logger("disjoinRuleset",e),s(e,n),t.logger("restructShorthand",e),l(e),t.logger("restructBlock",e),c(e),t.logger("mergeRuleset",e),u(e),t.logger("restructRuleset",e)}},{"./1-mergeAtrule":26,"./2-initialMergeRuleset":27,"./3-disjoinRuleset":28,"./4-restructShorthand":29,"./6-restructBlock":30,"./7-mergeRuleset":31,"./8-restructRuleset":32,"./prepare/index":35}],34:[function(e,t,n){function r(){this.seed=0,this.map=Object.create(null)}var o=e("css-tree").generate;r.prototype.resolve=function(e){var t=this.map[e];return t||(t=++this.seed,this.map[e]=t),t},t.exports=function(){var e=new r;return function(t){var n=o(t);return t.id=e.resolve(n),t.length=n.length,t.fingerprint=null,t}}},{"css-tree":44}],35:[function(e,t,n){var r=e("css-tree").keyword,o=e("css-tree").walk,i=e("css-tree").generate,a=e("./createDeclarationIndexer"),s=e("./processSelector");t.exports=function(e,t){var n=a();return o(e,{visit:"Rule",enter:function(e){e.block.children.each(n),s(e,t.usage)}}),o(e,{visit:"Atrule",enter:function(e){e.prelude&&(e.prelude.id=null,e.prelude.id=i(e.prelude)),"keyframes"===r(e.name).basename&&(e.block.avoidRulesMerge=!0,e.block.children.each(function(e){e.prelude.children.each(function(e){e.compareMarker=e.id})}))}}),{declaration:n}}},{"./createDeclarationIndexer":34,"./processSelector":36,"css-tree":44}],36:[function(e,t,n){var r=e("css-tree").generate,o=e("./specificity"),i={"first-letter":!0,"first-line":!0,after:!0,before:!0},a={link:!0,visited:!0,hover:!0,active:!0,"first-letter":!0,"first-line":!0,after:!0,before:!0};t.exports=function(e,t){var n=Object.create(null),s=!1;e.prelude.children.each(function(e){var l="*",c=0;e.children.each(function(o){switch(o.type){case"ClassSelector":if(t&&t.scopes){var u=t.scopes[o.name]||0;if(0!==c&&u!==c)throw new Error("Selector can't has classes from different scopes: "+r(e));c=u}break;case"PseudoClassSelector":var h=o.name.toLowerCase();a.hasOwnProperty(h)||(n[h]=!0,s=!0);break;case"PseudoElementSelector":var h=o.name.toLowerCase();i.hasOwnProperty(h)||(n[h]=!0,s=!0);break;case"TypeSelector":l=o.name.toLowerCase();break;case"AttributeSelector":o.flags&&(n["["+o.flags.toLowerCase()+"]"]=!0,s=!0);break;case"WhiteSpace":case"Combinator":l="*"}}),e.compareMarker=o(e).toString(),e.id=null,e.id=r(e),c&&(e.compareMarker+=":"+c),"*"!==l&&(e.compareMarker+=","+l)}),e.pseudoSignature=s&&Object.keys(n).sort().join(",")}},{"./specificity":37,"css-tree":44}],37:[function(e,t,n){t.exports=function(e){var t=0,n=0,r=0;return e.children.each(function e(o){switch(o.type){case"SelectorList":case"Selector":o.children.each(e);break;case"IdSelector":t++;break;case"ClassSelector":case"AttributeSelector":n++;break;case"PseudoClassSelector":switch(o.name.toLowerCase()){case"not":o.children.each(e);break;case"before":case"after":case"first-line":case"first-letter":r++;break;default:n++}break;case"PseudoElementSelector":r++;break;case"TypeSelector":"*"!==o.name.charAt(o.name.length-1)&&r++}}),[t,n,r]}},{}],38:[function(e,t,n){function r(e,t){for(var n=e.head,r=t.head;null!==n&&null!==r&&n.data.id===r.data.id;)n=n.next,r=r.next;return null===n&&null===r}function o(e,t){for(var n=e.head,r=
|
||
|
"-moz-user-modify":"read-only | read-write | write-only","-moz-window-dragging":"drag | no-drag","-moz-window-shadow":"default | menu | tooltip | sheet | none","-webkit-appearance":"none | button | button-bevel | caps-lock-indicator | caret | checkbox | default-button | listbox | listitem | media-fullscreen-button | media-mute-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | push-button | radio | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbargripper-horizontal | scrollbargripper-vertical | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield","-webkit-border-before":"<'border-width'> || <'border-style'> || <'color'>","-webkit-border-before-color":"<'color'>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[ above | below | right | left ]? <length>? <image>?","-webkit-mask":"[ <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || [ <box> | border | padding | content | text ] || [ <box> | border | padding | content ] ]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"<-webkit-mask-clip-style> [, <-webkit-mask-clip-style> ]*","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[ <box> | border | padding | content ]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[ <length-percentage> | left | center | right ]#","-webkit-mask-position-y":"[ <length-percentage> | top | center | bottom ]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat | no-repeat | space | round","-webkit-mask-repeat-y":"repeat | no-repeat | space | round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto | touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length> || <color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default | none","-webkit-user-modify":"read-only | read-write | read-write-plaintext-only","align-content":"normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>","align-items":"normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ]","align-self":"auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position>",all:"initial | inherit | unset | revert",animation:"<single-animation>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"<time>#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[ none | <keyframes-name> ]#","animation-play-state":"<single-animation-play-state>#","animation-timing-function":"<single-timing-function>#",appearance:"auto | none",azimuth:"<angle> | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards","backdrop-filter":"none | <filter-function-list>","backface-visibility":"visible | hidden",background:"[ <bg-layer> , ]* <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<box>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<box>#","background-position":"<bg-position>#","background-position-x":"[ center | [ left | right | x-start | x-end ]? <length-percentage>? ]#","background-position-y":"[ center | [ top | bottom | y-start | y-end ]? <length-percentage>? ]#","background-repeat":"<repea
|
||
|
this.properties[e]=this.createDescriptor(t,"Property",e)},addType_:function(e,t){this.types[e]=this.createDescriptor(t,"Type",e),t===u.expression&&(this.valueCommonSyntax=x)},matchDeclaration:function(e){return"Declaration"!==e.type?i(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)},matchProperty:function(e,t){var n=c.property(e);if(n.custom)return i(null,new Error("Lexer matching doesn't applicable for custom properties"));var r=n.vendor?this.getProperty(n.name)||this.getProperty(n.basename):this.getProperty(n.name);return r?a(this,r,t,!0):i(null,new s("Unknown property",e))},matchType:function(e,t){var n=this.getType(e);return n?a(this,n,t,!1):i(null,new s("Unknown type",e))},match:function(e,t){return e&&e.type?(e.match||(e=this.createDescriptor(e)),a(this,e,t,!1)):i(null,new s("Bad syntax"))},findValueFragments:function(e,t,n,r){return y.matchFragments(this,t,this.matchProperty(e,t),n,r)},findDeclarationValueFragments:function(e,t,n){return y.matchFragments(this,e.value,this.matchDeclaration(e),t,n)},findAllFragments:function(e,t,n){var r=[];return this.syntax.walk(e,{visit:"Declaration",enter:function(e){r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}.bind(this)}),r},getProperty:function(e){return this.properties.hasOwnProperty(e)?this.properties[e]:null},getType:function(e){return this.types.hasOwnProperty(e)?this.types[e]:null},validate:function(){function e(r,o,i,a){if(i.hasOwnProperty(o))return i[o];i[o]=!1,null!==a.syntax&&d(a.syntax,function(a){if("Type"===a.type||"Property"===a.type){var s="Type"===a.type?r.types:r.properties,l="Type"===a.type?t:n;s.hasOwnProperty(a.name)&&!e(r,a.name,l,s[a.name])||(i[o]=!0)}},this)}var t={},n={};for(var r in this.types)e(this,r,t,this.types[r]);for(var r in this.properties)e(this,r,n,this.properties[r]);return t=Object.keys(t).filter(function(e){return t[e]}),n=Object.keys(n).filter(function(e){return n[e]}),t.length||n.length?{types:t,properties:n}:null},dump:function(e){return{generic:this.generic,types:r(this.types,e),properties:r(this.properties,e)}},toString:function(){return JSON.stringify(this.dump())}},t.exports=w},{"../utils/names":145,"./ast-to-tokens":46,"./error":47,"./generic":48,"./grammar/generate":50,"./grammar/parse":52,"./grammar/walk":54,"./match":56,"./match-graph":55,"./search":57,"./structure":58,"./trace":59}],46:[function(e,t,n){t.exports={decorator:function(e){var t=null,n=null,r=[];return{children:e.children,node:function(n){var r=t;t=n,e.node.call(this,n),t=r},chunk:function(e){if(r.length>0)switch(t.type){case"Dimension":case"HexColor":case"IdSelector":case"Percentage":if(n.node===t)return void(n.value+=e);break;case"Function":case"PseudoClassSelector":case"PseudoElementSelector":case"Url":if("("===e)return void(n.value+=e);break;case"Atrule":if(n.node===t&&"@"===n.value)return void(n.value+=e)}r.push(n={value:e,node:t})},result:function(){return r}}}}},{}],47:[function(e,t,n){"use strict";function r(e){for(var t=e.tokens,n=e.longestMatch,r=n<t.length?t[n].node:null,o=0,i=0,a="",s=0;s<t.length;s++)s===n&&(o=a.length),null!==r&&t[s].node===r&&(s<=n?i++:i=0),a+=t[s].value;return null===r&&(o=a.length),{node:r,css:a,mismatchOffset:o,last:null===r||i>1}}function o(e,t){var n=e&&e.loc&&e.loc[t];return n?{offset:n.offset,line:n.line,column:n.column}:null}var i=e("../utils/createCustomError"),a=e("./grammar/generate"),s=function(e,t){var n=i("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},l=function(e,t,n,s,l){var c=i("SyntaxMatchError",e),u=r(l),h=u.mismatchOffset||0,p=u.node||s,d=o(p,"end"),f=u.last?d:o(p,"start"),m=u.css;return c.rawMessage=e,c.syntax=n?a(n):"<generic>",c.css=m,c.mismatchOffset=h,c.loc={source:p&&p.loc&&p.loc.source||"<unknown>",start:f,end:d},c.line=f?f.line:void 0,c.column=f?f.column:void 0,c.offset=f?f.offset:void 0,c.message=e+"\n syntax: "+c.syntax+"\n value: "+(c.css||"<empty string>")+"\n --------"+new Array(c.mismatchOffset+1).join("-")+"^",c};t.exports={SyntaxReferenceError:s,MatchError:l}},{"../utils/createCustomError":143,"./grammar/generate":50}],48:[func
|
||
|
"../convertor/create":41,"../generator/create":42,"../lexer/Lexer":45,"../lexer/grammar":51,"../parser/create":60,"../tokenizer":140,"../utils/clone":142,"../utils/list":144,"../utils/names":145,"../walker/create":146,"./config/mix":69}],73:[function(e,t,n){t.exports=function(){this.scanner.skipSC();var e=this.createSingleNodeList(this.IdSelector());return this.scanner.skipSC(),e}},{}],74:[function(e,t,n){t.exports=function(){return this.createSingleNodeList(this.Raw(this.scanner.currentToken,0,0,!1,!1))}},{}],75:[function(e,t,n){var r=e("../../tokenizer").TYPE,o=r.Identifier,i=r.Comma,a=r.Semicolon,s=r.HyphenMinus,l=r.ExclamationMark;t.exports=function(){var e=this.createList();this.scanner.skipSC();var t=this.scanner.tokenStart;return this.scanner.eat(s),this.scanner.source.charCodeAt(this.scanner.tokenStart)!==s&&this.scanner.error("HyphenMinus is expected"),this.scanner.eat(o),e.push({type:"Identifier",loc:this.getLocation(t,this.scanner.tokenStart),name:this.scanner.substrToCursor(t)}),this.scanner.skipSC(),this.scanner.tokenType===i&&(e.push(this.Operator()),e.push(this.parseCustomProperty?this.Value(null):this.Raw(this.scanner.currentToken,l,a,!1,!1))),e}},{"../../tokenizer":140}],76:[function(e,t,n){t.exports=e("./create").create(function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}(e("./config/lexer"),e("./config/parser"),e("./config/walker")))},{"./config/lexer":68,"./config/parser":70,"./config/walker":71,"./create":72}],77:[function(e,t,n){function r(e,t){var n=e.tokenStart;for(e.source.charCodeAt(n)!==c&&e.source.charCodeAt(n)!==u||(t&&e.error(),n++);n<e.tokenEnd;n++)i(e.source.charCodeAt(n))||e.error("Unexpected input",n)}var o=e("../../tokenizer").cmpChar,i=e("../../tokenizer").isNumber,a=e("../../tokenizer").TYPE,s=a.Identifier,l=a.Number,c=a.PlusSign,u=a.HyphenMinus;t.exports={name:"AnPlusB",structure:{a:[String,null],b:[String,null]},parse:function(){var e=this.scanner.tokenStart,t=e,n="",a=null,h=null;if(this.scanner.tokenType!==l&&this.scanner.tokenType!==c||(r(this.scanner,!1),n=this.scanner.getTokenValue(),this.scanner.next(),t=this.scanner.tokenStart),this.scanner.tokenType===s){var p=this.scanner.tokenStart;o(this.scanner.source,p,u)&&(""===n?(n="-",p++):this.scanner.error("Unexpected hyphen minus")),o(this.scanner.source,p,110)||this.scanner.error(),a=""===n?"1":"+"===n?"+1":"-"===n?"-1":n;var d=this.scanner.tokenEnd-p;d>1?(this.scanner.source.charCodeAt(p+1)!==u&&this.scanner.error("Unexpected input",p+1),d>2?this.scanner.tokenStart=p+2:(this.scanner.next(),this.scanner.skipSC()),r(this.scanner,!0),h="-"+this.scanner.getTokenValue(),this.scanner.next(),t=this.scanner.tokenStart):(n="",this.scanner.next(),t=this.scanner.tokenStart,this.scanner.skipSC(),this.scanner.tokenType!==u&&this.scanner.tokenType!==c||(n=this.scanner.getTokenValue(),this.scanner.next(),this.scanner.skipSC()),this.scanner.tokenType===l?(r(this.scanner,""!==n),i(this.scanner.source.charCodeAt(this.scanner.tokenStart))||(n=this.scanner.source.charAt(this.scanner.tokenStart),this.scanner.tokenStart++),""===n?this.scanner.error():"+"===n&&(n=""),h=n+this.scanner.getTokenValue(),this.scanner.next(),t=this.scanner.tokenStart):n&&this.scanner.eat(l))}else""!==n&&"+"!==n||this.scanner.error("Number or identifier is expected",this.scanner.tokenStart+(this.scanner.tokenType===c||this.scanner.tokenType===u)),h=n;return{type:"AnPlusB",loc:this.getLocation(e,t),a:a,b:h}},generate:function(e){var t=null!==e.a&&void 0!==e.a,n=null!==e.b&&void 0!==e.b;t?(this.chunk("+1"===e.a?"+n":"1"===e.a?"n":"-1"===e.a?"-n":e.a+"n"),n&&(n=String(e.b),"-"===n.charAt(0)||"+"===n.charAt(0)?(this.chunk(n.charAt(0)),this.chunk(n.substr(1))):(this.chunk("+"),this.chunk(n)))):this.chunk(String(e.b))}}},{"../../tokenizer":140}],78:[function(e,t,n){function r(e){return this.Raw(e,s,l,!1,!0)}function o(){for(var e,t=1;e=this.scanner.lookupType(t);t++){if(e===c)return!0;if(e===l||e===a)return!1}return!1}var i=e("../../tokenizer").TYPE,a=i.AtKeyword,s=i.Semicolon,l=i.LeftCurlyBracket,c=i.RightCurlyBracket;t.export
|
||
|
return this.createSingleNodeList(this.Nth(!1))}}},{}],119:[function(e,t,n){t.exports={parse:function(){return this.createSingleNodeList(this.Nth(!0))}}},{}],120:[function(e,t,n){t.exports={parse:function(){return this.createSingleNodeList(this.SelectorList())}}},{}],121:[function(e,t,n){t.exports={parse:function(){return this.createSingleNodeList(this.Identifier())}}},{}],122:[function(e,t,n){t.exports={parse:function(){return this.createSingleNodeList(this.SelectorList())}}},{}],123:[function(e,t,n){t.exports={dir:e("./dir"),has:e("./has"),lang:e("./lang"),matches:e("./matches"),not:e("./not"),"nth-child":e("./nth-child"),"nth-last-child":e("./nth-last-child"),"nth-last-of-type":e("./nth-last-of-type"),"nth-of-type":e("./nth-of-type"),slotted:e("./slotted")}},{"./dir":121,"./has":122,"./lang":124,"./matches":125,"./not":126,"./nth-child":127,"./nth-last-child":128,"./nth-last-of-type":129,"./nth-of-type":130,"./slotted":131}],124:[function(e,t,n){arguments[4][121][0].apply(n,arguments)},{dup:121}],125:[function(e,t,n){t.exports=e("./common/selectorList")},{"./common/selectorList":120}],126:[function(e,t,n){arguments[4][125][0].apply(n,arguments)},{"./common/selectorList":120,dup:125}],127:[function(e,t,n){t.exports=e("./common/nthWithOfClause")},{"./common/nthWithOfClause":119}],128:[function(e,t,n){arguments[4][127][0].apply(n,arguments)},{"./common/nthWithOfClause":119,dup:127}],129:[function(e,t,n){t.exports=e("./common/nth")},{"./common/nth":118}],130:[function(e,t,n){arguments[4][129][0].apply(n,arguments)},{"./common/nth":118,dup:129}],131:[function(e,t,n){t.exports={parse:function(){return this.createSingleNodeList(this.Selector())}}},{}],132:[function(e,t,n){t.exports={getNode:e("./default")}},{"./default":133}],133:[function(e,t,n){var r=e("../../tokenizer").cmpChar,o=e("../../tokenizer").TYPE,i=o.Identifier,a=o.String,s=o.Number,l=o.Function,c=o.Url,u=o.NumberSign,h=o.LeftParenthesis,p=o.LeftSquareBracket,d=o.PlusSign,f=o.HyphenMinus,m=o.Comma,g=o.Solidus,b=o.Asterisk,y=o.PercentSign,v=o.Backslash;t.exports=function(e){switch(this.scanner.tokenType){case u:return this.HexColor();case m:return e.space=null,e.ignoreWSAfter=!0,this.Operator();case g:case b:case d:case f:return this.Operator();case h:return this.Parentheses(this.readSequence,e.recognizer);case p:return this.Brackets(this.readSequence,e.recognizer);case a:return this.String();case s:switch(this.scanner.lookupType(1)){case y:return this.Percentage();case i:return r(this.scanner.source,this.scanner.tokenEnd,v)?this.Number():this.Dimension();default:return this.Number()}case l:return this.Function(this.readSequence,e.recognizer);case c:return this.Url();case i:return r(this.scanner.source,this.scanner.tokenStart,117)&&r(this.scanner.source,this.scanner.tokenStart+1,d)?this.UnicodeRange():this.Identifier()}}},{"../../tokenizer":140}],134:[function(e,t,n){t.exports={AtrulePrelude:e("./atrulePrelude"),Selector:e("./selector"),Value:e("./value")}},{"./atrulePrelude":132,"./selector":135,"./value":136}],135:[function(e,t,n){function r(e){switch(this.scanner.tokenType){case c:case f:case g:return e.space=null,e.ignoreWSAfter=!0,this.Combinator();case u:return this.Combinator();case p:return this.ClassSelector();case l:return this.AttributeSelector();case s:return this.IdSelector();case d:return this.scanner.lookupType(1)===d?this.PseudoElementSelector():this.PseudoClassSelector();case i:case h:case m:return this.TypeSelector();case a:return this.Percentage()}}var o=e("../../tokenizer").TYPE,i=o.Identifier,a=o.Number,s=o.NumberSign,l=o.LeftSquareBracket,c=o.PlusSign,u=o.Solidus,h=o.Asterisk,p=o.FullStop,d=o.Colon,f=o.GreaterThanSign,m=o.VerticalLine,g=o.Tilde;t.exports={getNode:r}},{"../../tokenizer":140}],136:[function(e,t,n){t.exports={getNode:e("./default"),"-moz-element":e("../function/element"),element:e("../function/element"),expression:e("../function/expression"),var:e("../function/var")}},{"../function/element":73,"../function/expression":74,"../function/var":75,"./default":133}],137:[function(e,t,n){"use strict";function r(e,t){var n=t.length,r=h(t
|
||
|
f.source&&(m.source=r.indexOf(f.source),m.originalLine=f.originalLine,m.originalColumn=f.originalColumn,f.name&&(m.name=n.indexOf(f.name)),u.push(m)),l.push(m)}return h(t.__originalMappings,s.compareByOriginalPositions),t},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._sources.toArray().map(function(e){return null!=this.sourceRoot?s.join(this.sourceRoot,e):e},this)}}),o.prototype._parseMappings=function(e,t){for(var n,r,o,a,l,c=1,p=0,d=0,f=0,m=0,g=0,b=e.length,y=0,v={},k={},x=[],w=[];y<b;)if(";"===e.charAt(y))c++,y++,p=0;else if(","===e.charAt(y))y++;else{for(n=new i,n.generatedLine=c,a=y;a<b&&!this._charIsMappingSeparator(e,a);a++);if(r=e.slice(y,a),o=v[r])y+=r.length;else{for(o=[];y<a;)u.decode(e,y,k),l=k.value,y=k.rest,o.push(l);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");v[r]=o}n.generatedColumn=p+o[0],p=n.generatedColumn,o.length>1&&(n.source=m+o[1],m+=o[1],n.originalLine=d+o[2],d=n.originalLine,n.originalLine+=1,n.originalColumn=f+o[3],f=n.originalColumn,o.length>4&&(n.name=g+o[4],g+=o[4])),w.push(n),"number"==typeof n.originalLine&&x.push(n)}h(w,s.compareByGeneratedPositionsDeflated),this.__generatedMappings=w,h(x,s.compareByOriginalPositions),this.__originalMappings=x},o.prototype._findMapping=function(e,t,n,r,o,i){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return l.search(e,t,o,i)},o.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(e){var t={generatedLine:s.getArg(e,"line"),generatedColumn:s.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",s.compareByGeneratedPositionsDeflated,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(n>=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=s.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=s.join(this.sourceRoot,i)));var a=s.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:s.getArg(o,"originalLine",null),column:s.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},o.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=s.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=s.urlParse(this.sourceRoot))){var r=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(e){var t=s.getArg(e,"source");if(null!=this.sourceRoot&&(t=s.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};t=this._sources.indexOf(t);var n={source:t,originalLine:s.getArg(e,"line"),originalColumn:s.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",s.compareByOriginalPositions,s.getArg(e,"bias",r.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:s.getArg(i,"generatedLine",null),column:s.getArg(i,"generatedColumn",null),lastColumn:s.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},n.Bas
|