aidol 0.9.0 → 0.10.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.
- package/dist/aidol-B3rN8pTx.js +2 -0
- package/dist/aidol-B3rN8pTx.js.map +1 -0
- package/dist/{aidol-CUuPOg12.mjs → aidol-CkuXlU8t.mjs} +14 -9
- package/dist/aidol-CkuXlU8t.mjs.map +1 -0
- package/dist/client.cjs +1 -1
- package/dist/client.cjs.map +1 -1
- package/dist/client.js +241 -240
- package/dist/client.js.map +1 -1
- package/dist/components/landing/HeroSection.d.ts +2 -1
- package/dist/components/landing/HeroSection.d.ts.map +1 -1
- package/dist/i18n/translations.d.ts +72 -0
- package/dist/i18n/translations.d.ts.map +1 -1
- package/dist/index.cjs +36 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +298 -233
- package/dist/index.js.map +1 -1
- package/dist/repositories/AIdolRepository.d.ts +21 -8
- package/dist/repositories/AIdolRepository.d.ts.map +1 -1
- package/dist/repositories/CompanionRepository.d.ts +25 -5
- package/dist/repositories/CompanionRepository.d.ts.map +1 -1
- package/dist/repositories/index.d.ts +0 -1
- package/dist/repositories/index.d.ts.map +1 -1
- package/dist/schemas/aidol.d.ts +20 -0
- package/dist/schemas/aidol.d.ts.map +1 -1
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/aidol-CUuPOg12.mjs.map +0 -1
- package/dist/aidol-CqvBUwd0.js +0 -2
- package/dist/aidol-CqvBUwd0.js.map +0 -1
- package/dist/repositories/MockCompanionRepository.d.ts +0 -13
- package/dist/repositories/MockCompanionRepository.d.ts.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("zod"),r=e.z.object({id:e.z.string(),name:e.z.string().nullable(),email:e.z.string().nullable().optional(),greeting:e.z.string().nullable().optional(),concept:e.z.string().nullable().optional(),profileImageUrl:e.z.string().nullable(),createdAt:e.z.string(),updatedAt:e.z.string()}),i=e.z.object({id:e.z.string()}),a=e.z.object({name:e.z.string().min(1,"creation.memberNameRequired"),personality:e.z.string().optional(),systemPrompt:e.z.string().optional()}),o=e.z.object({groupName:e.z.string().min(1,"creation.groupNameRequired"),concept:e.z.string().optional(),profileImageUrl:e.z.string().min(1,"creation.emblemRequired"),members:e.z.array(a).min(1,"creation.memberRequired").refine(t=>t.some(n=>n.name.trim()!==""),{message:"creation.memberRequired"})});e.z.object({prompt:e.z.string().max(200)});const m=e.z.object({imageUrl:e.z.string(),width:e.z.number(),height:e.z.number(),format:e.z.string()}),s=e.z.object({data:m});exports.aidolCreateResponseSchema=i;exports.aidolSchema=r;exports.groupCreationSchema=o;exports.imageGenerationResponseSchema=s;
|
|
2
|
+
//# sourceMappingURL=aidol-B3rN8pTx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aidol-B3rN8pTx.js","sources":["../src/schemas/aidol.ts"],"sourcesContent":["/**\n * AIdol (group) schemas\n * Matches backend aidol/schemas/aidol.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nimport type { Companion } from \"./companion\";\n\n/**\n * AIdol schema (public fields only, excludes claim_token)\n * Matches backend AIdolPublic (aidol/schemas/aidol.py)\n */\nexport const aidolSchema = z.object({\n id: z.string(),\n name: z.string().nullable(),\n email: z.string().nullable().optional(),\n greeting: z.string().nullable().optional(),\n concept: z.string().nullable().optional(),\n profileImageUrl: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdol extends BaseRecord {\n id: string;\n name: string | null;\n email?: string | null;\n greeting?: string | null;\n concept?: string | null;\n profileImageUrl: string | null;\n createdAt: string;\n updatedAt: string;\n companions?: Companion[];\n}\n\n/**\n * Schema for AIdol creation response (backend returns only id)\n */\nexport const aidolCreateResponseSchema = z.object({\n id: z.string(),\n});\n\nexport type AIdolCreateResponse = z.infer<typeof aidolCreateResponseSchema>;\n\n/**\n * Schema for creating an AIdol group\n * claimToken is optional for anonymous ownership verification\n */\nexport interface AIdolCreate {\n name: string;\n concept?: string | null;\n profileImageUrl: string;\n claimToken?: string | null;\n}\n\n/**\n * Schema for updating an AIdol group\n */\nexport interface AIdolUpdate {\n name?: string;\n concept?: string | null;\n profileImageUrl?: string | null;\n}\n\n/**\n * Member draft schema for group creation form\n */\nexport const memberDraftSchema = z.object({\n name: z.string().min(1, \"creation.memberNameRequired\"),\n personality: z.string().optional(),\n systemPrompt: z.string().optional(),\n});\n\nexport type MemberDraft = z.infer<typeof memberDraftSchema>;\n\n/**\n * Group creation form schema (react-hook-form + zod)\n */\nexport const groupCreationSchema = z.object({\n groupName: z.string().min(1, \"creation.groupNameRequired\"),\n concept: z.string().optional(),\n profileImageUrl: z.string().min(1, \"creation.emblemRequired\"),\n members: z\n .array(memberDraftSchema)\n .min(1, \"creation.memberRequired\")\n .refine((members) => members.some((m) => m.name.trim() !== \"\"), {\n message: \"creation.memberRequired\",\n }),\n});\n\nexport type GroupCreationFormData = z.infer<typeof groupCreationSchema>;\n\n// ---------------------------------------------------------------------------\n// Image Generation\n// ---------------------------------------------------------------------------\n\n/**\n * Request schema for image generation\n */\nexport const imageGenerationRequestSchema = z.object({\n prompt: z.string().max(200),\n});\n\nexport type ImageGenerationRequest = z.infer<\n typeof imageGenerationRequestSchema\n>;\n\n/**\n * Image generation result data\n */\nexport const imageGenerationDataSchema = z.object({\n imageUrl: z.string(),\n width: z.number(),\n height: z.number(),\n format: z.string(),\n});\n\nexport type ImageGenerationData = z.infer<typeof imageGenerationDataSchema>;\n\n/**\n * Response schema for image generation\n */\nexport const imageGenerationResponseSchema = z.object({\n data: imageGenerationDataSchema,\n});\n\nexport type ImageGenerationResponse = z.infer<\n typeof imageGenerationResponseSchema\n>;\n"],"names":["aidolSchema","z","aidolCreateResponseSchema","memberDraftSchema","groupCreationSchema","members","m","imageGenerationDataSchema","imageGenerationResponseSchema"],"mappings":"oCAcaA,EAAcC,EAAAA,EAAE,OAAO,CAClC,GAAIA,EAAAA,EAAE,OAAA,EACN,KAAMA,EAAAA,EAAE,OAAA,EAAS,SAAA,EACjB,MAAOA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA,EAC7B,SAAUA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA,EAChC,QAASA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA,EAC/B,gBAAiBA,EAAAA,EAAE,OAAA,EAAS,SAAA,EAC5B,UAAWA,EAAAA,EAAE,OAAA,EACb,UAAWA,EAAAA,EAAE,OAAA,CACf,CAAC,EAiBYC,EAA4BD,EAAAA,EAAE,OAAO,CAChD,GAAIA,EAAAA,EAAE,OAAA,CACR,CAAC,EA2BYE,EAAoBF,EAAAA,EAAE,OAAO,CACxC,KAAMA,EAAAA,EAAE,OAAA,EAAS,IAAI,EAAG,6BAA6B,EACrD,YAAaA,EAAAA,EAAE,OAAA,EAAS,SAAA,EACxB,aAAcA,EAAAA,EAAE,OAAA,EAAS,SAAA,CAC3B,CAAC,EAOYG,EAAsBH,EAAAA,EAAE,OAAO,CAC1C,UAAWA,EAAAA,EAAE,OAAA,EAAS,IAAI,EAAG,4BAA4B,EACzD,QAASA,EAAAA,EAAE,OAAA,EAAS,SAAA,EACpB,gBAAiBA,EAAAA,EAAE,OAAA,EAAS,IAAI,EAAG,yBAAyB,EAC5D,QAASA,EAAAA,EACN,MAAME,CAAiB,EACvB,IAAI,EAAG,yBAAyB,EAChC,OAAQE,GAAYA,EAAQ,KAAMC,GAAMA,EAAE,KAAK,SAAW,EAAE,EAAG,CAC9D,QAAS,yBAAA,CACV,CACL,CAAC,EAW2CL,EAAAA,EAAE,OAAO,CACnD,OAAQA,EAAAA,EAAE,OAAA,EAAS,IAAI,GAAG,CAC5B,CAAC,EASM,MAAMM,EAA4BN,EAAAA,EAAE,OAAO,CAChD,SAAUA,EAAAA,EAAE,OAAA,EACZ,MAAOA,EAAAA,EAAE,OAAA,EACT,OAAQA,EAAAA,EAAE,OAAA,EACV,OAAQA,EAAAA,EAAE,OAAA,CACZ,CAAC,EAOYO,EAAgCP,EAAAA,EAAE,OAAO,CACpD,KAAMM,CACR,CAAC"}
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
|
-
const
|
|
2
|
+
const o = e.object({
|
|
3
3
|
id: e.string(),
|
|
4
4
|
name: e.string().nullable(),
|
|
5
|
+
email: e.string().nullable().optional(),
|
|
6
|
+
greeting: e.string().nullable().optional(),
|
|
5
7
|
concept: e.string().nullable().optional(),
|
|
6
8
|
profileImageUrl: e.string().nullable(),
|
|
7
9
|
createdAt: e.string(),
|
|
8
10
|
updatedAt: e.string()
|
|
9
|
-
}),
|
|
11
|
+
}), m = e.object({
|
|
12
|
+
id: e.string()
|
|
13
|
+
}), r = e.object({
|
|
10
14
|
name: e.string().min(1, "creation.memberNameRequired"),
|
|
11
15
|
personality: e.string().optional(),
|
|
12
16
|
systemPrompt: e.string().optional()
|
|
13
|
-
}),
|
|
17
|
+
}), s = e.object({
|
|
14
18
|
groupName: e.string().min(1, "creation.groupNameRequired"),
|
|
15
19
|
concept: e.string().optional(),
|
|
16
20
|
profileImageUrl: e.string().min(1, "creation.emblemRequired"),
|
|
17
|
-
members: e.array(
|
|
21
|
+
members: e.array(r).min(1, "creation.memberRequired").refine((t) => t.some((n) => n.name.trim() !== ""), {
|
|
18
22
|
message: "creation.memberRequired"
|
|
19
23
|
})
|
|
20
24
|
});
|
|
@@ -26,12 +30,13 @@ const i = e.object({
|
|
|
26
30
|
width: e.number(),
|
|
27
31
|
height: e.number(),
|
|
28
32
|
format: e.string()
|
|
29
|
-
}),
|
|
33
|
+
}), g = e.object({
|
|
30
34
|
data: i
|
|
31
35
|
});
|
|
32
36
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
s as
|
|
37
|
+
o as a,
|
|
38
|
+
m as b,
|
|
39
|
+
s as g,
|
|
40
|
+
g as i
|
|
36
41
|
};
|
|
37
|
-
//# sourceMappingURL=aidol-
|
|
42
|
+
//# sourceMappingURL=aidol-CkuXlU8t.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aidol-CkuXlU8t.mjs","sources":["../src/schemas/aidol.ts"],"sourcesContent":["/**\n * AIdol (group) schemas\n * Matches backend aidol/schemas/aidol.py definitions (Public only for MVP)\n */\n\nimport type { BaseRecord } from \"@aioia/core\";\nimport { z } from \"zod\";\n\nimport type { Companion } from \"./companion\";\n\n/**\n * AIdol schema (public fields only, excludes claim_token)\n * Matches backend AIdolPublic (aidol/schemas/aidol.py)\n */\nexport const aidolSchema = z.object({\n id: z.string(),\n name: z.string().nullable(),\n email: z.string().nullable().optional(),\n greeting: z.string().nullable().optional(),\n concept: z.string().nullable().optional(),\n profileImageUrl: z.string().nullable(),\n createdAt: z.string(),\n updatedAt: z.string(),\n});\n\nexport interface AIdol extends BaseRecord {\n id: string;\n name: string | null;\n email?: string | null;\n greeting?: string | null;\n concept?: string | null;\n profileImageUrl: string | null;\n createdAt: string;\n updatedAt: string;\n companions?: Companion[];\n}\n\n/**\n * Schema for AIdol creation response (backend returns only id)\n */\nexport const aidolCreateResponseSchema = z.object({\n id: z.string(),\n});\n\nexport type AIdolCreateResponse = z.infer<typeof aidolCreateResponseSchema>;\n\n/**\n * Schema for creating an AIdol group\n * claimToken is optional for anonymous ownership verification\n */\nexport interface AIdolCreate {\n name: string;\n concept?: string | null;\n profileImageUrl: string;\n claimToken?: string | null;\n}\n\n/**\n * Schema for updating an AIdol group\n */\nexport interface AIdolUpdate {\n name?: string;\n concept?: string | null;\n profileImageUrl?: string | null;\n}\n\n/**\n * Member draft schema for group creation form\n */\nexport const memberDraftSchema = z.object({\n name: z.string().min(1, \"creation.memberNameRequired\"),\n personality: z.string().optional(),\n systemPrompt: z.string().optional(),\n});\n\nexport type MemberDraft = z.infer<typeof memberDraftSchema>;\n\n/**\n * Group creation form schema (react-hook-form + zod)\n */\nexport const groupCreationSchema = z.object({\n groupName: z.string().min(1, \"creation.groupNameRequired\"),\n concept: z.string().optional(),\n profileImageUrl: z.string().min(1, \"creation.emblemRequired\"),\n members: z\n .array(memberDraftSchema)\n .min(1, \"creation.memberRequired\")\n .refine((members) => members.some((m) => m.name.trim() !== \"\"), {\n message: \"creation.memberRequired\",\n }),\n});\n\nexport type GroupCreationFormData = z.infer<typeof groupCreationSchema>;\n\n// ---------------------------------------------------------------------------\n// Image Generation\n// ---------------------------------------------------------------------------\n\n/**\n * Request schema for image generation\n */\nexport const imageGenerationRequestSchema = z.object({\n prompt: z.string().max(200),\n});\n\nexport type ImageGenerationRequest = z.infer<\n typeof imageGenerationRequestSchema\n>;\n\n/**\n * Image generation result data\n */\nexport const imageGenerationDataSchema = z.object({\n imageUrl: z.string(),\n width: z.number(),\n height: z.number(),\n format: z.string(),\n});\n\nexport type ImageGenerationData = z.infer<typeof imageGenerationDataSchema>;\n\n/**\n * Response schema for image generation\n */\nexport const imageGenerationResponseSchema = z.object({\n data: imageGenerationDataSchema,\n});\n\nexport type ImageGenerationResponse = z.infer<\n typeof imageGenerationResponseSchema\n>;\n"],"names":["aidolSchema","z","aidolCreateResponseSchema","memberDraftSchema","groupCreationSchema","members","m","imageGenerationDataSchema","imageGenerationResponseSchema"],"mappings":";AAcO,MAAMA,IAAcC,EAAE,OAAO;AAAA,EAClC,IAAIA,EAAE,OAAA;AAAA,EACN,MAAMA,EAAE,OAAA,EAAS,SAAA;AAAA,EACjB,OAAOA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC7B,UAAUA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAChC,SAASA,EAAE,OAAA,EAAS,SAAA,EAAW,SAAA;AAAA,EAC/B,iBAAiBA,EAAE,OAAA,EAAS,SAAA;AAAA,EAC5B,WAAWA,EAAE,OAAA;AAAA,EACb,WAAWA,EAAE,OAAA;AACf,CAAC,GAiBYC,IAA4BD,EAAE,OAAO;AAAA,EAChD,IAAIA,EAAE,OAAA;AACR,CAAC,GA2BYE,IAAoBF,EAAE,OAAO;AAAA,EACxC,MAAMA,EAAE,OAAA,EAAS,IAAI,GAAG,6BAA6B;AAAA,EACrD,aAAaA,EAAE,OAAA,EAAS,SAAA;AAAA,EACxB,cAAcA,EAAE,OAAA,EAAS,SAAA;AAC3B,CAAC,GAOYG,IAAsBH,EAAE,OAAO;AAAA,EAC1C,WAAWA,EAAE,OAAA,EAAS,IAAI,GAAG,4BAA4B;AAAA,EACzD,SAASA,EAAE,OAAA,EAAS,SAAA;AAAA,EACpB,iBAAiBA,EAAE,OAAA,EAAS,IAAI,GAAG,yBAAyB;AAAA,EAC5D,SAASA,EACN,MAAME,CAAiB,EACvB,IAAI,GAAG,yBAAyB,EAChC,OAAO,CAACE,MAAYA,EAAQ,KAAK,CAACC,MAAMA,EAAE,KAAK,WAAW,EAAE,GAAG;AAAA,IAC9D,SAAS;AAAA,EAAA,CACV;AACL,CAAC;AAW2CL,EAAE,OAAO;AAAA,EACnD,QAAQA,EAAE,OAAA,EAAS,IAAI,GAAG;AAC5B,CAAC;AASM,MAAMM,IAA4BN,EAAE,OAAO;AAAA,EAChD,UAAUA,EAAE,OAAA;AAAA,EACZ,OAAOA,EAAE,OAAA;AAAA,EACT,QAAQA,EAAE,OAAA;AAAA,EACV,QAAQA,EAAE,OAAA;AACZ,CAAC,GAOYO,IAAgCP,EAAE,OAAO;AAAA,EACpD,MAAMM;AACR,CAAC;"}
|
package/dist/client.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react-i18next"),M=require("next/image"),g=require("react"),O=require("@hookform/resolvers"),E=require("react-hook-form"),Q=require("./aidol-CqvBUwd0.js"),v=require("framer-motion");function ee(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,l.get?l:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const m=ee(g);function G(t){var s,a,l="";if(typeof t=="string"||typeof t=="number")l+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(s=0;s<r;s++)t[s]&&(a=G(t[s]))&&(l&&(l+=" "),l+=a)}else for(a in t)t[a]&&(l&&(l+=" "),l+=a);return l}function j(){for(var t,s,a=0,l="",r=arguments.length;a<r;a++)(t=arguments[a])&&(s=G(t))&&(l&&(l+=" "),l+=s);return l}function te({title:t,titleId:s,...a},l){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":s},a),t?m.createElement("title",{id:s},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const ae=m.forwardRef(te);function se({title:t,titleId:s,...a},l){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":s},a),t?m.createElement("title",{id:s},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const le=m.forwardRef(se);function ne({title:t,titleId:s,...a},l){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":s},a),t?m.createElement("title",{id:s},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const re=m.forwardRef(ne);function oe({title:t,titleId:s,...a},l){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":s},a),t?m.createElement("title",{id:s},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const ie=m.forwardRef(oe);function ce({title:t,titleId:s,...a},l){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":s},a),t?m.createElement("title",{id:s},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))}const de=m.forwardRef(ce);function me({title:t,titleId:s,...a},l){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":s},a),t?m.createElement("title",{id:s},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))}const ue=m.forwardRef(me),pe={default:"size-profile",profile:"size-full"};function k({url:t,alt:s,variant:a="default"}){return e.jsx("div",{className:j("border-base-300 bg-base-200 relative overflow-hidden rounded-lg border",pe[a]),children:t?e.jsx(M,{src:t,alt:s,fill:!0,draggable:!1,className:"size-full object-cover"}):e.jsx("div",{className:"flex size-full items-center justify-center",children:e.jsx(ue,{className:"text-base-content/50 size-1/2"})})})}function B({companion:t,variant:s="grade",onClick:a}){const{t:l}=u.useTranslation(),o=t.aidolId!==null&&s==="grade",n=a&&!o,i=s==="position"?"opacity-30":o?"opacity-20":"opacity-60",c=s==="position"?t.position?l(`aidol:position.${t.position}`):l("aidol:position.unassigned"):l("companion.grade",{grade:t.grade});return e.jsxs("div",{className:j("h-card max-w-card border-base-300 relative isolate w-full overflow-hidden rounded-lg border",n&&"cursor-pointer"),onClick:n?a:void 0,role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:n?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a())}:void 0,children:[e.jsx("div",{className:"absolute inset-0",children:e.jsx(k,{url:t.profilePictureUrl,alt:t.name??"",variant:"profile"})}),o&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute inset-0 z-20 bg-black/40 backdrop-blur-sm"}),e.jsx("div",{className:"absolute top-4 left-4 z-20",children:e.jsx("span",{className:"bg-base-100 text-body-s text-base-content w-fit rounded-lg px-2 py-1",children:l("companion.signed")})})]}),e.jsx("div",{className:j("absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-black to-transparent",i)}),e.jsxs("div",{className:"absolute inset-x-4 bottom-4 z-10 flex flex-col gap-2",children:[e.jsx("span",{className:"text-title-s text-white",children:t.name}),e.jsx("span",{className:"text-body-s w-fit rounded-lg bg-black px-2 py-1 text-white",children:c})]})]})}function xe({companions:t,onCompanionClick:s}){const{t:a}=u.useTranslation();return e.jsxs("div",{className:"mt-8",children:[e.jsx("h2",{className:"text-title-l mb-4 font-semibold",children:a("aidol:aidol.members")}),t&&t.length>0?e.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:t.map(l=>e.jsx(B,{companion:l,onClick:()=>s(l.id)},l.id))}):e.jsx("p",{className:"text-base-content/50 text-center",children:a("aidol:aidol.noMembers")})]})}function be({aidol:t}){return e.jsxs("div",{className:"flex flex-col items-center gap-4 py-8 text-center",children:[e.jsx("div",{className:"bg-base-200 relative size-32 overflow-hidden rounded-full",children:t.profileImageUrl?e.jsx(M,{src:t.profileImageUrl,alt:t.name??"Group",fill:!0,className:"object-cover"}):e.jsx("div",{className:"from-primary/20 to-secondary/20 flex size-full items-center justify-center bg-gradient-to-br",children:e.jsx(de,{className:"text-base-content/50 size-16"})})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-display-s text-base-content font-bold",children:t.name}),t.concept&&e.jsx("p",{className:"text-body-l text-base-content/70 mt-2",children:t.concept})]})]})}function U({onClick:t,isLoading:s}){const{t:a}=u.useTranslation();return e.jsx("button",{onClick:t,disabled:s,className:"btn btn-neutral text-label-l text-neutral-content h-16 min-w-48",children:s?e.jsx("span",{className:"loading loading-spinner loading-sm"}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"size-5"}),a("aidol:companion.addMember")]})})}const I=["vocal","dance","rap","visual","stamina","charm"];function fe({stats:t}){const{t:s}=u.useTranslation(),a=260,l=a/2,r=70,o=100,n=(d,x)=>{const b=Math.PI*2*d/6-Math.PI/3,y=x/100*r;return{x:l+y*Math.cos(b),y:l+y*Math.sin(b)}},i=d=>{const x=Math.PI*2*d/6-Math.PI/3;return{x:l+o*Math.cos(x),y:l+o*Math.sin(x)}},c=I.map((d,x)=>n(x,t[d])),p=c.map(d=>`${d.x},${d.y}`).join(" "),w=[20,40,60,80,100];return e.jsx("div",{className:"flex items-center justify-center",children:e.jsxs("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,children:[w.map(d=>{const b=I.map((y,P)=>n(P,d)).map(y=>`${y.x},${y.y}`).join(" ");return e.jsx("polygon",{points:b,fill:"none",stroke:"currentColor",strokeWidth:"1",className:"text-base-300"},d)}),I.map((d,x)=>{const b=n(x,100);return e.jsx("line",{x1:l,y1:l,x2:b.x,y2:b.y,stroke:"currentColor",strokeWidth:"1",className:"text-base-300"},x)}),e.jsx("polygon",{points:p,fill:"currentColor",fillOpacity:"0.3",stroke:"currentColor",strokeWidth:"2",className:"text-secondary"}),c.map((d,x)=>e.jsx("circle",{cx:d.x,cy:d.y,r:"3",fill:"currentColor",className:"text-secondary"},x)),I.map((d,x)=>{const b=i(x);return e.jsxs("g",{children:[e.jsx("text",{x:b.x,y:b.y-8,textAnchor:"middle",dominantBaseline:"middle",className:"text-label-l fill-base-content font-medium",children:s(`aidol:casting.abilities.${d}`)}),e.jsx("text",{x:b.x,y:b.y+10,textAnchor:"middle",dominantBaseline:"middle",className:"text-label-l fill-secondary font-medium",children:t[d]})]},d)})]})})}function he({companion:t,showBiography:s=!0,showStats:a=!0}){const{t:l}=u.useTranslation(),{name:r,profilePictureUrl:o,grade:n,mbti:i,biography:c,stats:p}=t;return e.jsxs("div",{className:"flex flex-col items-center gap-6",children:[e.jsx(k,{url:o??null,alt:r??""}),e.jsxs("div",{className:"flex flex-col gap-2 self-start",children:[e.jsx("h2",{className:"text-title-s text-base-content font-semibold",children:r??""}),(n||i)&&e.jsxs("div",{className:"flex gap-2",children:[n&&e.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:l("aidol:companion.grade",{grade:n})}),i&&e.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:i})]})]}),s&&c&&e.jsx("p",{className:"text-body-s text-base-content",children:c}),a&&p&&e.jsx(fe,{stats:p})]})}const T=g.forwardRef(({placeholder:t,maxLength:s=500,charCount:a,...l},r)=>{const{t:o}=u.useTranslation();return e.jsxs("div",{className:"w-full",children:[e.jsx("textarea",{ref:r,placeholder:t??o("aidol:companion.promptPlaceholder"),maxLength:s,className:"textarea bg-base-100 text-base-content placeholder:text-base-content/50 focus:border-primary h-32 w-full resize-none focus:outline-hidden",...l}),e.jsxs("div",{className:"text-label-s text-base-content/50 mt-1 text-right",children:[a??0,"/",s]})]})});T.displayName="PromptInput";function ge({value:t,onChange:s}){const{t:a}=u.useTranslation();return e.jsx("input",{type:"text",value:t,onChange:l=>s(l.target.value),placeholder:a("aidol:companionCreate.complete.bioPlaceholder"),className:"input w-full bg-white text-black"})}function je({title:t,rightContent:s}){return e.jsxs("header",{className:"h-header bg-base-100 flex shrink-0 items-center justify-between px-6 py-4",children:[e.jsx("h1",{className:"text-headline-s text-base-content",children:t}),s&&e.jsx("div",{className:"flex max-w-40 shrink-0 items-center",children:s})]})}function F({progress:t}){const s=Math.min(100,Math.max(0,t));return e.jsx("div",{className:"bg-primary/20 h-3 w-full overflow-hidden rounded-full",children:e.jsx("div",{className:"bg-primary h-full rounded-full transition-all duration-500 ease-out",style:{width:`${s}%`}})})}function ye({step:t,totalSteps:s,children:a,bottomButton:l}){const{t:r}=u.useTranslation(),o=t/s*100;return e.jsxs("div",{className:"flex min-h-dvh flex-col",children:[e.jsx(je,{title:r("aidol:companionCreate.title")}),e.jsx("div",{className:"px-6 py-4",children:e.jsx(F,{progress:o})}),e.jsx("div",{className:"flex flex-1 flex-col gap-6 p-6",children:a}),e.jsx("div",{className:"sticky bottom-0 p-6",children:l})]})}const Ne=/[!@#$%^&*()+=[\]{}|\\;:'",.<>?/`~_]/g;function ve({value:t,onChange:s,maxLength:a=10}){const{t:l}=u.useTranslation();return e.jsx("input",{type:"text",value:t,onChange:r=>s(r.target.value.replace(Ne,"").slice(0,a)),placeholder:l("aidol:companionCreate.complete.namePlaceholder"),className:"input w-full bg-white text-black"})}const R=g.forwardRef(({options:t,...s},a)=>{const{t:l}=u.useTranslation();return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsx("label",{className:"label",children:l("aidol:creation.concept")}),e.jsxs("select",{ref:a,className:"select bg-base-100 text-base-content w-full",...s,children:[e.jsx("option",{value:"",children:l("aidol:creation.selectConcept")}),t.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))]})]})});R.displayName="ConceptSelector";function we({value:t,onChange:s}){const{t:a}=u.useTranslation(),l=[{gender:"female",label:a("aidol:companionCreate.gender.female")},{gender:"male",label:a("aidol:companionCreate.gender.male")}];return e.jsx("div",{className:"flex gap-4",children:l.map(({gender:r,label:o})=>e.jsx("button",{type:"button",onClick:()=>s(r),className:j("text-label-l flex-1 rounded-lg border px-6 py-3 transition-colors",t===r?"border-primary text-primary bg-white":"border-base-300 text-base-content bg-white"),children:o},r))})}function _({onGenerate:t,isGenerating:s,disabled:a}){const{t:l}=u.useTranslation(),[r,o]=g.useState(""),n=()=>{r.trim()&&t(r)},i=c=>{c.key==="Enter"&&r.trim()&&!s&&!a&&(c.preventDefault(),n())};return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:r,onChange:c=>o(c.target.value),onKeyDown:i,placeholder:l("aidol:creation.emblemPromptPlaceholder"),maxLength:200,className:"input flex-1",disabled:a||s,"data-testid":"emblem-prompt-input"}),e.jsx("button",{type:"button",onClick:n,disabled:a||s||!r.trim(),className:"btn btn-secondary","data-testid":"emblem-generate-button",children:s?e.jsx("span",{className:"loading loading-spinner loading-sm"}):l("aidol:creation.generate")})]}),s&&e.jsx("div",{className:"mt-2",children:e.jsx("progress",{className:"progress w-full"})})]})}var Ce=function(t,s){for(var a={};t.length;){var l=t[0],r=l.code,o=l.message,n=l.path.join(".");if(!a[n])if("unionErrors"in l){var i=l.unionErrors[0].errors[0];a[n]={message:i.message,type:i.code}}else a[n]={message:o,type:r};if("unionErrors"in l&&l.unionErrors.forEach(function(w){return w.errors.forEach(function(d){return t.push(d)})}),s){var c=a[n].types,p=c&&c[l.code];a[n]=E.appendErrors(n,s,a,r,p?[].concat(p,l.message):l.message)}t.shift()}return a},ke=function(t,s,a){return a===void 0&&(a={}),function(l,r,o){try{return Promise.resolve((function(n,i){try{var c=Promise.resolve(t[a.mode==="sync"?"parse":"parseAsync"](l,s)).then(function(p){return o.shouldUseNativeValidation&&O.validateFieldsNatively({},o),{errors:{},values:a.raw?l:p}})}catch(p){return i(p)}return c&&c.then?c.then(void 0,i):c})(0,function(n){if((function(i){return Array.isArray(i?.errors)})(n))return{values:{},errors:O.toNestErrors(Ce(n.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw n}))}catch(n){return Promise.reject(n)}}};const A=g.forwardRef(({error:t,...s},a)=>{const{t:l}=u.useTranslation();return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsx("label",{className:"label",children:l("aidol:creation.groupName")}),e.jsx("input",{ref:a,type:"text",placeholder:l("aidol:creation.groupNamePlaceholder"),className:j("input bg-base-100 text-base-content placeholder:text-base-content/50 w-full",t&&"input-error"),...s}),t&&e.jsx("span",{className:"text-label-m text-error",children:t})]})});A.displayName="GroupNameInput";const $=g.forwardRef(({error:t,...s},a)=>{const{t:l}=u.useTranslation();return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsx("label",{className:"label",children:l("aidol:creation.memberName")}),e.jsx("input",{ref:a,type:"text",placeholder:l("aidol:creation.memberNamePlaceholder"),className:j("input bg-base-100 text-base-content placeholder:text-base-content/50 w-full",t&&"input-error"),...s}),t&&e.jsx("span",{className:"text-label-m text-error",children:t})]})});$.displayName="MemberNameInput";function Z({value:t,onChange:s,options:a}){const{t:l}=u.useTranslation();return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsx("label",{className:"label",children:l("aidol:creation.personality")}),e.jsx("div",{className:"space-y-2",children:a.map(r=>e.jsxs("label",{className:j("flex cursor-pointer items-start gap-3 rounded-lg border p-4 transition-colors",t===r.value?"border-primary bg-primary/10":"border-base-300 hover:border-base-content/30"),children:[e.jsx("input",{type:"radio",name:"personality",value:r.value,checked:t===r.value,onChange:o=>s(o.target.value),className:"radio-primary radio mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base-content font-medium",children:r.label}),r.description&&e.jsx("div",{className:"text-body-s text-base-content/70 mt-1",children:r.description})]})]},r.value))})]})}function q({currentStep:t,totalSteps:s,labels:a}){return e.jsx("ul",{className:"steps w-full",children:Array.from({length:s},(l,r)=>{const o=r+1,n=o<t,i=o===t;return e.jsx("li",{className:j("step",(n||i)&&"step-primary"),children:a?.[r]??""},o)})})}const Pe=["cute","cool","elegant","powerful"],Se=["cheerful","cool","tsundere","gentle"];function Ie({onSubmit:t,onComplete:s,onGenerateImage:a,isLoading:l,isGeneratingImage:r,isCompleted:o}){const{t:n}=u.useTranslation(),[i,c]=g.useState(o?3:1),p=g.useMemo(()=>Pe.map(f=>({value:f,label:n(`aidol:creation.concepts.${f}`)})),[n]),w=g.useMemo(()=>Se.map(f=>({value:f,label:n(`aidol:creation.personalities.${f}.label`),description:n(`aidol:creation.personalities.${f}.description`)})),[n]),{register:d,control:x,handleSubmit:b,trigger:y,watch:P,setValue:D,formState:{errors:N}}=E.useForm({resolver:ke(Q.groupCreationSchema),defaultValues:{groupName:"",concept:"",profileImageUrl:"",members:[{name:"",personality:"",systemPrompt:""}]}}),L=P("profileImageUrl"),{fields:H,append:K}=E.useFieldArray({control:x,name:"members"}),z=P("members"),V=async f=>{const h=await a(f);h&&D("profileImageUrl",h)},Y=async()=>{await y(["groupName","profileImageUrl"])&&c(2)},X=b(async f=>{const h=f.members.filter(S=>S.name.trim());await t({...f,members:h}),c(3)}),J=()=>{K({name:"",personality:"",systemPrompt:""})};return e.jsx("main",{className:"bg-base-100 flex min-h-dvh w-full flex-col items-center px-6 py-20",children:e.jsxs("div",{className:"w-full max-w-lg",children:[e.jsx(q,{currentStep:i,totalSteps:3,labels:[n("aidol:creation.step1"),n("aidol:creation.step2"),n("aidol:creation.step3")]}),e.jsxs("div",{className:"mt-8",children:[i===1&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h2",{className:"text-display-s font-bold",children:n("aidol:creation.step1Title")}),e.jsx(A,{...d("groupName"),error:N.groupName?.message?n(N.groupName.message,{ns:"aidol"}):void 0}),e.jsx(R,{...d("concept"),options:p}),e.jsxs("fieldset",{className:"fieldset",children:[e.jsx("label",{className:"label",children:n("aidol:creation.emblem")}),e.jsx(_,{onGenerate:V,isGenerating:r,disabled:l}),L&&e.jsx("div",{className:"mt-2 flex justify-center",children:e.jsx(k,{url:L,alt:n("aidol:creation.emblem")})}),N.profileImageUrl?.message&&e.jsx("p",{className:"text-label-m text-error mt-1",children:n(N.profileImageUrl.message,{ns:"aidol"})})]}),e.jsx("button",{type:"button",onClick:Y,disabled:!L,className:"btn btn-primary w-full",children:n("aidol:creation.next")})]}),i===2&&e.jsxs("form",{onSubmit:X,className:"space-y-6",children:[e.jsx("h2",{className:"text-display-s font-bold",children:n("aidol:creation.step2Title")}),H.map((f,h)=>e.jsxs("div",{className:"border-base-300 space-y-4 rounded-lg border p-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(k,{url:null,alt:z[h]?.name??""}),e.jsx("div",{className:"flex-1",children:e.jsx($,{...d(`members.${h}.name`),error:N.members?.[h]?.name?.message?n(N.members?.[h]?.name?.message??"",{ns:"aidol"}):void 0})})]}),e.jsx(E.Controller,{name:`members.${h}.personality`,control:x,render:({field:S})=>e.jsx(Z,{value:S.value??"",onChange:S.onChange,options:w})}),e.jsx(T,{...d(`members.${h}.systemPrompt`),charCount:z[h]?.systemPrompt?.length??0})]},f.id)),e.jsx(U,{onClick:J,isLoading:!1}),N.members?.root?.message&&e.jsx("p",{className:"text-error text-center",children:n(N.members.root.message,{ns:"aidol"})}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("button",{type:"button",onClick:()=>c(1),className:"btn btn-ghost flex-1",disabled:l,children:n("aidol:creation.back")}),e.jsx("button",{type:"submit",className:"btn btn-primary flex-1",disabled:l,children:l?e.jsx("span",{className:"loading loading-spinner loading-sm"}):n("aidol:creation.create")})]})]}),i===3&&e.jsxs("div",{className:"space-y-6 text-center",children:[e.jsx("div",{className:"text-display-l",children:"🎉"}),e.jsx("h2",{className:"text-display-s font-bold",children:n("aidol:creation.completeTitle")}),e.jsx("p",{className:"text-body-l text-base-content/70",children:n("aidol:creation.completeDescription")}),e.jsx("button",{onClick:s,className:"btn btn-primary w-full",children:n("aidol:creation.viewProfile")})]})]})]})})}function W({label:t,leftLabel:s,rightLabel:a,value:l,onChange:r}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-label-l text-base-content",children:t}),e.jsx("input",{type:"range",min:1,max:10,step:1,value:l,onChange:o=>r(Number(o.target.value)),className:"range range-primary range-sm"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-label-m text-primary",children:s}),e.jsx("span",{className:"text-label-m text-primary",children:a})]})]})}function Ee({values:t,onChange:s}){const{t:a}=u.useTranslation(),l=[{key:"energy",label:a("aidol:companionCreate.personality.energy"),leftLabel:a("aidol:companionCreate.personality.energyLeft"),rightLabel:a("aidol:companionCreate.personality.energyRight")},{key:"perception",label:a("aidol:companionCreate.personality.perception"),leftLabel:a("aidol:companionCreate.personality.perceptionLeft"),rightLabel:a("aidol:companionCreate.personality.perceptionRight")},{key:"judgment",label:a("aidol:companionCreate.personality.judgment"),leftLabel:a("aidol:companionCreate.personality.judgmentLeft"),rightLabel:a("aidol:companionCreate.personality.judgmentRight")},{key:"lifestyle",label:a("aidol:companionCreate.personality.lifestyle"),leftLabel:a("aidol:companionCreate.personality.lifestyleLeft"),rightLabel:a("aidol:companionCreate.personality.lifestyleRight")}];return e.jsx("div",{className:"flex flex-col gap-6",children:l.map(({key:r,label:o,leftLabel:n,rightLabel:i})=>e.jsx(W,{label:o,leftLabel:n,rightLabel:i,value:t[r],onChange:c=>s({...t,[r]:c})},r))})}function Me({prompt:t,onPromptChange:s,onGenerate:a,isGenerating:l,imageUrl:r,hasGenerated:o}){const{t:n}=u.useTranslation();return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("input",{type:"text",value:t,onChange:i=>s(i.target.value),placeholder:n("aidol:companionCreate.image.promptPlaceholder"),className:"input w-full bg-white text-black"}),e.jsxs("button",{type:"button",onClick:a,disabled:l||!t.trim(),className:"btn btn-primary w-full",children:[l&&e.jsx("span",{className:"loading loading-spinner"}),n(o?"aidol:companionCreate.image.regenerate":"aidol:companionCreate.image.generate")]}),r?e.jsx("div",{className:"relative aspect-square w-full overflow-hidden rounded-lg",children:e.jsx(M,{src:r,alt:"Generated profile",fill:!0,className:"object-cover"})}):e.jsxs("div",{className:"border-base-300 bg-base-100 flex aspect-square w-full flex-col items-center justify-center gap-4 rounded-lg border",children:[e.jsx(ie,{className:"text-neutral size-6"}),e.jsx("p",{className:"text-body-m text-neutral text-center whitespace-pre-line",children:n("aidol:companionCreate.image.placeholder")})]})]})}function Le({step:t,title:s,children:a}){const l=t.toString().padStart(2,"0");return e.jsxs("div",{className:"bg-base-200 flex w-full flex-col gap-6 rounded-lg p-6",children:[e.jsx("span",{className:"text-title-s text-primary",children:l}),e.jsx("h3",{className:"text-title-s text-base-content",children:s}),e.jsx("div",{className:"flex flex-col gap-4",children:a})]})}const C={initial:{y:40,opacity:0},animate:{y:0,opacity:1,transition:{duration:.8,ease:"easeInOut"}}},Te={animate:{transition:{staggerChildren:.15}}};function Re({onGetStarted:t}){const{t:s}=u.useTranslation();return e.jsx("section",{className:"bg-base-100 flex min-h-screen w-full flex-col items-center px-6 pt-12 pb-8",children:e.jsxs(v.motion.div,{variants:Te,initial:"initial",animate:"animate",className:"flex w-full flex-col items-center text-center",children:[e.jsx(v.motion.div,{variants:C,className:"mb-6",children:e.jsx(M,{src:"/images/logo.svg",alt:"AIdol",width:92,height:28,priority:!0})}),e.jsxs(v.motion.h1,{variants:C,className:"text-display-s mb-3",children:[s("aidol:landing.hero.title.line1"),e.jsx("br",{}),s("aidol:landing.hero.title.line2")]}),e.jsxs(v.motion.div,{variants:C,className:"text-headline-s text-base-content mb-8 flex flex-col",children:[e.jsx("p",{className:"text-neutral",children:s("aidol:landing.hero.line1")}),e.jsx("p",{className:"text-neutral",children:s("aidol:landing.hero.line2")}),e.jsx("p",{children:s("aidol:landing.hero.line3")}),e.jsx("p",{children:s("aidol:landing.hero.line4")})]}),e.jsx(v.motion.div,{variants:C,className:"bg-base-200 relative mb-6 aspect-[345/368] w-full overflow-hidden rounded-lg"}),e.jsx(v.motion.div,{variants:C,className:"w-full",children:e.jsx("button",{onClick:t,className:"btn btn-primary btn-lg text-label-l w-full rounded-lg",children:s("aidol:landing.hero.cta")})})]})})}function Ae({isOpen:t,onClose:s,children:a,action:l}){const{t:r}=u.useTranslation();return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 z-40 h-screen w-screen bg-black/80",onClick:s}),e.jsx("div",{className:"max-w-mobile fixed inset-0 z-50 mx-auto flex items-center justify-center p-6",onClick:s,children:e.jsxs("div",{className:"bg-base-200 relative flex max-h-170 min-h-90 w-full flex-col gap-6 overflow-hidden rounded-lg p-6",onClick:o=>o.stopPropagation(),children:[e.jsx("div",{className:"scrollbar-hide flex-1 overflow-y-auto pb-20",children:a}),e.jsxs("div",{className:"absolute inset-x-6 bottom-6 flex shrink-0 gap-4",children:[e.jsx("button",{type:"button",onClick:s,className:"btn btn-lg bg-base-300 text-label-l text-base-content rounded-lg p-4",children:r("aidol:common.close")}),l&&e.jsx("button",{type:"button",onClick:l.onClick,className:j("btn btn-lg text-label-l flex-1",l.variant==="neutral"?"btn-neutral":"btn-primary"),children:l.label})]})]})})]}):null}function $e({url:t,onCopySuccess:s}){const{t:a}=u.useTranslation(),[l,r]=g.useState(!1),o=g.useCallback(async()=>{await navigator.clipboard.writeText(t),r(!0),s?.(),setTimeout(()=>r(!1),2e3)},[t,s]);return e.jsx("button",{onClick:o,className:"btn btn-circle btn-ghost","aria-label":a("aidol:share"),children:l?e.jsx(ae,{className:"text-success size-6"}):e.jsx(re,{className:"size-6"})})}exports.AddMemberButton=U;exports.BiographyInput=ge;exports.Card=B;exports.CompanionCreateLayout=ye;exports.CompanionGrid=xe;exports.CompanionNameInput=ve;exports.ConceptSelector=R;exports.EmblemGenerator=_;exports.GenderSelector=we;exports.GroupCreation=Ie;exports.GroupHeader=be;exports.GroupNameInput=A;exports.HeroSection=Re;exports.ImagePreview=k;exports.MbtiForm=Ee;exports.MbtiSlider=W;exports.MemberNameInput=$;exports.Modal=Ae;exports.PersonalitySelector=Z;exports.ProfileContent=he;exports.ProfileImageGenerator=Me;exports.ProgressBar=F;exports.PromptInput=T;exports.ShareButton=$e;exports.StepCard=Le;exports.StepIndicator=q;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react-i18next"),M=require("next/image"),g=require("react"),O=require("@hookform/resolvers"),E=require("react-hook-form"),Q=require("./aidol-B3rN8pTx.js"),v=require("framer-motion");function ee(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(l,a,s.get?s:{enumerable:!0,get:()=>t[a]})}}return l.default=t,Object.freeze(l)}const m=ee(g);function G(t){var l,a,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(l=0;l<r;l++)t[l]&&(a=G(t[l]))&&(s&&(s+=" "),s+=a)}else for(a in t)t[a]&&(s&&(s+=" "),s+=a);return s}function j(){for(var t,l,a=0,s="",r=arguments.length;a<r;a++)(t=arguments[a])&&(l=G(t))&&(s&&(s+=" "),s+=l);return s}function te({title:t,titleId:l,...a},s){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},a),t?m.createElement("title",{id:l},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const ae=m.forwardRef(te);function se({title:t,titleId:l,...a},s){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},a),t?m.createElement("title",{id:l},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const le=m.forwardRef(se);function ne({title:t,titleId:l,...a},s){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},a),t?m.createElement("title",{id:l},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const re=m.forwardRef(ne);function oe({title:t,titleId:l,...a},s){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},a),t?m.createElement("title",{id:l},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"}))}const ie=m.forwardRef(oe);function ce({title:t,titleId:l,...a},s){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},a),t?m.createElement("title",{id:l},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))}const de=m.forwardRef(ce);function me({title:t,titleId:l,...a},s){return m.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:s,"aria-labelledby":l},a),t?m.createElement("title",{id:l},t):null,m.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))}const ue=m.forwardRef(me),pe={default:"size-profile",profile:"size-full"};function k({url:t,alt:l,variant:a="default"}){return e.jsx("div",{className:j("border-base-300 bg-base-200 relative overflow-hidden rounded-lg border",pe[a]),children:t?e.jsx(M,{src:t,alt:l,fill:!0,draggable:!1,className:"size-full object-cover"}):e.jsx("div",{className:"flex size-full items-center justify-center",children:e.jsx(ue,{className:"text-base-content/50 size-1/2"})})})}function B({companion:t,variant:l="grade",onClick:a}){const{t:s}=u.useTranslation(),o=t.aidolId!==null&&l==="grade",n=a&&!o,i=l==="position"?"opacity-30":o?"opacity-20":"opacity-60",c=l==="position"?t.position?s(`aidol:position.${t.position}`):s("aidol:position.unassigned"):s("companion.grade",{grade:t.grade});return e.jsxs("div",{className:j("h-card max-w-card border-base-300 relative isolate w-full overflow-hidden rounded-lg border",n&&"cursor-pointer"),onClick:n?a:void 0,role:n?"button":void 0,tabIndex:n?0:void 0,onKeyDown:n?p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),a())}:void 0,children:[e.jsx("div",{className:"absolute inset-0",children:e.jsx(k,{url:t.profilePictureUrl,alt:t.name??"",variant:"profile"})}),o&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"absolute inset-0 z-20 bg-black/40 backdrop-blur-sm"}),e.jsx("div",{className:"absolute top-4 left-4 z-20",children:e.jsx("span",{className:"bg-base-100 text-body-s text-base-content w-fit rounded-lg px-2 py-1",children:s("companion.signed")})})]}),e.jsx("div",{className:j("absolute inset-x-0 bottom-0 h-24 bg-gradient-to-t from-black to-transparent",i)}),e.jsxs("div",{className:"absolute inset-x-4 bottom-4 z-10 flex flex-col gap-2",children:[e.jsx("span",{className:"text-title-s text-white",children:t.name}),e.jsx("span",{className:"text-body-s w-fit rounded-lg bg-black px-2 py-1 text-white",children:c})]})]})}function xe({companions:t,onCompanionClick:l}){const{t:a}=u.useTranslation();return e.jsxs("div",{className:"mt-8",children:[e.jsx("h2",{className:"text-title-l mb-4 font-semibold",children:a("aidol:aidol.members")}),t&&t.length>0?e.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:t.map(s=>e.jsx(B,{companion:s,onClick:()=>l(s.id)},s.id))}):e.jsx("p",{className:"text-base-content/50 text-center",children:a("aidol:aidol.noMembers")})]})}function be({aidol:t}){return e.jsxs("div",{className:"flex flex-col items-center gap-4 py-8 text-center",children:[e.jsx("div",{className:"bg-base-200 relative size-32 overflow-hidden rounded-full",children:t.profileImageUrl?e.jsx(M,{src:t.profileImageUrl,alt:t.name??"Group",fill:!0,className:"object-cover"}):e.jsx("div",{className:"from-primary/20 to-secondary/20 flex size-full items-center justify-center bg-gradient-to-br",children:e.jsx(de,{className:"text-base-content/50 size-16"})})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-display-s text-base-content font-bold",children:t.name}),t.concept&&e.jsx("p",{className:"text-body-l text-base-content/70 mt-2",children:t.concept})]})]})}function U({onClick:t,isLoading:l}){const{t:a}=u.useTranslation();return e.jsx("button",{onClick:t,disabled:l,className:"btn btn-neutral text-label-l text-neutral-content h-16 min-w-48",children:l?e.jsx("span",{className:"loading loading-spinner loading-sm"}):e.jsxs(e.Fragment,{children:[e.jsx(le,{className:"size-5"}),a("aidol:companion.addMember")]})})}const I=["vocal","dance","rap","visual","stamina","charm"];function fe({stats:t}){const{t:l}=u.useTranslation(),a=260,s=a/2,r=70,o=100,n=(d,x)=>{const b=Math.PI*2*d/6-Math.PI/3,y=x/100*r;return{x:s+y*Math.cos(b),y:s+y*Math.sin(b)}},i=d=>{const x=Math.PI*2*d/6-Math.PI/3;return{x:s+o*Math.cos(x),y:s+o*Math.sin(x)}},c=I.map((d,x)=>n(x,t[d])),p=c.map(d=>`${d.x},${d.y}`).join(" "),w=[20,40,60,80,100];return e.jsx("div",{className:"flex items-center justify-center",children:e.jsxs("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,children:[w.map(d=>{const b=I.map((y,P)=>n(P,d)).map(y=>`${y.x},${y.y}`).join(" ");return e.jsx("polygon",{points:b,fill:"none",stroke:"currentColor",strokeWidth:"1",className:"text-base-300"},d)}),I.map((d,x)=>{const b=n(x,100);return e.jsx("line",{x1:s,y1:s,x2:b.x,y2:b.y,stroke:"currentColor",strokeWidth:"1",className:"text-base-300"},x)}),e.jsx("polygon",{points:p,fill:"currentColor",fillOpacity:"0.3",stroke:"currentColor",strokeWidth:"2",className:"text-secondary"}),c.map((d,x)=>e.jsx("circle",{cx:d.x,cy:d.y,r:"3",fill:"currentColor",className:"text-secondary"},x)),I.map((d,x)=>{const b=i(x);return e.jsxs("g",{children:[e.jsx("text",{x:b.x,y:b.y-8,textAnchor:"middle",dominantBaseline:"middle",className:"text-label-l fill-base-content font-medium",children:l(`aidol:casting.abilities.${d}`)}),e.jsx("text",{x:b.x,y:b.y+10,textAnchor:"middle",dominantBaseline:"middle",className:"text-label-l fill-secondary font-medium",children:t[d]})]},d)})]})})}function he({companion:t,showBiography:l=!0,showStats:a=!0}){const{t:s}=u.useTranslation(),{name:r,profilePictureUrl:o,grade:n,mbti:i,biography:c,stats:p}=t;return e.jsxs("div",{className:"flex flex-col items-center gap-6",children:[e.jsx(k,{url:o??null,alt:r??""}),e.jsxs("div",{className:"flex flex-col gap-2 self-start",children:[e.jsx("h2",{className:"text-title-s text-base-content font-semibold",children:r??""}),(n||i)&&e.jsxs("div",{className:"flex gap-2",children:[n&&e.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:s("aidol:companion.grade",{grade:n})}),i&&e.jsx("span",{className:"text-label-l bg-base-content text-base-100 rounded-lg px-2 py-1",children:i})]})]}),l&&c&&e.jsx("p",{className:"text-body-s text-base-content",children:c}),a&&p&&e.jsx(fe,{stats:p})]})}const T=g.forwardRef(({placeholder:t,maxLength:l=500,charCount:a,...s},r)=>{const{t:o}=u.useTranslation();return e.jsxs("div",{className:"w-full",children:[e.jsx("textarea",{ref:r,placeholder:t??o("aidol:companion.promptPlaceholder"),maxLength:l,className:"textarea bg-base-100 text-base-content placeholder:text-base-content/50 focus:border-primary h-32 w-full resize-none focus:outline-hidden",...s}),e.jsxs("div",{className:"text-label-s text-base-content/50 mt-1 text-right",children:[a??0,"/",l]})]})});T.displayName="PromptInput";function ge({value:t,onChange:l}){const{t:a}=u.useTranslation();return e.jsx("input",{type:"text",value:t,onChange:s=>l(s.target.value),placeholder:a("aidol:companionCreate.complete.bioPlaceholder"),className:"input w-full bg-white text-black"})}function je({title:t,rightContent:l}){return e.jsxs("header",{className:"h-header bg-base-100 flex shrink-0 items-center justify-between px-6 py-4",children:[e.jsx("h1",{className:"text-headline-s text-base-content",children:t}),l&&e.jsx("div",{className:"flex max-w-40 shrink-0 items-center",children:l})]})}function F({progress:t}){const l=Math.min(100,Math.max(0,t));return e.jsx("div",{className:"bg-primary/20 h-3 w-full overflow-hidden rounded-full",children:e.jsx("div",{className:"bg-primary h-full rounded-full transition-all duration-500 ease-out",style:{width:`${l}%`}})})}function ye({step:t,totalSteps:l,children:a,bottomButton:s}){const{t:r}=u.useTranslation(),o=t/l*100;return e.jsxs("div",{className:"flex min-h-dvh flex-col",children:[e.jsx(je,{title:r("aidol:companionCreate.title")}),e.jsx("div",{className:"px-6 py-4",children:e.jsx(F,{progress:o})}),e.jsx("div",{className:"flex flex-1 flex-col gap-6 p-6",children:a}),e.jsx("div",{className:"sticky bottom-0 p-6",children:s})]})}const Ne=/[!@#$%^&*()+=[\]{}|\\;:'",.<>?/`~_]/g;function ve({value:t,onChange:l,maxLength:a=10}){const{t:s}=u.useTranslation();return e.jsx("input",{type:"text",value:t,onChange:r=>l(r.target.value.replace(Ne,"").slice(0,a)),placeholder:s("aidol:companionCreate.complete.namePlaceholder"),className:"input w-full bg-white text-black"})}const R=g.forwardRef(({options:t,...l},a)=>{const{t:s}=u.useTranslation();return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsx("label",{className:"label",children:s("aidol:creation.concept")}),e.jsxs("select",{ref:a,className:"select bg-base-100 text-base-content w-full",...l,children:[e.jsx("option",{value:"",children:s("aidol:creation.selectConcept")}),t.map(r=>e.jsx("option",{value:r.value,children:r.label},r.value))]})]})});R.displayName="ConceptSelector";function we({value:t,onChange:l}){const{t:a}=u.useTranslation(),s=[{gender:"female",label:a("aidol:companionCreate.gender.female")},{gender:"male",label:a("aidol:companionCreate.gender.male")}];return e.jsx("div",{className:"flex gap-4",children:s.map(({gender:r,label:o})=>e.jsx("button",{type:"button",onClick:()=>l(r),className:j("text-label-l flex-1 rounded-lg border px-6 py-3 transition-colors",t===r?"border-primary text-primary bg-white":"border-base-300 text-base-content bg-white"),children:o},r))})}function _({onGenerate:t,isGenerating:l,disabled:a}){const{t:s}=u.useTranslation(),[r,o]=g.useState(""),n=()=>{r.trim()&&t(r)},i=c=>{c.key==="Enter"&&r.trim()&&!l&&!a&&(c.preventDefault(),n())};return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:r,onChange:c=>o(c.target.value),onKeyDown:i,placeholder:s("aidol:creation.emblemPromptPlaceholder"),maxLength:200,className:"input flex-1",disabled:a||l,"data-testid":"emblem-prompt-input"}),e.jsx("button",{type:"button",onClick:n,disabled:a||l||!r.trim(),className:"btn btn-secondary","data-testid":"emblem-generate-button",children:l?e.jsx("span",{className:"loading loading-spinner loading-sm"}):s("aidol:creation.generate")})]}),l&&e.jsx("div",{className:"mt-2",children:e.jsx("progress",{className:"progress w-full"})})]})}var Ce=function(t,l){for(var a={};t.length;){var s=t[0],r=s.code,o=s.message,n=s.path.join(".");if(!a[n])if("unionErrors"in s){var i=s.unionErrors[0].errors[0];a[n]={message:i.message,type:i.code}}else a[n]={message:o,type:r};if("unionErrors"in s&&s.unionErrors.forEach(function(w){return w.errors.forEach(function(d){return t.push(d)})}),l){var c=a[n].types,p=c&&c[s.code];a[n]=E.appendErrors(n,l,a,r,p?[].concat(p,s.message):s.message)}t.shift()}return a},ke=function(t,l,a){return a===void 0&&(a={}),function(s,r,o){try{return Promise.resolve((function(n,i){try{var c=Promise.resolve(t[a.mode==="sync"?"parse":"parseAsync"](s,l)).then(function(p){return o.shouldUseNativeValidation&&O.validateFieldsNatively({},o),{errors:{},values:a.raw?s:p}})}catch(p){return i(p)}return c&&c.then?c.then(void 0,i):c})(0,function(n){if((function(i){return Array.isArray(i?.errors)})(n))return{values:{},errors:O.toNestErrors(Ce(n.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw n}))}catch(n){return Promise.reject(n)}}};const A=g.forwardRef(({error:t,...l},a)=>{const{t:s}=u.useTranslation();return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsx("label",{className:"label",children:s("aidol:creation.groupName")}),e.jsx("input",{ref:a,type:"text",placeholder:s("aidol:creation.groupNamePlaceholder"),className:j("input bg-base-100 text-base-content placeholder:text-base-content/50 w-full",t&&"input-error"),...l}),t&&e.jsx("span",{className:"text-label-m text-error",children:t})]})});A.displayName="GroupNameInput";const $=g.forwardRef(({error:t,...l},a)=>{const{t:s}=u.useTranslation();return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsx("label",{className:"label",children:s("aidol:creation.memberName")}),e.jsx("input",{ref:a,type:"text",placeholder:s("aidol:creation.memberNamePlaceholder"),className:j("input bg-base-100 text-base-content placeholder:text-base-content/50 w-full",t&&"input-error"),...l}),t&&e.jsx("span",{className:"text-label-m text-error",children:t})]})});$.displayName="MemberNameInput";function Z({value:t,onChange:l,options:a}){const{t:s}=u.useTranslation();return e.jsxs("fieldset",{className:"fieldset w-full",children:[e.jsx("label",{className:"label",children:s("aidol:creation.personality")}),e.jsx("div",{className:"space-y-2",children:a.map(r=>e.jsxs("label",{className:j("flex cursor-pointer items-start gap-3 rounded-lg border p-4 transition-colors",t===r.value?"border-primary bg-primary/10":"border-base-300 hover:border-base-content/30"),children:[e.jsx("input",{type:"radio",name:"personality",value:r.value,checked:t===r.value,onChange:o=>l(o.target.value),className:"radio-primary radio mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-base-content font-medium",children:r.label}),r.description&&e.jsx("div",{className:"text-body-s text-base-content/70 mt-1",children:r.description})]})]},r.value))})]})}function q({currentStep:t,totalSteps:l,labels:a}){return e.jsx("ul",{className:"steps w-full",children:Array.from({length:l},(s,r)=>{const o=r+1,n=o<t,i=o===t;return e.jsx("li",{className:j("step",(n||i)&&"step-primary"),children:a?.[r]??""},o)})})}const Pe=["cute","cool","elegant","powerful"],Se=["cheerful","cool","tsundere","gentle"];function Ie({onSubmit:t,onComplete:l,onGenerateImage:a,isLoading:s,isGeneratingImage:r,isCompleted:o}){const{t:n}=u.useTranslation(),[i,c]=g.useState(o?3:1),p=g.useMemo(()=>Pe.map(f=>({value:f,label:n(`aidol:creation.concepts.${f}`)})),[n]),w=g.useMemo(()=>Se.map(f=>({value:f,label:n(`aidol:creation.personalities.${f}.label`),description:n(`aidol:creation.personalities.${f}.description`)})),[n]),{register:d,control:x,handleSubmit:b,trigger:y,watch:P,setValue:D,formState:{errors:N}}=E.useForm({resolver:ke(Q.groupCreationSchema),defaultValues:{groupName:"",concept:"",profileImageUrl:"",members:[{name:"",personality:"",systemPrompt:""}]}}),L=P("profileImageUrl"),{fields:H,append:K}=E.useFieldArray({control:x,name:"members"}),z=P("members"),V=async f=>{const h=await a(f);h&&D("profileImageUrl",h)},Y=async()=>{await y(["groupName","profileImageUrl"])&&c(2)},X=b(async f=>{const h=f.members.filter(S=>S.name.trim());await t({...f,members:h}),c(3)}),J=()=>{K({name:"",personality:"",systemPrompt:""})};return e.jsx("main",{className:"bg-base-100 flex min-h-dvh w-full flex-col items-center px-6 py-20",children:e.jsxs("div",{className:"w-full max-w-lg",children:[e.jsx(q,{currentStep:i,totalSteps:3,labels:[n("aidol:creation.step1"),n("aidol:creation.step2"),n("aidol:creation.step3")]}),e.jsxs("div",{className:"mt-8",children:[i===1&&e.jsxs("div",{className:"space-y-6",children:[e.jsx("h2",{className:"text-display-s font-bold",children:n("aidol:creation.step1Title")}),e.jsx(A,{...d("groupName"),error:N.groupName?.message?n(N.groupName.message,{ns:"aidol"}):void 0}),e.jsx(R,{...d("concept"),options:p}),e.jsxs("fieldset",{className:"fieldset",children:[e.jsx("label",{className:"label",children:n("aidol:creation.emblem")}),e.jsx(_,{onGenerate:V,isGenerating:r,disabled:s}),L&&e.jsx("div",{className:"mt-2 flex justify-center",children:e.jsx(k,{url:L,alt:n("aidol:creation.emblem")})}),N.profileImageUrl?.message&&e.jsx("p",{className:"text-label-m text-error mt-1",children:n(N.profileImageUrl.message,{ns:"aidol"})})]}),e.jsx("button",{type:"button",onClick:Y,disabled:!L,className:"btn btn-primary w-full",children:n("aidol:creation.next")})]}),i===2&&e.jsxs("form",{onSubmit:X,className:"space-y-6",children:[e.jsx("h2",{className:"text-display-s font-bold",children:n("aidol:creation.step2Title")}),H.map((f,h)=>e.jsxs("div",{className:"border-base-300 space-y-4 rounded-lg border p-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(k,{url:null,alt:z[h]?.name??""}),e.jsx("div",{className:"flex-1",children:e.jsx($,{...d(`members.${h}.name`),error:N.members?.[h]?.name?.message?n(N.members?.[h]?.name?.message??"",{ns:"aidol"}):void 0})})]}),e.jsx(E.Controller,{name:`members.${h}.personality`,control:x,render:({field:S})=>e.jsx(Z,{value:S.value??"",onChange:S.onChange,options:w})}),e.jsx(T,{...d(`members.${h}.systemPrompt`),charCount:z[h]?.systemPrompt?.length??0})]},f.id)),e.jsx(U,{onClick:J,isLoading:!1}),N.members?.root?.message&&e.jsx("p",{className:"text-error text-center",children:n(N.members.root.message,{ns:"aidol"})}),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("button",{type:"button",onClick:()=>c(1),className:"btn btn-ghost flex-1",disabled:s,children:n("aidol:creation.back")}),e.jsx("button",{type:"submit",className:"btn btn-primary flex-1",disabled:s,children:s?e.jsx("span",{className:"loading loading-spinner loading-sm"}):n("aidol:creation.create")})]})]}),i===3&&e.jsxs("div",{className:"space-y-6 text-center",children:[e.jsx("div",{className:"text-display-l",children:"🎉"}),e.jsx("h2",{className:"text-display-s font-bold",children:n("aidol:creation.completeTitle")}),e.jsx("p",{className:"text-body-l text-base-content/70",children:n("aidol:creation.completeDescription")}),e.jsx("button",{onClick:l,className:"btn btn-primary w-full",children:n("aidol:creation.viewProfile")})]})]})]})})}function W({label:t,leftLabel:l,rightLabel:a,value:s,onChange:r}){return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("span",{className:"text-label-l text-base-content",children:t}),e.jsx("input",{type:"range",min:1,max:10,step:1,value:s,onChange:o=>r(Number(o.target.value)),className:"range range-primary range-sm"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{className:"text-label-m text-primary",children:l}),e.jsx("span",{className:"text-label-m text-primary",children:a})]})]})}function Ee({values:t,onChange:l}){const{t:a}=u.useTranslation(),s=[{key:"energy",label:a("aidol:companionCreate.personality.energy"),leftLabel:a("aidol:companionCreate.personality.energyLeft"),rightLabel:a("aidol:companionCreate.personality.energyRight")},{key:"perception",label:a("aidol:companionCreate.personality.perception"),leftLabel:a("aidol:companionCreate.personality.perceptionLeft"),rightLabel:a("aidol:companionCreate.personality.perceptionRight")},{key:"judgment",label:a("aidol:companionCreate.personality.judgment"),leftLabel:a("aidol:companionCreate.personality.judgmentLeft"),rightLabel:a("aidol:companionCreate.personality.judgmentRight")},{key:"lifestyle",label:a("aidol:companionCreate.personality.lifestyle"),leftLabel:a("aidol:companionCreate.personality.lifestyleLeft"),rightLabel:a("aidol:companionCreate.personality.lifestyleRight")}];return e.jsx("div",{className:"flex flex-col gap-6",children:s.map(({key:r,label:o,leftLabel:n,rightLabel:i})=>e.jsx(W,{label:o,leftLabel:n,rightLabel:i,value:t[r],onChange:c=>l({...t,[r]:c})},r))})}function Me({prompt:t,onPromptChange:l,onGenerate:a,isGenerating:s,imageUrl:r,hasGenerated:o}){const{t:n}=u.useTranslation();return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("input",{type:"text",value:t,onChange:i=>l(i.target.value),placeholder:n("aidol:companionCreate.image.promptPlaceholder"),className:"input w-full bg-white text-black"}),e.jsxs("button",{type:"button",onClick:a,disabled:s||!t.trim(),className:"btn btn-primary w-full",children:[s&&e.jsx("span",{className:"loading loading-spinner"}),n(o?"aidol:companionCreate.image.regenerate":"aidol:companionCreate.image.generate")]}),r?e.jsx("div",{className:"relative aspect-square w-full overflow-hidden rounded-lg",children:e.jsx(M,{src:r,alt:"Generated profile",fill:!0,className:"object-cover"})}):e.jsxs("div",{className:"border-base-300 bg-base-100 flex aspect-square w-full flex-col items-center justify-center gap-4 rounded-lg border",children:[e.jsx(ie,{className:"text-neutral size-6"}),e.jsx("p",{className:"text-body-m text-neutral text-center whitespace-pre-line",children:n("aidol:companionCreate.image.placeholder")})]})]})}function Le({step:t,title:l,children:a}){const s=t.toString().padStart(2,"0");return e.jsxs("div",{className:"bg-base-200 flex w-full flex-col gap-6 rounded-lg p-6",children:[e.jsx("span",{className:"text-title-s text-primary",children:s}),e.jsx("h3",{className:"text-title-s text-base-content",children:l}),e.jsx("div",{className:"flex flex-col gap-4",children:a})]})}const C={initial:{y:40,opacity:0},animate:{y:0,opacity:1,transition:{duration:.8,ease:"easeInOut"}}},Te={animate:{transition:{staggerChildren:.15}}};function Re({onGetStarted:t,isLoading:l}){const{t:a}=u.useTranslation();return e.jsx("section",{className:"bg-base-100 flex min-h-screen w-full flex-col items-center px-6 pt-12 pb-8",children:e.jsxs(v.motion.div,{variants:Te,initial:"initial",animate:"animate",className:"flex w-full flex-col items-center text-center",children:[e.jsx(v.motion.div,{variants:C,className:"mb-6",children:e.jsx(M,{src:"/images/logo.svg",alt:"AIdol",width:92,height:28,priority:!0})}),e.jsxs(v.motion.h1,{variants:C,className:"text-display-s mb-3",children:[a("aidol:landing.hero.title.line1"),e.jsx("br",{}),a("aidol:landing.hero.title.line2")]}),e.jsxs(v.motion.div,{variants:C,className:"text-headline-s text-base-content mb-8 flex flex-col",children:[e.jsx("p",{className:"text-neutral",children:a("aidol:landing.hero.line1")}),e.jsx("p",{className:"text-neutral",children:a("aidol:landing.hero.line2")}),e.jsx("p",{children:a("aidol:landing.hero.line3")}),e.jsx("p",{children:a("aidol:landing.hero.line4")})]}),e.jsx(v.motion.div,{variants:C,className:"bg-base-200 relative mb-6 aspect-[345/368] w-full overflow-hidden rounded-lg"}),e.jsx(v.motion.div,{variants:C,className:"w-full",children:e.jsx("button",{onClick:t,disabled:l,className:"btn btn-primary btn-lg text-label-l w-full rounded-lg",children:l?e.jsx("span",{className:"loading loading-spinner loading-sm"}):a("aidol:landing.hero.cta")})})]})})}function Ae({isOpen:t,onClose:l,children:a,action:s}){const{t:r}=u.useTranslation();return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 z-40 h-screen w-screen bg-black/80",onClick:l}),e.jsx("div",{className:"max-w-mobile fixed inset-0 z-50 mx-auto flex items-center justify-center p-6",onClick:l,children:e.jsxs("div",{className:"bg-base-200 relative flex max-h-170 min-h-90 w-full flex-col gap-6 overflow-hidden rounded-lg p-6",onClick:o=>o.stopPropagation(),children:[e.jsx("div",{className:"scrollbar-hide flex-1 overflow-y-auto pb-20",children:a}),e.jsxs("div",{className:"absolute inset-x-6 bottom-6 flex shrink-0 gap-4",children:[e.jsx("button",{type:"button",onClick:l,className:"btn btn-lg bg-base-300 text-label-l text-base-content rounded-lg p-4",children:r("aidol:common.close")}),s&&e.jsx("button",{type:"button",onClick:s.onClick,className:j("btn btn-lg text-label-l flex-1",s.variant==="neutral"?"btn-neutral":"btn-primary"),children:s.label})]})]})})]}):null}function $e({url:t,onCopySuccess:l}){const{t:a}=u.useTranslation(),[s,r]=g.useState(!1),o=g.useCallback(async()=>{await navigator.clipboard.writeText(t),r(!0),l?.(),setTimeout(()=>r(!1),2e3)},[t,l]);return e.jsx("button",{onClick:o,className:"btn btn-circle btn-ghost","aria-label":a("aidol:share"),children:s?e.jsx(ae,{className:"text-success size-6"}):e.jsx(re,{className:"size-6"})})}exports.AddMemberButton=U;exports.BiographyInput=ge;exports.Card=B;exports.CompanionCreateLayout=ye;exports.CompanionGrid=xe;exports.CompanionNameInput=ve;exports.ConceptSelector=R;exports.EmblemGenerator=_;exports.GenderSelector=we;exports.GroupCreation=Ie;exports.GroupHeader=be;exports.GroupNameInput=A;exports.HeroSection=Re;exports.ImagePreview=k;exports.MbtiForm=Ee;exports.MbtiSlider=W;exports.MemberNameInput=$;exports.Modal=Ae;exports.PersonalitySelector=Z;exports.ProfileContent=he;exports.ProfileImageGenerator=Me;exports.ProgressBar=F;exports.PromptInput=T;exports.ShareButton=$e;exports.StepCard=Le;exports.StepIndicator=q;
|
|
2
2
|
//# sourceMappingURL=client.cjs.map
|