ncc-client-poc 0.1.2 → 0.2.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.
@@ -0,0 +1,169 @@
1
+ import{r as F,R as k}from"./vendor-react-KfUPlHYY.js";/**
2
+ * @license lucide-react v0.344.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */var he={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
7
+ * @license lucide-react v0.344.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const ue=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),g=(l,a)=>{const s=F.forwardRef(({color:i="currentColor",size:f=24,strokeWidth:u=2,absoluteStrokeWidth:w,className:M="",children:e,...r},t)=>F.createElement("svg",{ref:t,...he,width:f,height:f,stroke:i,strokeWidth:w?Number(u)*24/Number(f):u,className:["lucide",`lucide-${ue(l)}`,M].join(" "),...r},[...a.map(([o,n])=>F.createElement(o,n)),...Array.isArray(e)?e:[e]]));return s.displayName=`${l}`,s};/**
12
+ * @license lucide-react v0.344.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const ve=g("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
17
+ * @license lucide-react v0.344.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const Ae=g("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
22
+ * @license lucide-react v0.344.0 - ISC
23
+ *
24
+ * This source code is licensed under the ISC license.
25
+ * See the LICENSE file in the root directory of this source tree.
26
+ */const Re=g("ArrowDownWideNarrow",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]]);/**
27
+ * @license lucide-react v0.344.0 - ISC
28
+ *
29
+ * This source code is licensed under the ISC license.
30
+ * See the LICENSE file in the root directory of this source tree.
31
+ */const Ne=g("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
32
+ * @license lucide-react v0.344.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */const Pe=g("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
37
+ * @license lucide-react v0.344.0 - ISC
38
+ *
39
+ * This source code is licensed under the ISC license.
40
+ * See the LICENSE file in the root directory of this source tree.
41
+ */const Se=g("BadgeCheck",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
42
+ * @license lucide-react v0.344.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */const be=g("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
47
+ * @license lucide-react v0.344.0 - ISC
48
+ *
49
+ * This source code is licensed under the ISC license.
50
+ * See the LICENSE file in the root directory of this source tree.
51
+ */const Ie=g("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
52
+ * @license lucide-react v0.344.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */const Le=g("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
57
+ * @license lucide-react v0.344.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const ze=g("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
62
+ * @license lucide-react v0.344.0 - ISC
63
+ *
64
+ * This source code is licensed under the ISC license.
65
+ * See the LICENSE file in the root directory of this source tree.
66
+ */const xe=g("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
67
+ * @license lucide-react v0.344.0 - ISC
68
+ *
69
+ * This source code is licensed under the ISC license.
70
+ * See the LICENSE file in the root directory of this source tree.
71
+ */const Oe=g("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/**
72
+ * @license lucide-react v0.344.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const Te=g("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
77
+ * @license lucide-react v0.344.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const De=g("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
82
+ * @license lucide-react v0.344.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const Fe=g("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/**
87
+ * @license lucide-react v0.344.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const Be=g("Network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/**
92
+ * @license lucide-react v0.344.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */const Ue=g("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
97
+ * @license lucide-react v0.344.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const _e=g("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
102
+ * @license lucide-react v0.344.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const Qe=g("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);/**
107
+ * @license lucide-react v0.344.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const He=g("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
112
+ * @license lucide-react v0.344.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Ve=g("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
117
+ * @license lucide-react v0.344.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const $e=g("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
122
+ * @license lucide-react v0.344.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const je=g("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
127
+ * @license lucide-react v0.344.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const Ge=g("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
132
+ * @license lucide-react v0.344.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Ye=g("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
137
+ * @license lucide-react v0.344.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const qe=g("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
142
+ * @license lucide-react v0.344.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Ke=g("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
147
+ * @license lucide-react v0.344.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const We=g("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
152
+ * @license lucide-react v0.344.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const Xe=g("Wallet",[["path",{d:"M21 12V7H5a2 2 0 0 1 0-4h14v4",key:"195gfw"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h16v-5",key:"195n9w"}],["path",{d:"M18 12a2 2 0 0 0 0 4h4v-4Z",key:"vllfpd"}]]);/**
157
+ * @license lucide-react v0.344.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const Ze=g("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var de=Object.defineProperty,O=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable,G=(l,a,s)=>a in l?de(l,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):l[a]=s,B=(l,a)=>{for(var s in a||(a={}))Y.call(a,s)&&G(l,s,a[s]);if(O)for(var s of O(a))q.call(a,s)&&G(l,s,a[s]);return l},U=(l,a)=>{var s={};for(var i in l)Y.call(l,i)&&a.indexOf(i)<0&&(s[i]=l[i]);if(l!=null&&O)for(var i of O(l))a.indexOf(i)<0&&q.call(l,i)&&(s[i]=l[i]);return s};/**
162
+ * @license QR Code generator library (TypeScript)
163
+ * Copyright (c) Project Nayuki.
164
+ * SPDX-License-Identifier: MIT
165
+ */var b;(l=>{const a=class p{constructor(e,r,t,o){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],e<p.MIN_VERSION||e>p.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=e*4+17;let n=[];for(let c=0;c<this.size;c++)n.push(!1);for(let c=0;c<this.size;c++)this.modules.push(n.slice()),this.isFunction.push(n.slice());this.drawFunctionPatterns();const h=this.addEccAndInterleave(t);if(this.drawCodewords(h),o==-1){let c=1e9;for(let m=0;m<8;m++){this.applyMask(m),this.drawFormatBits(m);const d=this.getPenaltyScore();d<c&&(o=m,c=d),this.applyMask(m)}}f(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(e,r){const t=l.QrSegment.makeSegments(e);return p.encodeSegments(t,r)}static encodeBinary(e,r){const t=l.QrSegment.makeBytes(e);return p.encodeSegments([t],r)}static encodeSegments(e,r,t=1,o=40,n=-1,h=!0){if(!(p.MIN_VERSION<=t&&t<=o&&o<=p.MAX_VERSION)||n<-1||n>7)throw new RangeError("Invalid value");let c,m;for(c=t;;c++){const y=p.getNumDataCodewords(c,r)*8,E=w.getTotalBits(e,c);if(E<=y){m=E;break}if(c>=o)throw new RangeError("Data too long")}for(const y of[p.Ecc.MEDIUM,p.Ecc.QUARTILE,p.Ecc.HIGH])h&&m<=p.getNumDataCodewords(c,y)*8&&(r=y);let d=[];for(const y of e){s(y.mode.modeBits,4,d),s(y.numChars,y.mode.numCharCountBits(c),d);for(const E of y.getData())d.push(E)}f(d.length==m);const A=p.getNumDataCodewords(c,r)*8;f(d.length<=A),s(0,Math.min(4,A-d.length),d),s(0,(8-d.length%8)%8,d),f(d.length%8==0);for(let y=236;d.length<A;y^=253)s(y,8,d);let v=[];for(;v.length*8<d.length;)v.push(0);return d.forEach((y,E)=>v[E>>>3]|=y<<7-(E&7)),new p(c,r,v,n)}getModule(e,r){return 0<=e&&e<this.size&&0<=r&&r<this.size&&this.modules[r][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let t=0;t<this.size;t++)this.setFunctionModule(6,t,t%2==0),this.setFunctionModule(t,6,t%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),r=e.length;for(let t=0;t<r;t++)for(let o=0;o<r;o++)t==0&&o==0||t==0&&o==r-1||t==r-1&&o==0||this.drawAlignmentPattern(e[t],e[o]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const r=this.errorCorrectionLevel.formatBits<<3|e;let t=r;for(let n=0;n<10;n++)t=t<<1^(t>>>9)*1335;const o=(r<<10|t)^21522;f(o>>>15==0);for(let n=0;n<=5;n++)this.setFunctionModule(8,n,i(o,n));this.setFunctionModule(8,7,i(o,6)),this.setFunctionModule(8,8,i(o,7)),this.setFunctionModule(7,8,i(o,8));for(let n=9;n<15;n++)this.setFunctionModule(14-n,8,i(o,n));for(let n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,i(o,n));for(let n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,i(o,n));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;const r=this.version<<12|e;f(r>>>18==0);for(let t=0;t<18;t++){const o=i(r,t),n=this.size-11+t%3,h=Math.floor(t/3);this.setFunctionModule(n,h,o),this.setFunctionModule(h,n,o)}}drawFinderPattern(e,r){for(let t=-4;t<=4;t++)for(let o=-4;o<=4;o++){const n=Math.max(Math.abs(o),Math.abs(t)),h=e+o,c=r+t;0<=h&&h<this.size&&0<=c&&c<this.size&&this.setFunctionModule(h,c,n!=2&&n!=4)}}drawAlignmentPattern(e,r){for(let t=-2;t<=2;t++)for(let o=-2;o<=2;o++)this.setFunctionModule(e+o,r+t,Math.max(Math.abs(o),Math.abs(t))!=1)}setFunctionModule(e,r,t){this.modules[r][e]=t,this.isFunction[r][e]=!0}addEccAndInterleave(e){const r=this.version,t=this.errorCorrectionLevel;if(e.length!=p.getNumDataCodewords(r,t))throw new RangeError("Invalid argument");const o=p.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][r],n=p.ECC_CODEWORDS_PER_BLOCK[t.ordinal][r],h=Math.floor(p.getNumRawDataModules(r)/8),c=o-h%o,m=Math.floor(h/o);let d=[];const A=p.reedSolomonComputeDivisor(n);for(let y=0,E=0;y<o;y++){let R=e.slice(E,E+m-n+(y<c?0:1));E+=R.length;const x=p.reedSolomonComputeRemainder(R,A);y<c&&R.push(0),d.push(R.concat(x))}let v=[];for(let y=0;y<d[0].length;y++)d.forEach((E,R)=>{(y!=m-n||R>=c)&&v.push(E[y])});return f(v.length==h),v}drawCodewords(e){if(e.length!=Math.floor(p.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let r=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let o=0;o<this.size;o++)for(let n=0;n<2;n++){const h=t-n,m=(t+1&2)==0?this.size-1-o:o;!this.isFunction[m][h]&&r<e.length*8&&(this.modules[m][h]=i(e[r>>>3],7-(r&7)),r++)}}f(r==e.length*8)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let r=0;r<this.size;r++)for(let t=0;t<this.size;t++){let o;switch(e){case 0:o=(t+r)%2==0;break;case 1:o=r%2==0;break;case 2:o=t%3==0;break;case 3:o=(t+r)%3==0;break;case 4:o=(Math.floor(t/3)+Math.floor(r/2))%2==0;break;case 5:o=t*r%2+t*r%3==0;break;case 6:o=(t*r%2+t*r%3)%2==0;break;case 7:o=((t+r)%2+t*r%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[r][t]&&o&&(this.modules[r][t]=!this.modules[r][t])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let h=!1,c=0,m=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[n][d]==h?(c++,c==5?e+=p.PENALTY_N1:c>5&&e++):(this.finderPenaltyAddHistory(c,m),h||(e+=this.finderPenaltyCountPatterns(m)*p.PENALTY_N3),h=this.modules[n][d],c=1);e+=this.finderPenaltyTerminateAndCount(h,c,m)*p.PENALTY_N3}for(let n=0;n<this.size;n++){let h=!1,c=0,m=[0,0,0,0,0,0,0];for(let d=0;d<this.size;d++)this.modules[d][n]==h?(c++,c==5?e+=p.PENALTY_N1:c>5&&e++):(this.finderPenaltyAddHistory(c,m),h||(e+=this.finderPenaltyCountPatterns(m)*p.PENALTY_N3),h=this.modules[d][n],c=1);e+=this.finderPenaltyTerminateAndCount(h,c,m)*p.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let h=0;h<this.size-1;h++){const c=this.modules[n][h];c==this.modules[n][h+1]&&c==this.modules[n+1][h]&&c==this.modules[n+1][h+1]&&(e+=p.PENALTY_N2)}let r=0;for(const n of this.modules)r=n.reduce((h,c)=>h+(c?1:0),r);const t=this.size*this.size,o=Math.ceil(Math.abs(r*20-t*10)/t)-1;return f(0<=o&&o<=9),e+=o*p.PENALTY_N4,f(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{const e=Math.floor(this.version/7)+2,r=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2;let t=[6];for(let o=this.size-7;t.length<e;o-=r)t.splice(1,0,o);return t}}static getNumRawDataModules(e){if(e<p.MIN_VERSION||e>p.MAX_VERSION)throw new RangeError("Version number out of range");let r=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return f(208<=r&&r<=29648),r}static getNumDataCodewords(e,r){return Math.floor(p.getNumRawDataModules(e)/8)-p.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*p.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let r=[];for(let o=0;o<e-1;o++)r.push(0);r.push(1);let t=1;for(let o=0;o<e;o++){for(let n=0;n<r.length;n++)r[n]=p.reedSolomonMultiply(r[n],t),n+1<r.length&&(r[n]^=r[n+1]);t=p.reedSolomonMultiply(t,2)}return r}static reedSolomonComputeRemainder(e,r){let t=r.map(o=>0);for(const o of e){const n=o^t.shift();t.push(0),r.forEach((h,c)=>t[c]^=p.reedSolomonMultiply(h,n))}return t}static reedSolomonMultiply(e,r){if(e>>>8||r>>>8)throw new RangeError("Byte out of range");let t=0;for(let o=7;o>=0;o--)t=t<<1^(t>>>7)*285,t^=(r>>>o&1)*e;return f(t>>>8==0),t}finderPenaltyCountPatterns(e){const r=e[1];f(r<=this.size*3);const t=r>0&&e[2]==r&&e[3]==r*3&&e[4]==r&&e[5]==r;return(t&&e[0]>=r*4&&e[6]>=r?1:0)+(t&&e[6]>=r*4&&e[0]>=r?1:0)}finderPenaltyTerminateAndCount(e,r,t){return e&&(this.finderPenaltyAddHistory(r,t),r=0),r+=this.size,this.finderPenaltyAddHistory(r,t),this.finderPenaltyCountPatterns(t)}finderPenaltyAddHistory(e,r){r[0]==0&&(e+=this.size),r.pop(),r.unshift(e)}};a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],a.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],l.QrCode=a;function s(M,e,r){if(e<0||e>31||M>>>e)throw new RangeError("Value out of range");for(let t=e-1;t>=0;t--)r.push(M>>>t&1)}function i(M,e){return(M>>>e&1)!=0}function f(M){if(!M)throw new Error("Assertion error")}const u=class C{constructor(e,r,t){if(this.mode=e,this.numChars=r,this.bitData=t,r<0)throw new RangeError("Invalid argument");this.bitData=t.slice()}static makeBytes(e){let r=[];for(const t of e)s(t,8,r);return new C(C.Mode.BYTE,e.length,r)}static makeNumeric(e){if(!C.isNumeric(e))throw new RangeError("String contains non-numeric characters");let r=[];for(let t=0;t<e.length;){const o=Math.min(e.length-t,3);s(parseInt(e.substring(t,t+o),10),o*3+1,r),t+=o}return new C(C.Mode.NUMERIC,e.length,r)}static makeAlphanumeric(e){if(!C.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let r=[],t;for(t=0;t+2<=e.length;t+=2){let o=C.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t))*45;o+=C.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),s(o,11,r)}return t<e.length&&s(C.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,r),new C(C.Mode.ALPHANUMERIC,e.length,r)}static makeSegments(e){return e==""?[]:C.isNumeric(e)?[C.makeNumeric(e)]:C.isAlphanumeric(e)?[C.makeAlphanumeric(e)]:[C.makeBytes(C.toUtf8ByteArray(e))]}static makeEci(e){let r=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)s(e,8,r);else if(e<16384)s(2,2,r),s(e,14,r);else if(e<1e6)s(6,3,r),s(e,21,r);else throw new RangeError("ECI assignment value out of range");return new C(C.Mode.ECI,0,r)}static isNumeric(e){return C.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return C.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,r){let t=0;for(const o of e){const n=o.mode.numCharCountBits(r);if(o.numChars>=1<<n)return 1/0;t+=4+n+o.bitData.length}return t}static toUtf8ByteArray(e){e=encodeURI(e);let r=[];for(let t=0;t<e.length;t++)e.charAt(t)!="%"?r.push(e.charCodeAt(t)):(r.push(parseInt(e.substring(t+1,t+3),16)),t+=2);return r}};u.NUMERIC_REGEX=/^[0-9]*$/,u.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,u.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let w=u;l.QrSegment=u})(b||(b={}));(l=>{(a=>{const s=class{constructor(f,u){this.ordinal=f,this.formatBits=u}};s.LOW=new s(0,1),s.MEDIUM=new s(1,0),s.QUARTILE=new s(2,3),s.HIGH=new s(3,2),a.Ecc=s})(l.QrCode||(l.QrCode={}))})(b||(b={}));(l=>{(a=>{const s=class{constructor(f,u){this.modeBits=f,this.numBitsCharCount=u}numCharCountBits(f){return this.numBitsCharCount[Math.floor((f+7)/17)]}};s.NUMERIC=new s(1,[10,12,14]),s.ALPHANUMERIC=new s(2,[9,11,13]),s.BYTE=new s(4,[8,16,16]),s.KANJI=new s(8,[8,10,12]),s.ECI=new s(7,[0,0,0]),a.Mode=s})(l.QrSegment||(l.QrSegment={}))})(b||(b={}));var I=b;/**
166
+ * @license qrcode.react
167
+ * Copyright (c) Paul O'Shannessy
168
+ * SPDX-License-Identifier: ISC
169
+ */var fe={L:I.QrCode.Ecc.LOW,M:I.QrCode.Ecc.MEDIUM,Q:I.QrCode.Ecc.QUARTILE,H:I.QrCode.Ecc.HIGH},K=128,W="L",X="#FFFFFF",Z="#000000",J=!1,ee=1,ye=4,me=0,pe=.1;function te(l,a=0){const s=[];return l.forEach(function(i,f){let u=null;i.forEach(function(w,M){if(!w&&u!==null){s.push(`M${u+a} ${f+a}h${M-u}v1H${u+a}z`),u=null;return}if(M===i.length-1){if(!w)return;u===null?s.push(`M${M+a},${f+a} h1v1H${M+a}z`):s.push(`M${u+a},${f+a} h${M+1-u}v1H${u+a}z`);return}w&&u===null&&(u=M)})}),s.join("")}function re(l,a){return l.slice().map((s,i)=>i<a.y||i>=a.y+a.h?s:s.map((f,u)=>u<a.x||u>=a.x+a.w?f:!1))}function ge(l,a,s,i){if(i==null)return null;const f=l.length+s*2,u=Math.floor(a*pe),w=f/a,M=(i.width||u)*w,e=(i.height||u)*w,r=i.x==null?l.length/2-M/2:i.x*w,t=i.y==null?l.length/2-e/2:i.y*w,o=i.opacity==null?1:i.opacity;let n=null;if(i.excavate){let c=Math.floor(r),m=Math.floor(t),d=Math.ceil(M+r-c),A=Math.ceil(e+t-m);n={x:c,y:m,w:d,h:A}}const h=i.crossOrigin;return{x:r,y:t,h:e,w:M,excavation:n,opacity:o,crossOrigin:h}}function Me(l,a){return a!=null?Math.max(Math.floor(a),0):l?ye:me}function oe({value:l,level:a,minVersion:s,includeMargin:i,marginSize:f,imageSettings:u,size:w,boostLevel:M}){let e=k.useMemo(()=>{const c=(Array.isArray(l)?l:[l]).reduce((m,d)=>(m.push(...I.QrSegment.makeSegments(d)),m),[]);return I.QrCode.encodeSegments(c,fe[a],s,void 0,void 0,M)},[l,a,s,M]);const{cells:r,margin:t,numCells:o,calculatedImageSettings:n}=k.useMemo(()=>{let h=e.getModules();const c=Me(i,f),m=h.length+c*2,d=ge(h,w,c,u);return{cells:h,margin:c,numCells:m,calculatedImageSettings:d}},[e,w,u,i,f]);return{qrcode:e,margin:t,cells:r,numCells:o,calculatedImageSettings:n}}var Ce=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),we=k.forwardRef(function(a,s){const i=a,{value:f,size:u=K,level:w=W,bgColor:M=X,fgColor:e=Z,includeMargin:r=J,minVersion:t=ee,boostLevel:o,marginSize:n,imageSettings:h}=i,m=U(i,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:d}=m,A=U(m,["style"]),v=h==null?void 0:h.src,y=k.useRef(null),E=k.useRef(null),R=k.useCallback(S=>{y.current=S,typeof s=="function"?s(S):s&&(s.current=S)},[s]),[x,_]=k.useState(!1),{margin:L,cells:T,numCells:D,calculatedImageSettings:N}=oe({value:f,level:w,minVersion:t,boostLevel:o,includeMargin:r,marginSize:n,imageSettings:h,size:u});k.useEffect(()=>{if(y.current!=null){const S=y.current,P=S.getContext("2d");if(!P)return;let H=T;const z=E.current,V=N!=null&&z!==null&&z.complete&&z.naturalHeight!==0&&z.naturalWidth!==0;V&&N.excavation!=null&&(H=re(T,N.excavation));const $=window.devicePixelRatio||1;S.height=S.width=u*$;const j=u/D*$;P.scale(j,j),P.fillStyle=M,P.fillRect(0,0,D,D),P.fillStyle=e,Ce?P.fill(new Path2D(te(H,L))):T.forEach(function(ae,ie){ae.forEach(function(le,ce){le&&P.fillRect(ce+L,ie+L,1,1)})}),N&&(P.globalAlpha=N.opacity),V&&P.drawImage(z,N.x+L,N.y+L,N.w,N.h)}}),k.useEffect(()=>{_(!1)},[v]);const se=B({height:u,width:u},d);let Q=null;return v!=null&&(Q=k.createElement("img",{src:v,key:v,style:{display:"none"},onLoad:()=>{_(!0)},ref:E,crossOrigin:N==null?void 0:N.crossOrigin})),k.createElement(k.Fragment,null,k.createElement("canvas",B({style:se,height:u,width:u,ref:R,role:"img"},A)),Q)});we.displayName="QRCodeCanvas";var Ee=k.forwardRef(function(a,s){const i=a,{value:f,size:u=K,level:w=W,bgColor:M=X,fgColor:e=Z,includeMargin:r=J,minVersion:t=ee,boostLevel:o,title:n,marginSize:h,imageSettings:c}=i,m=U(i,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:d,cells:A,numCells:v,calculatedImageSettings:y}=oe({value:f,level:w,minVersion:t,boostLevel:o,includeMargin:r,marginSize:h,imageSettings:c,size:u});let E=A,R=null;c!=null&&y!=null&&(y.excavation!=null&&(E=re(A,y.excavation)),R=k.createElement("image",{href:c.src,height:y.h,width:y.w,x:y.x+d,y:y.y+d,preserveAspectRatio:"none",opacity:y.opacity,crossOrigin:y.crossOrigin}));const x=te(E,d);return k.createElement("svg",B({height:u,width:u,viewBox:`0 0 ${v} ${v}`,ref:s,role:"img"},m),!!n&&k.createElement("title",null,n),k.createElement("path",{fill:M,d:`M0,0 h${v}v${v}H0z`,shapeRendering:"crispEdges"}),k.createElement("path",{fill:e,d:x,shapeRendering:"crispEdges"}),R)});Ee.displayName="QRCodeSVG";function ne(l){var a,s,i="";if(typeof l=="string"||typeof l=="number")i+=l;else if(typeof l=="object")if(Array.isArray(l)){var f=l.length;for(a=0;a<f;a++)l[a]&&(s=ne(l[a]))&&(i&&(i+=" "),i+=s)}else for(s in l)l[s]&&(i&&(i+=" "),i+=s);return i}function tt(){for(var l,a,s=0,i="",f=arguments.length;s<f;s++)(l=arguments[s])&&(a=ne(l))&&(i&&(i+=" "),i+=a);return i}export{Ae as A,Se as B,Le as C,ze as E,xe as G,Oe as K,De as L,Be as N,Ue as P,we as Q,He as R,Ge as S,qe as T,We as U,Xe as W,Ze as X,Qe as a,Re as b,tt as c,Ne as d,Pe as e,ve as f,Ke as g,Ve as h,Ye as i,Ie as j,_e as k,Te as l,je as m,$e as n,be as o,Fe as p};
package/dist/index.html CHANGED
@@ -7,8 +7,12 @@
7
7
  <!-- Security: Mitigate side-channel and XSS attacks -->
8
8
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; connect-src 'self' ws: wss: http: https:;">
9
9
  <title>NCC Client PoC</title>
10
- <script type="module" crossorigin src="/assets/index-CcCz_74v.js"></script>
11
- <link rel="stylesheet" crossorigin href="/assets/index-B6UyNgvq.css">
10
+ <script type="module" crossorigin src="/assets/index-Y-2LEWsG.js"></script>
11
+ <link rel="modulepreload" crossorigin href="/assets/vendor-react-KfUPlHYY.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/vendor-nostr-tools-gLyVtdq-.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/vendor-ncc-DazmxxKG.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/vendor-utils-D1mPQilD.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/index-BPoJ2Z9w.css">
12
16
  </head>
13
17
  <body>
14
18
  <div id="root"></div>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ncc-client-poc",
3
3
  "description": "Proof of Concept client for Nostr Community Conventions (NCC). Implements decentralized infrastructure management and discovery without DNS.",
4
- "version": "0.1.2",
4
+ "version": "0.2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.html",
7
7
  "files": [
@@ -42,8 +42,8 @@
42
42
  "buffer": "^6.0.3",
43
43
  "clsx": "^2.1.0",
44
44
  "lucide-react": "^0.344.0",
45
- "ncc-02-js": "^0.3.1",
46
- "ncc-05-js": "^1.1.14",
45
+ "ncc-02-js": "^0.4.0",
46
+ "ncc-05-js": "^1.2.0",
47
47
  "nostr-tools": "^2.1.5",
48
48
  "qrcode.react": "^4.2.0",
49
49
  "react": "^18.2.0",