var e,d;function o(){if(d)return e;d=1;var o="(".charCodeAt(0),n=")".charCodeAt(0),c="'".charCodeAt(0),r='"'.charCodeAt(0),t="\\".charCodeAt(0),s="/".charCodeAt(0),u=",".charCodeAt(0),l=":".charCodeAt(0),a="*".charCodeAt(0),h="u".charCodeAt(0),i="U".charCodeAt(0),f="+".charCodeAt(0),p=/^[a-f0-9?-]+$/i;return e=function(e){for(var d,x,A,C,I,v,g,E,y,w=[],O=e,b=0,m=O.charCodeAt(b),q=O.length,_=[{nodes:w}],U=0,$="",j="",k="";b<q;)if(m<=32){d=b;do{d+=1,m=O.charCodeAt(d)}while(m<=32);C=O.slice(b,d),A=w[w.length-1],m===n&&U?k=C:A&&"div"===A.type?(A.after=C,A.sourceEndIndex+=C.length):m===u||m===l||m===s&&O.charCodeAt(d+1)!==a&&(!y||y&&"function"===y.type&&"calc"!==y.value)?j=C:w.push({type:"space",sourceIndex:b,sourceEndIndex:d,value:C}),b=d}else if(m===c||m===r){d=b,C={type:"string",sourceIndex:b,quote:x=m===c?"'":'"'};do{if(I=!1,~(d=O.indexOf(x,d+1)))for(v=d;O.charCodeAt(v-1)===t;)v-=1,I=!I;else d=(O+=x).length-1,C.unclosed=!0}while(I);C.value=O.slice(b+1,d),C.sourceEndIndex=C.unclosed?d:d+1,w.push(C),b=d+1,m=O.charCodeAt(b)}else if(m===s&&O.charCodeAt(b+1)===a)C={type:"comment",sourceIndex:b,sourceEndIndex:(d=O.indexOf("*/",b))+2},-1===d&&(C.unclosed=!0,d=O.length,C.sourceEndIndex=d),C.value=O.slice(b+2,d),w.push(C),b=d+2,m=O.charCodeAt(b);else if(m!==s&&m!==a||!y||"function"!==y.type||"calc"!==y.value)if(m===s||m===u||m===l)C=O[b],w.push({type:"div",sourceIndex:b-j.length,sourceEndIndex:b+C.length,value:C,before:j,after:""}),j="",b+=1,m=O.charCodeAt(b);else if(o===m){d=b;do{d+=1,m=O.charCodeAt(d)}while(m<=32);if(E=b,C={type:"function",sourceIndex:b-$.length,value:$,before:O.slice(E+1,d)},b=d,"url"===$&&m!==c&&m!==r){d-=1;do{if(I=!1,~(d=O.indexOf(")",d+1)))for(v=d;O.charCodeAt(v-1)===t;)v-=1,I=!I;else d=(O+=")").length-1,C.unclosed=!0}while(I);g=d;do{g-=1,m=O.charCodeAt(g)}while(m<=32);E<g?(C.nodes=b!==g+1?[{type:"word",sourceIndex:b,sourceEndIndex:g+1,value:O.slice(b,g+1)}]:[],C.unclosed&&g+1!==d?(C.after="",C.nodes.push({type:"space",sourceIndex:g+1,sourceEndIndex:d,value:O.slice(g+1,d)})):(C.after=O.slice(g+1,d),C.sourceEndIndex=d)):(C.after="",C.nodes=[]),b=d+1,C.sourceEndIndex=C.unclosed?d:b,m=O.charCodeAt(b),w.push(C)}else U+=1,C.after="",C.sourceEndIndex=b+1,w.push(C),_.push(C),w=C.nodes=[],y=C;$=""}else if(n===m&&U)b+=1,m=O.charCodeAt(b),y.after=k,y.sourceEndIndex+=k.length,k="",U-=1,_[_.length-1].sourceEndIndex=b,_.pop(),w=(y=_[U]).nodes;else{d=b;do{m===t&&(d+=1),d+=1,m=O.charCodeAt(d)}while(d<q&&!(m<=32||m===c||m===r||m===u||m===l||m===s||m===o||m===a&&y&&"function"===y.type&&"calc"===y.value||m===s&&"function"===y.type&&"calc"===y.value||m===n&&U));C=O.slice(b,d),o===m?$=C:h!==C.charCodeAt(0)&&i!==C.charCodeAt(0)||f!==C.charCodeAt(1)||!p.test(C.slice(2))?w.push({type:"word",sourceIndex:b,sourceEndIndex:d,value:C}):w.push({type:"unicode-range",sourceIndex:b,sourceEndIndex:d,value:C}),b=d}else C=O[b],w.push({type:"word",sourceIndex:b-j.length,sourceEndIndex:b+C.length,value:C}),b+=1,m=O.charCodeAt(b);for(b=_.length-1;b;b-=1)_[b].unclosed=!0,_[b].sourceEndIndex=O.length;return _[0].nodes}}export{o as __require};