eslink-ui-plus
Version:
vue3 component library, css framework
8 lines (7 loc) • 14 kB
JavaScript
var B=Object.defineProperty;var P=Object.getOwnPropertySymbols;var Q=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var $=(n,e,t)=>e in n?B(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,k=(n,e)=>{for(var t in e||(e={}))Q.call(e,t)&&$(n,t,e[t]);if(P)for(var t of P(e))W.call(e,t)&&$(n,t,e[t]);return n};var h=(n,e,t)=>new Promise((o,a)=>{var i=c=>{try{r(t.next(c))}catch(f){a(f)}},s=c=>{try{r(t.throw(c))}catch(f){a(f)}},r=c=>c.done?o(c.value):Promise.resolve(c.value).then(i,s);r((t=t.apply(n,e)).next())});import{effectScope as z,ref as K,markRaw as L,isVue2 as x,toRaw as D,watch as Y,unref as q}from"vue-demi";function X(){return N().__VUE_DEVTOOLS_GLOBAL_HOOK__}function N(){return typeof navigator!="undefined"&&typeof window!="undefined"?window:typeof global!="undefined"?global:{}}const Z=typeof Proxy=="function",ee="devtools-plugin:setup",te="plugin:settings:set";class ne{constructor(e,t){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=e,this.hook=t;const o={};if(e.settings)for(const s in e.settings){const r=e.settings[s];o[s]=r.defaultValue}const a=`__vue-devtools-plugin-settings__${e.id}`;let i=Object.assign({},o);try{const s=localStorage.getItem(a),r=JSON.parse(s);Object.assign(i,r)}catch(s){}this.fallbacks={getSettings(){return i},setSettings(s){try{localStorage.setItem(a,JSON.stringify(s))}catch(r){}i=s}},t&&t.on(te,(s,r)=>{s===this.plugin.id&&this.fallbacks.setSettings(r)}),this.proxiedOn=new Proxy({},{get:(s,r)=>this.target?this.target.on[r]:(...c)=>{this.onQueue.push({method:r,args:c})}}),this.proxiedTarget=new Proxy({},{get:(s,r)=>this.target?this.target[r]:r==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(r)?(...c)=>(this.targetQueue.push({method:r,args:c,resolve:()=>{}}),this.fallbacks[r](...c)):(...c)=>new Promise(f=>{this.targetQueue.push({method:r,args:c,resolve:f})})})}setRealTarget(e){return h(this,null,function*(){this.target=e;for(const t of this.onQueue)this.target.on[t.method](...t.args);for(const t of this.targetQueue)t.resolve(yield this.target[t.method](...t.args))})}}function U(n,e){const t=n,o=N(),a=X(),i=Z&&t.enableEarlyProxy;if(a&&(o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!i))a.emit(ee,n,e);else{const s=i?new ne(t,a):null;(o.__VUE_DEVTOOLS_PLUGINS__=o.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:t,setupFn:e,proxy:s}),s&&e(s.proxiedTarget)}}/*!
* pinia v2.0.11
* (c) 2022 Eduardo San Martin Morote
* @license MIT
*/const oe=n=>n,ie=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();var p;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(p||(p={}));const O=typeof window!="undefined",V=(()=>typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null})();function re(n,{autoBom:e=!1}={}){return e&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type)?new Blob([String.fromCharCode(65279),n],{type:n.type}):n}function E(n,e,t){const o=new XMLHttpRequest;o.open("GET",n),o.responseType="blob",o.onload=function(){C(o.response,e,t)},o.onerror=function(){console.error("could not download file")},o.send()}function j(n){const e=new XMLHttpRequest;e.open("HEAD",n,!1);try{e.send()}catch(t){}return e.status>=200&&e.status<=299}function S(n){try{n.dispatchEvent(new MouseEvent("click"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),n.dispatchEvent(t)}}const w=typeof navigator=="object"?navigator:{userAgent:""},R=(()=>/Macintosh/.test(w.userAgent)&&/AppleWebKit/.test(w.userAgent)&&!/Safari/.test(w.userAgent))(),C=O?typeof HTMLAnchorElement!="undefined"&&"download"in HTMLAnchorElement.prototype&&!R?se:"msSaveOrOpenBlob"in w?ae:ce:()=>{};function se(n,e="download",t){const o=document.createElement("a");o.download=e,o.rel="noopener",typeof n=="string"?(o.href=n,o.origin!==location.origin?j(o.href)?E(n,e,t):(o.target="_blank",S(o)):S(o)):(o.href=URL.createObjectURL(n),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){S(o)},0))}function ae(n,e="download",t){if(typeof n=="string")if(j(n))E(n,e,t);else{const o=document.createElement("a");o.href=n,o.target="_blank",setTimeout(function(){S(o)})}else navigator.msSaveOrOpenBlob(re(n,t),e)}function ce(n,e,t,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof n=="string")return E(n,e,t);const a=n.type==="application/octet-stream",i=/constructor/i.test(String(V.HTMLElement))||"safari"in V,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||a&&i||R)&&typeof FileReader!="undefined"){const r=new FileReader;r.onloadend=function(){let c=r.result;if(typeof c!="string")throw o=null,new Error("Wrong reader.result type");c=s?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=c:location.assign(c),o=null},r.readAsDataURL(n)}else{const r=URL.createObjectURL(n);o?o.location.assign(r):location.href=r,o=null,setTimeout(function(){URL.revokeObjectURL(r)},4e4)}}function u(n,e){const t="\u{1F34D} "+n;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(t,e):e==="error"?console.error(t):e==="warn"?console.warn(t):console.log(t)}function T(n){return"_a"in n&&"install"in n}function M(){if(!("clipboard"in navigator))return u("Your browser doesn't support the Clipboard API","error"),!0}function G(n){return n instanceof Error&&n.message.toLowerCase().includes("document is not focused")?(u('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}function le(n){return h(this,null,function*(){if(!M())try{yield navigator.clipboard.writeText(JSON.stringify(n.state.value)),u("Global state copied to clipboard.")}catch(e){if(G(e))return;u("Failed to serialize the state. Check the console for more details.","error"),console.error(e)}})}function ue(n){return h(this,null,function*(){if(!M())try{n.state.value=JSON.parse(yield navigator.clipboard.readText()),u("Global state pasted from clipboard.")}catch(e){if(G(e))return;u("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(e)}})}function fe(n){return h(this,null,function*(){try{C(new Blob([JSON.stringify(n.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(e){u("Failed to export the state as JSON. Check the console for more details.","error"),console.error(e)}})}let g;function de(){g||(g=document.createElement("input"),g.type="file",g.accept=".json");function n(){return new Promise((e,t)=>{g.onchange=()=>h(this,null,function*(){const o=g.files;if(!o)return e(null);const a=o.item(0);return e(a?{text:yield a.text(),file:a}:null)}),g.oncancel=()=>e(null),g.onerror=t,g.click()})}return n}function he(n){return h(this,null,function*(){try{const t=yield(yield de())();if(!t)return;const{text:o,file:a}=t;n.state.value=JSON.parse(o),u(`Global state imported from "${a.name}".`)}catch(e){u("Failed to export the state as JSON. Check the console for more details.","error"),console.error(e)}})}function d(n){return{_custom:{display:n}}}const F="\u{1F34D} Pinia (root)",A="_root";function ge(n){return T(n)?{id:A,label:F}:{id:n.$id,label:n.$id}}function pe(n){if(T(n)){const t=Array.from(n._s.keys()),o=n._s;return{state:t.map(i=>({editable:!0,key:i,value:n.state.value[i]})),getters:t.filter(i=>o.get(i)._getters).map(i=>{const s=o.get(i);return{editable:!1,key:i,value:s._getters.reduce((r,c)=>(r[c]=s[c],r),{})}})}}const e={state:Object.keys(n.$state).map(t=>({editable:!0,key:t,value:n.$state[t]}))};return n._getters&&n._getters.length&&(e.getters=n._getters.map(t=>({editable:!1,key:t,value:n[t]}))),n._customProperties.size&&(e.customProperties=Array.from(n._customProperties).map(t=>({editable:!0,key:t,value:n[t]}))),e}function me(n){return n?Array.isArray(n)?n.reduce((e,t)=>(e.keys.push(t.key),e.operations.push(t.type),e.oldValue[t.key]=t.oldValue,e.newValue[t.key]=t.newValue,e),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:d(n.type),key:d(n.key),oldValue:n.oldValue,newValue:n.newValue}:{}}function _e(n){switch(n){case p.direct:return"mutation";case p.patchFunction:return"$patch";case p.patchObject:return"$patch";default:return"unknown"}}let y=!0;const v=[],m="pinia:mutations",l="pinia",b=n=>"\u{1F34D} "+n;function ye(n,e){U({id:"dev.esm.pinia",label:"Pinia \u{1F34D}",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:v,app:n},t=>{t.addTimelineLayer({id:m,label:"Pinia \u{1F34D}",color:15064968}),t.addInspector({id:l,label:"Pinia \u{1F34D}",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{le(e)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:()=>h(this,null,function*(){yield ue(e),t.sendInspectorTree(l),t.sendInspectorState(l)}),tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{fe(e)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:()=>h(this,null,function*(){yield he(e),t.sendInspectorTree(l),t.sendInspectorState(l)}),tooltip:"Import the state from a JSON file"}]}),t.on.inspectComponent((o,a)=>{const i=o.componentInstance&&o.componentInstance.proxy;if(i&&i._pStores){const s=o.componentInstance.proxy._pStores;Object.values(s).forEach(r=>{o.instanceData.state.push({type:b(r.$id),key:"state",editable:!0,value:r._isOptionsAPI?{_custom:{value:r.$state,actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>r.$reset()}]}}:r.$state}),r._getters&&r._getters.length&&o.instanceData.state.push({type:b(r.$id),key:"getters",editable:!1,value:r._getters.reduce((c,f)=>(c[f]=r[f],c),{})})})}}),t.on.getInspectorTree(o=>{if(o.app===n&&o.inspectorId===l){let a=[e];a=a.concat(Array.from(e._s.values())),o.rootNodes=(o.filter?a.filter(i=>"$id"in i?i.$id.toLowerCase().includes(o.filter.toLowerCase()):F.toLowerCase().includes(o.filter.toLowerCase())):a).map(ge)}}),t.on.getInspectorState(o=>{if(o.app===n&&o.inspectorId===l){const a=o.nodeId===A?e:e._s.get(o.nodeId);if(!a)return;a&&(o.state=pe(a))}}),t.on.editInspectorState((o,a)=>{if(o.app===n&&o.inspectorId===l){const i=o.nodeId===A?e:e._s.get(o.nodeId);if(!i)return u(`store "${o.nodeId}" not found`,"error");const{path:s}=o;T(i)?s.unshift("state"):(s.length!==1||!i._customProperties.has(s[0])||s[0]in i.$state)&&s.unshift("$state"),y=!1,o.set(i,s,o.state.value),y=!0}}),t.on.editComponentState(o=>{if(o.type.startsWith("\u{1F34D}")){const a=o.type.replace(/^🍍\s*/,""),i=e._s.get(a);if(!i)return u(`store "${a}" not found`,"error");const{path:s}=o;if(s[0]!=="state")return u(`Invalid path for store "${a}":
${s}
Only state can be modified.`);s[0]="$state",y=!1,o.set(i,s,o.state.value),y=!0}})})}function Se(n,e){v.includes(b(e.$id))||v.push(b(e.$id)),U({id:"dev.esm.pinia",label:"Pinia \u{1F34D}",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:v,app:n,settings:{}},t=>{e.$onAction(({after:i,onError:s,name:r,args:c})=>{const f=H++;t.addTimelineEvent({layerId:m,event:{time:Date.now(),title:"\u{1F6EB} "+r,subtitle:"start",data:{store:d(e.$id),action:d(r),args:c},groupId:f}}),i(I=>{_=void 0,t.addTimelineEvent({layerId:m,event:{time:Date.now(),title:"\u{1F6EC} "+r,subtitle:"end",data:{store:d(e.$id),action:d(r),args:c,result:I},groupId:f}})}),s(I=>{_=void 0,t.addTimelineEvent({layerId:m,event:{time:Date.now(),logType:"error",title:"\u{1F4A5} "+r,subtitle:"end",data:{store:d(e.$id),action:d(r),args:c,error:I},groupId:f}})})},!0),e._customProperties.forEach(i=>{Y(()=>q(e[i]),(s,r)=>{t.notifyComponentUpdate(),t.sendInspectorState(l),y&&t.addTimelineEvent({layerId:m,event:{time:Date.now(),title:"Change",subtitle:i,data:{newValue:s,oldValue:r},groupId:_}})},{deep:!0})}),e.$subscribe(({events:i,type:s},r)=>{if(t.notifyComponentUpdate(),t.sendInspectorState(l),!y)return;const c={time:Date.now(),title:_e(s),data:k({store:d(e.$id)},me(i)),groupId:_};_=void 0,s===p.patchFunction?c.subtitle="\u2935\uFE0F":s===p.patchObject?c.subtitle="\u{1F9E9}":i&&!Array.isArray(i)&&(c.subtitle=i.type),i&&(c.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),t.addTimelineEvent({layerId:m,event:c})},{detached:!0,flush:"sync"});const o=e._hotUpdate;e._hotUpdate=L(i=>{o(i),t.addTimelineEvent({layerId:m,event:{time:Date.now(),title:"\u{1F525} "+e.$id,subtitle:"HMR update",data:{store:d(e.$id),info:d("HMR update")}}}),t.notifyComponentUpdate(),t.sendInspectorTree(l),t.sendInspectorState(l)});const{$dispose:a}=e;e.$dispose=()=>{a(),t.notifyComponentUpdate(),t.sendInspectorTree(l),t.sendInspectorState(l),u(`Disposed "${e.$id}" store \u{1F5D1}`)},t.notifyComponentUpdate(),t.sendInspectorTree(l),t.sendInspectorState(l),u(`"${e.$id}" store installed \u{1F195}`)})}let H=0,_;function J(n,e){const t=e.reduce((o,a)=>(o[a]=D(n)[a],o),{});for(const o in t)n[o]=function(){const a=H,i=new Proxy(n,{get(...s){return _=a,Reflect.get(...s)},set(...s){return _=a,Reflect.set(...s)}});return t[o].apply(i,arguments)}}function we({app:n,store:e,options:t}){if(!e.$id.startsWith("__hot:")){if(t.state&&(e._isOptionsAPI=!0),typeof t.state=="function"){J(e,Object.keys(t.actions));const o=e._hotUpdate;D(e)._hotUpdate=function(a){o.apply(this,arguments),J(e,Object.keys(a._hmrPayload.actions))}}Se(n,e)}}function ve(){const n=z(!0),e=n.run(()=>K({}));let t=[],o=[];const a=L({install(i){oe(a),x||(a._a=i,i.provide(ie,a),i.config.globalProperties.$pinia=a,process.env.NODE_ENV!=="production"&&O&&ye(i,a),o.forEach(s=>t.push(s)),o=[])},use(i){return!this._a&&!x?o.push(i):t.push(i),this},_p:t,_a:null,_e:n,_s:new Map,state:e});return process.env.NODE_ENV!=="production"&&O&&a.use(we),a}process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();const be=ve();export{be as default};