DieselDepot-APP/node_modules/@tailwindcss/postcss/dist/index.mjs

11 lines
45 KiB
JavaScript
Raw Normal View History

var ve=(e,r)=>(r=Symbol[e])?r:Symbol.for("Symbol."+e),ke=e=>{throw TypeError(e)};var be=(e,r,t)=>{if(r!=null){typeof r!="object"&&typeof r!="function"&&ke("Object expected");var l,o;t&&(l=r[ve("asyncDispose")]),l===void 0&&(l=r[ve("dispose")],t&&(o=l)),typeof l!="function"&&ke("Object not disposable"),o&&(l=function(){try{o.call(this)}catch(n){return Promise.reject(n)}}),e.push([t,l,r])}else t&&e.push([t]);return r},we=(e,r,t)=>{var l=typeof SuppressedError=="function"?SuppressedError:function(i,a,u,s){return s=Error(u),s.name="SuppressedError",s.error=i,s.suppressed=a,s},o=i=>r=t?new l(i,r,"An error was suppressed during disposal"):(t=!0,i),n=i=>{for(;i=e.pop();)try{var a=i[1]&&i[1].call(i[2]);if(i[0])return Promise.resolve(a).then(n,u=>(o(u),n()))}catch(u){o(u)}if(t)throw r};return n()};import jt from"@alloc/quick-lru";import{compileAst as Wt,env as Bt,Features as de,Instrumentation as Yt,optimize as Gt,Polyfills as me}from"@tailwindcss/node";import{clearRequireCache as Ht}from"@tailwindcss/node/require-cache";import{Scanner as qt}from"@tailwindcss/oxide";import Zt from"fs";import D,{relative as qe}from"path";function M(e){return{kind:"word",value:e}}function Xe(e,r){return{kind:"function",value:e,nodes:r}}function et(e){return{kind:"separator",value:e}}function A(e){let r="";for(let t of e)switch(t.kind){case"word":case"separator":{r+=t.value;break}case"function":r+=t.value+"("+A(t.nodes)+")"}return r}var ye=92,tt=41,xe=58,Ae=44,rt=34,Ce=61,Se=62,Te=60,$e=10,it=40,nt=39,ot=47,Ne=32,Ve=9;function w(e){e=e.replaceAll(`\r
`,`
`);let r=[],t=[],l=null,o="",n;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);switch(a){case ye:{o+=e[i]+e[i+1],i++;break}case ot:{if(o.length>0){let s=M(o);l?l.nodes.push(s):r.push(s),o=""}let u=M(e[i]);l?l.nodes.push(u):r.push(u);break}case xe:case Ae:case Ce:case Se:case Te:case $e:case Ne:case Ve:{if(o.length>0){let f=M(o);l?l.nodes.push(f):r.push(f),o=""}let u=i,s=i+1;for(;s<e.length&&(n=e.charCodeAt(s),!(n!==xe&&n!==Ae&&n!==Ce&&n!==Se&&n!==Te&&n!==$e&&n!==Ne&&n!==Ve));s++);i=s-1;let c=et(e.slice(u,s));l?l.nodes.push(c):r.push(c);break}case nt:case rt:{let u=i;for(let s=i+1;s<e.length;s++)if(n=e.charCodeAt(s),n===ye)s+=1;else if(n===a){i=s;break}o+=e.slice(u,i+1);break}case it:{let u=Xe(o,[]);o="",l?l.nodes.push(u):r.push(u),t.push(u),l=u;break}case tt:{let u=t.pop();if(o.length>0){let s=M(o);u?.nodes.push(s),o=""}t.length>0?l=t[t.length-1]:l=null;break}default:o+=String.fromCharCode(a)}}return o.length>0&&r.push(M(o)),r}var d=class extends Map{constructor(t){super();this.factory=t}factory;get(t){let l=super.get(t);return l===void 0&&(l=this.factory(t,this),this.set(t,l)),l}};var or=new Uint8Array(256);var H=new Uint8Array(256);function v(e,r){let t=0,l=[],o=0,n=e.length,i=r.charCodeAt(0);for(let a=0;a<n;a++){let u=e.charCodeAt(a);if(t===0&&u===i){l.push(e.slice(o,a)),o=a+1;continue}switch(u){case 92:a+=1;break;case 39:case 34:for(;++a<n;){let s=e.charCodeAt(a);if(s===92){a+=1;continue}if(s===u)break}break;case 40:H[t]=41,t++;break;case 91:H[t]=93,t++;break;case 123:H[t]=125,t++;break;case 93:case 125:case 41:t>0&&u===H[t-1]&&t--;break}}return l.push(e.slice(o)),l}var re=(i=>(i[i.Continue=0]="Continue",i[i.Skip=1]="Skip",i[i.Stop=2]="Stop",i[i.Replace=3]="Replace",i[i.ReplaceSkip=4]="ReplaceSkip",i[i.ReplaceStop=5]="ReplaceStop",i))(re||{}),m={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function g(e,r){typeof r=="function"?Ee(e,r):Ee(e,r.enter,r.exit)}function Ee(e,r=()=>m.Continue,t=()=>m.Continue){let l={value:[e,0,null],prev:null},o={parent:null,depth:0,index:0,siblings:e,path(){let n=[],i=l;for(;i;){let a=i.value[2];a&&n.push(a),i=i.prev}return n.reverse(),n}};for(;l!==null;){let n=l.value,i=n[0],a=n[1],u=n[2];if(a>=i.length){l=l.prev,o.depth-=1;continue}if(o.parent=u,o.siblings=i,a>=0){o.index=a;let k=i[a],N=r(k,o)??m.Continue;switch(N.kind){case 0:{k.nodes&&k.nodes.length>0&&(o.depth+=1,l={value:[k.nodes,0,k],prev:l}),n[1]=~a;continue}case 2:return;case 1:{n[1]=~a;continue}case 3:{i.splice(a,1,...N.nodes);continue}case 5:{i.splice(a,1,...N.nodes);return}case 4:{i.splice(a,1,...N.nodes),n[1]+=N.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${re[N.kind]??`Unknown(${N.kind})`}\` in enter.`)}}let s=~a;o.index=s;let c=i[s],f=t(c,o)??m.Continue;switch(f.kind){case 0:n[1]=s+1;continue;case 2:return;case 3:{i.splice(s,1,...f.nodes),n[1]=s+f.nodes.length;continue}case 5:{i.splice(s,1,...f.nodes);return}case 4:{i.splice(s,1,...f.nodes),n[1]=s+f.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${re[f.kind]??`Unknown(${f.kind})`}\` in exit.`)}}}var hr=new d(e=>{let r=w(e),t=new Set,l=new Set(["~",">","+","-","*","/"]);return g(r,(o,n)=>{if(o.kind==="word"&&l.has(o.value)){let i=n.index;if(i===-1)return;let a=n.siblings[i-1];if(a?.kind!=="separator"||a.value!==" ")return;let u=n.siblings[i+1];if(u?.kind!=="separator"||u.value!==" ")return;let s=n.siblings[i-2];if(s&&l.has(s.value))return;let c=n.siblings[i+2];if(c&&l.has(c.value))return;t.add(a),t.add(u)}else if(o.kind==="separator"&&o.value.length>0&&o.value.trim()==="")(n.siblings[0]===o||n.siblings[n.siblings.length-1]===o)&&t.add(o);else if(o.kind==="separator"&&o.value.trim()===",")o.value=",";else if(o.kind==="function"&&o.value.startsWith("--")){let i=n.index;if(i<=0)return;let a=n.siblings[i-1];if(a?.kind==="separator"&&a.value===",")return;let u=n.siblings[i-2];return u&&!l.has(u.value)?void 0:m.ReplaceSkip({kind:"function",value:"",nodes:[o]})}}),t.size>0&&g
`,r){t+=s.length;let c=t;t+=i.property.length,t+=2,t+=i.value?.length??0,i.important&&(t+=11);let f=t;t+=2,i.dst=[l,c,f]}}else if(i.kind==="rule"){if(u+=`${s}${i.selector} {
`,r){t+=s.length;let c=t;t+=i.selector.length,t+=1;let f=t;i.dst=[l,c,f],t+=2}for(let c of i.nodes)u+=o(c,a+1);u+=`${s}}
`,r&&(t+=s.length,t+=2)}else if(i.kind==="at-rule"){if(i.nodes.length===0){let c=`${s}${i.name} ${i.params};
`;if(r){t+=s.length;let f=t;t+=i.name.length,t+=1,t+=i.params.length;let k=t;t+=2,i.dst=[l,f,k]}return c}if(u+=`${s}${i.name}${i.params?` ${i.params} `:" "}{
`,r){t+=s.length;let c=t;t+=i.name.length,i.params&&(t+=1,t+=i.params.length),t+=1;let f=t;i.dst=[l,c,f],t+=2}for(let c of i.nodes)u+=o(c,a+1);u+=`${s}}
`,r&&(t+=s.length,t+=2)}else if(i.kind==="comment"){if(u+=`${s}/*${i.value}*/
`,r){t+=s.length;let c=t;t+=2+i.value.length+2;let f=t;i.dst=[l,c,f],t+=1}}else if(i.kind==="context"||i.kind==="at-root")return"";return u}let n="";for(let i of e)n+=o(i,0);return l.code=n,n}var Ft=33;function Ye(e,r,t){let l=new d(s=>new e.Input(s.code,{map:t?.input.map,from:s.file??void 0})),o=new d(s=>Z(s.code)),n=e.root();n.source=t;function i(s){if(!s||!s[0])return;let c=o.get(s[0]),f=c.find(s[1]),k=c.find(s[2]);return{input:l.get(s[0]),start:{line:f.line,column:f.column+1,offset:s[1]},end:{line:k.line,column:k.column+1,offset:s[2]}}}function a(s,c){let f=i(c);f?s.source=f:delete s.source}function u(s,c){if(s.kind==="declaration"){let f=e.decl({prop:s.property,value:s.value??"",important:s.important});a(f,s.src),c.append(f)}else if(s.kind==="rule"){let f=e.rule({selector:s.selector});a(f,s.src),f.raws.semicolon=!0,c.append(f);for(let k of s.nodes)u(k,f)}else if(s.kind==="at-rule"){let f=e.atRule({name:s.name.slice(1),params:s.params});a(f,s.src),f.raws.semicolon=!0,c.append(f);for(let k of s.nodes)u(k,f)}else if(s.kind==="comment"){let f=e.comment({text:s.value});f.raws.left="",f.raws.right="",a(f,s.src),c.append(f)}else s.kind==="at-root"||s.kind}for(let s of r)u(s,n);return n}function Ge(e){let r=new d(n=>({file:n.file??n.id??null,code:n.css}));function t(n){let i=n.source;if(!i)return;let a=i.input;if(a&&i.start!==void 0&&i.end!==void 0)return[r.get(a),i.start.offset,i.end.offset]}function l(n,i){if(n.type==="decl"){let a=V(n.prop,n.value,n.important);a.src=t(n),i.push(a)}else if(n.type==="rule"){let a=O(n.selector);a.src=t(n),n.each(u=>l(u,a.nodes)),i.push(a)}else if(n.type==="atrule"){let a=C(`@${n.name}`,n.params);a.src=t(n),n.each(u=>l(u,a.nodes)),i.push(a)}else if(n.type==="comment"){if(n.text.charCodeAt(0)!==Ft)return;let a=Q(n.text);a.src=t(n),i.push(a)}}let o=[];return e.each(n=>l(n,o)),o}import{normalizePath as He}from"@tailwindcss/node";import X from"path";var ce="'",fe='"';function pe(){let e=new WeakSet;function r(t){let l=t.root().source?.input.file;if(!l)return;let o=t.source?.input.file;if(!o||e.has(t))return;let n=t.params[0],i=n[0]===fe&&n[n.length-1]===fe?fe:n[0]===ce&&n[n.length-1]===ce?ce:null;if(!i)return;let a=t.params.slice(1,-1),u="";if(a.startsWith("!")&&(a=a.slice(1),u="!"),!a.startsWith("./")&&!a.startsWith("../"))return;let s=X.posix.join(He(X.dirname(o)),a),c=X.posix.dirname(He(l)),f=X.posix.relative(c,s);f.startsWith(".")||(f="./"+f),t.params=i+u+f+i,e.add(t)}return{postcssPlugin:"tailwindcss-postcss-fix-relative-paths",Once(t){t.walkAtRules(/source|plugin|config/,r)}}}var p=Bt.DEBUG,ge=new jt({maxSize:50});function Qt(e,r,t){let l=`${r}:${t.base??""}:${JSON.stringify(t.optimize)}`;if(ge.has(l))return ge.get(l);let o={mtimes:new Map,inputCss:"",compiler:null,scanner:null,tailwindCssAst:[],cachedPostCssAst:e.root(),optimizedPostCssAst:e.root(),fullRebuildPaths:[]};return ge.set(l,o),o}function Jt(e={}){let r=e.base??process.cwd(),t=e.optimize??process.env.NODE_ENV==="production",l=e.transformAssetUrls??!0;return{postcssPlugin:"@tailwindcss/postcss",plugins:[pe(),{postcssPlugin:"tailwindcss",async Once(o,{result:n,postcss:i}){var he=[];try{let a=be(he,new Yt);let u=n.opts.from??"";let s=u.endsWith(".module.css");p&&a.start(`[@tailwindcss/postcss] ${qe(r,u)}`);{p&&a.start("Quick bail check");let b=!0;if(o.walkAtRules(h=>{if(h.name==="import"||h.name==="reference"||h.name==="theme"||h.name==="variant"||h.name==="config"||h.name==="plugin"||h.name==="apply"||h.name==="tailwind")return b=!1,!1}),b)return;p&&a.end("Quick bail check")}let c=Qt(i,u,e);let f=u?D.dirname(D.resolve(u)):r;let k=c.compiler===null;async function N(){p&&a.start("Setup compiler"),c.fullRebuildPaths.length>0&&!k&&Ht(c.fullRebuildPaths),c.fullRebuildPaths=[],p&&a.start("PostCSS AST -> Tailwind CSS AST");let b=Ge(o);p&&a.end("PostCSS AST -> Tailwind CSS AST"),p&&a.start("Create compiler");let h=await Wt(b,{from:n.opts.from,base:f,shouldRewriteUrls:l,onDependency:ee=>c.fullRebuildPaths.push(ee),polyfills:s?me.All^me.AtProperty:me.All});return p&&a.end("Create compiler"),p&&a.end("Setup compiler"),h}try{if(c.compiler??=