site-panzai/node_modules/@nuxt/devtools/dist/client/_nuxt/code-snippets-kqtstcdh.js

1 line
4.6 KiB
JavaScript
Raw Normal View History

2026-11-13 13:57:04 +01:00
import{C as e,Et as t,Mt as n,Qt as r,S as i,T as a,W as o,Y as s,_ as c,dt as l,g as u,h as d,lt as f,m as p,p as m,s as h,tn as g}from"./vendor/json-editor-vue-9tyg6b65.js";import{t as _}from"./nbutton-g8ropw1z.js";import{u as v}from"#entry";import{t as y}from"./ncode-block-cfw508sn.js";function b(e){return typeof e==`string`?`'${e}'`:new w().serialize(e)}var x=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,S=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[x.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function C(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&S[n]?S[n]:n+128,s=a<128&&S[a]?S[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var w=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?C(e,t):n===`number`&&r===`number`?e-t:C(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(C),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`Float64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`,`)}]`};for(let t of[`BigInt64Array`,`BigUint64Array`])e.prototype[`$`+t]=function(e){return`${t}[${e.join(`n,`)}${e.length>0?`n`:``}]`};return e})();function T(e,t){return e===t||b(e)===b(t)}var E={key:0,relative:``,"n-code-block":``},D={flex:`~ wrap`,"w-full":``},O=[`onClick`],k={flex:`~ gap-2`,px3:``,pb3:``,n:`sm primary`},A=Object.assign(a({__name:`CodeSnippets`,props:{codeSnippets:{},eventType:{}},setup(a){let b=a,x=t(b.codeSnippets[0]),S=v(),C=m(()=>x.value?.lang||`text`);return f(()=>{b.codeSnippets.includes(x.value)||(x.value=b.codeSnippets[0])}),(t,f)=>{let m=y,v=_;return a.codeSnippets.length?(o(),c(`div`,E,[p(`div`,D,[(o(!0),c(h,null,s(a.codeSnippets,(e,t)=>(o(),c(`button`,{key:t,px4:``,py2:``,border:`r base`,hover:`bg-active`,class:r(e===x.value?``:`border-b`),onClick:t=>x.value=e},[p(`div`,{class:r(e===x.value?``:`op30`),"font-mono