UNPKG

@eaze/product-image

Version:

Product Image component

1 lines 84.8 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):"object"==typeof exports?exports.ReactButton=t(require("react")):e.ReactButton=t(e.React)}(this,function(e){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=1)}([function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Object.defineProperty(t,"__esModule",{value:!0}),t.SIZES=t.ACCESSORY=t.CBD=t.SATIVA=t.HYBRID=t.INDICA=void 0;var u,c=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=function(e,t){return Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n width: 100%;\n height: ",";\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n background-color: ",";\n background-image: url('","');\n"],["\n width: 100%;\n height: ",";\n background-size: cover;\n background-position: center;\n background-repeat: no-repeat;\n background-color: ",";\n background-image: url('","');\n"]),f=n(0),h=r(f),p=n(2),d=r(p),v=n(7),m=r(v),y=n(9),g=r(y),w=t.INDICA="INDICA",b=t.HYBRID="HYBRID",k=t.SATIVA="SATIVA",C=t.CBD="CBD",x=t.ACCESSORY="ACCESSORY",S=t.SIZES={SMALL:"SMALL",LARGE:"LARGE"},O=(u={},a(u,w,m.default.indica[5]),a(u,b,m.default.hybrid[5]),a(u,k,m.default.sativa[5]),a(u,C,m.default.cbd[5]),a(u,x,m.default.accessory[4]),u),A=g.default.div(l,function(e){return e.size===S.LARGE?"26rem":"16rem"},function(e){return e.color},function(e){return e.src}),_=function(e){function t(){return o(this,t),i(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return s(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=e.imageUrl,n=e.strain,r=e.useThumb,o=e.size,i=r?t+"?preset=thumb":t;return h.default.createElement(A,{src:i,color:O[n],size:o})}}]),t}(f.PureComponent);_.defaultProps={imageUrl:"",strain:"Sativa",useThumb:!1,size:S.SMALL},_.propTypes={imageUrl:d.default.string,strain:d.default.string,useThumb:d.default.bool,size:d.default.string},t.default=_},function(e,t,n){e.exports=n(3)()},function(e,t,n){"use strict";var r=n(4),o=n(5),i=n(6);e.exports=function(){function e(e,t,n,r,s,a){a!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r,i,s,a,u){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,s,a,u],f=0;c=new Error(t.replace(/%s/g,function(){return l[f++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";(function(e){var n,r,o,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(s,a){"object"==i(t)&&"object"==i(e)?e.exports=a():(r=[],n=a,void 0!==(o="function"==typeof n?n.apply(t,r):n)&&(e.exports=o))}(0,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=0)}([function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default={primary:{1:"#00AAE7",2:"#5CC9F0",3:"#66CCF1",4:"#99DDF5",5:"#CCEEFA"},cbd:{1:"#9360A8",2:"#A980B9",3:"#BEA0CB",4:"#D4BFDC",5:"#E9DFEE"},hybrid:{1:"#42BC97",2:"#68C9AC",3:"#8ED7C1",4:"#B3E4D5",5:"#D9F2EA"},sativa:{1:"#FACA18",2:"#FBD546",3:"#FCDF74",4:"#FDEAA3",5:"#FEF4D1"},indica:{1:"#126CAB",2:"#4189BC",3:"#71A7CD",4:"#A0C4DD",5:"#D0E2EE"},danger:{1:"#F05B4B",2:"#F37C6F",3:"#F69D93",4:"#F9BDB7",5:"#FCDEDB"},accessory:{1:"#5C515A",2:"#817D80",3:"#D2CDCC",4:"#E9E3E1",5:"#FFF8F5"}}}])})}).call(t,n(8)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){return e.replace(B,"-$1").toLowerCase()}function o(e){return L(e).replace(z,"-ms-")}function i(e){return!0===Q(e)&&"[object Object]"===Object.prototype.toString.call(e)}function s(e){oe[e]||(oe[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}function a(e){function t(t){throw e.error("Unclosed "+t,k,C-b)}for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=[],o=e.css.valueOf(),i=n.ignoreErrors,s=void 0,a=void 0,u=void 0,c=void 0,l=void 0,f=void 0,h=void 0,p=void 0,d=void 0,v=void 0,m=void 0,y=void 0,g=void 0,w=o.length,b=-1,k=1,C=0;C<w;){switch(s=o.charCodeAt(C),(s===de||s===me||s===ge&&o.charCodeAt(C+1)!==de)&&(b=C,k+=1),s){case de:case ve:case ye:case ge:case me:a=C;do{a+=1,(s=o.charCodeAt(a))===de&&(b=a,k+=1)}while(s===ve||s===de||s===ye||s===ge||s===me);r.push(["space",o.slice(C,a)]),C=a-1;break;case we:r.push(["[","[",k,C-b]);break;case be:r.push(["]","]",k,C-b]);break;case xe:r.push(["{","{",k,C-b]);break;case Se:r.push(["}","}",k,C-b]);break;case _e:r.push([":",":",k,C-b]);break;case Oe:r.push([";",";",k,C-b]);break;case ke:if(y=r.length?r[r.length-1][1]:"",g=o.charCodeAt(C+1),"url"===y&&g!==le&&g!==fe&&g!==ve&&g!==de&&g!==ye&&g!==me&&g!==ge){a=C;do{if(v=!1,-1===(a=o.indexOf(")",a+1))){if(i){a=C;break}t("bracket")}for(m=a;o.charCodeAt(m-1)===he;)m-=1,v=!v}while(v);r.push(["brackets",o.slice(C,a+1),k,C-b,k,a-b]),C=a}else a=o.indexOf(")",C+1),f=o.slice(C,a+1),-1===a||Pe.test(f)?r.push(["(","(",k,C-b]):(r.push(["brackets",f,k,C-b,k,a-b]),C=a);break;case Ce:r.push([")",")",k,C-b]);break;case le:case fe:u=s===le?"'":'"',a=C;do{if(v=!1,-1===(a=o.indexOf(u,a+1))){if(i){a=C+1;break}t("quote")}for(m=a;o.charCodeAt(m-1)===he;)m-=1,v=!v}while(v);f=o.slice(C,a+1),c=f.split("\n"),l=c.length-1,l>0?(p=k+l,d=a-c[l].length):(p=k,d=b),r.push(["string",o.slice(C,a+1),k,C-b,p,a-d]),b=d,k=p,C=a;break;case Ee:je.lastIndex=C+1,je.test(o),a=0===je.lastIndex?o.length-1:je.lastIndex-2,r.push(["at-word",o.slice(C,a+1),k,C-b,k,a-b]),C=a;break;case he:for(a=C,h=!0;o.charCodeAt(a+1)===he;)a+=1,h=!h;s=o.charCodeAt(a+1),h&&s!==pe&&s!==ve&&s!==de&&s!==ye&&s!==ge&&s!==me&&(a+=1),r.push(["word",o.slice(C,a+1),k,C-b,k,a-b]),C=a;break;default:s===pe&&o.charCodeAt(C+1)===Ae?(a=o.indexOf("*/",C+2)+1,0===a&&(i?a=o.length:t("comment")),f=o.slice(C,a+1),c=f.split("\n"),l=c.length-1,l>0?(p=k+l,d=a-c[l].length):(p=k,d=b),r.push(["comment",f,k,C-b,p,a-d]),b=d,k=p,C=a):(Re.lastIndex=C+1,Re.test(o),a=0===Re.lastIndex?o.length-1:Re.lastIndex-2,r.push(["word",o.slice(C,a+1),k,C-b,k,a-b]),C=a)}C++}return r}function u(e){return"["+e+"m"}function c(e){var t=a(new Je(e),{ignoreErrors:!0}),n=[];return t.forEach(function(e){var t=Te[e[0]];t?n.push(e[1].split(/\r?\n/).map(function(e){return u(t[0])+e+u(t[1])}).join("\n")):n.push(e[1])}),n.join("")}function l(e){return e[0].toUpperCase()+e.slice(1)}function f(e,t){new Me(t).stringify(e)}function h(e,t){if(t&&t.safe)throw new Error('Option safe was removed. Use parser: require("postcss-safe-parser")');var n=new Je(e,t),r=new Le(n);try{r.tokenize(),r.loop()}catch(e){throw"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}function p(e){return e.map(function(e){return e.nodes&&(e.nodes=p(e.nodes)),delete e.source,e})}function d(e){return"object"===(void 0===e?"undefined":Y(e))&&"function"==typeof e.then}function v(e,t){var n=new Je(e,t),r=new Ze(n);return r.tokenize(),r.loop(),r.root}function m(e){return e.replace(Qe,function(e,t){return t.toUpperCase()})}function y(e){return tt(e.replace(nt,"ms-"))}function g(e,t){return t={exports:{}},e(t,t.exports),t.exports}function w(e){return e in gt?gt[e]:gt[e]=e.replace(mt,"-$&").toLowerCase().replace(yt,"-ms-")}function b(e,t){var n=[];return e.selectors.forEach(function(e){t.selectors.forEach(function(t){-1===t.indexOf("&")?n.push(e+" "+t):n.push(t.replace(/&/g,e))})}),n}function k(e,t){return e&&"comment"===e.type?e.moveAfter(t):t}function C(e,t){var n=[];if(t.each(function(t){"comment"===t.type&&n.push(t),"decl"===t.type?n.push(t):"rule"===t.type?t.selectors=b(e,t):"atrule"===t.type&&C(e,t)}),n.length){for(var r=e.clone({nodes:[]}),o=0;o<n.length;o++)n[o].moveTo(r);t.prepend(r)}}function x(e,t){var n=!1,r=e;e.each(function(o){"rule"===o.type?(n=!0,o.selectors=b(e,o),r=k(o.prev(),r),r=o.moveAfter(r)):"atrule"===o.type&&-1!==t.indexOf(o.name)&&(n=!0,C(e,o),r=k(o.prev(),r),r=o.moveAfter(r))}),n&&(e.raws.semicolon=!0,0===e.nodes.length&&e.remove())}function S(e){return e[e.length-1]}function O(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function A(){var e=document.createElement("style");return e.type="text/css",e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e),e}function _(e){return"string"==typeof e}function E(e){return function(){return e}}function j(e,t,n,r,o,i,s,a){if(qt(t),!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,s,a],l=0;u=new Error(t.replace(/%s/g,function(){return c[l++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}function R(e,t,n,r,o){for(var i in e)if(e.hasOwnProperty(i)){var s;try{Kt("function"==typeof e[i],"%s: %s type `%s` is invalid; it must be a function, usually from React.PropTypes.",r||"React class",n,i),s=e[i](t,i,r,n,null,Zt)}catch(e){s=e}if(Jt(!s||s instanceof Error,"%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",r||"React class",n,i,void 0===s?"undefined":Y(s)),s instanceof Error&&!(s.message in Qt)){Qt[s.message]=!0;var a=o?o():"";Jt(!1,"Failed %s type: %s%s",n,s.message,null!=a?a:"")}}}function P(e){return"object"===(void 0===e?"undefined":Y(e))&&null!==e&&e.$$typeof===un}function T(e){var t=fn.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"css",function(){return re}),n.d(t,"keyframes",function(){return kn}),n.d(t,"injectGlobal",function(){return It}),n.d(t,"ThemeProvider",function(){return dn}),n.d(t,"withTheme",function(){return bn});var D=n(0),F=n.n(D),M="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),I=function e(t){var n=M[t%M.length];return t>M.length?""+e(Math.floor(t/M.length))+n:n},N=function(e,t){return t.reduce(function(t,n,r){return t.concat(n,e[r+1])},[e[0]])},B=/([A-Z])/g,U=r,L=U,z=/^ms-/,W=o,Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},V=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},q=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),H=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},G=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$=function e(t,n,r){null===t&&(t=Function.prototype);var o=Object.getOwnPropertyDescriptor(t,n);if(void 0===o){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in o)return o.value;var s=o.get;if(void 0!==s)return s.call(r)},X=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},K=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},J=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},Z=function(e){return null!=e&&"object"===(void 0===e?"undefined":Y(e))&&!Array.isArray(e)},Q=Z,ee=function(e){var t,n;return!1!==i(e)&&("function"==typeof(t=e.constructor)&&(n=t.prototype,!1!==i(n)&&!1!==n.hasOwnProperty("isPrototypeOf")))},te=function e(t,n){var r=Object.keys(t).map(function(n){return ee(t[n])?e(t[n],n):W(n)+": "+t[n]+";"}).join(" ");return n?n+" {\n "+r+"\n}":r},ne=function e(t,n){return t.reduce(function(t,r){return void 0===r||null===r||!1===r||""===r?t:Array.isArray(r)?[].concat(J(t),J(e(r,n))):"function"==typeof r?n?t.concat.apply(t,J(e([r(n)],n))):t.concat(r):t.concat(ee(r)?te(r):r.toString())},[])},re=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ne(N(e,n))},oe={},ie={argv:[],env:{}},se=function(e,t){t=t||ie.argv;var n=t.indexOf("--"),r=/^--/.test(e)?"":"--",o=t.indexOf(r+e);return-1!==o&&(-1===n||o<n)},ae=se,ue=function(){return ae("no-color")||ae("no-colors")||ae("color=false")?0:ae("color=16m")||ae("color=full")||ae("color=truecolor")?3:ae("color=256")?2:ae("color")||ae("colors")||ae("color=true")||ae("color=always")?1:ie.stdout&&!ie.stdout.isTTY?0:"win32"===ie.platform?1:"COLORTERM"in ie.env?1:"dumb"===ie.env.TERM?0:/^xterm-256(?:color)?/.test(ie.env.TERM)?2:/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(ie.env.TERM)?1:0}();0===ue&&"FORCE_COLOR"in ie.env&&(ue=1);var ce=ie&&function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(ue),le="'".charCodeAt(0),fe='"'.charCodeAt(0),he="\\".charCodeAt(0),pe="/".charCodeAt(0),de="\n".charCodeAt(0),ve=" ".charCodeAt(0),me="\f".charCodeAt(0),ye="\t".charCodeAt(0),ge="\r".charCodeAt(0),we="[".charCodeAt(0),be="]".charCodeAt(0),ke="(".charCodeAt(0),Ce=")".charCodeAt(0),xe="{".charCodeAt(0),Se="}".charCodeAt(0),Oe=";".charCodeAt(0),Ae="*".charCodeAt(0),_e=":".charCodeAt(0),Ee="@".charCodeAt(0),je=/[ \n\t\r\f\{\(\)'"\\;\/\[\]#]/g,Re=/[ \n\t\r\f\(\)\{\}:;@!'"\\\]\[#]|\/(?=\*)/g,Pe=/.[\\\/\("'\n]/,Te={brackets:[36,39],string:[31,39],"at-word":[31,39],comment:[90,39],"{":[32,39],"}":[32,39],":":[1,22],";":[1,22],"(":[1,22],")":[1,22]},De=function(){function e(t,n,r,o,i,s){V(this,e),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),o&&(this.source=o),s&&(this.plugin=s),void 0!==n&&void 0!==r&&(this.line=n,this.column=r),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}return q(e,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var t=this;if(!this.source)return"";var n=this.source;void 0===e&&(e=ce),e&&(n=c(n));var r=n.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,r.length),s=String(i).length;return r.slice(o,i).map(function(e,n){var r=o+1+n,i=(" "+r).slice(-s),a=" "+i+" | ";if(r===t.line){return">"+a+e+"\n "+(a.replace(/\d/g," ")+e.slice(0,t.column-1).replace(/[^\t]/g," "))+"^"}return" "+a+e}).join("\n")}},{key:"toString",value:function(){var e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}},{key:"generated",get:function(){return s("CssSyntaxError#generated is depreacted. Use input instead."),this.input}}]),e}(),Fe={colon:": ",indent:" ",beforeDecl:"\n",beforeRule:"\n",beforeOpen:" ",beforeClose:"\n",beforeComment:"\n",after:"\n",emptyBody:"",commentLeft:" ",commentRight:" "},Me=function(){function e(t){V(this,e),this.builder=t}return q(e,[{key:"stringify",value:function(e,t){this[e.type](e,t)}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),r=e.prop+n+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector"))}},{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{var o=(e.raws.between||"")+(t?";":"");this.builder(n+r+o,e)}}},{key:"body",value:function(e){for(var t=e.nodes.length-1;t>0&&"comment"===e.nodes[t].type;)t-=1;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var o=e.nodes[r],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==r||n)}}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start");var r=void 0;e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}},{key:"raw",value:function(e,t,n){var r=void 0;if(n||(n=t),t&&void 0!==(r=e.raws[t]))return r;var o=e.parent;if("before"===n&&(!o||"root"===o.type&&o.first===e))return"";if(!o)return Fe[n];var i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);var s="raw"+l(n);return this[s]?r=this[s](i,e):i.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=Fe[n]),i.rawCache[n]=r,r}},{key:"rawSemicolon",value:function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawEmptyBody",value:function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(e){if(e.raws.indent)return e.raws.indent;var t=void 0;return e.walk(function(n){var r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){var o=n.raws.before.split("\n");return t=o[o.length-1],t=t.replace(/[^\s]/g,""),!1}}),t}},{key:"rawBeforeComment",value:function(e,t){var n=void 0;return e.walkComments(function(e){if(void 0!==e.raws.before)return n=e.raws.before,-1!==n.indexOf("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n&&(n=this.raw(t,null,"beforeDecl")),n}},{key:"rawBeforeDecl",value:function(e,t){var n=void 0;return e.walkDecls(function(e){if(void 0!==e.raws.before)return n=e.raws.before,-1!==n.indexOf("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n&&(n=this.raw(t,null,"beforeRule")),n}},{key:"rawBeforeRule",value:function(e){var t=void 0;return e.walk(function(n){if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.raws.before,-1!==t.indexOf("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t}},{key:"rawBeforeClose",value:function(e){var t=void 0;return e.walk(function(e){if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,-1!==t.indexOf("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t}},{key:"rawBeforeOpen",value:function(e){var t=void 0;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawColon",value:function(e){var t=void 0;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"beforeAfter",value:function(e,t){var n=void 0;n="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");for(var r=e.parent,o=0;r&&"root"!==r.type;)o+=1,r=r.parent;if(-1!==n.indexOf("\n")){var i=this.raw(e,null,"indent");if(i.length)for(var s=0;s<o;s++)n+=i}return n}},{key:"rawValue",value:function(e,t){var n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}}]),e}(),Ie=function e(t,n){var r=new t.constructor;for(var o in t)if(t.hasOwnProperty(o)){var i=t[o],s=void 0===i?"undefined":Y(i);"parent"===o&&"object"===s?n&&(r[o]=n):"source"===o?r[o]=i:i instanceof Array?r[o]=i.map(function(t){return e(t,r)}):"before"!==o&&"after"!==o&&"between"!==o&&"semicolon"!==o&&("object"===s&&null!==i&&(i=e(i)),r[o]=i)}return r},Ne=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};V(this,e),this.raws={};for(var n in t)this[n]=t[n]}return q(e,[{key:"error",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.source){var n=this.positionBy(t);return this.source.input.error(e,n.line,n.column,t)}return new De(e)}},{key:"warn",value:function(e,t,n){var r={node:this};for(var o in n)r[o]=n[o];return e.warn(t,r)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f;e.stringify&&(e=e.stringify);var t="";return e(this,function(e){t+=e}),t}},{key:"clone",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Ie(this);for(var n in e)t[n]=e[n];return t}},{key:"cloneBefore",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.clone(e);return this.parent.insertBefore(this,t),t}},{key:"cloneAfter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.clone(e);return this.parent.insertAfter(this,t),t}},{key:"replaceWith",value:function(){var e=this;if(this.parent){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];n.forEach(function(t){e.parent.insertBefore(e,t)}),this.remove()}return this}},{key:"moveTo",value:function(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.append(this),this}},{key:"moveBefore",value:function(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertBefore(e,this),this}},{key:"moveAfter",value:function(e){return this.cleanRaws(this.root()===e.root()),this.remove(),e.parent.insertAfter(e,this),this}},{key:"next",value:function(){var e=this.parent.index(this);return this.parent.nodes[e+1]}},{key:"prev",value:function(){var e=this.parent.index(this);return this.parent.nodes[e-1]}},{key:"toJSON",value:function(){var e={};for(var t in this)if(this.hasOwnProperty(t)&&"parent"!==t){var n=this[t];n instanceof Array?e[t]=n.map(function(e){return"object"===(void 0===e?"undefined":Y(e))&&e.toJSON?e.toJSON():e}):"object"===(void 0===n?"undefined":Y(n))&&n.toJSON?e[t]=n.toJSON():e[t]=n}return e}},{key:"raw",value:function(e,t){return(new Me).raw(this,e,t)}},{key:"root",value:function(){for(var e=this;e.parent;)e=e.parent;return e}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"positionInside",value:function(e){for(var t=this.toString(),n=this.source.start.column,r=this.source.start.line,o=0;o<e;o++)"\n"===t[o]?(n=1,r+=1):n+=1;return{line:r,column:n}}},{key:"positionBy",value:function(e){var t=this.source.start;if(e.index)t=this.positionInside(e.index);else if(e.word){var n=this.toString().indexOf(e.word);-1!==n&&(t=this.positionInside(n))}return t}},{key:"removeSelf",value:function(){return s("Node#removeSelf is deprecated. Use Node#remove."),this.remove()}},{key:"replace",value:function(e){return s("Node#replace is deprecated. Use Node#replaceWith"),this.replaceWith(e)}},{key:"style",value:function(e,t){return s("Node#style() is deprecated. Use Node#raw()"),this.raw(e,t)}},{key:"cleanStyles",value:function(e){return s("Node#cleanStyles() is deprecated. Use Node#cleanRaws()"),this.cleanRaws(e)}},{key:"before",get:function(){return s("Node#before is deprecated. Use Node#raws.before"),this.raws.before},set:function(e){s("Node#before is deprecated. Use Node#raws.before"),this.raws.before=e}},{key:"between",get:function(){return s("Node#between is deprecated. Use Node#raws.between"),this.raws.between},set:function(e){s("Node#between is deprecated. Use Node#raws.between"),this.raws.between=e}}]),e}(),Be=function(e){function t(e){V(this,t);var n=K(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="decl",n}return X(t,e),q(t,[{key:"_value",get:function(){return s("Node#_value was deprecated. Use Node#raws.value"),this.raws.value},set:function(e){s("Node#_value was deprecated. Use Node#raws.value"),this.raws.value=e}},{key:"_important",get:function(){return s("Node#_important was deprecated. Use Node#raws.important"),this.raws.important},set:function(e){s("Node#_important was deprecated. Use Node#raws.important"),this.raws.important=e}}]),t}(Ne),Ue=function(e){function t(e){V(this,t);var n=K(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="comment",n}return X(t,e),q(t,[{key:"left",get:function(){return s("Comment#left was deprecated. Use Comment#raws.left"),this.raws.left},set:function(e){s("Comment#left was deprecated. Use Comment#raws.left"),this.raws.left=e}},{key:"right",get:function(){return s("Comment#right was deprecated. Use Comment#raws.right"),this.raws.right},set:function(e){s("Comment#right was deprecated. Use Comment#raws.right"),this.raws.right=e}}]),t}(Ne),Le=function(){function e(t){V(this,e),this.input=t,this.pos=0,this.root=new Xe,this.current=this.root,this.spaces="",this.semicolon=!1,this.root.source={input:t,start:{line:1,column:1}}}return q(e,[{key:"tokenize",value:function(){this.tokens=a(this.input)}},{key:"loop",value:function(){for(var e=void 0;this.pos<this.tokens.length;){switch(e=this.tokens[this.pos],e[0]){case"space":case";":this.spaces+=e[1];break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other()}this.pos+=1}this.endFile()}},{key:"comment",value:function(e){var t=new Ue;this.init(t,e[2],e[3]),t.source.end={line:e[4],column:e[5]};var n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{var r=n.match(/^(\s*)([^]*[^\s])(\s*)$/);t.text=r[2],t.raws.left=r[1],t.raws.right=r[3]}}},{key:"emptyRule",value:function(e){var t=new Ve;this.init(t,e[2],e[3]),t.selector="",t.raws.between="",this.current=t}},{key:"other",value:function(){for(var e=void 0,t=!1,n=null,r=!1,o=null,i=[],s=this.pos;this.pos<this.tokens.length;){if(e=this.tokens[this.pos],"("===(n=e[0])||"["===n)o||(o=e),i.push("("===n?")":"]");else if(0===i.length){if(";"===n){if(r)return void this.decl(this.tokens.slice(s,this.pos+1));break}if("{"===n)return void this.rule(this.tokens.slice(s,this.pos+1));if("}"===n){this.pos-=1,t=!0;break}":"===n&&(r=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(o=null));this.pos+=1}if(this.pos===this.tokens.length&&(this.pos-=1,t=!0),i.length>0&&this.unclosedBracket(o),t&&r){for(;this.pos>s&&("space"===(e=this.tokens[this.pos][0])||"comment"===e);)this.pos-=1;return void this.decl(this.tokens.slice(s,this.pos+1))}this.unknownWord(s)}},{key:"rule",value:function(e){e.pop();var t=new Ve;this.init(t,e[0][2],e[0][3]),t.raws.between=this.spacesFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"decl",value:function(e){var t=new Be;this.init(t);var n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),n[4]?t.source.end={line:n[4],column:n[5]}:t.source.end={line:n[2],column:n[3]};"word"!==e[0][0];)t.raws.before+=e.shift()[1];for(t.source.start={line:e[0][2],column:e[0][3]},t.prop="";e.length;){var r=e[0][0];if(":"===r||"space"===r||"comment"===r)break;t.prop+=e.shift()[1]}t.raws.between="";for(var o=void 0;e.length;){if(o=e.shift(),":"===o[0]){t.raws.between+=o[1];break}t.raws.between+=o[1]}"_"!==t.prop[0]&&"*"!==t.prop[0]||(t.raws.before+=t.prop[0],t.prop=t.prop.slice(1)),t.raws.between+=this.spacesFromStart(e),this.precheckMissedSemicolon(e);for(var i=e.length-1;i>0;i--){if(o=e[i],"!important"===o[1]){t.important=!0;var s=this.stringFrom(e,i);s=this.spacesFromEnd(e)+s," !important"!==s&&(t.raws.important=s);break}if("important"===o[1]){for(var a=e.slice(0),u="",c=i;c>0;c--){var l=a[c][0];if(0===u.trim().indexOf("!")&&"space"!==l)break;u=a.pop()[1]+u}0===u.trim().indexOf("!")&&(t.important=!0,t.raws.important=u,e=a)}if("space"!==o[0]&&"comment"!==o[0])break}this.raw(t,"value",e),-1!==t.value.indexOf(":")&&this.checkMissedSemicolon(e)}},{key:"atrule",value:function(e){var t=new We;t.name=e[1].slice(1),""===t.name&&this.unnamedAtrule(t,e),this.init(t,e[2],e[3]);var n=!1,r=!1,o=[];for(this.pos+=1;this.pos<this.tokens.length;){if(e=this.tokens[this.pos],";"===e[0]){t.source.end={line:e[2],column:e[3]},this.semicolon=!0;break}if("{"===e[0]){r=!0;break}if("}"===e[0]){this.end(e);break}o.push(e),this.pos+=1}this.pos===this.tokens.length&&(n=!0),t.raws.between=this.spacesFromEnd(o),o.length?(t.raws.afterName=this.spacesFromStart(o),this.raw(t,"params",o),n&&(e=o[o.length-1],t.source.end={line:e[4],column:e[5]},this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),r&&(t.nodes=[],this.current=t)}},{key:"end",value:function(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end={line:e[2],column:e[3]},this.current=this.current.parent):this.unexpectedClose(e)}},{key:"endFile",value:function(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces}},{key:"init",value:function(e,t,n){this.current.push(e),e.source={start:{line:t,column:n},input:this.input},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}},{key:"raw",value:function(e,t,n){for(var r=void 0,o=void 0,i=n.length,s="",a=!0,u=0;u<i;u+=1)r=n[u],o=r[0],"comment"===o||"space"===o&&u===i-1?a=!1:s+=r[1];if(!a){var c=n.reduce(function(e,t){return e+t[1]},"");e.raws[t]={value:s,raw:c}}e[t]=s}},{key:"spacesFromEnd",value:function(e){for(var t=void 0,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesFromStart",value:function(e){for(var t=void 0,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"colon",value:function(e){for(var t=0,n=void 0,r=void 0,o=void 0,i=0;i<e.length;i++){if(n=e[i],"("===(r=n[0]))t+=1;else if(")"===r)t-=1;else if(0===t&&":"===r){if(o){if("word"===o[0]&&"progid"===o[1])continue;return i}this.doubleColon(n)}o=n}return!1}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",e[2],e[3])}},{key:"unknownWord",value:function(e){var t=this.tokens[e];throw this.input.error("Unknown word",t[2],t[3])}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",e[2],e[3])}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",e[2],e[3])}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",t[2],t[3])}},{key:"precheckMissedSemicolon",value:function(e){}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n=0,r=void 0,o=t-1;o>=0&&(r=e[o],"space"===r[0]||2!==(n+=1));o--);throw this.input.error("Missed semicolon",r[2],r[3])}}}]),e}(),ze=function(e){function t(){return V(this,t),K(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return X(t,e),q(t,[{key:"push",value:function(e){return e.parent=this,this.nodes.push(e),this}},{key:"each",value:function(e){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var t=this.lastEach;if(this.indexes[t]=0,this.nodes){for(var n=void 0,r=void 0;this.indexes[t]<this.nodes.length&&(n=this.indexes[t],!1!==(r=e(this.nodes[n],n)));)this.indexes[t]+=1;return delete this.indexes[t],r}}},{key:"walk",value:function(e){return this.each(function(t,n){var r=e(t,n);return!1!==r&&t.walk&&(r=t.walk(e)),r})}},{key:"walkDecls",value:function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk(function(n,r){if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("decl"===e.type)return t(e,n)}))}},{key:"walkRules",value:function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk(function(n,r){if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("rule"===e.type)return t(e,n)}))}},{key:"walkAtRules",value:function(e,t){return t?e instanceof RegExp?this.walk(function(n,r){if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk(function(n,r){if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk(function(e,n){if("atrule"===e.type)return t(e,n)}))}},{key:"walkComments",value:function(e){return this.walk(function(t,n){if("comment"===t.type)return e(t,n)})}},{key:"append",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return n.forEach(function(t){e.normalize(t,e.last).forEach(function(t){return e.nodes.push(t)})}),this}},{key:"prepend",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return n=n.reverse(),n.forEach(function(t){var n=e.normalize(t,e.first,"prepend").reverse();n.forEach(function(t){return e.nodes.unshift(t)});for(var r in e.indexes)e.indexes[r]=e.indexes[r]+n.length}),this}},{key:"cleanRaws",value:function(e){$(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"cleanRaws",this).call(this,e),this.nodes&&this.nodes.forEach(function(t){return t.cleanRaws(e)})}},{key:"insertBefore",value:function(e,t){var n=this;e=this.index(e);var r=0===e&&"prepend",o=this.normalize(t,this.nodes[e],r).reverse();o.forEach(function(t){return n.nodes.splice(e,0,t)});var i=void 0;for(var s in this.indexes)i=this.indexes[s],e<=i&&(this.indexes[s]=i+o.length);return this}},{key:"insertAfter",value:function(e,t){var n=this;e=this.index(e);var r=this.normalize(t,this.nodes[e]).reverse();r.forEach(function(t){return n.nodes.splice(e+1,0,t)});var o=void 0;for(var i in this.indexes)o=this.indexes[i],e<o&&(this.indexes[i]=o+r.length);return this}},{key:"remove",value:function(e){return void 0!==e?(s("Container#remove is deprecated. Use Container#removeChild"),this.removeChild(e)):$(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"remove",this).call(this),this}},{key:"removeChild",value:function(e){e=this.index(e),this.nodes[e].parent=void 0,this.nodes.splice(e,1);var t=void 0;for(var n in this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this}},{key:"removeAll",value:function(){return this.nodes.forEach(function(e){return e.parent=void 0}),this.nodes=[],this}},{key:"replaceValues",value:function(e,t,n){return n||(n=t,t={}),this.walkDecls(function(r){t.props&&-1===t.props.indexOf(r.prop)||t.fast&&-1===r.value.indexOf(t.fast)||(r.value=r.value.replace(e,n))}),this}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"index",value:function(e){return"number"==typeof e?e:this.nodes.indexOf(e)}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=p(h(e).nodes);else if(!Array.isArray(e))if("root"===e.type)e=e.nodes;else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new Be(e)]}else if(e.selector)e=[new Ve(e)];else if(e.name)e=[new We(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new Ue(e)]}return e.map(function(e){return void 0===e.raws&&(e=n.rebuild(e)),e.parent&&(e=e.clone()),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/[^\s]/g,"")),e.parent=n,e})}},{key:"rebuild",value:function(e,t){var n=this,r=void 0;"root"===e.type?r=new Xe:"atrule"===e.type?r=new We:"rule"===e.type?r=new Ve:"decl"===e.type?r=new Be:"comment"===e.type&&(r=new Ue);for(var o in e)"nodes"===o?r.nodes=e.nodes.map(function(e){return n.rebuild(e,r)}):"parent"===o&&t?r.parent=t:e.hasOwnProperty(o)&&(r[o]=e[o]);return r}},{key:"eachInside",value:function(e){return s("Container#eachInside is deprecated. Use Container#walk instead."),this.walk(e)}},{key:"eachDecl",value:function(e,t){return s("Container#eachDecl is deprecated. Use Container#walkDecls instead."),this.walkDecls(e,t)}},{key:"eachRule",value:function(e,t){return s("Container#eachRule is deprecated. Use Container#walkRules instead."),this.walkRules(e,t)}},{key:"eachAtRule",value:function(e,t){return s("Container#eachAtRule is deprecated. Use Container#walkAtRules instead."),this.walkAtRules(e,t)}},{key:"eachComment",value:function(e){return s("Container#eachComment is deprecated. Use Container#walkComments instead."),this.walkComments(e)}},{key:"first",get:function(){if(this.nodes)return this.nodes[0]}},{key:"last",get:function(){if(this.nodes)return this.nodes[this.nodes.length-1]}},{key:"semicolon",get:function(){return s("Node#semicolon is deprecated. Use Node#raws.semicolon"),this.raws.semicolon},set:function(e){s("Node#semicolon is deprecated. Use Node#raws.semicolon"),this.raws.semicolon=e}},{key:"after",get:function(){return s("Node#after is deprecated. Use Node#raws.after"),this.raws.after},set:function(e){s("Node#after is deprecated. Use Node#raws.after"),this.raws.after=e}}]),t}(Ne),We=function(e){function t(e){V(this,t);var n=K(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="atrule",n}return X(t,e),q(t,[{key:"append",value:function(){var e;this.nodes||(this.nodes=[]);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=$(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"append",this)).call.apply(e,[this].concat(r))}},{key:"prepend",value:function(){var e;this.nodes||(this.nodes=[]);for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=$(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"prepend",this)).call.apply(e,[this].concat(r))}},{key:"afterName",get:function(){return s("AtRule#afterName was deprecated. Use AtRule#raws.afterName"),this.raws.afterName},set:function(e){s("AtRule#afterName was deprecated. Use AtRule#raws.afterName"),this.raws.afterName=e}},{key:"_params",get:function(){return s("AtRule#_params was deprecated. Use AtRule#raws.params"),this.raws.params},set:function(e){s("AtRule#_params was deprecated. Use AtRule#raws.params"),this.raws.params=e}}]),t}(ze),Ye={split:function(e,t,n){for(var r=[],o="",i=!1,s=0,a=!1,u=!1,c=0;c<e.length;c++){var l=e[c];a?u?u=!1:"\\"===l?u=!0:l===a&&(a=!1):'"'===l||"'"===l?a=l:"("===l?s+=1:")"===l?s>0&&(s-=1):0===s&&-1!==t.indexOf(l)&&(i=!0),i?(""!==o&&r.push(o.trim()),o="",i=!1):o+=l}return(n||""!==o)&&r.push(o.trim()),r},space:function(e){var t=[" ","\n","\t"];return Ye.split(e,t)},comma:function(e){return Ye.split(e,[","],!0)}},Ve=function(e){function t(e){V(this,t);var n=K(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="rule",n.nodes||(n.nodes=[]),n}return X(t,e),q(t,[{key:"selectors",get:function(){return Ye.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}},{key:"_selector",get:function(){return s("Rule#_selector is deprecated. Use Rule#raws.selector"),this.raws.selector},set:function(e){s("Rule#_selector is deprecated. Use Rule#raws.selector"),this.raws.selector=e}}]),t}(ze),qe=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(V(this,e),this.type="warning",this.text=t,n.node&&n.node.source){var r=n.node.positionBy(n);this.line=r.line,this.column=r.column}for(var o in n)this[o]=n[o]}return q(e,[{key:"toString",value:function(){return this.node?this.node.error(this.text,{plugin:this.plugin,index:this.index,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}]),e}(),He=function(){function e(t,n,r){V(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0}return q(e,[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);var n=new qe(e,t);return this.messages.push(n),n}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),e}(),Ge=function(){function e(t,n,r){V(this,e),this.stringified=!1,this.processed=!1;var o=void 0;if("object"===(void 0===n?"undefined":Y(n))&&"root"===n.type)o=n;else if(n instanceof e||n instanceof He)o=n.root,n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var i=h;r.syntax&&(i=r.syntax.parse),r.parser&&(i=r.parser),i.parse&&(i=i.parse);try{o=i(n,r)}catch(e){this.error=e}}this.result=new He(t,o,r)}return q(e,[{key:"warnings",value:function(){return this.sync().warnings()}},{key:"toString",value:function(){return this.css}},{key:"then",value:function(e,t){return this.async().then(e,t)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"handleError",value:function(e,t){try{if(this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(t.postcssVersion){var n=t.postcssPlugin,r=t.postcssVersion,o=this.result.processor.version,i=r.split("."),a=o.split(".");(i[0]!==a[0]||parseInt(i[1])>parseInt(a[1]))&&s("Your current PostCSS version is "+o+", but "+n+" uses "+r+". Perhaps this is the source of the error below.")}}else e.plugin=t.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}}},{key:"asyncTick",value:function(e,t){var n=this;if(this.plugin>=this.processor.plugins.length)return this.processed=!0,e();try{var r=this.processor.plugins[this.plugin],o=this.run(r);this.plugin+=1,d(o)?o.then(function(){n.asyncTick(e,t)}).catch(function(e){n.handleError(e,r),n.processed=!0,t(e)}):this.asyncTick(e,t)}catch(e){this.processed=!0,t(e)}}},{key:"async",value:function(){var e=this;return this.processed?new Promise(function(t,n){e.error?n(e.error):t(e.stringify())}):this.processing?this.processing:(this.processing=new Promise(function(t,n){if(e.error)return n(e.error);e.plugin=0,e.asyncTick(t,n)}).then(function(){return e.processed=!0,e.stringify()}),this.processing)}},{key:"sync",value:function(){var e=this;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw new Error("Use process(css).then(cb) to work with async plugins");if(this.error)throw this.error;return this.result.processor.plugins.forEach(function(t){if(d(e.run(t)))throw new Error("Use process(css).then(cb) to work with async plugins")}),this.result}},{key:"run",value:function(e){this.result.lastPlugin=e;try{return e(this.result.root,this.result)}catch(t){throw this.handleError(t,e),t}}},{key:"stringify",value:function(){if(this.stringified)return this.result;this.stringified=!0,this.sync();var e=this.result.opts,t=f;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);var n="";return t(this.root,function(e){n+=e}),this.result.css=n,this.result}},{key:"processor",get:function(){return this.result.processor}},{key:"opts",get:function(){return this.result.opts}},{key:"css",get:function(){return this.stringify().css}},{key:"content",get:function(){return this.stringify().content}},{key:"map",get:function(){return this.stringify().map}},{key:"root",get:function(){return this.sync().root}},{key:"messages",get:function(){return this.sync().messages}}]),e}(),$e=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];V(this,e),this.version="5.2.0",this.plugins=this.normalize(t)}return q(e,[{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},{key:"process",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Ge(this,e,t)}},{key:"normalize",value:function(e){var t=[];return e.forEach(function(e){if(e.postcss&&(e=e.postcss),"object"===(void 0===e?"undefined":Y(e))&&Array.isArray(e.plugins))t=t.concat(e.plugins);else{if("function"!=typeof e)throw new Error(e+" is not a PostCSS plugin");t.push(e)}}),t}}]),e}(),Xe=function(e){function t(e){V(this,t);var n=K(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.type="root",n.nodes||(n.nodes=[]),n}return X(t,e),q(t,[{key:"removeChild",value:function(e){return e=this.index(e),0===e&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[e].raws.before),$(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"removeChild",this).call(this,e)}},{key:"normalize",value:function(e,n,r){var o=$(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"normalize",this).call(this,e);return n&&("prepend"===r?this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before:this.first!==n&&o.forEach(function(e){e.raws.before=n.raws.before})),o}},{key:"toResult",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Ge(new $e,this,e).stringify()}},{key:"remove",value:function(e){s("Root#remove is deprecated. Use Root#removeChild"),this.removeChild(e)}},{key:"prevMap",value:function(){return s("Root#prevMap is deprecated. Use Root#source.input.map"),this.source.input.map}}]),t}(ze),Ke=0,Je=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};V(this,e),this.css=t.toString(),"\ufeff"!==this.css[0]&&"￾"!==this.css[0]||(this.css=this.css.slice(1)),n.from&&(/^\w+:\/\//.test(n.from)?this.file=n.from:this.file=path.resolve(n.from)),this.file||(Ke+=1,this.id="<input css "+Ke+">"),this.map&&(this.map.file=this.from)}return q(e,[{key:"error",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0,i=this.origin(t,n);return o=i?new De(e,i.line,i.column,i.source,i.file,r.plugin):new De(e,t,n,this.css,this.file,r.plugin),o.input={line:t,column:n,source:this.css},this.file&&(o.input.file=this.file),o}},{key:"origin",value:function(e,t){if(!this.map)return!1;var n=this.map.consumer(),r=n.originalPositionFor({line:e,column:t});if(!r.source)return!1;var o={file:this.mapResolve(r.source),line:r.line,column:r.column},i=n.sourceContentFor(r.source);return i&&(o.source=i),o}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:path.resolve(this.map.consumer().sourceRoot||".",e)}},{key:"from",get:function(){return this.file||this.id}}]),e}(),Ze=function(e){function t(){return V(this,t),K(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return X(t,e),q(t,[{key:"tokenize",value:function(){this.tokens=a(this.input,