no message

This commit is contained in:
A1300399510 2024-05-15 12:08:59 +08:00
parent a2b20f1738
commit 3b0cff8ca4
900 changed files with 98716 additions and 138 deletions

View File

@ -1,5 +1,5 @@
{
"date": "2024-05-15T04:05:20.065Z",
"date": "2024-05-15T04:08:39.109Z",
"preset": "node-server",
"framework": {
"name": "nuxt",

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{aI as u,r as c,a0 as f,S as v,e as d,ay as l,aJ as i,aK as h,a6 as p}from"./entry.r79gNFmw.js";function I(a,t={}){const e=t.head||u();if(e)return e.ssr?e.push(a,t):m(e,a,t)}function m(a,t,e={}){const s=c(!1),n=c({});f(()=>{n.value=s.value?{}:h(t)});const r=a.push(n.value,e);return v(n,o=>{r.patch(o)}),p()&&(d(()=>{r.dispose()}),l(()=>{s.value=!0}),i(()=>{s.value=!1})),r}const y=(a,t)=>{const e=a.__vccOpts||a;for(const[s,n]of t)e[s]=n;return e};export{y as _,I as u};
import{aI as u,r as c,a0 as f,S as v,e as d,ay as l,aJ as i,aK as h,a6 as p}from"./entry.pFNfq0UB.js";function I(a,t={}){const e=t.head||u();if(e)return e.ssr?e.push(a,t):m(e,a,t)}function m(a,t,e={}){const s=c(!1),n=c({});f(()=>{n.value=s.value?{}:h(t)});const r=a.push(n.value,e);return v(n,o=>{r.patch(o)}),p()&&(d(()=>{r.dispose()}),l(()=>{s.value=!0}),i(()=>{s.value=!1})),r}const y=(a,t)=>{const e=a.__vccOpts||a;for(const[s,n]of t)e[s]=n;return e};export{y as _,I as u};

View File

@ -1 +1 @@
{"id":"bcd0ae82-0890-486f-9488-c29e0983ae57","timestamp":1715745894829}
{"id":"30ca3b98-cf46-4da1-864a-8ff3a6d0ca32","timestamp":1715746097125}

View File

@ -0,0 +1 @@
{"id":"30ca3b98-cf46-4da1-864a-8ff3a6d0ca32","timestamp":1715746097125,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

View File

@ -1 +0,0 @@
{"id":"bcd0ae82-0890-486f-9488-c29e0983ae57","timestamp":1715745894829,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{_ as i,u as a}from"./_plugin-vue_export-helper.lmLA3jcC.js";import{t as r,v as n,x as e,y as s,C as l,D as d}from"./entry.r79gNFmw.js";const c=t=>(l("data-v-df79c84d"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},f=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),h={class:"max-w-520px text-center"},m=["textContent"],g=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(b,u)=>(r(),n("div",p,[f,e("div",h,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,m),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,g)])]))}},_=i(x,[["__scopeId","data-v-df79c84d"]]);export{_ as default};
import{_ as i,u as a}from"./_plugin-vue_export-helper.P-CtXeSh.js";import{t as r,v as n,x as e,y as s,C as l,D as d}from"./entry.pFNfq0UB.js";const c=t=>(l("data-v-df79c84d"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},f=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),h={class:"max-w-520px text-center"},m=["textContent"],g=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(b,u)=>(r(),n("div",p,[f,e("div",h,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,m),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,g)])]))}},_=i(x,[["__scopeId","data-v-df79c84d"]]);export{_ as default};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
import{u as e}from"./entry.r79gNFmw.js";const s={__name:"index",setup(r){return e().replace("/index.html"),(u,n)=>null}};export{s as default};
import{u as e}from"./entry.pFNfq0UB.js";const s={__name:"index",setup(r){return e().replace("/index.html"),(u,n)=>null}};export{s as default};

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
import{aj as j,ak as w}from"./cross-icon.UWVgdOJ8.js";function V(x,v){for(var d=0;d<v.length;d++){const g=v[d];if(typeof g!="string"&&!Array.isArray(g)){for(const f in g)if(f!=="default"&&!(f in x)){const h=Object.getOwnPropertyDescriptor(g,f);h&&Object.defineProperty(x,f,h.get?h:{enumerable:!0,get:()=>g[f]})}}}return Object.freeze(Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}))}var N={exports:{}},W={exports:{}},L={exports:{}},A;function U(){return A||(A=1,function(x){(function(v,d){x.exports?x.exports=d():v.EvEmitter=d()})(typeof window<"u"?window:j,function(){function v(){}var d=v.prototype;return d.on=function(g,f){if(!(!g||!f)){var h=this._events=this._events||{},a=h[g]=h[g]||[];return a.indexOf(f)==-1&&a.push(f),this}},d.once=function(g,f){if(!(!g||!f)){this.on(g,f);var h=this._onceEvents=this._onceEvents||{},a=h[g]=h[g]||{};return a[f]=!0,this}},d.off=function(g,f){var h=this._events&&this._events[g];if(!(!h||!h.length)){var a=h.indexOf(f);return a!=-1&&h.splice(a,1),this}},d.emitEvent=function(g,f){var h=this._events&&this._events[g];if(!(!h||!h.length)){h=h.slice(0),f=f||[];for(var a=this._onceEvents&&this._onceEvents[g],o=0;o<h.length;o++){var s=h[o],l=a&&a[s];l&&(this.off(g,s),delete a[s]),s.apply(this,f)}return this}},d.allOff=function(){delete this._events,delete this._onceEvents},v})}(L)),L.exports}var C={exports:{}};/*!
import{aj as j,ak as w}from"./cross-icon.L5DBuTu4.js";function V(x,v){for(var d=0;d<v.length;d++){const g=v[d];if(typeof g!="string"&&!Array.isArray(g)){for(const f in g)if(f!=="default"&&!(f in x)){const h=Object.getOwnPropertyDescriptor(g,f);h&&Object.defineProperty(x,f,h.get?h:{enumerable:!0,get:()=>g[f]})}}}return Object.freeze(Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}))}var N={exports:{}},W={exports:{}},L={exports:{}},A;function U(){return A||(A=1,function(x){(function(v,d){x.exports?x.exports=d():v.EvEmitter=d()})(typeof window<"u"?window:j,function(){function v(){}var d=v.prototype;return d.on=function(g,f){if(!(!g||!f)){var h=this._events=this._events||{},a=h[g]=h[g]||[];return a.indexOf(f)==-1&&a.push(f),this}},d.once=function(g,f){if(!(!g||!f)){this.on(g,f);var h=this._onceEvents=this._onceEvents||{},a=h[g]=h[g]||{};return a[f]=!0,this}},d.off=function(g,f){var h=this._events&&this._events[g];if(!(!h||!h.length)){var a=h.indexOf(f);return a!=-1&&h.splice(a,1),this}},d.emitEvent=function(g,f){var h=this._events&&this._events[g];if(!(!h||!h.length)){h=h.slice(0),f=f||[];for(var a=this._onceEvents&&this._onceEvents[g],o=0;o<h.length;o++){var s=h[o],l=a&&a[s];l&&(this.off(g,s),delete a[s]),s.apply(this,f)}return this}},d.allOff=function(){delete this._events,delete this._onceEvents},v})}(L)),L.exports}var C={exports:{}};/*!
* getSize v2.0.3
* measure size of elements
* MIT license

View File

@ -1,10 +1,10 @@
const client_manifest = {
"__plugin-vue_export-helper.lmLA3jcC.js": {
"__plugin-vue_export-helper.P-CtXeSh.js": {
"resourceType": "script",
"module": true,
"prefetch": true,
"preload": true,
"file": "_plugin-vue_export-helper.lmLA3jcC.js",
"file": "_plugin-vue_export-helper.P-CtXeSh.js",
"imports": [
"node_modules/nuxt/dist/app/entry.js"
]
@ -16,7 +16,7 @@ const client_manifest = {
"file": "cross-icon.5Lsg-_qO.css",
"src": "_cross-icon.!~{009}~.js"
},
"_cross-icon.UWVgdOJ8.js": {
"_cross-icon.L5DBuTu4.js": {
"resourceType": "script",
"module": true,
"prefetch": true,
@ -24,10 +24,10 @@ const client_manifest = {
"css": [
"cross-icon.5Lsg-_qO.css"
],
"file": "cross-icon.UWVgdOJ8.js",
"file": "cross-icon.L5DBuTu4.js",
"imports": [
"node_modules/nuxt/dist/app/entry.js",
"__plugin-vue_export-helper.lmLA3jcC.js"
"__plugin-vue_export-helper.P-CtXeSh.js"
]
},
"cross-icon.5Lsg-_qO.css": {
@ -43,7 +43,7 @@ const client_manifest = {
"file": "el-popper.nJ_mFSbn.css",
"src": "_el-popper.!~{00b}~.js"
},
"_el-popper.Bs6EhWze.js": {
"_el-popper.I6dKLGMP.js": {
"resourceType": "script",
"module": true,
"prefetch": true,
@ -51,10 +51,10 @@ const client_manifest = {
"css": [
"el-popper.nJ_mFSbn.css"
],
"file": "el-popper.Bs6EhWze.js",
"file": "el-popper.I6dKLGMP.js",
"imports": [
"node_modules/nuxt/dist/app/entry.js",
"_cross-icon.UWVgdOJ8.js"
"_cross-icon.L5DBuTu4.js"
]
},
"el-popper.nJ_mFSbn.css": {
@ -63,14 +63,14 @@ const client_manifest = {
"prefetch": true,
"preload": true
},
"_masonry.UTL2hJ8m.js": {
"_masonry.k1yKHgzP.js": {
"resourceType": "script",
"module": true,
"prefetch": true,
"preload": true,
"file": "masonry.UTL2hJ8m.js",
"file": "masonry.k1yKHgzP.js",
"imports": [
"_cross-icon.UWVgdOJ8.js"
"_cross-icon.L5DBuTu4.js"
],
"isDynamicEntry": true
},
@ -81,7 +81,7 @@ const client_manifest = {
"file": "tick-black.p71NrTKG.css",
"src": "_tick-black.!~{00a}~.js"
},
"_tick-black.gcOKuYFv.js": {
"_tick-black.PHhQsb83.js": {
"resourceType": "script",
"module": true,
"prefetch": true,
@ -94,11 +94,11 @@ const client_manifest = {
"css": [
"tick-black.p71NrTKG.css"
],
"file": "tick-black.gcOKuYFv.js",
"file": "tick-black.PHhQsb83.js",
"imports": [
"_cross-icon.UWVgdOJ8.js",
"_cross-icon.L5DBuTu4.js",
"node_modules/nuxt/dist/app/entry.js",
"__plugin-vue_export-helper.lmLA3jcC.js"
"__plugin-vue_export-helper.P-CtXeSh.js"
]
},
"tick-black.p71NrTKG.css": {
@ -173,10 +173,10 @@ const client_manifest = {
"prefetch": true,
"preload": true,
"css": [],
"file": "error-404.jVQrFtrI.js",
"file": "error-404.Nn2vJFUt.js",
"imports": [
"node_modules/nuxt/dist/app/entry.js",
"__plugin-vue_export-helper.lmLA3jcC.js"
"__plugin-vue_export-helper.P-CtXeSh.js"
],
"isDynamicEntry": true,
"src": "node_modules/@nuxt/ui-templates/dist/templates/error-404.vue"
@ -193,9 +193,9 @@ const client_manifest = {
"prefetch": true,
"preload": true,
"css": [],
"file": "error-500.lF1s0fQO.js",
"file": "error-500.Y_DtRcr_.js",
"imports": [
"__plugin-vue_export-helper.lmLA3jcC.js",
"__plugin-vue_export-helper.P-CtXeSh.js",
"node_modules/nuxt/dist/app/entry.js"
],
"isDynamicEntry": true,
@ -219,7 +219,7 @@ const client_manifest = {
"node_modules/@nuxt/ui-templates/dist/templates/error-404.vue",
"node_modules/@nuxt/ui-templates/dist/templates/error-500.vue"
],
"file": "entry.r79gNFmw.js",
"file": "entry.pFNfq0UB.js",
"isEntry": true,
"src": "node_modules/nuxt/dist/app/entry.js",
"_globalCSS": true
@ -239,13 +239,13 @@ const client_manifest = {
"title.Acc43PUE.png"
],
"css": [],
"file": "_id_.vV_UX9s9.js",
"file": "_id_.-h824Jby.js",
"imports": [
"_cross-icon.UWVgdOJ8.js",
"_tick-black.gcOKuYFv.js",
"_el-popper.Bs6EhWze.js",
"_cross-icon.L5DBuTu4.js",
"_tick-black.PHhQsb83.js",
"_el-popper.I6dKLGMP.js",
"node_modules/nuxt/dist/app/entry.js",
"__plugin-vue_export-helper.lmLA3jcC.js"
"__plugin-vue_export-helper.P-CtXeSh.js"
],
"isDynamicEntry": true,
"src": "pages/details/[id].vue"
@ -269,14 +269,14 @@ const client_manifest = {
"preload": true,
"css": [],
"dynamicImports": [
"_masonry.UTL2hJ8m.js"
"_masonry.k1yKHgzP.js"
],
"file": "index.OLIYUoV1.js",
"file": "index.xyOOb3D9.js",
"imports": [
"node_modules/nuxt/dist/app/entry.js",
"_cross-icon.UWVgdOJ8.js",
"_tick-black.gcOKuYFv.js",
"__plugin-vue_export-helper.lmLA3jcC.js"
"_cross-icon.L5DBuTu4.js",
"_tick-black.PHhQsb83.js",
"__plugin-vue_export-helper.P-CtXeSh.js"
],
"isDynamicEntry": true,
"src": "pages/index.html/index.vue"
@ -292,7 +292,7 @@ const client_manifest = {
"module": true,
"prefetch": true,
"preload": true,
"file": "index.md7TFpUS.js",
"file": "index.hha2MzTQ.js",
"imports": [
"node_modules/nuxt/dist/app/entry.js"
],
@ -309,12 +309,12 @@ const client_manifest = {
"rubbish-icon.KM8oLqUI.svg"
],
"css": [],
"file": "index.NdLfXcS-.js",
"file": "index.ACq2ujgq.js",
"imports": [
"_cross-icon.UWVgdOJ8.js",
"_el-popper.Bs6EhWze.js",
"_cross-icon.L5DBuTu4.js",
"_el-popper.I6dKLGMP.js",
"node_modules/nuxt/dist/app/entry.js",
"__plugin-vue_export-helper.lmLA3jcC.js"
"__plugin-vue_export-helper.P-CtXeSh.js"
],
"isDynamicEntry": true,
"src": "pages/publish/index.vue"

View File

@ -1,9 +1,9 @@
const interopDefault = r => r.default || r || [];
const styles = {
"node_modules/nuxt/dist/app/entry.js": () => import('./_nuxt/entry-styles.vskejp-8.mjs').then(interopDefault),
"pages/details/[id].vue": () => import('./_nuxt/_id_-styles.jf6M_6Wp.mjs').then(interopDefault),
"pages/index.html/index.vue": () => import('./_nuxt/index-styles.k7glAHoc.mjs').then(interopDefault),
"pages/publish/index.vue": () => import('./_nuxt/index-styles.8SQC3utM.mjs').then(interopDefault),
"pages/details/[id].vue": () => import('./_nuxt/_id_-styles.jf6M_6Wp.mjs').then(interopDefault),
"node_modules/@nuxt/ui-templates/dist/templates/error-404.vue": () => import('./_nuxt/error-404-styles.XRz1-5H_.mjs').then(interopDefault),
"node_modules/@nuxt/ui-templates/dist/templates/error-500.vue": () => import('./_nuxt/error-500-styles.vMIeuOQq.mjs').then(interopDefault)
};

View File

@ -1 +1 @@
{"version":3,"file":"styles.mjs","sources":["../../../../.nuxt/dist/server/styles.mjs"],"sourcesContent":null,"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,GAAE;AAChD,eAAe;AACf,EAAE,qCAAqC,EAAE,MAAM,OAAO,mCAAmC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AAC/G,EAAE,wBAAwB,EAAE,MAAM,OAAO,kCAAkC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AACjG,EAAE,4BAA4B,EAAE,MAAM,OAAO,mCAAmC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AACtG,EAAE,yBAAyB,EAAE,MAAM,OAAO,mCAAmC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AACnG,EAAE,8DAA8D,EAAE,MAAM,OAAO,uCAAuC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AAC5I,EAAE,8DAA8D,EAAE,MAAM,OAAO,uCAAuC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AAC5I;;;;"}
{"version":3,"file":"styles.mjs","sources":["../../../../.nuxt/dist/server/styles.mjs"],"sourcesContent":null,"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,IAAI,GAAE;AAChD,eAAe;AACf,EAAE,qCAAqC,EAAE,MAAM,OAAO,mCAAmC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AAC/G,EAAE,4BAA4B,EAAE,MAAM,OAAO,mCAAmC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AACtG,EAAE,yBAAyB,EAAE,MAAM,OAAO,mCAAmC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AACnG,EAAE,wBAAwB,EAAE,MAAM,OAAO,kCAAkC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AACjG,EAAE,8DAA8D,EAAE,MAAM,OAAO,uCAAuC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AAC5I,EAAE,8DAA8D,EAAE,MAAM,OAAO,uCAAuC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;AAC5I;;;;"}

View File

@ -3044,7 +3044,7 @@ function klona(x) {
const inlineAppConfig = {
"nuxt": {
"buildId": "bcd0ae82-0890-486f-9488-c29e0983ae57"
"buildId": "30ca3b98-cf46-4da1-864a-8ff3a6d0ca32"
}
};
@ -4938,205 +4938,205 @@ const assets = {
"/_nuxt/calendar-icon.RgXPrw8I.svg": {
"type": "image/svg+xml",
"etag": "\"10de-7GpYtlC2JwrcocvS/s1VFTYW1Oc\"",
"mtime": "2024-05-15T04:05:02.826Z",
"mtime": "2024-05-15T04:08:24.587Z",
"size": 4318,
"path": "../public/_nuxt/calendar-icon.RgXPrw8I.svg"
},
"/_nuxt/cross-icon.5Lsg-_qO.css": {
"type": "text/css; charset=utf-8",
"etag": "\"3446-UrYllNnHDd7gKeOPaZburWnPV3I\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 13382,
"path": "../public/_nuxt/cross-icon.5Lsg-_qO.css"
},
"/_nuxt/cross-icon.UWVgdOJ8.js": {
"/_nuxt/cross-icon.L5DBuTu4.js": {
"type": "application/javascript",
"etag": "\"1cc1c-xLON0wTbk80/N9Y/ZwZTBzdEiso\"",
"mtime": "2024-05-15T04:05:02.829Z",
"etag": "\"1cc1c-+CitOMGdH8IKjqSfupv98fTsnug\"",
"mtime": "2024-05-15T04:08:24.591Z",
"size": 117788,
"path": "../public/_nuxt/cross-icon.UWVgdOJ8.js"
"path": "../public/_nuxt/cross-icon.L5DBuTu4.js"
},
"/_nuxt/delete-icon.p1wZUMqX.svg": {
"type": "image/svg+xml",
"etag": "\"17fc-i1z5ruTbyKdk0KmaLxdHbFn0fDE\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 6140,
"path": "../public/_nuxt/delete-icon.p1wZUMqX.svg"
},
"/_nuxt/el-popper.Bs6EhWze.js": {
"/_nuxt/el-popper.I6dKLGMP.js": {
"type": "application/javascript",
"etag": "\"c994-5jF2E1W1YYDmfeexf3PDmwr0H6s\"",
"mtime": "2024-05-15T04:05:02.829Z",
"etag": "\"c994-JdSPES4IRt7PRWuxdGXZkjIu7Ls\"",
"mtime": "2024-05-15T04:08:24.591Z",
"size": 51604,
"path": "../public/_nuxt/el-popper.Bs6EhWze.js"
"path": "../public/_nuxt/el-popper.I6dKLGMP.js"
},
"/_nuxt/el-popper.nJ_mFSbn.css": {
"type": "text/css; charset=utf-8",
"etag": "\"38b6-dWUD8yySxpDfgY7+9/KcduaUxQI\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 14518,
"path": "../public/_nuxt/el-popper.nJ_mFSbn.css"
},
"/_nuxt/empty-icon.LkY4ik76.svg": {
"type": "image/svg+xml",
"etag": "\"d028-Our2UxxUiciRSduORd8JZCt5Prw\"",
"mtime": "2024-05-15T04:05:02.827Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 53288,
"path": "../public/_nuxt/empty-icon.LkY4ik76.svg"
},
"/_nuxt/entry.r79gNFmw.js": {
"/_nuxt/entry.pFNfq0UB.js": {
"type": "application/javascript",
"etag": "\"2507c-66YRzHw5NcSzETGYcV/nBn6Yppc\"",
"mtime": "2024-05-15T04:05:02.830Z",
"etag": "\"2507c-R/bXuH9lXCK8QHRHsBQXskWAyRI\"",
"mtime": "2024-05-15T04:08:24.591Z",
"size": 151676,
"path": "../public/_nuxt/entry.r79gNFmw.js"
"path": "../public/_nuxt/entry.pFNfq0UB.js"
},
"/_nuxt/entry.ZC0N1p0G.css": {
"type": "text/css; charset=utf-8",
"etag": "\"650-twcVoXP/sEnGnstI7Ckhexu6MOs\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 1616,
"path": "../public/_nuxt/entry.ZC0N1p0G.css"
},
"/_nuxt/error-404.jVQrFtrI.js": {
"/_nuxt/error-404.Nn2vJFUt.js": {
"type": "application/javascript",
"etag": "\"193e-EJqthZsT4EMwUy+f6xTm5v7PLUs\"",
"mtime": "2024-05-15T04:05:02.828Z",
"etag": "\"193e-8t7Seeu3C+3HutjQ6h1ov7j1aVw\"",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 6462,
"path": "../public/_nuxt/error-404.jVQrFtrI.js"
"path": "../public/_nuxt/error-404.Nn2vJFUt.js"
},
"/_nuxt/error-404.qFGwA4uS.css": {
"type": "text/css; charset=utf-8",
"etag": "\"e26-9UI2Z985OY4ttYcbyiWh91cxpnM\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 3622,
"path": "../public/_nuxt/error-404.qFGwA4uS.css"
},
"/_nuxt/error-500.lF1s0fQO.js": {
"type": "application/javascript",
"etag": "\"78b-cLpbWg7t1rwFy2Z1unWbyi8q940\"",
"mtime": "2024-05-15T04:05:02.828Z",
"size": 1931,
"path": "../public/_nuxt/error-500.lF1s0fQO.js"
},
"/_nuxt/error-500.V0P2JAtD.css": {
"type": "text/css; charset=utf-8",
"etag": "\"79e-ByRo+49BgcevWdRjJy3CMx2IA5k\"",
"mtime": "2024-05-15T04:05:02.827Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 1950,
"path": "../public/_nuxt/error-500.V0P2JAtD.css"
},
"/_nuxt/error-500.Y_DtRcr_.js": {
"type": "application/javascript",
"etag": "\"78b-CnhRiW1ikKhadSOunzR/2jx69EE\"",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 1931,
"path": "../public/_nuxt/error-500.Y_DtRcr_.js"
},
"/_nuxt/index.ACq2ujgq.js": {
"type": "application/javascript",
"etag": "\"28fd8-kVd08D07EwLN62UFh/R6R1hi9RI\"",
"mtime": "2024-05-15T04:08:24.591Z",
"size": 167896,
"path": "../public/_nuxt/index.ACq2ujgq.js"
},
"/_nuxt/index.bpCV3N5s.css": {
"type": "text/css; charset=utf-8",
"etag": "\"b1e1-al+OXwcYtN4F19ZJ0cpljVFw0gc\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 45537,
"path": "../public/_nuxt/index.bpCV3N5s.css"
},
"/_nuxt/index.DsvIf7b1.css": {
"type": "text/css; charset=utf-8",
"etag": "\"1037-llIeX/6YFUSjc53VaBGy87nf4VE\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 4151,
"path": "../public/_nuxt/index.DsvIf7b1.css"
},
"/_nuxt/index.md7TFpUS.js": {
"/_nuxt/index.hha2MzTQ.js": {
"type": "application/javascript",
"etag": "\"8f-Ct+0sGzI90zX8Zvn7kyYFm76lZ0\"",
"mtime": "2024-05-15T04:05:02.828Z",
"etag": "\"8f-6lTTIvPkdvEscuUnKIhYaUjzPb4\"",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 143,
"path": "../public/_nuxt/index.md7TFpUS.js"
"path": "../public/_nuxt/index.hha2MzTQ.js"
},
"/_nuxt/index.NdLfXcS-.js": {
"/_nuxt/index.xyOOb3D9.js": {
"type": "application/javascript",
"etag": "\"28fd8-HNwcl0QQAV2uux/r5g5nlCNvoE8\"",
"mtime": "2024-05-15T04:05:02.829Z",
"size": 167896,
"path": "../public/_nuxt/index.NdLfXcS-.js"
},
"/_nuxt/index.OLIYUoV1.js": {
"type": "application/javascript",
"etag": "\"33e0-tFL5QyAhEqBPkvcMEo4FOLY3LcQ\"",
"mtime": "2024-05-15T04:05:02.828Z",
"etag": "\"33e0-F1mFStfuoSKMFY/rImaPZ6T9JAQ\"",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 13280,
"path": "../public/_nuxt/index.OLIYUoV1.js"
"path": "../public/_nuxt/index.xyOOb3D9.js"
},
"/_nuxt/logo-icon.fQ3LbI4i.png": {
"type": "image/png",
"etag": "\"8d1d-YZYdbCulYrGuoQi7QbaoOuzZCyY\"",
"mtime": "2024-05-15T04:05:02.827Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 36125,
"path": "../public/_nuxt/logo-icon.fQ3LbI4i.png"
},
"/_nuxt/masonry.UTL2hJ8m.js": {
"/_nuxt/masonry.k1yKHgzP.js": {
"type": "application/javascript",
"etag": "\"5925-pPI68pBiwXp28psSC1kO5bTnEtM\"",
"mtime": "2024-05-15T04:05:02.828Z",
"etag": "\"5925-XpLL1xnoyKS+TIe88VIhS421Csk\"",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 22821,
"path": "../public/_nuxt/masonry.UTL2hJ8m.js"
"path": "../public/_nuxt/masonry.k1yKHgzP.js"
},
"/_nuxt/rubbish-icon.KM8oLqUI.svg": {
"type": "image/svg+xml",
"etag": "\"17e1-0oHVDZUgWIUgaubOQT0sXepX2qs\"",
"mtime": "2024-05-15T04:05:02.827Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 6113,
"path": "../public/_nuxt/rubbish-icon.KM8oLqUI.svg"
},
"/_nuxt/tick-black.gcOKuYFv.js": {
"type": "application/javascript",
"etag": "\"b2d6-Vw5wdojDuGHl5gXcTXVEk2ZWRCo\"",
"mtime": "2024-05-15T04:05:02.829Z",
"size": 45782,
"path": "../public/_nuxt/tick-black.gcOKuYFv.js"
},
"/_nuxt/tick-black.p71NrTKG.css": {
"type": "text/css; charset=utf-8",
"etag": "\"2ee7-PvWnhiT0yIwma8iRb1rALqkLaDM\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 12007,
"path": "../public/_nuxt/tick-black.p71NrTKG.css"
},
"/_nuxt/tick-black.PHhQsb83.js": {
"type": "application/javascript",
"etag": "\"b2d6-QKz60hzdEW9izdWakQWeheAVPrQ\"",
"mtime": "2024-05-15T04:08:24.591Z",
"size": 45782,
"path": "../public/_nuxt/tick-black.PHhQsb83.js"
},
"/_nuxt/title.Acc43PUE.png": {
"type": "image/png",
"etag": "\"1723-0OwkVass/2nFB99dRT4w0sPUvI0\"",
"mtime": "2024-05-15T04:05:02.827Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 5923,
"path": "../public/_nuxt/title.Acc43PUE.png"
},
"/_nuxt/_id_.-h824Jby.js": {
"type": "application/javascript",
"etag": "\"e956-zflV/UDla+ytm0rF4n+C15TcAMU\"",
"mtime": "2024-05-15T04:08:24.591Z",
"size": 59734,
"path": "../public/_nuxt/_id_.-h824Jby.js"
},
"/_nuxt/_id_.iOUCIGGy.css": {
"type": "text/css; charset=utf-8",
"etag": "\"5e42-TWDlWMB+Q3UYfE9iY+ylVCbNJE8\"",
"mtime": "2024-05-15T04:05:02.828Z",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 24130,
"path": "../public/_nuxt/_id_.iOUCIGGy.css"
},
"/_nuxt/_id_.vV_UX9s9.js": {
"/_nuxt/_plugin-vue_export-helper.P-CtXeSh.js": {
"type": "application/javascript",
"etag": "\"e956-Pg1Iy1Kd745GvvTrA+B8Qa5rJgM\"",
"mtime": "2024-05-15T04:05:02.829Z",
"size": 59734,
"path": "../public/_nuxt/_id_.vV_UX9s9.js"
},
"/_nuxt/_plugin-vue_export-helper.lmLA3jcC.js": {
"type": "application/javascript",
"etag": "\"1de-AEtrUOoO49ARwuvjOwmgp5igtKY\"",
"mtime": "2024-05-15T04:05:02.828Z",
"etag": "\"1de-WnU9J91cqH9G8c0rnlD5zoNjb+U\"",
"mtime": "2024-05-15T04:08:24.589Z",
"size": 478,
"path": "../public/_nuxt/_plugin-vue_export-helper.lmLA3jcC.js"
"path": "../public/_nuxt/_plugin-vue_export-helper.P-CtXeSh.js"
},
"/_nuxt/builds/latest.json": {
"type": "application/json",
"etag": "\"47-TRFfR2CwLVB1BI8F8AaF7TfKIkA\"",
"mtime": "2024-05-15T04:05:08.035Z",
"etag": "\"47-e8QGHc15O1VG//qNo57RAFSgEQ0\"",
"mtime": "2024-05-15T04:08:28.358Z",
"size": 71,
"path": "../public/_nuxt/builds/latest.json"
},
"/_nuxt/builds/meta/bcd0ae82-0890-486f-9488-c29e0983ae57.json": {
"/_nuxt/builds/meta/30ca3b98-cf46-4da1-864a-8ff3a6d0ca32.json": {
"type": "application/json",
"etag": "\"8b-Aot5ZanNxdMi49yy1CG4aYNP+EU\"",
"mtime": "2024-05-15T04:05:08.035Z",
"etag": "\"8b-auf/6qsFX+ywUpWM6NIkz7ZWv8Y\"",
"mtime": "2024-05-15T04:08:28.358Z",
"size": 139,
"path": "../public/_nuxt/builds/meta/bcd0ae82-0890-486f-9488-c29e0983ae57.json"
"path": "../public/_nuxt/builds/meta/30ca3b98-cf46-4da1-864a-8ff3a6d0ca32.json"
}
};

14460
.output/server/node_modules/@babel/parser/lib/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

46
.output/server/node_modules/@babel/parser/package.json generated vendored Normal file
View File

@ -0,0 +1,46 @@
{
"name": "@babel/parser",
"version": "7.23.6",
"description": "A JavaScript parser",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-parser",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A+parser+%28babylon%29%22+is%3Aopen",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"keywords": [
"babel",
"javascript",
"parser",
"tc39",
"ecmascript",
"@babel/parser"
],
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-parser"
},
"main": "./lib/index.js",
"types": "./typings/babel-parser.d.ts",
"files": [
"bin",
"lib",
"typings/babel-parser.d.ts",
"index.cjs"
],
"engines": {
"node": ">=6.0.0"
},
"devDependencies": {
"@babel/code-frame": "^7.23.5",
"@babel/helper-check-duplicate-nodes": "^7.22.5",
"@babel/helper-fixtures": "^7.23.4",
"@babel/helper-string-parser": "^7.23.4",
"@babel/helper-validator-identifier": "^7.22.20",
"charcodes": "^0.2.0"
},
"bin": "./bin/babel-parser.js",
"type": "commonjs"
}

View File

@ -0,0 +1,250 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.numberInputToObject = exports.parseIntFromHex = exports.convertHexToDecimal = exports.convertDecimalToHex = exports.rgbaToArgbHex = exports.rgbaToHex = exports.rgbToHex = exports.hsvToRgb = exports.rgbToHsv = exports.hslToRgb = exports.rgbToHsl = exports.rgbToRgb = void 0;
var util_js_1 = require("./util.js");
// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
/**
* Handle bounds / percentage checking to conform to CSS color spec
* <http://www.w3.org/TR/css3-color/>
* *Assumes:* r, g, b in [0, 255] or [0, 1]
* *Returns:* { r, g, b } in [0, 255]
*/
function rgbToRgb(r, g, b) {
return {
r: (0, util_js_1.bound01)(r, 255) * 255,
g: (0, util_js_1.bound01)(g, 255) * 255,
b: (0, util_js_1.bound01)(b, 255) * 255,
};
}
exports.rgbToRgb = rgbToRgb;
/**
* Converts an RGB color value to HSL.
* *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]
* *Returns:* { h, s, l } in [0,1]
*/
function rgbToHsl(r, g, b) {
r = (0, util_js_1.bound01)(r, 255);
g = (0, util_js_1.bound01)(g, 255);
b = (0, util_js_1.bound01)(b, 255);
var max = Math.max(r, g, b);
var min = Math.min(r, g, b);
var h = 0;
var s = 0;
var l = (max + min) / 2;
if (max === min) {
s = 0;
h = 0; // achromatic
}
else {
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
default:
break;
}
h /= 6;
}
return { h: h, s: s, l: l };
}
exports.rgbToHsl = rgbToHsl;
function hue2rgb(p, q, t) {
if (t < 0) {
t += 1;
}
if (t > 1) {
t -= 1;
}
if (t < 1 / 6) {
return p + (q - p) * (6 * t);
}
if (t < 1 / 2) {
return q;
}
if (t < 2 / 3) {
return p + (q - p) * (2 / 3 - t) * 6;
}
return p;
}
/**
* Converts an HSL color value to RGB.
*
* *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
* *Returns:* { r, g, b } in the set [0, 255]
*/
function hslToRgb(h, s, l) {
var r;
var g;
var b;
h = (0, util_js_1.bound01)(h, 360);
s = (0, util_js_1.bound01)(s, 100);
l = (0, util_js_1.bound01)(l, 100);
if (s === 0) {
// achromatic
g = l;
b = l;
r = l;
}
else {
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
r = hue2rgb(p, q, h + 1 / 3);
g = hue2rgb(p, q, h);
b = hue2rgb(p, q, h - 1 / 3);
}
return { r: r * 255, g: g * 255, b: b * 255 };
}
exports.hslToRgb = hslToRgb;
/**
* Converts an RGB color value to HSV
*
* *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
* *Returns:* { h, s, v } in [0,1]
*/
function rgbToHsv(r, g, b) {
r = (0, util_js_1.bound01)(r, 255);
g = (0, util_js_1.bound01)(g, 255);
b = (0, util_js_1.bound01)(b, 255);
var max = Math.max(r, g, b);
var min = Math.min(r, g, b);
var h = 0;
var v = max;
var d = max - min;
var s = max === 0 ? 0 : d / max;
if (max === min) {
h = 0; // achromatic
}
else {
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
default:
break;
}
h /= 6;
}
return { h: h, s: s, v: v };
}
exports.rgbToHsv = rgbToHsv;
/**
* Converts an HSV color value to RGB.
*
* *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
* *Returns:* { r, g, b } in the set [0, 255]
*/
function hsvToRgb(h, s, v) {
h = (0, util_js_1.bound01)(h, 360) * 6;
s = (0, util_js_1.bound01)(s, 100);
v = (0, util_js_1.bound01)(v, 100);
var i = Math.floor(h);
var f = h - i;
var p = v * (1 - s);
var q = v * (1 - f * s);
var t = v * (1 - (1 - f) * s);
var mod = i % 6;
var r = [v, q, p, p, t, v][mod];
var g = [t, v, v, q, p, p][mod];
var b = [p, p, t, v, v, q][mod];
return { r: r * 255, g: g * 255, b: b * 255 };
}
exports.hsvToRgb = hsvToRgb;
/**
* Converts an RGB color to hex
*
* Assumes r, g, and b are contained in the set [0, 255]
* Returns a 3 or 6 character hex
*/
function rgbToHex(r, g, b, allow3Char) {
var hex = [
(0, util_js_1.pad2)(Math.round(r).toString(16)),
(0, util_js_1.pad2)(Math.round(g).toString(16)),
(0, util_js_1.pad2)(Math.round(b).toString(16)),
];
// Return a 3 character hex if possible
if (allow3Char &&
hex[0].startsWith(hex[0].charAt(1)) &&
hex[1].startsWith(hex[1].charAt(1)) &&
hex[2].startsWith(hex[2].charAt(1))) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
}
return hex.join('');
}
exports.rgbToHex = rgbToHex;
/**
* Converts an RGBA color plus alpha transparency to hex
*
* Assumes r, g, b are contained in the set [0, 255] and
* a in [0, 1]. Returns a 4 or 8 character rgba hex
*/
// eslint-disable-next-line max-params
function rgbaToHex(r, g, b, a, allow4Char) {
var hex = [
(0, util_js_1.pad2)(Math.round(r).toString(16)),
(0, util_js_1.pad2)(Math.round(g).toString(16)),
(0, util_js_1.pad2)(Math.round(b).toString(16)),
(0, util_js_1.pad2)(convertDecimalToHex(a)),
];
// Return a 4 character hex if possible
if (allow4Char &&
hex[0].startsWith(hex[0].charAt(1)) &&
hex[1].startsWith(hex[1].charAt(1)) &&
hex[2].startsWith(hex[2].charAt(1)) &&
hex[3].startsWith(hex[3].charAt(1))) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
}
return hex.join('');
}
exports.rgbaToHex = rgbaToHex;
/**
* Converts an RGBA color to an ARGB Hex8 string
* Rarely used, but required for "toFilter()"
*/
function rgbaToArgbHex(r, g, b, a) {
var hex = [
(0, util_js_1.pad2)(convertDecimalToHex(a)),
(0, util_js_1.pad2)(Math.round(r).toString(16)),
(0, util_js_1.pad2)(Math.round(g).toString(16)),
(0, util_js_1.pad2)(Math.round(b).toString(16)),
];
return hex.join('');
}
exports.rgbaToArgbHex = rgbaToArgbHex;
/** Converts a decimal to a hex value */
function convertDecimalToHex(d) {
return Math.round(parseFloat(d) * 255).toString(16);
}
exports.convertDecimalToHex = convertDecimalToHex;
/** Converts a hex value to a decimal */
function convertHexToDecimal(h) {
return parseIntFromHex(h) / 255;
}
exports.convertHexToDecimal = convertHexToDecimal;
/** Parse a base-16 hex value into a base-10 integer */
function parseIntFromHex(val) {
return parseInt(val, 16);
}
exports.parseIntFromHex = parseIntFromHex;
function numberInputToObject(color) {
return {
r: color >> 16,
g: (color & 0xff00) >> 8,
b: color & 0xff,
};
}
exports.numberInputToObject = numberInputToObject;

View File

@ -0,0 +1,157 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.names = void 0;
// https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
/**
* @hidden
*/
exports.names = {
aliceblue: '#f0f8ff',
antiquewhite: '#faebd7',
aqua: '#00ffff',
aquamarine: '#7fffd4',
azure: '#f0ffff',
beige: '#f5f5dc',
bisque: '#ffe4c4',
black: '#000000',
blanchedalmond: '#ffebcd',
blue: '#0000ff',
blueviolet: '#8a2be2',
brown: '#a52a2a',
burlywood: '#deb887',
cadetblue: '#5f9ea0',
chartreuse: '#7fff00',
chocolate: '#d2691e',
coral: '#ff7f50',
cornflowerblue: '#6495ed',
cornsilk: '#fff8dc',
crimson: '#dc143c',
cyan: '#00ffff',
darkblue: '#00008b',
darkcyan: '#008b8b',
darkgoldenrod: '#b8860b',
darkgray: '#a9a9a9',
darkgreen: '#006400',
darkgrey: '#a9a9a9',
darkkhaki: '#bdb76b',
darkmagenta: '#8b008b',
darkolivegreen: '#556b2f',
darkorange: '#ff8c00',
darkorchid: '#9932cc',
darkred: '#8b0000',
darksalmon: '#e9967a',
darkseagreen: '#8fbc8f',
darkslateblue: '#483d8b',
darkslategray: '#2f4f4f',
darkslategrey: '#2f4f4f',
darkturquoise: '#00ced1',
darkviolet: '#9400d3',
deeppink: '#ff1493',
deepskyblue: '#00bfff',
dimgray: '#696969',
dimgrey: '#696969',
dodgerblue: '#1e90ff',
firebrick: '#b22222',
floralwhite: '#fffaf0',
forestgreen: '#228b22',
fuchsia: '#ff00ff',
gainsboro: '#dcdcdc',
ghostwhite: '#f8f8ff',
goldenrod: '#daa520',
gold: '#ffd700',
gray: '#808080',
green: '#008000',
greenyellow: '#adff2f',
grey: '#808080',
honeydew: '#f0fff0',
hotpink: '#ff69b4',
indianred: '#cd5c5c',
indigo: '#4b0082',
ivory: '#fffff0',
khaki: '#f0e68c',
lavenderblush: '#fff0f5',
lavender: '#e6e6fa',
lawngreen: '#7cfc00',
lemonchiffon: '#fffacd',
lightblue: '#add8e6',
lightcoral: '#f08080',
lightcyan: '#e0ffff',
lightgoldenrodyellow: '#fafad2',
lightgray: '#d3d3d3',
lightgreen: '#90ee90',
lightgrey: '#d3d3d3',
lightpink: '#ffb6c1',
lightsalmon: '#ffa07a',
lightseagreen: '#20b2aa',
lightskyblue: '#87cefa',
lightslategray: '#778899',
lightslategrey: '#778899',
lightsteelblue: '#b0c4de',
lightyellow: '#ffffe0',
lime: '#00ff00',
limegreen: '#32cd32',
linen: '#faf0e6',
magenta: '#ff00ff',
maroon: '#800000',
mediumaquamarine: '#66cdaa',
mediumblue: '#0000cd',
mediumorchid: '#ba55d3',
mediumpurple: '#9370db',
mediumseagreen: '#3cb371',
mediumslateblue: '#7b68ee',
mediumspringgreen: '#00fa9a',
mediumturquoise: '#48d1cc',
mediumvioletred: '#c71585',
midnightblue: '#191970',
mintcream: '#f5fffa',
mistyrose: '#ffe4e1',
moccasin: '#ffe4b5',
navajowhite: '#ffdead',
navy: '#000080',
oldlace: '#fdf5e6',
olive: '#808000',
olivedrab: '#6b8e23',
orange: '#ffa500',
orangered: '#ff4500',
orchid: '#da70d6',
palegoldenrod: '#eee8aa',
palegreen: '#98fb98',
paleturquoise: '#afeeee',
palevioletred: '#db7093',
papayawhip: '#ffefd5',
peachpuff: '#ffdab9',
peru: '#cd853f',
pink: '#ffc0cb',
plum: '#dda0dd',
powderblue: '#b0e0e6',
purple: '#800080',
rebeccapurple: '#663399',
red: '#ff0000',
rosybrown: '#bc8f8f',
royalblue: '#4169e1',
saddlebrown: '#8b4513',
salmon: '#fa8072',
sandybrown: '#f4a460',
seagreen: '#2e8b57',
seashell: '#fff5ee',
sienna: '#a0522d',
silver: '#c0c0c0',
skyblue: '#87ceeb',
slateblue: '#6a5acd',
slategray: '#708090',
slategrey: '#708090',
snow: '#fffafa',
springgreen: '#00ff7f',
steelblue: '#4682b4',
tan: '#d2b48c',
teal: '#008080',
thistle: '#d8bfd8',
tomato: '#ff6347',
turquoise: '#40e0d0',
violet: '#ee82ee',
wheat: '#f5deb3',
white: '#ffffff',
whitesmoke: '#f5f5f5',
yellow: '#ffff00',
yellowgreen: '#9acd32',
};

View File

@ -0,0 +1,189 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidCSSUnit = exports.stringInputToObject = exports.inputToRGB = void 0;
/* eslint-disable @typescript-eslint/no-redundant-type-constituents */
var conversion_js_1 = require("./conversion.js");
var css_color_names_js_1 = require("./css-color-names.js");
var util_js_1 = require("./util.js");
/**
* Given a string or object, convert that input to RGB
*
* Possible string inputs:
* ```
* "red"
* "#f00" or "f00"
* "#ff0000" or "ff0000"
* "#ff000000" or "ff000000"
* "rgb 255 0 0" or "rgb (255, 0, 0)"
* "rgb 1.0 0 0" or "rgb (1, 0, 0)"
* "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
* "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
* "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
* "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
* "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
* ```
*/
function inputToRGB(color) {
var rgb = { r: 0, g: 0, b: 0 };
var a = 1;
var s = null;
var v = null;
var l = null;
var ok = false;
var format = false;
if (typeof color === 'string') {
color = stringInputToObject(color);
}
if (typeof color === 'object') {
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
rgb = (0, conversion_js_1.rgbToRgb)(color.r, color.g, color.b);
ok = true;
format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
}
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
s = (0, util_js_1.convertToPercentage)(color.s);
v = (0, util_js_1.convertToPercentage)(color.v);
rgb = (0, conversion_js_1.hsvToRgb)(color.h, s, v);
ok = true;
format = 'hsv';
}
else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
s = (0, util_js_1.convertToPercentage)(color.s);
l = (0, util_js_1.convertToPercentage)(color.l);
rgb = (0, conversion_js_1.hslToRgb)(color.h, s, l);
ok = true;
format = 'hsl';
}
if (Object.prototype.hasOwnProperty.call(color, 'a')) {
a = color.a;
}
}
a = (0, util_js_1.boundAlpha)(a);
return {
ok: ok,
format: color.format || format,
r: Math.min(255, Math.max(rgb.r, 0)),
g: Math.min(255, Math.max(rgb.g, 0)),
b: Math.min(255, Math.max(rgb.b, 0)),
a: a,
};
}
exports.inputToRGB = inputToRGB;
// <http://www.w3.org/TR/css3-values/#integers>
var CSS_INTEGER = '[-\\+]?\\d+%?';
// <http://www.w3.org/TR/css3-values/#number-value>
var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
// Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
// Actual matching.
// Parentheses and commas are optional, but not required.
// Whitespace can take the place of commas or opening paren
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
var matchers = {
CSS_UNIT: new RegExp(CSS_UNIT),
rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
};
/**
* Permissive string parsing. Take in a number of formats, and output an object
* based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
*/
function stringInputToObject(color) {
color = color.trim().toLowerCase();
if (color.length === 0) {
return false;
}
var named = false;
if (css_color_names_js_1.names[color]) {
color = css_color_names_js_1.names[color];
named = true;
}
else if (color === 'transparent') {
return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
}
// Try to match string input using regular expressions.
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
// Just return an object and let the conversion functions handle that.
// This way the result will be the same whether the tinycolor is initialized with string or object.
var match = matchers.rgb.exec(color);
if (match) {
return { r: match[1], g: match[2], b: match[3] };
}
match = matchers.rgba.exec(color);
if (match) {
return { r: match[1], g: match[2], b: match[3], a: match[4] };
}
match = matchers.hsl.exec(color);
if (match) {
return { h: match[1], s: match[2], l: match[3] };
}
match = matchers.hsla.exec(color);
if (match) {
return { h: match[1], s: match[2], l: match[3], a: match[4] };
}
match = matchers.hsv.exec(color);
if (match) {
return { h: match[1], s: match[2], v: match[3] };
}
match = matchers.hsva.exec(color);
if (match) {
return { h: match[1], s: match[2], v: match[3], a: match[4] };
}
match = matchers.hex8.exec(color);
if (match) {
return {
r: (0, conversion_js_1.parseIntFromHex)(match[1]),
g: (0, conversion_js_1.parseIntFromHex)(match[2]),
b: (0, conversion_js_1.parseIntFromHex)(match[3]),
a: (0, conversion_js_1.convertHexToDecimal)(match[4]),
format: named ? 'name' : 'hex8',
};
}
match = matchers.hex6.exec(color);
if (match) {
return {
r: (0, conversion_js_1.parseIntFromHex)(match[1]),
g: (0, conversion_js_1.parseIntFromHex)(match[2]),
b: (0, conversion_js_1.parseIntFromHex)(match[3]),
format: named ? 'name' : 'hex',
};
}
match = matchers.hex4.exec(color);
if (match) {
return {
r: (0, conversion_js_1.parseIntFromHex)(match[1] + match[1]),
g: (0, conversion_js_1.parseIntFromHex)(match[2] + match[2]),
b: (0, conversion_js_1.parseIntFromHex)(match[3] + match[3]),
a: (0, conversion_js_1.convertHexToDecimal)(match[4] + match[4]),
format: named ? 'name' : 'hex8',
};
}
match = matchers.hex3.exec(color);
if (match) {
return {
r: (0, conversion_js_1.parseIntFromHex)(match[1] + match[1]),
g: (0, conversion_js_1.parseIntFromHex)(match[2] + match[2]),
b: (0, conversion_js_1.parseIntFromHex)(match[3] + match[3]),
format: named ? 'name' : 'hex',
};
}
return false;
}
exports.stringInputToObject = stringInputToObject;
/**
* Check to see if it looks like a CSS unit
* (see `matchers` above for definition).
*/
function isValidCSSUnit(color) {
return Boolean(matchers.CSS_UNIT.exec(String(color)));
}
exports.isValidCSSUnit = isValidCSSUnit;

View File

@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.legacyRandom = exports.fromRatio = void 0;
var index_js_1 = require("./index.js");
var util_js_1 = require("./util.js");
/**
* If input is an object, force 1 into "1.0" to handle ratios properly
* String input requires "1.0" as input, so 1 will be treated as 1
*/
function fromRatio(ratio, opts) {
var newColor = {
r: (0, util_js_1.convertToPercentage)(ratio.r),
g: (0, util_js_1.convertToPercentage)(ratio.g),
b: (0, util_js_1.convertToPercentage)(ratio.b),
};
if (ratio.a !== undefined) {
newColor.a = Number(ratio.a);
}
return new index_js_1.TinyColor(newColor, opts);
}
exports.fromRatio = fromRatio;
/** old random function */
function legacyRandom() {
return new index_js_1.TinyColor({
r: Math.random(),
g: Math.random(),
b: Math.random(),
});
}
exports.legacyRandom = legacyRandom;

View File

@ -0,0 +1,512 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tinycolor = exports.TinyColor = void 0;
var conversion_js_1 = require("./conversion.js");
var css_color_names_js_1 = require("./css-color-names.js");
var format_input_1 = require("./format-input");
var util_js_1 = require("./util.js");
var TinyColor = /** @class */ (function () {
function TinyColor(color, opts) {
if (color === void 0) { color = ''; }
if (opts === void 0) { opts = {}; }
var _a;
// If input is already a tinycolor, return itself
if (color instanceof TinyColor) {
// eslint-disable-next-line no-constructor-return
return color;
}
if (typeof color === 'number') {
color = (0, conversion_js_1.numberInputToObject)(color);
}
this.originalInput = color;
var rgb = (0, format_input_1.inputToRGB)(color);
this.originalInput = color;
this.r = rgb.r;
this.g = rgb.g;
this.b = rgb.b;
this.a = rgb.a;
this.roundA = Math.round(100 * this.a) / 100;
this.format = (_a = opts.format) !== null && _a !== void 0 ? _a : rgb.format;
this.gradientType = opts.gradientType;
// Don't let the range of [0,255] come back in [0,1].
// Potentially lose a little bit of precision here, but will fix issues where
// .5 gets interpreted as half of the total, instead of half of 1
// If it was supposed to be 128, this was already taken care of by `inputToRgb`
if (this.r < 1) {
this.r = Math.round(this.r);
}
if (this.g < 1) {
this.g = Math.round(this.g);
}
if (this.b < 1) {
this.b = Math.round(this.b);
}
this.isValid = rgb.ok;
}
TinyColor.prototype.isDark = function () {
return this.getBrightness() < 128;
};
TinyColor.prototype.isLight = function () {
return !this.isDark();
};
/**
* Returns the perceived brightness of the color, from 0-255.
*/
TinyColor.prototype.getBrightness = function () {
// http://www.w3.org/TR/AERT#color-contrast
var rgb = this.toRgb();
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
};
/**
* Returns the perceived luminance of a color, from 0-1.
*/
TinyColor.prototype.getLuminance = function () {
// http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
var rgb = this.toRgb();
var R;
var G;
var B;
var RsRGB = rgb.r / 255;
var GsRGB = rgb.g / 255;
var BsRGB = rgb.b / 255;
if (RsRGB <= 0.03928) {
R = RsRGB / 12.92;
}
else {
// eslint-disable-next-line prefer-exponentiation-operator
R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
}
if (GsRGB <= 0.03928) {
G = GsRGB / 12.92;
}
else {
// eslint-disable-next-line prefer-exponentiation-operator
G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
}
if (BsRGB <= 0.03928) {
B = BsRGB / 12.92;
}
else {
// eslint-disable-next-line prefer-exponentiation-operator
B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
}
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
};
/**
* Returns the alpha value of a color, from 0-1.
*/
TinyColor.prototype.getAlpha = function () {
return this.a;
};
/**
* Sets the alpha value on the current color.
*
* @param alpha - The new alpha value. The accepted range is 0-1.
*/
TinyColor.prototype.setAlpha = function (alpha) {
this.a = (0, util_js_1.boundAlpha)(alpha);
this.roundA = Math.round(100 * this.a) / 100;
return this;
};
/**
* Returns whether the color is monochrome.
*/
TinyColor.prototype.isMonochrome = function () {
var s = this.toHsl().s;
return s === 0;
};
/**
* Returns the object as a HSVA object.
*/
TinyColor.prototype.toHsv = function () {
var hsv = (0, conversion_js_1.rgbToHsv)(this.r, this.g, this.b);
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
};
/**
* Returns the hsva values interpolated into a string with the following format:
* "hsva(xxx, xxx, xxx, xx)".
*/
TinyColor.prototype.toHsvString = function () {
var hsv = (0, conversion_js_1.rgbToHsv)(this.r, this.g, this.b);
var h = Math.round(hsv.h * 360);
var s = Math.round(hsv.s * 100);
var v = Math.round(hsv.v * 100);
return this.a === 1 ? "hsv(".concat(h, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
};
/**
* Returns the object as a HSLA object.
*/
TinyColor.prototype.toHsl = function () {
var hsl = (0, conversion_js_1.rgbToHsl)(this.r, this.g, this.b);
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
};
/**
* Returns the hsla values interpolated into a string with the following format:
* "hsla(xxx, xxx, xxx, xx)".
*/
TinyColor.prototype.toHslString = function () {
var hsl = (0, conversion_js_1.rgbToHsl)(this.r, this.g, this.b);
var h = Math.round(hsl.h * 360);
var s = Math.round(hsl.s * 100);
var l = Math.round(hsl.l * 100);
return this.a === 1 ? "hsl(".concat(h, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
};
/**
* Returns the hex value of the color.
* @param allow3Char will shorten hex value to 3 char if possible
*/
TinyColor.prototype.toHex = function (allow3Char) {
if (allow3Char === void 0) { allow3Char = false; }
return (0, conversion_js_1.rgbToHex)(this.r, this.g, this.b, allow3Char);
};
/**
* Returns the hex value of the color -with a # prefixed.
* @param allow3Char will shorten hex value to 3 char if possible
*/
TinyColor.prototype.toHexString = function (allow3Char) {
if (allow3Char === void 0) { allow3Char = false; }
return '#' + this.toHex(allow3Char);
};
/**
* Returns the hex 8 value of the color.
* @param allow4Char will shorten hex value to 4 char if possible
*/
TinyColor.prototype.toHex8 = function (allow4Char) {
if (allow4Char === void 0) { allow4Char = false; }
return (0, conversion_js_1.rgbaToHex)(this.r, this.g, this.b, this.a, allow4Char);
};
/**
* Returns the hex 8 value of the color -with a # prefixed.
* @param allow4Char will shorten hex value to 4 char if possible
*/
TinyColor.prototype.toHex8String = function (allow4Char) {
if (allow4Char === void 0) { allow4Char = false; }
return '#' + this.toHex8(allow4Char);
};
/**
* Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
* @param allowShortChar will shorten hex value to 3 or 4 char if possible
*/
TinyColor.prototype.toHexShortString = function (allowShortChar) {
if (allowShortChar === void 0) { allowShortChar = false; }
return this.a === 1 ? this.toHexString(allowShortChar) : this.toHex8String(allowShortChar);
};
/**
* Returns the object as a RGBA object.
*/
TinyColor.prototype.toRgb = function () {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a,
};
};
/**
* Returns the RGBA values interpolated into a string with the following format:
* "RGBA(xxx, xxx, xxx, xx)".
*/
TinyColor.prototype.toRgbString = function () {
var r = Math.round(this.r);
var g = Math.round(this.g);
var b = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
};
/**
* Returns the object as a RGBA object.
*/
TinyColor.prototype.toPercentageRgb = function () {
var fmt = function (x) { return "".concat(Math.round((0, util_js_1.bound01)(x, 255) * 100), "%"); };
return {
r: fmt(this.r),
g: fmt(this.g),
b: fmt(this.b),
a: this.a,
};
};
/**
* Returns the RGBA relative values interpolated into a string
*/
TinyColor.prototype.toPercentageRgbString = function () {
var rnd = function (x) { return Math.round((0, util_js_1.bound01)(x, 255) * 100); };
return this.a === 1
? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)")
: "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
};
/**
* The 'real' name of the color -if there is one.
*/
TinyColor.prototype.toName = function () {
if (this.a === 0) {
return 'transparent';
}
if (this.a < 1) {
return false;
}
var hex = '#' + (0, conversion_js_1.rgbToHex)(this.r, this.g, this.b, false);
for (var _i = 0, _a = Object.entries(css_color_names_js_1.names); _i < _a.length; _i++) {
var _b = _a[_i], key = _b[0], value = _b[1];
if (hex === value) {
return key;
}
}
return false;
};
TinyColor.prototype.toString = function (format) {
var formatSet = Boolean(format);
format = format !== null && format !== void 0 ? format : this.format;
var formattedString = false;
var hasAlpha = this.a < 1 && this.a >= 0;
var needsAlphaFormat = !formatSet && hasAlpha && (format.startsWith('hex') || format === 'name');
if (needsAlphaFormat) {
// Special case for "transparent", all other non-alpha formats
// will return rgba when there is transparency.
if (format === 'name' && this.a === 0) {
return this.toName();
}
return this.toRgbString();
}
if (format === 'rgb') {
formattedString = this.toRgbString();
}
if (format === 'prgb') {
formattedString = this.toPercentageRgbString();
}
if (format === 'hex' || format === 'hex6') {
formattedString = this.toHexString();
}
if (format === 'hex3') {
formattedString = this.toHexString(true);
}
if (format === 'hex4') {
formattedString = this.toHex8String(true);
}
if (format === 'hex8') {
formattedString = this.toHex8String();
}
if (format === 'name') {
formattedString = this.toName();
}
if (format === 'hsl') {
formattedString = this.toHslString();
}
if (format === 'hsv') {
formattedString = this.toHsvString();
}
return formattedString || this.toHexString();
};
TinyColor.prototype.toNumber = function () {
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
};
TinyColor.prototype.clone = function () {
return new TinyColor(this.toString());
};
/**
* Lighten the color a given amount. Providing 100 will always return white.
* @param amount - valid between 1-100
*/
TinyColor.prototype.lighten = function (amount) {
if (amount === void 0) { amount = 10; }
var hsl = this.toHsl();
hsl.l += amount / 100;
hsl.l = (0, util_js_1.clamp01)(hsl.l);
return new TinyColor(hsl);
};
/**
* Brighten the color a given amount, from 0 to 100.
* @param amount - valid between 1-100
*/
TinyColor.prototype.brighten = function (amount) {
if (amount === void 0) { amount = 10; }
var rgb = this.toRgb();
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
return new TinyColor(rgb);
};
/**
* Darken the color a given amount, from 0 to 100.
* Providing 100 will always return black.
* @param amount - valid between 1-100
*/
TinyColor.prototype.darken = function (amount) {
if (amount === void 0) { amount = 10; }
var hsl = this.toHsl();
hsl.l -= amount / 100;
hsl.l = (0, util_js_1.clamp01)(hsl.l);
return new TinyColor(hsl);
};
/**
* Mix the color with pure white, from 0 to 100.
* Providing 0 will do nothing, providing 100 will always return white.
* @param amount - valid between 1-100
*/
TinyColor.prototype.tint = function (amount) {
if (amount === void 0) { amount = 10; }
return this.mix('white', amount);
};
/**
* Mix the color with pure black, from 0 to 100.
* Providing 0 will do nothing, providing 100 will always return black.
* @param amount - valid between 1-100
*/
TinyColor.prototype.shade = function (amount) {
if (amount === void 0) { amount = 10; }
return this.mix('black', amount);
};
/**
* Desaturate the color a given amount, from 0 to 100.
* Providing 100 will is the same as calling greyscale
* @param amount - valid between 1-100
*/
TinyColor.prototype.desaturate = function (amount) {
if (amount === void 0) { amount = 10; }
var hsl = this.toHsl();
hsl.s -= amount / 100;
hsl.s = (0, util_js_1.clamp01)(hsl.s);
return new TinyColor(hsl);
};
/**
* Saturate the color a given amount, from 0 to 100.
* @param amount - valid between 1-100
*/
TinyColor.prototype.saturate = function (amount) {
if (amount === void 0) { amount = 10; }
var hsl = this.toHsl();
hsl.s += amount / 100;
hsl.s = (0, util_js_1.clamp01)(hsl.s);
return new TinyColor(hsl);
};
/**
* Completely desaturates a color into greyscale.
* Same as calling `desaturate(100)`
*/
TinyColor.prototype.greyscale = function () {
return this.desaturate(100);
};
/**
* Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
* Values outside of this range will be wrapped into this range.
*/
TinyColor.prototype.spin = function (amount) {
var hsl = this.toHsl();
var hue = (hsl.h + amount) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return new TinyColor(hsl);
};
/**
* Mix the current color a given amount with another color, from 0 to 100.
* 0 means no mixing (return current color).
*/
TinyColor.prototype.mix = function (color, amount) {
if (amount === void 0) { amount = 50; }
var rgb1 = this.toRgb();
var rgb2 = new TinyColor(color).toRgb();
var p = amount / 100;
var rgba = {
r: (rgb2.r - rgb1.r) * p + rgb1.r,
g: (rgb2.g - rgb1.g) * p + rgb1.g,
b: (rgb2.b - rgb1.b) * p + rgb1.b,
a: (rgb2.a - rgb1.a) * p + rgb1.a,
};
return new TinyColor(rgba);
};
TinyColor.prototype.analogous = function (results, slices) {
if (results === void 0) { results = 6; }
if (slices === void 0) { slices = 30; }
var hsl = this.toHsl();
var part = 360 / slices;
var ret = [this];
for (hsl.h = (hsl.h - ((part * results) >> 1) + 720) % 360; --results;) {
hsl.h = (hsl.h + part) % 360;
ret.push(new TinyColor(hsl));
}
return ret;
};
/**
* taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
*/
TinyColor.prototype.complement = function () {
var hsl = this.toHsl();
hsl.h = (hsl.h + 180) % 360;
return new TinyColor(hsl);
};
TinyColor.prototype.monochromatic = function (results) {
if (results === void 0) { results = 6; }
var hsv = this.toHsv();
var h = hsv.h;
var s = hsv.s;
var v = hsv.v;
var res = [];
var modification = 1 / results;
while (results--) {
res.push(new TinyColor({ h: h, s: s, v: v }));
v = (v + modification) % 1;
}
return res;
};
TinyColor.prototype.splitcomplement = function () {
var hsl = this.toHsl();
var h = hsl.h;
return [
this,
new TinyColor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
new TinyColor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l }),
];
};
/**
* Compute how the color would appear on a background
*/
TinyColor.prototype.onBackground = function (background) {
var fg = this.toRgb();
var bg = new TinyColor(background).toRgb();
var alpha = fg.a + bg.a * (1 - fg.a);
return new TinyColor({
r: (fg.r * fg.a + bg.r * bg.a * (1 - fg.a)) / alpha,
g: (fg.g * fg.a + bg.g * bg.a * (1 - fg.a)) / alpha,
b: (fg.b * fg.a + bg.b * bg.a * (1 - fg.a)) / alpha,
a: alpha,
});
};
/**
* Alias for `polyad(3)`
*/
TinyColor.prototype.triad = function () {
return this.polyad(3);
};
/**
* Alias for `polyad(4)`
*/
TinyColor.prototype.tetrad = function () {
return this.polyad(4);
};
/**
* Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
* monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
*/
TinyColor.prototype.polyad = function (n) {
var hsl = this.toHsl();
var h = hsl.h;
var result = [this];
var increment = 360 / n;
for (var i = 1; i < n; i++) {
result.push(new TinyColor({ h: (h + i * increment) % 360, s: hsl.s, l: hsl.l }));
}
return result;
};
/**
* compare color vs current color
*/
TinyColor.prototype.equals = function (color) {
return this.toRgbString() === new TinyColor(color).toRgbString();
};
return TinyColor;
}());
exports.TinyColor = TinyColor;
// kept for backwards compatability with v1
function tinycolor(color, opts) {
if (color === void 0) { color = ''; }
if (opts === void 0) { opts = {}; }
return new TinyColor(color, opts);
}
exports.tinycolor = tinycolor;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,28 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
var index_js_1 = require("./index.js");
__exportStar(require("./index.js"), exports);
__exportStar(require("./css-color-names.js"), exports);
__exportStar(require("./readability.js"), exports);
__exportStar(require("./to-ms-filter.js"), exports);
__exportStar(require("./from-ratio.js"), exports);
__exportStar(require("./format-input.js"), exports);
__exportStar(require("./random.js"), exports);
__exportStar(require("./interfaces.js"), exports);
__exportStar(require("./conversion.js"), exports);
// kept for backwards compatability with v1
exports.default = index_js_1.tinycolor;

View File

@ -0,0 +1,282 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bounds = exports.random = void 0;
/* eslint-disable @typescript-eslint/no-redundant-type-constituents */
// randomColor by David Merfield under the CC0 license
// https://github.com/davidmerfield/randomColor/
var index_js_1 = require("./index.js");
function random(options) {
if (options === void 0) { options = {}; }
// Check if we need to generate multiple colors
if (options.count !== undefined &&
options.count !== null) {
var totalColors = options.count;
var colors = [];
options.count = undefined;
while (totalColors > colors.length) {
// Since we're generating multiple colors,
// incremement the seed. Otherwise we'd just
// generate the same color each time...
options.count = null;
if (options.seed) {
options.seed += 1;
}
colors.push(random(options));
}
options.count = totalColors;
return colors;
}
// First we pick a hue (H)
var h = pickHue(options.hue, options.seed);
// Then use H to determine saturation (S)
var s = pickSaturation(h, options);
// Then use S and H to determine brightness (B).
var v = pickBrightness(h, s, options);
var res = { h: h, s: s, v: v };
if (options.alpha !== undefined) {
res.a = options.alpha;
}
// Then we return the HSB color in the desired format
return new index_js_1.TinyColor(res);
}
exports.random = random;
function pickHue(hue, seed) {
var hueRange = getHueRange(hue);
var res = randomWithin(hueRange, seed);
// Instead of storing red as two seperate ranges,
// we group them, using negative numbers
if (res < 0) {
res = 360 + res;
}
return res;
}
function pickSaturation(hue, options) {
if (options.hue === 'monochrome') {
return 0;
}
if (options.luminosity === 'random') {
return randomWithin([0, 100], options.seed);
}
var saturationRange = getColorInfo(hue).saturationRange;
var sMin = saturationRange[0];
var sMax = saturationRange[1];
switch (options.luminosity) {
case 'bright':
sMin = 55;
break;
case 'dark':
sMin = sMax - 10;
break;
case 'light':
sMax = 55;
break;
default:
break;
}
return randomWithin([sMin, sMax], options.seed);
}
function pickBrightness(H, S, options) {
var bMin = getMinimumBrightness(H, S);
var bMax = 100;
switch (options.luminosity) {
case 'dark':
bMax = bMin + 20;
break;
case 'light':
bMin = (bMax + bMin) / 2;
break;
case 'random':
bMin = 0;
bMax = 100;
break;
default:
break;
}
return randomWithin([bMin, bMax], options.seed);
}
function getMinimumBrightness(H, S) {
var lowerBounds = getColorInfo(H).lowerBounds;
for (var i = 0; i < lowerBounds.length - 1; i++) {
var s1 = lowerBounds[i][0];
var v1 = lowerBounds[i][1];
var s2 = lowerBounds[i + 1][0];
var v2 = lowerBounds[i + 1][1];
if (S >= s1 && S <= s2) {
var m = (v2 - v1) / (s2 - s1);
var b = v1 - m * s1;
return m * S + b;
}
}
return 0;
}
function getHueRange(colorInput) {
var num = parseInt(colorInput, 10);
if (!Number.isNaN(num) && num < 360 && num > 0) {
return [num, num];
}
if (typeof colorInput === 'string') {
var namedColor = exports.bounds.find(function (n) { return n.name === colorInput; });
if (namedColor) {
var color = defineColor(namedColor);
if (color.hueRange) {
return color.hueRange;
}
}
var parsed = new index_js_1.TinyColor(colorInput);
if (parsed.isValid) {
var hue = parsed.toHsv().h;
return [hue, hue];
}
}
return [0, 360];
}
function getColorInfo(hue) {
// Maps red colors to make picking hue easier
if (hue >= 334 && hue <= 360) {
hue -= 360;
}
for (var _i = 0, bounds_1 = exports.bounds; _i < bounds_1.length; _i++) {
var bound = bounds_1[_i];
var color = defineColor(bound);
if (color.hueRange && hue >= color.hueRange[0] && hue <= color.hueRange[1]) {
return color;
}
}
throw Error('Color not found');
}
function randomWithin(range, seed) {
if (seed === undefined) {
return Math.floor(range[0] + Math.random() * (range[1] + 1 - range[0]));
}
// Seeded random algorithm from http://indiegamr.com/generate-repeatable-random-numbers-in-js/
var max = range[1] || 1;
var min = range[0] || 0;
seed = (seed * 9301 + 49297) % 233280;
var rnd = seed / 233280.0;
return Math.floor(min + rnd * (max - min));
}
function defineColor(bound) {
var sMin = bound.lowerBounds[0][0];
var sMax = bound.lowerBounds[bound.lowerBounds.length - 1][0];
var bMin = bound.lowerBounds[bound.lowerBounds.length - 1][1];
var bMax = bound.lowerBounds[0][1];
return {
name: bound.name,
hueRange: bound.hueRange,
lowerBounds: bound.lowerBounds,
saturationRange: [sMin, sMax],
brightnessRange: [bMin, bMax],
};
}
/**
* @hidden
*/
exports.bounds = [
{
name: 'monochrome',
hueRange: null,
lowerBounds: [
[0, 0],
[100, 0],
],
},
{
name: 'red',
hueRange: [-26, 18],
lowerBounds: [
[20, 100],
[30, 92],
[40, 89],
[50, 85],
[60, 78],
[70, 70],
[80, 60],
[90, 55],
[100, 50],
],
},
{
name: 'orange',
hueRange: [19, 46],
lowerBounds: [
[20, 100],
[30, 93],
[40, 88],
[50, 86],
[60, 85],
[70, 70],
[100, 70],
],
},
{
name: 'yellow',
hueRange: [47, 62],
lowerBounds: [
[25, 100],
[40, 94],
[50, 89],
[60, 86],
[70, 84],
[80, 82],
[90, 80],
[100, 75],
],
},
{
name: 'green',
hueRange: [63, 178],
lowerBounds: [
[30, 100],
[40, 90],
[50, 85],
[60, 81],
[70, 74],
[80, 64],
[90, 50],
[100, 40],
],
},
{
name: 'blue',
hueRange: [179, 257],
lowerBounds: [
[20, 100],
[30, 86],
[40, 80],
[50, 74],
[60, 60],
[70, 52],
[80, 44],
[90, 39],
[100, 35],
],
},
{
name: 'purple',
hueRange: [258, 282],
lowerBounds: [
[20, 100],
[30, 87],
[40, 79],
[50, 70],
[60, 65],
[70, 59],
[80, 52],
[90, 45],
[100, 42],
],
},
{
name: 'pink',
hueRange: [283, 334],
lowerBounds: [
[20, 100],
[30, 90],
[40, 86],
[60, 84],
[80, 80],
[90, 75],
[100, 73],
],
},
];

View File

@ -0,0 +1,86 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mostReadable = exports.isReadable = exports.readability = void 0;
var index_js_1 = require("./index.js");
// Readability Functions
// ---------------------
// <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2)
/**
* AKA `contrast`
*
* Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2)
*/
function readability(color1, color2) {
var c1 = new index_js_1.TinyColor(color1);
var c2 = new index_js_1.TinyColor(color2);
return ((Math.max(c1.getLuminance(), c2.getLuminance()) + 0.05) /
(Math.min(c1.getLuminance(), c2.getLuminance()) + 0.05));
}
exports.readability = readability;
/**
* Ensure that foreground and background color combinations meet WCAG2 guidelines.
* The third argument is an object.
* the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA';
* the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'.
* If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}.
*
* Example
* ```ts
* new TinyColor().isReadable('#000', '#111') => false
* new TinyColor().isReadable('#000', '#111', { level: 'AA', size: 'large' }) => false
* ```
*/
function isReadable(color1, color2, wcag2) {
var _a, _b;
if (wcag2 === void 0) { wcag2 = { level: 'AA', size: 'small' }; }
var readabilityLevel = readability(color1, color2);
switch (((_a = wcag2.level) !== null && _a !== void 0 ? _a : 'AA') + ((_b = wcag2.size) !== null && _b !== void 0 ? _b : 'small')) {
case 'AAsmall':
case 'AAAlarge':
return readabilityLevel >= 4.5;
case 'AAlarge':
return readabilityLevel >= 3;
case 'AAAsmall':
return readabilityLevel >= 7;
default:
return false;
}
}
exports.isReadable = isReadable;
/**
* Given a base color and a list of possible foreground or background
* colors for that base, returns the most readable color.
* Optionally returns Black or White if the most readable color is unreadable.
*
* @param baseColor - the base color.
* @param colorList - array of colors to pick the most readable one from.
* @param args - and object with extra arguments
*
* Example
* ```ts
* new TinyColor().mostReadable('#123', ['#124", "#125'], { includeFallbackColors: false }).toHexString(); // "#112255"
* new TinyColor().mostReadable('#123', ['#124", "#125'],{ includeFallbackColors: true }).toHexString(); // "#ffffff"
* new TinyColor().mostReadable('#a8015a', ["#faf3f3"], { includeFallbackColors:true, level: 'AAA', size: 'large' }).toHexString(); // "#faf3f3"
* new TinyColor().mostReadable('#a8015a', ["#faf3f3"], { includeFallbackColors:true, level: 'AAA', size: 'small' }).toHexString(); // "#ffffff"
* ```
*/
function mostReadable(baseColor, colorList, args) {
if (args === void 0) { args = { includeFallbackColors: false, level: 'AA', size: 'small' }; }
var bestColor = null;
var bestScore = 0;
var includeFallbackColors = args.includeFallbackColors, level = args.level, size = args.size;
for (var _i = 0, colorList_1 = colorList; _i < colorList_1.length; _i++) {
var color = colorList_1[_i];
var score = readability(baseColor, color);
if (score > bestScore) {
bestScore = score;
bestColor = new index_js_1.TinyColor(color);
}
}
if (isReadable(baseColor, bestColor, { level: level, size: size }) || !includeFallbackColors) {
return bestColor;
}
args.includeFallbackColors = false;
return mostReadable(baseColor, ['#fff', '#000'], args);
}
exports.mostReadable = mostReadable;

View File

@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toMsFilter = void 0;
var conversion_js_1 = require("./conversion.js");
var index_js_1 = require("./index.js");
/**
* Returns the color represented as a Microsoft filter for use in old versions of IE.
*/
function toMsFilter(firstColor, secondColor) {
var color = new index_js_1.TinyColor(firstColor);
var hex8String = '#' + (0, conversion_js_1.rgbaToArgbHex)(color.r, color.g, color.b, color.a);
var secondHex8String = hex8String;
var gradientType = color.gradientType ? 'GradientType = 1, ' : '';
if (secondColor) {
var s = new index_js_1.TinyColor(secondColor);
secondHex8String = '#' + (0, conversion_js_1.rgbaToArgbHex)(s.r, s.g, s.b, s.a);
}
return "progid:DXImageTransform.Microsoft.gradient(".concat(gradientType, "startColorstr=").concat(hex8String, ",endColorstr=").concat(secondHex8String, ")");
}
exports.toMsFilter = toMsFilter;

View File

@ -0,0 +1,92 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pad2 = exports.convertToPercentage = exports.boundAlpha = exports.isPercentage = exports.isOnePointZero = exports.clamp01 = exports.bound01 = void 0;
/**
* Take input from [0, n] and return it as [0, 1]
* @hidden
*/
function bound01(n, max) {
if (isOnePointZero(n)) {
n = '100%';
}
var isPercent = isPercentage(n);
n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
// Automatically convert percentage into number
if (isPercent) {
n = parseInt(String(n * max), 10) / 100;
}
// Handle floating point rounding errors
if (Math.abs(n - max) < 0.000001) {
return 1;
}
// Convert into [0, 1] range if it isn't already
if (max === 360) {
// If n is a hue given in degrees,
// wrap around out-of-range values into [0, 360] range
// then convert into [0, 1].
n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
}
else {
// If n not a hue given in degrees
// Convert into [0, 1] range if it isn't already.
n = (n % max) / parseFloat(String(max));
}
return n;
}
exports.bound01 = bound01;
/**
* Force a number between 0 and 1
* @hidden
*/
function clamp01(val) {
return Math.min(1, Math.max(0, val));
}
exports.clamp01 = clamp01;
/**
* Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
* <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
* @hidden
*/
function isOnePointZero(n) {
return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
}
exports.isOnePointZero = isOnePointZero;
/**
* Check to see if string passed in is a percentage
* @hidden
*/
function isPercentage(n) {
return typeof n === 'string' && n.indexOf('%') !== -1;
}
exports.isPercentage = isPercentage;
/**
* Return a valid alpha value [0,1] with all invalid values being set to 1
* @hidden
*/
function boundAlpha(a) {
a = parseFloat(a);
if (isNaN(a) || a < 0 || a > 1) {
a = 1;
}
return a;
}
exports.boundAlpha = boundAlpha;
/**
* Replace a decimal with it's percentage value
* @hidden
*/
function convertToPercentage(n) {
if (n <= 1) {
return "".concat(Number(n) * 100, "%");
}
return n;
}
exports.convertToPercentage = convertToPercentage;
/**
* Force a hex value to have 2 characters
* @hidden
*/
function pad2(c) {
return c.length === 1 ? '0' + c : String(c);
}
exports.pad2 = pad2;

View File

@ -0,0 +1,80 @@
{
"name": "@ctrl/tinycolor",
"version": "3.6.1",
"description": "Fast, small color manipulation and conversion for JavaScript",
"author": "Scott Cooper <scttcper@gmail.com>",
"publishConfig": {
"access": "public"
},
"license": "MIT",
"homepage": "https://tinycolor.vercel.app",
"repository": "scttcper/tinycolor",
"keywords": [
"typescript",
"color",
"manipulation",
"tinycolor",
"hsa",
"rgb"
],
"main": "dist/public_api.js",
"module": "dist/module/public_api.js",
"typings": "dist/public_api.d.ts",
"files": [
"dist"
],
"sideEffects": false,
"scripts": {
"build:demo": "rollup -c rollup.demo.js",
"watch:demo": "rollup -c rollup.demo.js -w",
"lint": "eslint --ext .js,.ts, .",
"lint:fix": "eslint --fix --ext .js,.ts, .",
"prepare": "npm run build",
"build": "del-cli dist && tsc -p tsconfig.build.json && tsc -p tsconfig.module.json && ts-node build",
"build:docs": "typedoc --out demo/public/docs --hideGenerator --tsconfig tsconfig.build.json src/public_api.ts",
"test": "jest",
"test:ci": "jest --ci --runInBand --reporters=default --reporters=jest-junit --coverage",
"test:watch": "jest --watch"
},
"dependencies": {},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "7.19.6",
"@babel/preset-typescript": "7.18.6",
"@ctrl/eslint-config": "3.5.6",
"@jest/globals": "29.3.1",
"@types/node": "18.11.11",
"del-cli": "5.0.0",
"jest": "29.3.1",
"jest-junit": "15.0.0",
"rollup": "2.70.1",
"rollup-plugin-livereload": "2.0.5",
"rollup-plugin-serve": "1.1.0",
"rollup-plugin-sourcemaps": "0.6.3",
"rollup-plugin-terser": "7.0.2",
"rollup-plugin-typescript2": "0.34.1",
"ts-node": "10.9.1",
"typedoc": "0.23.21",
"typescript": "4.9.3"
},
"jest": {
"testEnvironment": "node",
"coverageProvider": "v8",
"moduleNameMapper": {
"(.+)\\.js": "$1"
}
},
"babel": {
"presets": [
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-transform-modules-commonjs"
]
},
"release": {
"branch": "master"
},
"engines": {
"node": ">=10"
}
}

File diff suppressed because one or more lines are too long

126
.output/server/node_modules/@popperjs/core/package.json generated vendored Normal file

File diff suppressed because one or more lines are too long

133
.output/server/node_modules/@unhead/dom/dist/index.mjs generated vendored Normal file
View File

@ -0,0 +1,133 @@
import { HasElementTags, hashTag, normaliseProps, tagDedupeKey, defineHeadPlugin } from '@unhead/shared';
async function elementToTag($el) {
const tag = {
tag: $el.tagName.toLowerCase(),
props: await normaliseProps(
$el.getAttributeNames().reduce((props, name) => ({ ...props, [name]: $el.getAttribute(name) }), {})
),
innerHTML: $el.innerHTML
};
tag._d = tagDedupeKey(tag);
return tag;
}
async function renderDOMHead(head, options = {}) {
const dom = options.document || head.resolvedOptions.document;
if (!dom)
return;
const beforeRenderCtx = { shouldRender: head.dirty, tags: [] };
await head.hooks.callHook("dom:beforeRender", beforeRenderCtx);
if (!beforeRenderCtx.shouldRender)
return;
const tags = (await head.resolveTags()).map((tag) => ({
tag,
id: HasElementTags.includes(tag.tag) ? hashTag(tag) : tag.tag,
shouldRender: true
}));
let state = head._dom;
if (!state) {
state = {
elMap: { htmlAttrs: dom.documentElement, bodyAttrs: dom.body }
};
for (const key of ["body", "head"]) {
const children = dom?.[key]?.children;
for (const c of [...children].filter((c2) => HasElementTags.includes(c2.tagName.toLowerCase())))
state.elMap[c.getAttribute("data-hid") || hashTag(await elementToTag(c))] = c;
}
}
state.pendingSideEffects = { ...state.sideEffects || {} };
state.sideEffects = {};
function track(id, scope, fn) {
const k = `${id}:${scope}`;
state.sideEffects[k] = fn;
delete state.pendingSideEffects[k];
}
function trackCtx({ id, $el, tag }) {
const isAttrTag = tag.tag.endsWith("Attrs");
state.elMap[id] = $el;
if (!isAttrTag) {
["textContent", "innerHTML"].forEach((k) => {
tag[k] && tag[k] !== $el[k] && ($el[k] = tag[k]);
});
track(id, "el", () => {
state.elMap[id].remove();
delete state.elMap[id];
});
}
Object.entries(tag.props).forEach(([k, value]) => {
const ck = `attr:${k}`;
if (k === "class") {
for (const c of (value || "").split(" ").filter(Boolean)) {
isAttrTag && track(id, `${ck}:${c}`, () => $el.classList.remove(c));
!$el.classList.contains(c) && $el.classList.add(c);
}
} else {
$el.getAttribute(k) !== value && $el.setAttribute(k, value === true ? "" : String(value));
isAttrTag && track(id, ck, () => $el.removeAttribute(k));
}
});
}
const pending = [];
const frag = {
bodyClose: void 0,
bodyOpen: void 0,
head: void 0
};
for (const ctx of tags) {
const { tag, shouldRender, id } = ctx;
if (!shouldRender)
continue;
if (tag.tag === "title") {
dom.title = tag.textContent;
continue;
}
ctx.$el = ctx.$el || state.elMap[id];
if (ctx.$el)
trackCtx(ctx);
else
HasElementTags.includes(tag.tag) && pending.push(ctx);
}
for (const ctx of pending) {
const pos = ctx.tag.tagPosition || "head";
ctx.$el = dom.createElement(ctx.tag.tag);
trackCtx(ctx);
frag[pos] = frag[pos] || dom.createDocumentFragment();
frag[pos].appendChild(ctx.$el);
}
for (const ctx of tags)
await head.hooks.callHook("dom:renderTag", ctx, dom, track);
frag.head && dom.head.appendChild(frag.head);
frag.bodyOpen && dom.body.insertBefore(frag.bodyOpen, dom.body.firstChild);
frag.bodyClose && dom.body.appendChild(frag.bodyClose);
Object.values(state.pendingSideEffects).forEach((fn) => fn());
head._dom = state;
head.dirty = false;
await head.hooks.callHook("dom:rendered", { renders: tags });
}
async function debouncedRenderDOMHead(head, options = {}) {
const fn = options.delayFn || ((fn2) => setTimeout(fn2, 10));
return head._domUpdatePromise = head._domUpdatePromise || new Promise((resolve) => fn(async () => {
await renderDOMHead(head, options);
delete head._domUpdatePromise;
resolve();
}));
}
// @__NO_SIDE_EFFECTS__
function DomPlugin(options) {
return defineHeadPlugin((head) => {
const initialPayload = head.resolvedOptions.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML || false;
initialPayload && head.push(JSON.parse(initialPayload));
return {
mode: "client",
hooks: {
"entries:updated": function(head2) {
debouncedRenderDOMHead(head2, options);
}
}
};
});
}
export { DomPlugin, debouncedRenderDOMHead, renderDOMHead };

40
.output/server/node_modules/@unhead/dom/package.json generated vendored Normal file
View File

@ -0,0 +1,40 @@
{
"name": "@unhead/dom",
"type": "module",
"version": "1.8.9",
"author": "Harlan Wilton <harlan@harlanzw.com>",
"license": "MIT",
"funding": "https://github.com/sponsors/harlan-zw",
"homepage": "https://unhead.unjs.io",
"repository": {
"type": "git",
"url": "git+https://github.com/unjs/unhead.git",
"directory": "packages/dom"
},
"bugs": {
"url": "https://github.com/unjs/unhead/issues"
},
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@unhead/schema": "1.8.9",
"@unhead/shared": "1.8.9"
},
"scripts": {
"build": "unbuild .",
"stub": "unbuild . --stub",
"export:sizes": "npx export-size . -r"
}
}

View File

@ -0,0 +1,640 @@
function asArray$1(value) {
return Array.isArray(value) ? value : [value];
}
const SelfClosingTags = ["meta", "link", "base"];
const TagsWithInnerContent = ["title", "titleTemplate", "script", "style", "noscript"];
const HasElementTags = [
"base",
"meta",
"link",
"style",
"script",
"noscript"
];
const ValidHeadTags = [
"title",
"titleTemplate",
"templateParams",
"base",
"htmlAttrs",
"bodyAttrs",
"meta",
"link",
"style",
"script",
"noscript"
];
const UniqueTags = ["base", "title", "titleTemplate", "bodyAttrs", "htmlAttrs", "templateParams"];
const TagConfigKeys = ["tagPosition", "tagPriority", "tagDuplicateStrategy", "children", "innerHTML", "textContent", "processTemplateParams"];
const IsBrowser = typeof window !== "undefined";
const composableNames = [
"getActiveHead",
"useHead",
"useSeoMeta",
"useHeadSafe",
"useServerHead",
"useServerSeoMeta",
"useServerHeadSafe"
];
function defineHeadPlugin(plugin) {
return plugin;
}
function hashCode(s) {
let h = 9;
for (let i = 0; i < s.length; )
h = Math.imul(h ^ s.charCodeAt(i++), 9 ** 9);
return ((h ^ h >>> 9) + 65536).toString(16).substring(1, 8).toLowerCase();
}
function hashTag(tag) {
return tag._h || hashCode(tag._d ? tag._d : `${tag.tag}:${tag.textContent || tag.innerHTML || ""}:${Object.entries(tag.props).map(([key, value]) => `${key}:${String(value)}`).join(",")}`);
}
function tagDedupeKey(tag, fn) {
const { props, tag: tagName } = tag;
if (UniqueTags.includes(tagName))
return tagName;
if (tagName === "link" && props.rel === "canonical")
return "canonical";
if (props.charset)
return "charset";
const name = ["id"];
if (tagName === "meta")
name.push(...["name", "property", "http-equiv"]);
for (const n of name) {
if (typeof props[n] !== "undefined") {
const val = String(props[n]);
if (fn && !fn(val))
return false;
return `${tagName}:${n}:${val}`;
}
}
return false;
}
function resolveTitleTemplate(template, title) {
if (template == null)
return title || null;
if (typeof template === "function")
return template(title);
return template;
}
function asArray(input) {
return Array.isArray(input) ? input : [input];
}
const InternalKeySymbol = "_$key";
function packObject(input, options) {
const keys = Object.keys(input);
let [k, v] = keys;
options = options || {};
options.key = options.key || k;
options.value = options.value || v;
options.resolveKey = options.resolveKey || ((k2) => k2);
const resolveKey = (index) => {
const arr = asArray(options?.[index]);
return arr.find((k2) => {
if (typeof k2 === "string" && k2.includes(".")) {
return k2;
}
return k2 && keys.includes(k2);
});
};
const resolveValue = (k2, input2) => {
if (k2.includes(".")) {
const paths = k2.split(".");
let val = input2;
for (const path of paths)
val = val[path];
return val;
}
return input2[k2];
};
k = resolveKey("key") || k;
v = resolveKey("value") || v;
const dedupeKeyPrefix = input.key ? `${InternalKeySymbol}${input.key}-` : "";
let keyValue = resolveValue(k, input);
keyValue = options.resolveKey(keyValue);
return {
[`${dedupeKeyPrefix}${keyValue}`]: resolveValue(v, input)
};
}
function packArray(input, options) {
const packed = {};
for (const i of input) {
const packedObj = packObject(i, options);
const pKey = Object.keys(packedObj)[0];
const isDedupeKey = pKey.startsWith(InternalKeySymbol);
if (!isDedupeKey && packed[pKey]) {
packed[pKey] = Array.isArray(packed[pKey]) ? packed[pKey] : [packed[pKey]];
packed[pKey].push(Object.values(packedObj)[0]);
} else {
packed[isDedupeKey ? pKey.split("-").slice(1).join("-") || pKey : pKey] = packedObj[pKey];
}
}
return packed;
}
function unpackToArray(input, options) {
const unpacked = [];
const kFn = options.resolveKeyData || ((ctx) => ctx.key);
const vFn = options.resolveValueData || ((ctx) => ctx.value);
for (const [k, v] of Object.entries(input)) {
unpacked.push(...(Array.isArray(v) ? v : [v]).map((i) => {
const ctx = { key: k, value: i };
const val = vFn(ctx);
if (typeof val === "object")
return unpackToArray(val, options);
if (Array.isArray(val))
return val;
return {
[typeof options.key === "function" ? options.key(ctx) : options.key]: kFn(ctx),
[typeof options.value === "function" ? options.value(ctx) : options.value]: val
};
}).flat());
}
return unpacked;
}
function unpackToString(value, options) {
return Object.entries(value).map(([key, value2]) => {
if (typeof value2 === "object")
value2 = unpackToString(value2, options);
if (options.resolve) {
const resolved = options.resolve({ key, value: value2 });
if (resolved)
return resolved;
}
if (typeof value2 === "number")
value2 = value2.toString();
if (typeof value2 === "string" && options.wrapValue) {
value2 = value2.replace(new RegExp(options.wrapValue, "g"), `\\${options.wrapValue}`);
value2 = `${options.wrapValue}${value2}${options.wrapValue}`;
}
return `${key}${options.keyValueSeparator || ""}${value2}`;
}).join(options.entrySeparator || "");
}
const p = (p2) => ({ keyValue: p2, metaKey: "property" });
const k = (p2) => ({ keyValue: p2 });
const MetaPackingSchema = {
appleItunesApp: {
unpack: {
entrySeparator: ", ",
resolve({ key, value }) {
return `${fixKeyCase(key)}=${value}`;
}
}
},
articleExpirationTime: p("article:expiration_time"),
articleModifiedTime: p("article:modified_time"),
articlePublishedTime: p("article:published_time"),
bookReleaseDate: p("book:release_date"),
charset: {
metaKey: "charset"
},
contentSecurityPolicy: {
unpack: {
entrySeparator: "; ",
resolve({ key, value }) {
return `${fixKeyCase(key)} ${value}`;
}
},
metaKey: "http-equiv"
},
contentType: {
metaKey: "http-equiv"
},
defaultStyle: {
metaKey: "http-equiv"
},
fbAppId: p("fb:app_id"),
msapplicationConfig: k("msapplication-Config"),
msapplicationTileColor: k("msapplication-TileColor"),
msapplicationTileImage: k("msapplication-TileImage"),
ogAudioSecureUrl: p("og:audio:secure_url"),
ogAudioUrl: p("og:audio"),
ogImageSecureUrl: p("og:image:secure_url"),
ogImageUrl: p("og:image"),
ogSiteName: p("og:site_name"),
ogVideoSecureUrl: p("og:video:secure_url"),
ogVideoUrl: p("og:video"),
profileFirstName: p("profile:first_name"),
profileLastName: p("profile:last_name"),
profileUsername: p("profile:username"),
refresh: {
metaKey: "http-equiv",
unpack: {
entrySeparator: ";",
resolve({ key, value }) {
if (key === "seconds")
return `${value}`;
}
}
},
robots: {
unpack: {
entrySeparator: ", ",
resolve({ key, value }) {
if (typeof value === "boolean")
return `${fixKeyCase(key)}`;
else
return `${fixKeyCase(key)}:${value}`;
}
}
},
xUaCompatible: {
metaKey: "http-equiv"
}
};
const openGraphNamespaces = [
"og",
"book",
"article",
"profile"
];
function resolveMetaKeyType(key) {
const fKey = fixKeyCase(key).split(":")[0];
if (openGraphNamespaces.includes(fKey))
return "property";
return MetaPackingSchema[key]?.metaKey || "name";
}
function resolveMetaKeyValue(key) {
return MetaPackingSchema[key]?.keyValue || fixKeyCase(key);
}
function fixKeyCase(key) {
const updated = key.replace(/([A-Z])/g, "-$1").toLowerCase();
const fKey = updated.split("-")[0];
if (openGraphNamespaces.includes(fKey) || fKey === "twitter")
return key.replace(/([A-Z])/g, ":$1").toLowerCase();
return updated;
}
function changeKeyCasingDeep(input) {
if (Array.isArray(input)) {
return input.map((entry) => changeKeyCasingDeep(entry));
}
if (typeof input !== "object" || Array.isArray(input))
return input;
const output = {};
for (const [key, value] of Object.entries(input))
output[fixKeyCase(key)] = changeKeyCasingDeep(value);
return output;
}
function resolvePackedMetaObjectValue(value, key) {
const definition = MetaPackingSchema[key];
if (key === "refresh")
return `${value.seconds};url=${value.url}`;
return unpackToString(
changeKeyCasingDeep(value),
{
keyValueSeparator: "=",
entrySeparator: ", ",
resolve({ value: value2, key: key2 }) {
if (value2 === null)
return "";
if (typeof value2 === "boolean")
return `${key2}`;
},
...definition?.unpack
}
);
}
const ObjectArrayEntries = ["og:image", "og:video", "og:audio", "twitter:image"];
function sanitize(input) {
const out = {};
Object.entries(input).forEach(([k2, v]) => {
if (String(v) !== "false" && k2)
out[k2] = v;
});
return out;
}
function handleObjectEntry(key, v) {
const value = sanitize(v);
const fKey = fixKeyCase(key);
const attr = resolveMetaKeyType(fKey);
if (ObjectArrayEntries.includes(fKey)) {
const input = {};
Object.entries(value).forEach(([k2, v2]) => {
input[`${key}${k2 === "url" ? "" : `${k2.charAt(0).toUpperCase()}${k2.slice(1)}`}`] = v2;
});
return unpackMeta(input).sort((a, b) => (a[attr]?.length || 0) - (b[attr]?.length || 0));
}
return [{ [attr]: fKey, ...value }];
}
function unpackMeta(input) {
const extras = [];
const primitives = {};
Object.entries(input).forEach(([key, value]) => {
if (!Array.isArray(value)) {
if (typeof value === "object" && value) {
if (ObjectArrayEntries.includes(fixKeyCase(key))) {
extras.push(...handleObjectEntry(key, value));
return;
}
primitives[key] = sanitize(value);
} else {
primitives[key] = value;
}
return;
}
value.forEach((v) => {
extras.push(...typeof v === "string" ? unpackMeta({ [key]: v }) : handleObjectEntry(key, v));
});
});
const meta = unpackToArray(primitives, {
key({ key }) {
return resolveMetaKeyType(key);
},
value({ key }) {
return key === "charset" ? "charset" : "content";
},
resolveKeyData({ key }) {
return resolveMetaKeyValue(key);
},
resolveValueData({ value, key }) {
if (value === null)
return "_null";
if (typeof value === "object")
return resolvePackedMetaObjectValue(value, key);
return typeof value === "number" ? value.toString() : value;
}
});
return [...extras, ...meta].map((m) => {
if (m.content === "_null")
m.content = null;
return m;
});
}
function packMeta(inputs) {
const mappedPackingSchema = Object.entries(MetaPackingSchema).map(([key, value]) => [key, value.keyValue]);
return packArray(inputs, {
key: ["name", "property", "httpEquiv", "http-equiv", "charset"],
value: ["content", "charset"],
resolveKey(k2) {
let key = mappedPackingSchema.filter((sk) => sk[1] === k2)?.[0]?.[0] || k2;
const replacer = (_, letter) => letter?.toUpperCase();
key = key.replace(/:([a-z])/g, replacer).replace(/-([a-z])/g, replacer);
return key;
}
});
}
const WhitelistAttributes = {
htmlAttrs: ["id", "class", "lang", "dir"],
bodyAttrs: ["id", "class"],
meta: ["id", "name", "property", "charset", "content"],
noscript: ["id", "textContent"],
script: ["id", "type", "textContent"],
link: ["id", "color", "crossorigin", "fetchpriority", "href", "hreflang", "imagesrcset", "imagesizes", "integrity", "media", "referrerpolicy", "rel", "sizes", "type"]
};
function acceptDataAttrs(value) {
const filtered = {};
Object.keys(value || {}).filter((a) => a.startsWith("data-")).forEach((a) => {
filtered[a] = value[a];
});
return filtered;
}
function whitelistSafeInput(input) {
const filtered = {};
Object.keys(input).forEach((key) => {
const tagValue = input[key];
if (!tagValue)
return;
switch (key) {
case "title":
case "titleTemplate":
case "templateParams":
filtered[key] = tagValue;
break;
case "htmlAttrs":
case "bodyAttrs":
filtered[key] = acceptDataAttrs(tagValue);
WhitelistAttributes[key].forEach((a) => {
if (tagValue[a])
filtered[key][a] = tagValue[a];
});
break;
case "meta":
if (Array.isArray(tagValue)) {
filtered[key] = tagValue.map((meta) => {
const safeMeta = acceptDataAttrs(meta);
WhitelistAttributes.meta.forEach((key2) => {
if (meta[key2])
safeMeta[key2] = meta[key2];
});
return safeMeta;
}).filter((meta) => Object.keys(meta).length > 0);
}
break;
case "link":
if (Array.isArray(tagValue)) {
filtered[key] = tagValue.map((meta) => {
const link = acceptDataAttrs(meta);
WhitelistAttributes.link.forEach((key2) => {
const val = meta[key2];
if (key2 === "rel" && ["stylesheet", "canonical", "modulepreload", "prerender", "preload", "prefetch"].includes(val))
return;
if (key2 === "href") {
if (val.includes("javascript:") || val.includes("data:"))
return;
link[key2] = val;
} else if (val) {
link[key2] = val;
}
});
return link;
}).filter((link) => Object.keys(link).length > 1 && !!link.rel);
}
break;
case "noscript":
if (Array.isArray(tagValue)) {
filtered[key] = tagValue.map((meta) => {
const noscript = acceptDataAttrs(meta);
WhitelistAttributes.noscript.forEach((key2) => {
if (meta[key2])
noscript[key2] = meta[key2];
});
return noscript;
}).filter((meta) => Object.keys(meta).length > 0);
}
break;
case "script":
if (Array.isArray(tagValue)) {
filtered[key] = tagValue.map((script) => {
const safeScript = acceptDataAttrs(script);
WhitelistAttributes.script.forEach((s) => {
if (script[s]) {
if (s === "textContent") {
try {
const jsonVal = typeof script[s] === "string" ? JSON.parse(script[s]) : script[s];
safeScript[s] = JSON.stringify(jsonVal, null, 0);
} catch (e) {
}
} else {
safeScript[s] = script[s];
}
}
});
return safeScript;
}).filter((meta) => Object.keys(meta).length > 0);
}
break;
}
});
return filtered;
}
async function normaliseTag(tagName, input, e) {
const tag = {
tag: tagName,
props: await normaliseProps(
// explicitly check for an object
// @ts-expect-error untyped
typeof input === "object" && typeof input !== "function" && !(input instanceof Promise) ? { ...input } : { [["script", "noscript", "style"].includes(tagName) ? "innerHTML" : "textContent"]: input },
["templateParams", "titleTemplate"].includes(tagName)
)
};
TagConfigKeys.forEach((k) => {
const val = typeof tag.props[k] !== "undefined" ? tag.props[k] : e[k];
if (typeof val !== "undefined") {
if (!["innerHTML", "textContent", "children"].includes(k) || TagsWithInnerContent.includes(tag.tag)) {
tag[k === "children" ? "innerHTML" : k] = val;
}
delete tag.props[k];
}
});
if (tag.props.body) {
tag.tagPosition = "bodyClose";
delete tag.props.body;
}
if (tag.tag === "script") {
if (typeof tag.innerHTML === "object") {
tag.innerHTML = JSON.stringify(tag.innerHTML);
tag.props.type = tag.props.type || "application/json";
}
}
return Array.isArray(tag.props.content) ? tag.props.content.map((v) => ({ ...tag, props: { ...tag.props, content: v } })) : tag;
}
function normaliseClassProp(v) {
if (typeof v === "object" && !Array.isArray(v)) {
v = Object.keys(v).filter((k) => v[k]);
}
return (Array.isArray(v) ? v.join(" ") : v).split(" ").filter((c) => c.trim()).filter(Boolean).join(" ");
}
async function normaliseProps(props, virtual) {
for (const k of Object.keys(props)) {
if (k === "class") {
props[k] = normaliseClassProp(props[k]);
continue;
}
if (props[k] instanceof Promise)
props[k] = await props[k];
if (!virtual && !TagConfigKeys.includes(k)) {
const v = String(props[k]);
const isDataKey = k.startsWith("data-");
if (v === "true" || v === "") {
props[k] = isDataKey ? "true" : true;
} else if (!props[k]) {
if (isDataKey && v === "false")
props[k] = "false";
else
delete props[k];
}
}
}
return props;
}
const TagEntityBits = 10;
async function normaliseEntryTags(e) {
const tagPromises = [];
Object.entries(e.resolvedInput).filter(([k, v]) => typeof v !== "undefined" && ValidHeadTags.includes(k)).forEach(([k, value]) => {
const v = asArray$1(value);
tagPromises.push(...v.map((props) => normaliseTag(k, props, e)).flat());
});
return (await Promise.all(tagPromises)).flat().filter(Boolean).map((t, i) => {
t._e = e._i;
e.mode && (t._m = e.mode);
t._p = (e._i << TagEntityBits) + i;
return t;
});
}
const TAG_WEIGHTS = {
// tags
base: -10,
title: 10
};
const TAG_ALIASES = {
// relative scores to their default values
critical: -80,
high: -10,
low: 20
};
function tagWeight(tag) {
let weight = 100;
const priority = tag.tagPriority;
if (typeof priority === "number")
return priority;
if (tag.tag === "meta") {
if (tag.props["http-equiv"] === "content-security-policy")
weight = -30;
if (tag.props.charset)
weight = -20;
if (tag.props.name === "viewport")
weight = -15;
} else if (tag.tag === "link" && tag.props.rel === "preconnect") {
weight = 20;
} else if (tag.tag in TAG_WEIGHTS) {
weight = TAG_WEIGHTS[tag.tag];
}
if (typeof priority === "string" && priority in TAG_ALIASES) {
return weight + TAG_ALIASES[priority];
}
return weight;
}
const SortModifiers = [{ prefix: "before:", offset: -1 }, { prefix: "after:", offset: 1 }];
const NetworkEvents = ["onload", "onerror", "onabort", "onprogress", "onloadstart"];
const sepSub = "%separator";
function processTemplateParams(s, p, sep) {
if (typeof s !== "string" || !s.includes("%"))
return s;
function sub(token) {
let val;
if (["s", "pageTitle"].includes(token)) {
val = p.pageTitle;
} else if (token.includes(".")) {
val = token.split(".").reduce((acc, key) => acc ? acc[key] || void 0 : void 0, p);
} else {
val = p[token];
}
return typeof val !== "undefined" ? (val || "").replace(/"/g, '\\"') : false;
}
let decoded = s;
try {
decoded = decodeURI(s);
} catch {
}
const tokens = (decoded.match(/%(\w+\.+\w+)|%(\w+)/g) || []).sort().reverse();
tokens.forEach((token) => {
const re = sub(token.slice(1));
if (typeof re === "string") {
s = s.replace(new RegExp(`\\${token}(\\W|$)`, "g"), (_, args) => `${re}${args}`).trim();
}
});
if (s.includes(sepSub)) {
if (s.endsWith(sepSub))
s = s.slice(0, -sepSub.length).trim();
if (s.startsWith(sepSub))
s = s.slice(sepSub.length).trim();
s = s.replace(new RegExp(`\\${sepSub}\\s*\\${sepSub}`, "g"), sepSub);
s = processTemplateParams(s, { separator: sep }, sep);
}
return s;
}
export { HasElementTags, IsBrowser, NetworkEvents, SelfClosingTags, SortModifiers, TAG_ALIASES, TAG_WEIGHTS, TagConfigKeys, TagEntityBits, TagsWithInnerContent, UniqueTags, ValidHeadTags, asArray$1 as asArray, composableNames, defineHeadPlugin, hashCode, hashTag, normaliseClassProp, normaliseEntryTags, normaliseProps, normaliseTag, packMeta, processTemplateParams, resolveMetaKeyType, resolveMetaKeyValue, resolvePackedMetaObjectValue, resolveTitleTemplate, tagDedupeKey, tagWeight, unpackMeta, whitelistSafeInput };

View File

@ -0,0 +1,47 @@
{
"name": "@unhead/shared",
"type": "module",
"version": "1.8.9",
"author": "Harlan Wilton <harlan@harlanzw.com>",
"license": "MIT",
"funding": "https://github.com/sponsors/harlan-zw",
"homepage": "https://unhead.unjs.io",
"repository": {
"type": "git",
"url": "git+https://github.com/unjs/unhead.git",
"directory": "packages/schema"
},
"bugs": {
"url": "https://github.com/unjs/unhead/issues"
},
"keywords": [
"head",
"meta tags",
"types"
],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@unhead/schema": "1.8.9"
},
"devDependencies": {
"packrup": "^0.1.0"
},
"scripts": {
"build": "unbuild .",
"stub": "unbuild . --stub",
"export:sizes": "npx export-size . -r"
}
}

84
.output/server/node_modules/@unhead/ssr/dist/index.mjs generated vendored Normal file
View File

@ -0,0 +1,84 @@
import { TagsWithInnerContent, SelfClosingTags } from '@unhead/shared';
function encodeAttribute(value) {
return String(value).replace(/"/g, "&quot;");
}
function propsToString(props) {
const attrs = [];
for (const [key, value] of Object.entries(props)) {
if (value !== false && value !== null)
attrs.push(value === true ? key : `${key}="${encodeAttribute(value)}"`);
}
return `${attrs.length > 0 ? " " : ""}${attrs.join(" ")}`;
}
function escapeHtml(str) {
return str.replace(/[&<>"'/]/g, (char) => {
switch (char) {
case "&":
return "&amp;";
case "<":
return "&lt;";
case ">":
return "&gt;";
case '"':
return "&quot;";
case "'":
return "&#x27;";
case "/":
return "&#x2F;";
default:
return char;
}
});
}
function tagToString(tag) {
const attrs = propsToString(tag.props);
const openTag = `<${tag.tag}${attrs}>`;
if (!TagsWithInnerContent.includes(tag.tag))
return SelfClosingTags.includes(tag.tag) ? openTag : `${openTag}</${tag.tag}>`;
let content = String(tag.innerHTML || "");
if (tag.textContent)
content = escapeHtml(String(tag.textContent));
return SelfClosingTags.includes(tag.tag) ? openTag : `${openTag}${content}</${tag.tag}>`;
}
function ssrRenderTags(tags) {
const schema = { htmlAttrs: {}, bodyAttrs: {}, tags: { head: [], bodyClose: [], bodyOpen: [] } };
for (const tag of tags) {
if (tag.tag === "htmlAttrs" || tag.tag === "bodyAttrs") {
schema[tag.tag] = { ...schema[tag.tag], ...tag.props };
continue;
}
schema.tags[tag.tagPosition || "head"].push(tagToString(tag));
}
return {
headTags: schema.tags.head.join("\n"),
bodyTags: schema.tags.bodyClose.join("\n"),
bodyTagsOpen: schema.tags.bodyOpen.join("\n"),
htmlAttrs: propsToString(schema.htmlAttrs),
bodyAttrs: propsToString(schema.bodyAttrs)
};
}
async function renderSSRHead(head) {
const beforeRenderCtx = { shouldRender: true };
await head.hooks.callHook("ssr:beforeRender", beforeRenderCtx);
if (!beforeRenderCtx.shouldRender) {
return {
headTags: "",
bodyTags: "",
bodyTagsOpen: "",
htmlAttrs: "",
bodyAttrs: ""
};
}
const ctx = { tags: await head.resolveTags() };
await head.hooks.callHook("ssr:render", ctx);
const html = ssrRenderTags(ctx.tags);
const renderCtx = { tags: ctx.tags, html };
await head.hooks.callHook("ssr:rendered", renderCtx);
return renderCtx.html;
}
export { escapeHtml, propsToString, renderSSRHead, ssrRenderTags, tagToString };

40
.output/server/node_modules/@unhead/ssr/package.json generated vendored Normal file
View File

@ -0,0 +1,40 @@
{
"name": "@unhead/ssr",
"type": "module",
"version": "1.8.9",
"author": "Harlan Wilton <harlan@harlanzw.com>",
"license": "MIT",
"funding": "https://github.com/sponsors/harlan-zw",
"homepage": "https://unhead.unjs.io",
"repository": {
"type": "git",
"url": "git+https://github.com/unjs/unhead.git",
"directory": "packages/ssr"
},
"bugs": {
"url": "https://github.com/unjs/unhead/issues"
},
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "dist/index.cjs",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@unhead/schema": "1.8.9",
"@unhead/shared": "1.8.9"
},
"scripts": {
"build": "unbuild .",
"stub": "unbuild . --stub",
"export:sizes": "npx export-size . -r"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,57 @@
{
"name": "@vue/compiler-core",
"version": "3.4.5",
"description": "@vue/compiler-core",
"main": "index.js",
"module": "dist/compiler-core.esm-bundler.js",
"types": "dist/compiler-core.d.ts",
"files": [
"index.js",
"dist"
],
"exports": {
".": {
"types": "./dist/compiler-core.d.ts",
"node": {
"production": "./dist/compiler-core.cjs.prod.js",
"development": "./dist/compiler-core.cjs.js",
"default": "./dist/compiler-core.cjs.prod.js"
},
"import": "./dist/compiler-core.esm-bundler.js",
"require": "./index.js"
},
"./*": "./*"
},
"buildOptions": {
"name": "VueCompilerCore",
"compat": true,
"formats": [
"esm-bundler",
"cjs"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core.git",
"directory": "packages/compiler-core"
},
"keywords": [
"vue"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/core/issues"
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-core#readme",
"dependencies": {
"@babel/parser": "^7.23.6",
"entities": "^4.5.0",
"estree-walker": "^2.0.2",
"source-map-js": "^1.0.2",
"@vue/shared": "3.4.5"
},
"devDependencies": {
"@babel/types": "^7.23.6"
}
}

View File

@ -0,0 +1,652 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var compilerCore = require('@vue/compiler-core');
var shared = require('@vue/shared');
const V_MODEL_RADIO = Symbol(``);
const V_MODEL_CHECKBOX = Symbol(``);
const V_MODEL_TEXT = Symbol(``);
const V_MODEL_SELECT = Symbol(``);
const V_MODEL_DYNAMIC = Symbol(``);
const V_ON_WITH_MODIFIERS = Symbol(``);
const V_ON_WITH_KEYS = Symbol(``);
const V_SHOW = Symbol(``);
const TRANSITION = Symbol(``);
const TRANSITION_GROUP = Symbol(``);
compilerCore.registerRuntimeHelpers({
[V_MODEL_RADIO]: `vModelRadio`,
[V_MODEL_CHECKBOX]: `vModelCheckbox`,
[V_MODEL_TEXT]: `vModelText`,
[V_MODEL_SELECT]: `vModelSelect`,
[V_MODEL_DYNAMIC]: `vModelDynamic`,
[V_ON_WITH_MODIFIERS]: `withModifiers`,
[V_ON_WITH_KEYS]: `withKeys`,
[V_SHOW]: `vShow`,
[TRANSITION]: `Transition`,
[TRANSITION_GROUP]: `TransitionGroup`
});
const parserOptions = {
parseMode: "html",
isVoidTag: shared.isVoidTag,
isNativeTag: (tag) => shared.isHTMLTag(tag) || shared.isSVGTag(tag) || shared.isMathMLTag(tag),
isPreTag: (tag) => tag === "pre",
decodeEntities: void 0,
isBuiltInComponent: (tag) => {
if (tag === "Transition" || tag === "transition") {
return TRANSITION;
} else if (tag === "TransitionGroup" || tag === "transition-group") {
return TRANSITION_GROUP;
}
},
// https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
getNamespace(tag, parent, rootNamespace) {
let ns = parent ? parent.ns : rootNamespace;
if (parent && ns === 2) {
if (parent.tag === "annotation-xml") {
if (tag === "svg") {
return 1;
}
if (parent.props.some(
(a) => a.type === 6 && a.name === "encoding" && a.value != null && (a.value.content === "text/html" || a.value.content === "application/xhtml+xml")
)) {
ns = 0;
}
} else if (/^m(?:[ions]|text)$/.test(parent.tag) && tag !== "mglyph" && tag !== "malignmark") {
ns = 0;
}
} else if (parent && ns === 1) {
if (parent.tag === "foreignObject" || parent.tag === "desc" || parent.tag === "title") {
ns = 0;
}
}
if (ns === 0) {
if (tag === "svg") {
return 1;
}
if (tag === "math") {
return 2;
}
}
return ns;
}
};
const transformStyle = (node) => {
if (node.type === 1) {
node.props.forEach((p, i) => {
if (p.type === 6 && p.name === "style" && p.value) {
node.props[i] = {
type: 7,
name: `bind`,
arg: compilerCore.createSimpleExpression(`style`, true, p.loc),
exp: parseInlineCSS(p.value.content, p.loc),
modifiers: [],
loc: p.loc
};
}
});
}
};
const parseInlineCSS = (cssText, loc) => {
const normalized = shared.parseStringStyle(cssText);
return compilerCore.createSimpleExpression(
JSON.stringify(normalized),
false,
loc,
3
);
};
function createDOMCompilerError(code, loc) {
return compilerCore.createCompilerError(
code,
loc,
DOMErrorMessages
);
}
const DOMErrorCodes = {
"X_V_HTML_NO_EXPRESSION": 53,
"53": "X_V_HTML_NO_EXPRESSION",
"X_V_HTML_WITH_CHILDREN": 54,
"54": "X_V_HTML_WITH_CHILDREN",
"X_V_TEXT_NO_EXPRESSION": 55,
"55": "X_V_TEXT_NO_EXPRESSION",
"X_V_TEXT_WITH_CHILDREN": 56,
"56": "X_V_TEXT_WITH_CHILDREN",
"X_V_MODEL_ON_INVALID_ELEMENT": 57,
"57": "X_V_MODEL_ON_INVALID_ELEMENT",
"X_V_MODEL_ARG_ON_ELEMENT": 58,
"58": "X_V_MODEL_ARG_ON_ELEMENT",
"X_V_MODEL_ON_FILE_INPUT_ELEMENT": 59,
"59": "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
"X_V_MODEL_UNNECESSARY_VALUE": 60,
"60": "X_V_MODEL_UNNECESSARY_VALUE",
"X_V_SHOW_NO_EXPRESSION": 61,
"61": "X_V_SHOW_NO_EXPRESSION",
"X_TRANSITION_INVALID_CHILDREN": 62,
"62": "X_TRANSITION_INVALID_CHILDREN",
"X_IGNORED_SIDE_EFFECT_TAG": 63,
"63": "X_IGNORED_SIDE_EFFECT_TAG",
"__EXTEND_POINT__": 64,
"64": "__EXTEND_POINT__"
};
const DOMErrorMessages = {
[53]: `v-html is missing expression.`,
[54]: `v-html will override element children.`,
[55]: `v-text is missing expression.`,
[56]: `v-text will override element children.`,
[57]: `v-model can only be used on <input>, <textarea> and <select> elements.`,
[58]: `v-model argument is not supported on plain elements.`,
[59]: `v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.`,
[60]: `Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.`,
[61]: `v-show is missing expression.`,
[62]: `<Transition> expects exactly one child element or component.`,
[63]: `Tags with side effect (<script> and <style>) are ignored in client component templates.`
};
const transformVHtml = (dir, node, context) => {
const { exp, loc } = dir;
if (!exp) {
context.onError(
createDOMCompilerError(53, loc)
);
}
if (node.children.length) {
context.onError(
createDOMCompilerError(54, loc)
);
node.children.length = 0;
}
return {
props: [
compilerCore.createObjectProperty(
compilerCore.createSimpleExpression(`innerHTML`, true, loc),
exp || compilerCore.createSimpleExpression("", true)
)
]
};
};
const transformVText = (dir, node, context) => {
const { exp, loc } = dir;
if (!exp) {
context.onError(
createDOMCompilerError(55, loc)
);
}
if (node.children.length) {
context.onError(
createDOMCompilerError(56, loc)
);
node.children.length = 0;
}
return {
props: [
compilerCore.createObjectProperty(
compilerCore.createSimpleExpression(`textContent`, true),
exp ? compilerCore.getConstantType(exp, context) > 0 ? exp : compilerCore.createCallExpression(
context.helperString(compilerCore.TO_DISPLAY_STRING),
[exp],
loc
) : compilerCore.createSimpleExpression("", true)
)
]
};
};
const transformModel = (dir, node, context) => {
const baseResult = compilerCore.transformModel(dir, node, context);
if (!baseResult.props.length || node.tagType === 1) {
return baseResult;
}
if (dir.arg) {
context.onError(
createDOMCompilerError(
58,
dir.arg.loc
)
);
}
const { tag } = node;
const isCustomElement = context.isCustomElement(tag);
if (tag === "input" || tag === "textarea" || tag === "select" || isCustomElement) {
let directiveToUse = V_MODEL_TEXT;
let isInvalidType = false;
if (tag === "input" || isCustomElement) {
const type = compilerCore.findProp(node, `type`);
if (type) {
if (type.type === 7) {
directiveToUse = V_MODEL_DYNAMIC;
} else if (type.value) {
switch (type.value.content) {
case "radio":
directiveToUse = V_MODEL_RADIO;
break;
case "checkbox":
directiveToUse = V_MODEL_CHECKBOX;
break;
case "file":
isInvalidType = true;
context.onError(
createDOMCompilerError(
59,
dir.loc
)
);
break;
}
}
} else if (compilerCore.hasDynamicKeyVBind(node)) {
directiveToUse = V_MODEL_DYNAMIC;
} else ;
} else if (tag === "select") {
directiveToUse = V_MODEL_SELECT;
} else ;
if (!isInvalidType) {
baseResult.needRuntime = context.helper(directiveToUse);
}
} else {
context.onError(
createDOMCompilerError(
57,
dir.loc
)
);
}
baseResult.props = baseResult.props.filter(
(p) => !(p.key.type === 4 && p.key.content === "modelValue")
);
return baseResult;
};
const isEventOptionModifier = /* @__PURE__ */ shared.makeMap(`passive,once,capture`);
const isNonKeyModifier = /* @__PURE__ */ shared.makeMap(
// event propagation management
`stop,prevent,self,ctrl,shift,alt,meta,exact,middle`
);
const maybeKeyModifier = /* @__PURE__ */ shared.makeMap("left,right");
const isKeyboardEvent = /* @__PURE__ */ shared.makeMap(
`onkeyup,onkeydown,onkeypress`,
true
);
const resolveModifiers = (key, modifiers, context, loc) => {
const keyModifiers = [];
const nonKeyModifiers = [];
const eventOptionModifiers = [];
for (let i = 0; i < modifiers.length; i++) {
const modifier = modifiers[i];
if (modifier === "native" && compilerCore.checkCompatEnabled(
"COMPILER_V_ON_NATIVE",
context,
loc
)) {
eventOptionModifiers.push(modifier);
} else if (isEventOptionModifier(modifier)) {
eventOptionModifiers.push(modifier);
} else {
if (maybeKeyModifier(modifier)) {
if (compilerCore.isStaticExp(key)) {
if (isKeyboardEvent(key.content)) {
keyModifiers.push(modifier);
} else {
nonKeyModifiers.push(modifier);
}
} else {
keyModifiers.push(modifier);
nonKeyModifiers.push(modifier);
}
} else {
if (isNonKeyModifier(modifier)) {
nonKeyModifiers.push(modifier);
} else {
keyModifiers.push(modifier);
}
}
}
}
return {
keyModifiers,
nonKeyModifiers,
eventOptionModifiers
};
};
const transformClick = (key, event) => {
const isStaticClick = compilerCore.isStaticExp(key) && key.content.toLowerCase() === "onclick";
return isStaticClick ? compilerCore.createSimpleExpression(event, true) : key.type !== 4 ? compilerCore.createCompoundExpression([
`(`,
key,
`) === "onClick" ? "${event}" : (`,
key,
`)`
]) : key;
};
const transformOn = (dir, node, context) => {
return compilerCore.transformOn(dir, node, context, (baseResult) => {
const { modifiers } = dir;
if (!modifiers.length)
return baseResult;
let { key, value: handlerExp } = baseResult.props[0];
const { keyModifiers, nonKeyModifiers, eventOptionModifiers } = resolveModifiers(key, modifiers, context, dir.loc);
if (nonKeyModifiers.includes("right")) {
key = transformClick(key, `onContextmenu`);
}
if (nonKeyModifiers.includes("middle")) {
key = transformClick(key, `onMouseup`);
}
if (nonKeyModifiers.length) {
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_MODIFIERS), [
handlerExp,
JSON.stringify(nonKeyModifiers)
]);
}
if (keyModifiers.length && // if event name is dynamic, always wrap with keys guard
(!compilerCore.isStaticExp(key) || isKeyboardEvent(key.content))) {
handlerExp = compilerCore.createCallExpression(context.helper(V_ON_WITH_KEYS), [
handlerExp,
JSON.stringify(keyModifiers)
]);
}
if (eventOptionModifiers.length) {
const modifierPostfix = eventOptionModifiers.map(shared.capitalize).join("");
key = compilerCore.isStaticExp(key) ? compilerCore.createSimpleExpression(`${key.content}${modifierPostfix}`, true) : compilerCore.createCompoundExpression([`(`, key, `) + "${modifierPostfix}"`]);
}
return {
props: [compilerCore.createObjectProperty(key, handlerExp)]
};
});
};
const transformShow = (dir, node, context) => {
const { exp, loc } = dir;
if (!exp) {
context.onError(
createDOMCompilerError(61, loc)
);
}
return {
props: [],
needRuntime: context.helper(V_SHOW)
};
};
const expReplaceRE = /__VUE_EXP_START__(.*?)__VUE_EXP_END__/g;
const stringifyStatic = (children, context, parent) => {
if (context.scopes.vSlot > 0) {
return;
}
let nc = 0;
let ec = 0;
const currentChunk = [];
const stringifyCurrentChunk = (currentIndex) => {
if (nc >= 20 || ec >= 5) {
const staticCall = compilerCore.createCallExpression(context.helper(compilerCore.CREATE_STATIC), [
JSON.stringify(
currentChunk.map((node) => stringifyNode(node, context)).join("")
).replace(expReplaceRE, `" + $1 + "`),
// the 2nd argument indicates the number of DOM nodes this static vnode
// will insert / hydrate
String(currentChunk.length)
]);
replaceHoist(currentChunk[0], staticCall, context);
if (currentChunk.length > 1) {
for (let i2 = 1; i2 < currentChunk.length; i2++) {
replaceHoist(currentChunk[i2], null, context);
}
const deleteCount = currentChunk.length - 1;
children.splice(currentIndex - currentChunk.length + 1, deleteCount);
return deleteCount;
}
}
return 0;
};
let i = 0;
for (; i < children.length; i++) {
const child = children[i];
const hoisted = getHoistedNode(child);
if (hoisted) {
const node = child;
const result = analyzeNode(node);
if (result) {
nc += result[0];
ec += result[1];
currentChunk.push(node);
continue;
}
}
i -= stringifyCurrentChunk(i);
nc = 0;
ec = 0;
currentChunk.length = 0;
}
stringifyCurrentChunk(i);
};
const getHoistedNode = (node) => (node.type === 1 && node.tagType === 0 || node.type == 12) && node.codegenNode && node.codegenNode.type === 4 && node.codegenNode.hoisted;
const dataAriaRE = /^(data|aria)-/;
const isStringifiableAttr = (name, ns) => {
return (ns === 0 ? shared.isKnownHtmlAttr(name) : ns === 1 ? shared.isKnownSvgAttr(name) : false) || dataAriaRE.test(name);
};
const replaceHoist = (node, replacement, context) => {
const hoistToReplace = node.codegenNode.hoisted;
context.hoists[context.hoists.indexOf(hoistToReplace)] = replacement;
};
const isNonStringifiable = /* @__PURE__ */ shared.makeMap(
`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`
);
function analyzeNode(node) {
if (node.type === 1 && isNonStringifiable(node.tag)) {
return false;
}
if (node.type === 12) {
return [1, 0];
}
let nc = 1;
let ec = node.props.length > 0 ? 1 : 0;
let bailed = false;
const bail = () => {
bailed = true;
return false;
};
function walk(node2) {
for (let i = 0; i < node2.props.length; i++) {
const p = node2.props[i];
if (p.type === 6 && !isStringifiableAttr(p.name, node2.ns)) {
return bail();
}
if (p.type === 7 && p.name === "bind") {
if (p.arg && (p.arg.type === 8 || p.arg.isStatic && !isStringifiableAttr(p.arg.content, node2.ns))) {
return bail();
}
if (p.exp && (p.exp.type === 8 || p.exp.constType < 3)) {
return bail();
}
}
}
for (let i = 0; i < node2.children.length; i++) {
nc++;
const child = node2.children[i];
if (child.type === 1) {
if (child.props.length > 0) {
ec++;
}
walk(child);
if (bailed) {
return false;
}
}
}
return true;
}
return walk(node) ? [nc, ec] : false;
}
function stringifyNode(node, context) {
if (shared.isString(node)) {
return node;
}
if (shared.isSymbol(node)) {
return ``;
}
switch (node.type) {
case 1:
return stringifyElement(node, context);
case 2:
return shared.escapeHtml(node.content);
case 3:
return `<!--${shared.escapeHtml(node.content)}-->`;
case 5:
return shared.escapeHtml(shared.toDisplayString(evaluateConstant(node.content)));
case 8:
return shared.escapeHtml(evaluateConstant(node));
case 12:
return stringifyNode(node.content, context);
default:
return "";
}
}
function stringifyElement(node, context) {
let res = `<${node.tag}`;
let innerHTML = "";
for (let i = 0; i < node.props.length; i++) {
const p = node.props[i];
if (p.type === 6) {
res += ` ${p.name}`;
if (p.value) {
res += `="${shared.escapeHtml(p.value.content)}"`;
}
} else if (p.type === 7) {
if (p.name === "bind") {
const exp = p.exp;
if (exp.content[0] === "_") {
res += ` ${p.arg.content}="__VUE_EXP_START__${exp.content}__VUE_EXP_END__"`;
continue;
}
if (shared.isBooleanAttr(p.arg.content) && exp.content === "false") {
continue;
}
let evaluated = evaluateConstant(exp);
if (evaluated != null) {
const arg = p.arg && p.arg.content;
if (arg === "class") {
evaluated = shared.normalizeClass(evaluated);
} else if (arg === "style") {
evaluated = shared.stringifyStyle(shared.normalizeStyle(evaluated));
}
res += ` ${p.arg.content}="${shared.escapeHtml(
evaluated
)}"`;
}
} else if (p.name === "html") {
innerHTML = evaluateConstant(p.exp);
} else if (p.name === "text") {
innerHTML = shared.escapeHtml(
shared.toDisplayString(evaluateConstant(p.exp))
);
}
}
}
if (context.scopeId) {
res += ` ${context.scopeId}`;
}
res += `>`;
if (innerHTML) {
res += innerHTML;
} else {
for (let i = 0; i < node.children.length; i++) {
res += stringifyNode(node.children[i], context);
}
}
if (!shared.isVoidTag(node.tag)) {
res += `</${node.tag}>`;
}
return res;
}
function evaluateConstant(exp) {
if (exp.type === 4) {
return new Function(`return (${exp.content})`)();
} else {
let res = ``;
exp.children.forEach((c) => {
if (shared.isString(c) || shared.isSymbol(c)) {
return;
}
if (c.type === 2) {
res += c.content;
} else if (c.type === 5) {
res += shared.toDisplayString(evaluateConstant(c.content));
} else {
res += evaluateConstant(c);
}
});
return res;
}
}
const ignoreSideEffectTags = (node, context) => {
if (node.type === 1 && node.tagType === 0 && (node.tag === "script" || node.tag === "style")) {
context.removeNode();
}
};
const DOMNodeTransforms = [
transformStyle,
...[]
];
const DOMDirectiveTransforms = {
cloak: compilerCore.noopDirectiveTransform,
html: transformVHtml,
text: transformVText,
model: transformModel,
// override compiler-core
on: transformOn,
// override compiler-core
show: transformShow
};
function compile(src, options = {}) {
return compilerCore.baseCompile(
src,
shared.extend({}, parserOptions, options, {
nodeTransforms: [
// ignore <script> and <tag>
// this is not put inside DOMNodeTransforms because that list is used
// by compiler-ssr to generate vnode fallback branches
ignoreSideEffectTags,
...DOMNodeTransforms,
...options.nodeTransforms || []
],
directiveTransforms: shared.extend(
{},
DOMDirectiveTransforms,
options.directiveTransforms || {}
),
transformHoist: stringifyStatic
})
);
}
function parse(template, options = {}) {
return compilerCore.baseParse(template, shared.extend({}, parserOptions, options));
}
exports.DOMDirectiveTransforms = DOMDirectiveTransforms;
exports.DOMErrorCodes = DOMErrorCodes;
exports.DOMErrorMessages = DOMErrorMessages;
exports.DOMNodeTransforms = DOMNodeTransforms;
exports.TRANSITION = TRANSITION;
exports.TRANSITION_GROUP = TRANSITION_GROUP;
exports.V_MODEL_CHECKBOX = V_MODEL_CHECKBOX;
exports.V_MODEL_DYNAMIC = V_MODEL_DYNAMIC;
exports.V_MODEL_RADIO = V_MODEL_RADIO;
exports.V_MODEL_SELECT = V_MODEL_SELECT;
exports.V_MODEL_TEXT = V_MODEL_TEXT;
exports.V_ON_WITH_KEYS = V_ON_WITH_KEYS;
exports.V_ON_WITH_MODIFIERS = V_ON_WITH_MODIFIERS;
exports.V_SHOW = V_SHOW;
exports.compile = compile;
exports.createDOMCompilerError = createDOMCompilerError;
exports.parse = parse;
exports.parserOptions = parserOptions;
exports.transformStyle = transformStyle;
Object.keys(compilerCore).forEach(function (k) {
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = compilerCore[k];
});

View File

@ -0,0 +1,56 @@
{
"name": "@vue/compiler-dom",
"version": "3.4.5",
"description": "@vue/compiler-dom",
"main": "index.js",
"module": "dist/compiler-dom.esm-bundler.js",
"types": "dist/compiler-dom.d.ts",
"unpkg": "dist/compiler-dom.global.js",
"jsdelivr": "dist/compiler-dom.global.js",
"files": [
"index.js",
"dist"
],
"exports": {
".": {
"types": "./dist/compiler-dom.d.ts",
"node": {
"production": "./dist/compiler-dom.cjs.prod.js",
"development": "./dist/compiler-dom.cjs.js",
"default": "./dist/compiler-dom.cjs.prod.js"
},
"import": "./dist/compiler-dom.esm-bundler.js",
"require": "./index.js"
},
"./*": "./*"
},
"sideEffects": false,
"buildOptions": {
"name": "VueCompilerDOM",
"compat": true,
"formats": [
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core.git",
"directory": "packages/compiler-dom"
},
"keywords": [
"vue"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/core/issues"
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme",
"dependencies": {
"@vue/shared": "3.4.5",
"@vue/compiler-core": "3.4.5"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
{
"name": "@vue/compiler-ssr",
"version": "3.4.5",
"description": "@vue/compiler-ssr",
"main": "dist/compiler-ssr.cjs.js",
"types": "dist/compiler-ssr.d.ts",
"files": [
"dist"
],
"buildOptions": {
"prod": false,
"formats": [
"cjs"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core.git",
"directory": "packages/compiler-ssr"
},
"keywords": [
"vue"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/core/issues"
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme",
"dependencies": {
"@vue/shared": "3.4.5",
"@vue/compiler-dom": "3.4.5"
}
}

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,22 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./api.js"), exports);
__exportStar(require("./app.js"), exports);
__exportStar(require("./component.js"), exports);
__exportStar(require("./context.js"), exports);
__exportStar(require("./hooks.js"), exports);
__exportStar(require("./util.js"), exports);

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.HOOK_PLUGIN_SETTINGS_SET = exports.HOOK_SETUP = void 0;
exports.HOOK_SETUP = 'devtools-plugin:setup';
exports.HOOK_PLUGIN_SETTINGS_SET = 'plugin:settings:set';

View File

@ -0,0 +1,17 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isProxyAvailable = exports.getTarget = exports.getDevtoolsGlobalHook = void 0;
function getDevtoolsGlobalHook() {
return getTarget().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
exports.getDevtoolsGlobalHook = getDevtoolsGlobalHook;
function getTarget() {
// @ts-ignore
return (typeof navigator !== 'undefined' && typeof window !== 'undefined')
? window
: typeof global !== 'undefined'
? global
: {};
}
exports.getTarget = getTarget;
exports.isProxyAvailable = typeof Proxy === 'function';

View File

@ -0,0 +1,44 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.setupDevtoolsPlugin = void 0;
const env_js_1 = require("./env.js");
const const_js_1 = require("./const.js");
const proxy_js_1 = require("./proxy.js");
__exportStar(require("./api/index.js"), exports);
__exportStar(require("./plugin.js"), exports);
__exportStar(require("./time.js"), exports);
function setupDevtoolsPlugin(pluginDescriptor, setupFn) {
const descriptor = pluginDescriptor;
const target = (0, env_js_1.getTarget)();
const hook = (0, env_js_1.getDevtoolsGlobalHook)();
const enableProxy = env_js_1.isProxyAvailable && descriptor.enableEarlyProxy;
if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) {
hook.emit(const_js_1.HOOK_SETUP, pluginDescriptor, setupFn);
}
else {
const proxy = enableProxy ? new proxy_js_1.ApiProxy(descriptor, hook) : null;
const list = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || [];
list.push({
pluginDescriptor: descriptor,
setupFn,
proxy,
});
if (proxy)
setupFn(proxy.proxiedTarget);
}
}
exports.setupDevtoolsPlugin = setupDevtoolsPlugin;

View File

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@ -0,0 +1,111 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiProxy = void 0;
const const_js_1 = require("./const.js");
const time_js_1 = require("./time.js");
class ApiProxy {
constructor(plugin, hook) {
this.target = null;
this.targetQueue = [];
this.onQueue = [];
this.plugin = plugin;
this.hook = hook;
const defaultSettings = {};
if (plugin.settings) {
for (const id in plugin.settings) {
const item = plugin.settings[id];
defaultSettings[id] = item.defaultValue;
}
}
const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`;
let currentSettings = Object.assign({}, defaultSettings);
try {
const raw = localStorage.getItem(localSettingsSaveId);
const data = JSON.parse(raw);
Object.assign(currentSettings, data);
}
catch (e) {
// noop
}
this.fallbacks = {
getSettings() {
return currentSettings;
},
setSettings(value) {
try {
localStorage.setItem(localSettingsSaveId, JSON.stringify(value));
}
catch (e) {
// noop
}
currentSettings = value;
},
now() {
return (0, time_js_1.now)();
},
};
if (hook) {
hook.on(const_js_1.HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
if (pluginId === this.plugin.id) {
this.fallbacks.setSettings(value);
}
});
}
this.proxiedOn = new Proxy({}, {
get: (_target, prop) => {
if (this.target) {
return this.target.on[prop];
}
else {
return (...args) => {
this.onQueue.push({
method: prop,
args,
});
};
}
},
});
this.proxiedTarget = new Proxy({}, {
get: (_target, prop) => {
if (this.target) {
return this.target[prop];
}
else if (prop === 'on') {
return this.proxiedOn;
}
else if (Object.keys(this.fallbacks).includes(prop)) {
return (...args) => {
this.targetQueue.push({
method: prop,
args,
resolve: () => { },
});
return this.fallbacks[prop](...args);
};
}
else {
return (...args) => {
return new Promise(resolve => {
this.targetQueue.push({
method: prop,
args,
resolve,
});
});
};
}
},
});
}
async setRealTarget(target) {
this.target = target;
for (const item of this.onQueue) {
this.target.on[item.method](...item.args);
}
for (const item of this.targetQueue) {
item.resolve(await this.target[item.method](...item.args));
}
}
}
exports.ApiProxy = ApiProxy;

View File

@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.now = exports.isPerformanceSupported = void 0;
let supported;
let perf;
function isPerformanceSupported() {
var _a;
if (supported !== undefined) {
return supported;
}
if (typeof window !== 'undefined' && window.performance) {
supported = true;
perf = window.performance;
}
else if (typeof global !== 'undefined' && ((_a = global.perf_hooks) === null || _a === void 0 ? void 0 : _a.performance)) {
supported = true;
perf = global.perf_hooks.performance;
}
else {
supported = false;
}
return supported;
}
exports.isPerformanceSupported = isPerformanceSupported;
function now() {
return isPerformanceSupported() ? perf.now() : Date.now();
}
exports.now = now;

View File

@ -0,0 +1,37 @@
{
"name": "@vue/devtools-api",
"version": "6.5.1",
"description": "Interact with the Vue devtools from the page",
"main": "lib/cjs/index.js",
"browser": "lib/esm/index.js",
"module": "lib/esm/index.js",
"types": "lib/esm/index.d.ts",
"sideEffects": false,
"author": {
"name": "Guillaume Chau"
},
"files": [
"lib/esm",
"lib/cjs"
],
"license": "MIT",
"repository": {
"url": "https://github.com/vuejs/vue-devtools.git",
"type": "git",
"directory": "packages/api"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "rimraf lib && yarn build:esm && yarn build:cjs",
"build:esm": "tsc --module es2015 --outDir lib/esm -d",
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
"build:watch": "yarn tsc --module es2015 --outDir lib/esm -d -w --sourceMap"
},
"devDependencies": {
"@types/node": "^13.9.1",
"@types/webpack-env": "^1.15.1",
"typescript": "^4.5.2"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,54 @@
{
"name": "@vue/reactivity",
"version": "3.4.5",
"description": "@vue/reactivity",
"main": "index.js",
"module": "dist/reactivity.esm-bundler.js",
"types": "dist/reactivity.d.ts",
"unpkg": "dist/reactivity.global.js",
"jsdelivr": "dist/reactivity.global.js",
"files": [
"index.js",
"dist"
],
"exports": {
".": {
"types": "./dist/reactivity.d.ts",
"node": {
"production": "./dist/reactivity.cjs.prod.js",
"development": "./dist/reactivity.cjs.js",
"default": "./dist/reactivity.cjs.prod.js"
},
"import": "./dist/reactivity.esm-bundler.js",
"require": "./index.js"
},
"./*": "./*"
},
"sideEffects": false,
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core.git",
"directory": "packages/reactivity"
},
"buildOptions": {
"name": "VueReactivity",
"formats": [
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
"keywords": [
"vue"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/core/issues"
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/reactivity#readme",
"dependencies": {
"@vue/shared": "3.4.5"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,51 @@
{
"name": "@vue/runtime-core",
"version": "3.4.5",
"description": "@vue/runtime-core",
"main": "index.js",
"module": "dist/runtime-core.esm-bundler.js",
"types": "dist/runtime-core.d.ts",
"files": [
"index.js",
"dist"
],
"exports": {
".": {
"types": "./dist/runtime-core.d.ts",
"node": {
"production": "./dist/runtime-core.cjs.prod.js",
"development": "./dist/runtime-core.cjs.js",
"default": "./dist/runtime-core.cjs.prod.js"
},
"import": "./dist/runtime-core.esm-bundler.js",
"require": "./index.js"
},
"./*": "./*"
},
"buildOptions": {
"name": "VueRuntimeCore",
"formats": [
"esm-bundler",
"cjs"
]
},
"sideEffects": false,
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core.git",
"directory": "packages/runtime-core"
},
"keywords": [
"vue"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/core/issues"
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
"dependencies": {
"@vue/shared": "3.4.5",
"@vue/reactivity": "3.4.5"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,55 @@
{
"name": "@vue/runtime-dom",
"version": "3.4.5",
"description": "@vue/runtime-dom",
"main": "index.js",
"module": "dist/runtime-dom.esm-bundler.js",
"types": "dist/runtime-dom.d.ts",
"unpkg": "dist/runtime-dom.global.js",
"files": [
"index.js",
"dist"
],
"exports": {
".": {
"types": "./dist/runtime-dom.d.ts",
"node": {
"production": "./dist/runtime-dom.cjs.prod.js",
"development": "./dist/runtime-dom.cjs.js",
"default": "./dist/runtime-dom.cjs.prod.js"
},
"import": "./dist/runtime-dom.esm-bundler.js",
"require": "./index.js"
},
"./*": "./*"
},
"sideEffects": false,
"buildOptions": {
"name": "VueRuntimeDOM",
"formats": [
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core.git",
"directory": "packages/runtime-dom"
},
"keywords": [
"vue"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/core/issues"
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-dom#readme",
"dependencies": {
"csstype": "^3.1.3",
"@vue/shared": "3.4.5",
"@vue/runtime-core": "3.4.5"
}
}

View File

@ -0,0 +1,836 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var Vue = require('vue');
var shared = require('@vue/shared');
var compilerSsr = require('@vue/compiler-ssr');
function _interopNamespaceDefault(e) {
var n = Object.create(null);
if (e) {
for (var k in e) {
n[k] = e[k];
}
}
n.default = e;
return Object.freeze(n);
}
var Vue__namespace = /*#__PURE__*/_interopNamespaceDefault(Vue);
const shouldIgnoreProp = shared.makeMap(
`,key,ref,innerHTML,textContent,ref_key,ref_for`
);
function ssrRenderAttrs(props, tag) {
let ret = "";
for (const key in props) {
if (shouldIgnoreProp(key) || shared.isOn(key) || tag === "textarea" && key === "value") {
continue;
}
const value = props[key];
if (key === "class") {
ret += ` class="${ssrRenderClass(value)}"`;
} else if (key === "style") {
ret += ` style="${ssrRenderStyle(value)}"`;
} else {
ret += ssrRenderDynamicAttr(key, value, tag);
}
}
return ret;
}
function ssrRenderDynamicAttr(key, value, tag) {
if (!isRenderableValue(value)) {
return ``;
}
const attrKey = tag && (tag.indexOf("-") > 0 || shared.isSVGTag(tag)) ? key : shared.propsToAttrMap[key] || key.toLowerCase();
if (shared.isBooleanAttr(attrKey)) {
return shared.includeBooleanAttr(value) ? ` ${attrKey}` : ``;
} else if (shared.isSSRSafeAttrName(attrKey)) {
return value === "" ? ` ${attrKey}` : ` ${attrKey}="${shared.escapeHtml(value)}"`;
} else {
console.warn(
`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`
);
return ``;
}
}
function ssrRenderAttr(key, value) {
if (!isRenderableValue(value)) {
return ``;
}
return ` ${key}="${shared.escapeHtml(value)}"`;
}
function isRenderableValue(value) {
if (value == null) {
return false;
}
const type = typeof value;
return type === "string" || type === "number" || type === "boolean";
}
function ssrRenderClass(raw) {
return shared.escapeHtml(shared.normalizeClass(raw));
}
function ssrRenderStyle(raw) {
if (!raw) {
return "";
}
if (shared.isString(raw)) {
return shared.escapeHtml(raw);
}
const styles = shared.normalizeStyle(raw);
return shared.escapeHtml(shared.stringifyStyle(styles));
}
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
return renderComponentVNode(
Vue.createVNode(comp, props, children),
parentComponent,
slotScopeId
);
}
function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
push(`<!--[-->`);
ssrRenderSlotInner(
slots,
slotName,
slotProps,
fallbackRenderFn,
push,
parentComponent,
slotScopeId
);
push(`<!--]-->`);
}
function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
const slotFn = slots[slotName];
if (slotFn) {
const slotBuffer = [];
const bufferedPush = (item) => {
slotBuffer.push(item);
};
const ret = slotFn(
slotProps,
bufferedPush,
parentComponent,
slotScopeId ? " " + slotScopeId : ""
);
if (shared.isArray(ret)) {
renderVNodeChildren(push, ret, parentComponent, slotScopeId);
} else {
let isEmptySlot = true;
if (transition) {
isEmptySlot = false;
} else {
for (let i = 0; i < slotBuffer.length; i++) {
if (!isComment(slotBuffer[i])) {
isEmptySlot = false;
break;
}
}
}
if (isEmptySlot) {
if (fallbackRenderFn) {
fallbackRenderFn();
}
} else {
let start = 0;
let end = slotBuffer.length;
if (transition && slotBuffer[0] === "<!--[-->" && slotBuffer[end - 1] === "<!--]-->") {
start++;
end--;
}
for (let i = start; i < end; i++) {
push(slotBuffer[i]);
}
}
}
} else if (fallbackRenderFn) {
fallbackRenderFn();
}
}
const commentTestRE = /^<!--.*-->$/s;
const commentRE = /<!--[^]*?-->/gm;
function isComment(item) {
if (typeof item !== "string" || !commentTestRE.test(item))
return false;
if (item.length <= 8)
return true;
return !item.replace(commentRE, "").trim();
}
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
parentPush("<!--teleport start-->");
const context = parentComponent.appContext.provides[Vue.ssrContextKey];
const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {});
const targetBuffer = teleportBuffers[target] || (teleportBuffers[target] = []);
const bufferIndex = targetBuffer.length;
let teleportContent;
if (disabled) {
contentRenderFn(parentPush);
teleportContent = `<!--teleport anchor-->`;
} else {
const { getBuffer, push } = createBuffer();
contentRenderFn(push);
push(`<!--teleport anchor-->`);
teleportContent = getBuffer();
}
targetBuffer.splice(bufferIndex, 0, teleportContent);
parentPush("<!--teleport end-->");
}
function ssrInterpolate(value) {
return shared.escapeHtml(shared.toDisplayString(value));
}
function ssrRenderList(source, renderItem) {
if (shared.isArray(source) || shared.isString(source)) {
for (let i = 0, l = source.length; i < l; i++) {
renderItem(source[i], i);
}
} else if (typeof source === "number") {
for (let i = 0; i < source; i++) {
renderItem(i + 1, i);
}
} else if (shared.isObject(source)) {
if (source[Symbol.iterator]) {
const arr = Array.from(source);
for (let i = 0, l = arr.length; i < l; i++) {
renderItem(arr[i], i);
}
} else {
const keys = Object.keys(source);
for (let i = 0, l = keys.length; i < l; i++) {
const key = keys[i];
renderItem(source[key], key, i);
}
}
}
}
async function ssrRenderSuspense(push, { default: renderContent }) {
if (renderContent) {
renderContent();
} else {
push(`<!---->`);
}
}
function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
if (typeof dir !== "function" && dir.getSSRProps) {
return dir.getSSRProps(
{
dir,
instance,
value,
oldValue: void 0,
arg,
modifiers
},
null
) || {};
}
return {};
}
const ssrLooseEqual = shared.looseEqual;
function ssrLooseContain(arr, value) {
return shared.looseIndexOf(arr, value) > -1;
}
function ssrRenderDynamicModel(type, model, value) {
switch (type) {
case "radio":
return shared.looseEqual(model, value) ? " checked" : "";
case "checkbox":
return (shared.isArray(model) ? ssrLooseContain(model, value) : model) ? " checked" : "";
default:
return ssrRenderAttr("value", model);
}
}
function ssrGetDynamicModelProps(existingProps = {}, model) {
const { type, value } = existingProps;
switch (type) {
case "radio":
return shared.looseEqual(model, value) ? { checked: true } : null;
case "checkbox":
return (shared.isArray(model) ? ssrLooseContain(model, value) : model) ? { checked: true } : null;
default:
return { value: model };
}
}
var helpers = /*#__PURE__*/Object.freeze({
__proto__: null,
ssrGetDirectiveProps: ssrGetDirectiveProps,
ssrGetDynamicModelProps: ssrGetDynamicModelProps,
ssrIncludeBooleanAttr: shared.includeBooleanAttr,
ssrInterpolate: ssrInterpolate,
ssrLooseContain: ssrLooseContain,
ssrLooseEqual: ssrLooseEqual,
ssrRenderAttr: ssrRenderAttr,
ssrRenderAttrs: ssrRenderAttrs,
ssrRenderClass: ssrRenderClass,
ssrRenderComponent: ssrRenderComponent,
ssrRenderDynamicAttr: ssrRenderDynamicAttr,
ssrRenderDynamicModel: ssrRenderDynamicModel,
ssrRenderList: ssrRenderList,
ssrRenderSlot: ssrRenderSlot,
ssrRenderSlotInner: ssrRenderSlotInner,
ssrRenderStyle: ssrRenderStyle,
ssrRenderSuspense: ssrRenderSuspense,
ssrRenderTeleport: ssrRenderTeleport,
ssrRenderVNode: renderVNode
});
const compileCache = /* @__PURE__ */ Object.create(null);
function ssrCompile(template, instance) {
const Component = instance.type;
const { isCustomElement, compilerOptions } = instance.appContext.config;
const { delimiters, compilerOptions: componentCompilerOptions } = Component;
const finalCompilerOptions = shared.extend(
shared.extend(
{
isCustomElement,
delimiters
},
compilerOptions
),
componentCompilerOptions
);
finalCompilerOptions.isCustomElement = finalCompilerOptions.isCustomElement || shared.NO;
finalCompilerOptions.isNativeTag = finalCompilerOptions.isNativeTag || shared.NO;
const cacheKey = JSON.stringify(
{
template,
compilerOptions: finalCompilerOptions
},
(key, value) => {
return shared.isFunction(value) ? value.toString() : value;
}
);
const cached = compileCache[cacheKey];
if (cached) {
return cached;
}
finalCompilerOptions.onError = (err) => {
{
throw err;
}
};
const { code } = compilerSsr.compile(template, finalCompilerOptions);
const requireMap = {
vue: Vue__namespace,
"vue/server-renderer": helpers
};
const fakeRequire = (id) => requireMap[id];
return compileCache[cacheKey] = Function("require", code)(fakeRequire);
}
const {
createComponentInstance,
setCurrentRenderingInstance,
setupComponent,
renderComponentRoot,
normalizeVNode
} = Vue.ssrUtils;
function createBuffer() {
let appendable = false;
const buffer = [];
return {
getBuffer() {
return buffer;
},
push(item) {
const isStringItem = shared.isString(item);
if (appendable && isStringItem) {
buffer[buffer.length - 1] += item;
} else {
buffer.push(item);
}
appendable = isStringItem;
if (shared.isPromise(item) || shared.isArray(item) && item.hasAsync) {
buffer.hasAsync = true;
}
}
};
}
function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
const instance = createComponentInstance(vnode, parentComponent, null);
const res = setupComponent(
instance,
true
/* isSSR */
);
const hasAsyncSetup = shared.isPromise(res);
const prefetches = instance.sp;
if (hasAsyncSetup || prefetches) {
let p = hasAsyncSetup ? res : Promise.resolve();
if (prefetches) {
p = p.then(
() => Promise.all(
prefetches.map((prefetch) => prefetch.call(instance.proxy))
)
).catch(() => {
});
}
return p.then(() => renderComponentSubTree(instance, slotScopeId));
} else {
return renderComponentSubTree(instance, slotScopeId);
}
}
function renderComponentSubTree(instance, slotScopeId) {
const comp = instance.type;
const { getBuffer, push } = createBuffer();
if (shared.isFunction(comp)) {
let root = renderComponentRoot(instance);
if (!comp.props) {
for (const key in instance.attrs) {
if (key.startsWith(`data-v-`)) {
(root.props || (root.props = {}))[key] = ``;
}
}
}
renderVNode(push, instance.subTree = root, instance, slotScopeId);
} else {
if ((!instance.render || instance.render === shared.NOOP) && !instance.ssrRender && !comp.ssrRender && shared.isString(comp.template)) {
comp.ssrRender = ssrCompile(comp.template, instance);
}
for (const e of instance.scope.effects) {
if (e.computed) {
e.computed._dirty = true;
e.computed._cacheable = true;
}
}
const ssrRender = instance.ssrRender || comp.ssrRender;
if (ssrRender) {
let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0;
let hasCloned = false;
let cur = instance;
while (true) {
const scopeId = cur.vnode.scopeId;
if (scopeId) {
if (!hasCloned) {
attrs = { ...attrs };
hasCloned = true;
}
attrs[scopeId] = "";
}
const parent = cur.parent;
if (parent && parent.subTree && parent.subTree === cur.vnode) {
cur = parent;
} else {
break;
}
}
if (slotScopeId) {
if (!hasCloned)
attrs = { ...attrs };
attrs[slotScopeId.trim()] = "";
}
const prev = setCurrentRenderingInstance(instance);
try {
ssrRender(
instance.proxy,
push,
instance,
attrs,
// compiler-optimized bindings
instance.props,
instance.setupState,
instance.data,
instance.ctx
);
} finally {
setCurrentRenderingInstance(prev);
}
} else if (instance.render && instance.render !== shared.NOOP) {
renderVNode(
push,
instance.subTree = renderComponentRoot(instance),
instance,
slotScopeId
);
} else {
const componentName = comp.name || comp.__file || `<Anonymous>`;
Vue.warn(`Component ${componentName} is missing template or render function.`);
push(`<!---->`);
}
}
return getBuffer();
}
function renderVNode(push, vnode, parentComponent, slotScopeId) {
const { type, shapeFlag, children } = vnode;
switch (type) {
case Vue.Text:
push(shared.escapeHtml(children));
break;
case Vue.Comment:
push(
children ? `<!--${shared.escapeHtmlComment(children)}-->` : `<!---->`
);
break;
case Vue.Static:
push(children);
break;
case Vue.Fragment:
if (vnode.slotScopeIds) {
slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
}
push(`<!--[-->`);
renderVNodeChildren(
push,
children,
parentComponent,
slotScopeId
);
push(`<!--]-->`);
break;
default:
if (shapeFlag & 1) {
renderElementVNode(push, vnode, parentComponent, slotScopeId);
} else if (shapeFlag & 6) {
push(renderComponentVNode(vnode, parentComponent, slotScopeId));
} else if (shapeFlag & 64) {
renderTeleportVNode(push, vnode, parentComponent, slotScopeId);
} else if (shapeFlag & 128) {
renderVNode(push, vnode.ssContent, parentComponent, slotScopeId);
} else {
Vue.warn(
"[@vue/server-renderer] Invalid VNode type:",
type,
`(${typeof type})`
);
}
}
}
function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
for (let i = 0; i < children.length; i++) {
renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
}
}
function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
const tag = vnode.type;
let { props, children, shapeFlag, scopeId, dirs } = vnode;
let openTag = `<${tag}`;
if (dirs) {
props = applySSRDirectives(vnode, props, dirs);
}
if (props) {
openTag += ssrRenderAttrs(props, tag);
}
if (scopeId) {
openTag += ` ${scopeId}`;
}
let curParent = parentComponent;
let curVnode = vnode;
while (curParent && curVnode === curParent.subTree) {
curVnode = curParent.vnode;
if (curVnode.scopeId) {
openTag += ` ${curVnode.scopeId}`;
}
curParent = curParent.parent;
}
if (slotScopeId) {
openTag += ` ${slotScopeId}`;
}
push(openTag + `>`);
if (!shared.isVoidTag(tag)) {
let hasChildrenOverride = false;
if (props) {
if (props.innerHTML) {
hasChildrenOverride = true;
push(props.innerHTML);
} else if (props.textContent) {
hasChildrenOverride = true;
push(shared.escapeHtml(props.textContent));
} else if (tag === "textarea" && props.value) {
hasChildrenOverride = true;
push(shared.escapeHtml(props.value));
}
}
if (!hasChildrenOverride) {
if (shapeFlag & 8) {
push(shared.escapeHtml(children));
} else if (shapeFlag & 16) {
renderVNodeChildren(
push,
children,
parentComponent,
slotScopeId
);
}
}
push(`</${tag}>`);
}
}
function applySSRDirectives(vnode, rawProps, dirs) {
const toMerge = [];
for (let i = 0; i < dirs.length; i++) {
const binding = dirs[i];
const {
dir: { getSSRProps }
} = binding;
if (getSSRProps) {
const props = getSSRProps(binding, vnode);
if (props)
toMerge.push(props);
}
}
return Vue.mergeProps(rawProps || {}, ...toMerge);
}
function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) {
const target = vnode.props && vnode.props.to;
const disabled = vnode.props && vnode.props.disabled;
if (!target) {
if (!disabled) {
Vue.warn(`[@vue/server-renderer] Teleport is missing target prop.`);
}
return [];
}
if (!shared.isString(target)) {
Vue.warn(
`[@vue/server-renderer] Teleport target must be a query selector string.`
);
return [];
}
ssrRenderTeleport(
push,
(push2) => {
renderVNodeChildren(
push2,
vnode.children,
parentComponent,
slotScopeId
);
},
target,
disabled || disabled === "",
parentComponent
);
}
const { isVNode: isVNode$1 } = Vue.ssrUtils;
async function unrollBuffer$1(buffer) {
if (buffer.hasAsync) {
let ret = "";
for (let i = 0; i < buffer.length; i++) {
let item = buffer[i];
if (shared.isPromise(item)) {
item = await item;
}
if (shared.isString(item)) {
ret += item;
} else {
ret += await unrollBuffer$1(item);
}
}
return ret;
} else {
return unrollBufferSync$1(buffer);
}
}
function unrollBufferSync$1(buffer) {
let ret = "";
for (let i = 0; i < buffer.length; i++) {
let item = buffer[i];
if (shared.isString(item)) {
ret += item;
} else {
ret += unrollBufferSync$1(item);
}
}
return ret;
}
async function renderToString(input, context = {}) {
if (isVNode$1(input)) {
return renderToString(Vue.createApp({ render: () => input }), context);
}
const vnode = Vue.createVNode(input._component, input._props);
vnode.appContext = input._context;
input.provide(Vue.ssrContextKey, context);
const buffer = await renderComponentVNode(vnode);
const result = await unrollBuffer$1(buffer);
await resolveTeleports(context);
if (context.__watcherHandles) {
for (const unwatch of context.__watcherHandles) {
unwatch();
}
}
return result;
}
async function resolveTeleports(context) {
if (context.__teleportBuffers) {
context.teleports = context.teleports || {};
for (const key in context.__teleportBuffers) {
context.teleports[key] = await unrollBuffer$1(
await Promise.all([context.__teleportBuffers[key]])
);
}
}
}
const { isVNode } = Vue.ssrUtils;
async function unrollBuffer(buffer, stream) {
if (buffer.hasAsync) {
for (let i = 0; i < buffer.length; i++) {
let item = buffer[i];
if (shared.isPromise(item)) {
item = await item;
}
if (shared.isString(item)) {
stream.push(item);
} else {
await unrollBuffer(item, stream);
}
}
} else {
unrollBufferSync(buffer, stream);
}
}
function unrollBufferSync(buffer, stream) {
for (let i = 0; i < buffer.length; i++) {
let item = buffer[i];
if (shared.isString(item)) {
stream.push(item);
} else {
unrollBufferSync(item, stream);
}
}
}
function renderToSimpleStream(input, context, stream) {
if (isVNode(input)) {
return renderToSimpleStream(
Vue.createApp({ render: () => input }),
context,
stream
);
}
const vnode = Vue.createVNode(input._component, input._props);
vnode.appContext = input._context;
input.provide(Vue.ssrContextKey, context);
Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => {
if (context.__watcherHandles) {
for (const unwatch of context.__watcherHandles) {
unwatch();
}
}
}).then(() => stream.push(null)).catch((error) => {
stream.destroy(error);
});
return stream;
}
function renderToStream(input, context = {}) {
console.warn(
`[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead.`
);
return renderToNodeStream(input, context);
}
function renderToNodeStream(input, context = {}) {
const stream = new (require("node:stream")).Readable({ read() {
} }) ;
if (!stream) {
throw new Error(
`ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.`
);
}
return renderToSimpleStream(input, context, stream);
}
function pipeToNodeWritable(input, context = {}, writable) {
renderToSimpleStream(input, context, {
push(content) {
if (content != null) {
writable.write(content);
} else {
writable.end();
}
},
destroy(err) {
writable.destroy(err);
}
});
}
function renderToWebStream(input, context = {}) {
if (typeof ReadableStream !== "function") {
throw new Error(
`ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.`
);
}
const encoder = new TextEncoder();
let cancelled = false;
return new ReadableStream({
start(controller) {
renderToSimpleStream(input, context, {
push(content) {
if (cancelled)
return;
if (content != null) {
controller.enqueue(encoder.encode(content));
} else {
controller.close();
}
},
destroy(err) {
controller.error(err);
}
});
},
cancel() {
cancelled = true;
}
});
}
function pipeToWebWritable(input, context = {}, writable) {
const writer = writable.getWriter();
const encoder = new TextEncoder();
let hasReady = false;
try {
hasReady = shared.isPromise(writer.ready);
} catch (e) {
}
renderToSimpleStream(input, context, {
async push(content) {
if (hasReady) {
await writer.ready;
}
if (content != null) {
return writer.write(encoder.encode(content));
} else {
return writer.close();
}
},
destroy(err) {
console.log(err);
writer.close();
}
});
}
Vue.initDirectivesForSSR();
exports.ssrIncludeBooleanAttr = shared.includeBooleanAttr;
exports.pipeToNodeWritable = pipeToNodeWritable;
exports.pipeToWebWritable = pipeToWebWritable;
exports.renderToNodeStream = renderToNodeStream;
exports.renderToSimpleStream = renderToSimpleStream;
exports.renderToStream = renderToStream;
exports.renderToString = renderToString;
exports.renderToWebStream = renderToWebStream;
exports.ssrGetDirectiveProps = ssrGetDirectiveProps;
exports.ssrGetDynamicModelProps = ssrGetDynamicModelProps;
exports.ssrInterpolate = ssrInterpolate;
exports.ssrLooseContain = ssrLooseContain;
exports.ssrLooseEqual = ssrLooseEqual;
exports.ssrRenderAttr = ssrRenderAttr;
exports.ssrRenderAttrs = ssrRenderAttrs;
exports.ssrRenderClass = ssrRenderClass;
exports.ssrRenderComponent = ssrRenderComponent;
exports.ssrRenderDynamicAttr = ssrRenderDynamicAttr;
exports.ssrRenderDynamicModel = ssrRenderDynamicModel;
exports.ssrRenderList = ssrRenderList;
exports.ssrRenderSlot = ssrRenderSlot;
exports.ssrRenderSlotInner = ssrRenderSlotInner;
exports.ssrRenderStyle = ssrRenderStyle;
exports.ssrRenderSuspense = ssrRenderSuspense;
exports.ssrRenderTeleport = ssrRenderTeleport;
exports.ssrRenderVNode = renderVNode;

View File

@ -0,0 +1,54 @@
{
"name": "@vue/server-renderer",
"version": "3.4.5",
"description": "@vue/server-renderer",
"main": "index.js",
"module": "dist/server-renderer.esm-bundler.js",
"types": "dist/server-renderer.d.ts",
"files": [
"index.js",
"dist"
],
"exports": {
".": {
"types": "./dist/server-renderer.d.ts",
"node": {
"production": "./dist/server-renderer.cjs.prod.js",
"development": "./dist/server-renderer.cjs.js",
"default": "./dist/server-renderer.cjs.prod.js"
},
"import": "./dist/server-renderer.esm-bundler.js",
"require": "./index.js"
},
"./*": "./*"
},
"buildOptions": {
"name": "VueServerRenderer",
"formats": [
"esm-bundler",
"esm-browser",
"cjs"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core.git",
"directory": "packages/server-renderer"
},
"keywords": [
"vue"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/core/issues"
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/server-renderer#readme",
"peerDependencies": {
"vue": "3.4.5"
},
"dependencies": {
"@vue/shared": "3.4.5",
"@vue/compiler-ssr": "3.4.5"
}
}

View File

@ -0,0 +1,548 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function makeMap(str, expectsLowerCase) {
const set = new Set(str.split(","));
return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
}
const EMPTY_OBJ = {};
const EMPTY_ARR = [];
const NOOP = () => {
};
const NO = () => false;
const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter
(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97);
const isModelListener = (key) => key.startsWith("onUpdate:");
const extend = Object.assign;
const remove = (arr, el) => {
const i = arr.indexOf(el);
if (i > -1) {
arr.splice(i, 1);
}
};
const hasOwnProperty = Object.prototype.hasOwnProperty;
const hasOwn = (val, key) => hasOwnProperty.call(val, key);
const isArray = Array.isArray;
const isMap = (val) => toTypeString(val) === "[object Map]";
const isSet = (val) => toTypeString(val) === "[object Set]";
const isDate = (val) => toTypeString(val) === "[object Date]";
const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
const isFunction = (val) => typeof val === "function";
const isString = (val) => typeof val === "string";
const isSymbol = (val) => typeof val === "symbol";
const isObject = (val) => val !== null && typeof val === "object";
const isPromise = (val) => {
return (isObject(val) || isFunction(val)) && isFunction(val.then) && isFunction(val.catch);
};
const objectToString = Object.prototype.toString;
const toTypeString = (value) => objectToString.call(value);
const toRawType = (value) => {
return toTypeString(value).slice(8, -1);
};
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
const isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key;
const isReservedProp = /* @__PURE__ */ makeMap(
// the leading comma is intentional so empty string "" is also included
",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
);
const isBuiltInDirective = /* @__PURE__ */ makeMap(
"bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
);
const cacheStringFunction = (fn) => {
const cache = /* @__PURE__ */ Object.create(null);
return (str) => {
const hit = cache[str];
return hit || (cache[str] = fn(str));
};
};
const camelizeRE = /-(\w)/g;
const camelize = cacheStringFunction((str) => {
return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : "");
});
const hyphenateRE = /\B([A-Z])/g;
const hyphenate = cacheStringFunction(
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
);
const capitalize = cacheStringFunction((str) => {
return str.charAt(0).toUpperCase() + str.slice(1);
});
const toHandlerKey = cacheStringFunction((str) => {
const s = str ? `on${capitalize(str)}` : ``;
return s;
});
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
const invokeArrayFns = (fns, arg) => {
for (let i = 0; i < fns.length; i++) {
fns[i](arg);
}
};
const def = (obj, key, value) => {
Object.defineProperty(obj, key, {
configurable: true,
enumerable: false,
value
});
};
const looseToNumber = (val) => {
const n = parseFloat(val);
return isNaN(n) ? val : n;
};
const toNumber = (val) => {
const n = isString(val) ? Number(val) : NaN;
return isNaN(n) ? val : n;
};
let _globalThis;
const getGlobalThis = () => {
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
};
const identRE = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
function genPropsAccessExp(name) {
return identRE.test(name) ? `__props.${name}` : `__props[${JSON.stringify(name)}]`;
}
const PatchFlags = {
"TEXT": 1,
"1": "TEXT",
"CLASS": 2,
"2": "CLASS",
"STYLE": 4,
"4": "STYLE",
"PROPS": 8,
"8": "PROPS",
"FULL_PROPS": 16,
"16": "FULL_PROPS",
"NEED_HYDRATION": 32,
"32": "NEED_HYDRATION",
"STABLE_FRAGMENT": 64,
"64": "STABLE_FRAGMENT",
"KEYED_FRAGMENT": 128,
"128": "KEYED_FRAGMENT",
"UNKEYED_FRAGMENT": 256,
"256": "UNKEYED_FRAGMENT",
"NEED_PATCH": 512,
"512": "NEED_PATCH",
"DYNAMIC_SLOTS": 1024,
"1024": "DYNAMIC_SLOTS",
"DEV_ROOT_FRAGMENT": 2048,
"2048": "DEV_ROOT_FRAGMENT",
"HOISTED": -1,
"-1": "HOISTED",
"BAIL": -2,
"-2": "BAIL"
};
const PatchFlagNames = {
[1]: `TEXT`,
[2]: `CLASS`,
[4]: `STYLE`,
[8]: `PROPS`,
[16]: `FULL_PROPS`,
[32]: `NEED_HYDRATION`,
[64]: `STABLE_FRAGMENT`,
[128]: `KEYED_FRAGMENT`,
[256]: `UNKEYED_FRAGMENT`,
[512]: `NEED_PATCH`,
[1024]: `DYNAMIC_SLOTS`,
[2048]: `DEV_ROOT_FRAGMENT`,
[-1]: `HOISTED`,
[-2]: `BAIL`
};
const ShapeFlags = {
"ELEMENT": 1,
"1": "ELEMENT",
"FUNCTIONAL_COMPONENT": 2,
"2": "FUNCTIONAL_COMPONENT",
"STATEFUL_COMPONENT": 4,
"4": "STATEFUL_COMPONENT",
"TEXT_CHILDREN": 8,
"8": "TEXT_CHILDREN",
"ARRAY_CHILDREN": 16,
"16": "ARRAY_CHILDREN",
"SLOTS_CHILDREN": 32,
"32": "SLOTS_CHILDREN",
"TELEPORT": 64,
"64": "TELEPORT",
"SUSPENSE": 128,
"128": "SUSPENSE",
"COMPONENT_SHOULD_KEEP_ALIVE": 256,
"256": "COMPONENT_SHOULD_KEEP_ALIVE",
"COMPONENT_KEPT_ALIVE": 512,
"512": "COMPONENT_KEPT_ALIVE",
"COMPONENT": 6,
"6": "COMPONENT"
};
const SlotFlags = {
"STABLE": 1,
"1": "STABLE",
"DYNAMIC": 2,
"2": "DYNAMIC",
"FORWARDED": 3,
"3": "FORWARDED"
};
const slotFlagsText = {
[1]: "STABLE",
[2]: "DYNAMIC",
[3]: "FORWARDED"
};
const GLOBALS_ALLOWED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error";
const isGloballyAllowed = /* @__PURE__ */ makeMap(GLOBALS_ALLOWED);
const isGloballyWhitelisted = isGloballyAllowed;
const range = 2;
function generateCodeFrame(source, start = 0, end = source.length) {
let lines = source.split(/(\r?\n)/);
const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);
lines = lines.filter((_, idx) => idx % 2 === 0);
let count = 0;
const res = [];
for (let i = 0; i < lines.length; i++) {
count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);
if (count >= start) {
for (let j = i - range; j <= i + range || end > count; j++) {
if (j < 0 || j >= lines.length)
continue;
const line = j + 1;
res.push(
`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`
);
const lineLength = lines[j].length;
const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;
if (j === i) {
const pad = start - (count - (lineLength + newLineSeqLength));
const length = Math.max(
1,
end > count ? lineLength - pad : end - start
);
res.push(` | ` + " ".repeat(pad) + "^".repeat(length));
} else if (j > i) {
if (end > count) {
const length = Math.max(Math.min(end - count, lineLength), 1);
res.push(` | ` + "^".repeat(length));
}
count += lineLength + newLineSeqLength;
}
}
break;
}
}
return res.join("\n");
}
function normalizeStyle(value) {
if (isArray(value)) {
const res = {};
for (let i = 0; i < value.length; i++) {
const item = value[i];
const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
if (normalized) {
for (const key in normalized) {
res[key] = normalized[key];
}
}
}
return res;
} else if (isString(value) || isObject(value)) {
return value;
}
}
const listDelimiterRE = /;(?![^(]*\))/g;
const propertyDelimiterRE = /:([^]+)/;
const styleCommentRE = /\/\*[^]*?\*\//g;
function parseStringStyle(cssText) {
const ret = {};
cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
if (item) {
const tmp = item.split(propertyDelimiterRE);
tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
}
});
return ret;
}
function stringifyStyle(styles) {
let ret = "";
if (!styles || isString(styles)) {
return ret;
}
for (const key in styles) {
const value = styles[key];
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
if (isString(value) || typeof value === "number") {
ret += `${normalizedKey}:${value};`;
}
}
return ret;
}
function normalizeClass(value) {
let res = "";
if (isString(value)) {
res = value;
} else if (isArray(value)) {
for (let i = 0; i < value.length; i++) {
const normalized = normalizeClass(value[i]);
if (normalized) {
res += normalized + " ";
}
}
} else if (isObject(value)) {
for (const name in value) {
if (value[name]) {
res += name + " ";
}
}
}
return res.trim();
}
function normalizeProps(props) {
if (!props)
return null;
let { class: klass, style } = props;
if (klass && !isString(klass)) {
props.class = normalizeClass(klass);
}
if (style) {
props.style = normalizeStyle(style);
}
return props;
}
const HTML_TAGS = "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";
const SVG_TAGS = "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";
const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics";
const VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr";
const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
const isBooleanAttr = /* @__PURE__ */ makeMap(
specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
);
function includeBooleanAttr(value) {
return !!value || value === "";
}
const unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/;
const attrValidationCache = {};
function isSSRSafeAttrName(name) {
if (attrValidationCache.hasOwnProperty(name)) {
return attrValidationCache[name];
}
const isUnsafe = unsafeAttrCharRE.test(name);
if (isUnsafe) {
console.error(`unsafe attribute name: ${name}`);
}
return attrValidationCache[name] = !isUnsafe;
}
const propsToAttrMap = {
acceptCharset: "accept-charset",
className: "class",
htmlFor: "for",
httpEquiv: "http-equiv"
};
const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`
);
const isKnownSvgAttr = /* @__PURE__ */ makeMap(
`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
);
const escapeRE = /["'&<>]/;
function escapeHtml(string) {
const str = "" + string;
const match = escapeRE.exec(str);
if (!match) {
return str;
}
let html = "";
let escaped;
let index;
let lastIndex = 0;
for (index = match.index; index < str.length; index++) {
switch (str.charCodeAt(index)) {
case 34:
escaped = "&quot;";
break;
case 38:
escaped = "&amp;";
break;
case 39:
escaped = "&#39;";
break;
case 60:
escaped = "&lt;";
break;
case 62:
escaped = "&gt;";
break;
default:
continue;
}
if (lastIndex !== index) {
html += str.slice(lastIndex, index);
}
lastIndex = index + 1;
html += escaped;
}
return lastIndex !== index ? html + str.slice(lastIndex, index) : html;
}
const commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g;
function escapeHtmlComment(src) {
return src.replace(commentStripRE, "");
}
function looseCompareArrays(a, b) {
if (a.length !== b.length)
return false;
let equal = true;
for (let i = 0; equal && i < a.length; i++) {
equal = looseEqual(a[i], b[i]);
}
return equal;
}
function looseEqual(a, b) {
if (a === b)
return true;
let aValidType = isDate(a);
let bValidType = isDate(b);
if (aValidType || bValidType) {
return aValidType && bValidType ? a.getTime() === b.getTime() : false;
}
aValidType = isSymbol(a);
bValidType = isSymbol(b);
if (aValidType || bValidType) {
return a === b;
}
aValidType = isArray(a);
bValidType = isArray(b);
if (aValidType || bValidType) {
return aValidType && bValidType ? looseCompareArrays(a, b) : false;
}
aValidType = isObject(a);
bValidType = isObject(b);
if (aValidType || bValidType) {
if (!aValidType || !bValidType) {
return false;
}
const aKeysCount = Object.keys(a).length;
const bKeysCount = Object.keys(b).length;
if (aKeysCount !== bKeysCount) {
return false;
}
for (const key in a) {
const aHasKey = a.hasOwnProperty(key);
const bHasKey = b.hasOwnProperty(key);
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
return false;
}
}
}
return String(a) === String(b);
}
function looseIndexOf(arr, val) {
return arr.findIndex((item) => looseEqual(item, val));
}
const toDisplayString = (val) => {
return isString(val) ? val : val == null ? "" : isArray(val) || isObject(val) && (val.toString === objectToString || !isFunction(val.toString)) ? JSON.stringify(val, replacer, 2) : String(val);
};
const replacer = (_key, val) => {
if (val && val.__v_isRef) {
return replacer(_key, val.value);
} else if (isMap(val)) {
return {
[`Map(${val.size})`]: [...val.entries()].reduce(
(entries, [key, val2], i) => {
entries[stringifySymbol(key, i) + " =>"] = val2;
return entries;
},
{}
)
};
} else if (isSet(val)) {
return {
[`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v))
};
} else if (isSymbol(val)) {
return stringifySymbol(val);
} else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {
return String(val);
}
return val;
};
const stringifySymbol = (v, i = "") => {
var _a;
return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
};
exports.EMPTY_ARR = EMPTY_ARR;
exports.EMPTY_OBJ = EMPTY_OBJ;
exports.NO = NO;
exports.NOOP = NOOP;
exports.PatchFlagNames = PatchFlagNames;
exports.PatchFlags = PatchFlags;
exports.ShapeFlags = ShapeFlags;
exports.SlotFlags = SlotFlags;
exports.camelize = camelize;
exports.capitalize = capitalize;
exports.def = def;
exports.escapeHtml = escapeHtml;
exports.escapeHtmlComment = escapeHtmlComment;
exports.extend = extend;
exports.genPropsAccessExp = genPropsAccessExp;
exports.generateCodeFrame = generateCodeFrame;
exports.getGlobalThis = getGlobalThis;
exports.hasChanged = hasChanged;
exports.hasOwn = hasOwn;
exports.hyphenate = hyphenate;
exports.includeBooleanAttr = includeBooleanAttr;
exports.invokeArrayFns = invokeArrayFns;
exports.isArray = isArray;
exports.isBooleanAttr = isBooleanAttr;
exports.isBuiltInDirective = isBuiltInDirective;
exports.isDate = isDate;
exports.isFunction = isFunction;
exports.isGloballyAllowed = isGloballyAllowed;
exports.isGloballyWhitelisted = isGloballyWhitelisted;
exports.isHTMLTag = isHTMLTag;
exports.isIntegerKey = isIntegerKey;
exports.isKnownHtmlAttr = isKnownHtmlAttr;
exports.isKnownSvgAttr = isKnownSvgAttr;
exports.isMap = isMap;
exports.isMathMLTag = isMathMLTag;
exports.isModelListener = isModelListener;
exports.isObject = isObject;
exports.isOn = isOn;
exports.isPlainObject = isPlainObject;
exports.isPromise = isPromise;
exports.isRegExp = isRegExp;
exports.isReservedProp = isReservedProp;
exports.isSSRSafeAttrName = isSSRSafeAttrName;
exports.isSVGTag = isSVGTag;
exports.isSet = isSet;
exports.isSpecialBooleanAttr = isSpecialBooleanAttr;
exports.isString = isString;
exports.isSymbol = isSymbol;
exports.isVoidTag = isVoidTag;
exports.looseEqual = looseEqual;
exports.looseIndexOf = looseIndexOf;
exports.looseToNumber = looseToNumber;
exports.makeMap = makeMap;
exports.normalizeClass = normalizeClass;
exports.normalizeProps = normalizeProps;
exports.normalizeStyle = normalizeStyle;
exports.objectToString = objectToString;
exports.parseStringStyle = parseStringStyle;
exports.propsToAttrMap = propsToAttrMap;
exports.remove = remove;
exports.slotFlagsText = slotFlagsText;
exports.stringifyStyle = stringifyStyle;
exports.toDisplayString = toDisplayString;
exports.toHandlerKey = toHandlerKey;
exports.toNumber = toNumber;
exports.toRawType = toRawType;
exports.toTypeString = toTypeString;

46
.output/server/node_modules/@vue/shared/package.json generated vendored Normal file
View File

@ -0,0 +1,46 @@
{
"name": "@vue/shared",
"version": "3.4.5",
"description": "internal utils shared across @vue packages",
"main": "index.js",
"module": "dist/shared.esm-bundler.js",
"types": "dist/shared.d.ts",
"files": [
"index.js",
"dist"
],
"exports": {
".": {
"types": "./dist/shared.d.ts",
"node": {
"production": "./dist/shared.cjs.prod.js",
"development": "./dist/shared.cjs.js",
"default": "./dist/shared.cjs.prod.js"
},
"import": "./dist/shared.esm-bundler.js",
"require": "./index.js"
},
"./*": "./*"
},
"sideEffects": false,
"buildOptions": {
"formats": [
"esm-bundler",
"cjs"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core.git",
"directory": "packages/shared"
},
"keywords": [
"vue"
],
"author": "Evan You",
"license": "MIT",
"bugs": {
"url": "https://github.com/vuejs/core/issues"
},
"homepage": "https://github.com/vuejs/core/tree/main/packages/shared#readme"
}

6588
.output/server/node_modules/@vueuse/core/index.mjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

47
.output/server/node_modules/@vueuse/core/package.json generated vendored Normal file
View File

@ -0,0 +1,47 @@
{
"name": "@vueuse/core",
"version": "9.13.0",
"description": "Collection of essential Vue Composition Utilities",
"author": "Anthony Fu <https://github.com/antfu>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/vueuse/vueuse#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vueuse/vueuse.git",
"directory": "packages/core"
},
"bugs": {
"url": "https://github.com/vueuse/vueuse/issues"
},
"keywords": [
"vue",
"vue-use",
"utils"
],
"sideEffects": false,
"exports": {
".": {
"types": "./index.d.ts",
"require": "./index.cjs",
"import": "./index.mjs"
},
"./*": "./*",
"./metadata": {
"types": "./metadata.d.ts",
"require": "./metadata.cjs",
"import": "./metadata.mjs"
}
},
"main": "./index.cjs",
"module": "./index.mjs",
"unpkg": "./index.iife.min.js",
"jsdelivr": "./index.iife.min.js",
"types": "./index.d.ts",
"dependencies": {
"@types/web-bluetooth": "^0.0.16",
"@vueuse/metadata": "9.13.0",
"@vueuse/shared": "9.13.0",
"vue-demi": "*"
}
}

1569
.output/server/node_modules/@vueuse/shared/index.mjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
{
"name": "@vueuse/shared",
"version": "9.13.0",
"author": "Anthony Fu <https://github.com/antfu>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/vueuse/vueuse/tree/main/packages/shared#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vueuse/vueuse.git",
"directory": "packages/shared"
},
"bugs": {
"url": "https://github.com/vueuse/vueuse/issues"
},
"keywords": [
"vue",
"vue-use",
"utils"
],
"sideEffects": false,
"exports": {
".": {
"types": "./index.d.ts",
"require": "./index.cjs",
"import": "./index.mjs"
},
"./*": "./*"
},
"main": "./index.cjs",
"module": "./index.mjs",
"unpkg": "./index.iife.min.js",
"jsdelivr": "./index.iife.min.js",
"types": "./index.d.ts",
"dependencies": {
"vue-demi": "*"
}
}

6
.output/server/node_modules/asynckit/index.js generated vendored Normal file
View File

@ -0,0 +1,6 @@
module.exports =
{
parallel : require('./parallel.js'),
serial : require('./serial.js'),
serialOrdered : require('./serialOrdered.js')
};

29
.output/server/node_modules/asynckit/lib/abort.js generated vendored Normal file
View File

@ -0,0 +1,29 @@
// API
module.exports = abort;
/**
* Aborts leftover active jobs
*
* @param {object} state - current state object
*/
function abort(state)
{
Object.keys(state.jobs).forEach(clean.bind(state));
// reset leftover jobs
state.jobs = {};
}
/**
* Cleans up leftover job by invoking abort function for the provided job id
*
* @this state
* @param {string|number} key - job id to abort
*/
function clean(key)
{
if (typeof this.jobs[key] == 'function')
{
this.jobs[key]();
}
}

34
.output/server/node_modules/asynckit/lib/async.js generated vendored Normal file
View File

@ -0,0 +1,34 @@
var defer = require('./defer.js');
// API
module.exports = async;
/**
* Runs provided callback asynchronously
* even if callback itself is not
*
* @param {function} callback - callback to invoke
* @returns {function} - augmented callback
*/
function async(callback)
{
var isAsync = false;
// check if async happened
defer(function() { isAsync = true; });
return function async_callback(err, result)
{
if (isAsync)
{
callback(err, result);
}
else
{
defer(function nextTick_callback()
{
callback(err, result);
});
}
};
}

26
.output/server/node_modules/asynckit/lib/defer.js generated vendored Normal file
View File

@ -0,0 +1,26 @@
module.exports = defer;
/**
* Runs provided function on next iteration of the event loop
*
* @param {function} fn - function to run
*/
function defer(fn)
{
var nextTick = typeof setImmediate == 'function'
? setImmediate
: (
typeof process == 'object' && typeof process.nextTick == 'function'
? process.nextTick
: null
);
if (nextTick)
{
nextTick(fn);
}
else
{
setTimeout(fn, 0);
}
}

75
.output/server/node_modules/asynckit/lib/iterate.js generated vendored Normal file
View File

@ -0,0 +1,75 @@
var async = require('./async.js')
, abort = require('./abort.js')
;
// API
module.exports = iterate;
/**
* Iterates over each job object
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {object} state - current job status
* @param {function} callback - invoked when all elements processed
*/
function iterate(list, iterator, state, callback)
{
// store current index
var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
{
// don't repeat yourself
// skip secondary callbacks
if (!(key in state.jobs))
{
return;
}
// clean up jobs
delete state.jobs[key];
if (error)
{
// don't process rest of the results
// stop still active jobs
// and reset the list
abort(state);
}
else
{
state.results[key] = output;
}
// return salvaged results
callback(error, state.results);
});
}
/**
* Runs iterator over provided job element
*
* @param {function} iterator - iterator to invoke
* @param {string|number} key - key/index of the element in the list of jobs
* @param {mixed} item - job description
* @param {function} callback - invoked after iterator is done with the job
* @returns {function|mixed} - job abort function or something else
*/
function runJob(iterator, key, item, callback)
{
var aborter;
// allow shortcut if iterator expects only two arguments
if (iterator.length == 2)
{
aborter = iterator(item, async(callback));
}
// otherwise go with full three arguments
else
{
aborter = iterator(item, key, async(callback));
}
return aborter;
}

37
.output/server/node_modules/asynckit/lib/state.js generated vendored Normal file
View File

@ -0,0 +1,37 @@
// API
module.exports = state;
/**
* Creates initial state object
* for iteration over list
*
* @param {array|object} list - list to iterate over
* @param {function|null} sortMethod - function to use for keys sort,
* or `null` to keep them as is
* @returns {object} - initial state object
*/
function state(list, sortMethod)
{
var isNamedList = !Array.isArray(list)
, initState =
{
index : 0,
keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
jobs : {},
results : isNamedList ? {} : [],
size : isNamedList ? Object.keys(list).length : list.length
}
;
if (sortMethod)
{
// sort array keys based on it's values
// sort object's keys just on own merit
initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
{
return sortMethod(list[a], list[b]);
});
}
return initState;
}

29
.output/server/node_modules/asynckit/lib/terminator.js generated vendored Normal file
View File

@ -0,0 +1,29 @@
var abort = require('./abort.js')
, async = require('./async.js')
;
// API
module.exports = terminator;
/**
* Terminates jobs in the attached state context
*
* @this AsyncKitState#
* @param {function} callback - final callback to invoke after termination
*/
function terminator(callback)
{
if (!Object.keys(this.jobs).length)
{
return;
}
// fast forward iteration index
this.index = this.size;
// abort jobs
abort(this);
// send back results we have so far
async(callback)(null, this.results);
}

63
.output/server/node_modules/asynckit/package.json generated vendored Normal file
View File

@ -0,0 +1,63 @@
{
"name": "asynckit",
"version": "0.4.0",
"description": "Minimal async jobs utility library, with streams support",
"main": "index.js",
"scripts": {
"clean": "rimraf coverage",
"lint": "eslint *.js lib/*.js test/*.js",
"test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec",
"win-test": "tape test/test-*.js",
"browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec",
"report": "istanbul report",
"size": "browserify index.js | size-table asynckit",
"debug": "tape test/test-*.js"
},
"pre-commit": [
"clean",
"lint",
"test",
"browser",
"report",
"size"
],
"repository": {
"type": "git",
"url": "git+https://github.com/alexindigo/asynckit.git"
},
"keywords": [
"async",
"jobs",
"parallel",
"serial",
"iterator",
"array",
"object",
"stream",
"destroy",
"terminate",
"abort"
],
"author": "Alex Indigo <iam@alexindigo.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/alexindigo/asynckit/issues"
},
"homepage": "https://github.com/alexindigo/asynckit#readme",
"devDependencies": {
"browserify": "^13.0.0",
"browserify-istanbul": "^2.0.0",
"coveralls": "^2.11.9",
"eslint": "^2.9.0",
"istanbul": "^0.4.3",
"obake": "^0.1.2",
"phantomjs-prebuilt": "^2.1.7",
"pre-commit": "^1.1.3",
"reamde": "^1.1.0",
"rimraf": "^2.5.2",
"size-table": "^0.2.0",
"tap-spec": "^4.1.1",
"tape": "^4.5.1"
},
"dependencies": {}
}

43
.output/server/node_modules/asynckit/parallel.js generated vendored Normal file
View File

@ -0,0 +1,43 @@
var iterate = require('./lib/iterate.js')
, initState = require('./lib/state.js')
, terminator = require('./lib/terminator.js')
;
// Public API
module.exports = parallel;
/**
* Runs iterator over provided array elements in parallel
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function parallel(list, iterator, callback)
{
var state = initState(list);
while (state.index < (state['keyedList'] || list).length)
{
iterate(list, iterator, state, function(error, result)
{
if (error)
{
callback(error, result);
return;
}
// looks like it's the last one
if (Object.keys(state.jobs).length === 0)
{
callback(null, state.results);
return;
}
});
state.index++;
}
return terminator.bind(state, callback);
}

17
.output/server/node_modules/asynckit/serial.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
var serialOrdered = require('./serialOrdered.js');
// Public API
module.exports = serial;
/**
* Runs iterator over provided array elements in series
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function serial(list, iterator, callback)
{
return serialOrdered(list, iterator, null, callback);
}

75
.output/server/node_modules/asynckit/serialOrdered.js generated vendored Normal file
View File

@ -0,0 +1,75 @@
var iterate = require('./lib/iterate.js')
, initState = require('./lib/state.js')
, terminator = require('./lib/terminator.js')
;
// Public API
module.exports = serialOrdered;
// sorting helpers
module.exports.ascending = ascending;
module.exports.descending = descending;
/**
* Runs iterator over provided sorted array elements in series
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} sortMethod - custom sort function
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function serialOrdered(list, iterator, sortMethod, callback)
{
var state = initState(list, sortMethod);
iterate(list, iterator, state, function iteratorHandler(error, result)
{
if (error)
{
callback(error, result);
return;
}
state.index++;
// are we there yet?
if (state.index < (state['keyedList'] || list).length)
{
iterate(list, iterator, state, iteratorHandler);
return;
}
// done here
callback(null, state.results);
});
return terminator.bind(state, callback);
}
/*
* -- Sort methods
*/
/**
* sort helper to sort array elements in ascending order
*
* @param {mixed} a - an item to compare
* @param {mixed} b - an item to compare
* @returns {number} - comparison result
*/
function ascending(a, b)
{
return a < b ? -1 : a > b ? 1 : 0;
}
/**
* sort helper to sort array elements in descending order
*
* @param {mixed} a - an item to compare
* @param {mixed} b - an item to compare
* @returns {number} - comparison result
*/
function descending(a, b)
{
return -1 * ascending(a, b);
}

43
.output/server/node_modules/axios/index.js generated vendored Normal file
View File

@ -0,0 +1,43 @@
import axios from './lib/axios.js';
// This module is intended to unwrap Axios default export as named.
// Keep top-level export same with static properties
// so that it can keep same with es module or cjs
const {
Axios,
AxiosError,
CanceledError,
isCancel,
CancelToken,
VERSION,
all,
Cancel,
isAxiosError,
spread,
toFormData,
AxiosHeaders,
HttpStatusCode,
formToJSON,
getAdapter,
mergeConfig
} = axios;
export {
axios as default,
Axios,
AxiosError,
CanceledError,
isCancel,
CancelToken,
VERSION,
all,
Cancel,
isAxiosError,
spread,
toFormData,
AxiosHeaders,
HttpStatusCode,
formToJSON,
getAdapter,
mergeConfig
}

View File

@ -0,0 +1,77 @@
import utils from '../utils.js';
import httpAdapter from './http.js';
import xhrAdapter from './xhr.js';
import AxiosError from "../core/AxiosError.js";
const knownAdapters = {
http: httpAdapter,
xhr: xhrAdapter
}
utils.forEach(knownAdapters, (fn, value) => {
if (fn) {
try {
Object.defineProperty(fn, 'name', {value});
} catch (e) {
// eslint-disable-next-line no-empty
}
Object.defineProperty(fn, 'adapterName', {value});
}
});
const renderReason = (reason) => `- ${reason}`;
const isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;
export default {
getAdapter: (adapters) => {
adapters = utils.isArray(adapters) ? adapters : [adapters];
const {length} = adapters;
let nameOrAdapter;
let adapter;
const rejectedReasons = {};
for (let i = 0; i < length; i++) {
nameOrAdapter = adapters[i];
let id;
adapter = nameOrAdapter;
if (!isResolvedHandle(nameOrAdapter)) {
adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
if (adapter === undefined) {
throw new AxiosError(`Unknown adapter '${id}'`);
}
}
if (adapter) {
break;
}
rejectedReasons[id || '#' + i] = adapter;
}
if (!adapter) {
const reasons = Object.entries(rejectedReasons)
.map(([id, state]) => `adapter ${id} ` +
(state === false ? 'is not supported by the environment' : 'is not available in the build')
);
let s = length ?
(reasons.length > 1 ? 'since :\n' + reasons.map(renderReason).join('\n') : ' ' + renderReason(reasons[0])) :
'as no adapter specified';
throw new AxiosError(
`There is no suitable adapter to dispatch the request ` + s,
'ERR_NOT_SUPPORT'
);
}
return adapter;
},
adapters: knownAdapters
}

681
.output/server/node_modules/axios/lib/adapters/http.js generated vendored Normal file
View File

@ -0,0 +1,681 @@
'use strict';
import utils from './../utils.js';
import settle from './../core/settle.js';
import buildFullPath from '../core/buildFullPath.js';
import buildURL from './../helpers/buildURL.js';
import {getProxyForUrl} from 'proxy-from-env';
import http from 'http';
import https from 'https';
import util from 'util';
import followRedirects from 'follow-redirects';
import zlib from 'zlib';
import {VERSION} from '../env/data.js';
import transitionalDefaults from '../defaults/transitional.js';
import AxiosError from '../core/AxiosError.js';
import CanceledError from '../cancel/CanceledError.js';
import platform from '../platform/index.js';
import fromDataURI from '../helpers/fromDataURI.js';
import stream from 'stream';
import AxiosHeaders from '../core/AxiosHeaders.js';
import AxiosTransformStream from '../helpers/AxiosTransformStream.js';
import EventEmitter from 'events';
import formDataToStream from "../helpers/formDataToStream.js";
import readBlob from "../helpers/readBlob.js";
import ZlibHeaderTransformStream from '../helpers/ZlibHeaderTransformStream.js';
import callbackify from "../helpers/callbackify.js";
const zlibOptions = {
flush: zlib.constants.Z_SYNC_FLUSH,
finishFlush: zlib.constants.Z_SYNC_FLUSH
};
const brotliOptions = {
flush: zlib.constants.BROTLI_OPERATION_FLUSH,
finishFlush: zlib.constants.BROTLI_OPERATION_FLUSH
}
const isBrotliSupported = utils.isFunction(zlib.createBrotliDecompress);
const {http: httpFollow, https: httpsFollow} = followRedirects;
const isHttps = /https:?/;
const supportedProtocols = platform.protocols.map(protocol => {
return protocol + ':';
});
/**
* If the proxy or config beforeRedirects functions are defined, call them with the options
* object.
*
* @param {Object<string, any>} options - The options object that was passed to the request.
*
* @returns {Object<string, any>}
*/
function dispatchBeforeRedirect(options) {
if (options.beforeRedirects.proxy) {
options.beforeRedirects.proxy(options);
}
if (options.beforeRedirects.config) {
options.beforeRedirects.config(options);
}
}
/**
* If the proxy or config afterRedirects functions are defined, call them with the options
*
* @param {http.ClientRequestArgs} options
* @param {AxiosProxyConfig} configProxy configuration from Axios options object
* @param {string} location
*
* @returns {http.ClientRequestArgs}
*/
function setProxy(options, configProxy, location) {
let proxy = configProxy;
if (!proxy && proxy !== false) {
const proxyUrl = getProxyForUrl(location);
if (proxyUrl) {
proxy = new URL(proxyUrl);
}
}
if (proxy) {
// Basic proxy authorization
if (proxy.username) {
proxy.auth = (proxy.username || '') + ':' + (proxy.password || '');
}
if (proxy.auth) {
// Support proxy auth object form
if (proxy.auth.username || proxy.auth.password) {
proxy.auth = (proxy.auth.username || '') + ':' + (proxy.auth.password || '');
}
const base64 = Buffer
.from(proxy.auth, 'utf8')
.toString('base64');
options.headers['Proxy-Authorization'] = 'Basic ' + base64;
}
options.headers.host = options.hostname + (options.port ? ':' + options.port : '');
const proxyHost = proxy.hostname || proxy.host;
options.hostname = proxyHost;
// Replace 'host' since options is not a URL object
options.host = proxyHost;
options.port = proxy.port;
options.path = location;
if (proxy.protocol) {
options.protocol = proxy.protocol.includes(':') ? proxy.protocol : `${proxy.protocol}:`;
}
}
options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
// Configure proxy for redirected request, passing the original config proxy to apply
// the exact same logic as if the redirected request was performed by axios directly.
setProxy(redirectOptions, configProxy, redirectOptions.href);
};
}
const isHttpAdapterSupported = typeof process !== 'undefined' && utils.kindOf(process) === 'process';
// temporary hotfix
const wrapAsync = (asyncExecutor) => {
return new Promise((resolve, reject) => {
let onDone;
let isDone;
const done = (value, isRejected) => {
if (isDone) return;
isDone = true;
onDone && onDone(value, isRejected);
}
const _resolve = (value) => {
done(value);
resolve(value);
};
const _reject = (reason) => {
done(reason, true);
reject(reason);
}
asyncExecutor(_resolve, _reject, (onDoneHandler) => (onDone = onDoneHandler)).catch(_reject);
})
};
const resolveFamily = ({address, family}) => {
if (!utils.isString(address)) {
throw TypeError('address must be a string');
}
return ({
address,
family: family || (address.indexOf('.') < 0 ? 6 : 4)
});
}
const buildAddressEntry = (address, family) => resolveFamily(utils.isObject(address) ? address : {address, family});
/*eslint consistent-return:0*/
export default isHttpAdapterSupported && function httpAdapter(config) {
return wrapAsync(async function dispatchHttpRequest(resolve, reject, onDone) {
let {data, lookup, family} = config;
const {responseType, responseEncoding} = config;
const method = config.method.toUpperCase();
let isDone;
let rejected = false;
let req;
if (lookup) {
const _lookup = callbackify(lookup, (value) => utils.isArray(value) ? value : [value]);
// hotfix to support opt.all option which is required for node 20.x
lookup = (hostname, opt, cb) => {
_lookup(hostname, opt, (err, arg0, arg1) => {
const addresses = utils.isArray(arg0) ? arg0.map(addr => buildAddressEntry(addr)) : [buildAddressEntry(arg0, arg1)];
opt.all ? cb(err, addresses) : cb(err, addresses[0].address, addresses[0].family);
});
}
}
// temporary internal emitter until the AxiosRequest class will be implemented
const emitter = new EventEmitter();
const onFinished = () => {
if (config.cancelToken) {
config.cancelToken.unsubscribe(abort);
}
if (config.signal) {
config.signal.removeEventListener('abort', abort);
}
emitter.removeAllListeners();
}
onDone((value, isRejected) => {
isDone = true;
if (isRejected) {
rejected = true;
onFinished();
}
});
function abort(reason) {
emitter.emit('abort', !reason || reason.type ? new CanceledError(null, config, req) : reason);
}
emitter.once('abort', reject);
if (config.cancelToken || config.signal) {
config.cancelToken && config.cancelToken.subscribe(abort);
if (config.signal) {
config.signal.aborted ? abort() : config.signal.addEventListener('abort', abort);
}
}
// Parse url
const fullPath = buildFullPath(config.baseURL, config.url);
const parsed = new URL(fullPath, 'http://localhost');
const protocol = parsed.protocol || supportedProtocols[0];
if (protocol === 'data:') {
let convertedData;
if (method !== 'GET') {
return settle(resolve, reject, {
status: 405,
statusText: 'method not allowed',
headers: {},
config
});
}
try {
convertedData = fromDataURI(config.url, responseType === 'blob', {
Blob: config.env && config.env.Blob
});
} catch (err) {
throw AxiosError.from(err, AxiosError.ERR_BAD_REQUEST, config);
}
if (responseType === 'text') {
convertedData = convertedData.toString(responseEncoding);
if (!responseEncoding || responseEncoding === 'utf8') {
convertedData = utils.stripBOM(convertedData);
}
} else if (responseType === 'stream') {
convertedData = stream.Readable.from(convertedData);
}
return settle(resolve, reject, {
data: convertedData,
status: 200,
statusText: 'OK',
headers: new AxiosHeaders(),
config
});
}
if (supportedProtocols.indexOf(protocol) === -1) {
return reject(new AxiosError(
'Unsupported protocol ' + protocol,
AxiosError.ERR_BAD_REQUEST,
config
));
}
const headers = AxiosHeaders.from(config.headers).normalize();
// Set User-Agent (required by some servers)
// See https://github.com/axios/axios/issues/69
// User-Agent is specified; handle case where no UA header is desired
// Only set header if it hasn't been set in config
headers.set('User-Agent', 'axios/' + VERSION, false);
const onDownloadProgress = config.onDownloadProgress;
const onUploadProgress = config.onUploadProgress;
const maxRate = config.maxRate;
let maxUploadRate = undefined;
let maxDownloadRate = undefined;
// support for spec compliant FormData objects
if (utils.isSpecCompliantForm(data)) {
const userBoundary = headers.getContentType(/boundary=([-_\w\d]{10,70})/i);
data = formDataToStream(data, (formHeaders) => {
headers.set(formHeaders);
}, {
tag: `axios-${VERSION}-boundary`,
boundary: userBoundary && userBoundary[1] || undefined
});
// support for https://www.npmjs.com/package/form-data api
} else if (utils.isFormData(data) && utils.isFunction(data.getHeaders)) {
headers.set(data.getHeaders());
if (!headers.hasContentLength()) {
try {
const knownLength = await util.promisify(data.getLength).call(data);
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
/*eslint no-empty:0*/
} catch (e) {
}
}
} else if (utils.isBlob(data)) {
data.size && headers.setContentType(data.type || 'application/octet-stream');
headers.setContentLength(data.size || 0);
data = stream.Readable.from(readBlob(data));
} else if (data && !utils.isStream(data)) {
if (Buffer.isBuffer(data)) {
// Nothing to do...
} else if (utils.isArrayBuffer(data)) {
data = Buffer.from(new Uint8Array(data));
} else if (utils.isString(data)) {
data = Buffer.from(data, 'utf-8');
} else {
return reject(new AxiosError(
'Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream',
AxiosError.ERR_BAD_REQUEST,
config
));
}
// Add Content-Length header if data exists
headers.setContentLength(data.length, false);
if (config.maxBodyLength > -1 && data.length > config.maxBodyLength) {
return reject(new AxiosError(
'Request body larger than maxBodyLength limit',
AxiosError.ERR_BAD_REQUEST,
config
));
}
}
const contentLength = utils.toFiniteNumber(headers.getContentLength());
if (utils.isArray(maxRate)) {
maxUploadRate = maxRate[0];
maxDownloadRate = maxRate[1];
} else {
maxUploadRate = maxDownloadRate = maxRate;
}
if (data && (onUploadProgress || maxUploadRate)) {
if (!utils.isStream(data)) {
data = stream.Readable.from(data, {objectMode: false});
}
data = stream.pipeline([data, new AxiosTransformStream({
length: contentLength,
maxRate: utils.toFiniteNumber(maxUploadRate)
})], utils.noop);
onUploadProgress && data.on('progress', progress => {
onUploadProgress(Object.assign(progress, {
upload: true
}));
});
}
// HTTP basic authentication
let auth = undefined;
if (config.auth) {
const username = config.auth.username || '';
const password = config.auth.password || '';
auth = username + ':' + password;
}
if (!auth && parsed.username) {
const urlUsername = parsed.username;
const urlPassword = parsed.password;
auth = urlUsername + ':' + urlPassword;
}
auth && headers.delete('authorization');
let path;
try {
path = buildURL(
parsed.pathname + parsed.search,
config.params,
config.paramsSerializer
).replace(/^\?/, '');
} catch (err) {
const customErr = new Error(err.message);
customErr.config = config;
customErr.url = config.url;
customErr.exists = true;
return reject(customErr);
}
headers.set(
'Accept-Encoding',
'gzip, compress, deflate' + (isBrotliSupported ? ', br' : ''), false
);
const options = {
path,
method: method,
headers: headers.toJSON(),
agents: { http: config.httpAgent, https: config.httpsAgent },
auth,
protocol,
family,
beforeRedirect: dispatchBeforeRedirect,
beforeRedirects: {}
};
// cacheable-lookup integration hotfix
!utils.isUndefined(lookup) && (options.lookup = lookup);
if (config.socketPath) {
options.socketPath = config.socketPath;
} else {
options.hostname = parsed.hostname;
options.port = parsed.port;
setProxy(options, config.proxy, protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path);
}
let transport;
const isHttpsRequest = isHttps.test(options.protocol);
options.agent = isHttpsRequest ? config.httpsAgent : config.httpAgent;
if (config.transport) {
transport = config.transport;
} else if (config.maxRedirects === 0) {
transport = isHttpsRequest ? https : http;
} else {
if (config.maxRedirects) {
options.maxRedirects = config.maxRedirects;
}
if (config.beforeRedirect) {
options.beforeRedirects.config = config.beforeRedirect;
}
transport = isHttpsRequest ? httpsFollow : httpFollow;
}
if (config.maxBodyLength > -1) {
options.maxBodyLength = config.maxBodyLength;
} else {
// follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
options.maxBodyLength = Infinity;
}
if (config.insecureHTTPParser) {
options.insecureHTTPParser = config.insecureHTTPParser;
}
// Create the request
req = transport.request(options, function handleResponse(res) {
if (req.destroyed) return;
const streams = [res];
const responseLength = +res.headers['content-length'];
if (onDownloadProgress) {
const transformStream = new AxiosTransformStream({
length: utils.toFiniteNumber(responseLength),
maxRate: utils.toFiniteNumber(maxDownloadRate)
});
onDownloadProgress && transformStream.on('progress', progress => {
onDownloadProgress(Object.assign(progress, {
download: true
}));
});
streams.push(transformStream);
}
// decompress the response body transparently if required
let responseStream = res;
// return the last request in case of redirects
const lastRequest = res.req || req;
// if decompress disabled we should not decompress
if (config.decompress !== false && res.headers['content-encoding']) {
// if no content, but headers still say that it is encoded,
// remove the header not confuse downstream operations
if (method === 'HEAD' || res.statusCode === 204) {
delete res.headers['content-encoding'];
}
switch ((res.headers['content-encoding'] || '').toLowerCase()) {
/*eslint default-case:0*/
case 'gzip':
case 'x-gzip':
case 'compress':
case 'x-compress':
// add the unzipper to the body stream processing pipeline
streams.push(zlib.createUnzip(zlibOptions));
// remove the content-encoding in order to not confuse downstream operations
delete res.headers['content-encoding'];
break;
case 'deflate':
streams.push(new ZlibHeaderTransformStream());
// add the unzipper to the body stream processing pipeline
streams.push(zlib.createUnzip(zlibOptions));
// remove the content-encoding in order to not confuse downstream operations
delete res.headers['content-encoding'];
break;
case 'br':
if (isBrotliSupported) {
streams.push(zlib.createBrotliDecompress(brotliOptions));
delete res.headers['content-encoding'];
}
}
}
responseStream = streams.length > 1 ? stream.pipeline(streams, utils.noop) : streams[0];
const offListeners = stream.finished(responseStream, () => {
offListeners();
onFinished();
});
const response = {
status: res.statusCode,
statusText: res.statusMessage,
headers: new AxiosHeaders(res.headers),
config,
request: lastRequest
};
if (responseType === 'stream') {
response.data = responseStream;
settle(resolve, reject, response);
} else {
const responseBuffer = [];
let totalResponseBytes = 0;
responseStream.on('data', function handleStreamData(chunk) {
responseBuffer.push(chunk);
totalResponseBytes += chunk.length;
// make sure the content length is not over the maxContentLength if specified
if (config.maxContentLength > -1 && totalResponseBytes > config.maxContentLength) {
// stream.destroy() emit aborted event before calling reject() on Node.js v16
rejected = true;
responseStream.destroy();
reject(new AxiosError('maxContentLength size of ' + config.maxContentLength + ' exceeded',
AxiosError.ERR_BAD_RESPONSE, config, lastRequest));
}
});
responseStream.on('aborted', function handlerStreamAborted() {
if (rejected) {
return;
}
const err = new AxiosError(
'maxContentLength size of ' + config.maxContentLength + ' exceeded',
AxiosError.ERR_BAD_RESPONSE,
config,
lastRequest
);
responseStream.destroy(err);
reject(err);
});
responseStream.on('error', function handleStreamError(err) {
if (req.destroyed) return;
reject(AxiosError.from(err, null, config, lastRequest));
});
responseStream.on('end', function handleStreamEnd() {
try {
let responseData = responseBuffer.length === 1 ? responseBuffer[0] : Buffer.concat(responseBuffer);
if (responseType !== 'arraybuffer') {
responseData = responseData.toString(responseEncoding);
if (!responseEncoding || responseEncoding === 'utf8') {
responseData = utils.stripBOM(responseData);
}
}
response.data = responseData;
} catch (err) {
return reject(AxiosError.from(err, null, config, response.request, response));
}
settle(resolve, reject, response);
});
}
emitter.once('abort', err => {
if (!responseStream.destroyed) {
responseStream.emit('error', err);
responseStream.destroy();
}
});
});
emitter.once('abort', err => {
reject(err);
req.destroy(err);
});
// Handle errors
req.on('error', function handleRequestError(err) {
// @todo remove
// if (req.aborted && err.code !== AxiosError.ERR_FR_TOO_MANY_REDIRECTS) return;
reject(AxiosError.from(err, null, config, req));
});
// set tcp keep alive to prevent drop connection by peer
req.on('socket', function handleRequestSocket(socket) {
// default interval of sending ack packet is 1 minute
socket.setKeepAlive(true, 1000 * 60);
});
// Handle request timeout
if (config.timeout) {
// This is forcing a int timeout to avoid problems if the `req` interface doesn't handle other types.
const timeout = parseInt(config.timeout, 10);
if (Number.isNaN(timeout)) {
reject(new AxiosError(
'error trying to parse `config.timeout` to int',
AxiosError.ERR_BAD_OPTION_VALUE,
config,
req
));
return;
}
// Sometime, the response will be very slow, and does not respond, the connect event will be block by event loop system.
// And timer callback will be fired, and abort() will be invoked before connection, then get "socket hang up" and code ECONNRESET.
// At this time, if we have a large number of request, nodejs will hang up some socket on background. and the number will up and up.
// And then these socket which be hang up will devouring CPU little by little.
// ClientRequest.setTimeout will be fired on the specify milliseconds, and can make sure that abort() will be fired after connect.
req.setTimeout(timeout, function handleRequestTimeout() {
if (isDone) return;
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
const transitional = config.transitional || transitionalDefaults;
if (config.timeoutErrorMessage) {
timeoutErrorMessage = config.timeoutErrorMessage;
}
reject(new AxiosError(
timeoutErrorMessage,
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
config,
req
));
abort();
});
}
// Send the request
if (utils.isStream(data)) {
let ended = false;
let errored = false;
data.on('end', () => {
ended = true;
});
data.once('error', err => {
errored = true;
req.destroy(err);
});
data.on('close', () => {
if (!ended && !errored) {
abort(new CanceledError('Request stream has been aborted', config, req));
}
});
data.pipe(req);
} else {
req.end(data);
}
});
}
export const __setProxy = setProxy;

260
.output/server/node_modules/axios/lib/adapters/xhr.js generated vendored Normal file
View File

@ -0,0 +1,260 @@
'use strict';
import utils from './../utils.js';
import settle from './../core/settle.js';
import cookies from './../helpers/cookies.js';
import buildURL from './../helpers/buildURL.js';
import buildFullPath from '../core/buildFullPath.js';
import isURLSameOrigin from './../helpers/isURLSameOrigin.js';
import transitionalDefaults from '../defaults/transitional.js';
import AxiosError from '../core/AxiosError.js';
import CanceledError from '../cancel/CanceledError.js';
import parseProtocol from '../helpers/parseProtocol.js';
import platform from '../platform/index.js';
import AxiosHeaders from '../core/AxiosHeaders.js';
import speedometer from '../helpers/speedometer.js';
function progressEventReducer(listener, isDownloadStream) {
let bytesNotified = 0;
const _speedometer = speedometer(50, 250);
return e => {
const loaded = e.loaded;
const total = e.lengthComputable ? e.total : undefined;
const progressBytes = loaded - bytesNotified;
const rate = _speedometer(progressBytes);
const inRange = loaded <= total;
bytesNotified = loaded;
const data = {
loaded,
total,
progress: total ? (loaded / total) : undefined,
bytes: progressBytes,
rate: rate ? rate : undefined,
estimated: rate && total && inRange ? (total - loaded) / rate : undefined,
event: e
};
data[isDownloadStream ? 'download' : 'upload'] = true;
listener(data);
};
}
const isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';
export default isXHRAdapterSupported && function (config) {
return new Promise(function dispatchXhrRequest(resolve, reject) {
let requestData = config.data;
const requestHeaders = AxiosHeaders.from(config.headers).normalize();
let {responseType, withXSRFToken} = config;
let onCanceled;
function done() {
if (config.cancelToken) {
config.cancelToken.unsubscribe(onCanceled);
}
if (config.signal) {
config.signal.removeEventListener('abort', onCanceled);
}
}
let contentType;
if (utils.isFormData(requestData)) {
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
requestHeaders.setContentType(false); // Let the browser set it
} else if ((contentType = requestHeaders.getContentType()) !== false) {
// fix semicolon duplication issue for ReactNative FormData implementation
const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];
requestHeaders.setContentType([type || 'multipart/form-data', ...tokens].join('; '));
}
}
let request = new XMLHttpRequest();
// HTTP basic authentication
if (config.auth) {
const username = config.auth.username || '';
const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : '';
requestHeaders.set('Authorization', 'Basic ' + btoa(username + ':' + password));
}
const fullPath = buildFullPath(config.baseURL, config.url);
request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
// Set the request timeout in MS
request.timeout = config.timeout;
function onloadend() {
if (!request) {
return;
}
// Prepare the response
const responseHeaders = AxiosHeaders.from(
'getAllResponseHeaders' in request && request.getAllResponseHeaders()
);
const responseData = !responseType || responseType === 'text' || responseType === 'json' ?
request.responseText : request.response;
const response = {
data: responseData,
status: request.status,
statusText: request.statusText,
headers: responseHeaders,
config,
request
};
settle(function _resolve(value) {
resolve(value);
done();
}, function _reject(err) {
reject(err);
done();
}, response);
// Clean up request
request = null;
}
if ('onloadend' in request) {
// Use onloadend if available
request.onloadend = onloadend;
} else {
// Listen for ready state to emulate onloadend
request.onreadystatechange = function handleLoad() {
if (!request || request.readyState !== 4) {
return;
}
// The request errored out and we didn't get a response, this will be
// handled by onerror instead
// With one exception: request that using file: protocol, most browsers
// will return status as 0 even though it's a successful request
if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {
return;
}
// readystate handler is calling before onerror or ontimeout handlers,
// so we should call onloadend on the next 'tick'
setTimeout(onloadend);
};
}
// Handle browser request cancellation (as opposed to a manual cancellation)
request.onabort = function handleAbort() {
if (!request) {
return;
}
reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));
// Clean up request
request = null;
};
// Handle low level network errors
request.onerror = function handleError() {
// Real errors are hidden from us by the browser
// onerror should only fire if it's a network error
reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));
// Clean up request
request = null;
};
// Handle timeout
request.ontimeout = function handleTimeout() {
let timeoutErrorMessage = config.timeout ? 'timeout of ' + config.timeout + 'ms exceeded' : 'timeout exceeded';
const transitional = config.transitional || transitionalDefaults;
if (config.timeoutErrorMessage) {
timeoutErrorMessage = config.timeoutErrorMessage;
}
reject(new AxiosError(
timeoutErrorMessage,
transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,
config,
request));
// Clean up request
request = null;
};
// Add xsrf header
// This is only done if running in a standard browser environment.
// Specifically not if we're in a web worker, or react-native.
if(platform.hasStandardBrowserEnv) {
withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(config));
if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(fullPath))) {
// Add xsrf header
const xsrfValue = config.xsrfHeaderName && config.xsrfCookieName && cookies.read(config.xsrfCookieName);
if (xsrfValue) {
requestHeaders.set(config.xsrfHeaderName, xsrfValue);
}
}
}
// Remove Content-Type if data is undefined
requestData === undefined && requestHeaders.setContentType(null);
// Add headers to the request
if ('setRequestHeader' in request) {
utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
request.setRequestHeader(key, val);
});
}
// Add withCredentials to request if needed
if (!utils.isUndefined(config.withCredentials)) {
request.withCredentials = !!config.withCredentials;
}
// Add responseType to request if needed
if (responseType && responseType !== 'json') {
request.responseType = config.responseType;
}
// Handle progress if needed
if (typeof config.onDownloadProgress === 'function') {
request.addEventListener('progress', progressEventReducer(config.onDownloadProgress, true));
}
// Not all browsers support upload events
if (typeof config.onUploadProgress === 'function' && request.upload) {
request.upload.addEventListener('progress', progressEventReducer(config.onUploadProgress));
}
if (config.cancelToken || config.signal) {
// Handle cancellation
// eslint-disable-next-line func-names
onCanceled = cancel => {
if (!request) {
return;
}
reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);
request.abort();
request = null;
};
config.cancelToken && config.cancelToken.subscribe(onCanceled);
if (config.signal) {
config.signal.aborted ? onCanceled() : config.signal.addEventListener('abort', onCanceled);
}
}
const protocol = parseProtocol(fullPath);
if (protocol && platform.protocols.indexOf(protocol) === -1) {
reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));
return;
}
// Send the request
request.send(requestData || null);
});
}

89
.output/server/node_modules/axios/lib/axios.js generated vendored Normal file
View File

@ -0,0 +1,89 @@
'use strict';
import utils from './utils.js';
import bind from './helpers/bind.js';
import Axios from './core/Axios.js';
import mergeConfig from './core/mergeConfig.js';
import defaults from './defaults/index.js';
import formDataToJSON from './helpers/formDataToJSON.js';
import CanceledError from './cancel/CanceledError.js';
import CancelToken from './cancel/CancelToken.js';
import isCancel from './cancel/isCancel.js';
import {VERSION} from './env/data.js';
import toFormData from './helpers/toFormData.js';
import AxiosError from './core/AxiosError.js';
import spread from './helpers/spread.js';
import isAxiosError from './helpers/isAxiosError.js';
import AxiosHeaders from "./core/AxiosHeaders.js";
import adapters from './adapters/adapters.js';
import HttpStatusCode from './helpers/HttpStatusCode.js';
/**
* Create an instance of Axios
*
* @param {Object} defaultConfig The default config for the instance
*
* @returns {Axios} A new instance of Axios
*/
function createInstance(defaultConfig) {
const context = new Axios(defaultConfig);
const instance = bind(Axios.prototype.request, context);
// Copy axios.prototype to instance
utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});
// Copy context to instance
utils.extend(instance, context, null, {allOwnKeys: true});
// Factory for creating new instances
instance.create = function create(instanceConfig) {
return createInstance(mergeConfig(defaultConfig, instanceConfig));
};
return instance;
}
// Create the default instance to be exported
const axios = createInstance(defaults);
// Expose Axios class to allow class inheritance
axios.Axios = Axios;
// Expose Cancel & CancelToken
axios.CanceledError = CanceledError;
axios.CancelToken = CancelToken;
axios.isCancel = isCancel;
axios.VERSION = VERSION;
axios.toFormData = toFormData;
// Expose AxiosError class
axios.AxiosError = AxiosError;
// alias for CanceledError for backward compatibility
axios.Cancel = axios.CanceledError;
// Expose all/spread
axios.all = function all(promises) {
return Promise.all(promises);
};
axios.spread = spread;
// Expose isAxiosError
axios.isAxiosError = isAxiosError;
// Expose mergeConfig
axios.mergeConfig = mergeConfig;
axios.AxiosHeaders = AxiosHeaders;
axios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);
axios.getAdapter = adapters.getAdapter;
axios.HttpStatusCode = HttpStatusCode;
axios.default = axios;
// this module should only have a default export
export default axios

View File

@ -0,0 +1,121 @@
'use strict';
import CanceledError from './CanceledError.js';
/**
* A `CancelToken` is an object that can be used to request cancellation of an operation.
*
* @param {Function} executor The executor function.
*
* @returns {CancelToken}
*/
class CancelToken {
constructor(executor) {
if (typeof executor !== 'function') {
throw new TypeError('executor must be a function.');
}
let resolvePromise;
this.promise = new Promise(function promiseExecutor(resolve) {
resolvePromise = resolve;
});
const token = this;
// eslint-disable-next-line func-names
this.promise.then(cancel => {
if (!token._listeners) return;
let i = token._listeners.length;
while (i-- > 0) {
token._listeners[i](cancel);
}
token._listeners = null;
});
// eslint-disable-next-line func-names
this.promise.then = onfulfilled => {
let _resolve;
// eslint-disable-next-line func-names
const promise = new Promise(resolve => {
token.subscribe(resolve);
_resolve = resolve;
}).then(onfulfilled);
promise.cancel = function reject() {
token.unsubscribe(_resolve);
};
return promise;
};
executor(function cancel(message, config, request) {
if (token.reason) {
// Cancellation has already been requested
return;
}
token.reason = new CanceledError(message, config, request);
resolvePromise(token.reason);
});
}
/**
* Throws a `CanceledError` if cancellation has been requested.
*/
throwIfRequested() {
if (this.reason) {
throw this.reason;
}
}
/**
* Subscribe to the cancel signal
*/
subscribe(listener) {
if (this.reason) {
listener(this.reason);
return;
}
if (this._listeners) {
this._listeners.push(listener);
} else {
this._listeners = [listener];
}
}
/**
* Unsubscribe from the cancel signal
*/
unsubscribe(listener) {
if (!this._listeners) {
return;
}
const index = this._listeners.indexOf(listener);
if (index !== -1) {
this._listeners.splice(index, 1);
}
}
/**
* Returns an object that contains a new `CancelToken` and a function that, when called,
* cancels the `CancelToken`.
*/
static source() {
let cancel;
const token = new CancelToken(function executor(c) {
cancel = c;
});
return {
token,
cancel
};
}
}
export default CancelToken;

View File

@ -0,0 +1,25 @@
'use strict';
import AxiosError from '../core/AxiosError.js';
import utils from '../utils.js';
/**
* A `CanceledError` is an object that is thrown when an operation is canceled.
*
* @param {string=} message The message.
* @param {Object=} config The config.
* @param {Object=} request The request.
*
* @returns {CanceledError} The created error.
*/
function CanceledError(message, config, request) {
// eslint-disable-next-line no-eq-null,eqeqeq
AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);
this.name = 'CanceledError';
}
utils.inherits(CanceledError, AxiosError, {
__CANCEL__: true
});
export default CanceledError;

View File

@ -0,0 +1,5 @@
'use strict';
export default function isCancel(value) {
return !!(value && value.__CANCEL__);
}

201
.output/server/node_modules/axios/lib/core/Axios.js generated vendored Normal file
View File

@ -0,0 +1,201 @@
'use strict';
import utils from './../utils.js';
import buildURL from '../helpers/buildURL.js';
import InterceptorManager from './InterceptorManager.js';
import dispatchRequest from './dispatchRequest.js';
import mergeConfig from './mergeConfig.js';
import buildFullPath from './buildFullPath.js';
import validator from '../helpers/validator.js';
import AxiosHeaders from './AxiosHeaders.js';
const validators = validator.validators;
/**
* Create a new instance of Axios
*
* @param {Object} instanceConfig The default config for the instance
*
* @return {Axios} A new instance of Axios
*/
class Axios {
constructor(instanceConfig) {
this.defaults = instanceConfig;
this.interceptors = {
request: new InterceptorManager(),
response: new InterceptorManager()
};
}
/**
* Dispatch a request
*
* @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
* @param {?Object} config
*
* @returns {Promise} The Promise to be fulfilled
*/
request(configOrUrl, config) {
/*eslint no-param-reassign:0*/
// Allow for axios('example/url'[, config]) a la fetch API
if (typeof configOrUrl === 'string') {
config = config || {};
config.url = configOrUrl;
} else {
config = configOrUrl || {};
}
config = mergeConfig(this.defaults, config);
const {transitional, paramsSerializer, headers} = config;
if (transitional !== undefined) {
validator.assertOptions(transitional, {
silentJSONParsing: validators.transitional(validators.boolean),
forcedJSONParsing: validators.transitional(validators.boolean),
clarifyTimeoutError: validators.transitional(validators.boolean)
}, false);
}
if (paramsSerializer != null) {
if (utils.isFunction(paramsSerializer)) {
config.paramsSerializer = {
serialize: paramsSerializer
}
} else {
validator.assertOptions(paramsSerializer, {
encode: validators.function,
serialize: validators.function
}, true);
}
}
// Set config.method
config.method = (config.method || this.defaults.method || 'get').toLowerCase();
// Flatten headers
let contextHeaders = headers && utils.merge(
headers.common,
headers[config.method]
);
headers && utils.forEach(
['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],
(method) => {
delete headers[method];
}
);
config.headers = AxiosHeaders.concat(contextHeaders, headers);
// filter out skipped interceptors
const requestInterceptorChain = [];
let synchronousRequestInterceptors = true;
this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {
return;
}
synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
});
const responseInterceptorChain = [];
this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
});
let promise;
let i = 0;
let len;
if (!synchronousRequestInterceptors) {
const chain = [dispatchRequest.bind(this), undefined];
chain.unshift.apply(chain, requestInterceptorChain);
chain.push.apply(chain, responseInterceptorChain);
len = chain.length;
promise = Promise.resolve(config);
while (i < len) {
promise = promise.then(chain[i++], chain[i++]);
}
return promise;
}
len = requestInterceptorChain.length;
let newConfig = config;
i = 0;
while (i < len) {
const onFulfilled = requestInterceptorChain[i++];
const onRejected = requestInterceptorChain[i++];
try {
newConfig = onFulfilled(newConfig);
} catch (error) {
onRejected.call(this, error);
break;
}
}
try {
promise = dispatchRequest.call(this, newConfig);
} catch (error) {
return Promise.reject(error);
}
i = 0;
len = responseInterceptorChain.length;
while (i < len) {
promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
}
return promise;
}
getUri(config) {
config = mergeConfig(this.defaults, config);
const fullPath = buildFullPath(config.baseURL, config.url);
return buildURL(fullPath, config.params, config.paramsSerializer);
}
}
// Provide aliases for supported request methods
utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {
/*eslint func-names:0*/
Axios.prototype[method] = function(url, config) {
return this.request(mergeConfig(config || {}, {
method,
url,
data: (config || {}).data
}));
};
});
utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {
/*eslint func-names:0*/
function generateHTTPMethod(isForm) {
return function httpMethod(url, data, config) {
return this.request(mergeConfig(config || {}, {
method,
headers: isForm ? {
'Content-Type': 'multipart/form-data'
} : {},
url,
data
}));
};
}
Axios.prototype[method] = generateHTTPMethod();
Axios.prototype[method + 'Form'] = generateHTTPMethod(true);
});
export default Axios;

View File

@ -0,0 +1,100 @@
'use strict';
import utils from '../utils.js';
/**
* Create an Error with the specified message, config, error code, request and response.
*
* @param {string} message The error message.
* @param {string} [code] The error code (for example, 'ECONNABORTED').
* @param {Object} [config] The config.
* @param {Object} [request] The request.
* @param {Object} [response] The response.
*
* @returns {Error} The created error.
*/
function AxiosError(message, code, config, request, response) {
Error.call(this);
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = (new Error()).stack;
}
this.message = message;
this.name = 'AxiosError';
code && (this.code = code);
config && (this.config = config);
request && (this.request = request);
response && (this.response = response);
}
utils.inherits(AxiosError, Error, {
toJSON: function toJSON() {
return {
// Standard
message: this.message,
name: this.name,
// Microsoft
description: this.description,
number: this.number,
// Mozilla
fileName: this.fileName,
lineNumber: this.lineNumber,
columnNumber: this.columnNumber,
stack: this.stack,
// Axios
config: utils.toJSONObject(this.config),
code: this.code,
status: this.response && this.response.status ? this.response.status : null
};
}
});
const prototype = AxiosError.prototype;
const descriptors = {};
[
'ERR_BAD_OPTION_VALUE',
'ERR_BAD_OPTION',
'ECONNABORTED',
'ETIMEDOUT',
'ERR_NETWORK',
'ERR_FR_TOO_MANY_REDIRECTS',
'ERR_DEPRECATED',
'ERR_BAD_RESPONSE',
'ERR_BAD_REQUEST',
'ERR_CANCELED',
'ERR_NOT_SUPPORT',
'ERR_INVALID_URL'
// eslint-disable-next-line func-names
].forEach(code => {
descriptors[code] = {value: code};
});
Object.defineProperties(AxiosError, descriptors);
Object.defineProperty(prototype, 'isAxiosError', {value: true});
// eslint-disable-next-line func-names
AxiosError.from = (error, code, config, request, response, customProps) => {
const axiosError = Object.create(prototype);
utils.toFlatObject(error, axiosError, function filter(obj) {
return obj !== Error.prototype;
}, prop => {
return prop !== 'isAxiosError';
});
AxiosError.call(axiosError, error.message, code, config, request, response);
axiosError.cause = error;
axiosError.name = error.name;
customProps && Object.assign(axiosError, customProps);
return axiosError;
};
export default AxiosError;

View File

@ -0,0 +1,298 @@
'use strict';
import utils from '../utils.js';
import parseHeaders from '../helpers/parseHeaders.js';
const $internals = Symbol('internals');
function normalizeHeader(header) {
return header && String(header).trim().toLowerCase();
}
function normalizeValue(value) {
if (value === false || value == null) {
return value;
}
return utils.isArray(value) ? value.map(normalizeValue) : String(value);
}
function parseTokens(str) {
const tokens = Object.create(null);
const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
let match;
while ((match = tokensRE.exec(str))) {
tokens[match[1]] = match[2];
}
return tokens;
}
const isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
function matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {
if (utils.isFunction(filter)) {
return filter.call(this, value, header);
}
if (isHeaderNameFilter) {
value = header;
}
if (!utils.isString(value)) return;
if (utils.isString(filter)) {
return value.indexOf(filter) !== -1;
}
if (utils.isRegExp(filter)) {
return filter.test(value);
}
}
function formatHeader(header) {
return header.trim()
.toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
return char.toUpperCase() + str;
});
}
function buildAccessors(obj, header) {
const accessorName = utils.toCamelCase(' ' + header);
['get', 'set', 'has'].forEach(methodName => {
Object.defineProperty(obj, methodName + accessorName, {
value: function(arg1, arg2, arg3) {
return this[methodName].call(this, header, arg1, arg2, arg3);
},
configurable: true
});
});
}
class AxiosHeaders {
constructor(headers) {
headers && this.set(headers);
}
set(header, valueOrRewrite, rewrite) {
const self = this;
function setHeader(_value, _header, _rewrite) {
const lHeader = normalizeHeader(_header);
if (!lHeader) {
throw new Error('header name must be a non-empty string');
}
const key = utils.findKey(self, lHeader);
if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {
self[key || _header] = normalizeValue(_value);
}
}
const setHeaders = (headers, _rewrite) =>
utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
if (utils.isPlainObject(header) || header instanceof this.constructor) {
setHeaders(header, valueOrRewrite)
} else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
setHeaders(parseHeaders(header), valueOrRewrite);
} else {
header != null && setHeader(valueOrRewrite, header, rewrite);
}
return this;
}
get(header, parser) {
header = normalizeHeader(header);
if (header) {
const key = utils.findKey(this, header);
if (key) {
const value = this[key];
if (!parser) {
return value;
}
if (parser === true) {
return parseTokens(value);
}
if (utils.isFunction(parser)) {
return parser.call(this, value, key);
}
if (utils.isRegExp(parser)) {
return parser.exec(value);
}
throw new TypeError('parser must be boolean|regexp|function');
}
}
}
has(header, matcher) {
header = normalizeHeader(header);
if (header) {
const key = utils.findKey(this, header);
return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
}
return false;
}
delete(header, matcher) {
const self = this;
let deleted = false;
function deleteHeader(_header) {
_header = normalizeHeader(_header);
if (_header) {
const key = utils.findKey(self, _header);
if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {
delete self[key];
deleted = true;
}
}
}
if (utils.isArray(header)) {
header.forEach(deleteHeader);
} else {
deleteHeader(header);
}
return deleted;
}
clear(matcher) {
const keys = Object.keys(this);
let i = keys.length;
let deleted = false;
while (i--) {
const key = keys[i];
if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
delete this[key];
deleted = true;
}
}
return deleted;
}
normalize(format) {
const self = this;
const headers = {};
utils.forEach(this, (value, header) => {
const key = utils.findKey(headers, header);
if (key) {
self[key] = normalizeValue(value);
delete self[header];
return;
}
const normalized = format ? formatHeader(header) : String(header).trim();
if (normalized !== header) {
delete self[header];
}
self[normalized] = normalizeValue(value);
headers[normalized] = true;
});
return this;
}
concat(...targets) {
return this.constructor.concat(this, ...targets);
}
toJSON(asStrings) {
const obj = Object.create(null);
utils.forEach(this, (value, header) => {
value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);
});
return obj;
}
[Symbol.iterator]() {
return Object.entries(this.toJSON())[Symbol.iterator]();
}
toString() {
return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\n');
}
get [Symbol.toStringTag]() {
return 'AxiosHeaders';
}
static from(thing) {
return thing instanceof this ? thing : new this(thing);
}
static concat(first, ...targets) {
const computed = new this(first);
targets.forEach((target) => computed.set(target));
return computed;
}
static accessor(header) {
const internals = this[$internals] = (this[$internals] = {
accessors: {}
});
const accessors = internals.accessors;
const prototype = this.prototype;
function defineAccessor(_header) {
const lHeader = normalizeHeader(_header);
if (!accessors[lHeader]) {
buildAccessors(prototype, _header);
accessors[lHeader] = true;
}
}
utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
return this;
}
}
AxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);
// reserved names hotfix
utils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {
let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`
return {
get: () => value,
set(headerValue) {
this[mapped] = headerValue;
}
}
});
utils.freezeMethods(AxiosHeaders);
export default AxiosHeaders;

View File

@ -0,0 +1,71 @@
'use strict';
import utils from './../utils.js';
class InterceptorManager {
constructor() {
this.handlers = [];
}
/**
* Add a new interceptor to the stack
*
* @param {Function} fulfilled The function to handle `then` for a `Promise`
* @param {Function} rejected The function to handle `reject` for a `Promise`
*
* @return {Number} An ID used to remove interceptor later
*/
use(fulfilled, rejected, options) {
this.handlers.push({
fulfilled,
rejected,
synchronous: options ? options.synchronous : false,
runWhen: options ? options.runWhen : null
});
return this.handlers.length - 1;
}
/**
* Remove an interceptor from the stack
*
* @param {Number} id The ID that was returned by `use`
*
* @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
*/
eject(id) {
if (this.handlers[id]) {
this.handlers[id] = null;
}
}
/**
* Clear all interceptors from the stack
*
* @returns {void}
*/
clear() {
if (this.handlers) {
this.handlers = [];
}
}
/**
* Iterate over all the registered interceptors
*
* This method is particularly useful for skipping over any
* interceptors that may have become `null` calling `eject`.
*
* @param {Function} fn The function to call for each interceptor
*
* @returns {void}
*/
forEach(fn) {
utils.forEach(this.handlers, function forEachHandler(h) {
if (h !== null) {
fn(h);
}
});
}
}
export default InterceptorManager;

View File

@ -0,0 +1,21 @@
'use strict';
import isAbsoluteURL from '../helpers/isAbsoluteURL.js';
import combineURLs from '../helpers/combineURLs.js';
/**
* Creates a new URL by combining the baseURL with the requestedURL,
* only when the requestedURL is not already an absolute URL.
* If the requestURL is absolute, this function returns the requestedURL untouched.
*
* @param {string} baseURL The base URL
* @param {string} requestedURL Absolute or relative URL to combine
*
* @returns {string} The combined full path
*/
export default function buildFullPath(baseURL, requestedURL) {
if (baseURL && !isAbsoluteURL(requestedURL)) {
return combineURLs(baseURL, requestedURL);
}
return requestedURL;
}

Some files were not shown because too many files have changed in this diff Show More