(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,52683,e=>{"use strict";let t;var r=e.i(43476),a=e.i(71645);let n="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),s=new Uint8Array(16),i=[];for(let e=0;e<256;++e)i.push((e+256).toString(16).slice(1));let o=function(e,r,a){if(n&&!r&&!e)return n();var o=e,l=a;let c=(o=o||{}).random??o.rng?.()??function(){if(!t){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");t=crypto.getRandomValues.bind(crypto)}return t(s)}();if(c.length<16)throw Error("Random bytes length must be >= 16");if(c[6]=15&c[6]|64,c[8]=63&c[8]|128,r){if((l=l||0)<0||l+16>r.length)throw RangeError(`UUID byte range ${l}:${l+15} is out of buffer bounds`);for(let e=0;e<16;++e)r[l+e]=c[e];return r}return function(e,t=0){return(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase()}(c)};async function l(e,t){let r=await fetch("https://d5dsl39kaesp3l10j0hp.yl4tuxdu.apigw.yandexcloud.net/chat",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e,thread_id:t})});if(!r.ok)throw Error(`HTTP error! status: ${r.status}`);let a=await r.json();return a.response||a.content||""}e.i(47167);var c=e.i(6538);let d=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),u=(e,t,r,a)=>{let n=e.length;for(let s=0;s{"string"==typeof e?p(e,t,r):"function"==typeof e?x(e,t,r,a):m(e,t,r,a)},p=(e,t,r)=>{(""===e?t:g(t,e)).classGroupId=r},x=(e,t,r,a)=>{f(e)?u(e(a),t,r,a):(null===t.validators&&(t.validators=[]),t.validators.push({classGroupId:r,validator:e}))},m=(e,t,r,a)=>{let n=Object.entries(e),s=n.length;for(let e=0;e{let r=e,a=t.split("-"),n=a.length;for(let e=0;e"isThemeGetter"in e&&!0===e.isThemeGetter;function b(e){return e.replace(/^\[Демонстрация\]\s*/i,"").replace(/^\[DEMO_END\]\s*/i,"").replace(/^\[\[DEMO_END\]\]\s*/i,"").trim()}var v=e.i(91104),w=e.i(83773);let y=/\[\[DEMO_START(?:::|[\s]+)(.*?)\]\]/;function j(e){return e.split("|||").map(e=>e.trim()).filter(Boolean)}let k=e=>new Promise(t=>setTimeout(t,e)),N=/\$\{niche\}/gi;function z(){let{isDemoMode:e}=(0,v.useDemoMode)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:`absolute top-0 left-0 w-[400px] h-[400px] lg:w-[800px] lg:h-[800px] blur-[80px] lg:blur-[120px] rounded-full pointer-events-none -translate-x-1/2 -translate-y-3/4 lg:-translate-y-1/2 mix-blend-screen transition-opacity duration-700 ease-in-out ${e?"opacity-0":"opacity-100"}`,style:{backgroundColor:"rgba(37, 99, 235, 0.1)"}},"blue-gradient-1"),(0,r.jsx)("div",{className:`absolute bottom-0 right-0 w-[400px] h-[400px] lg:w-[800px] lg:h-[800px] blur-[80px] lg:blur-[120px] rounded-full pointer-events-none translate-x-1/3 translate-y-0 lg:translate-y-1/3 mix-blend-screen transition-opacity duration-700 ease-in-out ${e?"opacity-0":"opacity-100"}`,style:{backgroundColor:"rgba(37, 99, 235, 0.2)"}},"blue-gradient-2"),(0,r.jsx)("div",{className:`absolute top-0 left-0 w-[400px] h-[400px] lg:w-[800px] lg:h-[800px] blur-[80px] lg:blur-[120px] rounded-full pointer-events-none -translate-x-1/2 -translate-y-3/4 lg:-translate-y-1/2 mix-blend-screen transition-opacity duration-700 ease-in-out ${e?"opacity-100":"opacity-0"}`,style:{backgroundColor:"rgba(250, 204, 21, 0.2)"}},"yellow-gradient-1"),(0,r.jsx)("div",{className:`absolute bottom-0 right-0 w-[400px] h-[400px] lg:w-[800px] lg:h-[800px] blur-[80px] lg:blur-[120px] rounded-full pointer-events-none translate-x-1/3 translate-y-0 lg:translate-y-1/3 mix-blend-screen transition-opacity duration-700 ease-in-out ${e?"opacity-100":"opacity-0"}`,style:{backgroundColor:"rgba(250, 204, 21, 0.3)"}},"yellow-gradient-2")]})}function M({onStop:e,className:t="",position:n="desktop"}){let s,{isDemoMode:i}=(0,v.useDemoMode)(),{t:o}=(0,w.useLanguage)(),l=function(){let[e,t]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=()=>{let e=document.querySelector("[data-chat-container]");if(!e)return void t(null);let r=e.getBoundingClientRect();t({left:r.left,width:r.width,center:r.left+r.width/2})};e(),window.addEventListener("resize",e);let r=document.querySelector("[data-chat-container]");if(r){let t=new ResizeObserver(e);return t.observe(r),()=>{window.removeEventListener("resize",e),t.disconnect()}}return()=>{window.removeEventListener("resize",e)}},[]),e}();return i?(0,r.jsx)("div",{className:`${"desktop"===n?"fixed bottom-24":"fixed bottom-20"} ${i?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"} flex justify-center transition-all duration-700 ease-in-out z-50 ${t}`,style:(s=i?"translateY(0)":"translateY(0.5rem)","desktop"===n&&l?{left:`${l.center}px`,transform:`translateX(-50%) ${s}`}:{left:"50%",transform:`translateX(-50%) ${s}`}),children:(0,r.jsx)("button",{onClick:e,className:"desktop"===n?"px-4 py-2 text-white/80 hover:text-white text-xs font-medium rounded-full border border-yellow-400/30 hover:border-yellow-400/50 bg-black/60 backdrop-blur-sm hover:bg-black/80 transition-all duration-200 whitespace-nowrap":"px-5 py-2.5 text-white/80 hover:text-white text-sm font-medium rounded-full border border-yellow-400/30 hover:border-yellow-400/50 bg-black/60 backdrop-blur-sm hover:bg-black/80 transition-all duration-200 whitespace-nowrap",suppressHydrationWarning:!0,children:o.chat.stopButton})}):null}let L=`WhatsApp: +62-812-3922-8332 Telegram: @ketly_ai EMAIL: agadjuka@gmail.com`;function C(e){let t;if(!e)return[e];let r=[],a=0,n=/(?a&&r.push(e.substring(a,t.index)),r.push("—"),a=t.index+1;return a0?r:[e]}function S({message:e}){let t="user"===e.role,a=!0===e.isDemoMode;return(0,r.jsxs)("div",{className:`flex gap-3 items-center ${t?"justify-end":"justify-start"}`,children:[!t&&(0,r.jsx)("div",{className:"flex-shrink-0 w-8 h-8 flex items-center justify-center",children:(0,r.jsx)("img",{src:"/android-chrome-512x512.png",alt:"AI",className:"w-full h-full object-contain"})}),(0,r.jsx)("div",{className:`max-w-[85%] sm:max-w-[80%] rounded-2xl px-3 sm:px-4 py-2.5 sm:py-3 transition-colors duration-700 ease-in-out ${t?"bg-zinc-800/40 text-white border border-white/10":a?"bg-yellow-500/8 text-zinc-200 border border-yellow-400/60":"bg-zinc-900/40 text-zinc-200 border border-white/5"}`,children:(0,r.jsx)("p",{className:"text-sm leading-relaxed whitespace-pre-wrap break-words select-text",style:{WebkitUserSelect:"text",userSelect:"text"},children:function(e){let t;if(!e)return e;e=(e=(e=e.replace(/^####\s+/gm,"")).replace(/(.*?)<\/b>/gi,"**$1**").replace(/(.*?)<\/strong>/gi,"**$1**")).replace(/\[\[contact\]\]/gi,(e,t,r)=>{let a=r.substring(0,t);return/\S/.test(a)?` ${L}`:L});let a=[],n=0,s=0,i=/\*\*((?:[^*]|\*(?!\*))+?)\*\*/g;for(;null!==(t=i.exec(e));){if(t.index>n){let r=C(e.substring(n,t.index));r.length>0&&a.push(...r)}let i=C(t[1]);a.push((0,r.jsx)("strong",{className:"font-semibold",children:i},`bold-${s}`)),s++,n=t.index+t[0].length}if(n0&&a.push(...t)}return a.length>0?a:C(e)}(e.content)})})]})}var E=e.i(46932);function T(){return(0,r.jsxs)("div",{className:"flex gap-3 justify-start items-center",children:[(0,r.jsx)("div",{className:"flex-shrink-0 w-8 h-8 flex items-center justify-center",children:(0,r.jsx)("img",{src:"/android-chrome-512x512.png",alt:"AI",className:"w-full h-full object-contain"})}),(0,r.jsx)("div",{className:"bg-white/5 backdrop-blur-md rounded-full px-4 py-2 border border-white/10 shadow-inner shadow-black/10",children:(0,r.jsx)("div",{className:"flex gap-1.5 items-center",children:[0,1,2].map(e=>(0,r.jsx)(E.motion.span,{className:"h-1.5 w-1.5 rounded-full bg-white/70",animate:{opacity:[.2,1,.2],scale:[.6,1.1,.6],y:[0,-2,0]},transition:{duration:.8,repeat:1/0,delay:.15*e,ease:"easeInOut"}},e))})})]})}let D=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},$=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var A={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let _=(0,a.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:o,...l},c)=>(0,a.createElement)("svg",{ref:c,...A,width:t,height:t,stroke:e,strokeWidth:n?24*Number(r)/Number(t):r,className:$("lucide",s),...!i&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(l)&&{"aria-hidden":"true"},...l},[...o.map(([e,t])=>(0,a.createElement)(e,t)),...Array.isArray(i)?i:[i]])),B=(e,t)=>{let r=(0,a.forwardRef)(({className:r,...n},s)=>(0,a.createElement)(_,{ref:s,iconNode:t,className:$(`lucide-${D(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,r),...n}));return r.displayName=D(e),r},R=B("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);function W({onSend:e,disabled:t=!1,onToggleMenu:n}){let[s,i]=(0,a.useState)(""),o=(0,a.useRef)(null),{isDemoMode:l}=(0,v.useDemoMode)(),{t:c}=(0,w.useLanguage)(),d=!s.trim(),u=()=>{d||t||(e(s.trim()),i(""),o.current&&(o.current.style.height="auto"),setTimeout(()=>{o.current?.focus()},0))};return(0,r.jsx)("div",{className:"w-full",children:(0,r.jsxs)("div",{className:`relative flex items-center gap-0.5 bg-black/20 border rounded-2xl px-4 py-2 transition-all duration-700 ease-in-out ${l?"border-yellow-400/50 focus-within:border-yellow-400/70 focus-within:shadow-[0_0_0_1px_rgba(250,204,21,0.3)]":"border-white/10 focus-within:border-white/20 focus-within:shadow-[0_0_0_1px_rgba(255,255,255,0.1)]"}`,children:[n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:n,className:"flex-shrink-0 p-1 rounded-lg bg-white/5 border border-white/5 text-zinc-400 hover:text-sky-400 hover:border-sky-500/20 transition-colors duration-300 lg:hidden group flex items-center justify-center",children:(0,r.jsx)("span",{className:"text-sm",children:"✨"})}),(0,r.jsx)("div",{className:"w-px self-stretch bg-white/10 mx-1 lg:hidden"})]}),(0,r.jsx)("textarea",{ref:o,value:s,onChange:e=>{i(e.target.value),o.current&&(o.current.style.height="auto",o.current.style.height=`${o.current.scrollHeight}px`)},onKeyDown:e=>{let t=window.innerWidth>768;"Enter"===e.key&&!e.shiftKey&&t&&(e.preventDefault(),u())},disabled:t,placeholder:c.chat.inputPlaceholder,rows:1,className:"flex-1 bg-transparent text-white placeholder:text-white/40 text-sm resize-none outline-none overflow-y-auto max-h-[150px] py-1.5 px-1 scrollbar-hide leading-relaxed",suppressHydrationWarning:!0,style:{touchAction:"manipulation",fontSize:"16px",minHeight:"24px"}}),(0,r.jsx)("button",{onClick:u,disabled:d||t,className:`flex-shrink-0 w-6 h-6 flex items-center justify-center transition-all duration-300 ${d||t?"opacity-50 cursor-not-allowed":"opacity-100 hover:opacity-80 active:scale-95"}`,children:(0,r.jsx)(R,{className:`w-4 h-4 stroke-[1.5] transition-colors duration-700 ease-in-out ${d||t?l?"text-yellow-400/70":"text-white/50":l?"text-yellow-300 hover:text-yellow-200":"text-white/70 hover:text-white"}`})})]})})}function O({messages:e,isTyping:t}){let n=(0,a.useRef)(null),s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{n.current?.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[e,t]),(0,a.useEffect)(()=>{if(s.current)return function(e,t={}){let{allowHorizontal:r=!1,allowVertical:a=!0,threshold:n=10}=t,s=null,i=e=>{1===e.touches.length&&(s={x:e.touches[0].clientX,y:e.touches[0].clientY})},o=e=>{if(!s||1!==e.touches.length)return;let t={x:e.touches[0].clientX,y:e.touches[0].clientY},i=Math.abs(t.x-s.x),o=Math.abs(t.y-s.y);if(i>o&&i>n&&!r)return void e.preventDefault();if(o>i&&o>n&&!a)return void e.preventDefault()},l=()=>{s=null};return e.addEventListener("touchstart",i,{passive:!1}),e.addEventListener("touchmove",o,{passive:!1}),e.addEventListener("touchend",l,{passive:!0}),()=>{e.removeEventListener("touchstart",i),e.removeEventListener("touchmove",o),e.removeEventListener("touchend",l)}}(s.current,{allowHorizontal:!1,allowVertical:!0,threshold:10})},[]),(0,r.jsxs)("div",{ref:s,className:"flex-1 overflow-y-auto relative scrollbar-hide scrollable-content",style:{WebkitOverflowScrolling:"touch",overscrollBehavior:"contain"},children:[(0,r.jsx)("div",{className:"sticky top-0 z-10 h-8 bg-gradient-to-b from-black/20 to-transparent pointer-events-none"}),(0,r.jsxs)("div",{className:"px-4 sm:px-6 pt-4 sm:pt-6 pb-2 sm:pb-6 space-y-4",children:[e.map(e=>(0,r.jsx)(S,{message:e},e.id)),t&&(0,r.jsx)(T,{}),(0,r.jsx)("div",{ref:n})]})]})}var H=e.i(74080),U=e.i(88653);let V=B("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),I=B("briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]),P=B("sliders-vertical",[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]]),q=B("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),K=B("monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]),F=B("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Y=B("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]),G={benefits:{icon:V,color:"violet"},audience:{icon:I,color:"indigo"},customization:{icon:P,color:"purple"},integrations:{icon:q,color:"sky"},control:{icon:K,color:"cyan"},edgeCases:{icon:F,color:"orange"},testDrive:{icon:Y,color:"blue"},contact:{icon:B("rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]),color:"emerald"}};function X(e){return e.map(e=>{let t=G[e.id];return{...e,icon:t?.icon??Y,color:t?.color}})}function Z({isOpen:e,onClose:t,onSelect:n}){let[s,i]=(0,a.useState)(!1),{t:o}=(0,w.useLanguage)(),l=(0,a.useMemo)(()=>X(o.capabilities),[o]);if((0,a.useEffect)(()=>{i(!0)},[]),!s)return null;let c=(0,r.jsx)(U.AnimatePresence,{children:e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-[9998]",onClick:t},"overlay"),(0,r.jsxs)(E.motion.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:20},transition:{type:"spring",stiffness:300,damping:25},style:{transformOrigin:"bottom left",backdropFilter:"blur(80px)",WebkitBackdropFilter:"blur(80px)",touchAction:"manipulation"},className:"fixed bottom-[calc(80px+1rem)] left-4 z-[9999] w-max max-w-[calc(100vw-2rem)] sm:max-w-[85vw] bg-zinc-900/20 border border-white/10 rounded-2xl shadow-2xl overflow-hidden",children:[(0,r.jsx)("div",{onClick:t,className:"w-full flex items-center justify-center py-2.5 cursor-pointer hover:bg-white/5 transition-colors active:bg-white/10 border-b border-white/10",children:(0,r.jsx)("div",{className:"w-8 h-1 bg-white/20 rounded-full"})}),(0,r.jsx)("div",{className:"px-2 pb-2",children:(0,r.jsx)("div",{className:"grid grid-cols-1 gap-1 divide-y divide-white/5",children:l.map(e=>(0,r.jsxs)("button",{onClick:()=>{t(),setTimeout(()=>{n(e.payload)},250)},className:"flex items-center gap-3 p-3 hover:bg-white/5 active:bg-white/10 transition-colors text-left group",children:[(0,r.jsx)("div",{className:"p-1.5 rounded-lg bg-white/5 border border-white/5 text-zinc-400 group-hover:text-indigo-400 group-hover:border-indigo-500/20 transition-colors",children:(0,r.jsx)(e.icon,{size:16})}),(0,r.jsx)("span",{className:"font-medium text-zinc-200 text-sm group-hover:text-white transition-colors whitespace-nowrap",children:e.title})]},e.id))})})]},"panel")]})});return(0,H.createPortal)(c,document.body)}let Q={violet:"group-hover:bg-violet-500/10 group-hover:text-violet-400/70",indigo:"group-hover:bg-indigo-500/10 group-hover:text-indigo-400/70",purple:"group-hover:bg-purple-500/10 group-hover:text-purple-400/70",sky:"group-hover:bg-sky-500/10 group-hover:text-sky-400/70",cyan:"group-hover:bg-cyan-500/10 group-hover:text-cyan-400/70",orange:"group-hover:bg-orange-500/10 group-hover:text-orange-400/70",blue:"group-hover:bg-blue-500/10 group-hover:text-blue-400/70",emerald:"group-hover:bg-emerald-500/10 group-hover:text-emerald-400/70"};function J({capability:e,onClick:t}){let a=Q[e.color||"violet"]||Q.violet;return(0,r.jsx)("button",{onClick:()=>t(e.payload),className:"w-full text-left p-2.5 rounded-lg border border-transparent hover:bg-white/5 hover:border-white/5 transition-all duration-300 ease-out group cursor-pointer hover:-translate-y-0.5",children:(0,r.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,r.jsx)("div",{className:`p-1.5 rounded-md bg-transparent text-zinc-600 ${a} transition-all duration-300 ease-out shrink-0`,children:(0,r.jsx)(e.icon,{className:"w-3.5 h-3.5"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("h4",{className:"text-sm font-medium text-zinc-400 group-hover:text-zinc-300 transition-colors duration-300",children:e.title}),(0,r.jsx)("p",{className:"text-xs text-zinc-600 leading-relaxed mt-0.5",children:e.description})]})]})})}let ee="bg-black/40 backdrop-blur-xl border border-white/5 ring-1 ring-white/5 rounded-2xl";function et({containerRef:e,showTop:t,showBottom:a}){let n=t=>{let r=e.current;if(!r)return;let a="down"===t?r.scrollTop+120:r.scrollTop-120;r.scrollTo({top:a,behavior:"smooth"})};return(0,r.jsxs)(r.Fragment,{children:[t&&(0,r.jsxs)("div",{className:"absolute top-[40px] left-0 right-0 z-10 pointer-events-none",children:[(0,r.jsx)("div",{className:"h-10 bg-gradient-to-b from-black/80 via-black/50 to-transparent"}),(0,r.jsx)("button",{onClick:()=>n("up"),className:"absolute top-0 left-1/2 -translate-x-1/2 pointer-events-auto w-14 h-5 flex items-center justify-center bg-zinc-900/70 hover:bg-zinc-800/90 active:bg-zinc-700/95 backdrop-blur-md border border-white/10 hover:border-white/20 rounded transition-all duration-300 ease-out hover:scale-105 active:scale-100 hover:shadow-lg hover:shadow-black/30 group","aria-label":"Прокрутить вверх",children:(0,r.jsx)("svg",{className:"w-3 h-3 text-zinc-400 group-hover:text-white transition-colors duration-300",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M18 15l-6-6-6 6"})})})]}),a&&(0,r.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 z-10 pointer-events-none overflow-hidden rounded-b-2xl",children:[(0,r.jsx)("div",{className:"h-12 bg-gradient-to-t from-black/90 via-black/60 to-transparent pointer-events-none"}),(0,r.jsx)("button",{onClick:()=>n("down"),className:"absolute bottom-2 left-1/2 -translate-x-1/2 pointer-events-auto w-14 h-5 flex items-center justify-center bg-zinc-900/80 hover:bg-zinc-800/95 active:bg-zinc-700/100 backdrop-blur-md border border-white/10 hover:border-white/20 rounded transition-all duration-300 ease-out hover:scale-105 active:scale-100 hover:shadow-lg hover:shadow-black/30 group","aria-label":"Прокрутить вниз",children:(0,r.jsx)("svg",{className:"w-3 h-3 text-zinc-400 group-hover:text-white transition-colors duration-300",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M6 9l6 6 6-6"})})})]})]})}function er({onSendMessage:e}){let{t}=(0,w.useLanguage)(),n=(0,a.useRef)(null),{showTop:s,showBottom:i}=function(e){let[t,r]=(0,a.useState)({showTop:!1,showBottom:!1});return(0,a.useEffect)(()=>{let t=e.current;if(!t)return;let a=()=>{let{scrollTop:e,scrollHeight:a,clientHeight:n}=t,s=a>n;r({showTop:s&&!(e<=5),showBottom:s&&!(e+n>=a-5)})};a(),t.addEventListener("scroll",a,{passive:!0}),window.addEventListener("resize",a,{passive:!0});let n=new ResizeObserver(a);return n.observe(t),()=>{t.removeEventListener("scroll",a),window.removeEventListener("resize",a),n.disconnect()}},[e]),t}(n),o=(0,a.useMemo)(()=>X(t.capabilities),[t]);return(0,r.jsxs)("div",{className:`${ee} overflow-hidden flex flex-col p-5 shadow-xl min-h-0 relative`,children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-zinc-400 mb-4 shrink-0",suppressHydrationWarning:!0,children:t.chat.quickActionsTitle}),(0,r.jsx)("div",{ref:n,className:"space-y-1.5 overflow-y-auto scrollbar-hide flex-1 min-h-0 pb-1",children:o.map(t=>(0,r.jsx)(J,{capability:t,onClick:e},t.id))}),(0,r.jsx)(et,{containerRef:n,showTop:s,showBottom:i})]})}function ea(){let[e,t]=(0,a.useState)(!1),{t:n}=(0,w.useLanguage)();return(0,r.jsx)("div",{className:`${ee} overflow-hidden shadow-xl shrink-0 self-end mt-auto w-48 h-12 flex items-center justify-center transition-all duration-300 ease-out`,children:e?(0,r.jsxs)("div",{className:"animate-in fade-in zoom-in duration-300 flex items-center justify-center gap-6 w-full h-full",children:[(0,r.jsx)("a",{href:"https://t.me/ketly_ai",target:"_blank",rel:"noopener noreferrer",className:"w-8 h-8 flex items-center justify-center text-zinc-400 hover:text-[#229ED9] transition-all duration-300 hover:scale-110",children:(0,r.jsx)("svg",{className:"w-5 h-5 fill-current",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.16.16-.295.293-.605.293l.214-3.054 5.56-5.022c.24-.213-.054-.334-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.942z"})})}),(0,r.jsx)("a",{href:"https://wa.me/6281239228332",target:"_blank",rel:"noopener noreferrer",className:"w-8 h-8 flex items-center justify-center text-zinc-400 hover:text-[#25D366] transition-all duration-300 hover:scale-110",children:(0,r.jsx)("svg",{className:"w-5 h-5 fill-current",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.008-.57-.008-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"})})})]}):(0,r.jsx)("button",{onClick:()=>t(!0),className:"w-full h-full flex items-center justify-center text-sm font-medium text-zinc-400 hover:text-zinc-200 hover:bg-white/5 transition-all duration-300",children:(0,r.jsx)("span",{suppressHydrationWarning:!0,children:n.chat.contactUs})})})}function en(){let[e,t]=(0,a.useState)(!1);return(0,r.jsxs)("div",{className:"fixed right-4 bottom-32 z-40 flex flex-col-reverse items-center gap-3",style:{paddingBottom:"env(safe-area-inset-bottom)"},children:[(0,r.jsx)("button",{onClick:()=>t(!e),className:"w-12 h-12 rounded-full bg-black/40 backdrop-blur-xl border border-white/10 flex items-center justify-center text-zinc-400 hover:text-zinc-200 hover:bg-black/60 transition-all duration-200 shadow-lg hover:shadow-xl active:scale-95",children:(0,r.jsx)(E.motion.div,{animate:{rotate:0},transition:{duration:.2},className:"relative w-6 h-6",children:(0,r.jsx)(U.AnimatePresence,{mode:"wait",children:e?(0,r.jsx)(E.motion.svg,{initial:{opacity:0,rotate:-90},animate:{opacity:1,rotate:0},exit:{opacity:0,rotate:90},transition:{duration:.2},className:"w-6 h-6 fill-current absolute inset-0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})},"close"):(0,r.jsx)(E.motion.svg,{initial:{opacity:0,rotate:-90},animate:{opacity:1,rotate:0},exit:{opacity:0,rotate:90},transition:{duration:.2},className:"w-6 h-6 fill-current absolute inset-0",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z"})},"chat")})})}),(0,r.jsx)(U.AnimatePresence,{children:e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E.motion.a,{initial:{opacity:0,scale:0,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:0,y:20},transition:{duration:.2,delay:.1},href:"https://wa.me/6281239228332",target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"w-12 h-12 rounded-full bg-black/40 backdrop-blur-xl border border-white/10 flex items-center justify-center text-zinc-400 hover:text-[#25D366] hover:border-[#25D366]/30 transition-colors duration-200 shadow-lg active:scale-95",children:(0,r.jsx)("svg",{className:"w-6 h-6 fill-current",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.008-.57-.008-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413Z"})})}),(0,r.jsx)(E.motion.a,{initial:{opacity:0,scale:0,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:0,y:20},transition:{duration:.2,delay:.05},href:"https://t.me/ketly_ai",target:"_blank",rel:"noopener noreferrer",onClick:()=>t(!1),className:"w-12 h-12 rounded-full bg-black/40 backdrop-blur-xl border border-white/10 flex items-center justify-center text-zinc-400 hover:text-[#229ED9] hover:border-[#229ED9]/30 transition-colors duration-200 shadow-lg active:scale-95",children:(0,r.jsx)("svg",{className:"w-6 h-6 fill-current",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M12 0C5.373 0 0 5.373 0 12s5.373 12 12 12 12-5.373 12-12S18.627 0 12 0zm5.894 8.221l-1.97 9.28c-.145.658-.537.818-1.084.508l-3-2.21-1.446 1.394c-.16.16-.295.293-.605.293l.214-3.054 5.56-5.022c.24-.213-.054-.334-.373-.121l-6.869 4.326-2.96-.924c-.64-.203-.658-.64.135-.954l11.566-4.458c.538-.196 1.006.128.832.942z"})})})]})})]})}function es(){let{t:e}=(0,w.useLanguage)();return(0,r.jsx)("div",{className:`${ee} overflow-hidden flex flex-col p-5 shadow-xl shrink-0 relative`,children:(0,r.jsxs)("div",{className:"flex items-center gap-4 mb-1",children:[(0,r.jsx)("div",{className:"w-12 h-12 flex items-center justify-center",children:(0,r.jsx)("img",{src:"/android-chrome-512x512.png",alt:"Logo",className:"w-full h-full object-contain"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-white font-medium",children:"KETLY"}),(0,r.jsx)("div",{className:"flex items-center gap-2 mt-0.5",children:(0,r.jsx)("span",{className:"text-xs text-zinc-500",suppressHydrationWarning:!0,children:e.chat.agentSubtitle})})]})]})})}function ei(){let{isDemoMode:e}=(0,v.useDemoMode)(),{t}=(0,w.useLanguage)();return(0,r.jsxs)("header",{className:"px-4 sm:px-6 py-4 sm:py-5 border-b border-white/5 flex items-center gap-3 shrink-0",children:[(0,r.jsxs)("div",{className:"h-5 flex items-center gap-2 flex-1",children:[(0,r.jsx)("img",{src:"/logo-text-black.png",alt:"Logo",className:"h-full w-auto object-contain"}),(0,r.jsx)("img",{src:"/android-chrome-512x512.png",alt:"Logo",className:"h-5 w-5 object-contain lg:hidden"})]}),(0,r.jsx)("div",{className:"flex items-center gap-3 ml-auto",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:`w-2 h-2 rounded-full transition-all duration-700 ease-in-out ${e?"bg-yellow-400 shadow-[0_0_10px_rgba(250,204,21,0.5)]":"bg-sky-400 shadow-[0_0_10px_rgba(56,189,248,0.5)]"}`}),(0,r.jsx)("span",{className:"text-xs text-zinc-500",suppressHydrationWarning:!0,children:t.chat.onlineStatus})]})})]})}function eo({messages:e,isTyping:t,onSendMessage:a,onQuickMessage:n}){let{t:s}=(0,w.useLanguage)();return(0,r.jsx)("div",{className:"hidden lg:block relative z-10 flex-1 min-h-0 p-4 h-full",children:(0,r.jsxs)("div",{className:"grid grid-cols-[minmax(0,1fr)_minmax(0,3fr)] gap-6 h-full",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4 h-full min-h-0",children:[(0,r.jsx)(es,{}),(0,r.jsx)(er,{onSendMessage:n}),(0,r.jsx)(ea,{})]}),(0,r.jsxs)("div",{"data-chat-container":!0,className:"bg-black/40 backdrop-blur-xl border border-white/5 ring-1 ring-white/5 rounded-2xl overflow-hidden flex flex-col shadow-2xl h-full relative",children:[(0,r.jsx)(ei,{}),(0,r.jsx)(O,{messages:e,isTyping:t}),(0,r.jsx)("div",{className:"p-3 sm:p-4 bg-transparent shrink-0 relative",children:(0,r.jsx)(W,{onSend:a})})]})]})})}function el({messages:e,isTyping:t,onSendMessage:n,onQuickMessage:s}){let[i,o]=(0,a.useState)(!1),{t:l}=(0,w.useLanguage)();return(0,r.jsxs)("div",{className:"lg:hidden flex flex-col flex-1 h-full overflow-hidden relative",children:[(0,r.jsx)("header",{className:"flex-none h-16 z-50 bg-black/40 backdrop-blur-xl border-b border-white/5",style:{paddingTop:"env(safe-area-inset-top)"},children:(0,r.jsx)(ei,{})}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto overscroll-contain touch-pan-y scrollable-content relative pb-32",children:(0,r.jsx)(O,{messages:e,isTyping:t})}),(0,r.jsx)("footer",{className:"flex-none z-50 backdrop-blur-xl pb-[env(safe-area-inset-bottom)]",style:{transform:"translateY(-12px)"},children:(0,r.jsxs)("div",{className:"px-2 pt-0 pb-0 relative",children:[(0,r.jsx)(W,{onSend:n,onToggleMenu:()=>o(e=>!e)}),(0,r.jsx)(Z,{isOpen:i,onClose:()=>o(!1),onSelect:s})]})}),(0,r.jsx)(en,{})]})}function ec(){let{messages:e,isTyping:t,handleSendMessage:n}=function(){let e=function(){let[e,t]=(0,a.useState)("");return(0,a.useEffect)(()=>{t(o())},[]),e}(),{isDemoMode:t,setIsDemoMode:r}=(0,v.useDemoMode)(),{t:n,isLanguageReady:s,isWelcomeInfoShown:i}=(0,w.useLanguage)(),[d,u]=(0,a.useState)([]),[h,p]=(0,a.useState)(!1),[x,m]=(0,a.useState)(!1),g=(0,a.useCallback)((e,t)=>{let r=b(e),a={id:o(),role:"assistant",content:r,createdAt:new Date,isDemoMode:t};u(e=>[...e,a])},[]),f=(0,a.useCallback)(async(e,t)=>{let r=e.map(e=>e.trim()).filter(Boolean);if(0!==r.length){g(r[0],t);for(let e=1;e{var s;let i;if(!a.trim())return;let c=a.trim(),d=(s=n.chat.stopKeyword,i=c.toLowerCase().trim(),Array.from(new Set(["стоп","stop",s.toLowerCase()])).includes(i));d&&r(!1);let h={id:o(),role:"user",content:c,createdAt:new Date,isDemoMode:t};u(e=>[...e,h]),p(!0),await k(1e3),m(!0);try{let a=await l(c,e);m(!1);let s=!d&&t,i=function(e){let t=e.match(y);if(t){let r=t[1].trim(),a=e.replace(y,"").trim();return{isDemoStart:!0,niche:r,mainText:a=a.replace(/^\[Демонстрация\]\s*/i,"").trim()}}return{isDemoStart:!1,mainText:e}}(a);if(i.isDemoStart&&i.niche){let e,t;r(!0),await k(1700),g((e=n.demo.startMessages.acknowledgement,t=i.niche,e.replace(N,t)),!1),await k(500),m(!0),await k(2e3),m(!1),g(n.demo.startMessages.disclaimer,!1),await k(500),m(!0),await k(2e3),m(!1),g(i.mainText,!0)}else if(!t&&/^\[Демонстрация\]/i.test(a.trim())){r(!0),await k(1700),g(n.demo.startMessages.acknowledgement.replace(N,"").replace(/\s+/g," ").trim(),!1),await k(500),m(!0),await k(2e3),m(!1),g(n.demo.startMessages.disclaimer,!1),await k(500),m(!0),await k(2e3),m(!1);let e=b(a),t=j(e);await f(t,!0)}else{let e=j(a);await f(e,s)}}catch(r){m(!1);let e=!d&&t;g(n.demo.startMessages.error,e)}finally{p(!1)}},[g,t,f,e,r,n.demo.startMessages.acknowledgement,n.demo.startMessages.disclaimer,n.chat.stopKeyword,n.demo.startMessages.error]);return(0,a.useEffect)(()=>{if(!s||d.length>0||!i)return;let e=!1;return(async()=>{var t;let r,a,n=(t=window.innerWidth<768,r=(()=>{let{demo:e}=c.dictionaries.ru,t=e?.scenarios?.length?e.scenarios:[],r=Math.floor(Math.random()*t.length);return t[r]??t[0]??""})(),a=(e=>{let{demo:t}=c.dictionaries.ru,r=t?.instructions??{desktop:"",mobile:""};return e?r.mobile:r.desktop})(t),r.replace("{{INSTRUCTION}}",a).split(" ||| ").map(e=>e.trim()).filter(Boolean));await k(1e3),e||(m(!0),await k(2e3),e||(m(!1),e||await f(n,!1)))})(),()=>{e=!0}},[s,i,d.length,f]),{messages:d,isTyping:x,isProcessing:h,sessionId:e,handleSendMessage:z}}(),{isDemoMode:s}=(0,v.useDemoMode)(),{t:i}=(0,w.useLanguage)(),d=e=>{s?(n(i.chat.stopKeyword),setTimeout(()=>{n(e)},700)):n(e)};return(0,r.jsxs)("main",{className:"fixed inset-0 flex flex-col bg-[#050505] text-white h-[100dvh]",children:[(0,r.jsx)(z,{}),(0,r.jsx)(eo,{messages:e,isTyping:t,onSendMessage:n,onQuickMessage:d}),(0,r.jsx)(el,{messages:e,isTyping:t,onSendMessage:n,onQuickMessage:d}),(0,r.jsx)(M,{onStop:()=>n(i.chat.stopKeyword),position:"desktop",className:"hidden lg:block"}),(0,r.jsx)(M,{onStop:()=>n(i.chat.stopKeyword),position:"mobile",className:"lg:hidden"})]})}e.s(["default",()=>ec],52683)}]);