8 lines
134 KiB
JavaScript
8 lines
134 KiB
JavaScript
|
function Re(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r<s.length;r++)n[s[r]]=!0;return t?r=>!!n[r.toLowerCase()]:r=>!!n[r]}const Tf="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt",Sf=Re(Tf);function Hn(e){if(j(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=z(s)?Qo(s):Hn(s);if(r)for(const i in r)t[i]=r[i]}return t}else{if(z(e))return e;if(ie(e))return e}}const wf=/;(?![^(]*\))/g,Nf=/:([^]+)/,Pf=/\/\*.*?\*\//gs;function Qo(e){const t={};return e.replace(Pf,"").split(wf).forEach(n=>{if(n){const s=n.split(Nf);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function Vn(e){let t="";if(z(e))t=e;else if(j(e))for(let n=0;n<e.length;n++){const s=Vn(e[n]);s&&(t+=s+" ")}else if(ie(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function Of(e){if(!e)return null;let{class:t,style:n}=e;return t&&!z(t)&&(e.class=Vn(t)),n&&(e.style=Hn(n)),e}const Rf="html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot",Af="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",If="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",Mf=Re(Rf),kf=Re(Af),Ff=Re(If),Lf="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Bf=Re(Lf);function Go(e){return!!e||e===""}function Df(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=ht(e[s],t[s]);return n}function ht(e,t){if(e===t)return!0;let n=Yi(e),s=Yi(t);if(n||s)return n&&s?e.getTime()===t.getTime():!1;if(n=gt(e),s=gt(t),n||s)return e===t;if(n=j(e),s=j(t),n||s)return n&&s?Df(e,t):!1;if(n=ie(e),s=ie(t),n||s){if(!n||!s)return!1;const r=Object.keys(e).length,i=Object.keys(t).length;if(r!==i)return!1;for(const o in e){const l=e.hasOwnProperty(o),c=t.hasOwnProperty(o);if(l&&!c||!l&&c||!ht(e[o],t[o]))return!1}}return String(e)===String(t)}function Bs(e,t){return e.findIndex(n=>ht(n,t))}const $f=e=>z(e)?e:e==null?"":j(e)||ie(e)&&(e.toString===tl||!W(e.toString))?JSON.stringify(e,el,2):String(e),el=(e,t)=>t&&t.__v_isRef?el(e,t.value):Zt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:jt(t)?{[`Set(${t.size})`]:[...t.values()]}:ie(t)&&!j(t)&&!nl(t)?String(t):t,se={},Yt=[],Fe=()=>{},us=()=>!1,Hf=/^on[^a-z]/,Vt=e=>Hf.test(e),Wr=e=>e.startsWith("onUpdate:"),te=Object.assign,qr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Vf=Object.prototype.hasOwnProperty,Q=(e,t)=>Vf.call(e,t),j=Array.isArray,Zt=e=>an(e)==="[object Map]",jt=e=>an(e)==="[object Set]",Yi=e=>an(e)==="[object Date]",jf=e=>an(e)==="[object RegExp]",W=e=>typeof e=="function",z=e=>typeof e=="string",gt=e=>typeof e=="symbol",ie=e=>e!==null&&typeof e=="object",zr=e=>ie(e)&&W(e.then)&&W(e.catch),tl=Object.prototype.toString,an=e=>tl.call(e),Uf=e=>an(e).slice(8,-1),nl=e=>an(e)==="[object Object]",Jr=e=>z(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Rt=Re(",key,
|
||
|
`);else if(/[^\t\r\n\f ]/.test(f.content))l&&(f.content=f.content.replace(/[\t\r\n\f ]+/g," "));else{const u=i[c-1],a=i[c+1];!u||!a||l&&(u.type===3&&a.type===3||u.type===3&&a.type===1||u.type===1&&a.type===3||u.type===1&&a.type===1&&/[\r\n]/.test(f.content))?(o=!0,i[c]=null):f.content=" "}else f.type===3&&!e.options.comments&&(o=!0,i[c]=null)}if(e.inPre&&s&&e.options.isPreTag(s.tag)){const c=i[0];c&&c.type===2&&(c.content=c.content.replace(/^\r?\n/,""))}}return o?i.filter(Boolean):i}function Bo(e,t){if(t.type===2){const n=rr(e);if(n&&n.type===2&&n.loc.end.offset===t.loc.start.offset){n.content+=t.content,n.loc.end=t.loc.end,n.loc.source+=t.loc.source;return}}e.push(t)}function _d(e,t){he(e,9);const n=Ui(e,3,t);return e.source.length===0?ne(e,6):he(e,3),n}function Ed(e){const t=Be(e);let n;const s=/--(\!)?>/.exec(e.source);if(!s)n=e.source.slice(4),he(e,e.source.length),ne(e,7);else{s.index<=3&&ne(e,0),s[1]&&ne(e,10),n=e.source.slice(4,s.index);const r=e.source.slice(0,s.index);let i=1,o=0;for(;(o=r.indexOf("<!--",i))!==-1;)he(e,o-i+1),o+4<r.length&&ne(e,16),i=o+1;he(e,s.index+s[0].length-i+1)}return{type:3,content:n,loc:Ue(e,t)}}function mn(e){const t=Be(e),n=e.source[1]==="?"?1:2;let s;const r=e.source.indexOf(">");return r===-1?(s=e.source.slice(n),he(e,e.source.length)):(s=e.source.slice(n,r),he(e,r+1)),{type:3,content:s,loc:Ue(e,t)}}function Cd(e,t){const n=e.inPre,s=e.inVPre,r=rr(t),i=Vr(e,0,r),o=e.inPre&&!n,l=e.inVPre&&!s;if(i.isSelfClosing||e.options.isVoidTag(i.tag))return o&&(e.inPre=!1),l&&(e.inVPre=!1),i;t.push(i);const c=e.options.getTextMode(i,r),f=Ui(e,c,t);t.pop();{const u=i.props.find(a=>a.type===6&&a.name==="inline-template");if(u&&Dn("COMPILER_INLINE_TEMPLATE",e,u.loc)){const a=Ue(e,i.loc.end);u.value={type:2,content:a.source,loc:a}}}if(i.children=f,jr(e.source,i.tag))Vr(e,1,r);else if(ne(e,24,0,i.loc.start),e.source.length===0&&i.tag.toLowerCase()==="script"){const u=f[0];u&&Ce(u.loc.source,"<!--")&&ne(e,8)}return i.loc=Ue(e,i.loc.start),o&&(e.inPre=!1),l&&(e.inVPre=!1),i}const Jc=Re("if,else,else-if,for,slot");function Vr(e,t,n){const s=Be(e),r=/^<\/?([a-z][^\t\r\n\f />]*)/i.exec(e.source),i=r[1],o=e.options.getNamespace(i,n);he(e,r[0].length),$n(e);const l=Be(e),c=e.source;e.options.isPreTag(i)&&(e.inPre=!0);let f=Do(e,t);t===0&&!e.inVPre&&f.some(d=>d.type===7&&d.name==="pre")&&(e.inVPre=!0,te(e,l),e.source=c,f=Do(e,t).filter(d=>d.name!=="v-pre"));let u=!1;if(e.source.length===0?ne(e,9):(u=Ce(e.source,"/>"),t===1&&u&&ne(e,4),he(e,u?2:1)),t===1)return;let a=0;return e.inVPre||(i==="slot"?a=2:i==="template"?f.some(d=>d.type===7&&Jc(d.name))&&(a=3):vd(i,f,e)&&(a=1)),{type:1,ns:o,tag:i,tagType:a,props:f,isSelfClosing:u,children:[],loc:Ue(e,s),codegenNode:void 0}}function vd(e,t,n){const s=n.options;if(s.isCustomElement(e))return!1;if(e==="component"||/^[A-Z]/.test(e)||xc(e)||s.isBuiltInComponent&&s.isBuiltInComponent(e)||s.isNativeTag&&!s.isNativeTag(e))return!0;for(let r=0;r<t.length;r++){const i=t[r];if(i.type===6){if(i.name==="is"&&i.value){if(i.value.content.startsWith("vue:"))return!0;if(Dn("COMPILER_IS_ON_ELEMENT",n,i.loc))return!0}}else{if(i.name==="is")return!0;if(i.name==="bind"&&Ot(i.arg,"is")&&!0&&Dn("COMPILER_IS_ON_ELEMENT",n,i.loc))return!0}}}function Do(e,t){const n=[],s=new Set;for(;e.source.length>0&&!Ce(e.source,">")&&!Ce(e.source,"/>");){if(Ce(e.source,"/")){ne(e,22),he(e,1),$n(e);continue}t===1&&ne(e,3);const r=Td(e,s);r.type===6&&r.value&&r.name==="class"&&(r.value.content=r.value.content.replace(/\s+/g," ").trim()),t===0&&n.push(r),/^[^\t\r\n\f />]/.test(e.source)&&ne(e,15),$n(e)}return n}function Td(e,t){const n=Be(e),r=/^[^\t\r\n\f />][^\t\r\n\f />=]*/.exec(e.source)[0];t.has(r)&&ne(e,2),t.add(r),r[0]==="="&&ne(e,19);{const l=/["'<]/g;let c;for(;c=l.exec(r);)ne(e,17,c.index)}he(e,r.length);let i;/^[\t\r\n\f ]*=/.test(e.source)&&($n(e),he(e,1),$n(e),i=Sd(e),i||ne(e,13));const o=Ue(e,n);if(!e.inVPre&&/^(v-[A-Za-z0-9-]|:|\.|@|#)/.test(r)){const l=/(?:^v-([a-z0-9-]+))?(?:(?::|^\.|^@|^#)(\[[^\]]+\]|[^\.]+))?(.+)?$/i.exec(r);let c=Ce(r,"."),f=l[1]||(c||Ce(r,":")?"bind":Ce(r,"@")?"on":"s
|
||
|
`+" ".repeat(v))}return m}function Fd(e,t={}){const n=Ho(e,t);t.onContextCreated&&t.onContextCreated(n);const{mode:s,push:r,prefixIdentifiers:i,indent:o,deindent:l,newline:c,scopeId:f,ssr:u}=n,a=Array.from(e.helpers),d=a.length>0,m=!i&&s!=="module",E=!1,v=E?Ho(e,t):n;Ld(e,v);const A=u?"ssrRender":"render",h=(u?["_ctx","_push","_parent","_attrs"]:["_ctx","_cache"]).join(", ");if(r(`function ${A}(${h}) {`),o(),m&&(r("with (_ctx) {"),o(),d&&(r(`const { ${a.map(tf).join(", ")} } = _Vue`),r(`
|
||
|
`),c())),e.components.length&&(br(e.components,"component",n),(e.directives.length||e.temps>0)&&c()),e.directives.length&&(br(e.directives,"directive",n),e.temps>0&&c()),e.filters&&e.filters.length&&(c(),br(e.filters,"filter",n),c()),e.temps>0){r("let ");for(let b=0;b<e.temps;b++)r(`${b>0?", ":""}_temp${b}`)}return(e.components.length||e.directives.length||e.temps)&&(r(`
|
||
|
`),c()),u||r("return "),e.codegenNode?Te(e.codegenNode,n):r("null"),m&&(l(),r("}")),l(),r("}"),{ast:e,code:n.code,preamble:E?v.code:"",map:n.map?n.map.toJSON():void 0}}function Ld(e,t){const{ssr:n,prefixIdentifiers:s,push:r,newline:i,runtimeModuleName:o,runtimeGlobalName:l,ssrRuntimeModuleName:c}=t,f=l,u=Array.from(e.helpers);if(u.length>0&&(r(`const _Vue = ${f}
|
||
|
`),e.hoists.length)){const a=[Pi,Oi,Wn,Ri,Vc].filter(d=>u.includes(d)).map(tf).join(", ");r(`const { ${a} } = _Vue
|
||
|
`)}Bd(e.hoists,t),i(),r("return ")}function br(e,t,{helper:n,push:s,newline:r,isTS:i}){const o=n(t==="filter"?Mi:t==="component"?Ai:Ii);for(let l=0;l<e.length;l++){let c=e[l];const f=c.endsWith("__self");f&&(c=c.slice(0,-6)),s(`const ${Bn(c,t)} = ${o}(${JSON.stringify(c)}${f?", true":""})${i?"!":""}`),l<e.length-1&&r()}}function Bd(e,t){if(!e.length)return;t.pure=!0;const{push:n,newline:s,helper:r,scopeId:i,mode:o}=t;s();for(let l=0;l<e.length;l++){const c=e[l];c&&(n(`const _hoisted_${l+1} = `),Te(c,t),s())}t.pure=!1}function Ki(e,t){const n=e.length>3||!1;t.push("["),n&&t.indent(),Jn(e,t,n),n&&t.deindent(),t.push("]")}function Jn(e,t,n=!1,s=!0){const{push:r,newline:i}=t;for(let o=0;o<e.length;o++){const l=e[o];z(l)?r(l):j(l)?Ki(l,t):Te(l,t),o<e.length-1&&(n?(s&&r(","),i()):s&&r(", "))}}function Te(e,t){if(z(e)){t.push(e);return}if(gt(e)){t.push(t.helper(e));return}switch(e.type){case 1:case 9:case 11:Te(e.codegenNode,t);break;case 2:Dd(e,t);break;case 4:nf(e,t);break;case 5:$d(e,t);break;case 12:Te(e.codegenNode,t);break;case 8:sf(e,t);break;case 3:Vd(e,t);break;case 13:jd(e,t);break;case 14:Kd(e,t);break;case 15:xd(e,t);break;case 17:Wd(e,t);break;case 18:qd(e,t);break;case 19:zd(e,t);break;case 20:Jd(e,t);break;case 21:Jn(e.body,t,!0,!1);break}}function Dd(e,t){t.push(JSON.stringify(e.content),e)}function nf(e,t){const{content:n,isStatic:s}=e;t.push(s?JSON.stringify(n):n,e)}function $d(e,t){const{push:n,helper:s,pure:r}=t;r&&n(or),n(`${s(nr)}(`),Te(e.content,t),n(")")}function sf(e,t){for(let n=0;n<e.children.length;n++){const s=e.children[n];z(s)?t.push(s):Te(s,t)}}function Hd(e,t){const{push:n}=t;if(e.type===8)n("["),sf(e,t),n("]");else if(e.isStatic){const s=Vi(e.content)?e.content:JSON.stringify(e.content);n(s,e)}else n(`[${e.content}]`,e)}function Vd(e,t){const{push:n,helper:s,pure:r}=t;r&&n(or),n(`${s(Wn)}(${JSON.stringify(e.content)})`,e)}function jd(e,t){const{push:n,helper:s,pure:r}=t,{tag:i,props:o,children:l,patchFlag:c,dynamicProps:f,directives:u,isBlock:a,disableTracking:d,isComponent:m}=e;u&&n(s(ki)+"("),a&&n(`(${s(Ht)}(${d?"true":""}), `),r&&n(or);const E=a?fn(t.inSSR,m):cn(t.inSSR,m);n(s(E)+"(",e),Jn(Ud([i,o,l,c,f]),t),n(")"),a&&n(")"),u&&(n(", "),Te(u,t),n(")"))}function Ud(e){let t=e.length;for(;t--&&e[t]==null;);return e.slice(0,t+1).map(n=>n||"null")}function Kd(e,t){const{push:n,helper:s,pure:r}=t,i=z(e.callee)?e.callee:s(e.callee);r&&n(or),n(i+"(",e),Jn(e.arguments,t),n(")")}function xd(e,t){const{push:n,indent:s,deindent:r,newline:i}=t,{properties:o}=e;if(!o.length){n("{}",e);return}const l=o.length>1||!1;n(l?"{":"{ "),l&&s();for(let c=0;c<o.length;c++){const{key:f,value:u}=o[c];Hd(f,t),n(": "),Te(u,t),c<o.length-1&&(n(","),i())}l&&r(),n(l?"}":" }")}function Wd(e,t){Ki(e.elements,t)}function qd(e,t){const{push:n,indent:s,deindent:r}=t,{params:i,returns:o,body:l,newline:c,isSlot:f}=e;f&&n(`_${on[$i]}(`),n("(",e),j(i)?Jn(i,t):i&&Te(i,t),n(") => "),(c||l)&&(n("{"),s()),o?(c&&n("return "),j(o)?Ki(o,t):Te(o,t)):l&&Te(l,t),(c||l)&&(r(),n("}")),f&&(e.isNonScopedSlot&&n(", undefined, true"),n(")"))}function zd(e,t){const{test:n,consequent:s,alternate:r,newline:i}=e,{push:o,indent:l,deindent:c,newline:f}=t;if(n.type===4){const a=!Vi(n.content);a&&o("("),nf(n,t),a&&o(")")}else o("("),Te(n,t),o(")");i&&l(),t.indentLevel++,i||o(" "),o("? "),Te(s,t),t.indentLevel--,i&&f(),i||o(" "),o(": ");const u=r.type===19;u||t.indentLevel++,Te(r,t),u||t.indentLevel--,i&&c(!0)}function Jd(e,t){const{push:n,helper:s,indent:r,deindent:i,newline:o}=t;n(`_cache[${e.index}] || (`),e.isVNode&&(r(),n(`${s(Rs)}(-1),`),o()),n(`_cache[${e.index}] = `),Te(e.value,t),e.isVNode&&(n(","),o(),n(`${s(Rs)}(1),`),o(),n(`_cache[${e.index}]`),i()),n(")")}new RegExp("\\b"+"arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b")+"\\b");const Yd=ef(/^(if|else|else-if)$/,(e,t,n)=>Zd(e,t,n,(s,r,i)=>{const o=n.parent.children;let l=o.indexOf(s),c=0;for(;l-->=0;){const f=o[l];f&&f.t
|