@highstate/designer 0.21.1 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{Lks7C8cK.js → -QAUKRUv.js} +1 -1
- package/.output/public/_nuxt/-WgkZJwX.js +1 -0
- package/.output/public/_nuxt/0VxYR0Dz.js +1 -0
- package/.output/public/_nuxt/{sB5TSp0H.js → 77UvFSdd.js} +7 -7
- package/.output/public/_nuxt/B4f2rRcR.js +1 -0
- package/.output/public/_nuxt/{5gjbd9sK.js → B8uKU-iG.js} +1 -1
- package/.output/public/_nuxt/{CpGRan2R.js → B8ylSe-r.js} +1 -1
- package/.output/public/_nuxt/BI2f9uP-.js +1 -0
- package/.output/public/_nuxt/BLI48uDH.js +1 -0
- package/.output/public/_nuxt/{B7RpoNQl.js → BQAu9Fve.js} +1 -1
- package/.output/public/_nuxt/BaXvK4sX.js +1 -0
- package/.output/public/_nuxt/{CJN4g-3R.js → BbWhHw7B.js} +1 -1
- package/.output/public/_nuxt/{Djg8J2AC.js → BdOV6aLJ.js} +1 -1
- package/.output/public/_nuxt/BgGQb96c.js +2 -0
- package/.output/public/_nuxt/{DkkrdwgN.js → BgvYz3Nr.js} +1 -1
- package/.output/public/_nuxt/{CPsHsqGU.js → Bh96JwGT.js} +1 -1
- package/.output/public/_nuxt/{D_wY_uke.js → Bn5R9WlL.js} +1 -1
- package/.output/public/_nuxt/{Fcs-0n6A.js → Bpl7n9_r.js} +1 -1
- package/.output/public/_nuxt/BqIbm1EF.js +1 -0
- package/.output/public/_nuxt/{Bs8TB6Bu.js → BqJDg8iS.js} +1 -1
- package/.output/public/_nuxt/{Dahes9VH.js → BrCpuEqM.js} +1 -1
- package/.output/public/_nuxt/{y0GN4iGv.js → BxGSDLX0.js} +1 -1
- package/.output/public/_nuxt/{CaehGOgh.js → BxvmPvww.js} +1 -1
- package/.output/public/_nuxt/ByRPlNhf.js +1 -0
- package/.output/public/_nuxt/Bz5q1XLL.js +14 -0
- package/.output/public/_nuxt/BzbjXxJd.js +6 -0
- package/.output/public/_nuxt/{UD_auLNX.js → C-0mRkgR.js} +1 -1
- package/.output/public/_nuxt/{C2zyO9uX.js → C-IrfHdq.js} +1 -1
- package/.output/public/_nuxt/{B2SoM2pd.js → C1JwrSe7.js} +2 -2
- package/.output/public/_nuxt/{CvSiusML.js → C4dMoSm9.js} +1 -1
- package/.output/public/_nuxt/{BCJKqJxW.js → C5DRPdxC.js} +1 -1
- package/.output/public/_nuxt/{C973_vs5.js → C5QFcB9K.js} +1 -1
- package/.output/public/_nuxt/{CtbC3i8L.js → CBiX8Qk6.js} +1 -1
- package/.output/public/_nuxt/{DSDbyhpJ.js → CC635Llr.js} +1 -1
- package/.output/public/_nuxt/CChinG0a.js +1 -0
- package/.output/public/_nuxt/{DTPYfUid.js → CGLWlIpJ.js} +1 -1
- package/.output/public/_nuxt/{BdRuKvw2.js → CGaUcol_.js} +1 -1
- package/.output/public/_nuxt/{B4FDp1sn.js → CKkVh4X6.js} +1 -1
- package/.output/public/_nuxt/{rscZxuQ2.js → CUu12Pr7.js} +1 -1
- package/.output/public/_nuxt/{BzhaMbyl.js → CWA5Cfde.js} +1 -1
- package/.output/public/_nuxt/CWvkRFU9.js +269 -0
- package/.output/public/_nuxt/{CTRkBkra.js → CY7tXH5c.js} +1 -1
- package/.output/public/_nuxt/{CemiMtCX.js → C_1RoKtr.js} +1 -1
- package/.output/public/_nuxt/{BwKAHWnp.js → CaZj7sno.js} +1 -1
- package/.output/public/_nuxt/CbbOSnE0.js +1 -0
- package/.output/public/_nuxt/{OuCcJFrZ.js → Cds-RgoS.js} +1 -1
- package/.output/public/_nuxt/{CqQg8Ldy.js → ChBheQRP.js} +1 -1
- package/.output/public/_nuxt/{DdvHdmGh.js → CkDbYrMj.js} +1 -1
- package/.output/public/_nuxt/Cke7R5qg.js +1 -0
- package/.output/public/_nuxt/{9OHRRPkh.js → CkzH91yw.js} +1 -1
- package/.output/public/_nuxt/CuEjdyyj.js +1 -0
- package/.output/public/_nuxt/Cv3A8XqH.js +1 -0
- package/.output/public/_nuxt/CzkxYs7G.js +1 -0
- package/.output/public/_nuxt/D-5fWV40.js +1 -0
- package/.output/public/_nuxt/{DEtIJe2u.js → D1xR8pBE.js} +1 -1
- package/.output/public/_nuxt/{C4XpvUuq.js → DJ5xpYjG.js} +1 -1
- package/.output/public/_nuxt/{DXyfavJr.js → DPQHj1GW.js} +1 -1
- package/.output/public/_nuxt/{BTd2ZN65.js → DQLKgX8r.js} +1 -1
- package/.output/public/_nuxt/DR05KuQJ.js +1 -0
- package/.output/public/_nuxt/{CBIEPWAA.js → DRTFVhVr.js} +1 -1
- package/.output/public/_nuxt/{BIPWeF69.js → DR_djprF.js} +1 -1
- package/.output/public/_nuxt/DRck-UV8.js +2 -0
- package/.output/public/_nuxt/{GXzlut8R.js → DTYY2tCY.js} +1 -1
- package/.output/public/_nuxt/{DUHba1vY.js → DV7MSCWu.js} +1 -1
- package/.output/public/_nuxt/{hAFXcJ2_.js → DVKmRHSk.js} +1 -1
- package/.output/public/_nuxt/{xnReCuE4.js → DWjqEyG2.js} +1 -1
- package/.output/public/_nuxt/{ByE1aAlg.js → Dc6WL_Gw.js} +1 -1
- package/.output/public/_nuxt/DdJEKw37.js +2 -0
- package/.output/public/_nuxt/{wCosSBIO.js → Dfijnsli.js} +1 -1
- package/.output/public/_nuxt/{DSpiceQe.js → DvCXikgN.js} +1 -1
- package/.output/public/_nuxt/{Bl_Sz9PU.js → Dzc0ALmG.js} +1 -1
- package/.output/public/_nuxt/{CmJE87KM.js → FtIBRaSq.js} +1 -1
- package/.output/public/_nuxt/MtN3owE1.js +1 -0
- package/.output/public/_nuxt/{D-7HtdRe.js → TXWXdcZY.js} +1 -1
- package/.output/public/_nuxt/{BArXRmKu.js → UXILZBAC.js} +1 -1
- package/.output/public/_nuxt/{BD_Kvn-W.js → V4k_CDL-.js} +1 -1
- package/.output/public/_nuxt/{EnN6XTXK.js → VRyQKyno.js} +1 -1
- package/.output/public/_nuxt/{Bdd5S2WL.js → XbaHEIpm.js} +1 -1
- package/.output/public/_nuxt/_pageId_.C5KTkEfy.css +1 -0
- package/.output/public/_nuxt/_panelId_.CKSHyLNC.css +1 -0
- package/.output/public/_nuxt/{DsG1SoRB.js → as6CcDUM.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/8e5022d6-1d1c-4861-b0b7-dc52b699526a.json +1 -0
- package/.output/public/_nuxt/components.a-P9dVi2.css +1 -0
- package/.output/public/_nuxt/{entry.Bc0aTA0K.css → entry.DRnr7AV7.css} +1 -1
- package/.output/public/_nuxt/error-404.DnBTUElh.css +1 -0
- package/.output/public/_nuxt/error-500.BNyYF0qG.css +1 -0
- package/.output/public/_nuxt/{CBVcjGJL.js → fbfpKHgl.js} +1 -1
- package/.output/public/_nuxt/graph-resolver-BXlQLip4.js +180 -0
- package/.output/public/_nuxt/{DCK6hB22.js → hunqYsQf.js} +1 -1
- package/.output/public/_nuxt/iJghVVcV.js +1 -0
- package/.output/public/_nuxt/{Bu1xs0Fv.js → m4Sxwg8n.js} +1 -1
- package/.output/public/_nuxt/{DKWXhhCy.js → mrNv5qht.js} +1 -1
- package/.output/public/_nuxt/{CnhVSb6R.js → s8-NXH-d.js} +1 -1
- package/.output/public/_nuxt/{Cs-GjQ8R.js → sDoJGqlK.js} +1 -1
- package/.output/public/_nuxt/{vuetify.BzdWZaIq.css → vuetify.DtnS3-VQ.css} +1 -1
- package/.output/server/index.mjs +2037 -1076
- package/.output/server/index.mjs.map +1 -1
- package/.output/server/node_modules/ws/lib/buffer-util.js +131 -0
- package/.output/server/node_modules/ws/lib/constants.js +19 -0
- package/.output/server/node_modules/ws/lib/event-target.js +292 -0
- package/.output/server/node_modules/ws/lib/extension.js +203 -0
- package/.output/server/node_modules/ws/lib/limiter.js +55 -0
- package/.output/server/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/.output/server/node_modules/ws/lib/receiver.js +706 -0
- package/.output/server/node_modules/ws/lib/sender.js +602 -0
- package/.output/server/node_modules/ws/lib/stream.js +161 -0
- package/.output/server/node_modules/ws/lib/subprotocol.js +62 -0
- package/.output/server/node_modules/ws/lib/validation.js +152 -0
- package/.output/server/node_modules/ws/lib/websocket-server.js +554 -0
- package/.output/server/node_modules/ws/lib/websocket.js +1393 -0
- package/.output/server/node_modules/ws/package.json +70 -0
- package/.output/server/node_modules/ws/wrapper.mjs +21 -0
- package/.output/server/package.json +2 -1
- package/package.json +6 -4
- package/.output/public/_nuxt/-OnKOwAh.js +0 -1
- package/.output/public/_nuxt/B-dJABhs.js +0 -1
- package/.output/public/_nuxt/BKIVPvZX.js +0 -1
- package/.output/public/_nuxt/BXphdu9w.js +0 -2
- package/.output/public/_nuxt/BYmSxWA_.js +0 -1
- package/.output/public/_nuxt/BhozkjGO.js +0 -1
- package/.output/public/_nuxt/BtrNScOx.js +0 -1
- package/.output/public/_nuxt/BupMEc6X.js +0 -6
- package/.output/public/_nuxt/Bv_vOb-Y.js +0 -14
- package/.output/public/_nuxt/CYL3VlR9.js +0 -1
- package/.output/public/_nuxt/Cz-197mS.js +0 -1
- package/.output/public/_nuxt/DHJ62FKo.js +0 -2
- package/.output/public/_nuxt/DnpKvmH_.js +0 -1
- package/.output/public/_nuxt/DrWe3t51.js +0 -2
- package/.output/public/_nuxt/DtBrxin9.js +0 -1
- package/.output/public/_nuxt/M0WOzN-S.js +0 -269
- package/.output/public/_nuxt/ZpmLW6rw.js +0 -1
- package/.output/public/_nuxt/builds/meta/d356de5d-6230-4e66-aba2-c48f455ae207.json +0 -1
- package/.output/public/_nuxt/builds/meta/ed797280-2bf0-44e6-a601-2ff2462bfbbc.json +0 -1
- package/.output/public/_nuxt/c6k-jVO-.js +0 -1
- package/.output/public/_nuxt/components.CIe9upZ4.css +0 -1
- package/.output/public/_nuxt/error-404.iOXvqd5J.css +0 -1
- package/.output/public/_nuxt/error-500.D0BgXBui.css +0 -1
- package/.output/public/_nuxt/graph-resolver-E9RSC1Ga.js +0 -180
package/.output/nitro.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{s as f,V as w}from"./
|
|
1
|
+
import{s as f,V as w}from"./C5QFcB9K.js";import{b3 as N,am as S,u as L,b4 as V,b5 as D,b6 as x,b7 as Y,b8 as C}from"#entry";import{E as M,w as H,V as W,J as F,a6 as z,W as J,D as $,j as I,n as b,B as P}from"./77UvFSdd.js";let A=!1;function T(t){A||(N("openEntitySnapshot",e=>{if(!e||typeof e!="object")return;const n=e;typeof n.projectId!="string"||n.projectId.length===0||typeof n.snapshotId!="string"||n.snapshotId.length===0||t.push({name:"settings.entity-snapshot-details",params:{projectId:n.projectId,snapshotId:n.snapshotId}})}),A=!0)}const d=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),E=t=>{if(!d(t)||!("$meta"in t))return!1;const e=t.$meta;return d(e)?typeof e.type=="string"&&e.type.length>0:!1},q=t=>Array.isArray(t)&&t.length>0&&t.every(E),g=t=>!d(t)||!(S.Secret in t)||t[S.Secret]!==!0?!1:"value"in t,i=t=>" ".repeat(Math.max(0,t)),h=(t,e)=>{const n=t.trimEnd();return n.length===0?[]:n.split(/\r?\n/).map(s=>s.length>0?`${i(e)}${s}`:s)},G=t=>{const e=t.$meta,n=typeof e.title=="string"&&e.title.length>0?e.title:e.type,s=typeof e.entityId=="string"&&e.entityId.length>0?e.entityId:"unknown";return`${n} [${s}]`},K=t=>{const e=t.$meta.description;if(!(typeof e!="string"||e.length===0))return e},Q=(t,e,n)=>{Object.keys(n).length!==0&&t.push(...h(f(n),e))},y=(t,e=new WeakSet)=>g(t)?!0:Array.isArray(t)?t.some(n=>y(n,e)):!d(t)||e.has(t)?!1:(e.add(t),Object.values(t).some(n=>y(n,e))),R=(t,e,n,s)=>{const a=t.length+1;t.push(`${i(n)}# secret`),t.push(...h(f({value:s}),n));const r=t.length;r>a&&e.push({start:a,end:r})},U=(t,e,n,s)=>{if(s.length===0){t.push(`${i(n)}[]`);return}for(const a of s){if(g(a)){t.push(`${i(n)}-`),R(t,e,n+2,a.value);continue}if(!y(a)){t.push(...h(f([a]),n));continue}t.push(`${i(n)}-`),B(t,e,n+2,a)}},O=(t,e,n,s)=>{for(const[a,r]of Object.entries(s)){if(g(r)){t.push(`${i(n)}${a}:`),R(t,e,n+2,r.value);continue}if(!y(r)){t.push(...h(f({[a]:r}),n));continue}t.push(`${i(n)}${a}:`),B(t,e,n+2,r)}},B=(t,e,n,s)=>{if(g(s)){R(t,e,n,s.value);return}if(Array.isArray(s)){U(t,e,n,s);return}if(d(s)){O(t,e,n,s);return}t.push(...h(f(s),n))},X=(t,e,n,s)=>{if(Object.keys(s).length!==0){if(!y(s)){Q(t,n,s);return}O(t,e,n,s)}},k=t=>{const e=t.lines.length+1,n=G(t.node),s=K(t.node),a=t.node.$meta.snapshotId;typeof a=="string"&&a.length>0&&t.links.push({line:e,snapshotId:a}),t.asListItem?t.lines.push(`${i(t.indent)}- # ${n}`):t.lines.push(`${i(t.indent)}# ${n}`);const r=t.asListItem?t.indent+2:t.indent;s&&t.lines.push(`${i(r)}# ${s}`);const o={},l=()=>{X(t.lines,t.regions,r,o);for(const u of Object.keys(o))delete o[u]};for(const[u,c]of Object.entries(t.node))if(u!=="$meta"){if(g(c)){l(),t.lines.push(`${i(r)}${u}:`);const p=t.lines.length+1;t.lines.push(`${i(r+2)}# secret`),t.lines.push(...h(f({value:c.value}),r+2));const j=t.lines.length;j>p&&t.regions.push({start:p,end:j});continue}if(E(c)||q(c)){if(l(),t.lines.push(`${i(r)}${u}:`),Array.isArray(c)){for(const p of c)k({node:p,indent:r+2,asListItem:!0,lines:t.lines,regions:t.regions,links:t.links,createRegion:!0});continue}k({node:c,indent:r+2,asListItem:!1,lines:t.lines,regions:t.regions,links:t.links,createRegion:!0});continue}o[u]=c}l();const m=t.lines.length;t.createRegion&&m>e&&t.regions.push({start:e,end:m})};function Z(t){if(!E(t))return{yaml:f(t??{}),regions:[],links:[]};const e=[],n=[],s=[];return k({node:t,indent:0,asListItem:!1,lines:e,regions:n,links:s,createRegion:!1}),{yaml:`${e.join(`
|
|
2
2
|
`)}
|
|
3
3
|
`,regions:n,links:s}}const et=M({__name:"EntityExplorerCodeEditor",props:{entity:{},projectId:{},language:{default:"yaml"},theme:{default:"dark-plus"},height:{default:"100%"},foldNestedByDefault:{type:Boolean,default:!0},options:{}},setup(t){const e=I(()=>Z(t.entity.content)),n=I(()=>e.value.yaml),s=I(()=>`entity://${t.entity.snapshotId}`),a=I(()=>({...C(),...t.options??{}})),r=L();T(r);const o=P(null);async function l(){if(!(!t.foldNestedByDefault||!o.value)){if(t.language==="yaml"){V(t.entity.snapshotId,e.value.regions),D({snapshotId:t.entity.snapshotId,projectId:t.projectId,links:e.value.links}),await x(o.value);return}await Y(o.value)}}const m=async(u,c)=>{o.value=u,await b(),await l()};return H(()=>n,async()=>{await b(),await l()}),(u,c)=>(W(),F("div",{style:z({height:t.height})},[J($(w),{value:$(n),language:t.language,theme:t.theme,path:$(s),options:$(a),style:{height:"100%"},onMount:m},null,8,["value","language","theme","path","options"])],4))}});export{et as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as Z,n as Q,_ as A,r as X,E as F,c as ee,W as te,g as se,i as ne}from"./BzbjXxJd.js";import{D as oe,E as re}from"#entry";import{E as ae,d as ie,w as G,H as le,P as ce,V as f,Y as N,aH as de,a as L,D as r,_ as k,aS as ue,W as h,at as U,Z as W,$ as T,a1 as V,ak as pe,aT as me,J as P,aa as j,aI as z,a2 as E,a0 as x,ao as ye,al as fe,ab as we,r as H,j as $}from"./77UvFSdd.js";const M=Z,O=Q;function I(e,t){let s=[];for(let n=0;n<Math.max(e.length,t.length);n++)s.push([e[n],t[n]]);return s}function B(...e){return e.reduce((t,s)=>new Set([...t,...s]),new Set)}function he(...e){return e.reduce((t,s)=>new Set(Array.from(t).filter(n=>s.has(n))))}const y={sec:1e3};y.min=60*y.sec;y.h=60*y.min;y.d=24*y.h;y.mo=30*y.d;y.y=365*y.mo;function ge(e){if(Number.isNaN(e))return"never";if(e>y.y*100)return"centuries";let t=[];for(let[s,n]of Object.entries(y).reverse()){if(e<n)continue;let c=Math.floor(e/n);t.push(`${c}${s}`),e-=c*n}return t.length>0?t.join(" "):"0 sec"}const u={};u[1]=new Set("0123456789");u["@"]=new Set("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~");u.v=new Set("aeiouy");u.c=new Set("bcdfghjklmnpqrstvwxz");u.a=B(u.v,u.c);for(const e of"vca")u[e.toUpperCase()]=new Set(Array.from(u[e]).map(t=>t.toUpperCase()));u.l=B(u.a,u.A);u.n=B(u.l,u[1]);u["*"]=B(u.n,u["@"]);const ve={s:"cv",S:"Cv"};function ke(e,t){if(Array.isArray(e)||(e=Array.from(e)),t<0||t>=e.length)throw new Error("Out of bounds index access");return e[t]}function be(e,t){let s=M(t),n=[];for(const c of e){const l=BigInt(c);n.push(Number(s%l)),s/=l}return{values:n,entropyLeft:s}}function q(e){let t=0;for(let s=e;s;t++,s>>=1n);return t-1}function S(e,t){return ge(Number(e)/t*1e3)}function Ve(e){const t=[[1005,"too guessable"],[1000005,"very guessable"],[100000005,"somewhat guessable"],[10000000005,"safely unguessable"]];let s="very unguessable";for(const[n,c]of t)if(e<=BigInt(n)){s=c;break}return s}function Y(e){const s=3416.6666666666665/(2*(y.y/1e3)),c=(360+6*320)/6,l=.12,o=(l+l*.33)/60/1e3,b=c*o+s,w=v=>Number(e/BigInt(v))*b;return{score:Ve(e),guesses:{online_throttling:S(e,100/(y.h/1e3)),online:S(e,10),slow:S(e,1e4),fast:S(e,1e10)},costs:{luks:w(22779),filevault2:w(151300),macos:w(1019200),pbkdf2:w(3029200)}}}class Pe{constructor(t){t=t.split("").map(s=>ve[s]||s).join(""),this.chars=t.split(""),this.length=this.chars.length,this.sets=this.chars.map(s=>u[s]||new Set([s])),this.lengths=this.sets.map(s=>s.size),this.cardinality=this.sets.reduce((s,n)=>s*BigInt(n.size),1n),this.entropy=q(this.cardinality)}apply(t){if(this.cardinality>=2n**BigInt(8*t.length/2))throw new Error("Not enough entropy");const{entropyLeft:s,values:n}=be(this.lengths,t);return{password:I(this.sets,n).map(([l,d])=>ke(l,d)).join(""),entropyLeft:s}}inverse({password:t,entropyLeft:s}){const n=I(this.sets,t.split("")).map(([l,d])=>Array.from(l).indexOf(d)),c=I(this.sets,n).reduceRight((l,[d,o])=>l*BigInt(d.size)+BigInt(o),0n);return O(s*this.cardinality+c)}estimate(){return Y(this.cardinality)}}const _=e=>new Pe(e),C=[];for(let e=0;e<17;e++)for(let t=0;t<3;t++)for(let s=0;s<2;s++){const n=["cvccvc","cvccvc","cvccvc"];n[t]=s?"1cvcvc":"cvccv1";const c=n.join("-");let l;for(let d=0,o=0;d<c.length;d++){const g=c[d];["c","v"].includes(g)&&(o===e&&(l=c.slice(0,d)+g.toUpperCase()+c.slice(d+1)),o++)}if(!l)throw new Error("Cannot find uppercase syllable index");C.push(l)}const Ee=(()=>{const e=BigInt(C.length),t=_(C[0]).cardinality*e;return{length:20,cardinality:t,entropy:q(t),estimate:()=>Y(t),apply:s=>{let n=M(s);const c=Number(n%e);return _(C[c]).apply(O(n/e))},inverse(s){const c=s.password.split("").map(g=>{const b=Object.entries(u).filter(([w,v])=>["c","v","C","V","1"].includes(w)).map(([w,v])=>[w,he(v,new Set([g]))]).filter(([w,v])=>v.size>0);if(b.length>1)throw new Error("Too much possible values, cannot detect mask.");return b.length?b[0][0]:g}).join(""),l=C.indexOf(c);if(l<0)throw new Error("Unknown mask");const d=_(C[l]).inverse(s),o=M(d);return O(o*e+BigInt(l))}}})(),Ne={class:"ml-2"},Ce={key:0,class:"mt-1"},Te={key:1},xe={key:1,class:"mb-4"},Se={class:"d-flex justify-space-between align-center mb-2"},Be={class:"text-caption text-medium-emphasis mt-1"},Ue={key:0,class:"mt-2"},Ie={class:"text-caption text-medium-emphasis ml-4"},Ae=ae({__name:"UnlockMethodForm",props:{showTypeSelector:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},showDisplayName:{type:Boolean,default:!0},initialType:{default:"password"},displayNameLabel:{default:"Display Name"},displayNameHint:{default:"A friendly name to identify this unlock method"},passwordHint:{default:"Password must be strong enough to resist offline attacks"},defaultDisplayName:{default:""},defaultDescription:{default:""}},emits:["update:valid","update:form"],setup(e,{expose:t,emit:s}){const n=e,c=s,l=H(!1),d=H(!1),o=ie({type:n.initialType,title:"",description:"",password:"",confirmPassword:""}),g=$(()=>n.showDisplayName?[a=>!!a||"Display name is required",a=>a&&a.length<=100||"Display name must be less than 100 characters"]:[]),b=[a=>!!a||"Password is required"],w=[a=>!!a||"Confirm password is required",a=>a===o.password||"Passwords do not match"],v=()=>{const a=Ee.apply(X(32)).password;o.password=a,o.confirmPassword=a,d.value=!0},m=$(()=>{if(!o.password)return null;const a=oe.zxcvbn(o.password),i={0:"very-weak",1:"weak",2:"fair",3:"strong",4:"very-strong"},p=Math.max(0,Math.min(4,a.score));return{score:a.score/4*100,level:i[p],estimatedCrackTime:a.crack_times_display.offline_slow_hashing_1e4_per_second||"unknown",recommendations:a.feedback.suggestions||[],warning:a.feedback.warning||void 0}}),R=a=>{switch(a){case"very-weak":return"error";case"weak":return"warning";case"fair":return"info";case"strong":return"success";case"very-strong":return"success";default:return"info"}},D=a=>{switch(a){case"password":return"mdi-key-variant";case"passkey":return"mdi-fingerprint";default:return"mdi-lock"}},J=()=>{o.type=n.initialType,o.title=n.defaultDisplayName,o.description=n.defaultDescription,o.password="",o.confirmPassword="",d.value=!1};return G(l,a=>{c("update:valid",a)}),G(o,a=>{c("update:form",{...a})},{deep:!0}),le(()=>{o.title=n.defaultDisplayName,o.description=n.defaultDescription}),t({resetForm:J,form:ce(o)}),(a,i)=>(f(),N(de,{modelValue:r(l),"onUpdate:modelValue":i[6]||(i[6]=p=>L(l)?l.value=p:null)},{default:k(()=>[e.showTypeSelector?(f(),N(ue,{key:0,modelValue:r(o).type,"onUpdate:modelValue":i[0]||(i[0]=p=>r(o).type=p),mandatory:"",variant:"outlined",density:"compact",divided:"",class:"w-100 mb-6"},{default:k(()=>[h(U,{value:"password",class:"flex-grow-1"},{default:k(()=>[h(W,{icon:D("password"),class:"mr-2"},null,8,["icon"]),i[7]||(i[7]=T(" Password ",-1))]),_:1}),h(U,{value:"passkey",class:"flex-grow-1"},{default:k(()=>[h(W,{icon:D("passkey"),class:"mr-2"},null,8,["icon"]),i[8]||(i[8]=T(" Passkey ",-1))]),_:1})]),_:1},8,["modelValue"])):V("",!0),e.showDisplayName?(f(),N(pe,{key:1,modelValue:r(o).title,"onUpdate:modelValue":i[1]||(i[1]=p=>r(o).title=p),class:"mb-4",variant:"outlined",density:"compact",label:e.displayNameLabel,rules:r(g),placeholder:"My unlock method",hint:e.displayNameHint,"persistent-hint":""},null,8,["modelValue","label","rules","hint"])):V("",!0),e.showDescription?(f(),N(me,{key:2,modelValue:r(o).description,"onUpdate:modelValue":i[2]||(i[2]=p=>r(o).description=p),class:"mb-4",variant:"outlined",density:"compact",label:"Description",placeholder:"Optional description for this unlock method",rows:"2","auto-grow":"","hide-details":""},null,8,["modelValue"])):V("",!0),r(o).type==="password"?(f(),P(j,{key:3},[h(r(A),{modelValue:r(o).password,"onUpdate:modelValue":i[3]||(i[3]=p=>r(o).password=p),visible:r(d),"onUpdate:visible":i[4]||(i[4]=p=>L(d)?d.value=p:null),class:"mb-4",label:"Password",rules:b,hint:e.passwordHint,"persistent-hint":""},null,8,["modelValue","visible","hint"]),h(U,{type:"button",class:"mb-4",variant:"tonal","prepend-icon":"mdi-auto-fix",onClick:v},{default:k(()=>[...i[9]||(i[9]=[T(" Generate Secure Password ",-1)])]),_:1}),h(r(A),{modelValue:r(o).confirmPassword,"onUpdate:modelValue":i[5]||(i[5]=p=>r(o).confirmPassword=p),class:"mb-4",label:"Confirm Password",rules:w},null,8,["modelValue"]),r(m)&&r(m).score<40?(f(),N(z,{key:0,type:r(m).score<20?"error":"warning",density:"compact",class:"mb-4"},{default:k(()=>[E("div",Ne,[E("strong",null,x(r(m).score<20?"Very Weak":"Weak")+" Password:",1),r(m).warning?(f(),P("div",Ce,x(r(m).warning),1)):(f(),P("div",Te," This password may be vulnerable to offline attacks. Consider using a stronger password. "))])]),_:1},8,["type"])):V("",!0),r(m)?(f(),P("div",xe,[E("div",Se,[i[10]||(i[10]=E("span",{class:"text-caption"},"Password Strength",-1)),h(ye,{color:R(r(m).level),size:"small",variant:"flat"},{default:k(()=>[T(x(r(m).level.replace("-"," ").toUpperCase()),1)]),_:1},8,["color"])]),h(fe,{"model-value":r(m).score,color:R(r(m).level),height:"6",rounded:""},null,8,["model-value","color"]),E("div",Be," Estimated crack time: "+x(r(m).estimatedCrackTime),1),r(m).recommendations.length>0?(f(),P("div",Ue,[i[11]||(i[11]=E("div",{class:"text-caption font-weight-medium mb-1"},"Suggestions:",-1)),E("ul",Ie,[(f(!0),P(j,null,we(r(m).recommendations,p=>(f(),P("li",{key:p},x(p),1))),128))])])):V("",!0)])):V("",!0)],64)):r(o).type==="passkey"?(f(),N(z,{key:4,type:"info",density:"compact",class:"mb-4"},{default:k(()=>[...i[12]||(i[12]=[T(" You'll be prompted to create a passkey using your device's biometric authentication or security key when you click Create. ",-1)])]),_:1})):V("",!0)]),_:1},8,["modelValue"]))}});async function K(e,t){const s=await se(),n=await t.encrypt(s),c=re(n),l=await ne(s);return{meta:e,encryptedIdentity:c,recipient:l}}async function _e(e,t){const s=new F;return s.setPassphrase(e),{type:"password",...await K(t,s)}}async function Me(e){if(!e.title)throw new Error("Display name is required for passkey unlock method");const t=await ee({keyName:e.title}),s=new F;return s.addRecipient(new te({identity:t})),{type:"passkey",...await K(e,s),passkeyIdentity:t}}function Ge(e){const t={title:e.title,description:e.description};if(e.type==="password")return _e(e.password,t);if(e.type==="passkey")return Me(t);throw new Error(`Unsupported unlock method type: ${e.type}`)}export{Ae as _,Ge as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as v,i as k,v as I,t as b}from"#entry";import{_ as A}from"./DvCXikgN.js";import{_ as y}from"./DTYY2tCY.js";import{_ as w}from"./iJghVVcV.js";import{_ as d,I as S}from"./C_1RoKtr.js";import{S as C}from"./C5DRPdxC.js";import{D as P,a as g}from"./hunqYsQf.js";import{E as D,aO as r,Y as V,_ as a,D as e,V as $,W as n,at as x,$ as c,ao as z,a0 as p}from"./77UvFSdd.js";import"./B69Z0Xk1.js";import"./CxoCegAs.js";import"./BxvmPvww.js";import"./fbfpKHgl.js";import"./BgvYz3Nr.js";const F=D({__name:"[panelId]",props:{params:{}},async setup(m){let i,o;const{settingsStore:u,projectStore:s}=v(),f=k();s.initializing?([i,o]=r(()=>b(()=>s.initialized).toBe(!0)),await i,o(),s.addLibraryRoot()):([i,o]=r(()=>s.initialize1()),await i,o(),[i,o]=r(()=>s.initialize2()),await i,o());const t=([i,o]=r(()=>u.getPanelDetails(m.params.panelId)),i=await i,o(),i);if(!t)throw I({statusCode:404,statusMessage:"Panel not found"});const _=[{key:"panelId",label:"Panel ID"},{key:"name",label:"Name"},{key:"status",label:"Status"},{key:"instance",label:"Instance"},{key:"serviceAccount",label:"Service Account"},{key:"workerVersion",label:"Worker Version"},{key:"createdAt",label:"Created"},{key:"updatedAt",label:"Last Updated"}];return(B,l)=>($(),V(e(g),null,{default:a(()=>[n(C,{meta:e(t).meta,"fallback-icon":"mdi-view-dashboard-outline",title:e(t).meta.title,description:e(t).meta.description},{actions:a(()=>[n(x,{variant:"outlined","prepend-icon":"mdi-open-in-new",disabled:!e(t).online,onClick:l[0]||(l[0]=O=>e(f).openPanel(m.params.projectId,e(t).id))},{default:a(()=>[...l[1]||(l[1]=[c(" Open Panel ",-1)])]),_:1},8,["disabled"])]),_:1},8,["meta","title","description"]),n(e(P),{title:"Panel Details",items:_},{"item.panelId":a(()=>[n(e(S),{value:e(t).id},null,8,["value"])]),"item.name":a(()=>[c(p(e(t).name),1)]),"item.status":a(()=>[n(z,{color:e(t).online?"success":void 0,"prepend-icon":e(t).online?"mdi-access-point":"mdi-access-point-off",size:"small",variant:"tonal"},{default:a(()=>[c(p(e(t).online?"Online":"Offline"),1)]),_:1},8,["color","prepend-icon"])]),"item.instance":a(()=>[n(e(y),{item:{stateId:e(t).stateId}},null,8,["item"])]),"item.serviceAccount":a(()=>[n(e(A),{item:{serviceAccountId:e(t).serviceAccountId,serviceAccountMeta:e(t).serviceAccountMeta}},null,8,["item"])]),"item.workerVersion":a(()=>[n(e(w),{item:e(t)},null,8,["item"])]),"item.createdAt":a(()=>[n(e(d),{value:e(t).createdAt},null,8,["value"])]),"item.updatedAt":a(()=>[n(e(d),{value:e(t).updatedAt},null,8,["value"])]),_:1})]),_:1}))}});export{F as default};
|