ray-template/js/@css-render_plugin-bem@0.15.14_css-render@0.15.14-B0Qt1gGG.js

2 lines
1.4 KiB
JavaScript

function z($){let b=".",f="__",o="--",m;{let e=$.blockPrefix;e&&(b=e),e=$.elementPrefix,e&&(f=e),e=$.modifierPrefix,e&&(o=e)}const c={install(e){m=e.c;const n=e.context;n.bem={},n.bem.b=null,n.bem.els=null}};function r(e){let n,l;return{before(i){n=i.bem.b,l=i.bem.els,i.bem.els=null},after(i){i.bem.b=n,i.bem.els=l},$({context:i,props:t}){return e=typeof e=="string"?e:e({context:i,props:t}),i.bem.b=e,`${(t==null?void 0:t.bPrefix)||b}${i.bem.b}`}}}function s(e){let n;return{before(l){n=l.bem.els},after(l){l.bem.els=n},$({context:l,props:i}){return e=typeof e=="string"?e:e({context:l,props:i}),l.bem.els=e.split(",").map(t=>t.trim()),l.bem.els.map(t=>`${(i==null?void 0:i.bPrefix)||b}${l.bem.b}${f}${t}`).join(", ")}}}function P(e){return{$({context:n,props:l}){e=typeof e=="string"?e:e({context:n,props:l});const i=e.split(",").map(u=>u.trim());function t(u){return i.map(_=>`&${(l==null?void 0:l.bPrefix)||b}${n.bem.b}${u!==void 0?`${f}${u}`:""}${o}${_}`).join(", ")}const d=n.bem.els;return d!==null?t(d[0]):t()}}}function v(e){return{$({context:n,props:l}){e=typeof e=="string"?e:e({context:n,props:l});const i=n.bem.els;return`&:not(${(l==null?void 0:l.bPrefix)||b}${n.bem.b}${i!==null&&i.length>0?`${f}${i[0]}`:""}${o}${e})`}}}return Object.assign(c,{cB:(...e)=>m(r(e[0]),e[1],e[2]),cE:(...e)=>m(s(e[0]),e[1],e[2]),cM:(...e)=>m(P(e[0]),e[1],e[2]),cNotM:(...e)=>m(v(e[0]),e[1],e[2])}),c}export{z as p};