@formata/limitr-ui 0.1.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 @@
1
+ {"version":3,"file":"current.js","sourceRoot":"","sources":["../current.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,oDAAoD;AACpD,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;;;;;;;;;;AAEF,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACzD,OAAO,YAAY,CAAC;AAGpB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,aAAa;IAA7C;;QAEH,mBAAc,GAAY,KAAK,CAAC;QAGhC,cAAS,GAAY,KAAK,CAAC;QAG3B,eAAU,GAAY,KAAK,CAAC;QAG5B,sBAAiB,GAAY,KAAK,CAAC;QAGnC,UAAK,GAAqB,OAAO,CAAC;QAIlC,sBAAiB,GAAY,KAAK,CAAC;QAI3B,gBAAW,GAAQ,IAAI,CAAC;QAIxB,oBAAe,GAAQ,IAAI,CAAC;QAG5B,YAAO,GAAY,IAAI,CAAC;QAGxB,qBAAgB,GAAY,KAAK,CAAC;QAmgBhC,wBAAmB,GAAY,KAAK,CAAC;IA2fnD,CAAC;IA3/BG;;OAEG;IACH,MAAM,KAAc,MAAM;QACtB,OAAO,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAA;AA5hCG;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;yDACI;AAGhC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;oDACD;AAG3B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;qDACA;AAG5B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;4DACO;AAGnC;IADC,QAAQ,EAAE;;gDACuB;AAIlC;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC5B,wFAAwF;;;4DACrD;AAI3B;IAFP,KAAK,EAAE;IACR,kCAAkC;;;sDACF;AAIxB;IAFP,KAAK,EAAE;IACR,kCAAkC;;;0DACE;AAG5B;IADP,KAAK,EAAE;;kDACwB;AAGxB;IADP,KAAK,EAAE;;2DACkC;AAmgBhC;IADT,KAAK,EAAE;;8DACuC;AAniBtC,iBAAiB;IAD7B,aAAa,CAAC,qBAAqB,CAAC;GACxB,iBAAiB,CA8hC7B"}
@@ -0,0 +1,90 @@
1
+ import { LitElement, type PropertyValues } from "lit";
2
+ import type { Limitr } from '@formata/limitr';
3
+ /**
4
+ * Limitr LitElement base class.
5
+ */
6
+ export declare class LimitrElement extends LitElement {
7
+ policy: Limitr;
8
+ customerId: string;
9
+ stripePortalUrl: string;
10
+ requestStripePortalUrl: boolean;
11
+ requestStripeInvoices: boolean;
12
+ /** Unique ID for making sure this UI component is updated with events. */
13
+ protected policyHandlerId: string;
14
+ /** Track if we've requested portal URL */
15
+ private stripePortalRequested;
16
+ /** Track if we've requested invoices */
17
+ private invoicesRequested;
18
+ /**
19
+ * Updated.
20
+ */
21
+ updated(changedProperties: PropertyValues): Promise<void>;
22
+ /**
23
+ * Disconnected callback.
24
+ */
25
+ disconnectedCallback(): void;
26
+ /**
27
+ * Get limitr policy as a JS object record (Record<string, unknown> as any).
28
+ * This includes credits, plans, etc. defined in the policy,
29
+ * and is all of the policy information needed for Limitr UI components.
30
+ */
31
+ get record(): any;
32
+ /**
33
+ * Get policy record as a JS object record (Record<string, unknown> as any).
34
+ * This object contains two fields we actually care about: credits: Record<string, unknown> and plans: Record<string, unknown>.
35
+ */
36
+ get policyRecord(): any;
37
+ /**
38
+ * Get credits record as a JS object record (Record<string, unknown> as any).
39
+ * Inside this object are credits (credit name is field name, credit object as value).
40
+ * These credits will be referenced by our UI anytime usage needs to be displayed for this customer,
41
+ * or anytime credits/units are referenced within a plan entitlement limit.
42
+ * Each credit object has a unit (e.g., credit, token, seat, etc.), a description, a label (human facing string), and a stof_units field (e.g., 'float', 'int', 'GB', 'MiB', 'seconds', etc.).
43
+ */
44
+ get creditsRecord(): any;
45
+ /**
46
+ * Get plans record as a JS object record (Record<string, unknown> as any).
47
+ * Inside this object are all of the plans offered for this customer (plan name is the key, plan object is the value).
48
+ * Some plans may have a "hidden" boolean field, if this is present and true, the plan should not be displayed nor considered for selection by the customer.
49
+ * Each plan will have a label (human facing string),an optional price object (with an id, amount, prefix string, and suffix string),
50
+ * and an entitlements object. Inside the entitlement object, each key will be an entitlement name, and the value will be an entitlement object.
51
+ * Each entitlement object will have an enabled boolean field, a description string, an optional scope string, and an optional limit object.
52
+ * If a limit is defined on the entitlement, it will contain a credit id (string that references a credit by name), a mode string (hard, soft, or observe),
53
+ * a value (string or number representing the limit max value), an optional increment value (string or number for how much a meter for this entitlement should change per increment),
54
+ * a resets boolean field (does a meter for this limit reset periodically), and a reset_inc field (ms after a meter starts for it to reset).
55
+ */
56
+ get plansRecord(): any;
57
+ /**
58
+ * Get the current customer record directly as a JS object record (Record<string, unknown> as any).
59
+ * This represents the current customer & state of the customer we are currently working with within this policy.
60
+ * Each customer will have a string (primary) "id" field, a plan string field (referencing the current customer's plan by name ex plansRecord[customer.plan]),
61
+ * an alt_ids array with additional unique string IDs that can be used to reference this customer (might include this.customerId) within the Limitr policy,
62
+ * a refs array with additional string IDs of other linked customers in the Limitr policy (if a plan is missing on this.customer(), need to look through these refs for which plan to use),
63
+ * a type string field (what type of customer is this e.g., user, org, workspace, etc. - if an entitlement scope is set, it must correlate to this type per user),
64
+ * a label string field (human facing label for the customer, like a display name), a meters object with all current usage information for this customer,
65
+ * an overrides object with all current limit overrides if any (each key references an entitlement key/name, and value is a limit that overrides the entitlement limit object with an
66
+ * optional override_expires_on timestamp/ms since epoch to ignore override after), and finally, a metadata object. This metadata object is a catch all for subscription info, etc.
67
+ */
68
+ customer(id?: string): Promise<any>;
69
+ /**
70
+ * Get visible plans (excluding hidden ones)
71
+ */
72
+ get visiblePlans(): any[];
73
+ /**
74
+ * Get a specific plan by name
75
+ */
76
+ getPlan(planName: string): any;
77
+ /**
78
+ * Get a specific credit by name
79
+ */
80
+ getCredit(creditName: string): any;
81
+ /**
82
+ * Get customer's current plan object (resolves through refs if needed)
83
+ */
84
+ getCustomerPlan(): Promise<any>;
85
+ /**
86
+ * Get effective limit for an entitlement (considering overrides)
87
+ */
88
+ getEntitlementLimit(entitlementName: string): Promise<any>;
89
+ }
90
+ //# sourceMappingURL=element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["../element.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAI9C;;GAEG;AACH,qBAAa,aAAc,SAAQ,UAAU;IAEzC,MAAM,EAAG,MAAM,CAAC;IAGhB,UAAU,EAAE,MAAM,CAAM;IAGxB,eAAe,EAAE,MAAM,CAAM;IAG7B,sBAAsB,EAAE,OAAO,CAAS;IAGxC,qBAAqB,EAAE,OAAO,CAAS;IAEvC,0EAA0E;IAC1E,SAAS,CAAC,eAAe,EAAE,MAAM,CAAc;IAE/C,0CAA0C;IAC1C,OAAO,CAAC,qBAAqB,CAAkB;IAE/C,wCAAwC;IACxC,OAAO,CAAC,iBAAiB,CAAkB;IAG3C;;OAEG;IACY,OAAO,CAAC,iBAAiB,EAAE,cAAc;IA+DxD;;OAEG;IACM,oBAAoB,IAAI,IAAI;IAQrC;;;;OAIG;IAEH,IAAI,MAAM,IAAI,GAAG,CAEhB;IAGD;;;OAGG;IAEH,IAAI,YAAY,IAAI,GAAG,CAGtB;IAGD;;;;;;OAMG;IAEH,IAAI,aAAa,IAAI,GAAG,CAGvB;IAGD;;;;;;;;;;OAUG;IAEH,IAAI,WAAW,IAAI,GAAG,CAGrB;IAGD;;;;;;;;;;OAUG;IAEG,QAAQ,CAAC,EAAE,GAAE,MAAwB,GAAG,OAAO,CAAC,GAAG,CAAC;IAK1D;;OAEG;IAEH,IAAI,YAAY,IAAI,GAAG,EAAE,CAOxB;IAGD;;OAEG;IAEH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG;IAK9B;;OAEG;IAEH,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG;IAKlC;;OAEG;IAEG,eAAe,IAAI,OAAO,CAAC,GAAG,CAAC;IA+BrC;;OAEG;IAEG,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;CA4BnE"}
@@ -0,0 +1,282 @@
1
+ //
2
+ // Copyright 2026 Formata, Inc. All rights reserved.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
17
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
18
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
19
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
20
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
21
+ };
22
+ var __metadata = (this && this.__metadata) || function (k, v) {
23
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
24
+ };
25
+ import { LitElement } from "lit";
26
+ import { property } from "lit/decorators.js";
27
+ import { nanoid } from 'nanoid';
28
+ /**
29
+ * Limitr LitElement base class.
30
+ */
31
+ export class LimitrElement extends LitElement {
32
+ constructor() {
33
+ super(...arguments);
34
+ this.customerId = '';
35
+ this.stripePortalUrl = '';
36
+ this.requestStripePortalUrl = false;
37
+ this.requestStripeInvoices = false;
38
+ /** Unique ID for making sure this UI component is updated with events. */
39
+ this.policyHandlerId = nanoid(14);
40
+ /** Track if we've requested portal URL */
41
+ this.stripePortalRequested = false;
42
+ /** Track if we've requested invoices */
43
+ this.invoicesRequested = false;
44
+ }
45
+ /**
46
+ * Updated.
47
+ */
48
+ async updated(changedProperties) {
49
+ super.updated(changedProperties);
50
+ if (changedProperties.has('policy')) {
51
+ const oldPolicy = changedProperties.get('policy');
52
+ if (oldPolicy)
53
+ oldPolicy.removeHandler(this.policyHandlerId);
54
+ if (this.policy) {
55
+ this.policy.addHandler(this.policyHandlerId, (key, _value) => {
56
+ if (key.includes('internal'))
57
+ this.requestUpdate();
58
+ });
59
+ }
60
+ }
61
+ // Request Stripe portal URL once when policy and customerId are available
62
+ if (this.policy && this.customerId && this.requestStripePortalUrl && !this.stripePortalRequested && !this.stripePortalUrl) {
63
+ // Make sure customer is loaded first
64
+ const customer = await this.customer();
65
+ if (customer && customer.id) {
66
+ this.stripePortalRequested = true;
67
+ // Set up one-time listener for the portal URL
68
+ const portalUrlPromise = new Promise((resolve) => {
69
+ const listenerId = 'portal-url-' + Math.random();
70
+ const timeoutId = setTimeout(() => {
71
+ this.policy.removeHandler(listenerId);
72
+ resolve(''); // timeout, return empty
73
+ }, 5000);
74
+ this.policy.addHandler(listenerId, (key, json) => {
75
+ if (key.includes('internal-customer-updated')) {
76
+ const jsonCustomer = JSON.parse(json);
77
+ if (jsonCustomer.id === this.customerId && jsonCustomer.metadata && !!jsonCustomer.metadata.stripe_customer_portal_session_url) {
78
+ clearTimeout(timeoutId);
79
+ this.policy.removeHandler(listenerId);
80
+ resolve(jsonCustomer.metadata.stripe_customer_portal_session_url);
81
+ }
82
+ }
83
+ });
84
+ });
85
+ // Send request
86
+ await this.policy.wsSend(JSON.stringify({
87
+ type: 'customer-stripe-portal',
88
+ id: this.customerId,
89
+ return_url: globalThis.location.href,
90
+ }));
91
+ // Wait for response
92
+ this.stripePortalUrl = await portalUrlPromise;
93
+ }
94
+ }
95
+ // Request invoices once when policy and customerId are available
96
+ if (this.policy && this.customerId && this.requestStripeInvoices && !this.invoicesRequested) {
97
+ this.invoicesRequested = true;
98
+ await this.policy.wsSend(JSON.stringify({
99
+ type: 'customer-invoices',
100
+ id: this.customerId
101
+ }));
102
+ }
103
+ }
104
+ /**
105
+ * Disconnected callback.
106
+ */
107
+ disconnectedCallback() {
108
+ super.disconnectedCallback();
109
+ if (this.policy) {
110
+ this.policy.removeHandler(this.policyHandlerId);
111
+ }
112
+ }
113
+ /**
114
+ * Get limitr policy as a JS object record (Record<string, unknown> as any).
115
+ * This includes credits, plans, etc. defined in the policy,
116
+ * and is all of the policy information needed for Limitr UI components.
117
+ */
118
+ //deno-lint-ignore no-explicit-any
119
+ get record() {
120
+ return this.policy ? this.policy.doc.record() : { policy: {} };
121
+ }
122
+ /**
123
+ * Get policy record as a JS object record (Record<string, unknown> as any).
124
+ * This object contains two fields we actually care about: credits: Record<string, unknown> and plans: Record<string, unknown>.
125
+ */
126
+ //deno-lint-ignore no-explicit-any
127
+ get policyRecord() {
128
+ const record = this.record;
129
+ return record.policy ? record.policy : {};
130
+ }
131
+ /**
132
+ * Get credits record as a JS object record (Record<string, unknown> as any).
133
+ * Inside this object are credits (credit name is field name, credit object as value).
134
+ * These credits will be referenced by our UI anytime usage needs to be displayed for this customer,
135
+ * or anytime credits/units are referenced within a plan entitlement limit.
136
+ * Each credit object has a unit (e.g., credit, token, seat, etc.), a description, a label (human facing string), and a stof_units field (e.g., 'float', 'int', 'GB', 'MiB', 'seconds', etc.).
137
+ */
138
+ //deno-lint-ignore no-explicit-any
139
+ get creditsRecord() {
140
+ const policy = this.policyRecord;
141
+ return policy.credits ? policy.credits : {};
142
+ }
143
+ /**
144
+ * Get plans record as a JS object record (Record<string, unknown> as any).
145
+ * Inside this object are all of the plans offered for this customer (plan name is the key, plan object is the value).
146
+ * Some plans may have a "hidden" boolean field, if this is present and true, the plan should not be displayed nor considered for selection by the customer.
147
+ * Each plan will have a label (human facing string),an optional price object (with an id, amount, prefix string, and suffix string),
148
+ * and an entitlements object. Inside the entitlement object, each key will be an entitlement name, and the value will be an entitlement object.
149
+ * Each entitlement object will have an enabled boolean field, a description string, an optional scope string, and an optional limit object.
150
+ * If a limit is defined on the entitlement, it will contain a credit id (string that references a credit by name), a mode string (hard, soft, or observe),
151
+ * a value (string or number representing the limit max value), an optional increment value (string or number for how much a meter for this entitlement should change per increment),
152
+ * a resets boolean field (does a meter for this limit reset periodically), and a reset_inc field (ms after a meter starts for it to reset).
153
+ */
154
+ //deno-lint-ignore no-explicit-any
155
+ get plansRecord() {
156
+ const policy = this.policyRecord;
157
+ return policy.plans ? policy.plans : {};
158
+ }
159
+ /**
160
+ * Get the current customer record directly as a JS object record (Record<string, unknown> as any).
161
+ * This represents the current customer & state of the customer we are currently working with within this policy.
162
+ * Each customer will have a string (primary) "id" field, a plan string field (referencing the current customer's plan by name ex plansRecord[customer.plan]),
163
+ * an alt_ids array with additional unique string IDs that can be used to reference this customer (might include this.customerId) within the Limitr policy,
164
+ * a refs array with additional string IDs of other linked customers in the Limitr policy (if a plan is missing on this.customer(), need to look through these refs for which plan to use),
165
+ * a type string field (what type of customer is this e.g., user, org, workspace, etc. - if an entitlement scope is set, it must correlate to this type per user),
166
+ * a label string field (human facing label for the customer, like a display name), a meters object with all current usage information for this customer,
167
+ * an overrides object with all current limit overrides if any (each key references an entitlement key/name, and value is a limit that overrides the entitlement limit object with an
168
+ * optional override_expires_on timestamp/ms since epoch to ignore override after), and finally, a metadata object. This metadata object is a catch all for subscription info, etc.
169
+ */
170
+ //deno-lint-ignore no-explicit-any
171
+ async customer(id = this.customerId) {
172
+ return this.policy && id ? await this.policy.customer(id) ?? {} : {};
173
+ }
174
+ /**
175
+ * Get visible plans (excluding hidden ones)
176
+ */
177
+ // deno-lint-ignore no-explicit-any
178
+ get visiblePlans() {
179
+ const plans = this.plansRecord;
180
+ return Object.entries(plans)
181
+ //deno-lint-ignore no-explicit-any
182
+ .filter(([_, plan]) => !plan.hidden)
183
+ //deno-lint-ignore no-explicit-any
184
+ .map(([name, plan]) => ({ name, ...plan }));
185
+ }
186
+ /**
187
+ * Get a specific plan by name
188
+ */
189
+ // deno-lint-ignore no-explicit-any
190
+ getPlan(planName) {
191
+ return this.plansRecord[planName] || null;
192
+ }
193
+ /**
194
+ * Get a specific credit by name
195
+ */
196
+ // deno-lint-ignore no-explicit-any
197
+ getCredit(creditName) {
198
+ return this.creditsRecord[creditName] || null;
199
+ }
200
+ /**
201
+ * Get customer's current plan object (resolves through refs if needed)
202
+ */
203
+ // deno-lint-ignore no-explicit-any
204
+ async getCustomerPlan() {
205
+ const customer = await this.customer();
206
+ if (!customer.id)
207
+ return null;
208
+ // Check if customer has a direct plan
209
+ if (customer.plan) {
210
+ const plan = this.getPlan(customer.plan);
211
+ if (plan) {
212
+ plan.name = customer.plan;
213
+ return plan;
214
+ }
215
+ }
216
+ // Check refs for a plan
217
+ if (customer.refs && customer.refs.length > 0) {
218
+ for (const refId of customer.refs) {
219
+ const refCustomer = await this.customer(refId);
220
+ if (refCustomer.plan) {
221
+ const plan = this.getPlan(refCustomer.plan);
222
+ if (plan) {
223
+ plan.name = refCustomer.plan;
224
+ return plan;
225
+ }
226
+ }
227
+ }
228
+ }
229
+ return null;
230
+ }
231
+ /**
232
+ * Get effective limit for an entitlement (considering overrides)
233
+ */
234
+ // deno-lint-ignore no-explicit-any
235
+ async getEntitlementLimit(entitlementName) {
236
+ const customer = await this.customer();
237
+ // Check for override first
238
+ if (customer.overrides && customer.overrides[entitlementName]) {
239
+ const override = customer.overrides[entitlementName];
240
+ // Check if override has expired
241
+ if (override.override_expires_on) {
242
+ const now = Date.now();
243
+ if (now > override.override_expires_on) {
244
+ // Override expired, fall through to plan limit
245
+ }
246
+ else {
247
+ return override;
248
+ }
249
+ }
250
+ else {
251
+ return override;
252
+ }
253
+ }
254
+ // Get plan entitlement limit
255
+ const plan = await this.getCustomerPlan();
256
+ if (plan && plan.entitlements && plan.entitlements[entitlementName]) {
257
+ return plan.entitlements[entitlementName].limit || null;
258
+ }
259
+ return null;
260
+ }
261
+ }
262
+ __decorate([
263
+ property({ type: Object }),
264
+ __metadata("design:type", Function)
265
+ ], LimitrElement.prototype, "policy", void 0);
266
+ __decorate([
267
+ property(),
268
+ __metadata("design:type", String)
269
+ ], LimitrElement.prototype, "customerId", void 0);
270
+ __decorate([
271
+ property(),
272
+ __metadata("design:type", String)
273
+ ], LimitrElement.prototype, "stripePortalUrl", void 0);
274
+ __decorate([
275
+ property({ type: Boolean }),
276
+ __metadata("design:type", Boolean)
277
+ ], LimitrElement.prototype, "requestStripePortalUrl", void 0);
278
+ __decorate([
279
+ property({ type: Boolean }),
280
+ __metadata("design:type", Boolean)
281
+ ], LimitrElement.prototype, "requestStripeInvoices", void 0);
282
+ //# sourceMappingURL=element.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element.js","sourceRoot":"","sources":["../element.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,oDAAoD;AACpD,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0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,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;;4DACW"}
package/dist/mod.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from "./element.js";
2
+ export * from "./current.js";
3
+ export * from "./table.js";
4
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../mod.ts"],"names":[],"mappings":"AAiBA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
package/dist/mod.js ADDED
@@ -0,0 +1,19 @@
1
+ //
2
+ // Copyright 2026 Formata, Inc. All rights reserved.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+ export * from "./element.js";
17
+ export * from "./current.js";
18
+ export * from "./table.js";
19
+ //# sourceMappingURL=mod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.js","sourceRoot":"","sources":["../mod.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,oDAAoD;AACpD,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,EAAE;AAGF,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { LimitrElement } from "./element.js";
2
+ import { type CSSResult } from "lit";
3
+ /**
4
+ * Pricing table for a Limitr policy, showing all visible plans for a user
5
+ * to choose from (allows them to pick/switch plans).
6
+ */
7
+ export declare class LimitrPricingTable extends LimitrElement {
8
+ interactive: boolean;
9
+ /** When true, emit plan select events only, without setting customer plan on policy. */
10
+ denyPolicyChanges: boolean;
11
+ theme: 'light' | 'dark';
12
+ private currentPlan;
13
+ private loading;
14
+ private showCouponModal;
15
+ private selectedPlanForCoupon;
16
+ private couponCode;
17
+ private couponError;
18
+ /**
19
+ * Styles.
20
+ */
21
+ static get styles(): CSSResult;
22
+ connectedCallback(): Promise<void>;
23
+ updated(changedProperties: Map<string | number | symbol, unknown>): Promise<void>;
24
+ private loadCurrentPlan;
25
+ private handlePlanSelect;
26
+ private completePlanSelection;
27
+ private handleCouponSubmit;
28
+ private handleCouponSkip;
29
+ private handleCouponCancel;
30
+ private formatPrice;
31
+ /**
32
+ * Pluralize a unit name if needed based on the value.
33
+ */
34
+ private pluralizeUnit;
35
+ private formatLimitValue;
36
+ private renderPlanCard;
37
+ /**
38
+ * Render.
39
+ */
40
+ render(): unknown;
41
+ }
42
+ //# sourceMappingURL=table.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../table.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAO,KAAK,SAAS,EAAQ,MAAM,KAAK,CAAC;AAGhD;;;GAGG;AACH,qBACa,kBAAmB,SAAQ,aAAa;IAEjD,WAAW,EAAE,OAAO,CAAQ;IAG5B,wFAAwF;IACxF,iBAAiB,EAAE,OAAO,CAAS;IAGnC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAW;IAIlC,OAAO,CAAC,WAAW,CAAa;IAGhC,OAAO,CAAC,OAAO,CAAiB;IAGhC,OAAO,CAAC,eAAe,CAAkB;IAGzC,OAAO,CAAC,qBAAqB,CAAc;IAG3C,OAAO,CAAC,UAAU,CAAc;IAGhC,OAAO,CAAC,WAAW,CAAc;IAGjC;;OAEG;IACH,WAAoB,MAAM,IAAI,SAAS,CAqVtC;IAGc,iBAAiB;IAMjB,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC;YASlE,eAAe;YAaf,gBAAgB;YAsBhB,qBAAqB;YA4CrB,kBAAkB;IA0BhC,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,kBAAkB;IAU1B,OAAO,CAAC,WAAW;IAenB;;OAEG;IACH,OAAO,CAAC,aAAa;IA2CrB,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,cAAc;IAyDtB;;OAEG;IACM,MAAM,IAAI,OAAO;CAwE7B"}