mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
10 lines
3.7 KiB
10 lines
3.7 KiB
import{t as e}from"./@emotion-CU1dD7u8.js";function t(e){let t=0;for(let n=0;n<e.length;++n)e[n]===`&`&&++t;return t}var n=/\s*,(?![^(]*\))\s*/g,r=/\s+/g;function i(e,r){let i=[];return r.split(n).forEach(n=>{let r=t(n);if(!r){e.forEach(e=>{i.push((e&&e+` `)+n)});return}else if(r===1){e.forEach(e=>{i.push(n.replace(`&`,e))});return}let a=[n];for(;r--;){let t=[];a.forEach(n=>{e.forEach(e=>{t.push(n.replace(`&`,e))})}),a=t}a.forEach(e=>i.push(e))}),i}function a(e,t){let r=[];return t.split(n).forEach(t=>{e.forEach(e=>{r.push((e&&e+` `)+t)})}),r}function o(e){let t=[``];return e.forEach(e=>{e&&=e.trim(),e&&(t=e.includes(`&`)?i(t,e):a(t,e))}),t.join(`, `).replace(r,` `)}function s(e){if(!e)return;let t=e.parentElement;t&&t.removeChild(e)}function c(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function l(e){let t=document.createElement(`style`);return t.setAttribute(`cssr-id`,e),t}function u(e){return e?/^\s*@(s|m)/.test(e):!1}var d=/[A-Z]/g;function f(e){return e.replace(d,e=>`-`+e.toLowerCase())}function p(e,t=` `){return typeof e==`object`&&e?` {
|
|
`+Object.entries(e).map(e=>t+` ${f(e[0])}: ${e[1]};`).join(`
|
|
`)+`
|
|
`+t+`}`:`: ${e};`}function m(e,t,n){return typeof e==`function`?e({context:t.context,props:n}):e}function h(e,t,n,r){if(!t)return``;let i=m(t,n,r);if(!i)return``;if(typeof i==`string`)return`${e} {\n${i}\n}`;let a=Object.keys(i);if(a.length===0)return n.config.keepEmptyBlock?e+` {
|
|
}`:``;let o=e?[e+` {`]:[];return a.forEach(e=>{let t=i[e];if(e===`raw`){o.push(`
|
|
`+t+`
|
|
`);return}e=f(e),t!=null&&o.push(` ${e}${p(t)}`)}),e&&o.push(`}`),o.join(`
|
|
`)}function g(e,t,n){e&&e.forEach(e=>{if(Array.isArray(e))g(e,t,n);else if(typeof e==`function`){let r=e(t);Array.isArray(r)?g(r,t,n):r&&n(r)}else e&&n(e)})}function _(e,t,n,r,i){let a=e.$,s=``;if(!a||typeof a==`string`)u(a)?s=a:t.push(a);else if(typeof a==`function`){let e=a({context:r.context,props:i});u(e)?s=e:t.push(e)}else if(a.before&&a.before(r.context),!a.$||typeof a.$==`string`)u(a.$)?s=a.$:t.push(a.$);else if(a.$){let e=a.$({context:r.context,props:i});u(e)?s=e:t.push(e)}let c=o(t),l=h(c,e.props,r,i);s?n.push(`${s} {`):l.length&&n.push(l),e.children&&g(e.children,{context:r.context,props:i},e=>{if(typeof e==`string`){let t=h(c,{raw:e},r,i);n.push(t)}else _(e,t,n,r,i)}),t.pop(),s&&n.push(`}`),a&&a.after&&a.after(r.context)}function v(e,t,n){let r=[];return _(e,[],r,t,n),r.join(`
|
|
|
|
`)}typeof window<`u`&&(window.__cssrContext={});function y(e,t,n,r){let{els:i}=t;if(n===void 0)i.forEach(s),t.els=[];else{let e=c(n,r);e&&i.includes(e)&&(s(e),t.els=i.filter(t=>t!==e))}}function b(e,t){e.push(t)}function x(t,n,r,i,a,o,s,u,d){let f;if(r===void 0&&(f=n.render(i),r=e(f)),d){d.adapter(r,f??n.render(i));return}u===void 0&&(u=document.head);let p=c(r,u);if(p!==null&&!o)return p;let m=p??l(r);if(f===void 0&&(f=n.render(i)),m.textContent=f,p!==null)return p;if(s){let e=u.querySelector(`meta[name="${s}"]`);if(e)return u.insertBefore(m,e),b(n.els,m),m}return a?u.insertBefore(m,u.querySelector(`style, link`)):u.appendChild(m),b(n.els,m),m}function S(e){return v(this,this.instance,e)}function C(e={}){let{id:t,ssr:n,props:r,head:i=!1,force:a=!1,anchorMetaName:o,parent:s}=e;return x(this.instance,this,t,r,i,a,o,s,n)}function w(e={}){let{id:t,parent:n}=e;y(this.instance,this,t,n)}var T=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:S,mount:C,unmount:w}},E=function(e,t,n,r){return Array.isArray(t)?T(e,{$:null},null,t):Array.isArray(n)?T(e,t,null,n):Array.isArray(r)?T(e,t,n,r):T(e,t,n,null)};function D(e={}){let t={c:((...e)=>E(t,...e)),use:(e,...n)=>e.install(t,...n),find:c,context:{},config:e};return t}function O(e,t){if(e===void 0)return!1;if(t){let{context:{ids:n}}=t;return n.has(e)}return c(e)!==null}export{D as n,O as t}; |