Deepvest/ProfilingAI
0
1/******/ (() => { // webpackBootstrap2/******/ "use strict";3/******/ var __webpack_modules__ = ({4 5/***/ 540:6/***/ ((module, __unused_webpack_exports, __webpack_require__) => {7 8 9 10if (true) {11 /* unused reexport */ __webpack_require__(869);12} else {}13 14 15/***/ }),16 17/***/ 698:18/***/ ((__unused_webpack_module, exports) => {19 20var __webpack_unused_export__;21/**22 * @license React23 * react-jsx-runtime.production.js24 *25 * Copyright (c) Meta Platforms, Inc. and affiliates.26 *27 * This source code is licensed under the MIT license found in the28 * LICENSE file in the root directory of this source tree.29 */30 31 32var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),33 REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");34function jsxProd(type, config, maybeKey) {35 var key = null;36 void 0 !== maybeKey && (key = "" + maybeKey);37 void 0 !== config.key && (key = "" + config.key);38 if ("key" in config) {39 maybeKey = {};40 for (var propName in config)41 "key" !== propName && (maybeKey[propName] = config[propName]);42 } else maybeKey = config;43 config = maybeKey.ref;44 return {45 $$typeof: REACT_ELEMENT_TYPE,46 type: type,47 key: key,48 ref: void 0 !== config ? config : null,49 props: maybeKey50 };51}52__webpack_unused_export__ = REACT_FRAGMENT_TYPE;53__webpack_unused_export__ = jsxProd;54__webpack_unused_export__ = jsxProd;55 56 57/***/ }),58 59/***/ 848:60/***/ ((module, __unused_webpack_exports, __webpack_require__) => {61 62 63 64if (true) {65 /* unused reexport */ __webpack_require__(698);66} else {}67 68 69/***/ }),70 71/***/ 869:72/***/ ((__unused_webpack_module, exports) => {73 74var __webpack_unused_export__;75/**76 * @license React77 * react.production.js78 *79 * Copyright (c) Meta Platforms, Inc. and affiliates.80 *81 * This source code is licensed under the MIT license found in the82 * LICENSE file in the root directory of this source tree.83 */84 85 86var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),87 REACT_PORTAL_TYPE = Symbol.for("react.portal"),88 REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),89 REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),90 REACT_PROFILER_TYPE = Symbol.for("react.profiler"),91 REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),92 REACT_CONTEXT_TYPE = Symbol.for("react.context"),93 REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),94 REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),95 REACT_MEMO_TYPE = Symbol.for("react.memo"),96 REACT_LAZY_TYPE = Symbol.for("react.lazy"),97 MAYBE_ITERATOR_SYMBOL = Symbol.iterator;98function getIteratorFn(maybeIterable) {99 if (null === maybeIterable || "object" !== typeof maybeIterable) return null;100 maybeIterable =101 (MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||102 maybeIterable["@@iterator"];103 return "function" === typeof maybeIterable ? maybeIterable : null;104}105var ReactNoopUpdateQueue = {106 isMounted: function () {107 return !1;108 },109 enqueueForceUpdate: function () {},110 enqueueReplaceState: function () {},111 enqueueSetState: function () {}112 },113 assign = Object.assign,114 emptyObject = {};115function Component(props, context, updater) {116 this.props = props;117 this.context = context;118 this.refs = emptyObject;119 this.updater = updater || ReactNoopUpdateQueue;120}121Component.prototype.isReactComponent = {};122Component.prototype.setState = function (partialState, callback) {123 if (124 "object" !== typeof partialState &&125 "function" !== typeof partialState &&126 null != partialState127 )128 throw Error(129 "takes an object of state variables to update or a function which returns an object of state variables."130 );131 this.updater.enqueueSetState(this, partialState, callback, "setState");132};133Component.prototype.forceUpdate = function (callback) {134 this.updater.enqueueForceUpdate(this, callback, "forceUpdate");135};136function ComponentDummy() {}137ComponentDummy.prototype = Component.prototype;138function PureComponent(props, context, updater) {139 this.props = props;140 this.context = context;141 this.refs = emptyObject;142 this.updater = updater || ReactNoopUpdateQueue;143}144var pureComponentPrototype = (PureComponent.prototype = new ComponentDummy());145pureComponentPrototype.constructor = PureComponent;146assign(pureComponentPrototype, Component.prototype);147pureComponentPrototype.isPureReactComponent = !0;148var isArrayImpl = Array.isArray,149 ReactSharedInternals = { H: null, A: null, T: null, S: null },150 hasOwnProperty = Object.prototype.hasOwnProperty;151function ReactElement(type, key, self, source, owner, props) {152 self = props.ref;153 return {154 $$typeof: REACT_ELEMENT_TYPE,155 type: type,156 key: key,157 ref: void 0 !== self ? self : null,158 props: props159 };160}161function cloneAndReplaceKey(oldElement, newKey) {162 return ReactElement(163 oldElement.type,164 newKey,165 void 0,166 void 0,167 void 0,168 oldElement.props169 );170}171function isValidElement(object) {172 return (173 "object" === typeof object &&174 null !== object &&175 object.$$typeof === REACT_ELEMENT_TYPE176 );177}178function escape(key) {179 var escaperLookup = { "=": "=0", ":": "=2" };180 return (181 "$" +182 key.replace(/[=:]/g, function (match) {183 return escaperLookup[match];184 })185 );186}187var userProvidedKeyEscapeRegex = /\/+/g;188function getElementKey(element, index) {189 return "object" === typeof element && null !== element && null != element.key190 ? escape("" + element.key)191 : index.toString(36);192}193function noop$1() {}194function resolveThenable(thenable) {195 switch (thenable.status) {196 case "fulfilled":197 return thenable.value;198 case "rejected":199 throw thenable.reason;200 default:201 switch (202 ("string" === typeof thenable.status203 ? thenable.then(noop$1, noop$1)204 : ((thenable.status = "pending"),205 thenable.then(206 function (fulfilledValue) {207 "pending" === thenable.status &&208 ((thenable.status = "fulfilled"),209 (thenable.value = fulfilledValue));210 },211 function (error) {212 "pending" === thenable.status &&213 ((thenable.status = "rejected"), (thenable.reason = error));214 }215 )),216 thenable.status)217 ) {218 case "fulfilled":219 return thenable.value;220 case "rejected":221 throw thenable.reason;222 }223 }224 throw thenable;225}226function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {227 var type = typeof children;228 if ("undefined" === type || "boolean" === type) children = null;229 var invokeCallback = !1;230 if (null === children) invokeCallback = !0;231 else232 switch (type) {233 case "bigint":234 case "string":235 case "number":236 invokeCallback = !0;237 break;238 case "object":239 switch (children.$$typeof) {240 case REACT_ELEMENT_TYPE:241 case REACT_PORTAL_TYPE:242 invokeCallback = !0;243 break;244 case REACT_LAZY_TYPE:245 return (246 (invokeCallback = children._init),247 mapIntoArray(248 invokeCallback(children._payload),249 array,250 escapedPrefix,251 nameSoFar,252 callback253 )254 );255 }256 }257 if (invokeCallback)258 return (259 (callback = callback(children)),260 (invokeCallback =261 "" === nameSoFar ? "." + getElementKey(children, 0) : nameSoFar),262 isArrayImpl(callback)263 ? ((escapedPrefix = ""),264 null != invokeCallback &&265 (escapedPrefix =266 invokeCallback.replace(userProvidedKeyEscapeRegex, "$&/") + "/"),267 mapIntoArray(callback, array, escapedPrefix, "", function (c) {268 return c;269 }))270 : null != callback &&271 (isValidElement(callback) &&272 (callback = cloneAndReplaceKey(273 callback,274 escapedPrefix +275 (null == callback.key ||276 (children && children.key === callback.key)277 ? ""278 : ("" + callback.key).replace(279 userProvidedKeyEscapeRegex,280 "$&/"281 ) + "/") +282 invokeCallback283 )),284 array.push(callback)),285 1286 );287 invokeCallback = 0;288 var nextNamePrefix = "" === nameSoFar ? "." : nameSoFar + ":";289 if (isArrayImpl(children))290 for (var i = 0; i < children.length; i++)291 (nameSoFar = children[i]),292 (type = nextNamePrefix + getElementKey(nameSoFar, i)),293 (invokeCallback += mapIntoArray(294 nameSoFar,295 array,296 escapedPrefix,297 type,298 callback299 ));300 else if (((i = getIteratorFn(children)), "function" === typeof i))301 for (302 children = i.call(children), i = 0;303 !(nameSoFar = children.next()).done;304 305 )306 (nameSoFar = nameSoFar.value),307 (type = nextNamePrefix + getElementKey(nameSoFar, i++)),308 (invokeCallback += mapIntoArray(309 nameSoFar,310 array,311 escapedPrefix,312 type,313 callback314 ));315 else if ("object" === type) {316 if ("function" === typeof children.then)317 return mapIntoArray(318 resolveThenable(children),319 array,320 escapedPrefix,321 nameSoFar,322 callback323 );324 array = String(children);325 throw Error(326 "Objects are not valid as a React child (found: " +327 ("[object Object]" === array328 ? "object with keys {" + Object.keys(children).join(", ") + "}"329 : array) +330 "). If you meant to render a collection of children, use an array instead."331 );332 }333 return invokeCallback;334}335function mapChildren(children, func, context) {336 if (null == children) return children;337 var result = [],338 count = 0;339 mapIntoArray(children, result, "", "", function (child) {340 return func.call(context, child, count++);341 });342 return result;343}344function lazyInitializer(payload) {345 if (-1 === payload._status) {346 var ctor = payload._result;347 ctor = ctor();348 ctor.then(349 function (moduleObject) {350 if (0 === payload._status || -1 === payload._status)351 (payload._status = 1), (payload._result = moduleObject);352 },353 function (error) {354 if (0 === payload._status || -1 === payload._status)355 (payload._status = 2), (payload._result = error);356 }357 );358 -1 === payload._status && ((payload._status = 0), (payload._result = ctor));359 }360 if (1 === payload._status) return payload._result.default;361 throw payload._result;362}363var reportGlobalError =364 "function" === typeof reportError365 ? reportError366 : function (error) {367 if (368 "object" === typeof window &&369 "function" === typeof window.ErrorEvent370 ) {371 var event = new window.ErrorEvent("error", {372 bubbles: !0,373 cancelable: !0,374 message:375 "object" === typeof error &&376 null !== error &&377 "string" === typeof error.message378 ? String(error.message)379 : String(error),380 error: error381 });382 if (!window.dispatchEvent(event)) return;383 } else if (384 "object" === typeof process &&385 "function" === typeof process.emit386 ) {387 process.emit("uncaughtException", error);388 return;389 }390 console.error(error);391 };392function noop() {}393__webpack_unused_export__ = {394 map: mapChildren,395 forEach: function (children, forEachFunc, forEachContext) {396 mapChildren(397 children,398 function () {399 forEachFunc.apply(this, arguments);400 },401 forEachContext402 );403 },404 count: function (children) {405 var n = 0;406 mapChildren(children, function () {407 n++;408 });409 return n;410 },411 toArray: function (children) {412 return (413 mapChildren(children, function (child) {414 return child;415 }) || []416 );417 },418 only: function (children) {419 if (!isValidElement(children))420 throw Error(421 "React.Children.only expected to receive a single React element child."422 );423 return children;424 }425};426__webpack_unused_export__ = Component;427__webpack_unused_export__ = REACT_FRAGMENT_TYPE;428__webpack_unused_export__ = REACT_PROFILER_TYPE;429__webpack_unused_export__ = PureComponent;430__webpack_unused_export__ = REACT_STRICT_MODE_TYPE;431__webpack_unused_export__ = REACT_SUSPENSE_TYPE;432__webpack_unused_export__ =433 ReactSharedInternals;434__webpack_unused_export__ = function () {435 throw Error("act(...) is not supported in production builds of React.");436};437__webpack_unused_export__ = function (fn) {438 return function () {439 return fn.apply(null, arguments);440 };441};442__webpack_unused_export__ = function (element, config, children) {443 if (null === element || void 0 === element)444 throw Error(445 "The argument must be a React element, but you passed " + element + "."446 );447 var props = assign({}, element.props),448 key = element.key,449 owner = void 0;450 if (null != config)451 for (propName in (void 0 !== config.ref && (owner = void 0),452 void 0 !== config.key && (key = "" + config.key),453 config))454 !hasOwnProperty.call(config, propName) ||455 "key" === propName ||456 "__self" === propName ||457 "__source" === propName ||458 ("ref" === propName && void 0 === config.ref) ||459 (props[propName] = config[propName]);460 var propName = arguments.length - 2;461 if (1 === propName) props.children = children;462 else if (1 < propName) {463 for (var childArray = Array(propName), i = 0; i < propName; i++)464 childArray[i] = arguments[i + 2];465 props.children = childArray;466 }467 return ReactElement(element.type, key, void 0, void 0, owner, props);468};469__webpack_unused_export__ = function (defaultValue) {470 defaultValue = {471 $$typeof: REACT_CONTEXT_TYPE,472 _currentValue: defaultValue,473 _currentValue2: defaultValue,474 _threadCount: 0,475 Provider: null,476 Consumer: null477 };478 defaultValue.Provider = defaultValue;479 defaultValue.Consumer = {480 $$typeof: REACT_CONSUMER_TYPE,481 _context: defaultValue482 };483 return defaultValue;484};485__webpack_unused_export__ = function (type, config, children) {486 var propName,487 props = {},488 key = null;489 if (null != config)490 for (propName in (void 0 !== config.key && (key = "" + config.key), config))491 hasOwnProperty.call(config, propName) &&492 "key" !== propName &&493 "__self" !== propName &&494 "__source" !== propName &&495 (props[propName] = config[propName]);496 var childrenLength = arguments.length - 2;497 if (1 === childrenLength) props.children = children;498 else if (1 < childrenLength) {499 for (var childArray = Array(childrenLength), i = 0; i < childrenLength; i++)500 childArray[i] = arguments[i + 2];501 props.children = childArray;502 }503 if (type && type.defaultProps)504 for (propName in ((childrenLength = type.defaultProps), childrenLength))505 void 0 === props[propName] &&506 (props[propName] = childrenLength[propName]);507 return ReactElement(type, key, void 0, void 0, null, props);508};509__webpack_unused_export__ = function () {510 return { current: null };511};512__webpack_unused_export__ = function (render) {513 return { $$typeof: REACT_FORWARD_REF_TYPE, render: render };514};515__webpack_unused_export__ = isValidElement;516__webpack_unused_export__ = function (ctor) {517 return {518 $$typeof: REACT_LAZY_TYPE,519 _payload: { _status: -1, _result: ctor },520 _init: lazyInitializer521 };522};523__webpack_unused_export__ = function (type, compare) {524 return {525 $$typeof: REACT_MEMO_TYPE,526 type: type,527 compare: void 0 === compare ? null : compare528 };529};530__webpack_unused_export__ = function (scope) {531 var prevTransition = ReactSharedInternals.T,532 currentTransition = {};533 ReactSharedInternals.T = currentTransition;534 try {535 var returnValue = scope(),536 onStartTransitionFinish = ReactSharedInternals.S;537 null !== onStartTransitionFinish &&538 onStartTransitionFinish(currentTransition, returnValue);539 "object" === typeof returnValue &&540 null !== returnValue &&541 "function" === typeof returnValue.then &&542 returnValue.then(noop, reportGlobalError);543 } catch (error) {544 reportGlobalError(error);545 } finally {546 ReactSharedInternals.T = prevTransition;547 }548};549__webpack_unused_export__ = function () {550 return ReactSharedInternals.H.useCacheRefresh();551};552__webpack_unused_export__ = function (usable) {553 return ReactSharedInternals.H.use(usable);554};555__webpack_unused_export__ = function (action, initialState, permalink) {556 return ReactSharedInternals.H.useActionState(action, initialState, permalink);557};558__webpack_unused_export__ = function (callback, deps) {559 return ReactSharedInternals.H.useCallback(callback, deps);560};561__webpack_unused_export__ = function (Context) {562 return ReactSharedInternals.H.useContext(Context);563};564__webpack_unused_export__ = function () {};565__webpack_unused_export__ = function (value, initialValue) {566 return ReactSharedInternals.H.useDeferredValue(value, initialValue);567};568__webpack_unused_export__ = function (create, deps) {569 return ReactSharedInternals.H.useEffect(create, deps);570};571__webpack_unused_export__ = function () {572 return ReactSharedInternals.H.useId();573};574__webpack_unused_export__ = function (ref, create, deps) {575 return ReactSharedInternals.H.useImperativeHandle(ref, create, deps);576};577__webpack_unused_export__ = function (create, deps) {578 return ReactSharedInternals.H.useInsertionEffect(create, deps);579};580__webpack_unused_export__ = function (create, deps) {581 return ReactSharedInternals.H.useLayoutEffect(create, deps);582};583__webpack_unused_export__ = function (create, deps) {584 return ReactSharedInternals.H.useMemo(create, deps);585};586__webpack_unused_export__ = function (passthrough, reducer) {587 return ReactSharedInternals.H.useOptimistic(passthrough, reducer);588};589__webpack_unused_export__ = function (reducer, initialArg, init) {590 return ReactSharedInternals.H.useReducer(reducer, initialArg, init);591};592__webpack_unused_export__ = function (initialValue) {593 return ReactSharedInternals.H.useRef(initialValue);594};595__webpack_unused_export__ = function (initialState) {596 return ReactSharedInternals.H.useState(initialState);597};598__webpack_unused_export__ = function (599 subscribe,600 getSnapshot,601 getServerSnapshot602) {603 return ReactSharedInternals.H.useSyncExternalStore(604 subscribe,605 getSnapshot,606 getServerSnapshot607 );608};609__webpack_unused_export__ = function () {610 return ReactSharedInternals.H.useTransition();611};612__webpack_unused_export__ = "19.0.0";613 614 615/***/ })616 617/******/ });618/************************************************************************/619/******/ // The module cache620/******/ var __webpack_module_cache__ = {};621/******/ 622/******/ // The require function623/******/ function __webpack_require__(moduleId) {624/******/ // Check if module is in cache625/******/ var cachedModule = __webpack_module_cache__[moduleId];626/******/ if (cachedModule !== undefined) {627/******/ return cachedModule.exports;628/******/ }629/******/ // Create a new module (and put it into the cache)630/******/ var module = __webpack_module_cache__[moduleId] = {631/******/ // no module.id needed632/******/ // no module.loaded needed633/******/ exports: {}634/******/ };635/******/ 636/******/ // Execute the module function637/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);638/******/ 639/******/ // Return the exports of the module640/******/ return module.exports;641/******/ }642/******/ 643/************************************************************************/644var __webpack_exports__ = {};645 646// UNUSED EXPORTS: default647 648// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js649var jsx_runtime = __webpack_require__(848);650// EXTERNAL MODULE: ./node_modules/react/index.js651var react = __webpack_require__(540);652;// ./src/interface/components/UserProfileForm.tsx653var __assign = (undefined && undefined.__assign) || function () {654 __assign = Object.assign || function(t) {655 for (var s, i = 1, n = arguments.length; i < n; i++) {656 s = arguments[i];657 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))658 t[p] = s[p];659 }660 return t;661 };662 return __assign.apply(this, arguments);663};664var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {665 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }666 return new (P || (P = Promise))(function (resolve, reject) {667 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }668 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }669 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }670 step((generator = generator.apply(thisArg, _arguments || [])).next());671 });672};673var __generator = (undefined && undefined.__generator) || function (thisArg, body) {674 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);675 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;676 function verb(n) { return function (v) { return step([n, v]); }; }677 function step(op) {678 if (f) throw new TypeError("Generator is already executing.");679 while (g && (g = 0, op[0] && (_ = 0)), _) try {680 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;681 if (y = 0, t) op = [op[0] & 2, t.value];682 switch (op[0]) {683 case 0: case 1: t = op; break;684 case 4: _.label++; return { value: op[1], done: false };685 case 5: _.label++; y = op[1]; op = [0]; continue;686 case 7: op = _.ops.pop(); _.trys.pop(); continue;687 default:688 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }689 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }690 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }691 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }692 if (t[2]) _.ops.pop();693 _.trys.pop(); continue;694 }695 op = body.call(thisArg, _);696 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }697 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };698 }699};700var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {701 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {702 if (ar || !(i in from)) {703 if (!ar) ar = Array.prototype.slice.call(from, 0, i);704 ar[i] = from[i];705 }706 }707 return to.concat(ar || Array.prototype.slice.call(from));708};709 710 711var UserProfileForm_UserProfileForm = function (_a) {712 var onSubmit = _a.onSubmit;713 var _b = useState({714 age: '',715 annual_income: '',716 monthly_savings: '',717 family_status: 'single',718 dependents: 0,719 risk_tolerance: 3,720 investment_horizon: 5,721 financial_knowledge: 3,722 income_stability: 3,723 investment_goals: [],724 life_events: [],725 investment_preferences: {726 esg: false,727 crypto: false,728 real_estate: false,729 alternative: false730 },731 total_assets: '',732 total_debt: ''733 }), formData = _b[0], setFormData = _b[1];734 var _c = useState(''), error = _c[0], setError = _c[1];735 var _d = useState(false), success = _d[0], setSuccess = _d[1];736 // Options pour les sélections737 var investmentGoals = [738 'Retraite',739 'Achat immobilier',740 'Études enfants',741 'Création entreprise',742 'Épargne générale',743 'Revenus passifs',744 'Croissance patrimoine'745 ];746 var lifeEvents = [747 'Mariage prévu',748 'Naissance attendue',749 'Changement emploi',750 'Déménagement',751 'Héritage attendu',752 'Projet entrepreneurial'753 ];754 var handleChange = function (e) {755 var _a = e.target, name = _a.name, value = _a.value, type = _a.type;756 var checked = type === 'checkbox' ? e.target.checked : undefined;757 if (name.startsWith('investment_preferences.')) {758 var preference_1 = name.split('.')[1];759 setFormData(function (prev) {760 var _a;761 return (__assign(__assign({}, prev), { investment_preferences: __assign(__assign({}, prev.investment_preferences), (_a = {}, _a[preference_1] = checked, _a)) }));762 });763 return;764 }765 if (type === 'checkbox') {766 var array_1 = name === 'investment_goals' ? 'investment_goals' : 'life_events';767 setFormData(function (prev) {768 var _a;769 return (__assign(__assign({}, prev), (_a = {}, _a[array_1] = checked770 ? __spreadArray(__spreadArray([], prev[array_1], true), [value], false) : prev[array_1].filter(function (item) { return item !== value; }), _a)));771 });772 return;773 }774 setFormData(function (prev) {775 var _a;776 return (__assign(__assign({}, prev), (_a = {}, _a[name] = value, _a)));777 });778 };779 var handleSubmit = function (e) { return __awaiter(void 0, void 0, void 0, function () {780 var err_1;781 return __generator(this, function (_a) {782 switch (_a.label) {783 case 0:784 e.preventDefault();785 _a.label = 1;786 case 1:787 _a.trys.push([1, 3, , 4]);788 setError('');789 setSuccess(false);790 if (parseInt(formData.age) < 18) {791 setError('Vous devez avoir au moins 18 ans');792 return [2 /*return*/];793 }794 return [4 /*yield*/, onSubmit(formData)];795 case 2:796 _a.sent();797 setSuccess(true);798 return [3 /*break*/, 4];799 case 3:800 err_1 = _a.sent();801 setError(err_1 instanceof Error ? err_1.message : 'Une erreur est survenue');802 return [3 /*break*/, 4];803 case 4: return [2 /*return*/];804 }805 });806 }); };807 return (_jsx("div", { className: "max-w-4xl mx-auto bg-white shadow-lg rounded-lg", children: _jsxs("div", { className: "p-6", children: [_jsx("h2", { className: "text-2xl font-semibold mb-6", children: "Votre Profil Investisseur" }), _jsxs("form", { onSubmit: handleSubmit, className: "space-y-8", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-lg font-medium mb-4", children: "Informations personnelles" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsx("div", { children: _jsxs("label", { className: "block text-sm font-medium mb-1", children: ["\u00C2ge", _jsx("input", { type: "number", name: "age", value: formData.age, onChange: handleChange, className: "mt-1 block w-full rounded", required: true })] }) }), _jsx("div", { children: _jsxs("label", { className: "block text-sm font-medium mb-1", children: ["Revenu annuel (\u20AC)", _jsx("input", { type: "number", name: "annual_income", value: formData.annual_income, onChange: handleChange, className: "mt-1 block w-full rounded", required: true })] }) }), _jsx("div", { children: _jsxs("label", { className: "block text-sm font-medium mb-1", children: ["Situation familiale", _jsxs("select", { name: "family_status", value: formData.family_status, onChange: handleChange, className: "mt-1 block w-full rounded", children: [_jsx("option", { value: "single", children: "C\u00E9libataire" }), _jsx("option", { value: "married", children: "Mari\u00E9(e)" }), _jsx("option", { value: "divorced", children: "Divorc\u00E9(e)" }), _jsx("option", { value: "widowed", children: "Veuf/Veuve" })] })] }) }), _jsx("div", { children: _jsxs("label", { className: "block text-sm font-medium mb-1", children: ["Personnes \u00E0 charge", _jsx("input", { type: "number", name: "dependents", value: formData.dependents, onChange: handleChange, min: "0", className: "mt-1 block w-full rounded" })] }) })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-lg font-medium mb-4", children: "Profil d'investissement" }), _jsxs("div", { className: "space-y-4", children: [_jsx("div", { children: _jsxs("label", { className: "block text-sm font-medium mb-1", children: ["Tol\u00E9rance au risque (1-5)", _jsx("input", { type: "range", name: "risk_tolerance", min: "1", max: "5", value: formData.risk_tolerance, onChange: handleChange, className: "w-full" }), _jsxs("div", { className: "flex justify-between text-xs", children: [_jsx("span", { children: "Tr\u00E8s prudent" }), _jsx("span", { children: "\u00C9quilibr\u00E9" }), _jsx("span", { children: "Dynamique" })] })] }) }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsx("div", { children: _jsxs("label", { className: "block text-sm font-medium mb-1", children: ["Horizon d'investissement (ann\u00E9es)", _jsx("input", { type: "number", name: "investment_horizon", value: formData.investment_horizon, onChange: handleChange, className: "mt-1 block w-full rounded", min: "1" })] }) }), _jsx("div", { children: _jsxs("label", { className: "block text-sm font-medium mb-1", children: ["Niveau de connaissance financi\u00E8re (1-5)", _jsx("input", { type: "range", name: "financial_knowledge", min: "1", max: "5", value: formData.financial_knowledge, onChange: handleChange, className: "w-full" })] }) })] })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-lg font-medium mb-4", children: "Objectifs et \u00E9v\u00E9nements de vie" }), _jsxs("div", { className: "mb-4", children: [_jsx("label", { className: "block text-sm font-medium mb-2", children: "Objectifs d'investissement" }), _jsx("div", { className: "grid grid-cols-2 gap-2", children: investmentGoals.map(function (goal) { return (_jsxs("label", { className: "flex items-center space-x-2", children: [_jsx("input", { type: "checkbox", name: "investment_goals", value: goal, checked: formData.investment_goals.includes(goal), onChange: handleChange, className: "rounded" }), _jsx("span", { className: "text-sm", children: goal })] }, goal)); }) })] }), _jsxs("div", { children: [_jsx("label", { className: "block text-sm font-medium mb-2", children: "\u00C9v\u00E9nements de vie pr\u00E9vus" }), _jsx("div", { className: "grid grid-cols-2 gap-2", children: lifeEvents.map(function (event) { return (_jsxs("label", { className: "flex items-center space-x-2", children: [_jsx("input", { type: "checkbox", name: "life_events", value: event, checked: formData.life_events.includes(event), onChange: handleChange, className: "rounded" }), _jsx("span", { className: "text-sm", children: event })] }, event)); }) })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "text-lg font-medium mb-4", children: "Pr\u00E9f\u00E9rences d'investissement" }), _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [_jsxs("label", { className: "flex items-center space-x-2", children: [_jsx("input", { type: "checkbox", name: "investment_preferences.esg", checked: formData.investment_preferences.esg, onChange: handleChange, className: "rounded" }), _jsx("span", { className: "text-sm", children: "Investissement responsable (ESG)" })] }), _jsxs("label", { className: "flex items-center space-x-2", children: [_jsx("input", { type: "checkbox", name: "investment_preferences.crypto", checked: formData.investment_preferences.crypto, onChange: handleChange, className: "rounded" }), _jsx("span", { className: "text-sm", children: "Cryptomonnaies" })] }), _jsxs("label", { className: "flex items-center space-x-2", children: [_jsx("input", { type: "checkbox", name: "investment_preferences.real_estate", checked: formData.investment_preferences.real_estate, onChange: handleChange, className: "rounded" }), _jsx("span", { className: "text-sm", children: "Immobilier" })] }), _jsxs("label", { className: "flex items-center space-x-2", children: [_jsx("input", { type: "checkbox", name: "investment_preferences.alternative", checked: formData.investment_preferences.alternative, onChange: handleChange, className: "rounded" }), _jsx("span", { className: "text-sm", children: "Investissements alternatifs" })] })] })] }), error && (_jsx("div", { className: "bg-red-50 text-red-800 p-4 rounded-md", children: error })), success && (_jsx("div", { className: "bg-green-50 text-green-800 p-4 rounded-md", children: "Profil cr\u00E9\u00E9 avec succ\u00E8s!" })), _jsx("button", { type: "submit", className: "w-full bg-blue-600 text-white p-3 rounded-lg hover:bg-blue-700 transition-colors", children: "Cr\u00E9er mon profil" })] })] }) }));808};809/* harmony default export */ const components_UserProfileForm = ((/* unused pure expression or super */ null && (UserProfileForm_UserProfileForm)));810 811;// ./src/interface/components/AppContainer.tsx812var AppContainer_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {813 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }814 return new (P || (P = Promise))(function (resolve, reject) {815 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }816 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }817 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }818 step((generator = generator.apply(thisArg, _arguments || [])).next());819 });820};821var AppContainer_generator = (undefined && undefined.__generator) || function (thisArg, body) {822 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);823 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;824 function verb(n) { return function (v) { return step([n, v]); }; }825 function step(op) {826 if (f) throw new TypeError("Generator is already executing.");827 while (g && (g = 0, op[0] && (_ = 0)), _) try {828 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;829 if (y = 0, t) op = [op[0] & 2, t.value];830 switch (op[0]) {831 case 0: case 1: t = op; break;832 case 4: _.label++; return { value: op[1], done: false };833 case 5: _.label++; y = op[1]; op = [0]; continue;834 case 7: op = _.ops.pop(); _.trys.pop(); continue;835 default:836 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }837 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }838 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }839 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }840 if (t[2]) _.ops.pop();841 _.trys.pop(); continue;842 }843 op = body.call(thisArg, _);844 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }845 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };846 }847};848 849 850 851var AppContainer = function () {852 // État pour stocker le profil courant853 var _a = useState(null), currentProfile = _a[0], setCurrentProfile = _a[1];854 // État pour gérer le chargement855 var _b = useState(false), isLoading = _b[0], setIsLoading = _b[1];856 // État pour gérer les erreurs857 var _c = useState(null), error = _c[0], setError = _c[1];858 // Initialisation et écoute des événements Streamlit859 useEffect(function () {860 if (window.Streamlit) {861 // Écouter les mises à jour de Streamlit862 window.Streamlit.on('change', function (event) {863 if (event.type === 'PROFILE_DATA') {864 setCurrentProfile(event.data);865 }866 });867 }868 }, []);869 // Gestionnaire de soumission du profil870 var handleProfileSubmit = function (profileData) { return AppContainer_awaiter(void 0, void 0, void 0, function () {871 return AppContainer_generator(this, function (_a) {872 try {873 setIsLoading(true);874 setError(null);875 // Validation supplémentaire des données876 if (!validateProfileData(profileData)) {877 throw new Error("Données de profil invalides");878 }879 // Mise à jour de l'état local880 setCurrentProfile(profileData);881 // Envoi des données à Streamlit882 if (window.Streamlit) {883 window.Streamlit.setComponentValue({884 type: 'PROFILE_UPDATE',885 data: profileData,886 timestamp: new Date().toISOString()887 });888 }889 setIsLoading(false);890 }891 catch (err) {892 setError(err instanceof Error ? err.message : "Une erreur est survenue");893 setIsLoading(false);894 console.error('Error handling profile submission:', err);895 }896 return [2 /*return*/];897 });898 }); };899 // Fonction de validation des données900 var validateProfileData = function (data) {901 if (parseInt(data.age) < 18)902 return false;903 if (parseInt(data.annual_income) < 0)904 return false;905 if (data.investment_goals.length === 0)906 return false;907 if (data.risk_tolerance < 1 || data.risk_tolerance > 5)908 return false;909 return true;910 };911 return (_jsx("div", { className: "min-h-screen bg-gray-50", children: _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [_jsxs("header", { className: "mb-8", children: [_jsx("h1", { className: "text-3xl font-bold text-gray-900", children: "DeepVest - Votre Assistant d'Investissement Personnalis\u00E9" }), currentProfile && (_jsxs("p", { className: "mt-2 text-gray-600", children: ["Profil cr\u00E9\u00E9 le ", new Date().toLocaleDateString()] }))] }), error && (_jsx("div", { className: "mb-6 bg-red-50 border-l-4 border-red-500 p-4", children: _jsxs("div", { className: "flex", children: [_jsx("div", { className: "flex-shrink-0", children: _jsx("svg", { className: "h-5 w-5 text-red-400", viewBox: "0 0 20 20", fill: "currentColor", children: _jsx("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) }) }), _jsx("div", { className: "ml-3", children: _jsx("p", { className: "text-sm text-red-700", children: error }) })] }) })), isLoading && (_jsx("div", { className: "flex justify-center items-center my-4", children: _jsx("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600" }) })), _jsx("div", { className: "bg-white shadow rounded-lg", children: _jsx(UserProfileForm, { onSubmit: handleProfileSubmit }) }), currentProfile && (_jsxs("div", { className: "mt-8 bg-white shadow rounded-lg p-6", children: [_jsx("h2", { className: "text-xl font-semibold mb-4", children: "Profil actuel" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsxs("div", { children: [_jsx("h3", { className: "font-medium text-gray-900", children: "Informations personnelles" }), _jsxs("dl", { className: "mt-2 text-sm text-gray-600", children: [_jsxs("div", { className: "mt-1", children: [_jsx("dt", { className: "inline", children: "\u00C2ge:" }), _jsxs("dd", { className: "inline ml-1", children: [currentProfile.age, " ans"] })] }), _jsxs("div", { className: "mt-1", children: [_jsx("dt", { className: "inline", children: "Revenu annuel:" }), _jsxs("dd", { className: "inline ml-1", children: [parseInt(currentProfile.annual_income).toLocaleString(), "\u20AC"] })] }), _jsxs("div", { className: "mt-1", children: [_jsx("dt", { className: "inline", children: "Situation familiale:" }), _jsx("dd", { className: "inline ml-1", children: currentProfile.family_status })] })] })] }), _jsxs("div", { children: [_jsx("h3", { className: "font-medium text-gray-900", children: "Profil d'investissement" }), _jsxs("dl", { className: "mt-2 text-sm text-gray-600", children: [_jsxs("div", { className: "mt-1", children: [_jsx("dt", { className: "inline", children: "Tol\u00E9rance au risque:" }), _jsxs("dd", { className: "inline ml-1", children: [currentProfile.risk_tolerance, "/5"] })] }), _jsxs("div", { className: "mt-1", children: [_jsx("dt", { className: "inline", children: "Horizon:" }), _jsxs("dd", { className: "inline ml-1", children: [currentProfile.investment_horizon, " ans"] })] }), _jsxs("div", { className: "mt-1", children: [_jsx("dt", { className: "inline", children: "Objectifs:" }), _jsx("dd", { className: "inline ml-1", children: currentProfile.investment_goals.join(", ") })] })] })] })] })] }))] }) }));912};913/* harmony default export */ const components_AppContainer = ((/* unused pure expression or super */ null && (AppContainer)));914 915/******/ })()916;