founder-schema 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +138 -2
  2. package/dist/core/common.d.ts +73 -16
  3. package/dist/core/common.d.ts.map +1 -1
  4. package/dist/core/common.js +68 -14
  5. package/dist/core/common.js.map +1 -1
  6. package/dist/core/limits.d.ts +7 -0
  7. package/dist/core/limits.d.ts.map +1 -1
  8. package/dist/core/limits.js +7 -0
  9. package/dist/core/limits.js.map +1 -1
  10. package/dist/core/validation.d.ts +26 -0
  11. package/dist/core/validation.d.ts.map +1 -1
  12. package/dist/core/validation.js +26 -0
  13. package/dist/core/validation.js.map +1 -1
  14. package/dist/domains/location/india.d.ts +205 -0
  15. package/dist/domains/location/india.d.ts.map +1 -0
  16. package/dist/domains/location/india.js +1175 -0
  17. package/dist/domains/location/india.js.map +1 -0
  18. package/dist/domains/onboarding/onboarding-answers.d.ts +81 -0
  19. package/dist/domains/onboarding/onboarding-answers.d.ts.map +1 -0
  20. package/dist/domains/onboarding/onboarding-answers.js +141 -0
  21. package/dist/domains/onboarding/onboarding-answers.js.map +1 -0
  22. package/dist/domains/onboarding/onboarding.d.ts +178 -14
  23. package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
  24. package/dist/domains/onboarding/onboarding.js +215 -47
  25. package/dist/domains/onboarding/onboarding.js.map +1 -1
  26. package/dist/domains/profile/founder-profile.d.ts +94 -6
  27. package/dist/domains/profile/founder-profile.d.ts.map +1 -1
  28. package/dist/domains/profile/founder-profile.js +26 -9
  29. package/dist/domains/profile/founder-profile.js.map +1 -1
  30. package/dist/index.d.ts +6 -4
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +7 -4
  33. package/dist/index.js.map +1 -1
  34. package/package.json +1 -1
@@ -0,0 +1,1175 @@
1
+ /**
2
+ * founder-schema — Where a founder is based: India's states, union territories
3
+ * and cities (0.17.0, moved here from the web client, where the location step's
4
+ * lists lived in the screen).
5
+ *
6
+ * Founder Circle is in India for now (the user, 2026-10-18: the country is
7
+ * shown locked to India and a state and city are chosen from lists). The RULE
8
+ * is `indiaLocationSchema` below; this file is its data, read by every side:
9
+ *
10
+ * states all 28 states and 8 union territories, by their current names: a
11
+ * CLOSED list, so a state is one of these or refused (`stateUnknown`)
12
+ * cities per state, the larger cities first, the rest A to Z. A HELP, NOT A
13
+ * RULE: the profile stores the city as text and Discover matches
14
+ * text, so the list spares members the typing and the spelling
15
+ * variants, and the picker also takes a town it does not hold
16
+ * aliases older or other names a member may search by ("Bangalore" finds
17
+ * Bengaluru), and the district names the location lookup answers
18
+ * with ("Bengaluru Urban"), so the server's suggestion and a member's
19
+ * search land on the list's own spelling
20
+ *
21
+ * Written for this product from public knowledge of India's cities; no
22
+ * third-party dataset is copied in.
23
+ *
24
+ * @module founder-schema/domains/location/india
25
+ */
26
+ import { z } from 'zod';
27
+ import { emptyStringToUndefined } from '../../core/common.js';
28
+ import { CITY_MAX } from '../../core/limits.js';
29
+ import { VALIDATION_MESSAGE } from '../../core/validation.js';
30
+ /** The one country a location may be in, for now. */
31
+ export const INDIA = 'India';
32
+ /** India's international dialing code: what a phone number is shown with (the stored number has none). */
33
+ export const INDIA_DIALING_CODE = '+91';
34
+ export const INDIA_STATES = [
35
+ {
36
+ name: 'Andhra Pradesh',
37
+ cities: [
38
+ 'Visakhapatnam',
39
+ 'Vijayawada',
40
+ 'Guntur',
41
+ 'Nellore',
42
+ 'Kurnool',
43
+ 'Rajamahendravaram',
44
+ 'Tirupati',
45
+ 'Kakinada',
46
+ 'Kadapa',
47
+ 'Anantapur',
48
+ 'Amaravati',
49
+ 'Adoni',
50
+ 'Bhimavaram',
51
+ 'Chilakaluripet',
52
+ 'Chittoor',
53
+ 'Dharmavaram',
54
+ 'Eluru',
55
+ 'Gudivada',
56
+ 'Guntakal',
57
+ 'Hindupur',
58
+ 'Machilipatnam',
59
+ 'Madanapalle',
60
+ 'Nandyal',
61
+ 'Narasaraopet',
62
+ 'Ongole',
63
+ 'Proddatur',
64
+ 'Puttaparthi',
65
+ 'Srikakulam',
66
+ 'Tadepalligudem',
67
+ 'Tenali',
68
+ 'Vizianagaram',
69
+ ],
70
+ },
71
+ {
72
+ name: 'Arunachal Pradesh',
73
+ cities: [
74
+ 'Itanagar',
75
+ 'Naharlagun',
76
+ 'Pasighat',
77
+ 'Aalo',
78
+ 'Bomdila',
79
+ 'Changlang',
80
+ 'Daporijo',
81
+ 'Khonsa',
82
+ 'Namsai',
83
+ 'Roing',
84
+ 'Seppa',
85
+ 'Tawang',
86
+ 'Tezu',
87
+ 'Ziro',
88
+ ],
89
+ },
90
+ {
91
+ name: 'Assam',
92
+ cities: [
93
+ 'Guwahati',
94
+ 'Dibrugarh',
95
+ 'Silchar',
96
+ 'Jorhat',
97
+ 'Tezpur',
98
+ 'Nagaon',
99
+ 'Tinsukia',
100
+ 'Barpeta',
101
+ 'Bongaigaon',
102
+ 'Dhubri',
103
+ 'Diphu',
104
+ 'Goalpara',
105
+ 'Golaghat',
106
+ 'Haflong',
107
+ 'Hailakandi',
108
+ 'Karimganj',
109
+ 'Kokrajhar',
110
+ 'Mangaldoi',
111
+ 'Nalbari',
112
+ 'North Lakhimpur',
113
+ 'Sivasagar',
114
+ ],
115
+ },
116
+ {
117
+ name: 'Bihar',
118
+ cities: [
119
+ 'Patna',
120
+ 'Gaya Ji',
121
+ 'Bhagalpur',
122
+ 'Muzaffarpur',
123
+ 'Darbhanga',
124
+ 'Purnia',
125
+ 'Arrah',
126
+ 'Aurangabad',
127
+ 'Begusarai',
128
+ 'Bettiah',
129
+ 'Bihar Sharif',
130
+ 'Bodh Gaya',
131
+ 'Buxar',
132
+ 'Chapra',
133
+ 'Dehri',
134
+ 'Hajipur',
135
+ 'Jamalpur',
136
+ 'Jehanabad',
137
+ 'Katihar',
138
+ 'Kishanganj',
139
+ 'Motihari',
140
+ 'Munger',
141
+ 'Nawada',
142
+ 'Saharsa',
143
+ 'Sasaram',
144
+ 'Sitamarhi',
145
+ 'Siwan',
146
+ ],
147
+ },
148
+ {
149
+ name: 'Chhattisgarh',
150
+ cities: [
151
+ 'Raipur',
152
+ 'Bhilai',
153
+ 'Bilaspur',
154
+ 'Korba',
155
+ 'Durg',
156
+ 'Ambikapur',
157
+ 'Bhatapara',
158
+ 'Chirmiri',
159
+ 'Dhamtari',
160
+ 'Jagdalpur',
161
+ 'Janjgir',
162
+ 'Kanker',
163
+ 'Mahasamund',
164
+ 'Nava Raipur',
165
+ 'Raigarh',
166
+ 'Rajnandgaon',
167
+ ],
168
+ },
169
+ {
170
+ name: 'Goa',
171
+ cities: [
172
+ 'Panaji',
173
+ 'Margao',
174
+ 'Vasco da Gama',
175
+ 'Mapusa',
176
+ 'Ponda',
177
+ 'Bicholim',
178
+ 'Canacona',
179
+ 'Curchorem',
180
+ 'Pernem',
181
+ 'Porvorim',
182
+ 'Quepem',
183
+ 'Sanguem',
184
+ 'Valpoi',
185
+ ],
186
+ },
187
+ {
188
+ name: 'Gujarat',
189
+ cities: [
190
+ 'Ahmedabad',
191
+ 'Surat',
192
+ 'Vadodara',
193
+ 'Rajkot',
194
+ 'Gandhinagar',
195
+ 'Bhavnagar',
196
+ 'Jamnagar',
197
+ 'Junagadh',
198
+ 'Amreli',
199
+ 'Anand',
200
+ 'Ankleshwar',
201
+ 'Bharuch',
202
+ 'Bhuj',
203
+ 'Botad',
204
+ 'Dahod',
205
+ 'Deesa',
206
+ 'Gandhidham',
207
+ 'Godhra',
208
+ 'Himmatnagar',
209
+ 'Kalol',
210
+ 'Mehsana',
211
+ 'Morbi',
212
+ 'Nadiad',
213
+ 'Navsari',
214
+ 'Palanpur',
215
+ 'Patan',
216
+ 'Porbandar',
217
+ 'Surendranagar',
218
+ 'Valsad',
219
+ 'Vapi',
220
+ 'Veraval',
221
+ ],
222
+ },
223
+ {
224
+ name: 'Haryana',
225
+ cities: [
226
+ 'Gurugram',
227
+ 'Faridabad',
228
+ 'Panipat',
229
+ 'Ambala',
230
+ 'Karnal',
231
+ 'Rohtak',
232
+ 'Hisar',
233
+ 'Sonipat',
234
+ 'Panchkula',
235
+ 'Bahadurgarh',
236
+ 'Bhiwani',
237
+ 'Charkhi Dadri',
238
+ 'Fatehabad',
239
+ 'Hansi',
240
+ 'Jhajjar',
241
+ 'Jind',
242
+ 'Kaithal',
243
+ 'Kurukshetra',
244
+ 'Manesar',
245
+ 'Narnaul',
246
+ 'Nuh',
247
+ 'Palwal',
248
+ 'Rewari',
249
+ 'Sirsa',
250
+ 'Yamunanagar',
251
+ ],
252
+ },
253
+ {
254
+ name: 'Himachal Pradesh',
255
+ cities: [
256
+ 'Shimla',
257
+ 'Dharamshala',
258
+ 'Solan',
259
+ 'Mandi',
260
+ 'Baddi',
261
+ 'Bilaspur',
262
+ 'Chamba',
263
+ 'Hamirpur',
264
+ 'Kangra',
265
+ 'Keylong',
266
+ 'Kullu',
267
+ 'Manali',
268
+ 'Nahan',
269
+ 'Palampur',
270
+ 'Paonta Sahib',
271
+ 'Reckong Peo',
272
+ 'Sundernagar',
273
+ 'Una',
274
+ ],
275
+ },
276
+ {
277
+ name: 'Jharkhand',
278
+ cities: [
279
+ 'Ranchi',
280
+ 'Jamshedpur',
281
+ 'Dhanbad',
282
+ 'Bokaro',
283
+ 'Deoghar',
284
+ 'Hazaribagh',
285
+ 'Adityapur',
286
+ 'Chaibasa',
287
+ 'Chatra',
288
+ 'Dumka',
289
+ 'Garhwa',
290
+ 'Giridih',
291
+ 'Godda',
292
+ 'Gumla',
293
+ 'Jamtara',
294
+ 'Khunti',
295
+ 'Koderma',
296
+ 'Latehar',
297
+ 'Lohardaga',
298
+ 'Medininagar',
299
+ 'Pakur',
300
+ 'Phusro',
301
+ 'Ramgarh',
302
+ 'Sahibganj',
303
+ 'Saraikela',
304
+ 'Simdega',
305
+ ],
306
+ },
307
+ {
308
+ name: 'Karnataka',
309
+ cities: [
310
+ 'Bengaluru',
311
+ 'Mysuru',
312
+ 'Mangaluru',
313
+ 'Hubballi',
314
+ 'Dharwad',
315
+ 'Belagavi',
316
+ 'Kalaburagi',
317
+ 'Davanagere',
318
+ 'Bagalkot',
319
+ 'Ballari',
320
+ 'Bidar',
321
+ 'Chamarajanagar',
322
+ 'Chikkaballapur',
323
+ 'Chikkamagaluru',
324
+ 'Chitradurga',
325
+ 'Gadag',
326
+ 'Hassan',
327
+ 'Haveri',
328
+ 'Hosapete',
329
+ 'Karwar',
330
+ 'Kolar',
331
+ 'Koppal',
332
+ 'Madikeri',
333
+ 'Mandya',
334
+ 'Manipal',
335
+ 'Raichur',
336
+ 'Ramanagara',
337
+ 'Shivamogga',
338
+ 'Tumakuru',
339
+ 'Udupi',
340
+ 'Vijayapura',
341
+ 'Yadgir',
342
+ ],
343
+ },
344
+ {
345
+ name: 'Kerala',
346
+ cities: [
347
+ 'Thiruvananthapuram',
348
+ 'Kochi',
349
+ 'Kozhikode',
350
+ 'Thrissur',
351
+ 'Kollam',
352
+ 'Kannur',
353
+ 'Alappuzha',
354
+ 'Palakkad',
355
+ 'Kottayam',
356
+ 'Malappuram',
357
+ 'Aluva',
358
+ 'Changanassery',
359
+ 'Guruvayur',
360
+ 'Kalpetta',
361
+ 'Kanhangad',
362
+ 'Kasaragod',
363
+ 'Kayamkulam',
364
+ 'Manjeri',
365
+ 'Munnar',
366
+ 'Pathanamthitta',
367
+ 'Perinthalmanna',
368
+ 'Ponnani',
369
+ 'Thalassery',
370
+ 'Thodupuzha',
371
+ 'Tirur',
372
+ 'Vatakara',
373
+ ],
374
+ },
375
+ {
376
+ name: 'Madhya Pradesh',
377
+ cities: [
378
+ 'Indore',
379
+ 'Bhopal',
380
+ 'Jabalpur',
381
+ 'Gwalior',
382
+ 'Ujjain',
383
+ 'Sagar',
384
+ 'Dewas',
385
+ 'Satna',
386
+ 'Ratlam',
387
+ 'Rewa',
388
+ 'Agar',
389
+ 'Anuppur',
390
+ 'Ashoknagar',
391
+ 'Balaghat',
392
+ 'Barwani',
393
+ 'Betul',
394
+ 'Bhind',
395
+ 'Burhanpur',
396
+ 'Chhatarpur',
397
+ 'Chhindwara',
398
+ 'Damoh',
399
+ 'Datia',
400
+ 'Dhar',
401
+ 'Dindori',
402
+ 'Guna',
403
+ 'Itarsi',
404
+ 'Jhabua',
405
+ 'Katni',
406
+ 'Khandwa',
407
+ 'Khargone',
408
+ 'Mandla',
409
+ 'Mandsaur',
410
+ 'Morena',
411
+ 'Narmadapuram',
412
+ 'Neemuch',
413
+ 'Panna',
414
+ 'Pithampur',
415
+ 'Rajgarh',
416
+ 'Sehore',
417
+ 'Seoni',
418
+ 'Shahdol',
419
+ 'Shajapur',
420
+ 'Shivpuri',
421
+ 'Sidhi',
422
+ 'Singrauli',
423
+ 'Tikamgarh',
424
+ 'Umaria',
425
+ 'Vidisha',
426
+ ],
427
+ },
428
+ {
429
+ name: 'Maharashtra',
430
+ cities: [
431
+ 'Mumbai',
432
+ 'Pune',
433
+ 'Nagpur',
434
+ 'Thane',
435
+ 'Navi Mumbai',
436
+ 'Nashik',
437
+ 'Chhatrapati Sambhajinagar',
438
+ 'Solapur',
439
+ 'Kolhapur',
440
+ 'Pimpri-Chinchwad',
441
+ 'Ahilyanagar',
442
+ 'Akola',
443
+ 'Alibag',
444
+ 'Amravati',
445
+ 'Baramati',
446
+ 'Beed',
447
+ 'Bhandara',
448
+ 'Bhiwandi',
449
+ 'Buldhana',
450
+ 'Chandrapur',
451
+ 'Dharashiv',
452
+ 'Dhule',
453
+ 'Gadchiroli',
454
+ 'Gondia',
455
+ 'Hingoli',
456
+ 'Ichalkaranji',
457
+ 'Jalgaon',
458
+ 'Jalna',
459
+ 'Kalyan',
460
+ 'Latur',
461
+ 'Lonavala',
462
+ 'Malegaon',
463
+ 'Mira-Bhayandar',
464
+ 'Nanded',
465
+ 'Nandurbar',
466
+ 'Palghar',
467
+ 'Panvel',
468
+ 'Parbhani',
469
+ 'Ratnagiri',
470
+ 'Sangli',
471
+ 'Satara',
472
+ 'Ulhasnagar',
473
+ 'Vasai-Virar',
474
+ 'Wardha',
475
+ 'Washim',
476
+ 'Yavatmal',
477
+ ],
478
+ },
479
+ {
480
+ name: 'Manipur',
481
+ cities: [
482
+ 'Imphal',
483
+ 'Thoubal',
484
+ 'Bishnupur',
485
+ 'Chandel',
486
+ 'Churachandpur',
487
+ 'Jiribam',
488
+ 'Kakching',
489
+ 'Moreh',
490
+ 'Senapati',
491
+ 'Tamenglong',
492
+ 'Ukhrul',
493
+ ],
494
+ },
495
+ {
496
+ name: 'Meghalaya',
497
+ cities: [
498
+ 'Shillong',
499
+ 'Tura',
500
+ 'Jowai',
501
+ 'Baghmara',
502
+ 'Mairang',
503
+ 'Nongpoh',
504
+ 'Nongstoin',
505
+ 'Resubelpara',
506
+ 'Sohra',
507
+ 'Williamnagar',
508
+ ],
509
+ },
510
+ {
511
+ name: 'Mizoram',
512
+ cities: [
513
+ 'Aizawl',
514
+ 'Lunglei',
515
+ 'Champhai',
516
+ 'Hnahthial',
517
+ 'Khawzawl',
518
+ 'Kolasib',
519
+ 'Lawngtlai',
520
+ 'Mamit',
521
+ 'Saitual',
522
+ 'Serchhip',
523
+ 'Siaha',
524
+ ],
525
+ },
526
+ {
527
+ name: 'Nagaland',
528
+ cities: [
529
+ 'Kohima',
530
+ 'Dimapur',
531
+ 'Mokokchung',
532
+ 'Chumoukedima',
533
+ 'Kiphire',
534
+ 'Longleng',
535
+ 'Mon',
536
+ 'Niuland',
537
+ 'Noklak',
538
+ 'Peren',
539
+ 'Phek',
540
+ 'Shamator',
541
+ 'Tseminyu',
542
+ 'Tuensang',
543
+ 'Wokha',
544
+ 'Zunheboto',
545
+ ],
546
+ },
547
+ {
548
+ name: 'Odisha',
549
+ aliases: ['Orissa'],
550
+ cities: [
551
+ 'Bhubaneswar',
552
+ 'Cuttack',
553
+ 'Rourkela',
554
+ 'Berhampur',
555
+ 'Sambalpur',
556
+ 'Puri',
557
+ 'Balasore',
558
+ 'Angul',
559
+ 'Balangir',
560
+ 'Bargarh',
561
+ 'Baripada',
562
+ 'Bhadrak',
563
+ 'Bhawanipatna',
564
+ 'Dhenkanal',
565
+ 'Jagatsinghpur',
566
+ 'Jajpur',
567
+ 'Jeypore',
568
+ 'Jharsuguda',
569
+ 'Kendrapara',
570
+ 'Keonjhar',
571
+ 'Khordha',
572
+ 'Koraput',
573
+ 'Malkangiri',
574
+ 'Nabarangpur',
575
+ 'Nayagarh',
576
+ 'Paradip',
577
+ 'Phulbani',
578
+ 'Rayagada',
579
+ 'Sundargarh',
580
+ 'Talcher',
581
+ ],
582
+ },
583
+ {
584
+ name: 'Punjab',
585
+ cities: [
586
+ 'Ludhiana',
587
+ 'Amritsar',
588
+ 'Jalandhar',
589
+ 'Patiala',
590
+ 'Mohali',
591
+ 'Bathinda',
592
+ 'Abohar',
593
+ 'Barnala',
594
+ 'Batala',
595
+ 'Faridkot',
596
+ 'Fazilka',
597
+ 'Firozpur',
598
+ 'Gurdaspur',
599
+ 'Hoshiarpur',
600
+ 'Kapurthala',
601
+ 'Khanna',
602
+ 'Malerkotla',
603
+ 'Mansa',
604
+ 'Moga',
605
+ 'Muktsar',
606
+ 'Nawanshahr',
607
+ 'Pathankot',
608
+ 'Phagwara',
609
+ 'Rajpura',
610
+ 'Rupnagar',
611
+ 'Sangrur',
612
+ 'Tarn Taran',
613
+ 'Zirakpur',
614
+ ],
615
+ },
616
+ {
617
+ name: 'Rajasthan',
618
+ cities: [
619
+ 'Jaipur',
620
+ 'Jodhpur',
621
+ 'Kota',
622
+ 'Udaipur',
623
+ 'Bikaner',
624
+ 'Ajmer',
625
+ 'Alwar',
626
+ 'Bhilwara',
627
+ 'Banswara',
628
+ 'Baran',
629
+ 'Barmer',
630
+ 'Beawar',
631
+ 'Bharatpur',
632
+ 'Bhiwadi',
633
+ 'Bundi',
634
+ 'Chittorgarh',
635
+ 'Churu',
636
+ 'Dausa',
637
+ 'Dhaulpur',
638
+ 'Dungarpur',
639
+ 'Gangapur City',
640
+ 'Hanumangarh',
641
+ 'Jaisalmer',
642
+ 'Jalore',
643
+ 'Jhalawar',
644
+ 'Jhunjhunu',
645
+ 'Karauli',
646
+ 'Kishangarh',
647
+ 'Mount Abu',
648
+ 'Nagaur',
649
+ 'Neemrana',
650
+ 'Pali',
651
+ 'Pratapgarh',
652
+ 'Rajsamand',
653
+ 'Sawai Madhopur',
654
+ 'Sikar',
655
+ 'Sirohi',
656
+ 'Sri Ganganagar',
657
+ 'Tonk',
658
+ ],
659
+ },
660
+ {
661
+ name: 'Sikkim',
662
+ cities: [
663
+ 'Gangtok',
664
+ 'Namchi',
665
+ 'Gyalshing',
666
+ 'Jorethang',
667
+ 'Mangan',
668
+ 'Pakyong',
669
+ 'Rangpo',
670
+ 'Ravangla',
671
+ 'Singtam',
672
+ 'Soreng',
673
+ ],
674
+ },
675
+ {
676
+ name: 'Tamil Nadu',
677
+ cities: [
678
+ 'Chennai',
679
+ 'Coimbatore',
680
+ 'Madurai',
681
+ 'Tiruchirappalli',
682
+ 'Salem',
683
+ 'Tiruppur',
684
+ 'Erode',
685
+ 'Tirunelveli',
686
+ 'Vellore',
687
+ 'Hosur',
688
+ 'Ambur',
689
+ 'Ariyalur',
690
+ 'Chengalpattu',
691
+ 'Cuddalore',
692
+ 'Dharmapuri',
693
+ 'Dindigul',
694
+ 'Gudiyatham',
695
+ 'Kallakurichi',
696
+ 'Kanchipuram',
697
+ 'Kanyakumari',
698
+ 'Karaikudi',
699
+ 'Karur',
700
+ 'Krishnagiri',
701
+ 'Kumbakonam',
702
+ 'Mayiladuthurai',
703
+ 'Nagapattinam',
704
+ 'Nagercoil',
705
+ 'Namakkal',
706
+ 'Ooty',
707
+ 'Perambalur',
708
+ 'Pollachi',
709
+ 'Pudukkottai',
710
+ 'Rajapalayam',
711
+ 'Ramanathapuram',
712
+ 'Ranipet',
713
+ 'Sivaganga',
714
+ 'Sivakasi',
715
+ 'Tenkasi',
716
+ 'Thanjavur',
717
+ 'Theni',
718
+ 'Thoothukudi',
719
+ 'Tirupattur',
720
+ 'Tiruvallur',
721
+ 'Tiruvannamalai',
722
+ 'Tiruvarur',
723
+ 'Viluppuram',
724
+ 'Virudhunagar',
725
+ ],
726
+ },
727
+ {
728
+ name: 'Telangana',
729
+ cities: [
730
+ 'Hyderabad',
731
+ 'Warangal',
732
+ 'Nizamabad',
733
+ 'Karimnagar',
734
+ 'Khammam',
735
+ 'Secunderabad',
736
+ 'Adilabad',
737
+ 'Bhongir',
738
+ 'Jagtial',
739
+ 'Kamareddy',
740
+ 'Kothagudem',
741
+ 'Mahbubnagar',
742
+ 'Mancherial',
743
+ 'Medak',
744
+ 'Miryalaguda',
745
+ 'Nalgonda',
746
+ 'Nirmal',
747
+ 'Ramagundam',
748
+ 'Sangareddy',
749
+ 'Siddipet',
750
+ 'Suryapet',
751
+ 'Vikarabad',
752
+ 'Wanaparthy',
753
+ 'Zahirabad',
754
+ ],
755
+ },
756
+ {
757
+ name: 'Tripura',
758
+ cities: [
759
+ 'Agartala',
760
+ 'Dharmanagar',
761
+ 'Udaipur',
762
+ 'Ambassa',
763
+ 'Belonia',
764
+ 'Bishalgarh',
765
+ 'Kailashahar',
766
+ 'Kamalpur',
767
+ 'Khowai',
768
+ 'Sabroom',
769
+ 'Sonamura',
770
+ 'Teliamura',
771
+ ],
772
+ },
773
+ {
774
+ name: 'Uttar Pradesh',
775
+ cities: [
776
+ 'Lucknow',
777
+ 'Kanpur',
778
+ 'Noida',
779
+ 'Ghaziabad',
780
+ 'Agra',
781
+ 'Varanasi',
782
+ 'Prayagraj',
783
+ 'Meerut',
784
+ 'Greater Noida',
785
+ 'Bareilly',
786
+ 'Aligarh',
787
+ 'Moradabad',
788
+ 'Gorakhpur',
789
+ 'Amroha',
790
+ 'Ayodhya',
791
+ 'Azamgarh',
792
+ 'Bahraich',
793
+ 'Ballia',
794
+ 'Banda',
795
+ 'Barabanki',
796
+ 'Basti',
797
+ 'Bulandshahr',
798
+ 'Chandausi',
799
+ 'Deoria',
800
+ 'Etah',
801
+ 'Etawah',
802
+ 'Farrukhabad',
803
+ 'Fatehpur',
804
+ 'Firozabad',
805
+ 'Gonda',
806
+ 'Hapur',
807
+ 'Hardoi',
808
+ 'Hathras',
809
+ 'Jaunpur',
810
+ 'Jhansi',
811
+ 'Kasganj',
812
+ 'Lakhimpur',
813
+ 'Lalitpur',
814
+ 'Mainpuri',
815
+ 'Mathura',
816
+ 'Mau',
817
+ 'Mirzapur',
818
+ 'Modinagar',
819
+ 'Muzaffarnagar',
820
+ 'Orai',
821
+ 'Pilibhit',
822
+ 'Raebareli',
823
+ 'Rampur',
824
+ 'Saharanpur',
825
+ 'Sambhal',
826
+ 'Shahjahanpur',
827
+ 'Sitapur',
828
+ 'Sultanpur',
829
+ 'Unnao',
830
+ 'Vrindavan',
831
+ ],
832
+ },
833
+ {
834
+ name: 'Uttarakhand',
835
+ aliases: ['Uttaranchal'],
836
+ cities: [
837
+ 'Dehradun',
838
+ 'Haridwar',
839
+ 'Roorkee',
840
+ 'Haldwani',
841
+ 'Rudrapur',
842
+ 'Kashipur',
843
+ 'Rishikesh',
844
+ 'Almora',
845
+ 'Bageshwar',
846
+ 'Champawat',
847
+ 'Gopeshwar',
848
+ 'Khatima',
849
+ 'Kotdwar',
850
+ 'Mussoorie',
851
+ 'Nainital',
852
+ 'Pauri',
853
+ 'Pithoragarh',
854
+ 'Ramnagar',
855
+ 'Rudraprayag',
856
+ 'Sitarganj',
857
+ 'Srinagar',
858
+ 'Tehri',
859
+ 'Uttarkashi',
860
+ ],
861
+ },
862
+ {
863
+ name: 'West Bengal',
864
+ cities: [
865
+ 'Kolkata',
866
+ 'Howrah',
867
+ 'Siliguri',
868
+ 'Durgapur',
869
+ 'Asansol',
870
+ 'Bardhaman',
871
+ 'Bidhannagar',
872
+ 'New Town',
873
+ 'Kharagpur',
874
+ 'Haldia',
875
+ 'Alipurduar',
876
+ 'Baharampur',
877
+ 'Balurghat',
878
+ 'Bally',
879
+ 'Bankura',
880
+ 'Barasat',
881
+ 'Barrackpore',
882
+ 'Bolpur',
883
+ 'Chandannagar',
884
+ 'Chinsurah',
885
+ 'Contai',
886
+ 'Cooch Behar',
887
+ 'Darjeeling',
888
+ 'Digha',
889
+ 'Habra',
890
+ 'Jalpaiguri',
891
+ 'Kalimpong',
892
+ 'Kalyani',
893
+ 'Krishnanagar',
894
+ 'Malda',
895
+ 'Medinipur',
896
+ 'Purulia',
897
+ 'Raiganj',
898
+ 'Serampore',
899
+ 'Shantipur',
900
+ 'Tamluk',
901
+ ],
902
+ },
903
+ {
904
+ name: 'Andaman and Nicobar Islands',
905
+ aliases: ['Andaman & Nicobar Islands', 'Andaman and Nicobar'],
906
+ cities: [
907
+ 'Sri Vijaya Puram',
908
+ 'Campbell Bay',
909
+ 'Car Nicobar',
910
+ 'Diglipur',
911
+ 'Mayabunder',
912
+ 'Rangat',
913
+ 'Shaheed Dweep',
914
+ 'Swaraj Dweep',
915
+ ],
916
+ },
917
+ { name: 'Chandigarh', cities: ['Chandigarh'] },
918
+ {
919
+ name: 'Dadra and Nagar Haveli and Daman and Diu',
920
+ aliases: [
921
+ 'The Dadra and Nagar Haveli and Daman and Diu',
922
+ 'Dadra and Nagar Haveli',
923
+ 'Daman and Diu',
924
+ ],
925
+ cities: ['Silvassa', 'Daman', 'Diu'],
926
+ },
927
+ {
928
+ name: 'Delhi',
929
+ aliases: ['NCT of Delhi', 'National Capital Territory of Delhi'],
930
+ cities: ['Delhi', 'New Delhi'],
931
+ },
932
+ {
933
+ name: 'Jammu and Kashmir',
934
+ aliases: ['Jammu & Kashmir', 'J&K'],
935
+ cities: [
936
+ 'Srinagar',
937
+ 'Jammu',
938
+ 'Anantnag',
939
+ 'Bandipora',
940
+ 'Baramulla',
941
+ 'Budgam',
942
+ 'Doda',
943
+ 'Ganderbal',
944
+ 'Kathua',
945
+ 'Katra',
946
+ 'Kishtwar',
947
+ 'Kulgam',
948
+ 'Kupwara',
949
+ 'Poonch',
950
+ 'Pulwama',
951
+ 'Rajouri',
952
+ 'Ramban',
953
+ 'Reasi',
954
+ 'Samba',
955
+ 'Shopian',
956
+ 'Sopore',
957
+ 'Udhampur',
958
+ ],
959
+ },
960
+ { name: 'Ladakh', cities: ['Leh', 'Kargil'] },
961
+ {
962
+ name: 'Lakshadweep',
963
+ cities: ['Kavaratti', 'Agatti', 'Amini', 'Andrott', 'Kadmat', 'Kalpeni', 'Minicoy'],
964
+ },
965
+ {
966
+ name: 'Puducherry',
967
+ aliases: ['Pondicherry'],
968
+ cities: ['Puducherry', 'Karaikal', 'Mahe', 'Yanam'],
969
+ },
970
+ ];
971
+ /**
972
+ * Other names a city is searched by, keyed by the list's name: the older name,
973
+ * the district name the location lookup answers with, or both. A search for
974
+ * any of them shows the city as the list writes it.
975
+ */
976
+ export const CITY_ALIASES = {
977
+ Bengaluru: ['Bangalore', 'Bengaluru Urban', 'Bangalore Urban'],
978
+ Mumbai: ['Bombay', 'Mumbai Suburban', 'Mumbai City'],
979
+ Chennai: ['Madras'],
980
+ Kolkata: ['Calcutta'],
981
+ Gurugram: ['Gurgaon'],
982
+ Noida: ['Gautam Buddha Nagar'],
983
+ Pune: ['Poona'],
984
+ Vadodara: ['Baroda'],
985
+ Visakhapatnam: ['Vizag', 'Vishakhapatnam'],
986
+ Mysuru: ['Mysore'],
987
+ Mangaluru: ['Mangalore', 'Dakshina Kannada'],
988
+ Hubballi: ['Hubli'],
989
+ Belagavi: ['Belgaum'],
990
+ Kalaburagi: ['Gulbarga'],
991
+ Vijayapura: ['Bijapur'],
992
+ Shivamogga: ['Shimoga'],
993
+ Tumakuru: ['Tumkur'],
994
+ Ballari: ['Bellary'],
995
+ Davanagere: ['Davangere'],
996
+ Chikkamagaluru: ['Chikmagalur'],
997
+ Hosapete: ['Hospet', 'Vijayanagara'],
998
+ Thiruvananthapuram: ['Trivandrum'],
999
+ Kochi: ['Cochin', 'Ernakulam'],
1000
+ Kozhikode: ['Calicut'],
1001
+ Thrissur: ['Trichur'],
1002
+ Alappuzha: ['Alleppey'],
1003
+ Kollam: ['Quilon'],
1004
+ Kannur: ['Cannanore'],
1005
+ Palakkad: ['Palghat'],
1006
+ Prayagraj: ['Allahabad'],
1007
+ Ayodhya: ['Faizabad'],
1008
+ Varanasi: ['Banaras', 'Benares', 'Kashi'],
1009
+ Tiruchirappalli: ['Trichy'],
1010
+ Thoothukudi: ['Tuticorin'],
1011
+ Ooty: ['Udhagamandalam', 'The Nilgiris'],
1012
+ Kanchipuram: ['Kanchi'],
1013
+ Puducherry: ['Pondicherry'],
1014
+ 'Chhatrapati Sambhajinagar': ['Aurangabad'],
1015
+ Ahilyanagar: ['Ahmednagar'],
1016
+ Dharashiv: ['Osmanabad'],
1017
+ Nashik: ['Nasik'],
1018
+ 'Pimpri-Chinchwad': ['Pimpri', 'Chinchwad', 'PCMC'],
1019
+ 'Vasai-Virar': ['Vasai', 'Virar'],
1020
+ Narmadapuram: ['Hoshangabad'],
1021
+ Medininagar: ['Daltonganj'],
1022
+ Bokaro: ['Bokaro Steel City'],
1023
+ Rajamahendravaram: ['Rajahmundry', 'Rajahmahendravaram'],
1024
+ Anantapur: ['Anantapuramu'],
1025
+ Kadapa: ['Cuddapah'],
1026
+ Berhampur: ['Brahmapur'],
1027
+ Balasore: ['Baleswar'],
1028
+ Keonjhar: ['Kendujhar'],
1029
+ Bidhannagar: ['Salt Lake'],
1030
+ Malda: ['English Bazar'],
1031
+ Baharampur: ['Berhampore'],
1032
+ Bardhaman: ['Burdwan', 'Purba Bardhaman'],
1033
+ Sohra: ['Cherrapunji'],
1034
+ 'Sri Vijaya Puram': ['Port Blair', 'South Andaman'],
1035
+ Mohali: ['SAS Nagar', 'Sahibzada Ajit Singh Nagar'],
1036
+ Kurukshetra: ['Thanesar'],
1037
+ Gyalshing: ['Geyzing'],
1038
+ Siaha: ['Saiha'],
1039
+ Aalo: ['Along'],
1040
+ 'Gaya Ji': ['Gaya'],
1041
+ Karimganj: ['Sribhumi'],
1042
+ // District names the location lookup answers with, for the city people name.
1043
+ Guwahati: ['Kamrup Metropolitan'],
1044
+ Vijayawada: ['NTR'],
1045
+ Hyderabad: ['Rangareddy', 'Ranga Reddy', 'Medchal Malkajgiri'],
1046
+ Panaji: ['Panjim', 'North Goa'],
1047
+ Margao: ['Madgaon', 'South Goa'],
1048
+ Shillong: ['East Khasi Hills'],
1049
+ Itanagar: ['Papum Pare'],
1050
+ Agartala: ['West Tripura'],
1051
+ Imphal: ['Imphal West', 'Imphal East'],
1052
+ Jamshedpur: ['East Singhbhum', 'Purbi Singhbhum'],
1053
+ Rudrapur: ['Udham Singh Nagar'],
1054
+ Asansol: ['Paschim Bardhaman'],
1055
+ Delhi: [
1056
+ 'Central Delhi',
1057
+ 'East Delhi',
1058
+ 'North Delhi',
1059
+ 'North East Delhi',
1060
+ 'North West Delhi',
1061
+ 'Shahdara',
1062
+ 'South Delhi',
1063
+ 'South East Delhi',
1064
+ 'South West Delhi',
1065
+ 'West Delhi',
1066
+ ],
1067
+ // Spellings people also use.
1068
+ Chapra: ['Chhapra'],
1069
+ Dhaulpur: ['Dholpur'],
1070
+ Mangaldoi: ['Mangaldai'],
1071
+ Rupnagar: ['Ropar'],
1072
+ 'Shaheed Dweep': ['Neil Island'],
1073
+ 'Swaraj Dweep': ['Havelock'],
1074
+ };
1075
+ const key = (text) => text
1076
+ .toLowerCase()
1077
+ .replace(/[.\s&]+/g, ' ')
1078
+ .replace(/\band\b/g, ' ')
1079
+ .replace(/\s+/g, ' ')
1080
+ .trim();
1081
+ /**
1082
+ * The state a name means, by its own name or an alias, ignoring case, dots,
1083
+ * "&" and "and" ("JAMMU AND KASHMIR", "Jammu & Kashmir"). `undefined` when it
1084
+ * is not an Indian state or union territory this list knows.
1085
+ */
1086
+ export function findIndiaState(name) {
1087
+ if (!name)
1088
+ return undefined;
1089
+ const wanted = key(name);
1090
+ if (!wanted)
1091
+ return undefined;
1092
+ return INDIA_STATES.find((state) => key(state.name) === wanted || state.aliases?.some((a) => key(a) === wanted));
1093
+ }
1094
+ /**
1095
+ * The names the state picker lists, in its order (states A to Z, then union
1096
+ * territories A to Z): the closed list a written state is checked against.
1097
+ */
1098
+ export const INDIA_STATE_NAMES = INDIA_STATES.map((state) => state.name);
1099
+ /** The state pickers' other names, by the list's name: "Orissa" finds Odisha. */
1100
+ export const STATE_ALIASES = Object.fromEntries(INDIA_STATES.filter((state) => state.aliases).map((state) => [state.name, state.aliases ?? []]));
1101
+ /**
1102
+ * A city as the list writes it, when `name` is one of the state's cities or
1103
+ * another name of one ("Bengaluru Urban", the location lookup's district, is
1104
+ * Bengaluru). Anything else comes back as it was given: never guessed.
1105
+ */
1106
+ export function listedCityName(state, name) {
1107
+ if (!state)
1108
+ return name;
1109
+ const wanted = key(name);
1110
+ const city = state.cities.find((c) => key(c) === wanted || CITY_ALIASES[c]?.some((alias) => key(alias) === wanted));
1111
+ return city ?? name;
1112
+ }
1113
+ /**
1114
+ * A place as the list writes it, from however it arrived: a member's older
1115
+ * draft ("karnataka"), the location lookup ("Bengaluru Urban" in "KARNATAKA"),
1116
+ * or another client. The state becomes the list's name when the list knows it
1117
+ * (else stays as given, trimmed, for the rule to refuse); the city becomes the
1118
+ * list's spelling when it is one of that state's cities or another name of
1119
+ * one, and is never guessed otherwise; the country is India.
1120
+ *
1121
+ * The SERVER applies it to every location it stores, so Discover's exact match
1122
+ * finds "Bengaluru" however a client spelled it; a client applies it when it
1123
+ * restores or suggests a place, so the member sees the spelling they will get.
1124
+ */
1125
+ export function canonicalIndiaLocation(place) {
1126
+ const listed = findIndiaState(place.state);
1127
+ return {
1128
+ city: listedCityName(listed, place.city.trim()),
1129
+ state: listed?.name ?? (place.state ?? '').trim(),
1130
+ country: INDIA,
1131
+ };
1132
+ }
1133
+ // ─── The rule ────────────────────────────────────────────────────────────────
1134
+ /**
1135
+ * A location as it is WRITTEN (0.17.0): onboarding's finish, the Me tab's
1136
+ * personal details, and the server's own suggestion. India only, one of its
1137
+ * states and union territories, and a city of any name within it.
1138
+ *
1139
+ * Until 0.17.0 the schema took any country and any state text while the web
1140
+ * locked the country to India and chose the state from this list, so another
1141
+ * client could store what no screen can show. The read side keeps
1142
+ * `locationSchema`: a location stored before this rule is still read as it is.
1143
+ *
1144
+ * The STATE is required: every Indian city has one, and the picker lists a
1145
+ * state's cities only once it is chosen. It is read the way people and the
1146
+ * location lookup write it ("KARNATAKA", "Orissa", "Jammu & Kashmir" are the
1147
+ * list's Karnataka, Odisha, Jammu and Kashmir: `findIndiaState`), so any client
1148
+ * may send another spelling and the list's name is what is kept. Left empty it
1149
+ * is `stateRequired`; one the list does not know is `stateUnknown`.
1150
+ */
1151
+ export const indiaLocationSchema = z.object({
1152
+ city: z.string().trim().min(1).max(CITY_MAX),
1153
+ state: z.preprocess((value) => {
1154
+ const given = emptyStringToUndefined(value);
1155
+ return typeof given === 'string' ? (findIndiaState(given)?.name ?? given) : given;
1156
+ }, z.enum(INDIA_STATE_NAMES, {
1157
+ error: (issue) => issue.input === undefined
1158
+ ? VALIDATION_MESSAGE.stateRequired
1159
+ : VALIDATION_MESSAGE.stateUnknown,
1160
+ })),
1161
+ country: z.literal(INDIA),
1162
+ });
1163
+ /**
1164
+ * The city these coordinates look like, for the member to CONFIRM, or `null`
1165
+ * when the lookup could not place them confidently (or they are outside India,
1166
+ * whose area data is all there is). A suggestion, never a write: only what the
1167
+ * member then submits becomes their location.
1168
+ *
1169
+ * In the WRITE shape (0.17.0): the server names the state and city the way
1170
+ * this list does (`findIndiaState`, `listedCityName`: the lookup's "Bengaluru
1171
+ * Urban" is Bengaluru), so what it suggests is what the member could have
1172
+ * picked, and saving it unchanged can never be refused.
1173
+ */
1174
+ export const suggestedLocationSchema = indiaLocationSchema.nullable();
1175
+ //# sourceMappingURL=india.js.map