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