-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.min.js
1 lines (1 loc) · 4.06 KB
/
client.min.js
1
var precss=function(){"use strict";function n(n){return function(t){return t==n}}var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=n;n.fn=function(n){return"function"==typeof n},n.str=function(n){return"string"==typeof n},n.num=function(n){return"number"==typeof n},n.obj=function(n){return"object"==typeof n},n.lit=function(n){return"object"==typeof n&&!(n instanceof Array)},n.bol=function(n){return"boolean"==typeof n},n.truthy=function(n){return 1==!!n},n.falsy=function(n){return 0==!!n},n.arr=function(n){return n instanceof Array},n.null=function(n){return null===n},n.def=function(n){return void 0!==n},n.in=function(n){return function(t){return!!n&&(n.indexOf?~n.indexOf(t):t in n)}},n.promise=function(n){return n instanceof Promise},n.stream=function(n){return!(!n||!n.next)};var e={arr:function(n){return Array.prototype.slice.call(n,0)},obj:function(n){function t(n,t,o){return 0===o&&(n={}),n[r.fn(e)?e(t,o):t[e]]=t,n}var e="id";return 1==arguments.length?(e=n,t):t.apply(this,arguments)}},o="undefined"!=typeof window,u=o?window:t,i=function(n){return function(t){if(!u.console||!console.log.apply)return t;r.arr(arguments[2])&&(arguments[2]=arguments[2].length);var o=e.arr(arguments),i="[log]["+(new Date).toISOString()+"]"+n;return o.unshift(i.grey?i.grey:i),console.log.apply(console,o),t}},f=function n(t,e){var o=arguments.length;return r.str(t)||2!=o?r.str(t)||3!=o?function(n){var u=this||{};return n=u.nodeName||r.fn(u.node)?u:n,n=n.node?n.node():n,n=n.host||n,o>1&&!1===e?n.removeAttribute(t):o>1?(n.setAttribute(t,e),e):n.attributes.getNamedItem(t)&&n.attributes.getNamedItem(t).value}:n(arguments[1],arguments[2]).call(this,arguments[0]):n(arguments[1]).call(this,arguments[0])},c=function(n,t){var r=!t&&document.head.createShadowRoot?"html /deep/ ":"";return(t||document).querySelector(r+n)},s=function(n){return 0===n?"0":n?r.fn(n)?""+n:r.obj(n)?JSON.stringify(n):String(n):""},a=function(n){return function(){return!n.apply(this,arguments)}},l=function(n){return function(){return n}},d=function n(t,e){var o=arguments.length>1,u=r.fn(t)?[]:s(t).split("."),i=u.shift();return function(f,c){var s={};return f?r.num(t)||t?r.arr(t)?(t.map(function(t){var e=n(t)(f);void 0!=e&&n(t,r.fn(e)?l(e):e)(s)}),s):f[t]||!u.length?o?(f[t]=r.fn(e)?e(f[t],c):e,f):r.fn(t)?t(f):f[t]:o?(n(u.join("."),e)(f[i]?f[i]:f[i]={}),f):n(u.join("."))(f[i]):f:void 0}},p=function(n,t){var e=1==arguments.length;return function(o){var u=r.fn(n)?n(o):d(n)(o);return u&&t&&u.toLowerCase&&t.toLowerCase?u.toLowerCase()===t.toLowerCase():e?Boolean(u):r.fn(t)?t(u):u==t}},h=function(n){return function(t){return n+t}},g=function(n){var t=[],r=n.replace(/\[(.+?)=(.*?)\]/g,function(n,r,e){return t.push([r,e]),""}).split("."),e=r.shift(),o=document.createElement(e);return t.forEach(function(n){f(o,n[0],n[1])}),r.forEach(function(n){o.classList.add(n)}),o.toString=function(){return e+r.map(h(".")).join("")},o},m=function(n,t){return n.replace(/^(?!.*:host)([^@%\n]*){/gim,function(n){return t+" "+n}).replace(/^(?!.*:host)(.*?),\s*$/gim,function(n){return t+" "+n}).replace(/:host\((.*?)\)/gi,function(n,r){return t+r}).replace(/:host([ ,])/gi,function(n,r){return t+r}).replace(/^.*:host-context\((.*)\)/gim,function(n,r){return r+" "+t})};return function(n,t){return t={exports:{}},n(t,t.exports),t.exports}(function(n){n.exports=function(n){if(o)return u("creating"),n.render=t(n)(n.render),n};var t=function(n){return function(t){return function(o){var u=s(f(o,"css")).split(" ").filter(Boolean),i=o.shadowRoot||o,l=document.head,d=l.createShadowRoot&&o.shadowRoot;if(!u.length)return t(o);if(!u.some(a(r.in(n.resources))))return u.map(function(t){return{res:n.resources[t],el:c('style[resource="'+t+'"]',d?i:l)||g("style[resource="+t+"]")}}).filter(function(n){return n.el.hash!=n.res.headers.hash}).map(function(n){return n.el.hash=n.res.headers.hash,n.el.innerHTML=d?n.res.body:e(n.res.body,n.res.name),n.el}).filter(a(p("parentNode"))).map(function(n){return d?i.insertBefore(n,i.firstChild):l.appendChild(n)}),t(o)}}},e=function(n,t){return m(n,'[css~="'+t+'"]')},u=i("[ri/precss]")})}();