/opt/canhelp/apps/web/.next/cache/webpack/server-production
NameSizeModeActions
0.pack925145390644editdlrm
1.pack12673790644editdlrm
2.pack43735990644editdlrm
3.pack7451990644editdlrm
4.pack65204660644editdlrm
5.pack259717610644editdlrm
6.pack7518430644editdlrm
7.pack46388840644editdlrm
8.pack48452960644editdlrm
9.pack97020644editdlrm
10.pack27038500644editdlrm
11.pack1361530644editdlrm
12.pack24060644editdlrm
13.pack4277340644editdlrm
14.pack6358240644editdlrm
15.pack19769150644editdlrm
16.pack85740644editdlrm
17.pack24591570644editdlrm
18.pack119171890644editdlrm
19.pack768050644editdlrm
20.pack31443360644editdlrm
21.pack60115380644editdlrm
22.pack10241010644editdlrm
index.pack77214480644editdlrm
index.pack.old84399530644editdlrm
Edit: /opt/canhelp/apps/web/.next/cache/webpack/server-production/13.pack (427734B)
wpcʆwebpack/lib/cache/PackFileCacheStrategyPackContentItems ` ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|react$=|next/dist/server/route-modules/app-page/vendored/ssr/react|react/compiler-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime|react/jsx-dev-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime|react/jsx-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime|react-dom$=|next/dist/server/route-modules/app-page/vendored/ssr/react-dom|react-dom/client$=|next/dist/compiled/react-dom/client|react-dom/server$=|next/dist/compiled/react-dom/server.node|react-dom/server.browser$=|next/dist/compiled/react-dom/server.browser|react-dom/server.edge$=|next/dist/build/webpack/alias/react-dom-server.js|react-dom/static$=|next/dist/compiled/react-dom/static.node|react-dom/static.browser$=|next/dist/compiled/react-dom/static.browser|react-dom/static.edge$=|next/dist/compiled/react-dom/static.edge|react-server-dom-webpack/client$=|next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client|react-server-dom-webpack/server$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/server.node$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/static$=|next/dist/compiled/react-server-dom-webpack/static.node|@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts=|next/dist/client/dev/noop-turbopack-hmr|next=|/opt/canhelp/node_modules/next|]|mainFields=[|0=|module|1=|main|]|dependencyType=|esm|path=|/opt/canhelp/apps/web/src/app/tasks/new|request=|@/components/TaskLocationPicker ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|react$=|next/dist/server/route-modules/app-page/vendored/ssr/react|react/compiler-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime|react/jsx-dev-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime|react/jsx-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime|react-dom$=|next/dist/server/route-modules/app-page/vendored/ssr/react-dom|react-dom/client$=|next/dist/compiled/react-dom/client|react-dom/server$=|next/dist/compiled/react-dom/server.node|react-dom/server.browser$=|next/dist/compiled/react-dom/server.browser|react-dom/server.edge$=|next/dist/build/webpack/alias/react-dom-server.js|react-dom/static$=|next/dist/compiled/react-dom/static.node|react-dom/static.browser$=|next/dist/compiled/react-dom/static.browser|react-dom/static.edge$=|next/dist/compiled/react-dom/static.edge|react-server-dom-webpack/client$=|next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client|react-server-dom-webpack/server$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/server.node$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/static$=|next/dist/compiled/react-server-dom-webpack/static.node|@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts=|next/dist/client/dev/noop-turbopack-hmr|next=|/opt/canhelp/node_modules/next|]|mainFields=[|0=|module|1=|main|]|dependencyType=|esm|path=|/opt/canhelp/apps/web/src/components|request=|@/components/TaskLocationPicker ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|react$=|next/dist/server/route-modules/app-page/vendored/ssr/react|react/compiler-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime|react/jsx-dev-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime|react/jsx-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime|react-dom$=|next/dist/server/route-modules/app-page/vendored/ssr/react-dom|react-dom/client$=|next/dist/compiled/react-dom/client|react-dom/server$=|next/dist/compiled/react-dom/server.node|react-dom/server.browser$=|next/dist/compiled/react-dom/server.browser|react-dom/server.edge$=|next/dist/build/webpack/alias/react-dom-server.js|react-dom/static$=|next/dist/compiled/react-dom/static.node|react-dom/static.browser$=|next/dist/compiled/react-dom/static.browser|react-dom/static.edge$=|next/dist/compiled/react-dom/static.edge|react-server-dom-webpack/client$=|next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client|react-server-dom-webpack/server$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/server.node$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/static$=|next/dist/compiled/react-server-dom-webpack/static.node|@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts=|next/dist/client/dev/noop-turbopack-hmr|next=|/opt/canhelp/node_modules/next|]|mainFields=[|0=|module|1=|main|]|dependencyType=|esm|path=|/opt/canhelp/apps/web/src/app/tasks|request=|@/components/TaskLocationPicker ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|react$=|next/dist/server/route-modules/app-page/vendored/ssr/react|react/compiler-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime|react/jsx-dev-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime|react/jsx-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime|react-dom$=|next/dist/server/route-modules/app-page/vendored/ssr/react-dom|react-dom/client$=|next/dist/compiled/react-dom/client|react-dom/server$=|next/dist/compiled/react-dom/server.node|react-dom/server.browser$=|next/dist/compiled/react-dom/server.browser|react-dom/server.edge$=|next/dist/build/webpack/alias/react-dom-server.js|react-dom/static$=|next/dist/compiled/react-dom/static.node|react-dom/static.browser$=|next/dist/compiled/react-dom/static.browser|react-dom/static.edge$=|next/dist/compiled/react-dom/static.edge|react-server-dom-webpack/client$=|next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client|react-server-dom-webpack/server$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/server.node$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/static$=|next/dist/compiled/react-server-dom-webpack/static.node|@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts=|next/dist/client/dev/noop-turbopack-hmr|next=|/opt/canhelp/node_modules/next|]|mainFields=[|0=|module|1=|main|]|dependencyType=|esm|path=|/opt/canhelp/apps/web/src/components|request=|@/components/TaskCategoryPicker ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|react$=|next/dist/server/route-modules/app-page/vendored/ssr/react|react/compiler-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime|react/jsx-dev-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime|react/jsx-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime|react-dom$=|next/dist/server/route-modules/app-page/vendored/ssr/react-dom|react-dom/client$=|next/dist/compiled/react-dom/client|react-dom/server$=|next/dist/compiled/react-dom/server.node|react-dom/server.browser$=|next/dist/compiled/react-dom/server.browser|react-dom/server.edge$=|next/dist/build/webpack/alias/react-dom-server.js|react-dom/static$=|next/dist/compiled/react-dom/static.node|react-dom/static.browser$=|next/dist/compiled/react-dom/static.browser|react-dom/static.edge$=|next/dist/compiled/react-dom/static.edge|react-server-dom-webpack/client$=|next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client|react-server-dom-webpack/server$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/server.node$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/static$=|next/dist/compiled/react-server-dom-webpack/static.node|@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts=|next/dist/client/dev/noop-turbopack-hmr|next=|/opt/canhelp/node_modules/next|]|mainFields=[|0=|module|1=|main|]|dependencyType=|esm|path=|/opt/canhelp/apps/web/src/app/tasks|request=|@/components/TaskCategoryPicker ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|react$=|next/dist/server/route-modules/app-page/vendored/ssr/react|react/compiler-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime|react/jsx-dev-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime|react/jsx-runtime$=|next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime|react-dom$=|next/dist/server/route-modules/app-page/vendored/ssr/react-dom|react-dom/client$=|next/dist/compiled/react-dom/client|react-dom/server$=|next/dist/compiled/react-dom/server.node|react-dom/server.browser$=|next/dist/compiled/react-dom/server.browser|react-dom/server.edge$=|next/dist/build/webpack/alias/react-dom-server.js|react-dom/static$=|next/dist/compiled/react-dom/static.node|react-dom/static.browser$=|next/dist/compiled/react-dom/static.browser|react-dom/static.edge$=|next/dist/compiled/react-dom/static.edge|react-server-dom-webpack/client$=|next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client|react-server-dom-webpack/server$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/server.node$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/static$=|next/dist/compiled/react-server-dom-webpack/static.node|@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts=|next/dist/client/dev/noop-turbopack-hmr|next=|/opt/canhelp/node_modules/next|]|mainFields=[|0=|module|1=|main|]|dependencyType=|esm|path=|/opt/canhelp/apps/web/src/app/tasks/new|request=|@/components/TaskCategoryPicker4Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/TaskLocationPicker.tsx|ssr4Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/TaskCategoryPicker.tsx|ssr<FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/TaskLocationPicker.tsx|ssr<FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/TaskCategoryPicker.tsx|ssrKCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/TaskLocationPicker.tsx|ssr|webpack-runtimeKCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[7].use[1]!/opt/canhelp/apps/web/src/components/TaskCategoryPicker.tsx|ssr|webpack-runtimeCompilation/assets|chunk22MinifierWebpackPlugin|22.jswebpack/lib/cache/ResolverCachePlugin`_ResolverCachePluginCacheMisscontextpathrequestqueryfragmentmoduledirectoryfileinternalfullySpecifieddescriptionFilePathdescriptionFileDatadescriptionFileRootrelativePath issuerissuerLayercompiler/opt/canhelp/apps/web/src/app/tasks/new/page.tsxssrserver/opt/canhelp/apps/web/src/components/TaskLocationPicker.tsx /opt/canhelp/apps/web/package.jsonnameversionprivatescriptsdependenciesdevDependenciesweb0.1.0 devbuildstartlinttypechecknext dev --port 3000NODE_ENV=production next buildnext startnext linttsc --noEmit` @canhelp/shared@marsidev/react-turnstile@types/leafletbetter-authleafletnanostoresnextreactreact-domreact-leafletreact-leaflet-clustersocket.io-clientzod*^1.5.0^1.9.21^1.2.7^1.9.4^1.2.0^15.1.6^19.0.0^5.0.0^4.1.3^4.8.1^3.24.1@types/node@types/react@types/react-domautoprefixerpostcsstailwindcsstypescript^22.10.7^19.0.6^19.0.3^10.4.20^8.5.1^3.4.17^5.7.3/opt/canhelp/apps/web./src/components/TaskLocationPicker.tsxwebpack/lib/FileSystemInfoSnapshot@ LyB /opt/canhelp/apps/web/src/components/opt/canhelp/apps/web/src/opt/canhelp/apps/opt/canhelp/opt/safeTimetimestamphash!GyBGyB2b838447edee29a3!`nuyBPnuyBd1168d5d5ce4fcb8`/opt/canhelp/apps/web/src/app/tasks/new/package.json/opt/canhelp/apps/web/src/app/tasks/package.json/opt/canhelp/apps/web/src/app/package.json/opt/canhelp/apps/web/src/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/package.json/opt/canhelp/apps/web/opt/canhelp/apps/package.json/opt/canhelp/apps/web/opt/canhelp/package.json/opt/canhelp/apps/web/opt/package.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskLocationPicker/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskLocationPicker.js/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskLocationPicker.mjs/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskLocationPicker.tsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskLocationPicker.ts/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskLocationPicker.jsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskLocationPicker.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskLocationPicker.wasm/opt/canhelp/apps/web/src/components/package.json/opt/canhelp/apps/web/src/components/TaskLocationPicker/opt/canhelp/apps/web/src/components/TaskLocationPicker.js/opt/canhelp/apps/web/src/components/TaskLocationPicker.mjs /opt/canhelp/apps/web/src/components/SpecialistsFiltersClient.tsx @ LyB Ӂ/!`nuyBPnuyBxwvutsr`u y/opt/canhelp/apps/web/src/app/tasks/TaskFiltersClient.tsxz{| }@ LyB {|ā/!`nuyBPnuyBihgfedc`f jlm/opt/canhelp/apps/web/src/components/TaskCategoryPicker.tsx n./src/components/TaskCategoryPicker.tsx@ LyB l/!`GyBPGyB5157c62d0c323061!`nuyBPnuyBWVUTSRQ`/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskCategoryPicker/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskCategoryPicker.js/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskCategoryPicker.mjs/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskCategoryPicker.tsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskCategoryPicker.ts/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskCategoryPicker.jsx/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskCategoryPicker.json/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/TaskCategoryPicker.wasm/opt/canhelp/apps/web/src/components/TaskCategoryPicker/opt/canhelp/apps/web/src/components/TaskCategoryPicker.js/opt/canhelp/apps/web/src/components/TaskCategoryPicker.mjsI MOP R@ LyB Q/!`nuyBPnuyB>=<;:98`; ?@AB D@ LyB C/!`nuyBPnuyB0/.-,+*`webpack/lib/NormalModulewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceJ/* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { useLocale } from '@/context/locale'; export function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = useState(false); const [expandedCity, setExpandedCity] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const { locale } = useLocale(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); } exportsTypesideEffectFreenamespace  javascript/auto*raliasmainFields`$server-only$client-only$next/dist/compiled/client-only$next/dist/compiled/server-only/opt/canhelp/node_modules/next/head.js/opt/canhelp/node_modules/next/image.js/opt/canhelp/node_modules/next/constants.js/opt/canhelp/node_modules/next/router.js/opt/canhelp/node_modules/next/dynamic.js/opt/canhelp/node_modules/next/script.js/opt/canhelp/node_modules/next/link.js/opt/canhelp/node_modules/next/form.js/opt/canhelp/node_modules/next/navigation.js/opt/canhelp/node_modules/next/headers.js/opt/canhelp/node_modules/next/og.js/opt/canhelp/node_modules/next/server.js/opt/canhelp/node_modules/next/document.js/opt/canhelp/node_modules/next/app.jsreact$react/compiler-runtime$react/jsx-dev-runtime$react/jsx-runtime$react-dom$react-dom/client$react-dom/server$react-dom/server.browser$react-dom/server.edge$react-dom/static$react-dom/static.browser$react-dom/static.edge$react-server-dom-webpack/client$react-server-dom-webpack/server$react-server-dom-webpack/server.node$react-server-dom-webpack/static$@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts$next/dist/compiled/server-only/indexnext/dist/compiled/client-only/indexnext/dist/client/components/noop-headnext/dist/api/imagenext/dist/api/constantsnext/dist/api/routernext/dist/api/app-dynamicnext/dist/api/scriptnext/dist/client/app-dir/linknext/dist/client/app-dir/formnext/dist/api/navigationnext/dist/api/headersnext/dist/api/ognext/dist/api/servernext/dist/api/documentnext/dist/api/appnext/dist/server/route-modules/app-page/vendored/ssr/reactnext/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtimenext/dist/server/route-modules/app-page/vendored/ssr/react-domnext/dist/compiled/react-dom/clientnext/dist/compiled/react-dom/server.nodenext/dist/compiled/react-dom/server.browsernext/dist/build/webpack/alias/react-dom-server.jsnext/dist/compiled/react-dom/static.nodenext/dist/compiled/react-dom/static.browsernext/dist/compiled/react-dom/static.edgenext/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-clientnext/dist/compiled/react-server-dom-webpack/server.nodenext/dist/compiled/react-server-dom-webpack/static.nodenext/dist/client/dev/noop-turbopack-hmr/opt/canhelp/node_modules/nextmain`cacheableparsedfileDependenciescontextDependenciesmissingDependenciesbuildDependenciesvalueDependencies&assetsassetsInforscstrictexportsArgumenttopLevelDeclarationssnapshot webpack/lib/util/LazySet/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.jswebpack/DefinePlugin_hash4028310f3d6b0560805b9ec6typeactionIdsisClientRefclient  __webpack_exports__TaskLocationPicker IyB webpack/lib/dependencies/HarmonyCompatibilityDependency dwebpack/lib/dependencies/ConstDependency`H@ aH@A `4A `-webpack/lib/dependencies/HarmonyExportHeaderDependency AJ AJ @? `5webpack/lib/dependencies/HarmonyImportSideEffectDependencyreact/jsx-runtime aH@ `4@/context/locale `-webpack/lib/dependencies/HarmonyExportSpecifierDependency` @?webpack/lib/dependencies/HarmonyImportSpecifierDependencya useState A`h   b$  A   b,4  A   b ( useRef A   b useLocale A   b  useEffect AT]   b7 @  A)2   c7@ jsxs_jsxs A@ E    c;; jsx_jsx A    c??  AG L    cDD  A    cI"I'  AB F    cP*P.  A   cU*U.  A   c\"\&  A   c`"`&  A   cf0f4  A    cn"n'  A   cq"q&  A   cs0s5  A59   cv.v2  A   c|<|@  A48   @`.@`2  Atx   @`8@`<  A   @`<@`@  A15   @`@@`D  A   @`"@`'  A    @`*@`.  A!!   @`4@`8  A""  ~~ @`8@`<  A&&  zz @`-@`2  A'!'  vv @`.@`3  Ax*|*  |rr @`6@`:  A++  xnn @`D@`H  A--  tjj @`6@`:  A'.+.  pff @`E@`I  A0 0  lbb @`D@`H  Ac1g1  h^^ @`L@`P  A 33  dZZ @`D@`H  A44  `VV @`L@`Q |} A55  \RR @`d@`i ~ A88  XNN @`>@`B tu Ay9~9  TJJ @`>@`C vw A;;  PFF @`P@`T rs Ah=l=  LBB @ `L@ `P hi AX@]@  H>> @`A@`F jk ACC  D:: @ `B@ `F fg A DD  @66 @#`B@#`F bc A8Epart.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } export function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = useState(false); const [expandedParent, setExpandedParent] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const searchRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); } `        3b79baa4ae22367c   isPathLikeLabelslugToLabelsafeCategoryLabelTaskCategoryPicker IyBcg  d `H@ aH@ A `4 A `9 AA AA a@& `1 aH@ `4@/components/CategoryIcon `9 a@&  Abj   c$    A   c08  A   c (  A   c    A   c  AZc   c7@  A>G   c 7 @  A    cHH  A% )    cLL    A    cQQ  Az~   cV1V5 CategoryIcon A 4 cV6VB  A   c['[+  A   ca0a4  A   cg"g&  A   ck"k&  A"&   cq0q4  A@E   cy"y'  A:>   c|"|&  A   c~0~5  Aos   @`.@`2  A    @`<@`@  Anr   @`.@`2  A   @`8@`<  A!%   @`<@`@  A   @`@@`D  Ae!j!   @`"@`'  A&#*#   @`*@`.  A##   @`4@`8  AV%Z%   @`8@`<  AM)R)   @`-@`2  A))   @`.@`3  AI-M-  ~ @`=@`A AN-Z- 4{uu @`B@`N  A..  w~~ @`6@`:  A//  szz @`D@`H  A11  ovv @`D@`H  A3373  krr @`P@`T  A44  gnn @`D@`H  A66  cjj @`K@`O  At8y8  _ff @`=@`B  A;;  [bb @`>@`B  A;<  W^^ @ `>@ `B  A=!=  SZZ @`L@`P  A>>  OVV @`L@`P webpack/lib/ModuleGraphRestoreProvidedData  providedcanMangleProvideterminalBindingexportsInfo=  +  sourcesruntimeRequirementsdatajavascriptwebpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Qwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceJ/* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { useLocale } from '@/context/locale'; export function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = useState(false); const [expandedCity, setExpandedCity] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const { locale } = useLocale(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); } a5H_`gT\)1@ D G K B E _ 5847tw14 !!"_"&&' 'x*{*++--'.*.0 0c1f1 33445588y9}9;;h=k=X@H\@CC DD8E;E*G-G(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemaps>U/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); /* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); ReplaceSourceRawSource 72134undefined136187undefined189233undefined235241undefined352359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined413420(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined461468(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined491496(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined528536(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined596604(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined10651073(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined23682372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24782481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26312635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30603064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33943397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37163719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40294032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42264229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45844587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined48704874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51205123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52775281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54295432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58425845(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61966199(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67726775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined70917094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74737476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined79277931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83768379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85798582(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89338936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99119915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1001210016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1087210875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1117911182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1154711550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1181511818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1229412297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1264312646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1306913072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1354413548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1380213806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447314476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1471314717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1524615249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1572015723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1647216476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1716817171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1742017423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1772017723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1821818221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined __webpack_require____webpack_require__.n__webpack_require__.d Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceA/* __next_internal_client_entry_do_not_use__ TaskCategoryPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { CategoryIcon } from '@/components/CategoryIcon'; function isPathLikeLabel(value) { return value.startsWith('/api/') || value.startsWith('/uploads/') || value.startsWith('http://') || value.startsWith('https://'); } function slugToLabel(slug) { return slug.split('-').filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } export function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = useState(false); const [expandedParent, setExpandedParent] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const searchRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); } a1H_biZb>F % ( z}_"%@D:=or nq!$e!i!&#)##_#V%Y%M)Q)))I-L-N-Y-..//1133634466t8x8;;;<= =>@>(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .EzL/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972); /* __next_internal_client_entry_do_not_use__ TaskCategoryPicker auto */ function isPathLikeLabel(value) { return value.startsWith('/api/') || value.startsWith('/uploads/') || value.startsWith('http://') || value.startsWith('https://'); } function slugToLabel(slug) { return slug.split('-').filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const searchRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ez, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ez, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); }  /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972);  72134undefined136187undefined189245undefined747753undefined866873(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined931938(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined979986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10091014(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined10451050(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined11141122(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined15981606(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined29993003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined31093112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32623266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37063709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37113722_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ezundefined40114014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43144317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45844587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47964799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51545157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54405444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56905693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58475851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined59996002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64126415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67666769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73947397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77137716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80958098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85498553(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89989001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92049207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95589561(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1057310577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1067410678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1159311596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1159811609_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ezundefined1201212015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1227512278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1275412757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1310713110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1353313536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1400714010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1445214456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1511915122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1535915362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1564515648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1611916122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined  ?webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceU"use strict"; exports.id = 22; exports.ids = [22]; exports.modules = { /***/ 53863: webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource %webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Qwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceJ/* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { useLocale } from '@/context/locale'; export function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = useState(false); const [expandedCity, setExpandedCity] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const { locale } = useLocale(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); } a5H_`gT\)1@ D G K B E _ 5847tw14 !!"_"&&' 'x*{*++--'.*.0 0c1f1 33445588y9}9;;h=k=X@H\@CC DD8E;E*G-G(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)buffersourcesizemapshashU/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); /* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); ReplaceSourceRawSourceJ/* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { useLocale } from '@/context/locale'; export function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = useState(false); const [expandedCity, setExpandedCity] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const { locale } = useLocale(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); }  72134undefined136187undefined189233undefined235241undefined352359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined413420(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined461468(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined491496(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined528536(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined596604(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined10651073(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined23682372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24782481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26312635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30603064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33943397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37163719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40294032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42264229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45844587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined48704874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51205123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52775281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54295432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58425845(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61966199(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67726775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined70917094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74737476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined79277931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83768379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85798582(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89338936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99119915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1001210016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1087210875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1117911182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1154711550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1181511818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1229412297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1264312646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1306913072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1354413548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1380213806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447314476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1471314717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1524615249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1572015723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1647216476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1716817171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1742017423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1772017723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1821818221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) buffersourcesizemapshashV/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); /* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); } /***/ }) {"finalSource":true}mapbufferedMap  ConcatSourceRawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); ReplaceSourceRawSourceJ/* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { useLocale } from '@/context/locale'; export function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = useState(false); const [expandedCity, setExpandedCity] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const { locale } = useLocale(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); }  72134undefined136187undefined189233undefined235241undefined352359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined413420(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined461468(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined491496(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined528536(0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)undefined596604(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined10651073(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined23682372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined24782481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26312635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined30603064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined33943397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37163719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined40294032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42264229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45844587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined48704874(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51205123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52775281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined54295432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58425845(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61966199(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67726775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined70917094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined74737476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined79277931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined83768379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85798582(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined89338936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99119915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1001210016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1087210875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1117911182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1154711550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1181511818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1229412297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1264312646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1306913072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1354413548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1380213806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447314476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1471314717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1524615249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1572015723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1647216476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1716817171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1742017423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1772017723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1821818221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined RawSource /***/ }), /***/ 88142:  webpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSourceQ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { webpack/lib/util/registerExternalSerializerwebpack-sources/CachedSource Hwebpack/lib/util/registerExternalSerializerwebpack-sources/ConcatSourcewebpack/lib/util/registerExternalSerializerwebpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972); webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceA/* __next_internal_client_entry_do_not_use__ TaskCategoryPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { CategoryIcon } from '@/components/CategoryIcon'; function isPathLikeLabel(value) { return value.startsWith('/api/') || value.startsWith('/uploads/') || value.startsWith('http://') || value.startsWith('https://'); } function slugToLabel(slug) { return slug.split('-').filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } export function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = useState(false); const [expandedParent, setExpandedParent] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const searchRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); } a1H_biZb>F % ( z}_"%@D:=or nq!$e!i!&#)##_#V%Y%M)Q)))I-L-N-Y-..//1133634466t8x8;;;<= =>@>(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .EzbuffersourcesizemapshashL/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972); /* __next_internal_client_entry_do_not_use__ TaskCategoryPicker auto */ function isPathLikeLabel(value) { return value.startsWith('/api/') || value.startsWith('/uploads/') || value.startsWith('http://') || value.startsWith('https://'); } function slugToLabel(slug) { return slug.split('-').filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const searchRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ez, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ez, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); } {"finalSource":true}mapbufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972); ReplaceSourceRawSourceA/* __next_internal_client_entry_do_not_use__ TaskCategoryPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { CategoryIcon } from '@/components/CategoryIcon'; function isPathLikeLabel(value) { return value.startsWith('/api/') || value.startsWith('/uploads/') || value.startsWith('http://') || value.startsWith('https://'); } function slugToLabel(slug) { return slug.split('-').filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } export function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = useState(false); const [expandedParent, setExpandedParent] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const searchRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); }  72134undefined136187undefined189245undefined747753undefined866873(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined931938(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined979986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10091014(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined10451050(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined11141122(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined15981606(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined29993003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined31093112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32623266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37063709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37113722_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ezundefined40114014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43144317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45844587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47964799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51545157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54405444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56905693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58475851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined59996002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64126415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67666769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73947397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77137716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80958098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85498553(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89989001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92049207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95589561(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1057310577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1067410678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1159311596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1159811609_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ezundefined1201212015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1227512278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1275412757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1310713110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1353313536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1400714010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1445214456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1511915122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1535915362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1564515648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1611916122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) L/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972); /* __next_internal_client_entry_do_not_use__ TaskCategoryPicker auto */ function isPathLikeLabel(value) { return value.startsWith('/api/') || value.startsWith('/uploads/') || value.startsWith('http://') || value.startsWith('https://'); } function slugToLabel(slug) { return slug.split('-').filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const searchRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ez, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ez, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); } /***/ })   /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972); A/* __next_internal_client_entry_do_not_use__ TaskCategoryPicker auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useRef, useState, useEffect } from 'react'; import { CategoryIcon } from '@/components/CategoryIcon'; function isPathLikeLabel(value) { return value.startsWith('/api/') || value.startsWith('/uploads/') || value.startsWith('http://') || value.startsWith('https://'); } function slugToLabel(slug) { return slug.split('-').filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } export function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = useState(false); const [expandedParent, setExpandedParent] = useState(null); const [search, setSearch] = useState(''); const ref = useRef(null); const searchRef = useRef(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && useEffect(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsx("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ _jsx("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsxs("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ _jsx("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ _jsx("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ _jsx("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ _jsxs("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); }  72134undefined136187undefined189245undefined747753undefined866873(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined931938(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined979986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10091014(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined10451050(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined11141122(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined15981606(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined29993003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined31093112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32623266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37063709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined37113722_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ezundefined40114014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43144317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined45844587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47964799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined51545157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54405444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined56905693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined58475851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined59996002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64126415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined67666769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined73947397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined77137716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80958098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85498553(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89989001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92049207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95589561(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1057310577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1067410678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1159311596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1159811609_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ezundefined1201212015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1227512278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1275412757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1310713110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1353313536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1400714010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1445214456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1511915122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1535915362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1564515648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1611916122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined }; ; a"use strict"; exports.id = 22; exports.ids = [22]; exports.modules = { /***/ 53863: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ TaskLocationPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(96484); /* __next_internal_client_entry_do_not_use__ TaskLocationPicker auto */ function TaskLocationPicker({ locations, value, onChange, anyLabel, allLabel }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const { locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_2__/* .useLocale */ .Y)(); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedCity(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand city of currently selected district process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!value) { setExpandedCity(null); return; } for (const city of locations){ if (city.slug === value) return; // city itself selected — no need to expand for (const d of city.children ?? []){ if (d.slug === value) { setExpandedCity(city.slug); return; } } } }, [ value, locations ]); let selectedLabel = anyLabel; outer: for (const city of locations){ if (city.slug === value) { selectedLabel = city.names[locale] ?? city.names.el; break; } for (const d of city.children ?? []){ if (d.slug === value) { selectedLabel = d.names[locale] ?? d.names.el; break outer; } } } function handleClose() { setOpen(false); setExpandedCity(null); setSearch(''); } const q = search.toLowerCase(); const filteredLocations = q ? locations.filter((city)=>(city.names[locale] ?? city.names.el).toLowerCase().includes(q) || (city.children ?? []).some((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q))) : locations; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "location", value: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: anyLabel }), !value && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredLocations.map((city)=>{ const cityName = city.names[locale] ?? city.names.el; const districts = city.children ?? []; const matchingDistricts = q ? districts.filter((d)=>(d.names[locale] ?? d.names.el).toLowerCase().includes(q)) : districts; const hasDistricts = districts.length > 0; const isCitySelected = value === city.slug; const isExpanded = expandedCity === city.slug || !!q && matchingDistricts.length > 0 && !cityName.toLowerCase().includes(q); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium hover:bg-green-50' : 'text-gray-800 hover:bg-gray-50'}`, onClick: ()=>{ if (hasDistricts) { setExpandedCity(isExpanded ? null : city.slug); } else { onChange(city.slug); handleClose(); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityName }), hasDistricts ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : isCitySelected ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasDistricts && isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: [ (!q || cityName.toLowerCase().includes(q)) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isCitySelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(city.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex-1", children: [ cityName, " — ", allLabel ] }), isCitySelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), matchingDistricts.map((d)=>{ const dName = d.names[locale] ?? d.names.el; const isSelected = value === d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(d.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: dName }), isSelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, d.id); }) ] }) ] }, city.id); }) ] }) ] }); } /***/ }), /***/ 88142: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ W: () => (/* binding */ TaskCategoryPicker) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(78157); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31768); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(44972); /* __next_internal_client_entry_do_not_use__ TaskCategoryPicker auto */ function isPathLikeLabel(value) { return value.startsWith('/api/') || value.startsWith('/uploads/') || value.startsWith('http://') || value.startsWith('https://'); } function slugToLabel(slug) { return slug.split('-').filter(Boolean).map((part)=>part.charAt(0).toUpperCase() + part.slice(1)).join(' '); } function safeCategoryLabel(value, slug) { const raw = typeof value === 'string' ? value.trim() : ''; if (!raw || isPathLikeLabel(raw)) return slugToLabel(slug); return raw; } function TaskCategoryPicker({ categories, locale, value, onChange, placeholder }) { const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const searchRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setExpandedParent(null); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); // Auto-expand the parent of the currently selected subcategory process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!value) { setExpandedParent(null); return; } for (const cat of categories){ for (const sub of cat.children ?? []){ if (sub.slug === value) { setExpandedParent(cat.slug); return; } } } }, [ value, categories ]); let selectedLabel = ''; let selectedIcon = ''; outer: for (const cat of categories){ if (cat.slug === value) { selectedLabel = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); selectedIcon = cat.icon ?? ''; break; } for (const sub of cat.children ?? []){ if (sub.slug === value) { selectedLabel = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); selectedIcon = cat.icon ?? ''; break outer; } } } function handleClose() { setOpen(false); setExpandedParent(null); setSearch(''); } const q = search.toLowerCase(); const filteredCategories = q ? categories.filter((cat)=>(cat.names[locale] ?? cat.names.el).toLowerCase().includes(q) || (cat.children ?? []).some((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q))) : categories; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "hidden", name: "category", value: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen(!open), className: `w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${open ? 'rounded-t-lg border border-green-400 bg-white text-gray-900' : 'rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900'}`, children: [ selectedIcon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ez, { icon: selectedIcon, alt: selectedLabel || placeholder, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate font-medium", children: selectedLabel || placeholder }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white border-b border-gray-100 px-3 py-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: searchRef, type: "text", value: search, onChange: (e)=>setSearch(e.target.value), className: "w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400", placeholder: "Поиск...", onClick: (e)=>e.stopPropagation() }), search && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600", onClick: ()=>setSearch(''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: `w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!value ? 'text-green-600 font-medium' : 'text-gray-700'}`, onClick: ()=>{ onChange(''); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: placeholder }), !value && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }), filteredCategories.map((cat)=>{ const name = safeCategoryLabel(cat.names[locale] ?? cat.names.el, cat.slug); const icon = cat.icon ?? ''; const children = cat.children ?? []; const matchingChildren = q ? children.filter((sub)=>(sub.names[locale] ?? sub.names.el).toLowerCase().includes(q) || name.toLowerCase().includes(q)) : children; const isExpanded = expandedParent === cat.slug || !!q && matchingChildren.length > 0 && !name.toLowerCase().includes(q); const hasChildren = children.length > 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${hasChildren ? 'hover:bg-gray-50 text-gray-800' : value === cat.slug ? 'text-green-600 font-medium hover:bg-green-50' : 'hover:bg-gray-50 text-gray-700'}`, onClick: ()=>{ if (hasChildren) { setExpandedParent(isExpanded ? null : cat.slug); } else { onChange(cat.slug); handleClose(); } }, children: [ icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_2__/* .CategoryIcon */ .Ez, { icon: icon, alt: name, className: "h-4 w-4 object-contain text-base leading-none shrink-0", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: name }), hasChildren ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: `w-4 h-4 text-gray-400 shrink-0 transition-transform ${isExpanded ? 'rotate-90' : ''}`, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : value === cat.slug ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) : null ] }), hasChildren && isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-gray-50 border-t border-b border-gray-100", children: matchingChildren.map((sub)=>{ const subName = safeCategoryLabel(sub.names[locale] ?? sub.names.el, sub.slug); const isSelected = value === sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", className: `w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${isSelected ? 'text-green-600 font-medium bg-green-50' : 'text-gray-600 hover:bg-gray-100'}`, onClick: ()=>{ onChange(sub.slug); handleClose(); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: subName }), isSelected && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) ] }, sub.id); }) }) ] }, cat.id); }) ] }) ] }); } /***/ }) }; ; {} `U"use strict"; exports.id = 22; exports.ids = [22]; exports.modules = { /***/ 53863: Q/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {  RawSource /***/ }), /***/ 88142:  }; ; +0"use strict";exports.id=22,exports.ids=[22],exports.modules={53863:(a,b,c)=>{c.d(b,{V:()=>g});var d=c(78157),e=c(31768),f=c(96484);function g({locations:a,value:b,onChange:c,anyLabel:g,allLabel:h}){let[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(""),o=(0,e.useRef)(null),{locale:p}=(0,f.Y)(),q=g;a:for(let c of a){if(c.slug===b){q=c.names[p]??c.names.el;break}for(let a of c.children??[])if(a.slug===b){q=a.names[p]??a.names.el;break a}}function r(){j(!1),l(null),n("")}let s=m.toLowerCase(),t=s?a.filter(a=>(a.names[p]??a.names.el).toLowerCase().includes(s)||(a.children??[]).some(a=>(a.names[p]??a.names.el).toLowerCase().includes(s))):a;return(0,d.jsxs)("div",{className:"relative",ref:o,children:[(0,d.jsx)("input",{type:"hidden",name:"location",value:b}),(0,d.jsxs)("button",{type:"button",onClick:()=>j(!i),className:`w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${i?"rounded-t-lg border border-green-400 bg-white text-gray-900":"rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900"}`,children:[(0,d.jsxs)("svg",{className:"w-4 h-4 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,d.jsx)("span",{className:"flex-1 text-left truncate font-medium",children:q}),(0,d.jsx)("svg",{className:`w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${i?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),i&&(0,d.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto",children:[(0,d.jsx)("div",{className:"sticky top-0 bg-white border-b border-gray-100 px-3 py-2",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,d.jsx)("input",{type:"text",value:m,onChange:a=>n(a.target.value),className:"w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400",placeholder:"Поиск...",onClick:a=>a.stopPropagation()}),m&&(0,d.jsx)("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:()=>n(""),children:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),(0,d.jsxs)("button",{className:`w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!b?"text-green-600 font-medium":"text-gray-700"}`,onClick:()=>{c(""),r()},children:[(0,d.jsx)("span",{className:"flex-1",children:g}),!b&&(0,d.jsx)("svg",{className:"w-4 h-4 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]}),t.map(a=>{let e=a.names[p]??a.names.el,f=a.children??[],g=s?f.filter(a=>(a.names[p]??a.names.el).toLowerCase().includes(s)):f,i=f.length>0,j=b===a.slug,m=k===a.slug||!!s&&g.length>0&&!e.toLowerCase().includes(s);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{type:"button",className:`w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${j?"text-green-600 font-medium hover:bg-green-50":"text-gray-800 hover:bg-gray-50"}`,onClick:()=>{i?l(m?null:a.slug):(c(a.slug),r())},children:[(0,d.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-300 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"})}),(0,d.jsx)("span",{className:"flex-1 font-medium",children:e}),i?(0,d.jsx)("svg",{className:`w-4 h-4 text-gray-400 shrink-0 transition-transform ${m?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):j?(0,d.jsx)("svg",{className:"w-4 h-4 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):null]}),i&&m&&(0,d.jsxs)("div",{className:"bg-gray-50 border-t border-b border-gray-100",children:[(!s||e.toLowerCase().includes(s))&&(0,d.jsxs)("button",{type:"button",className:`w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${j?"text-green-600 font-medium bg-green-50":"text-gray-600 hover:bg-gray-100"}`,onClick:()=>{c(a.slug),r()},children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,d.jsxs)("span",{className:"flex-1",children:[e," — ",h]}),j&&(0,d.jsx)("svg",{className:"w-4 h-4 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]}),g.map(a=>{let e=a.names[p]??a.names.el,f=b===a.slug;return(0,d.jsxs)("button",{type:"button",className:`w-full flex items-center gap-2 pl-8 pr-4 py-2 text-sm text-left transition-colors ${f?"text-green-600 font-medium bg-green-50":"text-gray-600 hover:bg-gray-100"}`,onClick:()=>{c(a.slug),r()},children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:e}),f&&(0,d.jsx)("svg",{className:"w-4 h-4 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},a.id)})]})]},a.id)})]})]})}},88142:(a,b,c)=>{c.d(b,{W:()=>h});var d=c(78157),e=c(31768),f=c(44972);function g(a,b){var c;let d="string"==typeof a?a.trim():"";return!d||(c=d).startsWith("/api/")||c.startsWith("/uploads/")||c.startsWith("http://")||c.startsWith("https://")?b.split("-").filter(Boolean).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" "):d}function h({categories:a,locale:b,value:c,onChange:h,placeholder:i}){let[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),[n,o]=(0,e.useState)(""),p=(0,e.useRef)(null),q=(0,e.useRef)(null),r="",s="";a:for(let d of a){if(d.slug===c){r=g(d.names[b]??d.names.el,d.slug),s=d.icon??"";break}for(let a of d.children??[])if(a.slug===c){r=g(a.names[b]??a.names.el,a.slug),s=d.icon??"";break a}}function t(){k(!1),m(null),o("")}let u=n.toLowerCase(),v=u?a.filter(a=>(a.names[b]??a.names.el).toLowerCase().includes(u)||(a.children??[]).some(a=>(a.names[b]??a.names.el).toLowerCase().includes(u))):a;return(0,d.jsxs)("div",{className:"relative",ref:p,children:[(0,d.jsx)("input",{type:"hidden",name:"category",value:c}),(0,d.jsxs)("button",{type:"button",onClick:()=>k(!j),className:`w-full flex items-center gap-1.5 px-3 py-2 text-sm transition-colors ${j?"rounded-t-lg border border-green-400 bg-white text-gray-900":"rounded-lg border border-gray-200 bg-gray-50 hover:bg-gray-100 text-gray-600 hover:text-gray-900"}`,children:[s?(0,d.jsx)(f.Ez,{icon:s,alt:r||i,className:"h-4 w-4 object-contain text-base leading-none shrink-0",fallback:"\uD83D\uDCE6"}):(0,d.jsx)("svg",{className:"w-4 h-4 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),(0,d.jsx)("span",{className:"flex-1 text-left truncate font-medium",children:r||i}),(0,d.jsx)("svg",{className:`w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ${j?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),j&&(0,d.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-96 overflow-y-auto",children:[(0,d.jsx)("div",{className:"sticky top-0 bg-white border-b border-gray-100 px-3 py-2",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),(0,d.jsx)("input",{ref:q,type:"text",value:n,onChange:a=>o(a.target.value),className:"w-full pl-8 pr-7 py-1.5 text-sm border border-gray-200 rounded-md focus:outline-none focus:border-green-400",placeholder:"Поиск...",onClick:a=>a.stopPropagation()}),n&&(0,d.jsx)("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",onClick:()=>o(""),children:(0,d.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),(0,d.jsxs)("button",{className:`w-full flex items-center gap-2.5 px-4 py-2.5 text-sm hover:bg-gray-50 text-left border-b border-gray-100 ${!c?"text-green-600 font-medium":"text-gray-700"}`,onClick:()=>{h(""),t()},children:[(0,d.jsx)("span",{className:"flex-1",children:i}),!c&&(0,d.jsx)("svg",{className:"w-4 h-4 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]}),v.map(a=>{let e=g(a.names[b]??a.names.el,a.slug),i=a.icon??"",j=a.children??[],k=u?j.filter(a=>(a.names[b]??a.names.el).toLowerCase().includes(u)||e.toLowerCase().includes(u)):j,n=l===a.slug||!!u&&k.length>0&&!e.toLowerCase().includes(u),o=j.length>0;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{type:"button",className:`w-full flex items-center gap-2 px-4 py-2.5 text-sm text-left transition-colors ${o?"hover:bg-gray-50 text-gray-800":c===a.slug?"text-green-600 font-medium hover:bg-green-50":"hover:bg-gray-50 text-gray-700"}`,onClick:()=>{o?m(n?null:a.slug):(h(a.slug),t())},children:[i?(0,d.jsx)(f.Ez,{icon:i,alt:e,className:"h-4 w-4 object-contain text-base leading-none shrink-0",fallback:"\uD83D\uDCE6"}):null,(0,d.jsx)("span",{className:"flex-1 font-medium",children:e}),o?(0,d.jsx)("svg",{className:`w-4 h-4 text-gray-400 shrink-0 transition-transform ${n?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):c===a.slug?(0,d.jsx)("svg",{className:"w-4 h-4 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})}):null]}),o&&n&&(0,d.jsx)("div",{className:"bg-gray-50 border-t border-b border-gray-100",children:k.map(a=>{let e=g(a.names[b]??a.names.el,a.slug),f=c===a.slug;return(0,d.jsxs)("button",{type:"button",className:`w-full flex items-center gap-2 pl-10 pr-4 py-2 text-sm text-left transition-colors ${f?"text-green-600 font-medium bg-green-50":"text-gray-600 hover:bg-gray-100"}`,onClick:()=>{h(a.slug),t()},children:[(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:e}),f&&(0,d.jsx)("svg",{className:"w-4 h-4 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},a.id)})})]},a.id)})]})]})}}};