PageSourceSearch

https://asmod.pro/_next/static/chunks/788-b0cb606597be1a00.js

js asmod.pro collected 2026-10-09 21:52:01 UTC 15,669 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[788],{70788:(e,t,a)=>{a.d(t,{A:()=>x});var l=a(64476),r=a(5776),n=a(96274);function i(e){return function(){e|=0;var t=Math.imul((e=e+0x6d2b79f5|0)^e>>>15,1|e);return(((t=t+Math.imul(t^t>>>7,61|t)^t)^t>>>14)>>>0)/0x100000000}}function s(e){var t=e.replace("#",""),a=parseInt(3===t.length?t.split("").map(e=>e+e).join(""):t,16);return[a>>16&255,a>>8&255,255&a]}var c=(e,t,a)=>[Math.round(e[0]+(t[0]-e[0])*a),Math.round(e[1]+(t[1]-e[1])*a),Math.round(e[2]+(t[2]-e[2])*a)];function o(e){var{photoUrl:t,maskUrl:a,starCount:n,colors:o,rgb:d=!1,animation:h,comets:u,className:x}=e,m=(0,r.useRef)(null),v=(0,r.useRef)(null),f=(0,r.useRef)(null),[p,g]=(0,r.useState)(0),[b,w]=(0,r.useState)(null),[M,j]=(0,r.useState)(455/640),[y,k]=(0,r.useState)(0),N=(d?Array.from({length:24},(e,t)=>{var a,l,r,n,i,s,c;return a=360*t/24,l=90,r=72,n=e=>(e+a/30)%12,i=(l/=100)*Math.min(r/=100,1-r),s=e=>r-i*Math.max(-1,Math.min(n(e)-3,Math.min(9-n(e),1))),c=e=>Math.round(255*e).toString(16).padStart(2,"0"),"#".concat(c(s(0))).concat(c(s(8))).concat(c(s(4)))}):o.length?o:["#FFFFFF"]).map(s),S=!d&&N.length>=2;return(0,r.useEffect)(()=>{var e=new Image;e.decoding="async",e.onload=()=>{f.current=e,j(e.naturalWidth/Math.max(1,e.naturalHeight)),g(e=>e+1)},e.onerror=()=>{g(e=>e+1)},e.src=t},[t]),(0,r.useEffect)(()=>{var e=!1;return fetch(a).then(e=>e.ok?e.json():null).then(t=>{e||w(Array.isArray(null==t?void 0:t.zones)?t.zones:Array.isArray(t)?t:[])}).catch(()=>w([])),()=>{e=!0}},[a]),(0,r.useEffect)(()=>{var e,t=()=>{clearTimeout(e),e=setTimeout(()=>k(e=>e+1),200)};return window.addEventListener("resize",t),window.addEventListener("orientationchange",t),()=>{clearTimeout(e),window.removeEventListener("resize",t),window.removeEventListener("orientationchange",t)}},[]),(0,r.useEffect)(()=>{var e=m.current,t=v.current;if(e&&t&&p&&b){var a=t.getContext("2d");if(a){var l=[],r=[];try{var s=Math.max(72,Math.round(110/M)),o=new Uint8Array(110*s),x=.025*s,f=(e,t)=>{for(var a=110*e,l=t*s,r=Math.max(0,Math.floor(a-2.75)),n=Math.min(109,Math.ceil(a+2.75)),i=Math.max(0,Math.floor(l-x)),c=Math.min(s-1,Math.ceil(l+x)),d=i;d<=c;d++)for(var h=r;h<=n;h++).025>Math.hypot((h+.5)/110-e,(d+.5)/s-t)&&(o[110*d+h]=1)};for(var g of b)if("rect"===g.type&&Array.isArray(g.points)&&g.points.length>=2)for(var w=g.points[0],j=g.points[1],y=Math.min(w.x,j.x),k=Math.max(w.x,j.x),C=Math.min(w.y,j.y),F=Math.max(w.y,j.y),A=0;A<s;A++)for(var D=0;D<110;D++){var E=(D+.5)/110,P=(A+.5)/s;E>=y&&E<=k&&P>=C&&P<=F&&(o[110*A+D]=1)}else if("freehand"===g.type&&Array.isArray(g.points))for(var I of g.points)f(I.x,I.y);for(var R=new Uint8Array(o.length),_=0;_<s;_++)for(var L=0;L<110;L++){var U=110*_+L;if(0===L||109===L||0===_||_===s-1){R[U]=0;continue}R[U]=+(!o[U]&&!o[U-1]&&!o[U+1]&&!o[U-110]&&!o[U+110])}for(var z=(e,t)=>{var a=Math.floor(110*e),l=Math.floor(t*s);return!(a<0)&&!(l<0)&&!(a>=110)&&!(l>=s)&&1===R[110*l+a]},T=i(0x9e3779b1*n),B=0,W=0,q=15*n;B<n&&W<q;){W++;var H=T(),G=T();if(z(H,G)){var J=T(),K=J<.75?.3+.2*T():J<.95?.5+.3*T():.8+.4*T(),O=T();l.push({x:H,y:G,size:K,base:.5+.5*T(),phase:T()*Math.PI*2,op:.5+.5*T(),cf:O,c:d?N[Math.floor(T()*N.length)]:S?c(N[0],N[1],O):N[0]}),B++}}var Q=i((n+7)*40503);r=[];for(var V=0;V<u;V++){for(var X=.5,Y=.5,Z=!1,$=0;!Z&&$<200;)$++,X=.15+.7*Q(),Y=.2+.6*Q(),Z=z(X,Y);r.push({x:X,y:Y,ang:(.1+.3*Q())*Math.PI*(.5>Q()?1:-1),len:.1+.05*Q(),c:N[Math.floor(Q()*N.length)],phase:Q()*Math.PI*2})}}catch(e){l=[],r=[]}var ee=Math.min(window.devicePixelRatio||1,2),et=e.clientWidth,ea=e.clientHeight;if(!(et<2)&&!(ea<2)){t.width=Math.round(et*ee),t.height=Math.round(ea*ee),t.style.width="100%",t.style.height="100%",a.setTransform(ee,0,0,ee,0,0);var el=(e,t)=>{a.fillStyle="rgba(".concat(e.c[0],",").concat(e.c[1],",").concat(e.c[2],",").concat(Math.max(0,Math.min(1,t)),")"),a.beginPath(),a.arc(e.x*et,e.y*ea,Math.max(.5,e.size*(et/400)),0,2*Math.PI),a.fill()},er=(e,t)=>{var l=e.x*et,r=e.y*ea,n=e.len*et,i=l-Math.cos(e.ang)*n,s=r-Math.sin(e.ang)*n,[c,o,d]=e.c,h=.7+.3*Math.sin(1.5*t+e.phase),u=a.createLinearGradient(l,r,i,s);u.addColorStop(0,"rgba(".concat(c,",").concat(o,",").concat(d,",").concat(.95*h,")")),u.addColorStop(1,"rgba(".concat(c,",").concat(o,",").concat(d,",0)")),a.strokeStyle=u,a.lineWidth=Math.max(1.2,et/400*1.6),a.beginPath(),a.moveTo(l,r),a.lineTo(i,s),a.stroke(),a.fillStyle="rgba(255,255,255,".concat(.9*h,")"),a.beginPath(),a.arc(l,r,Math.max(1,et/400*1.8),0,2*Math.PI),a.fill()},en=0,ei=e=>{if("twinkle"===h)for(var t=Math.max(1,Math.floor(.03*l.length)),n=0;n<t;n++){var s=l[(7919*e+104729*n)%l.length|0]||l[0];s&&(s.op=.4+.6*i((0|e)*0x9e3779b1+n>>>0)())}(e=>{var t=e/1e3;if(a.clearRect(0,0,et,ea),d||S)for(var n of l){var i=(Math.sin(.5*t+n.cf*Math.PI*2)+1)/2,s=d?n.c:S?c(N[0],N[1],i):n.c,o=n.base;"twinkle"===h?o*=n.op:"pulse"===h?o*=.5+.3*Math.sin(2*t+n.phase):"breathe"===h?o*=.6+.3*Math.sin(.5*t+.3*n.phase):"wave"===h&&(o*=.4+.4*Math.sin((n.x+n.y+.3*t)%1*Math.PI*2)),a.fillStyle="rgba(".concat(s[0],",").concat(s[1],",").concat(s[2],",").concat(Math.max(0,Math.min(1,o)),")"),a.beginPath(),a.arc(n.x*et,n.y*ea,Math.max(.5,n.size*(et/400)),0,2*Math.PI),a.fill()}else for(var u of l){var x=u.base;"twinkle"===h?x*=u.op:"pulse"===h?x*=.5+.3*Math.sin(2*t+u.phase):"breathe"===h?x*=.6+.3*Math.sin(.5*t+.3*u.phase):"wave"===h&&(x*=.4+.4*Math.sin((u.x+u.y+.3*t)%1*Math.PI*2)),el(u,x)}for(var m of r)er(m,t)})(e),en=requestAnimationFrame(ei)};
1return en=requestAnimationFrame(ei),()=>cancelAnimationFrame(en)}}}},[p,b,t,n,d,o.join(","),h,u,M,y]),(0,l.jsxs)("div",{ref:m,className:"relative mx-auto overflow-hidden bg-black rounded-2xl border border-white/10 shadow-2xl ".concat(x||""),style:{aspectRatio:String(M),height:"clamp(400px, 84vh, 800px)",maxWidth:"100%"},children:[(0,l.jsx)("img",{src:t,alt:"Потолок автомобиля",className:"absolute inset-0 w-full h-full object-cover"}),(0,l.jsx)("canvas",{ref:v,className:"absolute inset-0 w-full h-full"})]})}var d=a(87275),h={"anim-none":"none","anim-twinkle":"twinkle","anim-pulse":"pulse","anim-breathe":"breathe","anim-wave":"wave"};function u(e){return e.toLocaleString("ru-RU")+" ₽"}function x(){var e,t,a,i,s,c,x,p,g,b,[w,M]=(0,r.useState)([]),[j,y]=(0,r.useState)(""),[k,N]=(0,r.useState)(null),[S,C]=(0,r.useState)(!0),[F,A]=(0,r.useState)(1500),[D,E]=(0,r.useState)("color-white"),[P,I]=(0,r.useState)("anim-twinkle"),[R,_]=(0,r.useState)(!1),[L,U]=(0,r.useState)(!1),[z,T]=(0,r.useState)(!1),[B,W]=(0,r.useState)("");(0,r.useEffect)(()=>{n.default.get("/cars/makes").then(e=>{var{data:t}=e;M((Array.isArray(t)?t:(null==t?void 0:t.makes)||(null==t?void 0:t.list)||[]).filter(e=>e&&e.slug&&e.title).sort((e,t)=>e.title.localeCompare(t.title,"ru")))}).catch(()=>M([]))},[]),(0,r.useEffect)(()=>{C(!0);var e=j?"/star-sky/config?make=".concat(encodeURIComponent(j)):"/star-sky/config";n.default.get(e).then(e=>{var t,a,l,r,{data:n}=e;N(n);var i=n.tiers.find(e=>e.isRecommended)||n.tiers[0];i&&A(i.stars);var s=(null==(a=n.addons.animation)||null==(t=a.find(e=>e.isDefault))?void 0:t.slug)||"anim-twinkle",c=(null==(r=n.addons.color)||null==(l=r.find(e=>e.isDefault))?void 0:l.slug)||"color-white";I(s),E(c)}).catch(()=>N(null)).finally(()=>C(!1))},[j]);var q=(0,r.useMemo)(()=>(null==k?void 0:k.templates)||[],[k]);(0,r.useEffect)(()=>{q.length&&!q.some(e=>e.slug===B)&&W(q[0].slug)},[q,B]);var H=(null==k?void 0:k.tiers.find(e=>e.stars===F))||(null==k?void 0:k.tiers[0]),G=(null==k?void 0:k.addons)||{},J=null==(e=G.color)?void 0:e.find(e=>e.slug===D),K=null==(t=G.animation)?void 0:t.find(e=>e.slug===P),O=null==(a=G.retrim)?void 0:a[0],Q=null==(i=G.comet)?void 0:i[0],V=null!=(b=null!=(g=null==k||null==(c=k.retrimByClass)?void 0:c[(null==k||null==(s=k.carClass)?void 0:s.slug)||"sedan"])?g:null==O?void 0:O.priceDelta)?b:0,X=(0,r.useMemo)(()=>{var e=(null==H?void 0:H.price)||0;return J&&(e+=J.priceDelta),K&&(e+=K.priceDelta),R&&(e+=V),L&&Q&&(e+=Q.priceDelta),e},[H,J,K,R,V,L,Q]),Y=(null==k?void 0:k.templates.find(e=>e.slug===B))||q[0],Z=(0,r.useMemo)(()=>"color-rgb"===D?{colors:[],rgb:!0}:"color-duo"===D?{colors:["#FFFFFF","#4169E1"],rgb:!1}:{colors:["#FFFFFF"],rgb:!1},[D]),$=h[P]||"twinkle",ee=((null==H?void 0:H.cometBonus)||0)+(L&&Q?3:0),et=(0,r.useMemo)(()=>{var e,t,a=["Звёздное небо: ".concat(F," звёзд"),"Класс: ".concat((null==k||null==(e=k.carClass)?void 0:e.title)||"—"),(null==k||null==(t=k.make)?void 0:t.title)?"Авто: ".concat(k.make.title):"","Цвет: ".concat((null==J?void 0:J.title)||"—"),"Анимация: ".concat((null==K?void 0:K.title)||"—"),R?"Перетяжка: Алькантара":"",L?"Доп. кометы +3":"",z?"Есть люк/панорама":""].filter(Boolean);return a.push("Расчёт: ".concat(u(X))),"Конфигуратор звёздного неба. ".concat(a.join("; "))},[k,F,J,K,R,L,z,X]),ea=(0,r.useMemo)(()=>{var e,t,a;return{service:"Звёздное небо",make:(null==k||null==(e=k.make)?void 0:e.title)||"—",class:(null==k||null==(t=k.carClass)?void 0:t.title)||"—",stars:F,color:(null==J?void 0:J.title)||"—",animation:(null==K?void 0:K.title)||"—",retrim:R?"Алькантара":"нет",cometPack:L,sunroof:z,template:(null==(a=q.find(e=>e.slug===B))?void 0:a.title)||"—",price:X,summary:et}},[k,F,J,K,R,L,z,B,q,X,et]);return(0,l.jsx)("section",{className:"bg-gray-950 text-white",children:(0,l.jsx)("div",{className:"max-w-page mx-auto px-6 sm:px-8 lg:px-12 py-10 lg:py-14",children:(0,l.jsxs)("div",{className:"grid lg:grid-cols-[minmax(420px,560px)_1fr] gap-8 lg:gap-10",children:[(0,l.jsxs)("div",{className:"lg:sticky lg:top-24 lg:self-start",children:[(0,l.jsx)("div",{className:"flex justify-center",children:Y?(0,l.jsx)(o,{photoUrl:Y.photoUrl,maskUrl:"/masks/".concat(Y.slug,".json"),starCount:F,colors:Z.colors,rgb:Z.rgb,animation:$,comets:ee}):(0,l.jsx)("div",{className:"aspect-video bg-black"})}),(0,l.jsxs)("div",{className:"mt-4 flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 text-sm text-white/60",children:[(0,l.jsx)("span",{className:"inline-block w-2 h-2 rounded-full bg-accent"}),"Живая визуализация — меняйте параметры справа"]}),(null==k?void 0:k.carClass)&&(0,l.jsxs)("span",{className:"badge-xs px-3 py-1 rounded-full bg-white/10 text-white/80",children:["Класс авто: ",k.carClass.title]})]})]}),(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs uppercase tracking-wider text-white/50 mb-2",children:"Ваш автомобиль"}),(0,l.jsxs)("select",{value:j,onChange:e=>y(e.target.value),className:"w-full px-4 py-3 rounded-xl bg-white/5 border border-white/10 text-white focus:outline-none focus:border-accent",children:[(0,l.jsx)("option",{value:"",children:"Выберите марку…"}),w.map(e=>(0,l.jsx)("option",{value:e.slug,className:"bg-gray-900",children:e.title},e.slug))]})]}),j?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,l.jsx)("label",{className:"text-xs uppercase tracking-wider text-white/50",children:"Количество звёзд"})}),(0,l.jsx)("div",{className:"grid grid-cols-2 gap-2",children:null==k?void 0:k.tiers.map(e=>{var t=e.stars===F;return(0,l.jsxs)("button",{onClick:()=>A(e.stars),"aria-pressed":t,className:"relative text-left px-3 py-2.5 rounded-xl border transition-all ".concat(t?"border-accent bg-accent/15":"border-white/10 bg-white/5 hover:border-white/30"),children:[e.isRecommended&&(0,l.jsx)("span",{className:"absolute top-1.5 right-1.5 text-[9px] uppercase tracking-wide text-accent",children:"★"}),(0,l.jsxs)("div",{className:"text-sm font-semibold",children:[e.stars.toLocaleStr
1ing("ru-RU")," ★"]}),(0,l.jsx)("div",{className:"text-xs text-white/60",children:u(e.price)}),e.cometBonus>0&&(0,l.jsxs)("div",{className:"text-[10px] text-accent/80",children:["+",e.cometBonus," комета в подарок"]})]},e.stars)})})]}),(0,l.jsx)(m,{title:"Цвет свечения",children:null==(x=G.color)?void 0:x.map(e=>{var t=e.slug===D;return(0,l.jsx)(v,{active:t,onClick:()=>E(e.slug),sub:t?"✓ выбрано":e.priceDelta?"+".concat(u(e.priceDelta)):"бесплатно",children:e.title},e.slug)})}),(0,l.jsx)(m,{title:"Анимация",children:null==(p=G.animation)?void 0:p.map(e=>{var t=e.slug===P;return(0,l.jsx)(v,{active:t,onClick:()=>I(e.slug),sub:t?"✓ выбрано":e.priceDelta?"+".concat(u(e.priceDelta)):"бесплатно",children:e.title},e.slug)})}),O&&(0,l.jsx)(f,{label:O.title,hint:"перетяжка полотна",checked:R,onChange:_,price:V}),Q&&(0,l.jsx)(f,{label:Q.title,hint:"дополнительные кометы",checked:L,onChange:U,price:Q.priceDelta}),(0,l.jsxs)("div",{className:"rounded-2xl bg-gradient-to-r from-accent/20 to-transparent border border-accent/30 p-5",children:[(0,l.jsx)("div",{className:"text-xs uppercase tracking-wider text-white/60",children:"Расчёт стоимости"}),(0,l.jsx)("div",{className:"text-3xl sm:text-4xl font-heading font-bold mt-1",children:S?"…":u(X)}),(0,l.jsx)("div",{className:"text-xs text-white/50 mt-1",children:"Предварительный расчёт. Точную цену назовём после осмотра."})]}),(0,l.jsxs)("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-5",children:[(0,l.jsx)("h3",{className:"font-heading text-lg mb-3",children:"Оформить заявку"}),(null==k?void 0:k.service)&&(0,l.jsx)(d.A,{serviceSlug:k.service.slug,categorySlug:k.service.categorySlug,carMakeSlug:j||void 0,variant:"inline",submitLabel:"Отправить заявку",calculatorData:ea,className:"[&_input]:bg-white/10 [&_input]:border-white/15 [&_input]:text-white [&_input]:placeholder-white/40 [&_label]:text-white/70"})]})]}):(0,l.jsx)("div",{className:"rounded-2xl border border-dashed border-white/15 bg-white/5 p-8 text-center text-white/50 leading-relaxed",children:"\uD83D\uDC46 Выберите марку автомобиля — появятся варианты звёзд, цвета, анимации и стоимость."})]})]})})})}function m(e){var{title:t,children:a}=e;return(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"block text-xs uppercase tracking-wider text-white/50 mb-2",children:t}),(0,l.jsx)("div",{className:"flex flex-wrap gap-2",children:a})]})}function v(e){var{active:t,onClick:a,children:r,sub:n}=e;return(0,l.jsxs)("button",{onClick:a,"aria-pressed":t,className:"px-3 py-2 rounded-xl border text-sm transition-all text-left ".concat(t?"border-accent bg-accent/15 text-white":"border-white/10 bg-white/5 text-white/80 hover:border-white/30"),children:[(0,l.jsx)("div",{children:r}),n&&(0,l.jsx)("div",{className:"text-[10px] text-white/50",children:n})]})}function f(e){var{label:t,hint:a,checked:r,onChange:n,price:i}=e;return(0,l.jsxs)("button",{onClick:()=>n(!r),"aria-pressed":r,className:"w-full flex items-center justify-between px-4 py-3 rounded-xl border border-white/10 bg-white/5 hover:border-white/30 transition-all text-left",children:[(0,l.jsxs)("span",{children:[(0,l.jsxs)("span",{className:"block text-sm",children:[t,i?" (+".concat(u(i),")"):""]}),a&&(0,l.jsx)("span",{className:"block text-[11px] text-white/50",children:a})]}),(0,l.jsx)("span",{className:"relative w-11 h-6 rounded-full transition-colors flex-shrink-0 ".concat(r?"bg-accent":"bg-white/20"),children:(0,l.jsx)("span",{className:"absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white transition-transform ".concat(r?"translate-x-5":"")})})]})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.