(()=>{const q=/^(?:v$|verify(?:$|[-_])|preview(?:$|[-_])|debug(?:$|[-_])|audit(?:$|[-_])|archive(?:$|[-_])|perf(?:$|[-_])|fix(?:$|[-_])|sync(?:$|[-_])|prod(?:$|[-_])|reviews-prod(?:$|[-_])|nav-|glass-|carousel-|current-carousel)/i,B=new URL(window.location.href);let V=!1;if(Array.from(B.searchParams.keys()).forEach($=>{q.test($)&&(B.searchParams.delete($),V=!0)}),V){const $=`${B.pathname}${B.search}${B.hash}`;window.history.replaceState(window.history.state,"",$)}})(),(function(){if(window.__civiusCoreLoaded)return;window.__civiusCoreLoaded=!0,window.__civiusCleanFixesLoaded=!0;const q=window.CiviusData?.store,B=window.CiviusData?.nav,V=window.CiviusData?.routes;if(!q||!B||!V)throw new Error("[civius] canonical runtime must load before site-core.js");const $=q.keys.favorites,He=q.keys.cart,De=q.keys.cartQuantities,H="v040726-5",me="https://functions.yandexcloud.net/d4etulul6hc01jm9a61p",Ue=B.primary.flatMap(e=>e.matchPrefixes.map(i=>({prefix:i,href:e.href}))),Ve=B.pillAnchors,ze=108569434,b=(e,i=document)=>i.querySelector(e),S=(e,i=document)=>Array.from(i.querySelectorAll(e)),We=Array.from(document.querySelectorAll("[data-civius-reveal]")),te=null,W=[],Ye=new URLSearchParams(window.location.search);let ie="all";const z=Array.from(document.querySelectorAll("[data-civius-article-card]")),se=document.querySelector("[data-civius-article-search-input]"),O=Array.from(document.querySelectorAll("[data-civius-article-topic-filter]")),ne=document.querySelector("[data-civius-article-results]"),je=ne?.hasAttribute("data-civius-compact-article-results")||!1,pe=document.querySelector("[data-civius-article-empty]");let D="all",ge="",Y=0;const we=()=>{},ae=new WeakMap;function Ke(e){return ae.has(e)||ae.set(e,{generation:0,animations:new Set,timers:new Set}),ae.get(e)}function Ge(e){e.generation+=1,e.animations.forEach(i=>{try{i.cancel()}catch{}}),e.animations.clear(),e.timers.forEach(i=>window.clearTimeout(i)),e.timers.clear()}function j(e,i,{hold:t=!1}={}){e.animations.add(i),i.finished.then(()=>{if(!t){e.animations.delete(i);try{i.cancel()}catch{}}},()=>{e.animations.delete(i)})}function ye(e,i){return Array.from(e||[]).map((t,n)=>i.get(t)===!0?String(t.dataset.serviceId||t.dataset.articleSlug||t.id||n):"").filter(Boolean).join("|")}function Xe(e,i=1){const t=Array.from(e||[]),n=new Map;if(!t.length)return n;const c=[],s=8;return t.forEach((a,r)=>{const o=a.getBoundingClientRect(),l=Number.isFinite(o.top)?o.top:0,u=Number.isFinite(o.left)?o.left:r;let h=c.find(m=>Math.abs(m.top-l)<=s);h||(h={top:l,items:[]},c.push(h)),h.items.push({card:a,left:u,index:r})}),c.sort((a,r)=>a.top-r.top),c.forEach(a=>{a.items.sort((r,o)=>(i>=0?r.left-o.left:o.left-r.left)||r.index-o.index).forEach((r,o)=>{n.set(r.card,o*70)})}),n}function Le(e,i,{animate:t=!0}={}){if(!e)return;if(!!i){e.hidden=!1,e.setAttribute("aria-hidden","false"),e.classList.toggle("is-civius-empty-fast-enter",!!t),e.classList.remove("is-civius-empty-hidden","is-civius-empty-visible"),requestAnimationFrame(()=>{e.hidden||e.classList.add("is-civius-empty-visible")});return}e.classList.remove("is-civius-empty-fast-enter","is-civius-empty-visible"),e.classList.add("is-civius-empty-hidden"),e.setAttribute("aria-hidden","true"),e.hidden=!0}function Qe(e,i,{animate:t=!1,direction:n=1}={}){const c=Array.from(e||[]);if(!c.length)return;const s=c[0]?.parentElement||null;if(!s)return;const a=Ke(s);Ge(a);const r=a.generation,o=n>=0?1:-1,l=g=>i.get(g)===!0,u=()=>{s.style.height="",s.style.overflow=""},h=()=>{c.forEach(g=>{const L=l(g);g.hidden=!L,g.setAttribute("aria-hidden",L?"false":"true")})},m=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;if(!t||m||typeof c[0]?.animate!="function"){u(),h();return}u();const f=s.getBoundingClientRect().height;c.filter(g=>!g.hidden).forEach(g=>{j(a,g.animate([{opacity:1,transform:"translate3d(0, 0, 0)"},{opacity:0,transform:`translate3d(${-40*o}px, 0, 0)`}],{duration:200,easing:"cubic-bezier(.4,0,.7,1)",fill:"both"}),{hold:!0})});const A=window.setTimeout(()=>{if(a.timers.delete(A),a.generation!==r)return;a.animations.forEach(p=>{try{p.cancel()}catch{}}),a.animations.clear(),s.style.height=`${f}px`,s.style.overflow="hidden",h();const g=s.scrollHeight;j(a,s.animate([{height:`${f}px`},{height:`${g}px`}],{duration:320,easing:"cubic-bezier(.25,.8,.3,1)"})),s.style.height=`${g}px`;const L=c.filter(p=>!p.hidden);L.length&&j(a,s.animate([{opacity:1,transform:`translate3d(${40*o}px, 0, 0)`},{opacity:1,transform:"translate3d(0, 0, 0)"}],{duration:300,easing:"cubic-bezier(.2,.85,.25,1)",fill:"both"}));const d=Xe(L,o);L.forEach(p=>{const y=d.get(p)||0;j(a,p.animate([{opacity:0,transform:"translate3d(0, 16px, 0)"},{opacity:1,transform:"translate3d(0, 0, 0)"}],{duration:320,delay:y,easing:"cubic-bezier(.2,.85,.25,1)",fill:"both"}))});const w=L.reduce((p,y)=>Math.max(p,d.get(y)||0),0),C=window.setTimeout(()=>{a.timers.delete(C),a.generation===r&&(a.animations.forEach(p=>{try{p.cancel()}catch{}}),a.animations.clear(),u())},Math.max(320,320+w)+140);a.timers.add(C)},200);a.timers.add(A)}window.CiviusCatalogFilterMotion=Object.freeze({apply:Qe,signature:ye,setEmpty:Le});function P(e,i={}){const t=String(e||"").trim();if(!t)return;const n={page:window.location.pathname,...i};window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:t,...n}),window.CiviusMetrika=window.CiviusMetrika||{},window.CiviusMetrika.lastGoal={name:t,payload:n,createdAt:new Date().toISOString()},typeof window.ym=="function"&&window.ym(ze,"reachGoal",t,n)}window.CiviusMetrika=window.CiviusMetrika||{},window.CiviusMetrika.goal=P;function re(e,i){const t=e?.target;return t&&typeof t.closest=="function"?t.closest(i):null}function Je(){window.__civiusMetrikaMarkersBound||(window.__civiusMetrikaMarkersBound=!0,document.addEventListener("click",e=>{const i=re(e,"[data-civius-metrika-goal]");i&&P(i.getAttribute("data-civius-metrika-goal"),{label:i.getAttribute("data-civius-metrika-label")||i.textContent.trim().slice(0,80),href:i.getAttribute("href")||""});const t=re(e,'a[href^="/chat/"], a[href="/chat"]');t&&P("chat_open_click",{source:t.closest("[data-civius-glass-nav]")?"nav":"page",href:t.getAttribute("href")||"/chat/"});const n=re(e,'a[href^="/checkout/"], a[href="/checkout"]');n&&P("cart_checkout_click",{href:n.getAttribute("href")||"/checkout/"})}),document.querySelectorAll("[data-civius-metrika-goal-open]").forEach(e=>{e.addEventListener("toggle",()=>{e.open&&P(e.getAttribute("data-civius-metrika-goal-open"),{label:e.getAttribute("data-civius-metrika-label")||""})})}))}function _e(){const e=window.location.pathname||"/";return e.endsWith("/")?e:e+"/"}function oe(e,i){try{return JSON.parse(window.localStorage.getItem(e)||"")??i}catch{return i}}function Ce(e){return q.canonicalServiceId(e)}function Ze(e,i){window.localStorage.setItem(e,JSON.stringify(i));try{window.dispatchEvent(new StorageEvent("storage",{key:e}))}catch{window.dispatchEvent(new Event("storage"))}}function Ee(e){const i=oe(e,[]);return Array.isArray(i)?i.map(Ce).filter(Boolean):[]}function et(){const e=oe(De,{});if(!e||typeof e!="object"||Array.isArray(e))return{};const i={};return Object.entries(e).forEach(([t,n])=>{const c=Ce(t),s=Math.max(0,Number(n||0));c&&s>0&&(i[c]=Math.max(0,Number(i[c]||0))+s)}),i}function tt(){const e=et();return Object.values(e).reduce((t,n)=>t+Math.max(0,Number(n||0)),0)||Ee(He).length}function it(){S(".civius-glass-nav__action--favorite, .civius-glass-nav__action--cart").forEach(e=>{if(!b(".civius-nav-badge",e)){const i=document.createElement("span");i.className="civius-nav-badge is-initializing",i.setAttribute("aria-hidden","true"),i.hidden=!0,e.appendChild(i),window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>i.classList.remove("is-initializing"))})}})}function K(e=null){it();const i=Array.isArray(e?.cart)?e.cart.length:0,t=Array.isArray(e?.favorites)?e.favorites.length:0;let n=i;try{n=Math.max(tt(),i)}catch{n=i}const c=Math.max(Ee($).length,t);S(".civius-glass-nav__action--favorite .civius-nav-badge").forEach(s=>{s.textContent=c>99?"99+":String(c||""),s.hidden=c<1}),S(".civius-glass-nav__action--cart .civius-nav-badge").forEach(s=>{s.textContent=n>99?"99+":String(n||""),s.hidden=n<1})}window.CiviusSyncBadges=K;function st(e){const i=String(e?.type||"").toLowerCase(),t=String(e?.href||"");return i==="service"&&t.startsWith("/services/")&&t!=="/services/"?0:t==="/services/"||t==="/services"?1:(i==="article"||i==="knowledge")&&t.startsWith("/knowledge-base/")&&t!=="/knowledge-base/"?2:t==="/knowledge-base/"||t==="/knowledge-base"?3:4}function R(e){return String(e||"").trim().toLowerCase()}function be(){const e=Array.isArray(window.__CIVIUS_SEARCH_INDEX__)?window.__CIVIUS_SEARCH_INDEX__:[],t=(Array.isArray(window.__CIVIUS_SITE_DATA__?.services)?window.__CIVIUS_SITE_DATA__.services:[]).map(a=>({title:a.title||a.name,href:a.slug?"/services/"+a.slug+"/":a.detailUrl||a.href||"/services/",slug:a.slug||"",id:a.id||a.slug||"",type:"service",meta:a.category||"Услуга",text:[a.title,a.name,a.summary,a.description,a.category].filter(Boolean).join(" ")})),n=S("[data-civius-service-catalog-card], [data-civius-article-card]").map(a=>{const r=a.matches("[data-civius-service-catalog-card]"),o=b(".civius-service-catalog-card__title, .civius-kb-card__title",a),l=b(".civius-service-catalog-card__details, .civius-kb-card__link, a[href]",a),u=o?.textContent?.trim()||l?.getAttribute("aria-label")||"",h=l?.getAttribute("href")||(r?"/services/":"/knowledge-base/");return{title:u,href:h,slug:a.dataset.serviceId||"",id:a.dataset.serviceId||"",type:r?"service":"article",meta:a.dataset.serviceCategory||a.dataset.articleTopic||(r?"Услуга":"Статья"),text:[u,a.dataset.serviceSearch,a.dataset.articleSearch,a.textContent].filter(Boolean).join(" ")}}),c=[{title:"Документы по персональным данным для сайта и бизнеса",href:"/knowledge-base/dokumenty-po-personalnym-dannym-dlya-saita-i-biznesa/",type:"article",meta:"Статья",text:"персональные данные документы сайт бизнес 152-фз согласие политика оферта договор"},{title:"Чек-лист договора",href:"/knowledge-base/",type:"article",meta:"Статья",text:"договор чек-лист условия риск акт оплата ответственность"},{title:"Публичная оферта",href:"/knowledge-base/",type:"article",meta:"Статья",text:"оферта договор сайт пользователь соглашение оплата"},{title:"Тарифы сопровождения договоров",href:"/tariffs/",type:"page",meta:"Раздел",text:"договоры тарифы сопровождение консультации"},{title:"База знаний",href:"/knowledge-base/",type:"article",meta:"Раздел",text:"база знаний статьи документы шаблоны договор"}],s=new Map;return[...t,...n,...c,...e].forEach(a=>{const r=String(a?.title||"").trim(),o=String(a?.href||"").trim();if(!r||!o)return;const l=o+"|"+r;s.has(l)||s.set(l,{...a,title:r,href:o})}),Array.from(s.values())}function Se(e){const i=String(e?.type||"").toLowerCase(),t=String(e?.href||"");return i==="service"||t.startsWith("/services/")&&t!=="/services/"}function ce(e,i){const t=String(e?.href||"").trim();if(Se(e)&&t!=="/services/"&&t!=="/services")return Ae(t,i);if(t==="/services/"||t==="/services"){const s=new URLSearchParams;return s.set("q",i),s.set("highlight",i),"/services/?"+s.toString()}if(t==="/knowledge-base/"||t==="/knowledge-base"){const s=new URLSearchParams;return s.set("q",i),s.set("highlight",i),"/knowledge-base/?"+s.toString()}if(!Se(e))return Ae(e.href,i);const n=new URLSearchParams;n.set("q",i),n.set("highlight",i);const c=String(e.id||e.slug||"").trim();return c&&n.set("service",c),"/services/?"+n.toString()}function Ae(e,i){const t=String(e||"").trim();if(!t||!i)return t;try{const n=new URL(t,window.location.origin);return n.origin!==window.location.origin?t:(n.searchParams.set("highlight",i),n.pathname+n.search+n.hash)}catch{const n=t.includes("?")?"&":"?";return t+n+"highlight="+encodeURIComponent(i)}}function nt(){const e=b("[data-civius-site-search-form]"),i=b("[data-civius-site-search-input]"),t=b("[data-civius-site-search-results]");if(!e||!i||!t)return;e.setAttribute("autocomplete","off"),i.setAttribute("autocomplete","new-password"),i.setAttribute("autocapitalize","off"),i.setAttribute("autocorrect","off"),i.setAttribute("spellcheck","false"),i.setAttribute("name","civius-site-search");let n=[],c=-1;const s=r=>{c=Number.isFinite(r)?r:-1,S(".civius-header-search__result",t).forEach((o,l)=>{o.classList.toggle("is-active",l===c)})},a=()=>{const r=R(i.value);if(c=-1,!r){n=[],t.hidden=!0,t.innerHTML="";return}n=be().map(o=>{const l=R([o.title,o.meta,o.type,o.text].filter(Boolean).join(" ")),u=r.split(/\s+/).filter(Boolean);if(!l.includes(r)&&!u.every(f=>l.includes(f)))return null;const h=R(o.title),m=(h===r?-3:h.startsWith(r)?-2:l.startsWith(r)?-1:0)+st(o)*10;return{...o,score:m}}).filter(Boolean).sort((o,l)=>o.score-l.score||String(o.title).localeCompare(String(l.title),"ru")).slice(0,5),t.innerHTML=n.length?n.map((o,l)=>''+xe(o.title)+''+xe(o.meta||at(o.type))+"").join(""):'
Ничего не нашли. Попробуйте другой запрос.
',t.hidden=!1};t.addEventListener("pointerover",r=>{const o=r.target.closest("[data-civius-search-result-index]");o&&s(Number(o.getAttribute("data-civius-search-result-index")))}),t.addEventListener("focusin",r=>{const o=r.target.closest("[data-civius-search-result-index]");o&&s(Number(o.getAttribute("data-civius-search-result-index")))}),i.addEventListener("input",r=>{r.stopImmediatePropagation(),a()},!0),i.addEventListener("focus",r=>{r.stopImmediatePropagation(),a()},!0),e.addEventListener("submit",r=>{const o=R(i.value);if(!o)return;r.preventDefault(),r.stopImmediatePropagation();const l=n[c]||n[0]||be().find(u=>R(u.title).includes(o));P("site_search_submit",{queryLength:o.length,firstResultType:l?.type||"",firstResultHref:l?ce(l,o):""}),l&&(window.location.href=ce(l,o))},!0)}function at(e){const i=String(e||"").toLowerCase();return i==="service"?"Услуга":i==="article"||i==="knowledge"?"Статья":"Раздел"}function xe(e){return String(e||"").replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function Te(e,i,t){const n=R(t);if(!n)return 0;const c=R(e),s=R(i);if(c===n)return-80;if(c.startsWith(n))return-64;if(c.includes(n))return-48;if(s.startsWith(n))return-24;if(s.includes(n))return-12;const r=n.split(/\s+/).filter(Boolean).reduce((o,l)=>o+(s.includes(l)?1:0),0);return r?-r:999}function G(e){const i=b("[data-civius-service-search-input]"),t=S("[data-civius-service-catalog-card]"),n=t[0]?.parentElement||null;if(!i||!t.length||!n)return;t.forEach((r,o)=>{r.dataset.civiusOriginalOrder||(r.dataset.civiusOriginalOrder=String(o))});const c=String(e||i.value||"").trim();t.slice().sort((r,o)=>{if(!c)return Number(r.dataset.civiusOriginalOrder||0)-Number(o.dataset.civiusOriginalOrder||0);const l=b(".civius-service-catalog-card__title",r)?.textContent||"",u=b(".civius-service-catalog-card__title",o)?.textContent||"",h=Te(l,r.dataset.serviceSearch||r.textContent,c),m=Te(u,o.dataset.serviceSearch||o.textContent,c);return h-m||Number(r.dataset.civiusOriginalOrder||0)-Number(o.dataset.civiusOriginalOrder||0)}).forEach(r=>n.appendChild(r));const a=new URLSearchParams(window.location.search).get("service");a&&t.find(o=>o.dataset.serviceId===a||o.dataset.serviceDetailUrl?.includes("/"+a+"/"))?.classList.add("civius-service-catalog-card--search-focus")}function Ut(){const e=b("[data-civius-service-search-input]");if(!e)return;const t=new URLSearchParams(window.location.search).get("q")||"";if(t?(e.value=t,e.dispatchEvent(new Event("input",{bubbles:!0})),G(t),window.setTimeout(()=>G(t),0)):G(""),e.dataset.civiusRankBound==="1")return;e.dataset.civiusRankBound="1";let n=0;e.addEventListener("input",()=>{n&&window.cancelAnimationFrame(n),n=window.requestAnimationFrame(()=>{n=0,G(e.value)})})}function rt(e){const i=_e();e.forEach(c=>c.removeAttribute("aria-current"));const t=Ue.find(c=>i.startsWith(c.prefix));if(!t)return null;const n=e.find(c=>c.getAttribute("href")===t.href)||null;return n&&n.setAttribute("aria-current","page"),n}function ke(){const e=_e(),i=[".civius-glass-nav__action--favorite",".civius-glass-nav__action--cart",".civius-glass-nav__action--account",".civius-glass-nav__action--chat"],t=()=>{S(".civius-glass-nav").forEach(s=>{s.classList.add("civius-nav-state-ready")})},c=[{prefix:"/favorites/",selector:".civius-glass-nav__action--favorite"},{prefix:"/cart/",selector:".civius-glass-nav__action--cart"},{prefix:"/checkout/",selector:".civius-glass-nav__action--cart"},{prefix:"/account/",selector:".civius-glass-nav__action--account"},{prefix:"/auth/",selector:".civius-glass-nav__action--account"},{prefix:"/chat/",selector:".civius-glass-nav__action--chat"}].find(s=>e.startsWith(s.prefix))?.selector||"";S(i.join(",")).forEach(s=>{const a=!!c&&s.matches(c);s.classList.contains("is-page-active")!==a&&s.classList.toggle("is-page-active",a),a?s.getAttribute("aria-current")!=="page"&&s.setAttribute("aria-current","page"):s.getAttribute("aria-current")==="page"&&s.removeAttribute("aria-current")}),t()}function ot(){const e=b("[data-civius-glass-nav-links]");if(!e||e.dataset.civiusStablePillBound==="1")return;e.dataset.civiusStablePillBound="1";const i=e,t=S("a",i),n=rt(t);let c=n,s=0,a=!!n,r=0;const o=()=>{i.querySelector(".civius-glass-nav__active-pill")?.dispatchEvent(new Event("civius:nav-pill-geometry-change",{bubbles:!0}))},l=f=>{const E=f.getAttribute("href")||"",A=Ve[E];if(i.style.setProperty("--active-pill-scale","1"),A){i.style.setProperty("--active-pill-x",A.x),i.style.setProperty("--active-pill-w",A.width),o();return}const g=i.getBoundingClientRect(),L=f.getBoundingClientRect(),d=Math.max(0,g.width-12);let C=Math.min(d,L.width+18);C=Math.max(54,C);let y=L.left+L.width/2-g.left-C/2;y=Math.max(6,Math.min(y,g.width-C-6)),i.style.setProperty("--active-pill-x",String(Math.round(y))+"px"),i.style.setProperty("--active-pill-w",String(Math.round(C))+"px"),o()},u=f=>{f&&(s&&(window.cancelAnimationFrame(s),s=0),r&&(window.cancelAnimationFrame(r),r=0),c=f,i.classList.add("civius-nav-pill-priming","civius-nav-pill-instant","civius-nav-pill-ready","civius-nav-pill-settled"),i.classList.remove("civius-nav-pill-hidden"),l(f),i.offsetWidth,r=window.requestAnimationFrame(()=>{r=0,i.classList.remove("civius-nav-pill-instant"),i.offsetWidth,i.classList.remove("civius-nav-pill-priming"),a=!0}))},h=f=>{if(!f){a=!1,i.classList.add("civius-nav-pill-hidden"),i.classList.remove("civius-nav-pill-ready"),i.classList.remove("civius-nav-pill-settled"),i.classList.remove("civius-nav-pill-instant"),i.classList.remove("civius-nav-pill-priming");return}if(!a){u(f);return}l(f),i.classList.remove("civius-nav-pill-hidden"),i.classList.add("civius-nav-pill-ready","civius-nav-pill-settled"),a=!0},m=(f=c)=>{c=f||n,s&&window.cancelAnimationFrame(s),s=window.requestAnimationFrame(()=>{s=0,h(c)})};n?(i.classList.add("civius-nav-pill-locked","civius-nav-pill-instant","civius-nav-pill-ready","civius-nav-pill-settled"),i.classList.remove("civius-nav-pill-hidden","civius-nav-pill-priming"),l(n),a=!0,window.requestAnimationFrame(()=>i.classList.remove("civius-nav-pill-instant"))):i.classList.add("civius-nav-pill-hidden"),t.forEach(f=>{f.addEventListener("pointerenter",()=>{c=f,a?m(f):u(f)},{passive:!0}),f.addEventListener("focus",()=>{c=f,a?m(f):u(f)}),f.addEventListener("click",()=>h(f))}),i.addEventListener("pointerleave",()=>m(n),{passive:!0}),i.addEventListener("focusout",()=>m(n)),window.addEventListener("resize",()=>m(c),{passive:!0})}function ct(e){if(!e||e.dataset.civiusBurgerIcon==="loop")return;const i=document.createElement("span");i.className="civius-glass-nav__icon civius-glass-nav__icon--burger-loop",i.innerHTML='',e.replaceChildren(i),e.dataset.civiusBurgerIcon="loop"}function lt(){const e=b("[data-civius-glass-nav]"),i=b("[data-civius-glass-menu-toggle]",e||document),t=b("[data-civius-glass-menu-panel]",e||document);if(!e||!i||!t||(ct(i),i.dataset.civiusBurgerBound==="true"))return;i.dataset.civiusBurgerBound="true";const n=()=>{const s=document.activeElement;s&&t.contains(s)&&typeof s.blur=="function"&&s.blur(),i.setAttribute("aria-expanded","false"),t.setAttribute("aria-hidden","true"),t.setAttribute("inert","")},c=()=>{i.setAttribute("aria-expanded","true"),t.setAttribute("aria-hidden","false"),t.removeAttribute("inert")};i.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),i.getAttribute("aria-expanded")==="true"?n():c()},!0),t.addEventListener("click",s=>{s.target.closest("a")&&n()}),document.addEventListener("click",s=>{i.getAttribute("aria-expanded")==="true"&&(e.contains(s.target)||n())}),document.addEventListener("keydown",s=>{s.key==="Escape"&&n()}),window.addEventListener("resize",n,{passive:!0})}let X=null;function Q(e){const i=document.querySelector('script[src="'+e+'"]');return i?.dataset.civiusLoaded==="1"?Promise.resolve():new Promise((t,n)=>{const c=i||document.createElement("script");c.src=e,c.defer=!0,c.addEventListener("load",()=>{c.dataset.civiusLoaded="1",t()},{once:!0}),c.addEventListener("error",n,{once:!0}),i||document.head.appendChild(c)})}function Me(){window.__CIVIUS_CHAT_PAGE__&&!window.__CIVIUS_CHAT_PAGE__.chatApiUrl&&(window.__CIVIUS_CHAT_PAGE__.chatApiUrl=me),window.CV_CHAT_API_URL||(window.CV_CHAT_API_URL=window.__CIVIUS_CHAT_PAGE__?.chatApiUrl||me)}async function ut(e){let i=e||window.CiviusApi?.readSession?.();if(i?.sessionToken&&!i.profile?.uid)try{const t=await window.CiviusApi.auth("session",{sessionToken:i.sessionToken});window.CiviusApi.saveSession(t),i=window.CiviusApi.readSession?.()||t}catch(t){console.warn("[civius-order] session refresh failed",t)}return i}async function dt(){let e=await ut();return!e?.sessionToken||!e?.profile?.uid?null:(X||(X=(async()=>{if(Me(),window.CiviusChatTransport||await Q("/assets/chat-transport.js?v="+H),!window.CiviusChatTransport?.database||!window.CiviusChatTransport?.FieldValue)return null;const i=window.CiviusChatTransport.setSession({sessionToken:e.sessionToken,profile:e.profile},{persist:!1});return{session:e,user:i,database:window.CiviusChatTransport.database()}})().catch(i=>{throw X=null,i})),X)}async function Vt(e){const i=await dt();if(!i?.user||!i.database)return!1;const t=window.CiviusChatTransport.FieldValue.serverTimestamp(),n=buildOrderChatText(e),c=i.session.profile||{},s=i.database.collection("chats").doc(i.user.uid);return await s.collection("messages").add({senderRole:"user",senderUid:i.user.uid,senderName:c.name||"",text:n,files:[],taskCard:null,orderAction:{type:e.action,orderId:e.orderId||"",orderTitle:e.title||"",text:e.text||""},createdAt:t,replyTo:null}),await s.set({userUid:i.user.uid,userEmail:c.email||"",userName:c.name||"",updatedAt:t,lastMessageAt:t,lastMessageText:n,lastMessageSenderRole:"user",waitingForStaffSince:t,waitingForClientSince:null,status:"open"},{merge:!0}),!0}function ft(){const e=b("#cvClientChatTitle");e&&(e.textContent="Юридическая компания «Civius»")}function Ie(){const e=Math.max(0,window.innerWidth-document.documentElement.clientWidth);document.documentElement.style.setProperty("--civius-scrollbar-width",`${e}px`)}function le(){document.querySelector(".civius-chat-page")&&document.body.classList.add("civius-chat-ready")}function J(){return!!document.querySelector('.cv-admin__messages[data-client-chat-rendered="1"]')}function ht(e=8e3){return window.__civiusClientChatReady===!0&&J()?Promise.resolve():new Promise(i=>{let t=!1,n=0,c=0;const s=()=>r(),a=()=>{window.clearTimeout(n),window.clearInterval(c),window.removeEventListener("civius:client-chat-ready",s)},r=(o=!1)=>{!o&&(window.__civiusClientChatReady!==!0||!J())||t||(t=!0,a(),i())};window.addEventListener("civius:client-chat-ready",s,{once:!0}),c=window.setInterval(r,120),n=window.setTimeout(()=>r(!0),e),window.requestAnimationFrame(()=>{r()})})}async function vt(){return window.__civiusClientChatStackLoading||(window.__civiusClientChatStackLoading=(async()=>{Me(),await Promise.all([window.CiviusChatTransport?Promise.resolve():Q("/assets/chat-transport.js?v="+H),window.CiviusAccount?Promise.resolve():Q("/assets/account-client.js?v="+H)]),window.__civiusClientChatBootstrapped||await Q("/assets/chat-client.js?v="+H)})()),window.__civiusClientChatStackLoading}function mt(){if(!document.querySelector(".civius-chat-page"))return;let e=!1,i=window.__civiusClientChatReady===!0&&J();const t=()=>{if(!(i&&window.__civiusClientChatStackLoading)){if(e&&window.__civiusClientChatReady===!0&&J()){i=!0,le();return}e=!0,vt().then(()=>ht()).then(()=>{i=!0,le()}).catch(n=>{console.error("[civius] client chat stack failed",n),i=!0,le()})}};window.setTimeout(t,0),window.addEventListener("storage",t),document.addEventListener("visibilitychange",()=>{document.hidden||t()}),S(".cv-admin__input, #cvClientChatFileInput, .cv-admin__send, .cv-admin__dropzone").forEach(n=>{n.addEventListener("pointerdown",t,{passive:!0}),n.addEventListener("focusin",t)})}function pt(){if(window.CiviusApi?.clearSession)window.CiviusApi.clearSession();else{window.localStorage.removeItem(authStorageKey),window.localStorage.removeItem("civius:auth-session");try{window.dispatchEvent(new StorageEvent("storage",{key:authStorageKey}))}catch{window.dispatchEvent(new Event("storage"))}}const e=window.CiviusChatTransport?.auth?.();e?.currentUser&&e.signOut()}function gt(){document.addEventListener("click",e=>{const i=e.target.closest('.account-shell-page a[href="/auth/"], .account-shell-page a[href="/auth"]');!i||!/выйти/i.test(i.textContent||"")||(e.preventDefault(),pt(),renderAccountGate(),window.location.href="/auth/?mode=login&signedout=1")},!0)}function wt(){const e=document.querySelector('section.cta[aria-labelledby="cta-title"], section.cta, .civius-section--consultation'),i=document.querySelector('section[aria-labelledby="faq-title"], .civius-section--faq');e&&i&&i.nextElementSibling!==e&&i.insertAdjacentElement("afterend",e)}function yt(){const e=new URLSearchParams(window.location.search).get("highlight"),i=String(e||"").trim(),t=b("#main-content");if(!i||!t||t.dataset.civiusHighlightApplied==="1")return;t.dataset.civiusHighlightApplied="1";const n=i.toLowerCase(),c=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode(r){const o=r.parentElement;return!o||["SCRIPT","STYLE","TEXTAREA","INPUT","MARK"].includes(o.tagName)?NodeFilter.FILTER_REJECT:(r.nodeValue||"").toLowerCase().includes(n)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),s=[];for(;s.length<12;){const r=c.nextNode();if(!r)break;s.push(r)}s.forEach(r=>{const l=(r.nodeValue||"").toLowerCase().indexOf(n);if(l<0)return;const u=document.createRange();u.setStart(r,l),u.setEnd(r,l+i.length);const h=document.createElement("mark");h.className="civius-search-hit";try{u.surroundContents(h)}catch{}});const a=b(".civius-search-hit",t);a&&window.setTimeout(()=>a.scrollIntoView({block:"center",behavior:"smooth"}),120)}function Lt(){const e=b("[data-civius-brief-modal]");if(!e||e.dataset.civiusBriefBound==="1")return;e.dataset.civiusBriefBound="1";const i=b("[data-civius-brief-status]",e),t=b("[data-civius-brief-form]",e);let n=0;const c=()=>{window.clearTimeout(n),e.hidden=!1,document.body.classList.add("civius-brief-modal-open"),window.requestAnimationFrame(()=>e.classList.add("is-open"));const a=b("textarea, input, button",e);window.setTimeout(()=>a?.focus?.(),180),P("brief_open",{service:e.getAttribute("data-service-title")||""})},s=()=>{e.classList.remove("is-open"),document.body.classList.remove("civius-brief-modal-open"),n=window.setTimeout(()=>{e.hidden=!0},240)};S("[data-civius-brief-open]").forEach(a=>{a.addEventListener("click",r=>{r.preventDefault(),c()})}),S("[data-civius-brief-close]",e).forEach(a=>{a.addEventListener("click",r=>{r.preventDefault(),s()})}),document.addEventListener("keydown",a=>{a.key==="Escape"&&!e.hidden&&s()}),t?.addEventListener("submit",a=>{a.preventDefault();const r=new FormData(t),o=Array.from(r.entries()).map(([h,m])=>({key:h,value:String(m||"").trim()})).filter(h=>h.value),l=oe("civius:briefs",[]),u={service:e.getAttribute("data-service-title")||document.title,answers:o,createdAt:new Date().toISOString()};Ze("civius:briefs",Array.isArray(l)?[u,...l].slice(0,20):[u]),i&&(i.textContent="Бриф сохранён. Мы увидим ответы при разборе задачи."),P("brief_submit",{service:u.service,answers:o.length}),window.setTimeout(s,700)})}function Be(e,i,t,n={}){if(!e||!i||!t)return;const c=n.dataKey||"civiusFaqMotionBound";if(e.dataset[c]==="1")return;e.dataset[c]="1",e.classList.add(n.className||"civius-faq-motion");const s=n.duration||250,a=n.easing||"cubic-bezier(0.2, 0.82, 0.22, 1)",r=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches,o=()=>typeof n.openPadding=="function"?n.openPadding():n.motionPadding??n.openPadding??"0px";let l=0,u=null,h=e.open,m=0;e.style.overflow="hidden",i.setAttribute("aria-expanded",e.open?"true":"false"),t.style.display="block",t.style.boxSizing="border-box",t.style.margin="0",t.style.overflow="hidden",t.style.willChange="height, opacity, transform",t.style.transition=`height ${s}ms ${a}, opacity ${Math.min(180,s)}ms ease, transform ${s}ms ${a}, padding-bottom ${s}ms ${a}`;const f=t.style.transition,E=w=>{t.style.setProperty("transition",w?f:"none","important")},A=()=>{const w=t.style.height,C=t.style.paddingBottom,p=t.style.opacity,y=t.style.transform;E(!1),t.style.height="auto",t.style.paddingBottom=o(),t.style.opacity="1",t.style.transform="translateY(0)";const _=Math.ceil(t.getBoundingClientRect().height||t.scrollHeight);return t.style.height=w,t.style.paddingBottom=C,t.style.opacity=p,t.style.transform=y,t.offsetHeight,E(!0),_},g=()=>{e.classList.add("is-open"),t.style.opacity="1",t.style.transform="translateY(0)",t.style.paddingBottom=o()},L=()=>{e.classList.remove("is-open"),t.style.height="0px",t.style.opacity="0",t.style.transform="translateY(-4px)",t.style.paddingBottom="0px"};e.open?(g(),t.style.height="auto"):L();const d=(w,C)=>{if(C!==m)return;window.clearTimeout(l);const p=u;u&&(u.onfinish=null,u.oncancel=null,u=null),p?.cancel?.(),E(!1),delete e.dataset.civiusFaqMoving,w?(e.open=!0,g(),t.style.height="auto"):(e.open=!1,L()),i.setAttribute("aria-expanded",w?"true":"false"),t.offsetHeight,E(!0)};i.addEventListener("click",w=>{w.preventDefault(),u&&(u.cancel(),u=null),h=!h;const C=h,p=++m;if(e.dataset.civiusFaqMoving="1",window.clearTimeout(l),E(!1),C){e.open=!0;const y=A();if(e.classList.remove("is-open"),t.style.height="0px",t.style.opacity="0",t.style.transform="translateY(-4px)",t.style.paddingBottom="0px",r){g(),d(!0,p);return}e.classList.add("is-open"),u=t.animate([{height:"0px",opacity:0,transform:"translateY(-4px)",paddingBottom:"0px"},{height:`${y}px`,opacity:1,transform:"translateY(0)",paddingBottom:o()}],{duration:s,easing:a,fill:"both"}),t.style.height=`${y}px`,t.style.opacity="1",t.style.transform="translateY(0)",t.style.paddingBottom=o()}else{const y=Math.ceil(t.getBoundingClientRect().height||t.scrollHeight);if(t.style.height=`${y}px`,e.classList.remove("is-open"),r){d(!1,p);return}u=t.animate([{height:`${y}px`,opacity:1,transform:"translateY(0)",paddingBottom:o()},{height:"0px",opacity:0,transform:"translateY(-4px)",paddingBottom:"0px"}],{duration:s,easing:a,fill:"both"}),t.style.height="0px",t.style.opacity="0",t.style.transform="translateY(-4px)",t.style.paddingBottom="0px"}u.onfinish=()=>{d(C,p)},u.oncancel=()=>{window.clearTimeout(l)},l=window.setTimeout(()=>{d(C,p)},s+140)})}function _t(){const e=S(".faq details");e.length&&e.forEach(i=>{Be(i,b("summary",i),b("p",i),{dataKey:"civiusFaqDetailBound",className:"civius-faq-motion",duration:250,easing:"cubic-bezier(0.2, 0.82, 0.22, 1)",openPadding:()=>window.innerWidth<=767?"10px":"15px"})})}function Ct(){const e=[...S(".civius-service-catalog__chips"),...S(".civius-kb-design__chips")],i=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;e.forEach(t=>{if(t.dataset.civiusSlidingTabsBound==="1")return;const n=S('button, a[href^="#"]',t);if(!n.length)return;const c=t.hasAttribute("data-civius-tariff-tabs");t.dataset.civiusSlidingTabsBound="1",t.classList.add("civius-sliding-tabs"),c&&t.classList.add("civius-sliding-tabs--tariff"),i&&t.classList.add("civius-sliding-tabs--reduced");let s=null,a=null;i||(s=t.querySelector(".civius-sliding-tabs__indicator"),s||(s=document.createElement("span"),s.className="civius-sliding-tabs__indicator",s.setAttribute("aria-hidden","true"),t.insertBefore(s,t.firstChild)),t.classList.add("civius-sliding-tabs--dom-indicator"));let r=0,o=null,l=null,u=0,h=null;const m=()=>{u+=1,h=null},f=()=>n.find(d=>d.classList.contains("is-active")||d.getAttribute("aria-pressed")==="true")||n[0],E=(d,w=!1)=>{l=d||null,t.classList.toggle("civius-sliding-tabs--hovering",!!(l&&w)),n.forEach(C=>C.classList.toggle("is-pill-target",C===l))},A=d=>{const w=`${u}|${t.scrollLeft}`;if(h&&h.tab===d&&h.key===w)return h.frame;const C=t.getBoundingClientRect(),p=d.getBoundingClientRect(),y=k=>Number(k.toFixed(2)),_={x:y(p.left-C.left+t.scrollLeft),y:y(p.top-C.top),w:y(p.width),h:y(p.height)};return h={tab:d,key:w,frame:_},_},g=(d=f(),w=!1,C=!1)=>{if(!d)return;const p=T=>Number(T.toFixed(2)),y=A(d),_=y.x,k=y.y,M=y.w,I=y.h,he=()=>{if(!s)return null;const T=window.getComputedStyle(s),v=window.DOMMatrixReadOnly||window.DOMMatrix||null,x=v&&T.transform&&T.transform!=="none"?new v(T.transform):null;return{x:x?p(x.m41):Number(s.dataset.x||_),y:x?p(x.m42):Number(s.dataset.y||k),w:p(parseFloat(T.width)||Number(s.dataset.w||M)),h:p(parseFloat(T.height)||Number(s.dataset.h||I))}},F=()=>{t.style.setProperty("--tabs-pill-x",_+"px"),t.style.setProperty("--tabs-pill-y",k+"px"),t.style.setProperty("--tabs-pill-w",M+"px"),t.style.setProperty("--tabs-pill-h",I+"px"),s&&(s.style.width=M+"px",s.style.height=I+"px",s.style.transform=`translate3d(${_}px, ${k}px, 0)`,s.dataset.x=String(_),s.dataset.y=String(k),s.dataset.w=String(M),s.dataset.h=String(I)),o=k},ve=()=>{if(!s||w||i||!t.classList.contains("civius-sliding-tabs--ready")){a&&(a.oncancel=null,a.cancel(),a=null),F();return}const T=he()||{x:_,y:k,w:M,h:I};a&&(a.oncancel=null,a.cancel());const v=s.animate([{transform:`translate3d(${T.x}px, ${T.y}px, 0)`,width:`${T.w}px`,height:`${T.h}px`},{transform:`translate3d(${_}px, ${k}px, 0)`,width:`${M}px`,height:`${I}px`}],{duration:c?245:210,easing:"cubic-bezier(0.22, 1, 0.36, 1)",fill:"both"});a=v,v.onfinish=()=>{a===v&&(F(),a=null)},v.oncancel=()=>{a===v&&(a=null)}};E(d,C),s?ve():F(),t.classList.toggle("civius-sliding-tabs--instant",!!w),t.classList.add("civius-sliding-tabs--ready")},L=(d,w=!1,C=!1)=>{r&&window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{r=0,g(d||f(),w,C),w&&window.requestAnimationFrame(()=>t.classList.remove("civius-sliding-tabs--instant"))})};if(n.forEach(d=>{d.addEventListener("pointerdown",()=>g(d,!1,!0),{passive:!0}),d.addEventListener("pointerenter",()=>{s?g(d,!1,!0):L(d,!1,!0)},{passive:!0}),d.addEventListener("focus",()=>L(d,!1,!0)),s?d.addEventListener("click",()=>g(d),!0):d.addEventListener("click",()=>L(d))}),t.addEventListener("pointerleave",()=>L(f()),{passive:!0}),t.addEventListener("focusout",()=>window.setTimeout(()=>{t.contains(document.activeElement)||L(f())},0)),L(f(),!0),"MutationObserver"in window){const d=new MutationObserver(m);n.forEach(w=>d.observe(w,{attributes:!0,attributeFilter:["class","aria-pressed","style"]}))}document.fonts?.ready?.then(()=>{m(),L(f(),!0)}).catch(()=>{}),window.addEventListener("resize",()=>{m(),L()},{passive:!0}),t.addEventListener("scroll",()=>{m(),L(f(),!0)},{passive:!0})})}function Et(){const e=S("iframe[data-civius-lazy-iframe][data-src]");if(!e.length)return;const i=n=>{if(!n||n.getAttribute("src"))return;const c=n.getAttribute("data-src");c&&n.setAttribute("src",c)};if(!("IntersectionObserver"in window)){e.forEach(i);return}const t=new IntersectionObserver(n=>{n.forEach(c=>{c.isIntersecting&&(i(c.target),t.unobserve(c.target))})},{rootMargin:"360px 0px"});e.forEach(n=>t.observe(n))}function bt(){const e=S('section[aria-labelledby="faq-title"] .faq-item');e.length&&e.forEach(i=>{const t=b("summary",i),n=b("p",i);Be(i,t,n,{dataKey:"civiusFaqBound",className:"civius-faq-animated",duration:380,easing:"cubic-bezier(0.2, 0.72, 0.22, 1)",openPadding:()=>window.innerWidth<=767?"16px":"24px"})})}function Pe(e=document){const i=e instanceof Element?e:document,t=".c-button, .c-icon-button, .civius-glass-nav__action",n=i.matches?.(t)?[i]:Array.from(i.querySelectorAll?.(t)||[]);if(!n.length&&window.__civiusButtonInteractionObserverBound)return;const c=s=>{if(!s.classList.contains("c-button"))return;const a=s.querySelector(":scope > i");!a||a.dataset.civiusButtonIconReady==="css"||(a.querySelectorAll(":scope > .c-button__svg").forEach(r=>r.remove()),!(a.children.length||a.textContent.trim())&&(a.dataset.civiusButtonIconReady="css",a.setAttribute("aria-hidden","true")))};n.forEach(s=>{if(s.classList.contains("hero-splash-btn")||s.classList.contains("services-mobile-dot")||(c(s),s.dataset.civiusButtonInteractionBound==="1"))return;s.dataset.civiusButtonInteractionBound="1";let a=0,r=0,o=0,l=0,u=0,h=0,m=null,f=null,E=0;const A=150,g=430,L=500,d=560,w=30,C=g,p=d,y=700,_=()=>window.performance&&typeof performance.now=="function"?performance.now():Date.now(),k=v=>v&&(v.pointerType==="touch"||v.pointerType==="pen")?"touch":"pointer",M=()=>{window.clearTimeout(r),window.clearTimeout(o),window.clearTimeout(l),window.clearTimeout(u),window.clearTimeout(h)},I=()=>s.disabled||s.getAttribute("aria-disabled")==="true"||s.classList.contains("is-loading"),he=()=>{window.clearTimeout(l),window.clearTimeout(u),window.clearTimeout(h),s.classList.remove("is-accenting","is-accent-releasing"),l=window.setTimeout(()=>{s.classList.add("is-accenting")},w)},F=(v,x)=>{if(!I()&&!((v==="mouse"||v==="pointer")&&x&&x.button!==void 0&&x.button!==0)&&!s.classList.contains("is-pressing")&&(M(),f=v,a=_(),s.classList.remove("is-releasing","is-accent-releasing"),s.classList.add("is-hovering","is-pressing"),v==="touch"&&he(),x&&x.pointerId!==void 0)){m=x.pointerId;try{s.setPointerCapture?.(x.pointerId)}catch{}}},ve=v=>{if(v!=="touch")return;window.clearTimeout(u),window.clearTimeout(h);const x=_()-a,U=Math.max(0,C-x);u=window.setTimeout(()=>{window.clearTimeout(l),s.classList.remove("is-accenting"),s.classList.add("is-accent-releasing"),h=window.setTimeout(()=>{s.classList.remove("is-accent-releasing")},p)},U)},T=(v,x)=>{if(!s.classList.contains("is-pressing")||x&&x.pointerId!==void 0&&m!==null&&x.pointerId!==m)return;if(m!==null)try{s.releasePointerCapture?.(m)}catch{}m=null;const U=f||v;f=null;const Ht=_()-a,Dt=Math.max(0,(U==="touch"?g:A)-Ht);ve(U),window.clearTimeout(r),r=window.setTimeout(()=>{s.classList.remove("is-hovering","is-pressing"),s.classList.add("is-releasing"),o=window.setTimeout(()=>{s.classList.remove("is-hovering","is-pressing","is-releasing")},U==="touch"?d:L)},Dt)};window.PointerEvent?(s.addEventListener("pointerdown",v=>{v.pointerType==="mouse"&&v.button!==0||(v.pointerType==="touch"&&(E=Date.now()),F(k(v),v))}),s.addEventListener("pointerup",v=>T(k(v),v)),s.addEventListener("pointercancel",v=>T(k(v),v)),s.addEventListener("lostpointercapture",()=>{m=null})):(s.addEventListener("touchstart",v=>{v.touches&&v.touches.length>1||(E=Date.now(),F("touch",v))},{passive:!0}),s.addEventListener("touchend",v=>T("touch",v),{passive:!0}),s.addEventListener("touchcancel",v=>T("touch",v),{passive:!0}),s.addEventListener("mousedown",v=>{Date.now()-E{Date.now()-E{if(Date.now()-E{M(),m=null,f=null,s.classList.remove("is-hovering","is-pressing","is-releasing","is-accenting","is-accent-releasing")})}),!window.__civiusButtonInteractionObserverBound&&document.body&&"MutationObserver"in window&&(window.__civiusButtonInteractionObserverBound=!0,new MutationObserver(a=>{a.forEach(r=>{r.addedNodes.forEach(o=>{o instanceof Element&&Pe(o)})})}).observe(document.body,{childList:!0,subtree:!0}))}function St(){const e=S(".hero-splash-btn");if(!e.length||window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches)return;const i=1900,t=2e3,n=900,c=920;let s=!0;const a=e[0].closest(".hero")||e[0].parentElement;a&&"IntersectionObserver"in window&&new IntersectionObserver(o=>{s=o.some(l=>l.isIntersecting)},{rootMargin:"160px 0px"}).observe(a),e.forEach(r=>{if(r.dataset.civiusHeroSplashBound==="1")return;r.dataset.civiusHeroSplashBound="1";let o=0,l=0,u=0,h=0,m=!1,f="";const E=r.classList.contains("hero-splash-btn--chat"),A=()=>{const d=r.classList.contains("is-hero-hover-cycle")||r.classList.contains("is-hero-auto-cycle");o=0,r.classList.remove("is-hero-hover-cycle","is-hero-auto-cycle"),m=!1,f="",!(!E||!d)&&(window.clearTimeout(l),r.classList.add("is-hero-returning"),l=window.setTimeout(()=>{l=0,r.classList.remove("is-hero-returning")},n))},g=(d="hover")=>r.classList.contains("is-hero-hover-cycle")||r.classList.contains("is-hero-auto-cycle")?!1:(window.clearTimeout(o),window.clearTimeout(l),r.classList.remove("is-hero-returning"),m=!1,f=d,r.classList.add(d==="auto"?"is-hero-auto-cycle":"is-hero-hover-cycle"),o=window.setTimeout(()=>{o=0,m=!0,(f==="auto"||!r.matches(":hover, :focus-visible"))&&A()},i),!0),L=(d=t)=>{E&&(window.clearTimeout(u),u=window.setTimeout(()=>{s&&!document.hidden&&!document.documentElement.classList.contains("civius-scroll-active")&&!r.matches(":hover, :focus-visible")&&g("auto"),L(i+t)},d))};r.addEventListener("pointerenter",()=>g("hover"),{passive:!0}),r.addEventListener("pointerleave",()=>{m&&A()},{passive:!0}),r.addEventListener("focusin",()=>g("hover")),r.addEventListener("focusout",()=>{m&&!r.matches(":hover, :focus-visible")&&A()}),r.addEventListener("click",d=>{const w=r.getAttribute("href");if(!w||d.defaultPrevented||d.button!==0||d.metaKey||d.ctrlKey||d.shiftKey||d.altKey||r.getAttribute("target")&&r.getAttribute("target")!=="_self")return;if(E||w==="/chat/"||w==="/chat"||w.startsWith("/chat/?")){window.clearTimeout(h),window.clearTimeout(u),r.classList.add("is-hero-clicking"),h=window.setTimeout(()=>r.classList.remove("is-hero-clicking"),260);return}d.preventDefault(),window.clearTimeout(h),window.clearTimeout(u),g("hover"),r.classList.add("is-hero-clicking"),h=window.setTimeout(()=>{r.classList.remove("is-hero-clicking"),window.location.href=w},c)}),L()})}function At(){const e=document.querySelector("[data-civius-consultation-splash]"),i=document.querySelector(".hero-splash-btn--telegram:not(.hero-splash-btn--consultation)");if(!e||!i||e.dataset.civiusConsultationSplashReady==="1")return;const t=n=>Array.from(n).map((c,s)=>{const a=document.createElement("span");return a.dataset.label=c,a.style.setProperty("--i",String(s+1)),c===" "?(a.className="hero-splash-btn__space",a.textContent=" "):a.textContent=c,a});e.replaceChildren(...Array.from(i.children,n=>n.cloneNode(!0))),e.className="hero-splash-btn hero-splash-btn--telegram hero-splash-btn--consultation",e.setAttribute("aria-label","Получить консультацию"),e.querySelector(".hero-splash-btn__chars--one")?.replaceChildren(...t("Получить консультацию")),e.querySelector(".hero-splash-btn__chars--two")?.replaceChildren(...t("Открыть чат")),e.dataset.civiusConsultationSplashReady="1"}function xt(){const e=S(".civius-home-page .benefit-card");if(!e.length||window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches)return;const i=e[0].closest(".benefits");i&&"IntersectionObserver"in window&&new IntersectionObserver(l=>{i.classList.toggle("is-benefits-paused",!l.some(u=>u.isIntersecting))},{rootMargin:"180px 0px"}).observe(i);const t=64,n=18,c=13,s=new Map;let a=null;const r=o=>{let l=0,u=0,h=0,m=0,f=0,E=null,A=0,g=!1;const L=p=>{const y=A?Math.min(34,p-A):16.67,_=g?320:230,k=1-Math.exp(-y/_);if(A=p,m+=(u-m)*k,f+=(h-f)*k,Math.abs(u-m)<.025&&(m=u),Math.abs(h-f)<.025&&(f=h),o.style.setProperty("--benefit-hover-x",`${m.toFixed(2)}px`),o.style.setProperty("--benefit-hover-y",`${f.toFixed(2)}px`),m!==u||f!==h){l=window.requestAnimationFrame(L);return}l=0,A=0,g&&(g=!1,E=null,o.classList.remove("is-benefit-magnet"))},d=()=>{l||(l=window.requestAnimationFrame(L))},w=()=>{u=0,h=0,g=!0,d()};return{card:o,reset:w,update:(p,y=null)=>{const _=E||y;if(!_?.width||!_.height)return!1;if(!(p.clientX>=_.left-t&&p.clientX<=_.right+t&&p.clientY>=_.top-t&&p.clientY<=_.bottom+t))return w(),!1;E||=_,g=!1,o.classList.add("is-benefit-magnet");const M=_.left+_.width/2,I=_.top+_.height/2;return u=Math.max(-1,Math.min(1,(p.clientX-M)/(_.width/2+t)))*n,h=Math.max(-1,Math.min(1,(p.clientY-I)/(_.height/2+t)))*c,d(),!0}}};e.forEach(o=>{if(o.dataset.civiusBenefitMagnetBound==="1")return;o.dataset.civiusBenefitMagnetBound="1";const l=r(o);s.set(o,l),o.addEventListener("pointerenter",u=>{a&&a!==l&&a.reset(),a=l,l.update(u,o.getBoundingClientRect())||(a=null)},{passive:!0}),o.addEventListener("pointercancel",()=>{l.reset(),a===l&&(a=null)},{passive:!0}),o.addEventListener("blur",()=>{l.reset(),a===l&&(a=null)},!0)}),window.addEventListener("pointermove",o=>{a&&(a.update(o)||(a=null))},{passive:!0}),window.addEventListener("blur",()=>{a?.reset(),a=null})}function Tt(e,i=""){const t=Number(e||0),n=t%10,c=t%100;let s="статей";return n===1&&c!==11?s="статья":n>=2&&n<=4&&(c<12||c>14)&&(s="статьи"),i?`${i}${t} ${s}`:`${t} ${s}`}function ue(e={}){if(!z.length)return;const i=String(se?.value||"").trim().toLowerCase(),t=D;let n=0;const c=new Map;z.forEach(l=>{const u=String(l.dataset.articleSearch||"").toLowerCase(),h=String(l.dataset.articleTopic||"").trim(),E=(!i||u.includes(i))&&(t==="all"||h===t);c.set(l,E),E&&(n+=1)});const s=ye(z,c),a=s!==ge;ge=s;const r=e?.animate===!0&&a&&n>0,o=window.CiviusCatalogFilterMotion;if(o&&typeof o.apply=="function"?o.apply(z,c,{animate:r,direction:e?.direction||1}):z.forEach(l=>{const u=c.get(l)===!0;l.hidden=!u,l.setAttribute("aria-hidden",u?"false":"true")}),ne){const l="Найдено: ";ne.textContent=je?`Найдено: ${n}`:Tt(n,l)}pe&&Le(pe,n===0,{animate:!0})}function kt(){Y&&window.clearTimeout(Y),Y=window.setTimeout(()=>{Y=0,ue({animate:!0,direction:1})},120)}function Z(e,i,t){e.forEach(n=>{const s=n.getAttribute(t)===i;n.classList.toggle("is-active",s),n.setAttribute("aria-pressed",s?"true":"false")})}function Mt(){if(te){const e=Ye.get("q")||"";e&&(te.value=e),te.addEventListener("input",we)}if(W.length&&(Z(W,ie,"data-civius-service-category-filter"),W.forEach(e=>{e.addEventListener("click",()=>{ie=e.getAttribute("data-civius-service-category-filter")||"all",Z(W,ie,"data-civius-service-category-filter"),we()})})),se&&se.addEventListener("input",kt),O.length){const e=O.find(i=>i.getAttribute("data-civius-article-topic-filter")==="Legal Tech");window.location.hash==="#faq"&&e&&(D="Legal Tech"),Z(O,D,"data-civius-article-topic-filter"),O.forEach(i=>{i.addEventListener("click",()=>{const t=D;D=i.getAttribute("data-civius-article-topic-filter")||"all";const n=O.findIndex(a=>a.getAttribute("data-civius-article-topic-filter")===t),s=O.indexOf(i)>=n?1:-1;Z(O,D,"data-civius-article-topic-filter"),ue({animate:!0,direction:s})})})}}const Re=new Set,de=new Set,fe=[],It=2;let ee=0,Fe=!1;function qe(e){const i=String(e||"").trim();if(!i||i.startsWith("#"))return null;try{const t=new URL(i,window.location.href);return t.origin!==window.location.origin||!/^https?:$/i.test(t.protocol)||t.pathname===window.location.pathname&&t.search===window.location.search?null:`${t.pathname}${t.search}`}catch{return null}}function Oe(e){const i=qe(e);if(!i||Re.has(i))return;Re.add(i);const t=document.createElement("link");t.rel="prefetch",t.as="document",t.href=i,document.head.appendChild(t)}function Bt(e){return V.familyForPath(e)?.id||""}function Pt(e){return e==="home"?"/assets/css/pages/home-head.css?v="+H:e?"/assets/css/pages/page-head/?v=v040726-5"+e+".css?v="+H:""}function Rt(e){if(!(!e||de.has(e))){if(document.querySelector(`link[href="${e}"]`)){de.add(e);return}de.add(e),fe.push(e),Ne()}}function N(e){ee=Math.max(0,ee-1),window.clearTimeout(Number(N.timers?.get(e)||0)),N.timers?.delete(e),Ne()}N.timers=new Map;function Ne(){for(;eeN(e),{once:!0}),i.addEventListener("error",()=>N(e),{once:!0}),N.timers.set(e,window.setTimeout(()=>N(e),4500)),document.head.appendChild(i)}}function Ft(e){if(!Fe)return;const i=qe(e);if(i)try{const t=new URL(i,window.location.origin),n=Bt(t.pathname),c=Pt(n);Rt(c)}catch{}}function qt(){const e=()=>{Fe=!0};if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(e,{timeout:1200});return}window.setTimeout(e,700)}function Ot(){const e=window.location.hostname;return e==="localhost"||e==="127.0.0.1"||e==="::1"||e==="[::1]"}function Nt(){if(Ot())return;qt();const e=i=>{const t=i?.closest?.("a[href]");!t||t.target==="_blank"||t.hasAttribute("download")||Ft(t.href)};document.addEventListener("pointerover",i=>{e(i.target)},{passive:!0}),document.addEventListener("focusin",i=>{e(i.target)}),document.addEventListener("touchstart",i=>{e(i.target)},{passive:!0})}function $t(){if(window.HTMLScriptElement&&HTMLScriptElement.supports&&HTMLScriptElement.supports("speculationrules"))return;const e=t=>{const n=t?.closest?.("a[href]");!n||n.target==="_blank"||n.hasAttribute("download")||Oe(n.href)};document.addEventListener("pointerover",t=>{e(t.target)},{passive:!0}),document.addEventListener("focusin",t=>{e(t.target)}),document.addEventListener("touchstart",t=>{e(t.target)},{passive:!0});const i=()=>{document.querySelectorAll(".civius-header__nav a, .civius-header__actions a, .civius-bottom-nav__item").forEach(t=>Oe(t.href))};if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(i,{timeout:900});return}window.setTimeout(i,220)}function $e(){We.forEach(e=>e.classList.add("is-visible")),$t(),Nt(),Ie(),window.addEventListener("resize",Ie,{passive:!0}),Je(),At(),Pe(),ft(),ot(),ke(),lt(),nt(),Lt(),_t(),mt(),gt(),Et(),bt(),St(),xt(),wt(),yt(),K(),window.__CIVIUS_COMMERCE_BUNDLE__||(Mt(),ue(),Ct())}window.addEventListener("pageshow",()=>{S(".c-button, .c-icon-button, .civius-glass-nav__action").forEach(e=>{e.classList.remove("is-hovering","is-pressing","is-releasing","is-accenting","is-accent-releasing")}),ke(),K()}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",$e,{once:!0}):$e(),window.addEventListener("storage",K)})();