-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.min.js
1 lines (1 loc) · 1.96 KB
/
index.min.js
1
const t="",e="";function o(o){let a,s,c,n,d=this,h=0,f=[null],g=0,u=[],m=0,b=0,y=!1;const $=(t,o=[],r)=>{let l=0;return(t=r||t!==e?t.replace(/\ue001/g,t=>u[m++]):u[m++].slice(1,-1))?(t.replace(/\ue000/g,(e,r)=>(r&&o.push(t.slice(l,r)),l=r+1,o.push(arguments[++g]))),l<t.length&&o.push(t.slice(l)),o.length>1?o:o[0]):t},k=()=>{[f,n,...a]=f,f.push(d(n,...a)),y===b--&&(y=!1)};return o.join(t).replace(/<!--[^]*?-->/g,"").replace(/<!\[CDATA\[[^]*\]\]>/g,"").replace(/('|")[^\1]*?\1/g,t=>(u.push(t),e)).replace(/(?:^|>)((?:[^<]|<[^\w\ue000\/?!>])*)(?:$|<)/g,(t,e,o,a)=>{let d,u;if(o&&a.slice(h,o).replace(/(\S)\/$/,"$1 /").split(/\s+/).map((t,e)=>{if("/"===t[0]){if(t=t.slice(1),l[t])return;u=d||t||1}else if(e){if(t){let e=f[2]||(f[2]={});"..."===t.slice(0,3)?Object.assign(e,arguments[++g]):([s,c]=t.split("="),Array.isArray(c=e[$(s)]=!c||$(c))&&(c.toString=c.join.bind(c,"")))}}else{if(d=$(t),"string"==typeof d)for(d=d.toLowerCase();p[f[1]+d];)k();f=[f,d,null],b++,!y&&i[d]&&(y=b),l[d]&&(u=d)}}),u)for(f[0]||r(`Wrong close tag \`${u}\``),k();n!==u&&p[n];)k();h=o+t.length,y||(e=e.replace(/\s*\n\s*/g,"").replace(/\s+/g," ")),e&&$((n=0,e),f,!0)}),f[0]&&p[f[1]]&&k(),b&&r(`Unclosed \`${f[1]}\`.`),f.length<3?f[1]:(f.shift(),f)}const r=t=>{throw SyntaxError(t)},l=o.empty={},p=o.close={},i=o.pre={};"area base br col command embed hr img input keygen link meta param source track wbr ! !doctype ? ?xml".split(" ").map(t=>o.empty[t]=!0);let a={li:"",dt:"dd",dd:"dt",p:"address article aside blockquote details div dl fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 header hgroup hr main menu nav ol pre section table",rt:"rp",rp:"rt",optgroup:"",option:"optgroup",caption:"tbody thead tfoot tr colgroup",colgroup:"thead tbody tfoot tr caption",thead:"tbody tfoot caption",tbody:"tfoot caption",tfoot:"caption",tr:"tbody tfoot",td:"th tr",th:"td tr tbody"};for(let t in a)for(let e of[...a[t].split(" "),t])o.close[t]=o.close[t+e]=!0;"pre textarea".split(" ").map(t=>o.pre[t]=!0);export{o as default};