@huddle-marketplace/skills 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.
Files changed (86) hide show
  1. package/README.md +256 -0
  2. package/dist/adapters/openclaw.d.ts +42 -0
  3. package/dist/adapters/openclaw.d.ts.map +1 -0
  4. package/dist/adapters/openclaw.js +94 -0
  5. package/dist/adapters/openclaw.js.map +1 -0
  6. package/dist/base.d.ts +26 -0
  7. package/dist/base.d.ts.map +1 -0
  8. package/dist/base.js +97 -0
  9. package/dist/base.js.map +1 -0
  10. package/dist/compose.d.ts +87 -0
  11. package/dist/compose.d.ts.map +1 -0
  12. package/dist/compose.js +119 -0
  13. package/dist/compose.js.map +1 -0
  14. package/dist/index.d.ts +104 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +167 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/jurisdictions/ca-bc/index.d.ts +49 -0
  19. package/dist/jurisdictions/ca-bc/index.d.ts.map +1 -0
  20. package/dist/jurisdictions/ca-bc/index.js +212 -0
  21. package/dist/jurisdictions/ca-bc/index.js.map +1 -0
  22. package/dist/jurisdictions/ca-ns/index.d.ts +27 -0
  23. package/dist/jurisdictions/ca-ns/index.d.ts.map +1 -0
  24. package/dist/jurisdictions/ca-ns/index.js +127 -0
  25. package/dist/jurisdictions/ca-ns/index.js.map +1 -0
  26. package/dist/jurisdictions/ca-on/index.d.ts +26 -0
  27. package/dist/jurisdictions/ca-on/index.d.ts.map +1 -0
  28. package/dist/jurisdictions/ca-on/index.js +109 -0
  29. package/dist/jurisdictions/ca-on/index.js.map +1 -0
  30. package/dist/jurisdictions/ca-qc/index.d.ts +75 -0
  31. package/dist/jurisdictions/ca-qc/index.d.ts.map +1 -0
  32. package/dist/jurisdictions/ca-qc/index.js +232 -0
  33. package/dist/jurisdictions/ca-qc/index.js.map +1 -0
  34. package/dist/jurisdictions/canadian-template.d.ts +49 -0
  35. package/dist/jurisdictions/canadian-template.d.ts.map +1 -0
  36. package/dist/jurisdictions/canadian-template.js +228 -0
  37. package/dist/jurisdictions/canadian-template.js.map +1 -0
  38. package/dist/jurisdictions/lifecycle/active-tenancy.d.ts +55 -0
  39. package/dist/jurisdictions/lifecycle/active-tenancy.d.ts.map +1 -0
  40. package/dist/jurisdictions/lifecycle/active-tenancy.js +227 -0
  41. package/dist/jurisdictions/lifecycle/active-tenancy.js.map +1 -0
  42. package/dist/jurisdictions/lifecycle/homeownership-readiness.d.ts +60 -0
  43. package/dist/jurisdictions/lifecycle/homeownership-readiness.d.ts.map +1 -0
  44. package/dist/jurisdictions/lifecycle/homeownership-readiness.js +401 -0
  45. package/dist/jurisdictions/lifecycle/homeownership-readiness.js.map +1 -0
  46. package/dist/jurisdictions/us-ca/index.d.ts +65 -0
  47. package/dist/jurisdictions/us-ca/index.d.ts.map +1 -0
  48. package/dist/jurisdictions/us-ca/index.js +265 -0
  49. package/dist/jurisdictions/us-ca/index.js.map +1 -0
  50. package/dist/jurisdictions/us-cftc/index.d.ts +48 -0
  51. package/dist/jurisdictions/us-cftc/index.d.ts.map +1 -0
  52. package/dist/jurisdictions/us-cftc/index.js +192 -0
  53. package/dist/jurisdictions/us-cftc/index.js.map +1 -0
  54. package/dist/jurisdictions/us-fl/index.d.ts +43 -0
  55. package/dist/jurisdictions/us-fl/index.d.ts.map +1 -0
  56. package/dist/jurisdictions/us-fl/index.js +129 -0
  57. package/dist/jurisdictions/us-fl/index.js.map +1 -0
  58. package/dist/jurisdictions/us-ny/index.d.ts +77 -0
  59. package/dist/jurisdictions/us-ny/index.d.ts.map +1 -0
  60. package/dist/jurisdictions/us-ny/index.js +344 -0
  61. package/dist/jurisdictions/us-ny/index.js.map +1 -0
  62. package/dist/jurisdictions/us-state-factory.d.ts +79 -0
  63. package/dist/jurisdictions/us-state-factory.d.ts.map +1 -0
  64. package/dist/jurisdictions/us-state-factory.js +425 -0
  65. package/dist/jurisdictions/us-state-factory.js.map +1 -0
  66. package/dist/jurisdictions/us-tx/index.d.ts +43 -0
  67. package/dist/jurisdictions/us-tx/index.d.ts.map +1 -0
  68. package/dist/jurisdictions/us-tx/index.js +160 -0
  69. package/dist/jurisdictions/us-tx/index.js.map +1 -0
  70. package/dist/mcp/index.d.ts +49 -0
  71. package/dist/mcp/index.d.ts.map +1 -0
  72. package/dist/mcp/index.js +211 -0
  73. package/dist/mcp/index.js.map +1 -0
  74. package/dist/registry/index.d.ts +27 -0
  75. package/dist/registry/index.d.ts.map +1 -0
  76. package/dist/registry/index.js +47 -0
  77. package/dist/registry/index.js.map +1 -0
  78. package/dist/traiga/index.d.ts +24 -0
  79. package/dist/traiga/index.d.ts.map +1 -0
  80. package/dist/traiga/index.js +67 -0
  81. package/dist/traiga/index.js.map +1 -0
  82. package/dist/types/index.d.ts +814 -0
  83. package/dist/types/index.d.ts.map +1 -0
  84. package/dist/types/index.js +150 -0
  85. package/dist/types/index.js.map +1 -0
  86. package/package.json +77 -0
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Active Tenancy Compliance Skill
3
+ *
4
+ * Validates rent payments, late fees, and rent increases against
5
+ * jurisdiction-specific rules. Works alongside deposit skills to provide
6
+ * continuous compliance during the tenancy lifecycle.
7
+ *
8
+ * Capabilities:
9
+ * - Late fee validation (caps, grace periods, compounding rules)
10
+ * - Rent payment receipt requirements
11
+ * - Payment timeliness tracking
12
+ */
13
+ import { BaseSkill } from "../../base.js";
14
+ const LATE_FEE_RULES = {
15
+ "US-NY": { maxPercent: 5, maxFlatCents: 5000, useMinimum: true, gracePeriodDays: 5, compoundingAllowed: false, statute: "NY RPL", section: "§ 238-a" },
16
+ "US-CA": { maxPercent: 6, maxFlatCents: 0, useMinimum: false, gracePeriodDays: 0, compoundingAllowed: false, statute: "CA Okelberry v. West", section: "Case Law" },
17
+ "US-TX": { maxPercent: 12, maxFlatCents: 0, useMinimum: false, gracePeriodDays: 2, compoundingAllowed: false, statute: "TX Property Code", section: "§ 92.019" },
18
+ "US-FL": { maxPercent: 5, maxFlatCents: 0, useMinimum: false, gracePeriodDays: 0, compoundingAllowed: false, statute: "FL Stat", section: "§ 83.808" },
19
+ "US-MA": { maxPercent: 0, maxFlatCents: 0, useMinimum: false, gracePeriodDays: 30, compoundingAllowed: false, statute: "MA Gen Laws", section: "Ch. 186 § 15B" },
20
+ "US-IL": { maxPercent: 5, maxFlatCents: 0, useMinimum: false, gracePeriodDays: 5, compoundingAllowed: false, statute: "IL Compiled Statutes", section: "765 ILCS 705" },
21
+ "CA-ON": { maxPercent: 0, maxFlatCents: 0, useMinimum: false, gracePeriodDays: 0, compoundingAllowed: false, statute: "ON RTA", section: "s. 134" },
22
+ "CA-BC": { maxPercent: 0, maxFlatCents: 0, useMinimum: false, gracePeriodDays: 0, compoundingAllowed: false, statute: "BC RTA", section: "s. 27" },
23
+ "CA-QC": { maxPercent: 0, maxFlatCents: 0, useMinimum: false, gracePeriodDays: 0, compoundingAllowed: false, statute: "QC CCQ", section: "Art. 1883" },
24
+ };
25
+ // Default for unlisted jurisdictions
26
+ const DEFAULT_LATE_FEE_RULES = {
27
+ maxPercent: 10,
28
+ maxFlatCents: 0,
29
+ useMinimum: false,
30
+ gracePeriodDays: 0,
31
+ compoundingAllowed: false,
32
+ statute: "Varies by jurisdiction",
33
+ section: "Check local law",
34
+ };
35
+ export class ActiveTenancySkill extends BaseSkill {
36
+ id = "huddle-active-tenancy";
37
+ name = "Active Tenancy Compliance";
38
+ jurisdiction = "US-CFTC"; // Universal
39
+ version = "1.0.0";
40
+ capabilities = [
41
+ "payment-compliance",
42
+ "late-fee-validation",
43
+ ];
44
+ targetJurisdiction;
45
+ constructor(jurisdiction) {
46
+ super();
47
+ this.targetJurisdiction = jurisdiction ?? "US-TX";
48
+ }
49
+ /**
50
+ * Create a jurisdiction-specific active tenancy skill
51
+ */
52
+ static forJurisdiction(jurisdiction) {
53
+ return new ActiveTenancySkill(jurisdiction);
54
+ }
55
+ async validate(input) {
56
+ if (input.type !== "payment-compliance") {
57
+ return this.buildResult([{
58
+ name: "input-type",
59
+ passed: false,
60
+ confidence: 1.0,
61
+ note: `Active tenancy skill supports payment-compliance, received: ${input.type}`,
62
+ }], input);
63
+ }
64
+ const payment = input;
65
+ const checks = [
66
+ this.checkLateFee(payment),
67
+ this.checkGracePeriod(payment),
68
+ this.checkPaymentTimeliness(payment),
69
+ ];
70
+ return this.buildResult(checks, input);
71
+ }
72
+ /**
73
+ * Validate late fee against jurisdiction-specific caps
74
+ */
75
+ checkLateFee(input) {
76
+ const rules = LATE_FEE_RULES[this.targetJurisdiction] ?? DEFAULT_LATE_FEE_RULES;
77
+ const lateFee = input.lateFeeAmountCents ?? 0;
78
+ const monthlyRent = input.monthlyRentCents;
79
+ // Canadian provinces generally prohibit late fees entirely
80
+ if (rules.maxPercent === 0 && rules.maxFlatCents === 0) {
81
+ const isProhibited = lateFee > 0;
82
+ return {
83
+ name: "late-fee-cap",
84
+ passed: !isProhibited,
85
+ confidence: 1.0,
86
+ note: isProhibited
87
+ ? `Late fees are PROHIBITED in ${this.targetJurisdiction} per ${rules.statute} ${rules.section}`
88
+ : `No late fee charged. ${this.targetJurisdiction} prohibits late fees.`,
89
+ citation: {
90
+ statute: rules.statute,
91
+ section: rules.section,
92
+ summary: "Late fees/charges are prohibited for residential tenancies",
93
+ },
94
+ };
95
+ }
96
+ const percentCap = Math.floor(monthlyRent * (rules.maxPercent / 100));
97
+ let maxAllowed;
98
+ if (rules.maxFlatCents > 0 && rules.useMinimum) {
99
+ maxAllowed = Math.min(percentCap, rules.maxFlatCents);
100
+ }
101
+ else if (rules.maxFlatCents > 0) {
102
+ maxAllowed = Math.max(percentCap, rules.maxFlatCents);
103
+ }
104
+ else {
105
+ maxAllowed = percentCap;
106
+ }
107
+ const withinCap = lateFee <= maxAllowed;
108
+ return {
109
+ name: "late-fee-cap",
110
+ passed: withinCap,
111
+ confidence: 0.9,
112
+ note: withinCap
113
+ ? `Late fee ($${(lateFee / 100).toFixed(2)}) within ${this.targetJurisdiction} cap ($${(maxAllowed / 100).toFixed(2)})`
114
+ : `Late fee ($${(lateFee / 100).toFixed(2)}) exceeds ${this.targetJurisdiction} cap of $${(maxAllowed / 100).toFixed(2)} (${rules.maxPercent}% of rent)`,
115
+ citation: {
116
+ statute: rules.statute,
117
+ section: rules.section,
118
+ summary: `Late fee cap: ${rules.maxPercent}% of rent${rules.maxFlatCents > 0 ? ` or $${(rules.maxFlatCents / 100).toFixed(2)}` : ""}${rules.useMinimum ? " (whichever is less)" : ""}`,
119
+ },
120
+ details: {
121
+ lateFeeCents: lateFee,
122
+ maxAllowedCents: maxAllowed,
123
+ jurisdiction: this.targetJurisdiction,
124
+ rules,
125
+ },
126
+ };
127
+ }
128
+ /**
129
+ * Validate grace period compliance
130
+ */
131
+ checkGracePeriod(input) {
132
+ const rules = LATE_FEE_RULES[this.targetJurisdiction] ?? DEFAULT_LATE_FEE_RULES;
133
+ const gracePeriod = input.gracePeriodDays ?? 0;
134
+ const required = rules.gracePeriodDays;
135
+ if (required === 0) {
136
+ return {
137
+ name: "grace-period",
138
+ passed: true,
139
+ confidence: 0.8,
140
+ note: `${this.targetJurisdiction} has no statutory grace period requirement. Current: ${gracePeriod} days.`,
141
+ citation: { statute: rules.statute, section: rules.section, summary: "No statutory grace period" },
142
+ };
143
+ }
144
+ const met = gracePeriod >= required;
145
+ return {
146
+ name: "grace-period",
147
+ passed: met,
148
+ confidence: 1.0,
149
+ note: met
150
+ ? `${gracePeriod}-day grace period meets ${this.targetJurisdiction} ${required}-day requirement`
151
+ : `${gracePeriod}-day grace period is below ${this.targetJurisdiction} ${required}-day requirement`,
152
+ citation: {
153
+ statute: rules.statute,
154
+ section: rules.section,
155
+ summary: `Minimum ${required}-day grace period before late fees`,
156
+ },
157
+ };
158
+ }
159
+ /**
160
+ * Track payment timeliness
161
+ */
162
+ checkPaymentTimeliness(input) {
163
+ const dueDate = new Date(input.dueDate);
164
+ const paymentDate = new Date(input.paymentDate);
165
+ const daysLate = Math.max(0, Math.floor((paymentDate.getTime() - dueDate.getTime()) / 86400000));
166
+ return {
167
+ name: "payment-timeliness",
168
+ passed: daysLate === 0,
169
+ confidence: 1.0,
170
+ note: daysLate === 0
171
+ ? "Payment received on or before due date. On-time streak maintained."
172
+ : `Payment is ${daysLate} day(s) late. This may affect credit score and homeownership readiness.`,
173
+ details: {
174
+ dueDate: input.dueDate,
175
+ paymentDate: input.paymentDate,
176
+ daysLate,
177
+ },
178
+ };
179
+ }
180
+ checkToRemediation(check) {
181
+ switch (check.name) {
182
+ case "late-fee-cap":
183
+ return {
184
+ action: "reduce_late_fee",
185
+ description: `Reduce late fee to within ${this.targetJurisdiction} statutory cap`,
186
+ urgency: "required",
187
+ automatable: true,
188
+ };
189
+ case "grace-period":
190
+ return {
191
+ action: "extend_grace_period",
192
+ description: "Extend grace period to meet jurisdictional minimum",
193
+ urgency: "required",
194
+ automatable: true,
195
+ };
196
+ case "payment-timeliness":
197
+ return {
198
+ action: "setup_auto_pay",
199
+ description: "Set up automatic rent payments to maintain on-time payment streak and protect credit score",
200
+ urgency: "recommended",
201
+ automatable: true,
202
+ };
203
+ default:
204
+ return super.checkToRemediation(check);
205
+ }
206
+ }
207
+ getMetadata() {
208
+ return {
209
+ ...super.getMetadata(),
210
+ description: `Active tenancy compliance: late fee validation, grace period enforcement, payment timeliness tracking. Jurisdiction-aware rules for ${Object.keys(LATE_FEE_RULES).length}+ jurisdictions.`,
211
+ tags: ["payment", "late-fee", "grace-period", "tenancy", "compliance"],
212
+ };
213
+ }
214
+ }
215
+ export const activeTenancySkill = new ActiveTenancySkill();
216
+ /** Pre-built jurisdiction-specific instances */
217
+ export const activeTenancySkills = {
218
+ "US-NY": ActiveTenancySkill.forJurisdiction("US-NY"),
219
+ "US-CA": ActiveTenancySkill.forJurisdiction("US-CA"),
220
+ "US-TX": ActiveTenancySkill.forJurisdiction("US-TX"),
221
+ "US-FL": ActiveTenancySkill.forJurisdiction("US-FL"),
222
+ "US-MA": ActiveTenancySkill.forJurisdiction("US-MA"),
223
+ "CA-ON": ActiveTenancySkill.forJurisdiction("CA-ON"),
224
+ "CA-BC": ActiveTenancySkill.forJurisdiction("CA-BC"),
225
+ "CA-QC": ActiveTenancySkill.forJurisdiction("CA-QC"),
226
+ };
227
+ //# sourceMappingURL=active-tenancy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"active-tenancy.js","sourceRoot":"","sources":["../../../src/jurisdictions/lifecycle/active-tenancy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAuB1C,MAAM,cAAc,GAAiC;IACnD,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE;IACtJ,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,UAAU,EAAE;IACnK,OAAO,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,UAAU,EAAE;IAChK,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE;IACtJ,OAAO,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE,YAAY,EAAE,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C;AAE3D,gDAAgD;AAChD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;IACpD,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;IACpD,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;IACpD,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;IACpD,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;IACpD,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;IACpD,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;IACpD,OAAO,EAAE,kBAAkB,CAAC,eAAe,CAAC,OAAO,CAAC;CACrD,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Homeownership Readiness Skill
3
+ *
4
+ * The core differentiator: assesses a renter's readiness to become a homeowner.
5
+ * Not jurisdiction-specific — applies universally with jurisdiction-aware program matching.
6
+ *
7
+ * Capabilities:
8
+ * - Down payment progress tracking with timeline projection
9
+ * - Mortgage readiness assessment (DTI, credit, employment)
10
+ * - First-time buyer program matching (FHA, VA, USDA, state programs)
11
+ * - Closing cost estimation
12
+ * - Actionable roadmap to homeownership
13
+ */
14
+ import { BaseSkill } from "../../base.js";
15
+ import type { SkillInput, SkillResult, SkillCheck, SkillCapability, RemediationStep, SkillMetadata } from "../../types/index.js";
16
+ export declare class HomeownershipReadinessSkill extends BaseSkill {
17
+ readonly id = "huddle-homeownership-readiness";
18
+ readonly name = "Homeownership Readiness Assessment";
19
+ readonly jurisdiction: "US-CFTC";
20
+ readonly version = "1.0.0";
21
+ readonly capabilities: SkillCapability[];
22
+ validate(input: SkillInput): Promise<SkillResult>;
23
+ /**
24
+ * Debt-to-Income Ratio Assessment
25
+ * Front-end DTI (housing only): ideally < 28%
26
+ * Back-end DTI (all debt): ideally < 36%, max 43% for most loans, 50% for FHA
27
+ */
28
+ private checkDTIRatio;
29
+ /**
30
+ * Credit Score Assessment
31
+ * 740+: Excellent (best rates)
32
+ * 700-739: Good
33
+ * 660-699: Fair (conventional possible)
34
+ * 620-659: FHA eligible
35
+ * 580-619: FHA with 3.5% down
36
+ * 500-579: FHA with 10% down
37
+ * <500: Not mortgage-eligible
38
+ */
39
+ private checkCreditScore;
40
+ /**
41
+ * Down Payment Progress
42
+ * Tracks savings vs target and projects completion date
43
+ */
44
+ private checkDownPaymentProgress;
45
+ /**
46
+ * Employment Stability
47
+ * Most lenders require 2 years of stable employment
48
+ */
49
+ private checkEmploymentStability;
50
+ /**
51
+ * First-Time Buyer Program Matching
52
+ * Evaluates eligibility for FHA, VA, USDA, and conventional programs
53
+ */
54
+ private checkProgramEligibility;
55
+ private matchPrograms;
56
+ protected checkToRemediation(check: SkillCheck): RemediationStep;
57
+ getMetadata(): SkillMetadata;
58
+ }
59
+ export declare const homeownershipReadinessSkill: HomeownershipReadinessSkill;
60
+ //# sourceMappingURL=homeownership-readiness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"homeownership-readiness.d.ts","sourceRoot":"","sources":["../../../src/jurisdictions/lifecycle/homeownership-readiness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,EACV,eAAe,EAEf,eAAe,EACf,aAAa,EACd,MAAM,sBAAsB,CAAC;AAa9B,qBAAa,2BAA4B,SAAQ,SAAS;IACxD,QAAQ,CAAC,EAAE,oCAAoC;IAC/C,QAAQ,CAAC,IAAI,wCAAwC;IACrD,QAAQ,CAAC,YAAY,EAAG,SAAS,CAAU;IAC3C,QAAQ,CAAC,OAAO,WAAW;IAC3B,QAAQ,CAAC,YAAY,EAAE,eAAe,EAAE,CAItC;IAEI,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC;IAsBvD;;;;OAIG;IACH,OAAO,CAAC,aAAa;IA8CrB;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;IAgExB;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAqDhC;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IA+BhC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAuB/B,OAAO,CAAC,aAAa;cAuFF,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe;IA0ChE,WAAW,IAAI,aAAa;CAOtC;AAED,eAAO,MAAM,2BAA2B,6BAAoC,CAAC"}