1 line
314 KiB
JavaScript
1 line
314 KiB
JavaScript
|
var e,t;e=this,t=function(e){"use strict";const t=void 0;function n(e,t){return typeof e===t}function r(e){const t=e.ownerSVGElement;return!!t||null===t}function i(e){return"template"===e.tagName.toLowerCase()}function a(e){return n(e,"function")}function s(e){return!o(e)&&e.constructor===Object}function o(e){return null==e}function l(){return"undefined"!=typeof process}const c={ATTRIBUTE:0,EVENT:1,TEXT:2,VALUE:3};function u(e){return e.replace(/-(\w)/g,((e,t)=>t.toUpperCase()))}function p(e){throw Error(e)}function h(e){const t=new Map,n=n=>(t.has(n)||t.set(n,e.call(this,n)))&&t.get(n);return n.cache=t,n}function d(e){return e.reduce(((e,t)=>{const{value:n,type:r}=t;switch(!0){case!t.name&&0===r:return Object.assign({},e,n);case 3===r:e.value=t.value;break;default:e[u(t.name)]=t.value}return e}),{})}const f="exports",m="template",y="riot",g="RiotComponentWrapper",b="RiotComponent",v="javascript",x="template",S="script",E="style",T="textarea",k="isSpread";var P=Object.freeze({__proto__:null,JAVASCRIPT_OUTPUT_NAME:v,CSS_OUTPUT_NAME:"css",TEMPLATE_OUTPUT_NAME:x,JAVASCRIPT_TAG:S,STYLE_TAG:E,TEXTAREA_TAG:T,IS_RAW:"isRaw",IS_SELF_CLOSING:"isSelfClosing",IS_VOID:"isVoid",IS_BOOLEAN:"isBoolean",IS_CUSTOM:"isCustom",IS_SPREAD:k}),w=Object.freeze({__proto__:null,TAG:1,ATTR:2,TEXT:3,CDATA:4,COMMENT:8,DOCUMENT:9,DOCTYPE:10,DOCUMENT_FRAGMENT:11});const _=/^(?:\/[a-zA-Z]|[a-zA-Z][^\s>/]?)/,A=/(\/?[^\s>/]+)\s*(>)?/g,C=/(\S[^>/=\s]*)(?:\s*=\s*([^>/])?)?/g,I=/\.\.\./,N={script:/<\/script\s*>/gi,style:/<\/style\s*>/gi,textarea:/<\/textarea\s*>/gi},O=/^\/?(?:pre|textarea)$/;function D(e,t,n){return e.lastIndex=t,e.exec(n)}var j=e=>e.replace(/(?=[-[\](){^*+?.$|\\])/g,"\\");function L(e,t,n){const r=/[`$\\]/g;let i;for(;r.lastIndex=t,r.exec(e);){if(i=e[(t=r.lastIndex)-1],"`"===i)return t;if("$"===i&&"{"===e[t++])return n.push("`","}"),t}throw function(e,t,n){n||(n=e.length);const r=(e.slice(0,n).match(/\r\n?|\n/g)||"").length+1;let i=0;for(;--n>=0&&!/[\r\n]/.test(e[n]);)++i;return`[${r},${i}]: Unclosed ES6 template literal.`}(e,0,t)}const M="[{(,;:?=|&!^~>%*/",B=M+"+-",F=["case","default","do","else","in","instanceof","prefix","return","typeof","void","yield"],V=F.reduce(((e,t)=>e+t.slice(-1)),""),R=/^\/(?=[^*>/])[^[/\\]*(?:(?:\\.|\[(?:\\.|[^\]\\]*)*\])[^[\\/]*)*?\/[gimuy]*/,q=/[$\w]/,U=/.*/g;function z(e,t){for(;--t>=0&&/\s/.test(e[t]););return t}const W=/'[^'\n\r\\]*(?:\\(?:\r\n?|[\S\s])[^'\n\r\\]*)*'/.source,J=`${W}|${W.replace(/'/g,'"')}`,H={};function $(e,t,n,r){let i=0;switch(t){case"[":case"(":case"{":e.push("["===t?"]":"("===t?")":"}");break;case")":case"]":case"}":e.pop(),"}"===t&&"`"===e[e.length-1]&&(t=e.pop()),i=n+1;break;case"/":i=function(e,t){let n=U.lastIndex=t++;const r=(U.exec(e)||" ")[0].match(R);if(r){const i=n+r[0].length;n=z(e,n);let a=e[n];if(n<0||M.includes(a))return i;if("."===a)"."===e[n-1]&&(t=i);else{if(("+"===a||"-"===a)&&(e[--n]!==a||(n=z(e,n))<0||B.includes(a=e[n])))return i;if(V.includes(a)){const r=n+1;for(;--n>=0&&q.test(e[n]););F.includes(e.slice(n+1,r))&&(t=i)}}}return t}(r,n)}return{char:t,index:i}}function G(e,t,n){const[r,i]=n,a=t+r.length,s=[],o=function(e){let t=H[e];if(!t){let n=j(e);e.length>1?n+="|[":n=/[{}[\]()]/.test(e)?"[":"["+n,H[e]=t=RegExp(`${J}|${n}\`/\\{}[\\]()]`,"g")}return t}(i);let l,c;for(o.lastIndex=a;c=o.exec(e);){const n=c.index,r=c[0];if(l=o.lastIndex,r===i&&!s.length)return{text:e.slice(a,n),start:t,end:l};const{char:u,index:p}=$(s,r[0],n,e);l=p||l,o.lastIndex="`"===u?L(e,l,s):l}}function X(e){const t=e.last;e.last=null,t&&e.root&&e.builder.push(t)}function K(e,t,n){return e.slice(t,n)}function Q(e,t,n,r){void 0===r&&(r={});const i=K(e.data,t,n),a=r.expressions,s=r.unescape;let o=e.last;return e.pos=n,o&&3===o.type?(o.text+=i,o.end=n):(X(e),e.last=o={type:3,text:i,start:t,end:n}),a&&a.length&&(o.expressions=(o.expressions||[]).concat(a)),s&&(o.unescape=s),3}function Y(e,t,n,r){const i=function(e,t){const{brackets:n}=e.options,r=e.regexCache[t];if(r)return r;const i=j(n[0]);return Object.assign(e.regexCache,{[t]:RegExp(`(${t})|${i}`,"g")}),e.regexCache[t]}(e,n);i.lastIndex=r;const
|