@superbright/indexeddb-orm 1.0.30 → 1.0.32

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 (53) hide show
  1. package/dist/adapters/zustand-store.cjs +1 -1
  2. package/dist/adapters/zustand-store.cjs.map +1 -1
  3. package/dist/adapters/zustand-store.d.ts +2 -6
  4. package/dist/adapters/zustand-store.mjs +212 -167
  5. package/dist/adapters/zustand-store.mjs.map +1 -1
  6. package/dist/base/enums.cjs +1 -1
  7. package/dist/base/enums.cjs.map +1 -1
  8. package/dist/base/enums.d.ts +4 -0
  9. package/dist/base/enums.mjs +2 -1
  10. package/dist/base/enums.mjs.map +1 -1
  11. package/dist/base/userinquiry.d.ts +23 -0
  12. package/dist/base/visitor.d.ts +17 -0
  13. package/dist/base/visitorfilter.d.ts +25 -0
  14. package/dist/base/visitorquestionnaire.d.ts +25 -0
  15. package/dist/base/visitorunitengagement.d.ts +24 -0
  16. package/dist/features/units/transformers.cjs.map +1 -1
  17. package/dist/features/units/transformers.d.ts +2 -0
  18. package/dist/features/units/transformers.mjs.map +1 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.d.ts +1 -5
  21. package/dist/index.mjs +111 -127
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/schema.cjs +1 -1
  24. package/dist/schema.cjs.map +1 -1
  25. package/dist/schema.d.ts +13 -41
  26. package/dist/schema.mjs +63 -74
  27. package/dist/schema.mjs.map +1 -1
  28. package/dist/stores/store.cjs +1 -1
  29. package/dist/stores/store.cjs.map +1 -1
  30. package/dist/stores/store.d.ts +5 -73
  31. package/dist/stores/store.mjs +53 -254
  32. package/dist/stores/store.mjs.map +1 -1
  33. package/package.json +1 -1
  34. package/dist/api/favorites.cjs +0 -2
  35. package/dist/api/favorites.cjs.map +0 -1
  36. package/dist/api/favorites.d.ts +0 -4
  37. package/dist/api/favorites.mjs +0 -34
  38. package/dist/api/favorites.mjs.map +0 -1
  39. package/dist/api/properties.cjs +0 -2
  40. package/dist/api/properties.cjs.map +0 -1
  41. package/dist/api/properties.d.ts +0 -22
  42. package/dist/api/properties.mjs +0 -197
  43. package/dist/api/properties.mjs.map +0 -1
  44. package/dist/api/users.cjs +0 -2
  45. package/dist/api/users.cjs.map +0 -1
  46. package/dist/api/users.d.ts +0 -5
  47. package/dist/api/users.mjs +0 -54
  48. package/dist/api/users.mjs.map +0 -1
  49. package/dist/units/favorites.cjs +0 -2
  50. package/dist/units/favorites.cjs.map +0 -1
  51. package/dist/units/favorites.d.ts +0 -7
  52. package/dist/units/favorites.mjs +0 -19
  53. package/dist/units/favorites.mjs.map +0 -1
@@ -67,3 +67,7 @@ export declare enum Highlights {
67
67
  BALCONY = "BALCONY",
68
68
  WHEELCHAIR_ACCESSIBLE = "WHEELCHAIR_ACCESSIBLE"
69
69
  }
70
+ export declare enum EngagementType {
71
+ FAVORITE = "FAVORITE",
72
+ SEEN = "SEEN"
73
+ }
@@ -1,7 +1,8 @@
1
- var _ = /* @__PURE__ */ ((E) => (E.UN_RENDERED = "UN_RENDERED", E.IN_QUEUE = "IN_QUEUE", E.RENDERING = "RENDERING", E.RENDERED = "RENDERED", E.FAILED = "FAILED", E))(_ || {}), O = /* @__PURE__ */ ((E) => (E.NOT_STARTED = "NOT_STARTED", E.IN_QUEUE = "IN_QUEUE", E.IN_PROGRESS = "IN_PROGRESS", E.COMPLETED = "COMPLETED", E.FAILED = "FAILED", E))(O || {}), I = /* @__PURE__ */ ((E) => (E.Hyly = "Hyly", E.GoogleAnalytics = "GoogleAnalytics", E))(I || {}), N = /* @__PURE__ */ ((E) => (E.Pending = "Pending", E.Failed = "Failed", E.Success = "Success", E))(N || {}), S = /* @__PURE__ */ ((E) => (E.image = "image", E.video = "video", E.model = "model", E.audio = "audio", E.json = "json", E.blend = "blend", E.logs = "logs", E))(S || {}), T = /* @__PURE__ */ ((E) => (E.USER = "USER", E.ADMIN = "ADMIN", E))(T || {}), A = /* @__PURE__ */ ((E) => (E.archived = "archived", E.active = "active", E))(A || {}), R = /* @__PURE__ */ ((E) => (E.IN_STOCK = "IN_STOCK", E.SOLD_OUT = "SOLD_OUT", E.WAIT_LIST = "WAIT_LIST", E))(R || {}), L = /* @__PURE__ */ ((E) => (E.USD = "USD", E.GBP = "GBP", E))(L || {}), D = /* @__PURE__ */ ((E) => (E.GOOD_VIEW = "GOOD_VIEW", E.SUNSET_VIEWS = "SUNSET_VIEWS", E.GOOD_FOR_HOSTING = "GOOD_FOR_HOSTING", E.LOTS_OF_WINDOWS = "LOTS_OF_WINDOWS", E.BATHTUB = "BATHTUB", E.SOUTH_FACING = "SOUTH_FACING", E.CLOSE_TO_ELEVATOR = "CLOSE_TO_ELEVATOR", E.PEACE_AND_QUIET = "PEACE_AND_QUIET", E.LARGE_LIVING_ROOM = "LARGE_LIVING_ROOM", E.LARGE_BEDROOM = "LARGE_BEDROOM", E.PRIVATE_TERRACE = "PRIVATE_TERRACE", E.WALK_IN_CLOSET = "WALK_IN_CLOSET", E.LOTS_OF_LIGHT = "LOTS_OF_LIGHT", E.LOTS_OF_STORAGE = "LOTS_OF_STORAGE", E.HIS_AND_HERS_SINKS = "HIS_AND_HERS_SINKS", E.COUNTER_SPACE = "COUNTER_SPACE", E.BALCONY = "BALCONY", E.WHEELCHAIR_ACCESSIBLE = "WHEELCHAIR_ACCESSIBLE", E))(D || {});
1
+ var _ = /* @__PURE__ */ ((E) => (E.UN_RENDERED = "UN_RENDERED", E.IN_QUEUE = "IN_QUEUE", E.RENDERING = "RENDERING", E.RENDERED = "RENDERED", E.FAILED = "FAILED", E))(_ || {}), O = /* @__PURE__ */ ((E) => (E.NOT_STARTED = "NOT_STARTED", E.IN_QUEUE = "IN_QUEUE", E.IN_PROGRESS = "IN_PROGRESS", E.COMPLETED = "COMPLETED", E.FAILED = "FAILED", E))(O || {}), I = /* @__PURE__ */ ((E) => (E.Hyly = "Hyly", E.GoogleAnalytics = "GoogleAnalytics", E))(I || {}), N = /* @__PURE__ */ ((E) => (E.Pending = "Pending", E.Failed = "Failed", E.Success = "Success", E))(N || {}), S = /* @__PURE__ */ ((E) => (E.image = "image", E.video = "video", E.model = "model", E.audio = "audio", E.json = "json", E.blend = "blend", E.logs = "logs", E))(S || {}), T = /* @__PURE__ */ ((E) => (E.USER = "USER", E.ADMIN = "ADMIN", E))(T || {}), A = /* @__PURE__ */ ((E) => (E.archived = "archived", E.active = "active", E))(A || {}), R = /* @__PURE__ */ ((E) => (E.IN_STOCK = "IN_STOCK", E.SOLD_OUT = "SOLD_OUT", E.WAIT_LIST = "WAIT_LIST", E))(R || {}), L = /* @__PURE__ */ ((E) => (E.USD = "USD", E.GBP = "GBP", E))(L || {}), D = /* @__PURE__ */ ((E) => (E.GOOD_VIEW = "GOOD_VIEW", E.SUNSET_VIEWS = "SUNSET_VIEWS", E.GOOD_FOR_HOSTING = "GOOD_FOR_HOSTING", E.LOTS_OF_WINDOWS = "LOTS_OF_WINDOWS", E.BATHTUB = "BATHTUB", E.SOUTH_FACING = "SOUTH_FACING", E.CLOSE_TO_ELEVATOR = "CLOSE_TO_ELEVATOR", E.PEACE_AND_QUIET = "PEACE_AND_QUIET", E.LARGE_LIVING_ROOM = "LARGE_LIVING_ROOM", E.LARGE_BEDROOM = "LARGE_BEDROOM", E.PRIVATE_TERRACE = "PRIVATE_TERRACE", E.WALK_IN_CLOSET = "WALK_IN_CLOSET", E.LOTS_OF_LIGHT = "LOTS_OF_LIGHT", E.LOTS_OF_STORAGE = "LOTS_OF_STORAGE", E.HIS_AND_HERS_SINKS = "HIS_AND_HERS_SINKS", E.COUNTER_SPACE = "COUNTER_SPACE", E.BALCONY = "BALCONY", E.WHEELCHAIR_ACCESSIBLE = "WHEELCHAIR_ACCESSIBLE", E))(D || {}), G = /* @__PURE__ */ ((E) => (E.FAVORITE = "FAVORITE", E.SEEN = "SEEN", E))(G || {});
2
2
  export {
3
3
  L as Currency,
4
4
  N as DeliveryStatus,
5
+ G as EngagementType,
5
6
  I as ExternalService,
6
7
  R as FurnitureAvailability,
7
8
  D as Highlights,
@@ -1 +1 @@
1
- {"version":3,"file":"enums.mjs","sources":["../../src/base/enums.ts"],"sourcesContent":["export enum RenderStatus {\n UN_RENDERED = 'UN_RENDERED',\n IN_QUEUE = 'IN_QUEUE',\n RENDERING = 'RENDERING',\n RENDERED = 'RENDERED',\n FAILED = 'FAILED',\n }\n \n export enum QueueJobStatus {\n NOT_STARTED = 'NOT_STARTED',\n IN_QUEUE = 'IN_QUEUE',\n IN_PROGRESS = 'IN_PROGRESS',\n COMPLETED = 'COMPLETED',\n FAILED = 'FAILED',\n }\n \n export enum ExternalService {\n Hyly = 'Hyly',\n GoogleAnalytics = 'GoogleAnalytics',\n }\n \n export enum DeliveryStatus {\n Pending = 'Pending',\n Failed = 'Failed',\n Success = 'Success',\n }\n \n export enum MediaType {\n image = 'image',\n video = 'video',\n model = 'model',\n audio = 'audio',\n json = 'json',\n blend = 'blend',\n logs = 'logs',\n }\n \n export enum UserRole {\n USER = 'USER',\n ADMIN = 'ADMIN',\n }\n \n export enum Status {\n archived = 'archived',\n active = 'active',\n }\n \n export enum FurnitureAvailability {\n IN_STOCK = 'IN_STOCK',\n SOLD_OUT = 'SOLD_OUT',\n WAIT_LIST = 'WAIT_LIST',\n }\n \n export enum Currency {\n USD = 'USD',\n GBP = 'GBP',\n }\n \n export enum Highlights {\n GOOD_VIEW = 'GOOD_VIEW',\n SUNSET_VIEWS = 'SUNSET_VIEWS',\n GOOD_FOR_HOSTING = 'GOOD_FOR_HOSTING',\n LOTS_OF_WINDOWS = 'LOTS_OF_WINDOWS',\n BATHTUB = 'BATHTUB',\n SOUTH_FACING = 'SOUTH_FACING',\n CLOSE_TO_ELEVATOR = 'CLOSE_TO_ELEVATOR',\n PEACE_AND_QUIET = 'PEACE_AND_QUIET',\n LARGE_LIVING_ROOM = 'LARGE_LIVING_ROOM',\n LARGE_BEDROOM = 'LARGE_BEDROOM',\n PRIVATE_TERRACE = 'PRIVATE_TERRACE',\n WALK_IN_CLOSET = 'WALK_IN_CLOSET',\n LOTS_OF_LIGHT = 'LOTS_OF_LIGHT',\n LOTS_OF_STORAGE = 'LOTS_OF_STORAGE',\n HIS_AND_HERS_SINKS = 'HIS_AND_HERS_SINKS',\n COUNTER_SPACE = 'COUNTER_SPACE',\n BALCONY = 'BALCONY',\n WHEELCHAIR_ACCESSIBLE = 'WHEELCHAIR_ACCESSIBLE',\n }\n "],"names":["RenderStatus","QueueJobStatus","ExternalService","DeliveryStatus","MediaType","UserRole","Status","FurnitureAvailability","Currency","Highlights"],"mappings":"AAAO,IAAKA,sBAAAA,OACRA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,SAAS,UALDA,IAAAA,KAAA,CAAA,CAAA,GAQEC,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,cAAc,eACdA,EAAA,YAAY,aACZA,EAAA,SAAS,UALCA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,kBAAkB,mBAFRA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,UAAU,WACVA,EAAA,SAAS,UACTA,EAAA,UAAU,WAHAA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,QAAQ,SACRA,EAAA,OAAO,QACPA,EAAA,QAAQ,SACRA,EAAA,OAAO,QAPGA,IAAAA,KAAA,CAAA,CAAA,GAUAC,sBAAAA,OACVA,EAAA,OAAO,QACPA,EAAA,QAAQ,SAFEA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,SAAS,UAFCA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,WAAW,YACXA,EAAA,WAAW,YACXA,EAAA,YAAY,aAHFA,IAAAA,KAAA,CAAA,CAAA,GAMAC,sBAAAA,OACVA,EAAA,MAAM,OACNA,EAAA,MAAM,OAFIA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAA,YAAY,aACZA,EAAA,eAAe,gBACfA,EAAA,mBAAmB,oBACnBA,EAAA,kBAAkB,mBAClBA,EAAA,UAAU,WACVA,EAAA,eAAe,gBACfA,EAAA,oBAAoB,qBACpBA,EAAA,kBAAkB,mBAClBA,EAAA,oBAAoB,qBACpBA,EAAA,gBAAgB,iBAChBA,EAAA,kBAAkB,mBAClBA,EAAA,iBAAiB,kBACjBA,EAAA,gBAAgB,iBAChBA,EAAA,kBAAkB,mBAClBA,EAAA,qBAAqB,sBACrBA,EAAA,gBAAgB,iBAChBA,EAAA,UAAU,WACVA,EAAA,wBAAwB,yBAlBdA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"enums.mjs","sources":["../../src/base/enums.ts"],"sourcesContent":["export enum RenderStatus {\n UN_RENDERED = 'UN_RENDERED',\n IN_QUEUE = 'IN_QUEUE',\n RENDERING = 'RENDERING',\n RENDERED = 'RENDERED',\n FAILED = 'FAILED',\n }\n \n export enum QueueJobStatus {\n NOT_STARTED = 'NOT_STARTED',\n IN_QUEUE = 'IN_QUEUE',\n IN_PROGRESS = 'IN_PROGRESS',\n COMPLETED = 'COMPLETED',\n FAILED = 'FAILED',\n }\n \n export enum ExternalService {\n Hyly = 'Hyly',\n GoogleAnalytics = 'GoogleAnalytics',\n }\n \n export enum DeliveryStatus {\n Pending = 'Pending',\n Failed = 'Failed',\n Success = 'Success',\n }\n \n export enum MediaType {\n image = 'image',\n video = 'video',\n model = 'model',\n audio = 'audio',\n json = 'json',\n blend = 'blend',\n logs = 'logs',\n }\n \n export enum UserRole {\n USER = 'USER',\n ADMIN = 'ADMIN',\n }\n\n export enum Status {\n archived = 'archived',\n active = 'active',\n }\n \n export enum FurnitureAvailability {\n IN_STOCK = 'IN_STOCK',\n SOLD_OUT = 'SOLD_OUT',\n WAIT_LIST = 'WAIT_LIST',\n }\n \n export enum Currency {\n USD = 'USD',\n GBP = 'GBP',\n }\n \n export enum Highlights {\n GOOD_VIEW = 'GOOD_VIEW',\n SUNSET_VIEWS = 'SUNSET_VIEWS',\n GOOD_FOR_HOSTING = 'GOOD_FOR_HOSTING',\n LOTS_OF_WINDOWS = 'LOTS_OF_WINDOWS',\n BATHTUB = 'BATHTUB',\n SOUTH_FACING = 'SOUTH_FACING',\n CLOSE_TO_ELEVATOR = 'CLOSE_TO_ELEVATOR',\n PEACE_AND_QUIET = 'PEACE_AND_QUIET',\n LARGE_LIVING_ROOM = 'LARGE_LIVING_ROOM',\n LARGE_BEDROOM = 'LARGE_BEDROOM',\n PRIVATE_TERRACE = 'PRIVATE_TERRACE',\n WALK_IN_CLOSET = 'WALK_IN_CLOSET',\n LOTS_OF_LIGHT = 'LOTS_OF_LIGHT',\n LOTS_OF_STORAGE = 'LOTS_OF_STORAGE',\n HIS_AND_HERS_SINKS = 'HIS_AND_HERS_SINKS',\n COUNTER_SPACE = 'COUNTER_SPACE',\n BALCONY = 'BALCONY',\n WHEELCHAIR_ACCESSIBLE = 'WHEELCHAIR_ACCESSIBLE',\n }\n \n export enum EngagementType {\n FAVORITE = 'FAVORITE',\n SEEN = 'SEEN'\n };\n"],"names":["RenderStatus","QueueJobStatus","ExternalService","DeliveryStatus","MediaType","UserRole","Status","FurnitureAvailability","Currency","Highlights","EngagementType"],"mappings":"AAAO,IAAKA,sBAAAA,OACRA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,YAAY,aACZA,EAAA,WAAW,YACXA,EAAA,SAAS,UALDA,IAAAA,KAAA,CAAA,CAAA,GAQEC,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,WAAW,YACXA,EAAA,cAAc,eACdA,EAAA,YAAY,aACZA,EAAA,SAAS,UALCA,IAAAA,KAAA,CAAA,CAAA,GAQAC,sBAAAA,OACV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}
@@ -0,0 +1,23 @@
1
+ import * as z from 'zod';
2
+ export declare const UserInquiryModel: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ createdAt: z.ZodDate;
5
+ scheduledAt: z.ZodDate;
6
+ userId: z.ZodNumber;
7
+ propertyId: z.ZodNumber;
8
+ unitId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ createdAt: Date;
11
+ id: number;
12
+ propertyId: number;
13
+ userId: number;
14
+ scheduledAt: Date;
15
+ unitId?: number | null | undefined;
16
+ }, {
17
+ createdAt: Date;
18
+ id: number;
19
+ propertyId: number;
20
+ userId: number;
21
+ scheduledAt: Date;
22
+ unitId?: number | null | undefined;
23
+ }>;
@@ -0,0 +1,17 @@
1
+ import * as z from 'zod';
2
+ export declare const VisitorModel: z.ZodObject<{
3
+ id: z.ZodString;
4
+ userId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
5
+ createdAt: z.ZodDate;
6
+ lastSeenAt: z.ZodDate;
7
+ }, "strip", z.ZodTypeAny, {
8
+ createdAt: Date;
9
+ id: string;
10
+ lastSeenAt: Date;
11
+ userId?: number | null | undefined;
12
+ }, {
13
+ createdAt: Date;
14
+ id: string;
15
+ lastSeenAt: Date;
16
+ userId?: number | null | undefined;
17
+ }>;
@@ -0,0 +1,25 @@
1
+ import * as z from 'zod';
2
+ type Literal = boolean | number | string;
3
+ type Json = Literal | {
4
+ [key: string]: Json;
5
+ } | Json[];
6
+ export declare const VisitorFilterModel: z.ZodObject<{
7
+ id: z.ZodNumber;
8
+ visitorId: z.ZodString;
9
+ propertyId: z.ZodNumber;
10
+ filter: z.ZodType<Json, z.ZodTypeDef, Json>;
11
+ createdAt: z.ZodDate;
12
+ }, "strip", z.ZodTypeAny, {
13
+ createdAt: Date;
14
+ filter: Json;
15
+ id: number;
16
+ propertyId: number;
17
+ visitorId: string;
18
+ }, {
19
+ createdAt: Date;
20
+ filter: Json;
21
+ id: number;
22
+ propertyId: number;
23
+ visitorId: string;
24
+ }>;
25
+ export {};
@@ -0,0 +1,25 @@
1
+ import * as z from 'zod';
2
+ type Literal = boolean | number | string;
3
+ type Json = Literal | {
4
+ [key: string]: Json;
5
+ } | Json[];
6
+ export declare const VisitorQuestionnaireModel: z.ZodObject<{
7
+ id: z.ZodNumber;
8
+ visitorId: z.ZodString;
9
+ propertyId: z.ZodNumber;
10
+ data: z.ZodType<Json, z.ZodTypeDef, Json>;
11
+ createdAt: z.ZodDate;
12
+ }, "strip", z.ZodTypeAny, {
13
+ createdAt: Date;
14
+ data: Json;
15
+ id: number;
16
+ propertyId: number;
17
+ visitorId: string;
18
+ }, {
19
+ createdAt: Date;
20
+ data: Json;
21
+ id: number;
22
+ propertyId: number;
23
+ visitorId: string;
24
+ }>;
25
+ export {};
@@ -0,0 +1,24 @@
1
+ import * as z from 'zod';
2
+ import { EngagementType } from './enums';
3
+ export declare const VisitorUnitEngagementModel: z.ZodObject<{
4
+ id: z.ZodNumber;
5
+ visitorId: z.ZodString;
6
+ propertyId: z.ZodNumber;
7
+ unitId: z.ZodNumber;
8
+ engagementType: z.ZodNativeEnum<typeof EngagementType>;
9
+ createdAt: z.ZodDate;
10
+ }, "strip", z.ZodTypeAny, {
11
+ createdAt: Date;
12
+ id: number;
13
+ propertyId: number;
14
+ unitId: number;
15
+ visitorId: string;
16
+ engagementType: EngagementType;
17
+ }, {
18
+ createdAt: Date;
19
+ id: number;
20
+ propertyId: number;
21
+ unitId: number;
22
+ visitorId: string;
23
+ engagementType: EngagementType;
24
+ }>;
@@ -1 +1 @@
1
- {"version":3,"file":"transformers.cjs","sources":["../../../src/features/units/transformers.ts"],"sourcesContent":["export const DEFAULT_WEB_ORIGIN = \"//web.inresiapp.com\";\nexport const DEFAULT_PLACEHOLDER_IMAGE = \"/placeholder.jpg\";\n\nexport interface UnitImageApiResponse {\n CFURL?: string;\n name?: string;\n imageSignature?: string;\n}\n\nexport interface UnitSourceApiResponse extends Record<string, unknown> {\n id?: number | string;\n name?: string;\n title?: string;\n slug?: string;\n base_price?: number;\n qty_bedrooms?: number | string;\n qty_bathrooms?: number | string;\n totalSqFt?: number;\n dim_sq_ft?: number | string;\n amenities?: unknown;\n highlights?: unknown;\n date_availability?: string | Date | null;\n unitSetAvailableOn?: string | Date | null;\n image: UnitImageApiResponse;\n additionalImages?: UnitImageApiResponse[];\n}\n\nexport interface UnitHitApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n _index?: string;\n _id?: string;\n _score?: number;\n _source?: Source;\n}\n\nexport interface UnitsTotalInfo {\n value: number;\n relation?: string;\n}\n\nexport interface UnitsDataApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n total?: UnitsTotalInfo;\n max_score?: number | null;\n hits?: UnitHitApiResponse<Source>[];\n type?: string;\n imageSignature?: string;\n}\n\nexport interface UnitsApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n data: UnitsDataApiResponse<Source>;\n}\n\nexport type TransformedUnit<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> = Source & {\n name: string;\n imageUrl: string;\n secondaryImageUrl?: string;\n tertiaryImageUrl?: string;\n};\n\nexport interface UnitsClientList<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n total: number;\n maxScore: number | null;\n type: string;\n hits: TransformedUnit<Source>[];\n}\n\nexport interface TransformUnitsOptions {\n origin?: string;\n placeholderImage?: string;\n}\n\nconst normalizeSignature = (signature?: string): string => {\n if (!signature) return \"\";\n return signature.startsWith(\"?\") ? signature : `?${signature}`;\n};\n\nconst coerceString = (value: unknown): string | undefined => {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n return undefined;\n};\n\nconst propertySlugFallback = (\n defaultSlug: string,\n source: UnitSourceApiResponse,\n): string | undefined => {\n const slug =\n coerceString((source as any).propertySlug) ??\n coerceString((source as any).property_slug);\n return slug ?? defaultSlug;\n};\n\nexport const buildExploreUrl = (\n unitSlug: string,\n propertySlug: string,\n origin = DEFAULT_WEB_ORIGIN,\n): string => `${origin}/${propertySlug}/unit/${unitSlug}/explore`;\n\nexport const buildImageUrl = (\n image: UnitImageApiResponse | undefined,\n placeholder = DEFAULT_PLACEHOLDER_IMAGE,\n fallbackSignature?: string,\n): string => {\n const signature = image?.imageSignature ?? fallbackSignature;\n if (!image?.CFURL || !image?.name || !signature) return placeholder;\n return `${image.CFURL}${image.name}${normalizeSignature(signature)}`;\n};\n\nexport function transformUnitsApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n>(apiResponse: UnitsDataApiResponse<Source>): UnitsApiResponse<Source> {\n return { data: apiResponse };\n}\n\nexport function transformUnitsApiResponseToClient<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n>(\n apiResponse: UnitsDataApiResponse<Source>,\n propertySlug: string,\n options?: TransformUnitsOptions,\n): UnitsClientList<Source> {\n const origin = options?.origin ?? DEFAULT_WEB_ORIGIN;\n const placeholderImage = options?.placeholderImage ?? DEFAULT_PLACEHOLDER_IMAGE;\n\n const hits =\n apiResponse.hits?.map((hit) => {\n const source = (hit._source ?? {}) as Source & UnitSourceApiResponse;\n const unit_name =\n typeof source.name === \"string\"\n ? source.name\n : typeof source.title === \"string\"\n ? source.title\n : \"\";\n\n const slugCandidate =\n coerceString(source.slug) ?? coerceString((source as any).unit_slug) ?? \"\";\n const resolvedPropertySlug =\n coerceString((source as any).propertySlug) ??\n coerceString((source as any).property_slug) ??\n propertySlugFallback(propertySlug, source) ??\n propertySlug;\n\n const normalized: TransformedUnit<Source> = {\n ...(source as Source),\n name: unit_name,\n imageUrl: buildImageUrl(source.image, placeholderImage, apiResponse.imageSignature),\n secondaryImageUrl: buildImageUrl(source.additionalImages?.[0], placeholderImage, apiResponse.imageSignature),\n tertiaryImageUrl: buildImageUrl(source.additionalImages?.[1], placeholderImage, apiResponse.imageSignature),\n };\n\n\n\n if (\n resolvedPropertySlug &&\n !(normalized as Record<string, unknown>).propertySlug\n ) {\n (normalized as Record<string, unknown>).propertySlug = resolvedPropertySlug;\n }\n\n return normalized;\n }) ?? [];\n return {\n total: apiResponse.total?.value ?? hits.length,\n maxScore: apiResponse.max_score ?? null,\n type: apiResponse.type ?? \"units\",\n hits,\n };\n}\n\nexport interface UnitsFilterParams {\n date_availability?: string[];\n qty_bedrooms?: (number | string)[];\n base_price?: number | null;\n highlights?: string[];\n}\n\nexport interface UnitsClientFilters {\n date_availability?: string[];\n qty_bedrooms?: string[];\n base_price?: number;\n highlights: string[];\n}\n\nconst reverseAvailabilityMap: Record<string, string> = {\n asap: \"ASAP\",\n next_month: \"Next Month\",\n \"2_3_months\": \"2-3 Months\",\n all: \"Just Browsing\",\n};\n\nconst reverseBedroomMap: Record<number, string> = {\n 0: \"Studio\",\n 1: \"1 Bed\",\n 2: \"2 Bed\",\n 3: \"3+ Bed\",\n};\n\nconst bedroomLabels = new Set(Object.values(reverseBedroomMap));\n\nconst normalizeBedrooms = (\n bedrooms?: (number | string)[],\n): string[] | undefined => {\n if (!bedrooms || bedrooms.length === 0) return undefined;\n\n const result = new Set<string>();\n\n for (const bedroom of bedrooms) {\n if (typeof bedroom === \"number\") {\n const label = reverseBedroomMap[bedroom];\n if (label) result.add(label);\n continue;\n }\n\n const values = bedroom.split(\",\").map((v) => v.trim());\n\n for (const value of values) {\n const parsed = Number.parseInt(value, 10);\n if (!Number.isNaN(parsed) && reverseBedroomMap[parsed]) {\n result.add(reverseBedroomMap[parsed]);\n } else if (bedroomLabels.has(value)) {\n result.add(value);\n }\n }\n }\n\n return result.size > 0 ? Array.from(result) : undefined;\n};\n\nexport const transformUnitsApiResponseToClientFilters = (\n params: UnitsFilterParams,\n): UnitsClientFilters => {\n const dateAvailabilityLabels =\n params.date_availability && params.date_availability.length > 0\n ? params.date_availability.map(\n (value) => reverseAvailabilityMap[value] ?? value,\n )\n : undefined;\n\n return {\n date_availability: dateAvailabilityLabels,\n qty_bedrooms: normalizeBedrooms(params.qty_bedrooms),\n base_price: params.base_price ?? undefined,\n highlights: params.highlights ?? [],\n };\n};\n"],"names":["DEFAULT_WEB_ORIGIN","DEFAULT_PLACEHOLDER_IMAGE","normalizeSignature","signature","coerceString","value","propertySlugFallback","defaultSlug","source","buildExploreUrl","unitSlug","propertySlug","origin","buildImageUrl","image","placeholder","fallbackSignature","transformUnitsApiResponse","apiResponse","transformUnitsApiResponseToClient","options","placeholderImage","hits","_a","hit","unit_name","resolvedPropertySlug","normalized","_b","reverseAvailabilityMap","reverseBedroomMap","bedroomLabels","normalizeBedrooms","bedrooms","result","bedroom","label","values","v","parsed","transformUnitsApiResponseToClientFilters","params"],"mappings":"gFAAO,MAAMA,EAAqB,sBACrBC,EAA4B,mBA+EnCC,EAAsBC,GACrBA,EACEA,EAAU,WAAW,GAAG,EAAIA,EAAY,IAAIA,CAAS,GADrC,GAInBC,EAAgBC,GAAuC,CAC3D,GAAI,OAAOA,GAAU,SAAU,OAAOA,EACtC,GAAI,OAAOA,GAAU,UAAY,OAAOA,GAAU,UAChD,OAAO,OAAOA,CAAK,CAGvB,EAEMC,EAAuB,CAC3BC,EACAC,IAGEJ,EAAcI,EAAe,YAAY,GACzCJ,EAAcI,EAAe,aAAa,GAC7BD,EAGJE,EAAkB,CAC7BC,EACAC,EACAC,EAASZ,IACE,GAAGY,CAAM,IAAID,CAAY,SAASD,CAAQ,WAE1CG,EAAgB,CAC3BC,EACAC,EAAcd,EACde,IACW,CACX,MAAMb,GAAYW,GAAA,YAAAA,EAAO,iBAAkBE,EAC3C,MAAI,EAACF,GAAA,MAAAA,EAAO,QAAS,EAACA,GAAA,MAAAA,EAAO,OAAQ,CAACX,EAAkBY,EACjD,GAAGD,EAAM,KAAK,GAAGA,EAAM,IAAI,GAAGZ,EAAmBC,CAAS,CAAC,EACpE,EAEO,SAASc,EAEdC,EAAqE,CACrE,MAAO,CAAE,KAAMA,CAAA,CACjB,CAEO,SAASC,EAGdD,EACAP,EACAS,EACyB,SACVA,GAAA,MA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,GAAI,OAAOE,GAAY,SAAU,CAC/B,MAAMC,EAAQN,EAAkBK,CAAO,EACnCC,GAAOF,EAAO,IAAIE,CAAK,EAC3B,QACF,CAEA,MAAMC,EAASF,EAAQ,MAAM,GAAG,EAAE,IAAKG,GAAMA,EAAE,MAAM,EAErD,UAAWjC,KAASgC,EAAQ,CAC1B,MAAME,EAAS,OAAO,SAASlC,EAAO,EAAE,EACpC,CAAC,OAAO,MAAMkC,CAAM,GAAKT,EAAkBS,CAAM,EACnDL,EAAO,IAAIJ,EAAkBS,CAAM,CAAC,EAC3BR,EAAc,IAAI1B,CAAK,GAChC6B,EAAO,IAAI7B,CAAK,CAEpB,CACF,CAEA,OAAO6B,EAAO,KAAO,EAAI,MAAM,KAAKA,CAAM,EAAI,MAChD,EAEaM,EACXC,IASO,CACL,kBAPAA,EAAO,mBAAqBA,EAAO,kBAAkB,OAAS,EAC1DA,EAAO,kBAAkB,IACtBpC,GAAUwB,EAAuBxB,CAAK,GAAKA,CAAA,EAE9C,OAIJ,aAAc2B,EAAkBS,EAAO,YAAY,EACnD,WAAYA,EAAO,YAAc,OACjC,WAAYA,EAAO,YAAc,CAAA,CAAC"}
1
+ {"version":3,"file":"transformers.cjs","sources":["../../../src/features/units/transformers.ts"],"sourcesContent":["export const DEFAULT_WEB_ORIGIN = \"//web.inresiapp.com\";\nexport const DEFAULT_PLACEHOLDER_IMAGE = \"/placeholder.jpg\";\n\nexport interface UnitImageApiResponse {\n CFURL?: string;\n name?: string;\n imageSignature?: string;\n}\n\nexport interface UnitSourceApiResponse extends Record<string, unknown> {\n id?: number | string;\n name?: string;\n title?: string;\n slug?: string;\n base_price?: number;\n qty_bedrooms?: number | string;\n qty_bathrooms?: number | string;\n totalSqFt?: number;\n dim_sq_ft?: number | string;\n amenities?: unknown;\n highlights?: unknown;\n date_availability?: string | Date | null;\n unitSetAvailableOn?: string | Date | null;\n image: UnitImageApiResponse;\n additionalImages?: UnitImageApiResponse[];\n is_favorite?: boolean;\n seen_on?: string | null;\n}\n\nexport interface UnitHitApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n _index?: string;\n _id?: string;\n _score?: number;\n _source?: Source;\n}\n\nexport interface UnitsTotalInfo {\n value: number;\n relation?: string;\n}\n\nexport interface UnitsDataApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n total?: UnitsTotalInfo;\n max_score?: number | null;\n hits?: UnitHitApiResponse<Source>[];\n type?: string;\n imageSignature?: string;\n}\n\nexport interface UnitsApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n data: UnitsDataApiResponse<Source>;\n}\n\nexport type TransformedUnit<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> = Source & {\n name: string;\n imageUrl: string;\n secondaryImageUrl?: string;\n tertiaryImageUrl?: string;\n};\n\nexport interface UnitsClientList<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n total: number;\n maxScore: number | null;\n type: string;\n hits: TransformedUnit<Source>[];\n}\n\nexport interface TransformUnitsOptions {\n origin?: string;\n placeholderImage?: string;\n}\n\nconst normalizeSignature = (signature?: string): string => {\n if (!signature) return \"\";\n return signature.startsWith(\"?\") ? signature : `?${signature}`;\n};\n\nconst coerceString = (value: unknown): string | undefined => {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n return undefined;\n};\n\nconst propertySlugFallback = (\n defaultSlug: string,\n source: UnitSourceApiResponse,\n): string | undefined => {\n const slug =\n coerceString((source as any).propertySlug) ??\n coerceString((source as any).property_slug);\n return slug ?? defaultSlug;\n};\n\nexport const buildExploreUrl = (\n unitSlug: string,\n propertySlug: string,\n origin = DEFAULT_WEB_ORIGIN,\n): string => `${origin}/${propertySlug}/unit/${unitSlug}/explore`;\n\nexport const buildImageUrl = (\n image: UnitImageApiResponse | undefined,\n placeholder = DEFAULT_PLACEHOLDER_IMAGE,\n fallbackSignature?: string,\n): string => {\n const signature = image?.imageSignature ?? fallbackSignature;\n if (!image?.CFURL || !image?.name || !signature) return placeholder;\n return `${image.CFURL}${image.name}${normalizeSignature(signature)}`;\n};\n\nexport function transformUnitsApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n>(apiResponse: UnitsDataApiResponse<Source>): UnitsApiResponse<Source> {\n return { data: apiResponse };\n}\n\nexport function transformUnitsApiResponseToClient<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n>(\n apiResponse: UnitsDataApiResponse<Source>,\n propertySlug: string,\n options?: TransformUnitsOptions,\n): UnitsClientList<Source> {\n const origin = options?.origin ?? DEFAULT_WEB_ORIGIN;\n const placeholderImage = options?.placeholderImage ?? DEFAULT_PLACEHOLDER_IMAGE;\n\n const hits =\n apiResponse.hits?.map((hit) => {\n const source = (hit._source ?? {}) as Source & UnitSourceApiResponse;\n const unit_name =\n typeof source.name === \"string\"\n ? source.name\n : typeof source.title === \"string\"\n ? source.title\n : \"\";\n\n const slugCandidate =\n coerceString(source.slug) ?? coerceString((source as any).unit_slug) ?? \"\";\n const resolvedPropertySlug =\n coerceString((source as any).propertySlug) ??\n coerceString((source as any).property_slug) ??\n propertySlugFallback(propertySlug, source) ??\n propertySlug;\n\n const normalized: TransformedUnit<Source> = {\n ...(source as Source),\n name: unit_name,\n imageUrl: buildImageUrl(source.image, placeholderImage, apiResponse.imageSignature),\n secondaryImageUrl: buildImageUrl(source.additionalImages?.[0], placeholderImage, apiResponse.imageSignature),\n tertiaryImageUrl: buildImageUrl(source.additionalImages?.[1], placeholderImage, apiResponse.imageSignature),\n };\n\n\n\n if (\n resolvedPropertySlug &&\n !(normalized as Record<string, unknown>).propertySlug\n ) {\n (normalized as Record<string, unknown>).propertySlug = resolvedPropertySlug;\n }\n\n return normalized;\n }) ?? [];\n return {\n total: apiResponse.total?.value ?? hits.length,\n maxScore: apiResponse.max_score ?? null,\n type: apiResponse.type ?? \"units\",\n hits,\n };\n}\n\nexport interface UnitsFilterParams {\n date_availability?: string[];\n qty_bedrooms?: (number | string)[];\n base_price?: number | null;\n highlights?: string[];\n}\n\nexport interface UnitsClientFilters {\n date_availability?: string[];\n qty_bedrooms?: string[];\n base_price?: number;\n highlights: string[];\n}\n\nconst reverseAvailabilityMap: Record<string, string> = {\n asap: \"ASAP\",\n next_month: \"Next Month\",\n \"2_3_months\": \"2-3 Months\",\n all: \"Just Browsing\",\n};\n\nconst reverseBedroomMap: Record<number, string> = {\n 0: \"Studio\",\n 1: \"1 Bed\",\n 2: \"2 Bed\",\n 3: \"3+ Bed\",\n};\n\nconst bedroomLabels = new Set(Object.values(reverseBedroomMap));\n\nconst normalizeBedrooms = (\n bedrooms?: (number | string)[],\n): string[] | undefined => {\n if (!bedrooms || bedrooms.length === 0) return undefined;\n\n const result = new Set<string>();\n\n for (const bedroom of bedrooms) {\n if (typeof bedroom === \"number\") {\n const label = reverseBedroomMap[bedroom];\n if (label) result.add(label);\n continue;\n }\n\n const values = bedroom.split(\",\").map((v) => v.trim());\n\n for (const value of values) {\n const parsed = Number.parseInt(value, 10);\n if (!Number.isNaN(parsed) && reverseBedroomMap[parsed]) {\n result.add(reverseBedroomMap[parsed]);\n } else if (bedroomLabels.has(value)) {\n result.add(value);\n }\n }\n }\n\n return result.size > 0 ? Array.from(result) : undefined;\n};\n\nexport const transformUnitsApiResponseToClientFilters = (\n params: UnitsFilterParams,\n): UnitsClientFilters => {\n const dateAvailabilityLabels =\n params.date_availability && params.date_availability.length > 0\n ? params.date_availability.map(\n (value) => reverseAvailabilityMap[value] ?? value,\n )\n : undefined;\n\n return {\n date_availability: dateAvailabilityLabels,\n qty_bedrooms: normalizeBedrooms(params.qty_bedrooms),\n base_price: params.base_price ?? undefined,\n highlights: params.highlights ?? [],\n };\n};\n"],"names":["DEFAULT_WEB_ORIGIN","DEFAULT_PLACEHOLDER_IMAGE","normalizeSignature","signature","coerceString","value","propertySlugFallback","defaultSlug","source","buildExploreUrl","unitSlug","propertySlug","origin","buildImageUrl","image","placeholder","fallbackSignature","transformUnitsApiResponse","apiResponse","transformUnitsApiResponseToClient","options","placeholderImage","hits","_a","hit","unit_name","resolvedPropertySlug","normalized","_b","reverseAvailabilityMap","reverseBedroomMap","bedroomLabels","normalizeBedrooms","bedrooms","result","bedroom","label","values","v","parsed","transformUnitsApiResponseToClientFilters","params"],"mappings":"gFAAO,MAAMA,EAAqB,sBACrBC,EAA4B,mBAiFnCC,EAAsBC,GACrBA,EACEA,EAAU,WAAW,GAAG,EAAIA,EAAY,IAAIA,CAAS,GADrC,GAInBC,EAAgBC,GAAuC,CAC3D,GAAI,OAAOA,GAAU,SAAU,OAAOA,EACtC,GAAI,OAAOA,GAAU,UAAY,OAAOA,GAAU,UAChD,OAAO,OAAOA,CAAK,CAGvB,EAEMC,EAAuB,CAC3BC,EACAC,IAGEJ,EAAcI,EAAe,YAAY,GACzCJ,EAAcI,EAAe,aAAa,GAC7BD,EAGJE,EAAkB,CAC7BC,EACAC,EACAC,EAASZ,IACE,GAAGY,CAAM,IAAID,CAAY,SAASD,CAAQ,WAE1CG,EAAgB,CAC3BC,EACAC,EAAcd,EACde,IACW,CACX,MAAMb,GAAYW,GAAA,YAAAA,EAAO,iBAAkBE,EAC3C,MAAI,EAACF,GAAA,MAAAA,EAAO,QAAS,EAACA,GAAA,MAAAA,EAAO,OAAQ,CAACX,EAAkBY,EACjD,GAAGD,EAAM,KAAK,GAAGA,EAAM,IAAI,GAAGZ,EAAmBC,CAAS,CAAC,EACpE,EAEO,SAASc,EAEdC,EAAqE,CACrE,MAAO,CAAE,KAAMA,CAAA,CACjB,CAEO,SAASC,EAGdD,EACAP,EACAS,EACyB,SACVA,GAAA,MAAAA,EAAS,OACxB,MAAMC,GAAmBD,GAAA,YAAAA,EAAS,mBAAoBnB,EAEhDqB,IACJC,EAAAL,EAAY,OAAZ,YAAAK,EAAkB,IAAKC,GAAQ,SAC7B,MAAMhB,EAAUgB,EAAI,SAAW,CAAA,EACzBC,EACJ,OAAOjB,EAAO,MAAS,SACnBA,EAAO,K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AME,EAAS,OAAO,SAASlC,EAAO,EAAE,EACpC,CAAC,OAAO,MAAMkC,CAAM,GAAKT,EAAkBS,CAAM,EACnDL,EAAO,IAAIJ,EAAkBS,CAAM,CAAC,EAC3BR,EAAc,IAAI1B,CAAK,GAChC6B,EAAO,IAAI7B,CAAK,CAEpB,CACF,CAEA,OAAO6B,EAAO,KAAO,EAAI,MAAM,KAAKA,CAAM,EAAI,MAChD,EAEaM,EACXC,IASO,CACL,kBAPAA,EAAO,mBAAqBA,EAAO,kBAAkB,OAAS,EAC1DA,EAAO,kBAAkB,IACtBpC,GAAUwB,EAAuBxB,CAAK,GAAKA,CAAA,EAE9C,OAIJ,aAAc2B,EAAkBS,EAAO,YAAY,EACnD,WAAYA,EAAO,YAAc,OACjC,WAAYA,EAAO,YAAc,CAAA,CAAC"}
@@ -21,6 +21,8 @@ export interface UnitSourceApiResponse extends Record<string, unknown> {
21
21
  unitSetAvailableOn?: string | Date | null;
22
22
  image: UnitImageApiResponse;
23
23
  additionalImages?: UnitImageApiResponse[];
24
+ is_favorite?: boolean;
25
+ seen_on?: string | null;
24
26
  }
25
27
  export interface UnitHitApiResponse<Source extends Record<string, unknown> = UnitSourceApiResponse> {
26
28
  _index?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"transformers.mjs","sources":["../../../src/features/units/transformers.ts"],"sourcesContent":["export const DEFAULT_WEB_ORIGIN = \"//web.inresiapp.com\";\nexport const DEFAULT_PLACEHOLDER_IMAGE = \"/placeholder.jpg\";\n\nexport interface UnitImageApiResponse {\n CFURL?: string;\n name?: string;\n imageSignature?: string;\n}\n\nexport interface UnitSourceApiResponse extends Record<string, unknown> {\n id?: number | string;\n name?: string;\n title?: string;\n slug?: string;\n base_price?: number;\n qty_bedrooms?: number | string;\n qty_bathrooms?: number | string;\n totalSqFt?: number;\n dim_sq_ft?: number | string;\n amenities?: unknown;\n highlights?: unknown;\n date_availability?: string | Date | null;\n unitSetAvailableOn?: string | Date | null;\n image: UnitImageApiResponse;\n additionalImages?: UnitImageApiResponse[];\n}\n\nexport interface UnitHitApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n _index?: string;\n _id?: string;\n _score?: number;\n _source?: Source;\n}\n\nexport interface UnitsTotalInfo {\n value: number;\n relation?: string;\n}\n\nexport interface UnitsDataApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n total?: UnitsTotalInfo;\n max_score?: number | null;\n hits?: UnitHitApiResponse<Source>[];\n type?: string;\n imageSignature?: string;\n}\n\nexport interface UnitsApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n data: UnitsDataApiResponse<Source>;\n}\n\nexport type TransformedUnit<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> = Source & {\n name: string;\n imageUrl: string;\n secondaryImageUrl?: string;\n tertiaryImageUrl?: string;\n};\n\nexport interface UnitsClientList<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n total: number;\n maxScore: number | null;\n type: string;\n hits: TransformedUnit<Source>[];\n}\n\nexport interface TransformUnitsOptions {\n origin?: string;\n placeholderImage?: string;\n}\n\nconst normalizeSignature = (signature?: string): string => {\n if (!signature) return \"\";\n return signature.startsWith(\"?\") ? signature : `?${signature}`;\n};\n\nconst coerceString = (value: unknown): string | undefined => {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n return undefined;\n};\n\nconst propertySlugFallback = (\n defaultSlug: string,\n source: UnitSourceApiResponse,\n): string | undefined => {\n const slug =\n coerceString((source as any).propertySlug) ??\n coerceString((source as any).property_slug);\n return slug ?? defaultSlug;\n};\n\nexport const buildExploreUrl = (\n unitSlug: string,\n propertySlug: string,\n origin = DEFAULT_WEB_ORIGIN,\n): string => `${origin}/${propertySlug}/unit/${unitSlug}/explore`;\n\nexport const buildImageUrl = (\n image: UnitImageApiResponse | undefined,\n placeholder = DEFAULT_PLACEHOLDER_IMAGE,\n fallbackSignature?: string,\n): string => {\n const signature = image?.imageSignature ?? fallbackSignature;\n if (!image?.CFURL || !image?.name || !signature) return placeholder;\n return `${image.CFURL}${image.name}${normalizeSignature(signature)}`;\n};\n\nexport function transformUnitsApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n>(apiResponse: UnitsDataApiResponse<Source>): UnitsApiResponse<Source> {\n return { data: apiResponse };\n}\n\nexport function transformUnitsApiResponseToClient<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n>(\n apiResponse: UnitsDataApiResponse<Source>,\n propertySlug: string,\n options?: TransformUnitsOptions,\n): UnitsClientList<Source> {\n const origin = options?.origin ?? DEFAULT_WEB_ORIGIN;\n const placeholderImage = options?.placeholderImage ?? DEFAULT_PLACEHOLDER_IMAGE;\n\n const hits =\n apiResponse.hits?.map((hit) => {\n const source = (hit._source ?? {}) as Source & UnitSourceApiResponse;\n const unit_name =\n typeof source.name === \"string\"\n ? source.name\n : typeof source.title === \"string\"\n ? source.title\n : \"\";\n\n const slugCandidate =\n coerceString(source.slug) ?? coerceString((source as any).unit_slug) ?? \"\";\n const resolvedPropertySlug =\n coerceString((source as any).propertySlug) ??\n coerceString((source as any).property_slug) ??\n propertySlugFallback(propertySlug, source) ??\n propertySlug;\n\n const normalized: TransformedUnit<Source> = {\n ...(source as Source),\n name: unit_name,\n imageUrl: buildImageUrl(source.image, placeholderImage, apiResponse.imageSignature),\n secondaryImageUrl: buildImageUrl(source.additionalImages?.[0], placeholderImage, apiResponse.imageSignature),\n tertiaryImageUrl: buildImageUrl(source.additionalImages?.[1], placeholderImage, apiResponse.imageSignature),\n };\n\n\n\n if (\n resolvedPropertySlug &&\n !(normalized as Record<string, unknown>).propertySlug\n ) {\n (normalized as Record<string, unknown>).propertySlug = resolvedPropertySlug;\n }\n\n return normalized;\n }) ?? [];\n return {\n total: apiResponse.total?.value ?? hits.length,\n maxScore: apiResponse.max_score ?? null,\n type: apiResponse.type ?? \"units\",\n hits,\n };\n}\n\nexport interface UnitsFilterParams {\n date_availability?: string[];\n qty_bedrooms?: (number | string)[];\n base_price?: number | null;\n highlights?: string[];\n}\n\nexport interface UnitsClientFilters {\n date_availability?: string[];\n qty_bedrooms?: string[];\n base_price?: number;\n highlights: string[];\n}\n\nconst reverseAvailabilityMap: Record<string, string> = {\n asap: \"ASAP\",\n next_month: \"Next Month\",\n \"2_3_months\": \"2-3 Months\",\n all: \"Just Browsing\",\n};\n\nconst reverseBedroomMap: Record<number, string> = {\n 0: \"Studio\",\n 1: \"1 Bed\",\n 2: \"2 Bed\",\n 3: \"3+ Bed\",\n};\n\nconst bedroomLabels = new Set(Object.values(reverseBedroomMap));\n\nconst normalizeBedrooms = (\n bedrooms?: (number | string)[],\n): string[] | undefined => {\n if (!bedrooms || bedrooms.length === 0) return undefined;\n\n const result = new Set<string>();\n\n for (const bedroom of bedrooms) {\n if (typeof bedroom === \"number\") {\n const label = reverseBedroomMap[bedroom];\n if (label) result.add(label);\n continue;\n }\n\n const values = bedroom.split(\",\").map((v) => v.trim());\n\n for (const value of values) {\n const parsed = Number.parseInt(value, 10);\n if (!Number.isNaN(parsed) && reverseBedroomMap[parsed]) {\n result.add(reverseBedroomMap[parsed]);\n } else if (bedroomLabels.has(value)) {\n result.add(value);\n }\n }\n }\n\n return result.size > 0 ? Array.from(result) : undefined;\n};\n\nexport const transformUnitsApiResponseToClientFilters = (\n params: UnitsFilterParams,\n): UnitsClientFilters => {\n const dateAvailabilityLabels =\n params.date_availability && params.date_availability.length > 0\n ? params.date_availability.map(\n (value) => reverseAvailabilityMap[value] ?? value,\n )\n : undefined;\n\n return {\n date_availability: dateAvailabilityLabels,\n qty_bedrooms: normalizeBedrooms(params.qty_bedrooms),\n base_price: params.base_price ?? undefined,\n highlights: params.highlights ?? [],\n };\n};\n"],"names":["DEFAULT_WEB_ORIGIN","DEFAULT_PLACEHOLDER_IMAGE","normalizeSignature","signature","coerceString","value","propertySlugFallback","defaultSlug","source","buildExploreUrl","unitSlug","propertySlug","origin","buildImageUrl","image","placeholder","fallbackSignature","transformUnitsApiResponse","apiResponse","transformUnitsApiResponseToClient","options","_a","_b","placeholderImage","hits","hit","unit_name","resolvedPropertySlug","normalized","reverseAvailabilityMap","reverseBedroomMap","bedroomLabels","normalizeBedrooms","bedrooms","result","bedroom","label","values","v","parsed","transformUnitsApiResponseToClientFilters","params"],"mappings":"AAAO,MAAMA,IAAqB,uBACrBC,IAA4B,oBA+EnCC,IAAqB,CAACC,MACrBA,IACEA,EAAU,WAAW,GAAG,IAAIA,IAAY,IAAIA,CAAS,KADrC,IAInBC,IAAe,CAACC,MAAuC;AAC3D,MAAI,OAAOA,KAAU,SAAU,QAAOA;AACtC,MAAI,OAAOA,KAAU,YAAY,OAAOA,KAAU;AAChD,WAAO,OAAOA,CAAK;AAGvB,GAEMC,IAAuB,CAC3BC,GACAC,MAGEJ,EAAcI,EAAe,YAAY,KACzCJ,EAAcI,EAAe,aAAa,KAC7BD,GAGJE,IAAkB,CAC7BC,GACAC,GACAC,IAASZ,MACE,GAAGY,CAAM,IAAID,CAAY,SAASD,CAAQ,YAE1CG,IAAgB,CAC3BC,GACAC,IAAcd,GACde,MACW;AACX,QAAMb,KAAYW,KAAA,gBAAAA,EAAO,mBAAkBE;AAC3C,SAAI,EAACF,KAAA,QAAAA,EAAO,UAAS,EAACA,KAAA,QAAAA,EAAO,SAAQ,CAACX,IAAkBY,IACjD,GAAGD,EAAM,KAAK,GAAGA,EAAM,IAAI,GAAGZ,EAAmBC,CAAS,CAAC;AACpE;AAEO,SAASc,EAEdC,GAAqE;AACrE,SAAO,EAAE,MAAMA,EAAA;AACjB;AAEO,SAASC,EAGdD,GACAP,GACAS,GACyB;AAnIpB,MAAAC,GAAAC;AAoIU,EAAAF,KAAA,QAAAA,EAAS;AACxB,QAAMG,KAAmBH,KAAA,gBAAAA,EAAS,qBAAoBnB,GAEhDuB,MACJH,IAAAH,EAAY,SAAZ,gBAAAG,EAAkB,IAAI,CAACI,MAAQ;AAxI5B,QAAAJ,GAAAC;AA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GAAU;AAC9B,QAAI,OAAOE,KAAY,UAAU;AAC/B,YAAMC,IAAQN,EAAkBK,CAAO;AACvC,MAAIC,KAAOF,EAAO,IAAIE,CAAK;AAC3B;AAAA,IACF;AAEA,UAAMC,IAASF,EAAQ,MAAM,GAAG,EAAE,IAAI,CAACG,MAAMA,EAAE,MAAM;AAErD,eAAWjC,KAASgC,GAAQ;AAC1B,YAAME,IAAS,OAAO,SAASlC,GAAO,EAAE;AACxC,MAAI,CAAC,OAAO,MAAMkC,CAAM,KAAKT,EAAkBS,CAAM,IACnDL,EAAO,IAAIJ,EAAkBS,CAAM,CAAC,IAC3BR,EAAc,IAAI1B,CAAK,KAChC6B,EAAO,IAAI7B,CAAK;AAAA,IAEpB;AAAA,EACF;AAEA,SAAO6B,EAAO,OAAO,IAAI,MAAM,KAAKA,CAAM,IAAI;AAChD,GAEaM,IAA2C,CACtDC,OASO;AAAA,EACL,mBAPAA,EAAO,qBAAqBA,EAAO,kBAAkB,SAAS,IAC1DA,EAAO,kBAAkB;AAAA,IACvB,CAACpC,MAAUwB,EAAuBxB,CAAK,KAAKA;AAAA,EAAA,IAE9C;AAAA,EAIJ,cAAc2B,EAAkBS,EAAO,YAAY;AAAA,EACnD,YAAYA,EAAO,cAAc;AAAA,EACjC,YAAYA,EAAO,cAAc,CAAA;AAAC;"}
1
+ {"version":3,"file":"transformers.mjs","sources":["../../../src/features/units/transformers.ts"],"sourcesContent":["export const DEFAULT_WEB_ORIGIN = \"//web.inresiapp.com\";\nexport const DEFAULT_PLACEHOLDER_IMAGE = \"/placeholder.jpg\";\n\nexport interface UnitImageApiResponse {\n CFURL?: string;\n name?: string;\n imageSignature?: string;\n}\n\nexport interface UnitSourceApiResponse extends Record<string, unknown> {\n id?: number | string;\n name?: string;\n title?: string;\n slug?: string;\n base_price?: number;\n qty_bedrooms?: number | string;\n qty_bathrooms?: number | string;\n totalSqFt?: number;\n dim_sq_ft?: number | string;\n amenities?: unknown;\n highlights?: unknown;\n date_availability?: string | Date | null;\n unitSetAvailableOn?: string | Date | null;\n image: UnitImageApiResponse;\n additionalImages?: UnitImageApiResponse[];\n is_favorite?: boolean;\n seen_on?: string | null;\n}\n\nexport interface UnitHitApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n _index?: string;\n _id?: string;\n _score?: number;\n _source?: Source;\n}\n\nexport interface UnitsTotalInfo {\n value: number;\n relation?: string;\n}\n\nexport interface UnitsDataApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n total?: UnitsTotalInfo;\n max_score?: number | null;\n hits?: UnitHitApiResponse<Source>[];\n type?: string;\n imageSignature?: string;\n}\n\nexport interface UnitsApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n data: UnitsDataApiResponse<Source>;\n}\n\nexport type TransformedUnit<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> = Source & {\n name: string;\n imageUrl: string;\n secondaryImageUrl?: string;\n tertiaryImageUrl?: string;\n};\n\nexport interface UnitsClientList<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n> {\n total: number;\n maxScore: number | null;\n type: string;\n hits: TransformedUnit<Source>[];\n}\n\nexport interface TransformUnitsOptions {\n origin?: string;\n placeholderImage?: string;\n}\n\nconst normalizeSignature = (signature?: string): string => {\n if (!signature) return \"\";\n return signature.startsWith(\"?\") ? signature : `?${signature}`;\n};\n\nconst coerceString = (value: unknown): string | undefined => {\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") {\n return String(value);\n }\n return undefined;\n};\n\nconst propertySlugFallback = (\n defaultSlug: string,\n source: UnitSourceApiResponse,\n): string | undefined => {\n const slug =\n coerceString((source as any).propertySlug) ??\n coerceString((source as any).property_slug);\n return slug ?? defaultSlug;\n};\n\nexport const buildExploreUrl = (\n unitSlug: string,\n propertySlug: string,\n origin = DEFAULT_WEB_ORIGIN,\n): string => `${origin}/${propertySlug}/unit/${unitSlug}/explore`;\n\nexport const buildImageUrl = (\n image: UnitImageApiResponse | undefined,\n placeholder = DEFAULT_PLACEHOLDER_IMAGE,\n fallbackSignature?: string,\n): string => {\n const signature = image?.imageSignature ?? fallbackSignature;\n if (!image?.CFURL || !image?.name || !signature) return placeholder;\n return `${image.CFURL}${image.name}${normalizeSignature(signature)}`;\n};\n\nexport function transformUnitsApiResponse<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n>(apiResponse: UnitsDataApiResponse<Source>): UnitsApiResponse<Source> {\n return { data: apiResponse };\n}\n\nexport function transformUnitsApiResponseToClient<\n Source extends Record<string, unknown> = UnitSourceApiResponse,\n>(\n apiResponse: UnitsDataApiResponse<Source>,\n propertySlug: string,\n options?: TransformUnitsOptions,\n): UnitsClientList<Source> {\n const origin = options?.origin ?? DEFAULT_WEB_ORIGIN;\n const placeholderImage = options?.placeholderImage ?? DEFAULT_PLACEHOLDER_IMAGE;\n\n const hits =\n apiResponse.hits?.map((hit) => {\n const source = (hit._source ?? {}) as Source & UnitSourceApiResponse;\n const unit_name =\n typeof source.name === \"string\"\n ? source.name\n : typeof source.title === \"string\"\n ? source.title\n : \"\";\n\n const slugCandidate =\n coerceString(source.slug) ?? coerceString((source as any).unit_slug) ?? \"\";\n const resolvedPropertySlug =\n coerceString((source as any).propertySlug) ??\n coerceString((source as any).property_slug) ??\n propertySlugFallback(propertySlug, source) ??\n propertySlug;\n\n const normalized: TransformedUnit<Source> = {\n ...(source as Source),\n name: unit_name,\n imageUrl: buildImageUrl(source.image, placeholderImage, apiResponse.imageSignature),\n secondaryImageUrl: buildImageUrl(source.additionalImages?.[0], placeholderImage, apiResponse.imageSignature),\n tertiaryImageUrl: buildImageUrl(source.additionalImages?.[1], placeholderImage, apiResponse.imageSignature),\n };\n\n\n\n if (\n resolvedPropertySlug &&\n !(normalized as Record<string, unknown>).propertySlug\n ) {\n (normalized as Record<string, unknown>).propertySlug = resolvedPropertySlug;\n }\n\n return normalized;\n }) ?? [];\n return {\n total: apiResponse.total?.value ?? hits.length,\n maxScore: apiResponse.max_score ?? null,\n type: apiResponse.type ?? \"units\",\n hits,\n };\n}\n\nexport interface UnitsFilterParams {\n date_availability?: string[];\n qty_bedrooms?: (number | string)[];\n base_price?: number | null;\n highlights?: string[];\n}\n\nexport interface UnitsClientFilters {\n date_availability?: string[];\n qty_bedrooms?: string[];\n base_price?: number;\n highlights: string[];\n}\n\nconst reverseAvailabilityMap: Record<string, string> = {\n asap: \"ASAP\",\n next_month: \"Next Month\",\n \"2_3_months\": \"2-3 Months\",\n all: \"Just Browsing\",\n};\n\nconst reverseBedroomMap: Record<number, string> = {\n 0: \"Studio\",\n 1: \"1 Bed\",\n 2: \"2 Bed\",\n 3: \"3+ Bed\",\n};\n\nconst bedroomLabels = new Set(Object.values(reverseBedroomMap));\n\nconst normalizeBedrooms = (\n bedrooms?: (number | string)[],\n): string[] | undefined => {\n if (!bedrooms || bedrooms.length === 0) return undefined;\n\n const result = new Set<string>();\n\n for (const bedroom of bedrooms) {\n if (typeof bedroom === \"number\") {\n const label = reverseBedroomMap[bedroom];\n if (label) result.add(label);\n continue;\n }\n\n const values = bedroom.split(\",\").map((v) => v.trim());\n\n for (const value of values) {\n const parsed = Number.parseInt(value, 10);\n if (!Number.isNaN(parsed) && reverseBedroomMap[parsed]) {\n result.add(reverseBedroomMap[parsed]);\n } else if (bedroomLabels.has(value)) {\n result.add(value);\n }\n }\n }\n\n return result.size > 0 ? Array.from(result) : undefined;\n};\n\nexport const transformUnitsApiResponseToClientFilters = (\n params: UnitsFilterParams,\n): UnitsClientFilters => {\n const dateAvailabilityLabels =\n params.date_availability && params.date_availability.length > 0\n ? params.date_availability.map(\n (value) => reverseAvailabilityMap[value] ?? value,\n )\n : undefined;\n\n return {\n date_availability: dateAvailabilityLabels,\n qty_bedrooms: normalizeBedrooms(params.qty_bedrooms),\n base_price: params.base_price ?? undefined,\n highlights: params.highlights ?? [],\n };\n};\n"],"names":["DEFAULT_WEB_ORIGIN","DEFAULT_PLACEHOLDER_IMAGE","normalizeSignature","signature","coerceString","value","propertySlugFallback","defaultSlug","source","buildExploreUrl","unitSlug","propertySlug","origin","buildImageUrl","image","placeholder","fallbackSignature","transformUnitsApiResponse","apiResponse","transformUnitsApiResponseToClient","options","_a","_b","placeholderImage","hits","hit","unit_name","resolvedPropertySlug","normalized","reverseAvailabilityMap","reverseBedroomMap","bedroomLabels","normalizeBedrooms","bedrooms","result","bedroom","label","values","v","parsed","transformUnitsApiResponseToClientFilters","params"],"mappings":"AAAO,MAAMA,IAAqB,uBACrBC,IAA4B,oBAiFnCC,IAAqB,CAACC,MACrBA,IACEA,EAAU,WAAW,GAAG,IAAIA,IAAY,IAAIA,CAAS,KADrC,IAInBC,IAAe,CAACC,MAAuC;AAC3D,MAAI,OAAOA,KAAU,SAAU,QAAOA;AACtC,MAAI,OAAOA,KAAU,YAAY,OAAOA,KAAU;AAChD,WAAO,OAAOA,CAAK;AAGvB,GAEMC,IAAuB,CAC3BC,GACAC,MAGEJ,EAAcI,EAAe,YAAY,KACzCJ,EAAcI,EAAe,aAAa,KAC7BD,GAGJE,IAAkB,CAC7BC,GACAC,GACAC,IAASZ,MACE,GAAGY,CAAM,IAAID,CAAY,SAASD,CAAQ,YAE1CG,IAAgB,CAC3BC,GACAC,IAAcd,GACde,MACW;AACX,QAAMb,KAAYW,KAAA,gBAAAA,EAAO,mBAAkBE;AAC3C,SAAI,EAACF,KAAA,QAAAA,EAAO,UAAS,EAACA,KAAA,QAAAA,EAAO,SAAQ,CAACX,IAAkBY,IACjD,GAAGD,EAAM,KAAK,GAAGA,EAAM,IAAI,GAAGZ,EAAmBC,CAAS,CAAC;AACpE;AAEO,SAASc,EAEdC,GAAqE;AACrE,SAAO,EAAE,MAAMA,EAAA;AACjB;AAEO,SAASC,EAGdD,GACAP,GACAS,GACyB;AArIpB,MAAAC,GAAAC;AAsIU,EAAAF,KAAA,QAAAA,EAAS;AACxB,QAAMG,KAAmBH,KAAA,gBAAAA,EAAS,qBAAoBnB,GAEhDuB,MACJH,IA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,CAACA,KAAYA,EAAS,WAAW,EAAG;AAExC,QAAMC,wBAAa,IAAA;AAEnB,aAAWC,KAAWF,GAAU;AAC9B,QAAI,OAAOE,KAAY,UAAU;AAC/B,YAAMC,IAAQN,EAAkBK,CAAO;AACvC,MAAIC,KAAOF,EAAO,IAAIE,CAAK;AAC3B;AAAA,IACF;AAEA,UAAMC,IAASF,EAAQ,MAAM,GAAG,EAAE,IAAI,CAACG,MAAMA,EAAE,MAAM;AAErD,eAAWjC,KAASgC,GAAQ;AAC1B,YAAME,IAAS,OAAO,SAASlC,GAAO,EAAE;AACxC,MAAI,CAAC,OAAO,MAAMkC,CAAM,KAAKT,EAAkBS,CAAM,IACnDL,EAAO,IAAIJ,EAAkBS,CAAM,CAAC,IAC3BR,EAAc,IAAI1B,CAAK,KAChC6B,EAAO,IAAI7B,CAAK;AAAA,IAEpB;AAAA,EACF;AAEA,SAAO6B,EAAO,OAAO,IAAI,MAAM,KAAKA,CAAM,IAAI;AAChD,GAEaM,IAA2C,CACtDC,OASO;AAAA,EACL,mBAPAA,EAAO,qBAAqBA,EAAO,kBAAkB,SAAS,IAC1DA,EAAO,kBAAkB;AAAA,IACvB,CAACpC,MAAUwB,EAAuBxB,CAAK,KAAKA;AAAA,EAAA,IAE9C;AAAA,EAIJ,cAAc2B,EAAkBS,EAAO,YAAY;AAAA,EACnD,YAAYA,EAAO,cAAc;AAAA,EACjC,YAAYA,EAAO,cAAc,CAAA;AAAC;"}
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./errors.cjs"),e=require("./schema.cjs"),m=require("./db.cjs"),s=require("./api/users.cjs"),S=require("./debug.cjs"),a=require("./storage.cjs"),n=require("./api/favorites.cjs"),d=require("./api/properties.cjs"),u=require("./stores/store.cjs"),p=require("./adapters/zustand-store.cjs"),U=require("./adapters/structured-store.cjs"),h=require("./units/favorites.cjs"),t=require("./features/units/transformers.cjs"),c=require("./features/filters/transformers.cjs"),o=require("./utils/dimensions.cjs"),M=require("./validation.cjs"),v=require("./base/overviewimagesonproperty.cjs"),g=require("./base/amenityimagesonproperty.cjs"),E=require("./base/floorplan.cjs"),P=require("./base/media.cjs"),f=require("./base/property.cjs"),D=require("./base/propertyhighlight.cjs"),q=require("./base/room.cjs"),A=require("./base/style.cjs"),F=require("./base/unit.cjs"),r=require("./base/enums.cjs"),T=require("./base/renderedstyle.cjs"),R=require("./base/propertyamenity.cjs"),I=require("./base/favoriteunit.cjs"),O=require("./base/user.cjs"),b=require("./base/propertylink.cjs"),y=require("./features/analytics/AnalyticsProvider.cjs"),i=require("./features/analytics/analytics.cjs");exports.OpenDBError=l.OpenDBError;exports.SchemaMismatchError=l.SchemaMismatchError;exports.ApiUserSchema=e.ApiUserSchema;exports.AppStoreDataSchema=e.AppStoreDataSchema;exports.FavoritesSchema=e.FavoritesSchema;exports.FiltersSchema=e.FiltersSchema;exports.PropertySchema=e.PropertySchema;exports.PropertyStoreDataSchema=e.PropertyStoreDataSchema;exports.QueryParamsSchema=e.QueryParamsSchema;exports.ResultsModeEnum=e.ResultsModeEnum;exports.SCHEMA_VERSION=e.SCHEMA_VERSION;exports.SortByEnum=e.SortByEnum;exports.TourContactDataSchema=e.TourContactDataSchema;exports.UnifiedStoreDataSchema=e.UnifiedStoreDataSchema;exports.UnitDataSchema=e.UnitDataSchema;exports.UnitFavoriteSchema=e.UnitFavoriteSchema;exports.UnitSchema=e.UnitSchema;exports.UserPropertyStateSchema=e.UserPropertyStateSchema;exports.UserSchema=e.UserSchema;exports.UserUnitDataSchema=e.UserUnitDataSchema;exports.ViewedUnitSchema=e.ViewedUnitSchema;exports.getDB=m.getDB;exports.resetDB=m.resetDB;exports.defaultIdGenerator=s.defaultIdGenerator;exports.ensureUser=s.ensureUser;exports.getUserUUID=s.getUserUUID;exports.debugDump=S.debugDump;exports.exportJSON=S.exportJSON;exports.createORMStringStorage=a.createORMStringStorage;exports.kvGet=a.kvGet;exports.kvRemove=a.kvRemove;exports.kvSet=a.kvSet;exports.getFavoritedUnitsForProperty=n.getFavoritedUnitsForProperty;exports.isUnitFavorited=n.isUnitFavorited;exports.setFavoriteUnit=n.setFavoriteUnit;exports.toggleFavoriteUnit=n.toggleFavoriteUnit;exports.PropertyStore=d.PropertyStore;exports.propertyStore=d.propertyStore;exports.Store=u.UnifiedStore;exports.UnifiedStore=u.UnifiedStore;exports.store=u.store;exports.createUseUnitState=p.createUseUnitState;exports.createZustandUnifiedStore=p.createZustandUnifiedStore;exports.createStructuredStore=U.createStructuredStore;exports.createStructuredStoreActions=U.createStructuredStoreActions;exports.favorites=h.favorites;exports.DEFAULT_PLACEHOLDER_IMAGE=t.DEFAULT_PLACEHOLDER_IMAGE;exports.DEFAULT_WEB_ORIGIN=t.DEFAULT_WEB_ORIGIN;exports.buildExploreUrl=t.buildExploreUrl;exports.buildImageUrl=t.buildImageUrl;exports.transformUnitsApiResponse=t.transformUnitsApiResponse;exports.transformUnitsApiResponseToClient=t.transformUnitsApiResponseToClient;exports.transformUnitsApiResponseToClientFilters=t.transformUnitsApiResponseToClientFilters;exports.defaultSortParamMap=c.defaultSortParamMap;exports.transformFiltersToPreferences=c.transformFiltersToPreferences;exports.transformFiltersToUnitsSearchParams=c.transformFiltersToUnitsSearchParams;exports.dimensionToMmNumber=o.dimensionToMmNumber;exports.formatDimensions=o.formatDimensions;exports.imperialToMm=o.imperialToMm;exports.inchesToMm=o.inchesToMm;exports.mmToInches=o.mmToInches;exports.toInchesDisplay=o.toInchesDisplay;exports.configureValidation=M.configureValidation;exports.OverviewImagesOnPropertyModel=v.OverviewImagesOnPropertyModel;exports.AmenityImagesOnPropertyModel=g.AmenityImagesOnPropertyModel;exports.FloorPlanModel=E.FloorPlanModel;exports.MediaModel=P.MediaModel;exports.PropertyModel=f.PropertyModel;exports.PropertyHighlightModel=D.PropertyHighlightModel;exports.RoomModel=q.RoomModel;exports.StyleModel=A.StyleModel;exports.UnitModel=F.UnitModel;exports.Currency=r.Currency;exports.DeliveryStatus=r.DeliveryStatus;exports.ExternalService=r.ExternalService;exports.FurnitureAvailability=r.FurnitureAvailability;exports.Highlights=r.Highlights;exports.MediaType=r.MediaType;exports.QueueJobStatus=r.QueueJobStatus;exports.RenderStatus=r.RenderStatus;exports.Status=r.Status;exports.UserRole=r.UserRole;exports.RenderedStyleModel=T.RenderedStyleModel;exports.PropertyAmenityModel=R.PropertyAmenityModel;exports.FavoriteUnitModel=I.FavoriteUnitModel;exports.UserModel=O.UserModel;exports.PropertyLinkModel=b.PropertyLinkModel;exports.AnalyticsProvider=y.AnalyticsProvider;exports.useAnalytics=y.useAnalytics;exports.QuestionEnumValues=i.QuestionEnumValues;exports.QuestionnaireInteractionValues=i.QuestionnaireInteractionValues;exports.SortEnumValues=i.SortEnumValues;exports.buildTrackingEvents=i.buildTrackingEvents;exports.useTrackEvent=i.useTrackEvent;exports.useTrackingEvents=i.useTrackingEvents;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./errors.cjs"),e=require("./schema.cjs"),c=require("./db.cjs"),l=require("./debug.cjs"),n=require("./storage.cjs"),a=require("./stores/store.cjs"),d=require("./adapters/zustand-store.cjs"),m=require("./adapters/structured-store.cjs"),t=require("./features/units/transformers.cjs"),s=require("./features/filters/transformers.cjs"),o=require("./utils/dimensions.cjs"),p=require("./validation.cjs"),y=require("./base/overviewimagesonproperty.cjs"),h=require("./base/amenityimagesonproperty.cjs"),M=require("./base/floorplan.cjs"),U=require("./base/media.cjs"),g=require("./base/property.cjs"),E=require("./base/propertyhighlight.cjs"),v=require("./base/room.cjs"),P=require("./base/style.cjs"),A=require("./base/unit.cjs"),r=require("./base/enums.cjs"),T=require("./base/renderedstyle.cjs"),D=require("./base/propertyamenity.cjs"),f=require("./base/favoriteunit.cjs"),q=require("./base/user.cjs"),R=require("./base/propertylink.cjs"),S=require("./features/analytics/AnalyticsProvider.cjs"),i=require("./features/analytics/analytics.cjs");exports.OpenDBError=u.OpenDBError;exports.SchemaMismatchError=u.SchemaMismatchError;exports.ApiUserSchema=e.ApiUserSchema;exports.AppStoreDataSchema=e.AppStoreDataSchema;exports.FiltersSchema=e.FiltersSchema;exports.PropertySchema=e.PropertySchema;exports.PropertyStoreDataSchema=e.PropertyStoreDataSchema;exports.QueryParamsSchema=e.QueryParamsSchema;exports.ResultsModeEnum=e.ResultsModeEnum;exports.SCHEMA_VERSION=e.SCHEMA_VERSION;exports.SortByEnum=e.SortByEnum;exports.TourContactDataSchema=e.TourContactDataSchema;exports.UnifiedStoreDataSchema=e.UnifiedStoreDataSchema;exports.UnitDataSchema=e.UnitDataSchema;exports.UnitSchema=e.UnitSchema;exports.UserPropertyStateSchema=e.UserPropertyStateSchema;exports.UserSchema=e.UserSchema;exports.UserUnitDataSchema=e.UserUnitDataSchema;exports.ViewedUnitSchema=e.ViewedUnitSchema;exports.getDB=c.getDB;exports.resetDB=c.resetDB;exports.debugDump=l.debugDump;exports.exportJSON=l.exportJSON;exports.createORMStringStorage=n.createORMStringStorage;exports.kvGet=n.kvGet;exports.kvRemove=n.kvRemove;exports.kvSet=n.kvSet;exports.Store=a.UnifiedStore;exports.UnifiedStore=a.UnifiedStore;exports.store=a.store;exports.createZustandUnifiedStore=d.createZustandUnifiedStore;exports.createStructuredStore=m.createStructuredStore;exports.createStructuredStoreActions=m.createStructuredStoreActions;exports.DEFAULT_PLACEHOLDER_IMAGE=t.DEFAULT_PLACEHOLDER_IMAGE;exports.DEFAULT_WEB_ORIGIN=t.DEFAULT_WEB_ORIGIN;exports.buildExploreUrl=t.buildExploreUrl;exports.buildImageUrl=t.buildImageUrl;exports.transformUnitsApiResponse=t.transformUnitsApiResponse;exports.transformUnitsApiResponseToClient=t.transformUnitsApiResponseToClient;exports.transformUnitsApiResponseToClientFilters=t.transformUnitsApiResponseToClientFilters;exports.defaultSortParamMap=s.defaultSortParamMap;exports.transformFiltersToPreferences=s.transformFiltersToPreferences;exports.transformFiltersToUnitsSearchParams=s.transformFiltersToUnitsSearchParams;exports.dimensionToMmNumber=o.dimensionToMmNumber;exports.formatDimensions=o.formatDimensions;exports.imperialToMm=o.imperialToMm;exports.inchesToMm=o.inchesToMm;exports.mmToInches=o.mmToInches;exports.toInchesDisplay=o.toInchesDisplay;exports.configureValidation=p.configureValidation;exports.OverviewImagesOnPropertyModel=y.OverviewImagesOnPropertyModel;exports.AmenityImagesOnPropertyModel=h.AmenityImagesOnPropertyModel;exports.FloorPlanModel=M.FloorPlanModel;exports.MediaModel=U.MediaModel;exports.PropertyModel=g.PropertyModel;exports.PropertyHighlightModel=E.PropertyHighlightModel;exports.RoomModel=v.RoomModel;exports.StyleModel=P.StyleModel;exports.UnitModel=A.UnitModel;exports.Currency=r.Currency;exports.DeliveryStatus=r.DeliveryStatus;exports.EngagementType=r.EngagementType;exports.ExternalService=r.ExternalService;exports.FurnitureAvailability=r.FurnitureAvailability;exports.Highlights=r.Highlights;exports.MediaType=r.MediaType;exports.QueueJobStatus=r.QueueJobStatus;exports.RenderStatus=r.RenderStatus;exports.Status=r.Status;exports.UserRole=r.UserRole;exports.RenderedStyleModel=T.RenderedStyleModel;exports.PropertyAmenityModel=D.PropertyAmenityModel;exports.FavoriteUnitModel=f.FavoriteUnitModel;exports.UserModel=q.UserModel;exports.PropertyLinkModel=R.PropertyLinkModel;exports.AnalyticsProvider=S.AnalyticsProvider;exports.useAnalytics=S.useAnalytics;exports.QuestionEnumValues=i.QuestionEnumValues;exports.QuestionnaireInteractionValues=i.QuestionnaireInteractionValues;exports.SortEnumValues=i.SortEnumValues;exports.buildTrackingEvents=i.buildTrackingEvents;exports.useTrackEvent=i.useTrackEvent;exports.useTrackingEvents=i.useTrackingEvents;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.ts CHANGED
@@ -1,15 +1,11 @@
1
1
  export * from "./errors";
2
2
  export * from "./schema";
3
3
  export * from "./db";
4
- export * from "./api/users";
5
4
  export * from "./debug";
6
5
  export * from "./storage";
7
- export * from "./api/favorites";
8
- export { PropertyStore, propertyStore, type UserPropertyState, type PropertyStoreData, } from "./api/properties";
9
6
  export { UnifiedStore, Store, store } from "./stores/store";
10
- export { createZustandUnifiedStore, createUseUnitState, type ZustandUnifiedStoreState } from "./adapters/zustand-store";
7
+ export { createZustandUnifiedStore, type ZustandUnifiedStoreState } from "./adapters/zustand-store";
11
8
  export { createStructuredStore, createStructuredStoreActions, type StructuredStore, type StructuredStoreActions } from "./adapters/structured-store";
12
- export { favorites } from "./units/favorites";
13
9
  export * from "./features/units/transformers";
14
10
  export * from "./features/filters/transformers";
15
11
  export * from "./utils/dimensions";
package/dist/index.mjs CHANGED
@@ -1,131 +1,115 @@
1
- import { OpenDBError as t, SchemaMismatchError as o } from "./errors.mjs";
2
- import { ApiUserSchema as i, AppStoreDataSchema as m, FavoritesSchema as n, FiltersSchema as s, PropertySchema as p, PropertyStoreDataSchema as l, QueryParamsSchema as S, ResultsModeEnum as f, SCHEMA_VERSION as c, SortByEnum as d, TourContactDataSchema as u, UnifiedStoreDataSchema as x, UnitDataSchema as U, UnitFavoriteSchema as h, UnitSchema as y, UserPropertyStateSchema as M, UserSchema as v, UserUnitDataSchema as E, ViewedUnitSchema as g } from "./schema.mjs";
3
- import { getDB as D, resetDB as A } from "./db.mjs";
4
- import { defaultIdGenerator as T, ensureUser as R, getUserUUID as I } from "./api/users.mjs";
5
- import { debugDump as b, exportJSON as k } from "./debug.mjs";
6
- import { createORMStringStorage as V, kvGet as B, kvRemove as L, kvSet as _ } from "./storage.mjs";
7
- import { getFavoritedUnitsForProperty as H, isUnitFavorited as N, setFavoriteUnit as Q, toggleFavoriteUnit as w } from "./api/favorites.mjs";
8
- import { PropertyStore as W, propertyStore as Z } from "./api/properties.mjs";
9
- import { UnifiedStore as q, UnifiedStore as z, store as K } from "./stores/store.mjs";
10
- import { createUseUnitState as Y, createZustandUnifiedStore as $ } from "./adapters/zustand-store.mjs";
11
- import { createStructuredStore as re, createStructuredStoreActions as te } from "./adapters/structured-store.mjs";
12
- import { favorites as ae } from "./units/favorites.mjs";
13
- import { DEFAULT_PLACEHOLDER_IMAGE as me, DEFAULT_WEB_ORIGIN as ne, buildExploreUrl as se, buildImageUrl as pe, transformUnitsApiResponse as le, transformUnitsApiResponseToClient as Se, transformUnitsApiResponseToClientFilters as fe } from "./features/units/transformers.mjs";
14
- import { defaultSortParamMap as de, transformFiltersToPreferences as ue, transformFiltersToUnitsSearchParams as xe } from "./features/filters/transformers.mjs";
15
- import { dimensionToMmNumber as he, formatDimensions as ye, imperialToMm as Me, inchesToMm as ve, mmToInches as Ee, toInchesDisplay as ge } from "./utils/dimensions.mjs";
16
- import { configureValidation as De } from "./validation.mjs";
17
- import { OverviewImagesOnPropertyModel as Fe } from "./base/overviewimagesonproperty.mjs";
18
- import { AmenityImagesOnPropertyModel as Re } from "./base/amenityimagesonproperty.mjs";
19
- import { FloorPlanModel as Oe } from "./base/floorplan.mjs";
20
- import { MediaModel as ke } from "./base/media.mjs";
21
- import { PropertyModel as Ve } from "./base/property.mjs";
22
- import { PropertyHighlightModel as Le } from "./base/propertyhighlight.mjs";
23
- import { RoomModel as Ge } from "./base/room.mjs";
24
- import { StyleModel as Ne } from "./base/style.mjs";
25
- import { UnitModel as we } from "./base/unit.mjs";
26
- import { Currency as We, DeliveryStatus as Ze, ExternalService as je, FurnitureAvailability as qe, Highlights as ze, MediaType as Ke, QueueJobStatus as Xe, RenderStatus as Ye, Status as $e, UserRole as er } from "./base/enums.mjs";
27
- import { RenderedStyleModel as tr } from "./base/renderedstyle.mjs";
28
- import { PropertyAmenityModel as ar } from "./base/propertyamenity.mjs";
29
- import { FavoriteUnitModel as mr } from "./base/favoriteunit.mjs";
30
- import { UserModel as sr } from "./base/user.mjs";
31
- import { PropertyLinkModel as lr } from "./base/propertylink.mjs";
32
- import { AnalyticsProvider as fr, useAnalytics as cr } from "./features/analytics/AnalyticsProvider.mjs";
33
- import { QuestionEnumValues as ur, QuestionnaireInteractionValues as xr, SortEnumValues as Ur, buildTrackingEvents as hr, useTrackEvent as yr, useTrackingEvents as Mr } from "./features/analytics/analytics.mjs";
1
+ import { OpenDBError as o, SchemaMismatchError as t } from "./errors.mjs";
2
+ import { ApiUserSchema as m, AppStoreDataSchema as i, FiltersSchema as n, PropertySchema as s, PropertyStoreDataSchema as p, QueryParamsSchema as l, ResultsModeEnum as S, SCHEMA_VERSION as f, SortByEnum as c, TourContactDataSchema as u, UnifiedStoreDataSchema as d, UnitDataSchema as x, UnitSchema as M, UserPropertyStateSchema as h, UserSchema as U, UserUnitDataSchema as y, ViewedUnitSchema as E } from "./schema.mjs";
3
+ import { getDB as A, resetDB as D } from "./db.mjs";
4
+ import { debugDump as T, exportJSON as v } from "./debug.mjs";
5
+ import { createORMStringStorage as I, kvGet as F, kvRemove as O, kvSet as b } from "./storage.mjs";
6
+ import { UnifiedStore as C, UnifiedStore as V, store as B } from "./stores/store.mjs";
7
+ import { createZustandUnifiedStore as _ } from "./adapters/zustand-store.mjs";
8
+ import { createStructuredStore as N, createStructuredStoreActions as Q } from "./adapters/structured-store.mjs";
9
+ import { DEFAULT_PLACEHOLDER_IMAGE as w, DEFAULT_WEB_ORIGIN as J, buildExploreUrl as W, buildImageUrl as Z, transformUnitsApiResponse as j, transformUnitsApiResponseToClient as q, transformUnitsApiResponseToClientFilters as z } from "./features/units/transformers.mjs";
10
+ import { defaultSortParamMap as X, transformFiltersToPreferences as Y, transformFiltersToUnitsSearchParams as $ } from "./features/filters/transformers.mjs";
11
+ import { dimensionToMmNumber as re, formatDimensions as oe, imperialToMm as te, inchesToMm as ae, mmToInches as me, toInchesDisplay as ie } from "./utils/dimensions.mjs";
12
+ import { configureValidation as se } from "./validation.mjs";
13
+ import { OverviewImagesOnPropertyModel as le } from "./base/overviewimagesonproperty.mjs";
14
+ import { AmenityImagesOnPropertyModel as fe } from "./base/amenityimagesonproperty.mjs";
15
+ import { FloorPlanModel as ue } from "./base/floorplan.mjs";
16
+ import { MediaModel as xe } from "./base/media.mjs";
17
+ import { PropertyModel as he } from "./base/property.mjs";
18
+ import { PropertyHighlightModel as ye } from "./base/propertyhighlight.mjs";
19
+ import { RoomModel as ge } from "./base/room.mjs";
20
+ import { StyleModel as De } from "./base/style.mjs";
21
+ import { UnitModel as Te } from "./base/unit.mjs";
22
+ import { Currency as Re, DeliveryStatus as Ie, EngagementType as Fe, ExternalService as Oe, FurnitureAvailability as be, Highlights as ke, MediaType as Ce, QueueJobStatus as Ve, RenderStatus as Be, Status as Le, UserRole as _e } from "./base/enums.mjs";
23
+ import { RenderedStyleModel as Ne } from "./base/renderedstyle.mjs";
24
+ import { PropertyAmenityModel as Ge } from "./base/propertyamenity.mjs";
25
+ import { FavoriteUnitModel as Je } from "./base/favoriteunit.mjs";
26
+ import { UserModel as Ze } from "./base/user.mjs";
27
+ import { PropertyLinkModel as qe } from "./base/propertylink.mjs";
28
+ import { AnalyticsProvider as Ke, useAnalytics as Xe } from "./features/analytics/AnalyticsProvider.mjs";
29
+ import { QuestionEnumValues as $e, QuestionnaireInteractionValues as er, SortEnumValues as rr, buildTrackingEvents as or, useTrackEvent as tr, useTrackingEvents as ar } from "./features/analytics/analytics.mjs";
34
30
  export {
35
- Re as AmenityImagesOnPropertyModel,
36
- fr as AnalyticsProvider,
37
- i as ApiUserSchema,
38
- m as AppStoreDataSchema,
39
- We as Currency,
40
- me as DEFAULT_PLACEHOLDER_IMAGE,
41
- ne as DEFAULT_WEB_ORIGIN,
42
- Ze as DeliveryStatus,
43
- je as ExternalService,
44
- mr as FavoriteUnitModel,
45
- n as FavoritesSchema,
46
- s as FiltersSchema,
47
- Oe as FloorPlanModel,
48
- qe as FurnitureAvailability,
49
- ze as Highlights,
50
- ke as MediaModel,
51
- Ke as MediaType,
52
- t as OpenDBError,
53
- Fe as OverviewImagesOnPropertyModel,
54
- ar as PropertyAmenityModel,
55
- Le as PropertyHighlightModel,
56
- lr as PropertyLinkModel,
57
- Ve as PropertyModel,
58
- p as PropertySchema,
59
- W as PropertyStore,
60
- l as PropertyStoreDataSchema,
61
- S as QueryParamsSchema,
62
- ur as QuestionEnumValues,
63
- xr as QuestionnaireInteractionValues,
64
- Xe as QueueJobStatus,
65
- Ye as RenderStatus,
66
- tr as RenderedStyleModel,
67
- f as ResultsModeEnum,
68
- Ge as RoomModel,
69
- c as SCHEMA_VERSION,
70
- o as SchemaMismatchError,
71
- d as SortByEnum,
72
- Ur as SortEnumValues,
73
- $e as Status,
74
- q as Store,
75
- Ne as StyleModel,
31
+ fe as AmenityImagesOnPropertyModel,
32
+ Ke as AnalyticsProvider,
33
+ m as ApiUserSchema,
34
+ i as AppStoreDataSchema,
35
+ Re as Currency,
36
+ w as DEFAULT_PLACEHOLDER_IMAGE,
37
+ J as DEFAULT_WEB_ORIGIN,
38
+ Ie as DeliveryStatus,
39
+ Fe as EngagementType,
40
+ Oe as ExternalService,
41
+ Je as FavoriteUnitModel,
42
+ n as FiltersSchema,
43
+ ue as FloorPlanModel,
44
+ be as FurnitureAvailability,
45
+ ke as Highlights,
46
+ xe as MediaModel,
47
+ Ce as MediaType,
48
+ o as OpenDBError,
49
+ le as OverviewImagesOnPropertyModel,
50
+ Ge as PropertyAmenityModel,
51
+ ye as PropertyHighlightModel,
52
+ qe as PropertyLinkModel,
53
+ he as PropertyModel,
54
+ s as PropertySchema,
55
+ p as PropertyStoreDataSchema,
56
+ l as QueryParamsSchema,
57
+ $e as QuestionEnumValues,
58
+ er as QuestionnaireInteractionValues,
59
+ Ve as QueueJobStatus,
60
+ Be as RenderStatus,
61
+ Ne as RenderedStyleModel,
62
+ S as ResultsModeEnum,
63
+ ge as RoomModel,
64
+ f as SCHEMA_VERSION,
65
+ t as SchemaMismatchError,
66
+ c as SortByEnum,
67
+ rr as SortEnumValues,
68
+ Le as Status,
69
+ C as Store,
70
+ De as StyleModel,
76
71
  u as TourContactDataSchema,
77
- z as UnifiedStore,
78
- x as UnifiedStoreDataSchema,
79
- U as UnitDataSchema,
80
- h as UnitFavoriteSchema,
81
- we as UnitModel,
82
- y as UnitSchema,
83
- sr as UserModel,
84
- M as UserPropertyStateSchema,
85
- er as UserRole,
86
- v as UserSchema,
87
- E as UserUnitDataSchema,
88
- g as ViewedUnitSchema,
89
- se as buildExploreUrl,
90
- pe as buildImageUrl,
91
- hr as buildTrackingEvents,
92
- De as configureValidation,
93
- V as createORMStringStorage,
94
- re as createStructuredStore,
95
- te as createStructuredStoreActions,
96
- Y as createUseUnitState,
97
- $ as createZustandUnifiedStore,
98
- b as debugDump,
99
- T as defaultIdGenerator,
100
- de as defaultSortParamMap,
101
- he as dimensionToMmNumber,
102
- R as ensureUser,
103
- k as exportJSON,
104
- ae as favorites,
105
- ye as formatDimensions,
106
- D as getDB,
107
- H as getFavoritedUnitsForProperty,
108
- I as getUserUUID,
109
- Me as imperialToMm,
110
- ve as inchesToMm,
111
- N as isUnitFavorited,
112
- B as kvGet,
113
- L as kvRemove,
114
- _ as kvSet,
115
- Ee as mmToInches,
116
- Z as propertyStore,
117
- A as resetDB,
118
- Q as setFavoriteUnit,
119
- K as store,
120
- ge as toInchesDisplay,
121
- w as toggleFavoriteUnit,
122
- ue as transformFiltersToPreferences,
123
- xe as transformFiltersToUnitsSearchParams,
124
- le as transformUnitsApiResponse,
125
- Se as transformUnitsApiResponseToClient,
126
- fe as transformUnitsApiResponseToClientFilters,
127
- cr as useAnalytics,
128
- yr as useTrackEvent,
129
- Mr as useTrackingEvents
72
+ V as UnifiedStore,
73
+ d as UnifiedStoreDataSchema,
74
+ x as UnitDataSchema,
75
+ Te as UnitModel,
76
+ M as UnitSchema,
77
+ Ze as UserModel,
78
+ h as UserPropertyStateSchema,
79
+ _e as UserRole,
80
+ U as UserSchema,
81
+ y as UserUnitDataSchema,
82
+ E as ViewedUnitSchema,
83
+ W as buildExploreUrl,
84
+ Z as buildImageUrl,
85
+ or as buildTrackingEvents,
86
+ se as configureValidation,
87
+ I as createORMStringStorage,
88
+ N as createStructuredStore,
89
+ Q as createStructuredStoreActions,
90
+ _ as createZustandUnifiedStore,
91
+ T as debugDump,
92
+ X as defaultSortParamMap,
93
+ re as dimensionToMmNumber,
94
+ v as exportJSON,
95
+ oe as formatDimensions,
96
+ A as getDB,
97
+ te as imperialToMm,
98
+ ae as inchesToMm,
99
+ F as kvGet,
100
+ O as kvRemove,
101
+ b as kvSet,
102
+ me as mmToInches,
103
+ D as resetDB,
104
+ B as store,
105
+ ie as toInchesDisplay,
106
+ Y as transformFiltersToPreferences,
107
+ $ as transformFiltersToUnitsSearchParams,
108
+ j as transformUnitsApiResponse,
109
+ q as transformUnitsApiResponseToClient,
110
+ z as transformUnitsApiResponseToClientFilters,
111
+ Xe as useAnalytics,
112
+ tr as useTrackEvent,
113
+ ar as useTrackingEvents
130
114
  };
131
115
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}