@divkitframework/divkit 27.3.0 → 28.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- (()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(){}function i(t){return t()}function n(t){t.forEach(i)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const i=t.subscribe(...e);return i.unsubscribe?()=>i.unsubscribe():i}function s(t,e,r){return t.set(r),e}let l;function c(t){l=t}function u(){if(!l)throw new Error("Function called outside component initialization");return l}function d(t){u().$$.on_destroy.push(t)}function g(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>_n,createVariable:()=>lr,render:()=>Dn}),new Set,new Map;const p=[],f=[];let h=[];const m=[],y=Promise.resolve();let b=!1;function _(){return b||(b=!0,y.then($)),y}function w(t){h.push(t)}const x=new Set;let k=0;function $(){if(0!==k)return;const t=l;do{try{for(;k<p.length;){const t=p[k];k++,c(t),E(t.$$)}}catch(t){throw p.length=0,k=0,t}for(c(null),p.length=0,k=0;f.length;)f.pop()();for(let t=0;t<h.length;t+=1){const e=h[t];x.has(e)||(x.add(e),e())}h.length=0}while(p.length);for(;m.length;)m.pop()();b=!1,x.clear(),c(t)}function E(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(w)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const C=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),F=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function A(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,i=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),i&&(null==r.style?r.style=R(i):r.style=R(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),i=e.slice(0,t).trim(),n=e.slice(t+1).trim();i&&(r[i]=n)}for(const t in e){const i=e[t];i?r[t]=i:delete r[t]}return r}(r.style,i)))}let i="";return Object.keys(r).forEach((t=>{if(F.test(t))return;const e=r[t];!0===e?i+=" "+t:C.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const V=/[&"]/g,D=/[&<]/g;function j(t,e=!1){const r=String(t),i=e?V:D;i.lastIndex=0;let n="",o=0;for(;i.test(r);){const t=i.lastIndex-1,e=r[t];n+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return n+r.substring(o)}function P(t){return"string"==typeof t||t&&"object"==typeof t?j(t,!0):t}function S(t){const e={};for(const r in t)e[r]=P(t[r]);return e}function O(t,e){let r="";for(let i=0;i<t.length;i+=1)r+=e(t[i],i);return r}const M={$$render:()=>""};function I(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${e}>.`);return t}let T,z;function N(t){function e(e,r,i,n,o){const a=l;c({$$:{on_destroy:T,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,i,n);return c(a),s}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{T=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,i);return n(T),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function J(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function R(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${P(t[e])};`)).join(" ")}function B(t){const e=R(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(z=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(i).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(function(t){const e=[],r=[];h.forEach((i=>-1===t.indexOf(i)?e.push(i):r.push(i))),r.forEach((t=>t())),h=e}(r.after_update),n(r.on_destroy),r.fragment&&r.fragment.d(e),r.on_destroy=r.fragment=null,r.ctx=[])})(this,1),this.$destroy=r}$on(t,e){if(!o(e))return r;const i=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return i.push(e),()=>{const t=i.indexOf(e);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});const U=[];function W(t,e=r){let i;const n=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,i)){const e=!U.length;for(const e of n)e[1](),U.push(e,t);if(e){for(let t=0;t<U.length;t+=2)U[t][0](U[t+1]);U.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return n.add(l),1===n.size&&(i=e(o)||r),a(t),()=>{n.delete(l),0===n.size&&i&&(i(),i=null)}}}}function L(t,e,i){const s=!Array.isArray(t),l=s?[t]:t,c=e.length<2;return u=t=>{let i=!1;const u=[];let d=0,g=r;const v=()=>{if(d)return;g();const i=e(s?u[0]:u,t);c?t(i):g=o(i)?i:r},p=l.map(((t,e)=>a(t,(t=>{u[e]=t,d&=~(1<<e),i&&v()}),(()=>{d|=1<<e}))));return i=!0,v(),function(){n(p),g(),i=!1}},{subscribe:W(i,u).subscribe};var u}const H="divkit-bd259",q="divkit-d9099",G="divkit-c016b",Z="divkit-aa145",Y="divkit-f0cba",X=Symbol("root");function K(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const Q={"text-range":"divkit-faf07",text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},tt={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980","outer_has-custom-focus":"divkit-c7f14"};function et(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function rt(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function it(t){let e=rt(t);return"0"===e&&(e+="em"),e}function nt(t,e){for(;t.length<e;)t="0"+t;return t}function ot(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const i=at(t);return i?(i.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>nt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(i)):r}function at(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,i,n,o]=e,a=2===i.length?i:i+i,s=2===n.length?n:n+n,l=2===o.length?o:o+o,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,i,n]=e,o=2===r.length?r:r+r,a=2===i.length?i:i+i,s=2===n.length?n:n+n;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function st(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const lt=Boolean;function ct(t){if(1===t.length&&"solid"===t[0].type)return{color:ot(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=ot(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(lt);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>ot(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:gt(t.bg.scale),pos:vt(t.bg),image:'url("'+st(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(lt);if(!r.length)return;const i=t.bg.radius;let n;i&&"object"==typeof i&&"type"in i&&void 0!==i.value&&("fixed"===i.type?n=it(i.value):"relative"===i.type&&(n=ut[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"farthest-corner"} at ${dt(t.bg.center_x)} ${dt(t.bg.center_y)},`+r.map((t=>ot(t))).join(",")+")"}}({bg:t}):void 0)).filter(lt).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const ut={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function dt(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return it(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function gt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function vt(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function pt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function ft(t,e){return e.has(t)}function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(r),!0).forEach((function(e){yt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function yt(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bt(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function _t(t,e){e&&t.push(e)}function wt(t,e,r){const i=[];_t(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&_t(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const xt=Symbol("state");function kt(t){return rt(t.top||0)+" "+rt(t.right||0)+" "+rt(t.bottom||0)+" "+rt(t.left||0)}function $t(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function Et(t){return $t(t)&&t>=0}function Ct(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!Et(r[t]))return e;return kt(t)}function Ft(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const At=Object.prototype.hasOwnProperty;function Vt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(let i=0;i<r.length;i++){const n=r[i];if(!At.call(e,n)||!Vt(t[n],e[n]))return!1}return!0}function Dt(t,e){return Vt(t,e)?e:t}function jt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Pt(t,e){const r=Number(t);return isNaN(r)?e:r}function St(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...St(t))})):e.push(t),e}function Ot(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let i=0;i<r.length;++i)if(t[r[i]]&&!Et(t[r[i]]))return e;return t}function Mt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>rt((t||e)/r*10))).join(" ")}function It(){}const Tt=Symbol("action"),zt=N(((t,e,r,i)=>{let{actions:n}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:c}=e,{use:u=It}=e,{customAction:d=null}=e,{isNativeActionAnimation:p=!0}=e;const f=v(X),h=v(Tt);g(Tt,{hasAction:()=>Boolean(h.hasAction()||(null==n?void 0:n.length))});let m,y="",b=!1;if(void 0===e.actions&&r.actions&&void 0!==n&&r.actions(n),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==c&&r.attrs(c),void 0===e.use&&r.use&&void 0!==u&&r.use(u),void 0===e.customAction&&r.customAction&&void 0!==d&&r.customAction(d),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==p&&r.isNativeActionAnimation(p),Array.isArray(n)&&(null==n?void 0:n.length))for(let t=0;t<n.length;++t){const e=n[t].url;if(e){y=e,m=n[t].target||void 0;break}}return Array.isArray(n)&&(null==n?void 0:n.length)&&h.hasAction()&&(y="",f.logError(K(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:n}}))),b=Boolean(d),y&&!ft(pt(y),f.getBuiltinProtocols())?(y="",b=!0):!y&&Array.isArray(n)&&(null==n?void 0:n.length)&&(b=!0,f.logError(K(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:n}}))),y?`<a${A([{href:P(y)},{target:P(m)},{style:P(l)},{class:j(s,!0)+" "+j(p?H:q,!0)+" "+j(null!=a&&a.length?Y:"",!0)},S(c)],{})}>${i.default?i.default({}):""}</a>`:`\n <span${A([{class:j(s,!0)+j(b?` ${p?H:q} ${G}`:"",!0)+" "+j(null!=a&&a.length?Y:"",!0)},{style:P(l)},{role:P(b?"button":null)},{tabindex:P(b?0:null)},S(c)],{})}>${i.default?i.default({}):""}</span>`})),Nt=zt,Jt="divkit-b921d";function Rt(t){return $t(t)&&t>0}function Bt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Rt(t.radius))return`blur(${it(t.radius/2)})`}else e(K(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Ut=N(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=v(X);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),n=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const i=ct([t]);"solid"===t.type&&(e["background-color"]=i.color),"gradient"===t.type&&(e["background-image"]=i.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=i.size,e["object-position"]=i.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Bt(t.filters,s.logError)))}return r})),`<span${J("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${B({"border-radius":a})}>${O(n,(t=>t.image_url?`<img${J("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${J("class",Jt,0)}${J("style",et(t.style),0)}>`:`<span${J("class",Jt,0)}${J("style",et(t.style),0)}></span>`))}</span>`})),Wt=Ut,Lt=N(((t,e,i,n)=>{let o,s,l,c,u,g,p,f,h,m,y,b,w,x,k,$,E,C,F,A,V,D,j,P,S,O,M,T,z,N,R,B,U,W,L,H,q,G,Z,Y,Q,nt,at,st,ut,dt=r,gt=r,vt=r,ht=r,yt=r,_t=r,$t=r,At=r,Vt=r,It=r,Tt=r,zt=r,Jt=r,Rt=r,Bt=r,Ut=r,Lt=r,Ht=r,qt=r;var Gt,Zt,Yt,Xt,Kt,Qt;let{json:te={}}=e,{origJson:ee}=e,{templateContext:re}=e,{cls:ie=""}=e,{style:ne}=e,{layoutParams:oe={}}=e,{customDescription:ae=!1}=e,{customPaddings:se=!1}=e,{customActions:le=""}=e,{additionalPaddings:ce=null}=e,{heightByAspect:ue=!1}=e,{parentOf:de}=e,{replaceItems:ge}=e;const ve={left:"start",center:"center",right:"end"},pe={top:"start",center:"center",bottom:"end",baseline:"baseline"},fe=v(X),he=v(xt);let me,ye,be=null,_e=[];function we(t,e){if(!Array.isArray(de)||!ge)return;const r=de.findIndex((e=>(null==e?void 0:e.id)===t)),i=de.slice();i.splice(r,1,...e||[]),de=i,ge(i)}let xe,ke,$e,Ee,Ce,Fe,Ae,Ve,De,je,Pe={},Se={},Oe=!1,Me=1,Ie="transparent",Te=0,ze={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ne="",Je=null,Re="",Be={},Ue=0,We=0,Le=0,He=!1,qe=!1,Ge={},Ze=0,Ye=0,Xe=0,Ke=!1,Qe=!1,tr=1;const er=oe.fakeElement?[]:te.transition_triggers||["state_change","visibility_change"],rr=-1!==er.indexOf("state_change")&&te.id,ir=-1!==er.indexOf("visibility_change")&&te.id;let nr,or,ar,sr,lr,cr,ur,dr,gr,vr,pr=[],fr=[],hr=[],mr=[],yr=[],br=[],_r="",wr=!1,xr="visible",kr=0,$r=0;function Er(){te.focus&&(M||(vr=!0),fe.execAnyActions(mr))}function Cr(){te.focus&&(vr=!1,fe.execAnyActions(yr))}d((()=>{_e.forEach((t=>{fe.unregisterParentOf(t)})),_e=[]})),void 0===e.json&&i.json&&void 0!==te&&i.json(te),void 0===e.origJson&&i.origJson&&void 0!==ee&&i.origJson(ee),void 0===e.templateContext&&i.templateContext&&void 0!==re&&i.templateContext(re),void 0===e.cls&&i.cls&&void 0!==ie&&i.cls(ie),void 0===e.style&&i.style&&void 0!==ne&&i.style(ne),void 0===e.layoutParams&&i.layoutParams&&void 0!==oe&&i.layoutParams(oe),void 0===e.customDescription&&i.customDescription&&void 0!==ae&&i.customDescription(ae),void 0===e.customPaddings&&i.customPaddings&&void 0!==se&&i.customPaddings(se),void 0===e.customActions&&i.customActions&&void 0!==le&&i.customActions(le),void 0===e.additionalPaddings&&i.additionalPaddings&&void 0!==ce&&i.additionalPaddings(ce),void 0===e.heightByAspect&&i.heightByAspect&&void 0!==ue&&i.heightByAspect(ue),void 0===e.parentOf&&i.parentOf&&void 0!==de&&i.parentOf(de),void 0===e.replaceItems&&i.replaceItems&&void 0!==ge&&i.replaceItems(ge),_e.forEach((t=>{fe.unregisterParentOf(t)})),_e=[],de&&de.forEach((t=>{t.id&&(_e.push(t.id),fe.registerParentOf(t.id,{replaceWith:we}))})),o=fe.getDerivedFromVars(te.focus),yt(),yt=a(o,(t=>R=t)),s=fe.getDerivedFromVars(te.border),qt(),qt=a(s,(t=>ut=t));{const t=vr&&(null==R?void 0:R.border)?R.border:ut;let e={},r={},i=!1,n="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?rt((null===(Zt=null===(Gt=r.offset)||void 0===Gt?void 0:Gt.x)||void 0===Zt?void 0:Zt.value)||0)+" "+rt((null===(Xt=null===(Yt=r.offset)||void 0===Yt?void 0:Yt.y)||void 0===Xt?void 0:Xt.value)||0)+" "+rt(null!==(Kt=r.blur)&&void 0!==Kt?Kt:2)+" "+ot(r.color||"#000000",null!==(Qt=r.alpha)&&void 0!==Qt?Qt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(t.stroke&&(i=!0,Me=Ft(t.stroke.width,Me),Ie=ot(t.stroke.color,1,Ie),r.border=`${rt(Me)} solid ${Ie}`),t.corners_radius?(ze=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!Et(r[t]))return e;return t}(t.corners_radius,ze),r["border-radius"]=e["border-radius"]=Mt(ze)):t.corner_radius&&(Te=Ft(t.corner_radius,Te),ze={"top-left":Te,"top-right":Te,"bottom-right":Te,"bottom-left":Te},r["border-radius"]=e["border-radius"]=rt(Te)),i&&Me&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},ze);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Me/2})),n=Mt(t)}}Pe=Dt(e,Pe),Se=Dt(r,Se),Oe=i,Ne=n}l=fe.getDerivedFromVars(te.paddings),Ht(),Ht=a(l,(t=>st=t)),Je=Ot(st&&!se?st:void 0,Je),c=kt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((i=>{const n=t[i];n&&(r[i]=n);const o=e[i];o&&(r[i]=(r[i]||0)+o)})),r}(Je,ce)),u=fe.getDerivedFromVars(te.margins),Ut(),Ut=a(u,(t=>nt=t)),Re=Ct(nt,Re),g=fe.getDerivedFromVars(te.width),Rt(),Rt=a(g,(t=>Y=t)),p=fe.getDerivedFromVars(te.alignment_horizontal),Lt(),Lt=a(p,(t=>at=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Ue=Ft(null==Y?void 0:Y.value,Ue),e=rt(Ue);else if("wrap_content"!==c&&(oe.overlapParent||"match_parent"!==c&&c||!oe.parentHorizontalWrapContent))t="parent","vertical"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,fe.logError(K(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===oe.parentLayoutOrientation?e=`calc(100% - ${it(((null==nt?void 0:nt.left)||0)+((null==nt?void 0:nt.right)||0))})`:"horizontal"===oe.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,oe.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&Et(t.min_size.value)&&(r=rt(t.min_size.value)),t.max_size&&Et(t.max_size.value)&&(i=rt(t.max_size.value))}"match_parent"!==c&&c||fe.logError(K(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=at;n["halign-self"]="left"===t||"center"===t||"right"===t?ve[t]:oe.parentHAlign||"start"}t&&(n.width=t),xe=e,ke=r,$e=i,We=o,Le=a,Be=Dt(n,Be),He=s,qe=l}f=fe.getDerivedFromVars(te.height),Jt(),Jt=a(f,(t=>Z=t)),h=fe.getDerivedFromVars(te.alignment_vertical),Bt(),Bt=a(h,(t=>Q=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ue);else if("fixed"===c)Ze=Ft(null==Z?void 0:Z.value,Ze),e=rt(Ze);else if("match_parent"!==c||!oe.overlapParent&&oe.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&oe.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&Et(t.min_size.value)&&(r=rt(t.min_size.value)),(null==t?void 0:t.max_size)&&Et(t.max_size.value)&&(i=rt(t.max_size.value))}"match_parent"===c&&fe.logError(K(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,fe.logError(K(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===oe.parentLayoutOrientation?e=`calc(100% - ${it(((null==nt?void 0:nt.top)||0)+((null==nt?void 0:nt.bottom)||0))})`:"vertical"===oe.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=Q;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===oe.parentContainerOrientation?n["valign-self"]=pe[t]:n["valign-self"]=oe.parentVAlign||"start"}t&&(n.height=t),Ee=e,Ce=r,Fe=i,Ye=o,Xe=a,Ge=Dt(n,Ge),Ke=s,Qe=l}var Fr,Ar,Vr;if(m=!!oe.overlapParent||void 0,y=oe.overlapParent&&(!Y||"match_parent"===Y.type)&&"match_parent"===(null==Z?void 0:Z.type),b=oe.gridArea?`${oe.gridArea.y+1}/${oe.gridArea.x+1}/span ${oe.gridArea.rowSpan}/span ${oe.gridArea.colSpan}`:void 0,w=fe.getDerivedFromVars(te.alpha),zt(),zt=a(w,(t=>G=t)),Ar=tr,tr=!Et(Fr=G)||void 0===Fr||Fr>1?Ar:Number(Fr),Ae=1===tr?void 0:tr,x=fe.getDerivedFromVars(te.accessibility),Tt(),Tt=a(x,(t=>q=t)),ye=void 0,q&&!ae&&q.description&&(ye={},ye["aria-label"]=q.description),k=fe.getDerivedFromVars(te.background),It(),It=a(k,(t=>H=t)),Ve=vr&&(null==R?void 0:R.background)?R.background:H,De={},je=!1,Array.isArray(Ve)&&(je=Ve.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ne),!je)){const t=ct(Ve);De["background-color"]=t.color,De["background-image"]=t.image,De["background-size"]=t.size,De["background-position"]=t.position,De["background-repeat"]="no-repeat"}nr=void 0,rr&&te.transition_in&&fe.isRunning("stateChange")&&(nr=!0),ar=void 0,rr&&te.transition_change&&fe.isRunning("stateChange")&&he.hasTransitionChange(te.id)&&(ar=!0),$=fe.getDerivedFromVars(te.action),At(),At=a($,(t=>W=t)),E=fe.getDerivedFromVars(te.actions),Vt(),Vt=a(E,(t=>L=t)),C=fe.getDerivedFromVars(te.doubletap_actions),$t(),$t=a(C,(t=>U=t)),F=fe.getDerivedFromVars(te.longtap_actions),_t(),_t=a(F,(t=>B=t));{let t=L||W&&[W]||[],e=U||[],r=B||[],i=(null==R?void 0:R.on_focus)||[],n=(null==R?void 0:R.on_blur)||[];oe.fakeElement?(t=[],e=[],r=[],i=[],n=[]):(Array.isArray(t)||(t=[],fe.logError(K(new Error("Actions should be array")))),Array.isArray(e)||(e=[],fe.logError(K(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],fe.logError(K(new Error("LongTapActions should be array")))),Array.isArray(i)||(i=[],fe.logError(K(new Error("FocusActions should be array")))),Array.isArray(n)||(n=[],fe.logError(K(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&le&&(t=[],e=[],r=[],fe.logError(K(new Error(`Cannot use action on component "${le}"`)))),pr=t,fr=e,hr=r,mr=i,yr=n}A=fe.getDerivedFromVars(te.action_animation),ht(),ht=a(A,(t=>N=t)),N&&(br=St(N),_r=br.map((function(t){const e=Pt(t.start_value,1),r=Pt(t.end_value,1),i=Ft(t.start_delay,0),n=Ft(t.duration,300),o=jt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return sr=e,lr=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return cr=e,ur=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return fe.logError(K(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),V=fe.getDerivedFromVars(te.visibility),vt(),vt=a(V,(t=>z=t));{const t=xr,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(z,xr);t!==e&&(!wr||"visible"!==xr&&"visible"!==e?xr=e:async function(t){xr=t;const e="visible"===t?"in":"out",r="in"===e?te.transition_in:te.transition_out;ir&&r&&(await _(),"in"===e&&(or=!0),he.runVisibilityTransition(Object.assign(Object.assign({},te),{visibility:"visible"}),re,r,me,e).then((()=>{"in"===e&&(or=!1)})).catch((t=>{throw"in"===e&&(or=!1),t})))}(e)),wr||(wr=!0)}if(D=Object.assign(Object.assign(Object.assign({},Be),Ge),{"parent-overlap":m,"parent-overlap-absolute":y,"scroll-snap":oe.scrollSnap,"hide-on-transition-in":nr||or||ar,visibility:xr,"has-action-animation":Boolean(_r),"parent-flex":oe.parentContainerOrientation||void 0,"parent-grid":Boolean(oe.gridArea)||void 0,"has-custom-focus":Boolean(vr&&te.focus)}),j=fe.getDerivedFromVars(te.transform),gt(),gt=a(j,(t=>T=t)),T&&void 0!==T.rotation){const t=T.pivot_x||{type:"pivot-percentage",value:50};kr=Pt(t.value,kr);const e="pivot-fixed"===t.type?rt(kr):`${kr}%`,r=T.pivot_y||{type:"pivot-percentage",value:50};$r=Pt(r.value,$r),dr=`${e} ${"pivot-fixed"===r.type?rt($r):`${$r}%`}`,gr=`rotate(${T.rotation}deg)`}return P=He||Ke?"100%":We||Ye?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},ne),De),Pe),{width:xe,"min-width":ke,"max-width":$e,height:Ee,"min-height":Ce,"max-height":Fe||(null==ne?void 0:ne["max-height"]),"grid-area":b,padding:c,margin:Re,opacity:Ae,transition:_r,"transform-origin":dr,transform:gr,"flex-grow":We||Ye||void 0,"flex-shrink":Le||Xe?1:void 0,"flex-basis":P,"--divkit-animation-opacity-start":sr,"--divkit-animation-opacity-end":lr,"--divkit-animation-scale-start":cr,"--divkit-animation-scale-end":ur}),O=fe.isPointerFocus,dt(),dt=a(O,(t=>M=t)),dt(),gt(),vt(),ht(),yt(),_t(),$t(),At(),Vt(),It(),Tt(),zt(),Jt(),Rt(),Bt(),Ut(),Lt(),Ht(),qt(),qe||Qe?"":`${I(Nt,"Actionable").$$render(t,{use:function(t){me=t,rr&&te.transition_in&&he.registerChildWithTransitionIn(te,re,te.transition_in,t).then((()=>{nr=!1})).catch((t=>{throw nr=!1,t})),rr&&te.transition_out&&he.registerChildWithTransitionOut(te,re,te.transition_out,t),rr&&te.transition_change&&he.registerChildWithTransitionChange(te,re,te.transition_change,t).then((()=>{ar=!1})).catch((t=>{throw ar=!1,t}));const e=oe.fakeElement?[]:te.visibility_actions||te.visibility_action&&[te.visibility_action],r=oe.fakeElement?[]:te.disappear_actions;(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length)&&function(t,{visibilityActions:e,disappearActions:r,rootCtx:i}){const n=[];e&&e.forEach((t=>{n.push({type:"visibility",index:n.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{n.push({type:"disappear",index:n.length,action:t,visible:!1,count:0,finished:!1})}));const o=n.map((t=>{const e="visibility"===t.type,r=i.getJsonWithVars({visibility_percentage:t.action.visibility_percentage,visibility_duration:e?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit});return mt(mt({},r),{},{visibility_percentage:bt(e,r.visibility_percentage,e?50:0)})})),a=[...new Set(o.map((t=>t.visibility_percentage/100)))];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const r=o[e.index],n="visibility"===e.type;let a;a=0===r.visibility_percentage?t.intersectionRatio>=1e-12:t.intersectionRatio>=r.visibility_percentage/100;const s=n?!e.visible&&a:e.visible&&!a,l=n?!a:a;s?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===r.log_limit?1/0:r.log_limit||1;++e.count>=t&&(e.finished=!0);const o=i.getJsonWithVars(e.action),a=o.url;if(a){const t=pt(a);t&&!ft(t,i.getBuiltinProtocols())&&("div-action"===t?i.execAction(o):o.log_id&&i.execCustomAction(o))}i.logStat(n?"visible":"disappear",o)}),o[e.index].visibility_duration||800)):l&&e.timer&&clearTimeout(e.timer),e.visible=a}))}))}),{threshold:a}).observe(t)}(t,{visibilityActions:e,disappearActions:r,rootCtx:fe});const i=te.id;i&&he.registerChild(i);let n=null;if(Array.isArray(te.extensions)){const e=fe.getExtensionContext();be=te.extensions.map((r=>{var i;const n=fe.getExtension(r.id,r.params);return n&&(null===(i=n.mountView)||void 0===i||i.call(n,t,e)),n})).filter(lt)}return{destroy(){if(i&&he.unregisterChild(i),be){const e=fe.getExtensionContext();be.forEach((r=>{var i;null===(i=r.unmountView)||void 0===i||i.call(r,t,e)})),be=null}n&&n.destroy()}}},cls:ie+" "+wt("outer",tt,D),style:et(S),actions:pr,doubleTapActions:fr,longTapActions:hr,attrs:ye,isNativeActionAnimation:!br.length||(Vr=br,Vr.some((t=>"native"===t.name)))},{},{default:()=>`${je?`${I(Wt,"OuterBackground").$$render(t,{background:Ve,radius:Ne},{},{})}`:""}${n.default?n.default({focusHandler:Er,blurHandler:Cr,hasCustomFocus:vr}):""}${Oe?`<span${J("class",tt.outer__border,0)}${J("style",et(Se),0)}></span>`:""}`})}`})),Ht=Lt,qt={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function Gt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Zt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Yt(t,e){return Zt(t)||e}const Xt=N(((t,e,r,i)=>{let n,o,a,s,l;var c,u;let{text:d}=e,{rootFontSize:g}=e,{textStyles:p={}}=e,{singleline:f=!1}=e,{actions:h}=e;const m=v(X);let y,b="none",_=12,w=1.25,x="",k="",$="",E=null;void 0===e.text&&r.text&&void 0!==d&&r.text(d),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==g&&r.rootFontSize(g),void 0===e.textStyles&&r.textStyles&&void 0!==p&&r.textStyles(p),void 0===e.singleline&&r.singleline&&void 0!==f&&r.singleline(f),void 0===e.actions&&r.actions&&void 0!==h&&r.actions(h);{let t="none";(p.underline||p.strike)&&("single"===p.underline&&"single"===p.strike?t="both":"single"===p.underline?t="underline":"single"===p.strike&&(t="strike")),b=t}return _=Gt(p.font_size,_),Rt(p.line_height)&&(w=Number(p.line_height)/_),Et(p.letter_spacing)&&(x=rt(p.letter_spacing)),y=Yt(p.font_weight,y),k="string"==typeof p.font_family&&p.font_family?m.typefaceProvider(p.font_family,{fontWeight:y||400}):"",$=ot(p.text_color,1,$),n=p.top_offset?rt(p.top_offset):"",o=p.background?ct([p.background]):null,E=(null===(c=p.border)||void 0===c?void 0:c.stroke)&&"transparent"!==ot(p.border.stroke.color)&&Rt(p.border.stroke.width)?{color:p.border.stroke.color,width:p.border.stroke.width}:null,a=Gt(null===(u=p.border)||void 0===u?void 0:u.corner_radius,0),s={singleline:f,decoration:b},l={"font-size":rt(10*_/g),"line-height":w,"letter-spacing":x,"font-weight":y,"font-family":k,color:$,background:(null==o?void 0:o.color)||void 0,"box-shadow":E?`inset 0 0 0 ${rt(E.width)} ${E.color}`:void 0,"border-radius":a?rt(a):void 0},`${n?`<span${J("class",qt["text-range__top-offset"],0)}${B({"margin-top":n})}></span>`:""}${I(Nt,"Actionable").$$render(t,{cls:wt("text-range",qt,s),actions:h,style:et(l)},{},{default:()=>`${j(d)}`})}`})),Kt=Xt;function Qt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function te(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function ee(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function re(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const ie=N(((t,e,i,n)=>{let o,s,l,c,u,g,p,f,h,m,y,b,_,w,x,k,$,E,C,F,A,V,D,j,P,S,M,T,z,N,R,B,U,W,L,H=r,q=r,Z=r,Y=r,tt=r,it=r,nt=r,at=r,st=r,lt=r,ut=r,dt=r,gt=r,vt=r,{json:pt={}}=e,{templateContext:ft}=e,{origJson:ht}=e,{layoutParams:mt}=e;const yt=v(X);let bt=!1,_t="",xt=12,kt=1.25,$t=!1,Et="",Ct="",Ft=!1,At="left",Vt="top",Dt="",jt="",Pt="",St=!1,Ot=[],Mt=[];var It,Tt;d((()=>{Mt.forEach((([t,e])=>{yt.removeSvgFilter(t,e)}))})),void 0===e.json&&i.json&&void 0!==pt&&i.json(pt),void 0===e.templateContext&&i.templateContext&&void 0!==ft&&i.templateContext(ft),void 0===e.origJson&&i.origJson&&void 0!==ht&&i.origJson(ht),void 0===e.layoutParams&&i.layoutParams&&void 0!==mt&&i.layoutParams(mt),o=yt.getDerivedFromVars(pt.text),vt(),vt=a(o,(t=>L=t)),It=L,Tt=_t,_t=String(null!=It?It:"")||Tt,_t?bt=!1:(bt=!0,yt.logError(K(new Error('Missing "text" prop for div "text"')))),s=yt.getDerivedFromVars(pt.ranges),q(),q=a(s,(t=>D=t)),l=yt.getDerivedFromVars(pt.images),H(),H=a(l,(t=>V=t)),c=yt.getDerivedFromVars({font_size:pt.font_size,letter_spacing:pt.letter_spacing,font_weight:pt.font_weight,font_family:pt.font_family,text_color:pt.text_color,underline:pt.underline,strike:pt.strike,line_height:pt.line_height}),Z(),Z=a(c,(t=>j=t)),u=yt.getDerivedFromVars(pt.font_size),gt(),gt=a(u,(t=>W=t)),xt=Gt(W,xt),g=yt.getDerivedFromVars(pt.line_height),dt(),dt=a(g,(t=>U=t));{const t=U;Rt(t)?(kt=Number(t)/xt,$t=!0):$t=!1}p=yt.getDerivedFromVars(pt.max_lines),st(),st=a(p,(t=>N=t)),f=1===N;{let t="",e="",r=!1;if(N&&N>1){let i=Number(N);t=i*kt+"em",D||V||(e=i,r=!0)}Et=t,Ct=e,Ft=r}h=yt.getDerivedFromVars(pt.text_alignment_horizontal),ut(),ut=a(h,(t=>B=t)),At=Qt(B,At),m=yt.getDerivedFromVars(pt.text_alignment_vertical),lt(),lt=a(m,(t=>R=t)),Vt=te(R,Vt),y=!D||_t&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=_t.length,b=yt.getDerivedFromVars(pt.text_color),at(),at=a(b,(t=>z=t)),_=Boolean(z)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";N&&y&&_&&(t=ot(z||D&&D[0]&&D[0].text_color,1,Dt)),Dt=t}w=yt.getDerivedFromVars(pt.focused_text_color),nt(),nt=a(w,(t=>T=t)),jt=ot(T,1,jt),x=yt.getDerivedFromVars(pt.truncate),it(),it=a(x,(t=>M=t)),k="none"===M?"none":"",$=yt.getDerivedFromVars(pt.text_gradient),tt(),tt=a($,(t=>S=t));{let t="";if(S){const e=ct([S]);e.image&&(t=e.image)}Pt=t}return E=yt.getDerivedFromVars(pt.selectable),Y(),Y=a(E,(t=>P=t)),St=ee(P,St),function(t,e,r){let i=[];if(Mt.forEach((([t,e])=>{yt.removeSvgFilter(t,e)})),Mt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Ot=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);i.push({text:n.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...l),r=rt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),n=rt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":rt(10*(Number(e.font_size)||12)/xt)};let a="";const s=t.image.tint_color,c=re(t.image.tint_mode,"source_in");if(s){const e=ot(t.image.tint_color);a=yt.addSvgFilter(e,c),Mt.push([e,c])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=o})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},j)}),Ot=i}(_t,D,V),C={singleline:f,multiline:Ft,halign:At,valign:Vt,truncate:k},F={gradient:Boolean(Pt)},A={"font-size":rt(xt),"line-height":kt,"max-height":Et,"-webkit-line-clamp":Ct,color:Dt,"background-image":Pt,"--divkit-text-focus-color":jt},H(),q(),Z(),Y(),tt(),it(),nt(),at(),st(),lt(),ut(),dt(),gt(),vt(),bt?"":`${I(Ht,"Outer").$$render(t,{cls:wt("text",Q,C)+" "+(St?"":G),json:pt,origJson:ht,templateContext:ft,layoutParams:mt},{},{default:()=>`<span${J("class",wt("text__inner",Q,F),0)}${J("style",et(A),0)}>${Ot.length?`${O(Ot,((e,r)=>"text"in e?e.text?`${I(Kt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:xt,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${J("style",et(e.image.wrapperStyle),0)}><img${J("class",Q.text__image,0)}${J("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${J("style",et({width:e.image.width,height:e.image.height,"margin-top":$t?`-${e.image.height}`:void 0,"margin-bottom":$t?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${I(Kt,"TextRangeView").$$render(t,{text:_t,rootFontSize:xt,textStyles:j,singleline:f},{},{})}`}</span>`})}`})),ne=ie,oe={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function ae(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function se(t,e,r){const i=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),n=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0);null!=e&&e.show_at_start&&(r?t.top=e.style.height+n:t.left=e.style.width+i),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+n:t.right=e.style.width+i)}function le(t,e,r){let i;const n=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),o=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0),a=((null==r?void 0:r.margins.left)||0)+((null==r?void 0:r.margins.right)||0),s=((null==r?void 0:r.margins.top)||0)+((null==r?void 0:r.margins.bottom)||0);return i="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+n:0]:[null!=e&&e.show_between?e.style.height+o:0,null!=r&&r.show_between?r.style.width+a:0],i.map(rt).join(" ")}function ce(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let i;if("rounded_rectangle"===t.shape.type)n=t.shape,i={width:Number((null===(o=n.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=n.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=n.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Number((null===(e=t.radius)||void 0===e?void 0:e.value)||10);return{width:r,height:r,radius:r}}(t.shape)}var n,o,a,s,l;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?ot(o.color):"",s=null!=o&&o.width?Number(null!==(i=o.width)&&void 0!==i?i:1):"";n.width=t.width,n.height=t.height,n.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return n.background=ot(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${rt(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}let ue;function de(){if(void 0!==ue)return ue;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),ue=1===t.scrollHeight,document.body.removeChild(t),ue}const ge="divkit-a7719",ve="divkit-f6e9a";function pe(t,e,r,i,n,o){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;o?t.push({top:r.bottom+l,left:n.left+a,width:Math.max(0,n.right-n.left-a-s),height:i.top-r.bottom-l-c,style:e.style}):t.push({top:n.top+l,left:r.right+a,width:i.left-r.right-a-s,height:Math.max(0,n.bottom-n.top-l-c),style:e.style})}function fe(t,e,r,i){const n={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if((null==e?void 0:e.show_at_start)&&pe(t,e,{top:0,right:r[0].left-e.style.width-e.margins.left-e.margins.right,bottom:r[0].top-e.style.height-e.margins.top-e.margins.bottom,left:0},r[0],n,i),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)pe(t,e,r[o],r[o+1],n,i);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];pe(t,e,o,{top:o.bottom+e.style.height+e.margins.top+e.margins.bottom,right:0,bottom:0,left:o.right+e.style.width+e.margins.left+e.margins.right},n,i)}}const he=N(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,i=0,n=!1;return function(){const e=Date.now();return!i||Math.abs(e-i)>10?(i=e,r=t.apply(this,arguments)):(n||(n=!0,setTimeout((()=>{n=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!n)return;const t=n.getBoundingClientRect();u=[];let e=[...n.children].filter((t=>t!==c&&!t.classList.contains(tt.outer__border))),r=[];for(;e.length;){const t=[],i=e.shift();t.push(i);let n=i.getBoundingClientRect(),a=n.right,s=n.bottom;for(;e.length;){let r=e[0],i=r.getBoundingClientRect();if("vertical"===o){if(i.top<s)break}else if(i.left<a)break;a=Math.max(a,i.right),s=Math.max(s,i.bottom),t.push(r),e.shift()}r.push(t)}const i=[];r.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&fe(u,a,e,"vertical"===o);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};i.push(r)})),s&&fe(u,s,i,"horizontal"===o),u.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let c,u=[],g=!1,v=null,p=null;return d((()=>{g=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),n=null,(g&&n||v||p)&&(v&&(v.disconnect(),v=null),p&&(p.disconnect(),p=null),g&&n&&("undefined"!=typeof MutationObserver&&(v=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains(ve))&&!(null==r?void 0:r.contains(ge))}))&&l()})),v.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(l),p.observe(n)))),g&&n&&l(),`\n\n<div${J("class",ge,0)}${J("this",c,0)}>${O(u,(t=>`<div${J("class","divkit-c770e",0)}${B({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${J("class",ve,0)}${B({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div>\n </div>`))}</div>`})),me=N(((t,e,i,n)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b,_,w,x,k,$,E,C,F,A,V,D,j=r,P=r,S=r,M=r,T=r,z=r,N=r,J=r,R=r;var B,U,W,L,H,q;let{json:G={}}=e,{templateContext:Z}=e,{origJson:Y}=e,{layoutParams:Q}=e;const tt={left:"start",center:"center",right:"end","space-between":"start","space-around":"start","space-evenly":"start"},et={top:"start",center:"center",bottom:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},rt=["rounded_rectangle","circle"],it=v(X);let nt,ot=!1,at="vertical",st="top",lt="left",ct=null,ut=null,dt={};if(void 0===e.json&&i.json&&void 0!==G&&i.json(G),void 0===e.templateContext&&i.templateContext&&void 0!==Z&&i.templateContext(Z),void 0===e.origJson&&i.origJson&&void 0!==Y&&i.origJson(Y),void 0===e.layoutParams&&i.layoutParams&&void 0!==Q&&i.layoutParams(Q),o=G.items,(null==o?void 0:o.length)&&Array.isArray(o)?ot=!1:(ot=!0,it.logError(K(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!ot&&o||[]).map((t=>{let e=t,r=Z;return({templateContext:r,json:e}=it.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=it.getDerivedFromVars(G.orientation),R(),R=a(l,(t=>D=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(D,at),c=it.getDerivedFromVars(G.content_alignment_vertical),J(),J=a(c,(t=>V=t)),st=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(V,st),u=it.getDerivedFromVars(G.content_alignment_horizontal),N(),N=a(u,(t=>A=t)),lt=function(t,e){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(A,lt),d=it.getDerivedFromVars(G.layout_mode),z(),z=a(d,(t=>F=t)),g="wrap"===F,p=it.getDerivedFromVars(G.separator),T(),T=a(p,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&de()){const t=ce(C.style,rt,(null==ct?void 0:ct.style)||null);ct=t?{show_at_start:Boolean(null!==(B=C.show_at_start)&&void 0!==B&&B),show_at_end:Boolean(null!==(U=C.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(W=C.show_between)||void 0===W||W),style:t,margins:ae(C.margins)}:null}else ct=null;if(f=it.getDerivedFromVars(G.line_separator),M(),M=a(f,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&de()){const t=ce(E.style,rt,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(L=E.show_at_start)&&void 0!==L&&L),show_at_end:Boolean(null!==(H=E.show_at_end)&&void 0!==H&&H),show_between:Boolean(null===(q=E.show_between)||void 0===q||q),style:t,margins:ae(E.margins)}:null}else ut=null;h=ct||ut?function(t,e,r){const i={};return se(i,e,"vertical"===t),se(i,r,"horizontal"===t),i}(at,ct,ut):null,m=it.getDerivedFromVars(G.aspect),S(),S=a(m,(t=>$=t));{const t=null==$?void 0:$.ratio;nt=t&&Rt(t)?t:void 0}y=it.getDerivedFromVars(G.width),j(),j=a(y,(t=>x=t)),b=it.getDerivedFromVars(G.height),P(),P=a(b,(t=>k=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=g?"start":tt[lt],nt||k&&"wrap_content"!==k.type&&("match_parent"!==k.type||!(null==Q?void 0:Q.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0)),"vertical"!==at&&(t.parentVAlign=g?"start":et[st],("wrap_content"===(null==x?void 0:x.type)||"match_parent"===(null==x?void 0:x.type)&&(null==Q?void 0:Q.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===at&&(t.parentContainerOrientation="horizontal"),"vertical"===at&&(t.parentContainerOrientation="vertical"),g&&(t.parentContainerWrap=!0),dt=Dt(t,dt)}return _={orientation:at,valign:st,halign:lt,wrap:g},w={gap:ct||ut?le(at,ct,ut):void 0,"aspect-ratio":nt},j(),P(),S(),M(),T(),z(),N(),J(),R(),ot?"":`${I(Ht,"Outer").$$render(t,{cls:wt("container",oe,_),style:w,json:G,origJson:Y,templateContext:Z,layoutParams:Q,additionalPaddings:h,heightByAspect:Boolean(nt),parentOf:o,replaceItems:function(t){G=Object.assign(Object.assign({},G),{items:t})}},{},{default:()=>`${O(s,(e=>`${I(Vr,"Unknown").$$render(t,{layoutParams:dt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n\n ${ct||ut?`${I(he,"ContainerSeparators").$$render(t,{separator:ct,lineSeparator:ut,orientation:at},{},{})}`:""}`})}`})),ye=me,be={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function _e(t,e){return"vertical"===t||"horizontal"===t?t:e}const we=N(((t,e,i,n)=>{let o,s,l,c,u,d,g,p=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const b=v(X);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&i.json&&void 0!==f&&i.json(f),void 0===e.templateContext&&i.templateContext&&void 0!==h&&i.templateContext(h),void 0===e.origJson&&i.origJson&&void 0!==m&&i.origJson(m),void 0===e.layoutParams&&i.layoutParams&&void 0!==y&&i.layoutParams(y),o=b.getDerivedFromVars(f.delimiter_style),p(),p=a(o,(t=>g=t)),_=_e(null==g?void 0:g.orientation,_),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=ot(null==g?void 0:g.color,1,w),l="horizontal"===_?"100%":rt(1),c="horizontal"===_?rt(1):"100%",u={background:w,width:l,height:c},d={orientation:_},p(),`${I(Ht,"Outer").$$render(t,{cls:wt("separator",be,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>s?`<span${J("class",be.separator__inner,0)}${J("style",et(u),0)}></span>`:""})}`})),xe={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function ke(t){return t.startsWith("data:")?st(t):`data:image/jpg;base64,${st(t)}`}const $e=N(((t,e,i,n)=>{let o,s,l,c,u,g,p,f,h,m,y,b,_,w,x,k,$,E,C,F,A,V,D,j,P,S,O,M,T,z,N,R,U,W,L=r,H=r,q=r,G=r,Z=r,Y=r,Q=r,tt=r,rt=r,it=r,nt=r,at=r,st=r,lt=r,{json:ct={}}=e,{templateContext:ut}=e,{origJson:dt}=e,{layoutParams:pt}=e;const ft=v(X);let ht,mt=0,yt="rgba(0,0,0,0.08)",bt=!1,_t="",xt="none",kt="50% 50%",$t="0",Et="source_in",Ct="",At="",Vt=0,Dt=0,Pt=0,St="",Ot="";d((()=>{ft.removeSvgFilter(ht,Et)})),void 0===e.json&&i.json&&void 0!==ct&&i.json(ct),void 0===e.templateContext&&i.templateContext&&void 0!==ut&&i.templateContext(ut),void 0===e.origJson&&i.origJson&&void 0!==dt&&i.origJson(dt),void 0===e.layoutParams&&i.layoutParams&&void 0!==pt&&i.layoutParams(pt),o=ft.getDerivedFromVars(ct.image_url),lt(),lt=a(o,(t=>W=t)),s=ft.getDerivedFromVars(ct.gif_url),st(),st=a(s,(t=>U=t)),l=W||U,mt=0,l?bt=!1:(bt=!0,ft.logError(K(new Error('Missing "image_url" for "image"')))),c=ft.getDerivedFromVars(ct.width),at(),at=a(c,(t=>R=t)),u="wrap_content"===(null==R?void 0:R.type),g=ft.getDerivedFromVars(ct.height),nt(),nt=a(g,(t=>N=t)),p="wrap_content"===(null==N?void 0:N.type),f=ft.getDerivedFromVars(ct.preview),it(),it=a(f,(t=>z=t)),_t=z?`url("${ke(z)}")`:"",h=ft.getDerivedFromVars(ct.placeholder_color),rt(),rt=a(h,(t=>T=t)),yt=ot(T,1,yt),m=ft.getDerivedFromVars(ct.scale),tt(),tt=a(m,(t=>M=t)),xt=gt(M)||xt,y=ft.getDerivedFromVars({content_alignment_horizontal:ct.content_alignment_horizontal,content_alignment_vertical:ct.content_alignment_vertical}),Q(),Q=a(y,(t=>O=t)),kt=function(t,e){const r=t.content_alignment_horizontal,i=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||i&&"top"!==i&&"center"!==i&&"bottom"!==i?e:vt(t)}(O,kt),b=ft.getDerivedFromVars(ct.accessibility),Y(),Y=a(b,(t=>S=t)),_=(null==S?void 0:S.description)||"",w=ft.getDerivedFromVars(ct.aspect),Z(),Z=a(w,(t=>P=t));{const t=null==P?void 0:P.ratio;$t=t&&Rt(t)?(100/Number(t)).toFixed(2):"0"}x=ft.getDerivedFromVars(ct.tint_color),G(),G=a(x,(t=>j=t)),k=ft.getDerivedFromVars(ct.tint_mode),q(),q=a(k,(t=>D=t));{const t=j?ot(j):void 0,e=re(D,Et);t===ht&&e===Et||(ft.removeSvgFilter(ht,Et),Ct=t?ft.addSvgFilter(t,e):"",ht=t,Et=e)}if($=ft.getDerivedFromVars(ct.appearance_animation),H(),H=a($,(t=>V=t)),V&&"fade"===V.type){const t=V;At=jt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Pt=Ft(t.duration,300),Dt=Ft(t.start_delay,0),Vt=Ft(t.alpha,0)}E=ft.getDerivedFromVars(ct.filters),L(),L=a(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=Bt(A,ft.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),St=t,Ot=e}return C={aspect:"0"!==$t,"is-width-content":u,"is-height-content":p,loaded:!1,"before-appearance":Boolean(At)&&!0},F={"background-image":_t,"background-color":_t?void 0:yt,"background-size":xt,"clip-path":Ot||void 0,"object-fit":xt,"object-position":kt,filter:["",St].filter(Boolean).join(" "),"--divkit-appearance-interpolator":At||void 0,"--divkit-appearance-fade-start":At?Vt:void 0,"--divkit-appearance-delay":At?`${Dt}ms`:void 0,"--divkit-appearance-duration":At?`${Pt}ms`:void 0},L(),H(),q(),G(),Z(),Y(),Q(),tt(),rt(),it(),nt(),at(),st(),lt(),bt?"":`${I(Ht,"Outer").$$render(t,{cls:wt("image",xe,C),json:ct,origJson:dt,templateContext:ut,layoutParams:pt,customDescription:!0},{},{default:()=>C.aspect?`<span${J("class",xe["image__aspect-wrapper"],0)}${B({"padding-bottom":`${$t}%`})}><img${J("class",xe.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",et(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}></span>`:`<img${J("class",xe.image__image,0)}${J("src",l,0)} loading="lazy" decoding="async"${J("style",et(F),0)}${J("alt",_,0)}${J("aria-hidden",_?null:"true",0)}>`})}`})),Ee={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function Ce(t){return t>0&&t<1}function Fe(t){return String(Math.ceil(1e3*t)/1e3)}function Ae(t,e,r){if(t.some(Ce)){const e=Math.max(...t.filter(Ce).map((t=>1/t)));t=t.map((t=>t*e))}let i=0,n=0;const o=[];if(t.every(Boolean)){n=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*n;r>i&&(i=r)}}for(let e=0;e<r;++e)i?o[e]=`minmax(${rt(i*t[e]/n)},${Fe(t[e])}fr)`:t[e]?o[e]=`${Fe(t[e])}fr`:o[e]="auto";return o.join(" ")}const Ve=N(((t,e,i,n)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b=r,_=r,w=r,x=r,{json:k={}}=e,{templateContext:$}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(X);let A,V,D=!1,j=1,P=[],S=[],M=[],T=[],z=0,N=!1,J="top",R="left";void 0===e.json&&i.json&&void 0!==k&&i.json(k),void 0===e.templateContext&&i.templateContext&&void 0!==$&&i.templateContext($),void 0===e.origJson&&i.origJson&&void 0!==E&&i.origJson(E),void 0===e.layoutParams&&i.layoutParams&&void 0!==C&&i.layoutParams(C),o=k.items,(null==o?void 0:o.length)&&Array.isArray(o)?D=!1:(D=!0,F.logError(K(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(k.column_count),x(),x=a(s,(t=>y=t)),j=Gt(y,j),l=(!D&&o||[]).map((t=>{let e=t,r=$;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=L(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;P=[],S=[],M=[],T=[],N=!1,V=l.map(((i,n)=>{var o,a,s,l;const c=m[n],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,g={x:e,y:r,colSpan:u,rowSpan:d},v="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.type)?Number(c.width.weight||1)/u:0,p="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let i=e;i<e+u;++i)for(let e=r;e<r+d;++e)t[i+"_"+e]?N=!0:(t[i+"_"+e]=!0,(!P[i]||P[i]<v)&&(P[i]=v),(!S[e]||S[e]<p)&&(S[e]=p),(!M[i]||M[i]<f)&&(M[i]=f),(!T[e]||T[e]<h)&&(T[e]=h));do{++e,e>=j&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:g,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(K(new Error('Mismatching "grid" rows/columns'))),z=r}return c=F.getDerivedFromVars(k.content_alignment_vertical),_(),_=a(c,(t=>h=t)),J=te(h,J),u=F.getDerivedFromVars(k.content_alignment_horizontal),b(),b=a(u,(t=>f=t)),R=Qt(f,R),d={valign:J,halign:R},g={"grid-template-columns":Ae(P,M,j),"grid-template-rows":Ae(S,T,z)},p=D||N,b(),_(),w(),x(),p?"":`${I(Ht,"Outer").$$render(t,{cls:wt("grid",Ee,d),json:k,origJson:E,templateContext:$,style:g,layoutParams:C,parentOf:k.items,replaceItems:function(t){k=Object.assign(Object.assign({},k),{items:t})}},{},{default:()=>`${O(V,(e=>`${I(Vr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),De=Ve,je={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function Pe(t){const e=[];let r=t[0],i=1;for(let n=1;n<=t.length;n++)t[n]!==r?(e.push(i>1?`repeat(${i}, ${r})`:r),r=t[n],i=1):i++;return e.join(" ")}function Se(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const Oe=N(((t,e,i,n)=>{let o,s,l,c,u,g,p,f,h,m,y,b,_,w,x,k,$,E,C,F,A,V,D,P,S,M,T,z,N,R=r,B=r,U=r,W=r,H=r,q=r,G=r,Y=r,Q=r,tt=r,{json:it={}}=e,{templateContext:nt}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=v(X);let lt,ct,ut=[],dt=!1,gt=!1,vt=null,pt=!1;const ft=st.getCustomization("galleryLeftClass"),ht=st.getCustomization("galleryRightClass");let mt=!1;z=a(st.isDesktop,(t=>T=t));let yt,bt,_t,xt,kt=1,$t="horizontal",Et="start",At=8,Vt="",jt=[],Pt={},St=!1,Ot={},Mt=0;const It=Se((function(){if(!lt)return;const t=lt.scrollLeft,e=lt.scrollWidth,r=lt.offsetWidth;dt=t>2,gt=t+r<e-2}),50);function Tt(){let t=[],e=ut[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<kt;++e){const i=ut[e].children[r];i&&t.push(i)}return t}function zt(t,e,r="smooth"){const i="horizontal"===$t,n=i?"offsetLeft":"offsetTop",o=i?"left":"top",a=t[e];a&&lt.scroll({[o]:Math.max(0,a[n]+.01-At/2),behavior:r})}function Nt(t){const e=Tt(),r=lt.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===$t?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==i)return i;const n=e.map((t=>function(t,e){return"horizontal"===$t?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=n.findIndex(Boolean);return-1!==o?"prev"===t&&2===n.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!it.id||mt||(null==at?void 0:at.fakeElement)||st.registerInstance(it.id,{setCurrentItem(t){const e=Tt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');zt(e,t)},setPreviousItem(t){const e=Nt("prev"),r=Tt();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),zt(r,i)},setNextItem(t){const e="horizontal"===$t?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Tt();if(e&&"ring"===t)return void zt(r,0);const i=Nt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),zt(r,n)}}),d((()=>{pt=!1,it.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(it.id)})),void 0===e.json&&i.json&&void 0!==it&&i.json(it),void 0===e.templateContext&&i.templateContext&&void 0!==nt&&i.templateContext(nt),void 0===e.origJson&&i.origJson&&void 0!==ot&&i.origJson(ot),void 0===e.layoutParams&&i.layoutParams&&void 0!==at&&i.layoutParams(at),o=it.items,(null==o?void 0:o.length)&&Array.isArray(o)?mt=!1:(mt=!0,st.logError(K(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!mt&&o||[]).map((t=>{let e=t,r=nt;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=T&&pt&&!mt,l?"undefined"!=typeof ResizeObserver&&(vt=new ResizeObserver((()=>{It()})),vt.observe(ct)):vt&&(vt.disconnect(),vt=null),c=st.getDerivedFromVars(it.column_count),Q(),Q=a(c,(t=>M=t)),kt=Gt(M,kt),u=function(t,e){let r=0,i=[];for(let n=0;n<t.length;++n)i[r]||(i[r]=[]),i[r].push(t[n]),++r>=e&&(r=0);return i}(s,kt),g=st.getDerivedFromVars(it.orientation),Y(),Y=a(g,(t=>S=t)),$t=_e(S,$t),p=st.getDerivedFromVars(it.cross_content_alignment),G(),G=a(p,(t=>P=t)),Et=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(P,Et),f=st.getDerivedFromVars(it.item_spacing),q(),q=a(f,(t=>D=t)),At=Ft(D,At),yt=rt(At),h=st.getDerivedFromVars(it.cross_spacing),H(),H=a(h,(t=>V=t)),_t=Ft(V,At),bt=rt(_t),m=st.getDerivedFromVars(it.paddings),W(),W=a(m,(t=>A=t)),Vt=Ct(A,Vt),y="horizontal"===$t?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===$t?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),xt=L(t,(t=>t)),U(),U=a(xt,(t=>F=t))}jt=[],kt>1?jt.push("auto"):F.forEach((t=>{!t&&"horizontal"===$t||"match_parent"===(null==t?void 0:t.type)?jt.push("100%"):jt.push("max-content")})),b=st.getDerivedFromVars(it.scroll_mode),B(),B=a(b,(t=>C=t));{const t={};let e={};St=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===$t?e.parentVAlign=Et:e.parentHAlign=Et,"paging"===C&&(St=!0,e.scrollSnap="start",t["horizontal"===$t?"scroll-padding-left":"scroll-padding-top"]=rt(At/2)),1===kt&&(e.parentLayoutOrientation=$t),Pt=Dt(t,Pt),Ot=Dt(e,Ot)}return _=st.getDerivedFromVars(it.restrict_parent_scroll),tt(),tt=a(_,(t=>N=t)),w={padding:Vt,"grid-gap":bt},x={"grid-gap":yt,[y]:Pe(jt)},k={orientation:$t,"scroll-snap":St},$=st.getDerivedFromVars(it.default_item),R(),R=a($,(t=>E=t)),Mt=Ft(E,Mt),R(),B(),U(),W(),H(),q(),G(),Y(),Q(),z(),tt(),"\n\n"+(mt?"":`${I(Ht,"Outer").$$render(t,{cls:wt("gallery",je,k),json:it,origJson:ot,templateContext:nt,layoutParams:at,customPaddings:!0,customActions:"gallery",parentOf:o,replaceItems:function(t){it=Object.assign(Object.assign({},it),{items:t})}},{},{default:()=>`<div class="${j(je.gallery__scroller,!0)+" "+j(N?Z:"",!0)}"${J("style",et(Pt),0)}${J("this",lt,0)}><div${J("class",je["gallery__items-grid"],0)}${J("style",et(w),0)}${J("this",ct,0)}>${O(u,((e,r)=>`<div${J("class",je.gallery__items,0)}${J("style",et(x),0)}${J("this",ut[r],0)}>${O(e,(e=>`${I(Vr,"Unknown").$$render(t,{layoutParams:Ot,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===$t?`${dt&&l?`\n <div${J("class",ft||`${je.gallery__arrow} ${je.gallery__arrow_left}`,0)}>${ft?"":`<svg${J("class",je["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",je["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""}\n ${gt&&l?`\n <div${J("class",ht||`${je.gallery__arrow} ${je.gallery__arrow_right}`,0)}>${ht?"":`<svg${J("class",je["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${J("class",je["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`)})),Me=Oe,Ie={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},Te=N(((t,e,i,n)=>{let o,s,l,c,u,g,p,f,h,m,y,b,w,x,k,$,E,C,F,A,V,D,P,S,M=r,T=r,z=r,N=r,R=r,U=r,L=r,H=r,q=r;var G,Y;let{json:Q={}}=e,{templateContext:tt}=e,{origJson:nt}=e,{layoutParams:at}=e;const st=v(X),lt=st.genId("tabs");let ct=!1,ut=W([]);k=a(ut,(t=>x=t));let dt,gt,vt,pt={};const ft=st.getJsonWithVars(Q.selected_tab);let ht,mt,yt=ft&&Number(ft)||0,bt=12,_t="",xt="",$t="",At="",Vt="",jt="",Pt="",St="",It="",Tt="",zt=0,Jt="",Bt="",Ut=null,Wt=!1,Lt=!1,qt=yt,Zt=[],Xt=[];async function Kt(t,e=!1){if(qt=yt,yt=t,Wt||(Wt=!0,gt.style.height=rt(gt.clientHeight),vt.style.transform=`translate3d(${100*-qt}%,0,0)`),Lt=!0,async function(t){await _(),vt.style.transform=`translate3d(${t}%,0,0)`}(100*-yt),function(t=!1){const e=t?Math.max(0,yt-1):Math.min(yt,qt),r=t?Math.min(o.length-1,yt+1):Math.max(yt,qt);Zt=Zt.map(((t,i)=>t||i>=e&&i<=r)),Xt=Xt.map(((t,i)=>i>=e&&i<=r))}(),async function(){await _();const t=document.getElementById(`${lt}-panel-${yt}`);t&&(gt.style.height=rt(t.offsetHeight))}(),te&&clearTimeout(te),te=window.setTimeout((()=>{Xt=o.map(((t,e)=>e===yt))}),400),Qt=-yt*gt.clientWidth,e){await _();const t=dt.querySelector(`.${Ie.tabs__item_selected}`);t&&t.focus()}}let Qt,te=null;if(!Q.id||ct||(null==at?void 0:at.fakeElement)||st.registerInstance(Q.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Kt(t)},setPreviousItem(t){let e=yt-1;e<0&&(e="ring"===t?o.length-1:yt),Kt(e)},setNextItem(t){let e=yt+1;e>o.length-1&&(e="ring"===t?0:yt),Kt(e)}}),d((()=>{Q.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(Q.id)})),void 0===e.json&&i.json&&void 0!==Q&&i.json(Q),void 0===e.templateContext&&i.templateContext&&void 0!==tt&&i.templateContext(tt),void 0===e.origJson&&i.origJson&&void 0!==nt&&i.origJson(nt),void 0===e.layoutParams&&i.layoutParams&&void 0!==at&&i.layoutParams(at),o=Q.items||[],Array.isArray(o)&&o.length){let t=[];o.forEach(((e,r)=>{const i=st.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});i.title&&"string"==typeof i.title?t.push(i):st.logError(K(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),ut.set(t)}else ut.set([]);(null==x?void 0:x.length)?ct=!1:(ct=!0,st.logError(K(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=st.getDerivedFromVars(Q.width),H(),H=a(s,(t=>P=t)),l=st.getDerivedFromVars(Q.height),L(),L=a(l,(t=>D=t));{let t={};(null==at?void 0:at.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==P?void 0:P.type)&&(t.parentHorizontalWrapContent=!0),D&&"wrap_content"!==D.type||(t.parentVerticalWrapContent=!0),pt=Dt(t,pt)}if(!ct&&(yt<0||yt>=o.length)&&(st.logError(K(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Q.selected_tab,length:o.length}})),yt=yt<0?0:o.length-1),ct||x.some((t=>yt===t.index))||(st.logError(K(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Q.selected_tab}})),yt=(null===(G=x[0])||void 0===G?void 0:G.index)||0),c=st.getDerivedFromVars(Q.tab_title_style),U(),U=a(c,(t=>V=t)),u=V||{},bt=Gt(u.font_size,bt),u.font_size||u.paddings){const t=u.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/bt*10,right:(Number(t.right)||0)/bt*10,bottom:(Number(t.bottom)||0)/bt*10,left:(Number(t.left)||0)/bt*10};_t=Ct(e,_t)}{const t=u.line_height;void 0!==t&&Rt(t)&&(xt=rt(t/bt*10))}{const t=u.letter_spacing;void 0!==t&&Et(t)&&($t=rt(t/bt*10))}if(u.corner_radius||u.corners_radius||u.font_size){const t=null!==(Y=u.corner_radius)&&void 0!==Y?Y:1e3;u.corners_radius?At=function(t,e,r,i){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!Et(n[t]))return i;return Mt(t,e,r)}(u.corners_radius,t,bt,At):Et(t)&&(At=rt(t/bt*10))}return ht=Yt(u.active_font_weight||u.font_weight,ht),Vt=u.font_family&&"string"==typeof u.font_family?st.typefaceProvider(u.font_family,{fontWeight:ht||400}):"",mt=Yt(u.inactive_font_weight||u.font_weight,mt),jt=u.font_family&&"string"==typeof u.font_family?st.typefaceProvider(u.font_family,{fontWeight:mt||400}):"",Pt=ot(u.active_text_color,1,Pt),St=ot(u.inactive_text_color,1,St),It=ot(u.active_background_color,1,It),Tt=ot(u.inactive_background_color,1,Tt),zt=Ft(u.item_spacing,zt),g=st.getDerivedFromVars(Q.has_separator),R(),R=a(g,(t=>A=t)),p=st.getDerivedFromVars(Q.separator_color),N(),N=a(p,(t=>F=t)),f=st.getDerivedFromVars(Q.separator_paddings),z(),z=a(f,(t=>C=t)),A&&(F&&(Jt=ot(F,1,Jt)),C&&(Bt=Ct(C,Bt))),h={background:Jt,margin:Bt},m=st.getDerivedFromVars(Q.switch_tabs_by_content_swipe_enabled),T(),T=a(m,(t=>E=t)),y=void 0===E||Boolean(E),b=st.getDerivedFromVars(Q.restrict_parent_scroll),q(),q=a(b,(t=>S=t)),w=st.getDerivedFromVars(Q.title_paddings),M(),M=a(w,(t=>$=t)),Ut=Ot($||void 0,Ut),ct||(Zt=o.map(((t,e)=>e===yt)),Xt=o.map(((t,e)=>e===yt))),k(),M(),T(),z(),N(),R(),U(),L(),H(),q(),ct?"":`${I(Ht,"Outer").$$render(t,{cls:wt("tabs",Ie,{}),json:Q,origJson:nt,templateContext:tt,layoutParams:at,customActions:"tabs"},{},{default:()=>`\n <div class="${j(Ie.tabs__list,!0)+" "+j(S?Z:"",!0)}" role="tablist"${B({"--divkit-tabs-title-padding":Ut?kt(Ut):"","--divkit-tabs-font-size":rt(bt),"--divkit-tabs-paddings":_t,"--divkit-tabs-line-height":xt,"--divkit-tabs-letter-spacing":$t,"--divkit-tabs-active-font-weight":ht||"","--divkit-tabs-inactive-font-weight":mt||"","--divkit-tabs-active-font-family":Vt||"","--divkit-tabs-inactive-font-family":jt||"","--divkit-tabs-active-text-color":Pt,"--divkit-tabs-inactive-text-color":St,"--divkit-tabs-active-background-color":It,"--divkit-tabs-inactive-background-color":Tt,"--divkit-tabs-border-radius":At,"--divkit-tabs-items-spacing":zt?it(zt):""})}${J("this",dt,0)}>${O(x,(e=>{let r=e.index,i=r===yt;return`\n \n\n ${I(Nt,"Actionable").$$render(t,{cls:wt("tabs__item",Ie,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=at&&at.fakeElement?[]:[e.title_click_action],attrs:{id:`${lt}-tab-${r}`,"aria-controls":`${lt}-panel-${r}`,role:"tab",tabindex:!i||null!=at&&at.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":i?"true":"false"},customAction:null!=at&&at.fakeElement?null:t=>function(t,e){return yt===e||(Kt(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${A?`<div${J("class",Ie.tabs__separator,0)}${J("style",et(h),0)}></div>`:""}\n <div class="${j(Ie.tabs__panels,!0)+" "+j(S?Z:"",!0)}"${J("this",gt,0)}><div${J("class",wt("tabs__swiper",Ie,{inited:Wt,animated:Lt}),0)}${J("this",vt,0)}>${O(x,(e=>{let r=e.index;return`\n\n <div${J("class",wt("tabs__panel",Ie,{visible:Xt[r]}),0)} role="tabpanel" id="${j(lt,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(lt,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${Zt[r]?`${I(Vr,"Unknown").$$render(t,{div:o[r].div,templateContext:tt,layoutParams:pt},{},{})}`:""}\n </div>`}))}</div></div>`})}`})),ze=Te,Ne="divkit-eb860",Je="divkit-e08c6";function Re(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,i=Math.floor(r),n=r-i;return t[i]*n+t[i+1]*(1-n)}}Re([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),Re([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const Be=N(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=v(X),u=v(xt);let p=new Map,f=new Set,h=!1,m=null,y=[],b=[],w=[],x=[];const k=o.div_id||o.id;let $;k?(null==l?void 0:l.fakeElement)||(u.registerInstance(k,{async setState(t){if($===t)return;c.setRunning("stateChange",!0),new Set(f),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],x.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),b=[],w=[],x=[];const e=n.find((e=>e.state_id===t))||null;e?($=t,E=e):c.logError(K(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);c.logError(K(new Error("Missing state block with id"),{additional:{id:t}}))}}),g(xt,{registerInstance(t,e){m||(m=new Map),m.has(t)?c.logError(K(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return b.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return w.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,i){const n=t.id;if(!n)return Promise.resolve();const o={id:n,json:t,templateContext:e,transitions:r,node:i};return x.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&p.has(t),registerChild(t){f.add(t)},unregisterChild(t){f.delete(t)}})):(h=!0,c.logError(K(new Error('Missing "id" prop for div "state"'))));let E=null;const C=c.getJsonWithVars(o.default_state_id);let F=!1;return d((()=>{k&&!(null==l?void 0:l.fakeElement)&&u.unregisterInstance(k)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(f=new Set),n=o.states||[],(null==n?void 0:n.length)?h=!1:(h=!0,c.logError(K(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?($=C,E=t.find((t=>t.state_id===$))||null,E||c.logError(K(new Error("Cannot find state for default_state_id"),{additional:{selectedId:$}}))):(E=t[0],$=E.state_id)))}(n),h?"":`${I(Ht,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${I(Vr,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${J("class","divkit-adaae",0)} aria-hidden="true"${J("this",undefined,0)}>${O(y,(e=>"direction"in e?`<div${J("class",Ne,0)} style="${"left:"+j(e.offsetLeft,!0)+"px;top:"+j(e.offsetTop,!0)+"px;width:"+j(e.width,!0)+"px;height:"+j(e.height,!0)+"px"}"><div${J("class",Je,0)}>${I(Vr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${J("class",Ne,0)}><div${J("class",Je,0)}>${I(Vr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),Ue={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},We=N(((t,e,i,n)=>{let o,l,c,u,g,p,f,h,m,y,b,_,w,x,k,$,E,C=r,F=r,A=r,V=r,D=r,P=r;var S,M,T,z,N,R,B;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:H}=e;const q=v(X),G=q.genId("pager");let Y,Q=!1,tt=!1,nt=0,ot=0,at=!1,st="horizontal",lt="",ct="",ut="";function dt(t,e="smooth"){const r="horizontal"===st,i=Y.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Y.scroll({[o]:i[n],behavior:e}),nt=t}Se((function(){if(!Q)return;const t=function(){const t=Array.from(Y.children),e=Y.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===st?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:nt}();t!==nt&&(nt=t)}),50),U.id&&!(null==H?void 0:H.fakeElement)&&q.registerInstance(U.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');dt(t)},setPreviousItem(t){let e=nt-1;e<0&&(e="ring"===t?o.length-1:nt),dt(e)},setNextItem(t){let e=nt+1;e>o.length-1&&(e="ring"===t?0:nt),dt(e)}}),d((()=>{Q=!1,U.id&&!(null==H?void 0:H.fakeElement)&&q.unregisterInstance(U.id)})),void 0===e.json&&i.json&&void 0!==U&&i.json(U),void 0===e.templateContext&&i.templateContext&&void 0!==W&&i.templateContext(W),void 0===e.origJson&&i.origJson&&void 0!==L&&i.origJson(L),void 0===e.layoutParams&&i.layoutParams&&void 0!==H&&i.layoutParams(H),(null===(S=U.items)||void 0===S?void 0:S.length)&&Array.isArray(U.items)?tt=!1:(tt=!0,q.logError(K(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!tt&&U.items||[]).map((t=>{let e=t,r=W;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=q.getDerivedFromVars(U.layout_mode),F(),F=a(l,(t=>w=t)),w?"percentage"!==w.type&&"fixed"!==w.type?(at=!0,q.logError(K(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):at=!1:(at=!0,q.logError(K(new Error('Empty "layout_mode" prop for div "pager"')))),c=q.getDerivedFromVars(U.orientation),D(),D=a(c,(t=>$=t)),st=_e($,st),u=q.getDerivedFromVars(U.item_spacing),V(),V=a(u,(t=>k=t));{const t=null==k?void 0:k.value;t&&Et(t)&&(lt=rt(t||0))}if(g=q.getDerivedFromVars(U.paddings),A(),A=a(g,(t=>x=t)),ct=Ct(x,ct),p=q.getDerivedFromVars(U.restrict_parent_scroll),P(),P=a(p,(t=>E=t)),f="horizontal"===st?"grid-auto-columns":"grid-auto-rows","fixed"===(null==w?void 0:w.type)){const t=it("horizontal"===st?((null===(M=U.paddings)||void 0===M?void 0:M.left)||0)+((null===(T=U.paddings)||void 0===T?void 0:T.right)||0):((null===(z=U.paddings)||void 0===z?void 0:z.top)||0)+((null===(N=U.paddings)||void 0===N?void 0:N.bottom)||0)),e=null===(R=w.neighbour_page_width)||void 0===R?void 0:R.value;ut=e?`calc(100% + ${t} - 2 * ${it(e)} - 2 * ${lt})`:"100%"}else if("percentage"===(null==w?void 0:w.type)){const t=null===(B=w.page_width)||void 0===B?void 0:B.value;ut=`${Number(t)}%`}return h={"grid-gap":lt,padding:ct,[f]:ut},m={orientation:st},y=tt||at,b=q.getStore("pagers"),C(),C=a(b,(t=>_=t)),function(t,e){const r=U.id;if(r){const i=new Map(_);s(b,_=i.set(r,{instId:G,size:t,currentItem:e,scrollToPagerItem:dt}),_)}}(o.length,nt),function(t){var e;if(t===ot)return;ot=t;const r=q.getJsonWithVars(null===(e=o[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(nt),C(),F(),A(),V(),D(),P(),y?"":`${I(Ht,"Outer").$$render(t,{cls:wt("pager",Ue,m),json:U,origJson:L,templateContext:W,layoutParams:H,customPaddings:!0,parentOf:U.items,replaceItems:function(t){U=Object.assign(Object.assign({},U),{items:t})}},{},{default:()=>`<div class="${j(Ue.pager__items,!0)+" "+j(E?Z:"",!0)}"${J("style",et(h),0)}${J("this",Y,0)}>${O(o,(e=>`<div${J("class",Ue.pager__item,0)}>${I(Vr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),Le=We,He={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},qe=N(((t,e,i,n)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b,w,x,k,$,E,C,F=r,A=r,V=r,D=r,P=r,S=r,M=r,T=r,z=r;var N,R;let{json:U={}}=e,{templateContext:W}=e,{origJson:L}=e,{layoutParams:q}=e;const G=["rounded_rectangle","circle"],Z=v(X);let Y,K,Q,tt={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},et={width:10,height:10,borderRadius:5,background:"#33919cb5"},it="default",nt=15,at=10,st=5;if(void 0===e.json&&i.json&&void 0!==U&&i.json(U),void 0===e.templateContext&&i.templateContext&&void 0!==W&&i.templateContext(W),void 0===e.origJson&&i.origJson&&void 0!==L&&i.origJson(L),void 0===e.layoutParams&&i.layoutParams&&void 0!==q&&i.layoutParams(q),o=Z.getDerivedFromVars(U.shape),S(),S=a(o,(t=>k=t)),s=Z.getDerivedFromVars(U.active_item_color),D(),D=a(s,(t=>w=t)),l=Z.getDerivedFromVars(U.inactive_item_color),P(),P=a(l,(t=>x=t)),c=Z.getDerivedFromVars(U.active_item_size),M(),M=a(c,(t=>$=t)),u=Z.getDerivedFromVars(U.active_shape),z(),z=a(u,(t=>C=t)),d=Z.getDerivedFromVars(U.inactive_shape),T(),T=a(d,(t=>E=t)),C&&(tt=ce({type:"shape_drawable",shape:C},G,tt)),E&&(et=ce({type:"shape_drawable",shape:E},G,et)),!C&&!E&&k){const t=Gt($,1.3);et=ce({type:"shape_drawable",shape:k,color:et.background},G,et),et.background=ot(x,1,et.background),tt=Object.assign(Object.assign({},et),{width:et.width*t,height:et.height*t,borderRadius:et.borderRadius*t,background:tt.background}),tt.background=ot(w,1,tt.background)}if(g=Z.getDerivedFromVars(U.space_between_centers),A(),A=a(g,(t=>y=t)),p=Z.getDerivedFromVars(U.items_placement),V(),V=a(p,(t=>b=t)),!b||"default"!==b.type&&"stretch"!==b.type)it="default",y&&(nt=Ft(y.value,nt));else if(it=b.type,"default"===it)nt=Ft(null===(N=b.space_between_centers)||void 0===N?void 0:N.value,nt);else if("stretch"===it){const t=b;at=Gt(t.max_visible_items,at),st=Ft(null===(R=t.item_spacing)||void 0===R?void 0:R.value,st)}return f=Z.getStore("pagers"),F(),F=a(f,(t=>m=t)),async function(t){if(U.pager_id&&t.has(U.pager_id)&&(Q=t.get(U.pager_id),await _(),K)){const t=K.children[Q.currentItem].offsetLeft;Y.scroll({left:t-Y.clientWidth/2,behavior:"smooth"})}}(m),h={placement:it},F(),A(),V(),D(),P(),S(),M(),T(),z(),`${I(Ht,"Outer").$$render(t,{cls:wt("indicator",He,h),json:U,origJson:L,templateContext:W,layoutParams:q},{},{default:()=>`<div${J("class",He.indicator__scroller,0)}${J("this",Y,0)}><div${J("class",He.indicator__items,0)} role="tablist"${B({margin:"default"===it?`0 ${rt(Math.max(0,tt.width-et.width)/2)}`:"","--divkit-indicator-inactive-width":rt(et.width),"--divkit-indicator-inactive-height":rt(et.height),"--divkit-indicator-inactive-border-radius":rt(et.borderRadius),"--divkit-indicator-inactive-background":et.background||"","--divkit-indicator-inactive-box-shadow":et.boxShadow||"","--divkit-indicator-active-width":rt(tt.width),"--divkit-indicator-active-height":rt(tt.height),"--divkit-indicator-active-border-radius":rt(tt.borderRadius),"--divkit-indicator-active-background":tt.background||"","--divkit-indicator-active-box-shadow":tt.boxShadow||"","--divkit-indicator-active-scale":tt.width/et.width,"--divkit-indicator-default-margin":"default"===it?`0 ${rt((nt-et.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===it?rt(st):"","--divkit-indicator-stretch-max-count":"stretch"===it?at:"","--divkit-indicator-stretch-max-spacer":"stretch"===it?rt((at-1)*st):""})}${J("this",K,0)}>${Q?`${O(Array(Q.size),((t,e)=>{let r=e===Q.currentItem;return`\n <div class="${j(wt("indicator__item",He,{active:r}),!0)+" "+j(H,!0)}" role="tab" id="${j(Q.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(Q.instId,!0)+"-panel-"+j(e,!0)}"${J("aria-selected",r?"true":"false",0)}${J("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),Ge=qe,Ze={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function Ye(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&ot(t.text_color)||"#000",n=Zt(t.font_weight);if(Rt(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:rt(t.font_size),fontWeight:n,textColor:i};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function Xe(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const Ke="function"==typeof BigInt;function Qe(t){return Ke?BigInt(t):Number(t)}const tr=Qe("9223372036854775807"),er=Qe("-9223372036854775808");function rr(t){const e=Qe(t);if(e>tr||e<er)throw new Error("Integer overflow.");return e}const ir=rr(0);function nr(t){let e=t;return e<0&&(e=-e),e}function or(t){let e=0;return t>0?e=1:t<0&&(e=-1),rr(e)}class ar{constructor(t,e){const r=this.convertValue(e);this.name=t,this.value=r}getName(){return this.name}subscribe(t){return this.store||(this.store=W(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}const sr={string:class extends ar{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends ar{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}},integer:class extends ar{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>tr||t<er)throw new Error("Incorrect variable value");return rr(t)}fromString(t){const e=rr(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends ar{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}},color:class extends ar{convertValue(t){if("string"!=typeof t||!at(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends ar{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}},dict:class extends ar{convertValue(t){if("object"!=typeof t||!t)throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Dict variable does not support setter from string")}getType(){return"dict"}}};function lr(t,e,r){if(!(e in sr))throw new Error("Unsupported variable type");return new sr[e](t,r)}function cr(t,e,r,i,n){let o=[];if(n)for(let n=t;n<e;++n)o.push((n-r)/(i-r));else{for(let e=r;e<t;++e)o.push((e-r)/(i-r));for(let t=e;t<i+1;++t)o.push((t-r)/(i-r))}return o}const ur=N(((t,e,i,n)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b,_,w,x,k,$,E,C,F,A,V,D,P,S,M,T,z,N,R,U,W,L,H,q,G=r,Z=r,Y=r,Q=r,tt=r,et=r,nt=r,ot=r,at=r,st=r,lt=r,ct=r;var ut,dt,gt,vt;let{json:pt={}}=e,{templateContext:ft}=e,{origJson:ht}=e,{layoutParams:mt}=e;const yt={width:10,height:10,borderRadius:5,background:"#000"},bt=["rounded_rectangle","circle"],_t=["rounded_rectangle"],xt=v(X),kt=v(Tt);let $t,Ct=0,Ft=100;const At=pt.thumb_value_variable,Vt=pt.thumb_secondary_value_variable;L=a(At&&xt.getVariable(At,"integer")||lr("temp","integer",0),(t=>W=t)),U=a(Vt&&xt.getVariable(Vt,"integer")||lr("temp","integer",0),(t=>R=t));let Dt,jt,St,Ot=Xe(W||0,Ct,Ft),Mt=Xe(R||0,Ct,Ft),It=yt,zt=It,Nt=yt,Jt=yt,Rt=null,Bt=null,Ut=St,Wt="",Lt="",qt=!1,Gt=!1;function Zt(){if(!$t)return;const t=Ft-Ct,e=(null==Rt?void 0:Rt.width)||0,r=(null==Bt?void 0:Bt.width)||0;Math.max(e,r)*t>=(null==$t?void 0:$t.clientWidth)?Gt||(xt.logError(K(new Error("Slider ticks overlap each other"),{level:"warn"})),Gt=!0):Gt=!1}Se(Zt,50),void 0===e.json&&i.json&&void 0!==pt&&i.json(pt),void 0===e.templateContext&&i.templateContext&&void 0!==ft&&i.templateContext(ft),void 0===e.origJson&&i.origJson&&void 0!==ht&&i.origJson(ht),void 0===e.layoutParams&&i.layoutParams&&void 0!==mt&&i.layoutParams(mt),o=xt.getDerivedFromVars(pt.min_value),ct(),ct=a(o,(t=>q=t)),s=xt.getDerivedFromVars(pt.max_value),lt(),lt=a(s,(t=>H=t)),Ct=Pt(q,Ct),Ft=Pt(H,Ft),Zt();{const t=Xe(W||0,Ct,Ft);t!==Ot&&(Ot=t)}{const t=Xe(R||0,Ct,Ft);t!==Mt&&(Mt=t)}l=xt.getDerivedFromVars(pt.thumb_style),st(),st=a(l,(t=>N=t)),It=ce(N,bt,It),c=xt.getDerivedFromVars(pt.thumb_secondary_style),at(),at=a(c,(t=>z=t)),zt=ce(z,bt,It),u=xt.getDerivedFromVars(pt.track_inactive_style),ot(),ot=a(u,(t=>T=t)),Nt=ce(T,_t,Nt),d=xt.getDerivedFromVars(pt.track_active_style),nt(),nt=a(d,(t=>M=t)),Jt=ce(M,_t,Jt),g=xt.getDerivedFromVars(pt.tick_mark_active_style),et(),et=a(g,(t=>S=t));{let t=ce(S,bt,yt);t!==yt&&(Rt=t)}Rt?(Dt=Vt?cr(Math.min(Ot,Mt),Math.max(Ot,Mt)+1,Ct,Ft,!0):cr(Ct,Ot,Ct,Ft,!0),Zt()):Dt=[],p=xt.getDerivedFromVars(pt.tick_mark_inactive_style),tt(),tt=a(p,(t=>P=t));{let t=ce(P,bt,yt);t!==yt&&(Bt=t)}Bt?(jt=Vt?cr(Math.min(Ot,Mt),Math.max(Ot,Mt)+1,Ct,Ft,!1):cr(Ot+1,Ft+1,Ct,Ft,!0),Zt()):jt=[],f=xt.getDerivedFromVars(pt.thumb_text_style),Q(),Q=a(f,(t=>D=t)),St=Ye(D,St),h=xt.getDerivedFromVars(pt.thumb_secondary_text_style),Y(),Y=a(h,(t=>V=t)),Ut=Ye(V,St),m=xt.getDerivedFromVars(pt.accessibility),Z(),Z=a(m,(t=>A=t)),(null==A?void 0:A.description)?Wt=A.description:xt.logError(K(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=xt.getDerivedFromVars(pt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Lt=F.description:Vt&&xt.logError(K(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;kt.hasAction()?(xt.logError(K(new Error('Cannot show "slider" inside component with action'))),t=!0):It===yt?(xt.logError(K(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===yt?(xt.logError(K(new Error('Missing "track_active_style" in slider'))),t=!0):Nt===yt&&(xt.logError(K(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==qt&&(qt=t)}return b=rt(Math.max(...[It.width,zt.width,0].filter(Et))),_=rt(Math.max(...[It.height,zt.height,0].filter(Et))),w=(Ot-Ct)/(Ft-Ct),x=Vt?(Mt-Ct)/(Ft-Ct):void 0,k=void 0!==x?Math.abs(x-w):w,$=void 0!==x?Math.min(x,w):0,E={"--divkit-slider-thumb-width":rt(It.width),"--divkit-slider-thumb-height":rt(It.height),"--divkit-slider-thumb-secondary-width":rt(zt.width),"--divkit-slider-thumb-secondary-height":rt(zt.height),"--divkit-slider-text-offset-x":(null===(ut=null==St?void 0:St.offset)||void 0===ut?void 0:ut.x)?it(St.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==St?void 0:St.offset)||void 0===dt?void 0:dt.y)?it(St.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(gt=null==Ut?void 0:Ut.offset)||void 0===gt?void 0:gt.x)?it(Ut.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(vt=null==Ut?void 0:Ut.offset)||void 0===vt?void 0:vt.y)?it(Ut.offset.y):void 0,"--divkit-slider-tick-active-width":Rt?rt(Rt.width):void 0,"--divkit-slider-tick-active-height":Rt?rt(Rt.height):void 0,"--divkit-slider-tick-active-border-radius":Rt?rt(Rt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Rt?void 0:Rt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Rt?void 0:Rt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Bt?rt(Bt.width):void 0,"--divkit-slider-tick-inactive-height":Bt?rt(Bt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Bt?rt(Bt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Bt?void 0:Bt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Bt?void 0:Bt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":x},C={},G(),Z(),Y(),Q(),tt(),et(),nt(),ot(),at(),st(),U(),L(),lt(),ct(),"\n\n"+(qt?"":`${I(Ht,"Outer").$$render(t,{cls:wt("slider",Ze,C),style:E,customDescription:!0,customActions:"slider",json:pt,origJson:ht,templateContext:ft,layoutParams:mt},{},{default:()=>{var t,e,r,i,n,o;return`<div${J("class",Ze["slider__tracks-wrapper"],0)}><div${J("class",Ze["slider__tracks-inner"],0)}${J("this",$t,0)}><div${J("class",Ze.slider__track,0)}${B({height:rt(Nt.height),"border-radius":rt(Nt.borderRadius),background:Nt.background,"box-shadow":Nt.boxShadow||""})}></div>\n <div${J("class",Ze["slider__active-track"],0)}${B({left:(100*$).toFixed(2)+"%",width:(100*k).toFixed(2)+"%",height:rt(Jt.height),"border-radius":rt(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${O(Dt,(t=>`<div class="${j(Ze.slider__tick,!0)+" "+j(Ze.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${O(jt,(t=>`<div class="${j(Ze.slider__tick,!0)+" "+j(Ze.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${J("class",Ze.slider__thumb,0)}${B({"border-radius":rt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${St?`<div${J("class",Ze["slider__thumb-text"],0)}><div${J("class",Ze["slider__thumb-text-inner"],0)}${B({"font-size":(null===(t=St)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=St)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=St)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Ot)}</div></div>`:""}</div>\n ${Vt?`<div class="${j(Ze.slider__thumb,!0)+" "+j(Ze.slider__thumb_secondary,!0)}"${B({"border-radius":rt(zt.borderRadius),background:zt.background,"box-shadow":zt.boxShadow||""})}>${Ut?`<div class="${j(Ze["slider__thumb-text"],!0)+" "+j(Ze["slider__thumb-text_secondary"],!0)}"><div${J("class",Ze["slider__thumb-text-inner"],0)}${B({"font-size":(null===(i=Ut)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(n=Ut)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Ut)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Mt)}</div></div>`:""}</div>`:""}\n <input type="range"${J("class",Ze.slider__input,0)}${J("min",Ct,0)}${J("max",Ft,0)} step="1"${J("value",Ot,0)}${J("aria-label",Wt,0)}>\n ${Vt?`<input type="range"${J("class",`${Ze.slider__input} ${Ze.slider__input_secondary}`,0)}${J("min",Ct,0)}${J("max",Ft,0)} step="1"${J("value",Mt,0)}${J("aria-label",Lt,0)}>`:""}</div></div>`}})}`)})),dr={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_right":"divkit-e8038",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_top":"divkit-bdccd","input_alignment-vertical_bottom":"divkit-fc670","input_alignment-vertical_baseline":"divkit-dd6af","input_highlight-color":"divkit-cc00f",input__input_singleline:"divkit-ffd1e","input__scroll-wrapper":"divkit-ad8a3",input__input_multiline:"divkit-f61f0","input__input_has-custom-focus":"divkit-e6b50"};function gr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=gr(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,i=e.length-1;const n=e.length-t.length;for(;r<i&&r<t.length&&t[r]===e[r];)++r;for(;i-n>=r&&t[i-n]===e[i];)--i;return++i,{start:r,added:i-r,removed:i-r-n}}function vr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class pr{constructor(t){this.char=t}}class fr{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class hr{constructor(t){vr(this,"filters",new Map),vr(this,"destructedValue",[]),vr(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof pr)t+=r.char;else if(r instanceof fr)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof fr&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(K(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new fr(null,this.filters.get(e.key),e.placeholder):new pr(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=gr(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const i=this.buildBodySubstring(r,t),n=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=this.calculateMaxShift(n,o);this.replaceChars(i,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(n,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,i=e;for(;i<this.destructedValue.length;)this.destructedValue[i]instanceof fr&&++r,++i;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let i=0;for(;i<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+i);)++i;return Math.max(0,i-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof fr&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof fr&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let i;i=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=i}calculateInsertableSubstring(t,e){let r="",i=e;const n=()=>{for(var t;i<this.destructedValue.length&&!(this.destructedValue[i]instanceof fr);)++i;return null===(t=this.destructedValue[i])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=n();null!=e&&e.test(t)&&(r+=t,++i)})),r}collectValueRange(t,e){let r="",i=t;for(;i<=e;){const t=this.destructedValue[i];t instanceof fr&&null!==t.char&&(r+=t.char),++i}return r}replaceChars(t,e,r){let i=this.calculateInsertableSubstring(t,e);void 0!==r&&(i=i.substring(0,r));let n=e,o=0;for(;n<this.destructedValue.length&&o<i.length;){const t=this.destructedValue[n],e=i[o];t instanceof fr&&(t.char=e,++o),++n}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof fr);)++e;return e}}class mr extends hr{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function yr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class br extends hr{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),yr(this,"currencyFormatter",new Intl.NumberFormat),yr(this,"decimalSeparator","."),yr(this,"localeDigits",{}),yr(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(K(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),i=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:i,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=gr(this.value,t),i=this.value.lastIndexOf(this.decimalSeparator),n=t.lastIndexOf(this.decimalSeparator),o=i!==n||-1===i&&-1===n,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,i=0;for(;i<t.length;){if(t[i]===this.decimalSeparator&&!this.inDiff(e,i)){r=i;break}i++}let n=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(n=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;if(-1!==r)for(i=r;i<t.length;)this.isDigit(t[i])&&!this.inDiff(e,i)&&a--,i++;else{let r=!1;for(let i=0;i<t.length;i++){const n=t[i];n===this.decimalSeparator?r=!0:!this.inDiff(e,i)&&r&&this.isDigit(n)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==n,l=[];i=t.length-1;let c=!1;for(;i>=0;){const u=t[i],d=l.length<=o;this.isDigit(u)?this.inDiff(e,i)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&i===n?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==i&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=i),i--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}function _r(t){const e=t.textContent;let r=0;return"string"==typeof e&&(r+=e.length,t instanceof HTMLElement&&("DIV"===t.tagName||"BR"===t.tagName)&&++r),r}function wr(t,e){if(3!==t.nodeType)if(t instanceof HTMLElement&&"BR"===t.tagName)try{const e=window.getSelection();if(e){e.removeAllRanges();const r=document.createRange(),i=t.parentNode,n=Array.from(i.childNodes).indexOf(t)+1;r.setStart(i,n),r.setEnd(i,n),e.addRange(r)}}catch(t){}else for(let r=0,i=t.childNodes.length;r<i;++r){const i=t.childNodes[r],n=_r(i);if(e<=n)return void wr(i,e);e-=n}else try{const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStart(t,e),i.setEnd(t,e),r.addRange(i)}}catch(t){}}const xr=N(((t,e,i,n)=>{let o,l,c,u,d,g,p,f,h,m,y,b,w,x,k,$,E,C,F,A,V,D,P,S,O,M,T,z,N,R,B,U,W,L,H,q,G,Z,Y,Q,tt,nt,at,st,lt=r,ct=r;var ut;let{json:dt={}}=e,{templateContext:gt}=e,{origJson:vt}=e,{layoutParams:pt}=e;const ft=v(X);let ht,mt=null;const yt=dt.text_variable,bt=null===(ut=dt.mask)||void 0===ut?void 0:ut.raw_text_variable;let _t=!1;yt||(_t=!0,ft.logError(K(new Error('Missing "text_variable" in "input"'))));let xt=yt&&ft.getVariable(yt,"string")||lr("temp","string","");m=a(xt,(t=>h=t));let Et=bt&&ft.getVariable(bt,"string")||lr("temp","string","");b=a(Et,(t=>y=t));let Ct="",At="";C=a(ft.getDerivedFromVars(dt.mask),(t=>E=t)),nt=a(ft.getDerivedFromVars(dt.hint_text),(t=>tt=t)),Q=a(ft.getDerivedFromVars(dt.hint_color),(t=>Y=t));let Vt="";Z=a(ft.getDerivedFromVars(dt.font_size),(t=>G=t));let Dt,jt=12;q=a(ft.getDerivedFromVars(dt.font_weight),(t=>H=t)),L=a(ft.getDerivedFromVars(dt.font_family),(t=>W=t));let Pt,St="";U=a(ft.getDerivedFromVars(dt.line_height),(t=>B=t)),R=a(ft.getDerivedFromVars(dt.letter_spacing),(t=>N=t));let Mt="";z=a(ft.getDerivedFromVars(dt.text_color),(t=>T=t));let It="#000";M=a(ft.getDerivedFromVars(dt.highlight_color),(t=>O=t));let Tt="";S=a(ft.getDerivedFromVars(dt.text_alignment_horizontal),(t=>P=t));let zt="left";D=a(ft.getDerivedFromVars(dt.text_alignment_vertical),(t=>V=t));let Nt="center";A=a(ft.getDerivedFromVars(dt.keyboard_type),(t=>F=t));const Jt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let Bt="multi_line_text",Ut="text";const Wt=document&&"inputMode"in document.createElement("input");let Lt;$=a(ft.getDerivedFromVars(dt.max_visible_lines),(t=>k=t));let qt="",Zt=null,Xt="",Kt="",ee="";function re(t){ht instanceof HTMLInputElement?ht.selectionStart=ht.selectionEnd=t:wr(ht,t)}async function ie(){if(!ht||!mt)return;mt.overrideRawValue(y),Et.set(mt.rawValue),s(xt,h=Ct=At=mt.value,h);const t=mt.cursorPosition;await _(),document.activeElement===ht&&re(t)}var ne;st=a(ft.getDerivedFromVars(dt.select_all_on_focus),(t=>at=t)),void 0===e.json&&i.json&&void 0!==dt&&i.json(dt),void 0===e.templateContext&&i.templateContext&&void 0!==gt&&i.templateContext(gt),void 0===e.origJson&&i.origJson&&void 0!==vt&&i.origJson(vt),void 0===e.layoutParams&&i.layoutParams&&void 0!==pt&&i.layoutParams(pt),"fixed_length"===(null==(ne=E)?void 0:ne.type)?mt=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const i={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(i),r):new mr(i,e)}return r||null}(ne,ft.logError,mt):"currency"===(null==ne?void 0:ne.type)&&(mt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new br(t.locale,e)}(ne,ft.logError,mt)),mt&&ie(),mt||Ct===h||(Ct=At=h),mt&&mt.rawValue!==y&&ie(),o=tt,Vt=ot(Y,1,Vt),jt=Gt(G,jt),Dt=Yt(H,Dt),St=W&&"string"==typeof W?ft.typefaceProvider(W,{fontWeight:Dt||400}):"";{const t=B;Rt(t)&&(Pt=t/jt)}return $t(N)&&(Mt=rt(N)),It=ot(T,1,It),Tt=ot(O,1,Tt),zt=Qt(P,zt),Nt=te(V,Nt),F&&F in Jt&&(Ut=Jt[F],Bt=F),"currency"===(null==E?void 0:E.type)&&(Ut=Wt?"text":"tel",Lt="decimal"),l="multi_line_text"===Bt,c=ft.getDerivedFromVars(dt.paddings),ct(),ct=a(c,(t=>x=t)),Rt(k)&&(qt=`calc(${k*(Pt||1.25)*(jt/10)+"em"} + ${it(Ft(null==x?void 0:x.top,0)+Ft(null==x?void 0:x.bottom,0))})`),Zt=Ot(x||void 0,Zt),Xt=Zt?kt({top:(Number(Zt.top)||0)/jt*10,right:(Number(Zt.right)||0)/jt*10,bottom:(Number(Zt.bottom)||0)/jt*10,left:(Number(Zt.left)||0)/jt*10}):"",Kt=Zt?kt({top:(Number(Zt.top)||0)/jt*10,bottom:(Number(Zt.bottom)||0)/jt*10}):"",u=ft.getDerivedFromVars(dt.accessibility),lt(),lt=a(u,(t=>w=t)),(null==w?void 0:w.description)?ee=w.description:ft.logError(K(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(Tt),multiline:l,"alignment-horizontal":zt,"alignment-vertical":Nt},g={"--divkit-input-hint-color":Vt,"--divkit-input-highlight-color":Tt,"--divkit-input-line-height":Pt,"font-weight":Dt,"font-family":St,"letter-spacing":Mt,color:It,"max-height":qt},p={"font-size":rt(jt),padding:Xt},f={"font-size":rt(jt),padding:Kt},m(),b(),lt(),ct(),$(),C(),A(),D(),S(),M(),z(),R(),U(),L(),q(),Z(),Q(),nt(),st(),_t?"":`${I(Ht,"Outer").$$render(t,{cls:wt("input",dr,d),style:g,customDescription:!0,customActions:"input",customPaddings:!0,json:dt,origJson:vt,templateContext:gt,layoutParams:pt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return l?`<span${J("class",dr["input__scroll-wrapper"],0)}>${!At&&o?`<div${J("class",dr.input__placeholder,0)} aria-hidden="true"${J("style",et(p),0)}>${j(o)}</div>`:""}\n\n \n <span aria-hidden="true"${J("style",et(f),0)}>​</span>\n\n \n <span${J("class",wt("input__input",dr,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${J("aria-label",ee,0)}${J("style",et(p),0)}${J("this",ht,0)}>${i=At,void 0===i?"":i}</span></span>`:`<input${J("type",Ut,0)}${J("inputmode",Lt,0)}${J("class",wt("input__input",dr,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${J("aria-label",ee,0)}${J("style",et(p),0)}${J("placeholder",o,0)}${J("value",Ct,0)}${J("this",ht,0)}>`;var i}})}`})),kr={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72","select__select_has-custom-focused":"divkit-a46ad","has-custom-focused":"divkit-fc5dc",select__option:"divkit-e774b"},$r=N(((t,e,i,n)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b,_,w,x,k,$,E,C,F,A,V,D,P,S,M,T=r,z=r,{json:N={}}=e,{templateContext:R}=e,{origJson:B}=e,{layoutParams:U}=e;const W=v(X),L=N.value_variable;let H=!1;L||(H=!0,W.logError(K(new Error('Missing "value_variable" in "select"')))),M=a(L&&W.getVariable(L,"string")||lr("temp","string",""),(t=>S=t));let q="";const G=N.options,Z=Array.isArray(G)&&G.filter((t=>"string"==typeof t.value))||[];Array.isArray(Z)&&Z.length||W.logError(K(new Error('Empty selection "items" in "select"')));let Y="",Q=null,tt="";D=a(W.getDerivedFromVars(N.hint_text),(t=>V=t)),A=a(W.getDerivedFromVars(N.hint_color),(t=>F=t));let it="rgba(0,0,0,.45)";C=a(W.getDerivedFromVars(N.font_size),(t=>E=t));let nt,at=12;$=a(W.getDerivedFromVars(N.font_weight),(t=>k=t)),x=a(W.getDerivedFromVars(N.font_family),(t=>w=t));let st,lt="";_=a(W.getDerivedFromVars(N.line_height),(t=>b=t)),y=a(W.getDerivedFromVars(N.letter_spacing),(t=>m=t));let ct="";h=a(W.getDerivedFromVars(N.text_color),(t=>f=t));let ut="#000",dt="";void 0===e.json&&i.json&&void 0!==N&&i.json(N),void 0===e.templateContext&&i.templateContext&&void 0!==R&&i.templateContext(R),void 0===e.origJson&&i.origJson&&void 0!==B&&i.origJson(B),void 0===e.layoutParams&&i.layoutParams&&void 0!==U&&i.layoutParams(U),q=S;{const t=Z.find((t=>t.value===S));t?Y="string"==typeof t.text?t.text:t.value:(Y="",S&&W.logError(K(new Error('Value from the variable was not found in the selection items for "select"'))))}o=W.getDerivedFromVars(N.paddings),z(),z=a(o,(t=>P=t)),at=Gt(E,at),Q=Ot(P||void 0,Q),tt=Q?kt({top:(Number(Q.top)||0)/at*10,right:(Number(Q.right)||0)/at*10,bottom:(Number(Q.bottom)||0)/at*10,left:(Number(Q.left)||0)/at*10}):"",s=V,it=ot(F,1,it),nt=Yt(k,nt),lt=w&&"string"==typeof w?W.typefaceProvider(w,{fontWeight:nt||400}):"";{const t=b;Rt(t)&&(st=t/at)}return $t(m)&&(ct=rt(m/at*10)),ut=ot(f,1,ut),l=W.getDerivedFromVars(N.accessibility),T(),T=a(l,(t=>p=t)),(null==p?void 0:p.description)?dt=p.description:W.logError(K(new Error('Missing accessibility "description" for select'),{level:"warn"})),c={hint:!Y},u={"--divkit-input-hint-color":it,"font-weight":nt,"font-family":lt,color:ut},d={padding:tt,"font-size":rt(at),"line-height":st,"letter-spacing":ct},g={"font-size":rt(at),"line-height":st,"letter-spacing":ct},T(),h(),y(),_(),x(),$(),C(),A(),D(),z(),M(),H?"":`${I(Ht,"Outer").$$render(t,{cls:wt("select",kr,c),style:u,customDescription:!0,customActions:"select",customPaddings:!0,json:N,origJson:B,templateContext:R,layoutParams:U},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${J("class",kr["select__select-text"],0)}${J("style",et(d),0)} aria-hidden="true">\n ${j(Y||s||"​")}</span>\n\n <select${J("class",wt("select__select",kr,{"has-custom-focus":t}),0)}${J("aria-label",dt,0)}${J("style",et(g),0)}>${O(Z,(t=>`<option${J("class",kr.select__option,0)}${J("value",t.value,0)}>${j(t.text||t.value)}</option>`))}</select>`})}`})),Er={video__video:"divkit-c11f9"},Cr=N(((t,e,r,i)=>{let n,o,s,l,c,u,g,p,f,h,{json:m={}}=e,{templateContext:y}=e,{origJson:b}=e,{layoutParams:_}=e;const w=v(X);let x=!1,k=!1;h=a(w.getDerivedFromVars(m.video_sources),(t=>f=t));let $=[];p=a(w.getDerivedFromVars(m.repeatable),(t=>g=t));let E=!1;u=a(w.getDerivedFromVars(m.autostart),(t=>c=t));let C=!1;l=a(w.getDerivedFromVars(m.muted),(t=>s=t));let F,A=!1;o=a(w.getDerivedFromVars(m.preview),(t=>n=t));const V=m.elapsed_time_variable;var D,j;return(V&&w.getVariable(V,"integer")||lr("temp","integer",0)).subscribe((t=>{k&&(k=!1)})),!m.id||x||(null==_?void 0:_.fakeElement)||w.registerInstance(m.id,{pause(){},start(){}}),d((()=>{!m.id||x||(null==_?void 0:_.fakeElement)||w.unregisterInstance(m.id)})),void 0===e.json&&r.json&&void 0!==m&&r.json(m),void 0===e.templateContext&&r.templateContext&&void 0!==y&&r.templateContext(y),void 0===e.origJson&&r.origJson&&void 0!==b&&r.origJson(b),void 0===e.layoutParams&&r.layoutParams&&void 0!==_&&r.layoutParams(_),D=f,j=$,$=Array.isArray(D)&&D.length?D.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):j,$.length?x=!1:(x=!0,w.logError(K(new Error('Missing "video_sources" in "video"')))),E=ee(g,E),C=ee(c,C),A=ee(s,A),F="string"==typeof n?ke(n):F,o(),l(),u(),p(),h(),x?"":`${I(Ht,"Outer").$$render(t,{cls:Er.video,customActions:"video",json:m,origJson:b,templateContext:y,layoutParams:_},{},{default:()=>`\n <video${J("class",Er.video__video,0)} playsinline ${E?"loop":""} ${C?"autoplay":""} ${A?"muted":""}${J("poster",F,0)}${J("this",undefined,0)}>${O($,(t=>`<source${J("src",t.src,0)}${J("type",t.type,0)}>`))}</video>`})}`})),Fr=Cr,Ar={};Ar.text=ne,Ar.container=ye,Ar.separator=we,Ar.image=$e,Ar.gif=$e,Ar.grid=De,Ar.gallery=Me,Ar.tabs=ze,Ar.state=Be,Ar.pager=Le,Ar.indicator=Ge,Ar.slider=ur,Ar.input=xr,Ar.select=$r,Ar.video=Fr;const Vr=N(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(X);let c,u,d;if(void 0===e.div&&r.div&&void 0!==n&&r.div(n),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),c=n,u=o,d=c&&Ar[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Ar[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(K(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${I(d||M,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||n},{},{})}`:""})),Dr=N(((t,e,r,i)=>{let{svgFiltersMap:n}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==n&&r.svgFiltersMap(n),Object.keys(n).length?`<svg${J("class","divkit-dc22b",0)} aria-hidden="true"><defs>${O([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return`\n <filter${J("id",n[t],0)}><feFlood${J("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${J("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${J("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function jr(t,e,r,i){const n=r[t.type];if(!n)return i(K(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const i=Object.keys(r).filter((t=>"__proto__"!==t)),n=i.filter((t=>"$"!==t.charAt(0))),o=i.filter((t=>"$"===t.charAt(0)));return n.forEach((i=>{const n=r[i];"object"==typeof n&&null!==n?(e[i]=Array.isArray(n)?[]:{},t(e[i],n)):e[i]=n})),o.forEach((t=>{const i=r[t],n=a[i];if(void 0!==n){const r=t.substring(1);e[r]=n}})),e}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Pr(){}function Sr(t){return{subscribe:e=>(e(t),Pr)}}function Or(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Mr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Ir(t){if(t.every((t=>"string"==typeof t)))return{type:"StringLiteral",value:t.join("")};let e=t.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]).reduce(((t,e)=>("string"==typeof e?t.quasis.push({type:"StringLiteral",value:e}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(e)),t)),{type:"TemplateLiteral",quasis:[],expressions:[]});return e.quasis.length===e.expressions.length&&e.quasis.push({type:"StringLiteral",value:""}),e}function Tr(t){try{return rr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function zr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Nr(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,Nr.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function Jr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function Rr(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Fe,JsonStringContents:function(){var t,e,r;for(t=pe,e=[],r=Ae();r!==i;)e.push(r),r=Ae();return fe=t,e=jt(e)}},a=Fe,s="@{",l="}",c="@{}",u="\\",d="?",g=":",v="||",p="&&",f="==",h="!=",m=">=",y=">",b="<=",_="<",w="+",x="-",k="/",$="*",E="%",C="!",F="(",A=")",V=",",D="'",j=".",P="e",S="E",O="true",M="false",I=/^[^}]/,T=/^[^'}]/,z=/^[0-9]/,N=/^[a-zA-Z_0-9.]/,J=/^[a-zA-Z_]/,R=/^[ \t\r\n]/,B=we("@{",!1),U=we("}",!1),W=we("@{}",!1),L=we("\\",!1),H={type:"any"},q=xe(["}"],!0,!1),G=we("?",!1),Z=we(":",!1),Y=we("||",!1),X=we("&&",!1),K=we("==",!1),Q=we("!=",!1),tt=we(">=",!1),et=we(">",!1),rt=we("<=",!1),it=we("<",!1),nt=we("+",!1),ot=we("-",!1),at=we("/",!1),st=we("*",!1),lt=we("%",!1),ct=we("!",!1),ut=we("(",!1),dt=we(")",!1),gt=we(",",!1),vt=ke("string"),pt=we("'",!1),ft=xe(["'","}"],!0,!1),ht=ke("integer"),mt=xe([["0","9"]],!1,!1),yt=ke("number"),bt=we(".",!1),_t=we("e",!1),wt=we("E",!1),xt=ke("boolean"),kt=we("true",!1),$t=we("false",!1),Et=xe([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),Ct=ke("identifier"),Ft=xe([["a","z"],["A","Z"],"_"],!1,!1),At=ke("whitespace"),Vt=xe([" ","\t","\r","\n"],!1,!1),Dt=function(t){return t},jt=function(t){return Ir(t)},Pt=function(t){return t},St=function(){return""},Ot=function(){return _e()},Mt=function(){throw new Error("Error tokenizing '"+t+"'.")},It=function(){throw new Error("Error tokenizing '"+t+"'.")},Tt=function(t){return t},zt=function(t){return zr(t)},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},Jt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Rt=function(t,e){return Mr(t,e)},Bt=function(t,e){return Mr(t,e)},Ut=function(t,e){return Or(t,e)},Wt=function(t,e){return Or(t,e)},Lt=function(t,e){return Or(t,e)},Ht=function(t,e){return Or(t,e)},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t){return{type:"Variable",id:t}},Yt=function(t,e){return[t,...e]},Xt=function(t){return t},Kt=function(t){return t},Qt=function(t){return Ir(t)},te=function(t){return t},ee=function(){return""},re=function(){return _e()},ie=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ae=function(t){return zr(t)},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(){return{type:"IntegerLiteral",value:Tr(_e())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},ue=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},de=function(){return{type:"BooleanLiteral",value:!0}},ge=function(){return{type:"BooleanLiteral",value:!1}},ve=function(){return{type:"Identifier",name:_e()}},pe=0,fe=0,he=[{line:1,column:1}],me=0,ye=[],be=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function _e(){return t.substring(fe,pe)}function we(t,e){return{type:"literal",text:t,ignoreCase:e}}function xe(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function ke(t){return{type:"other",description:t}}function $e(e){var r,i=he[e];if(i)return i;for(r=e-1;!he[r];)r--;for(i={line:(i=he[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return he[e]=i,i}function Ee(t,e,r){var i=$e(t),o=$e(e),a={source:n,start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:o.line,column:o.column}};return r&&n&&"function"==typeof n.offset&&(a.start=n.offset(a.start),a.end=n.offset(a.end)),a}function Ce(t){pe<me||(pe>me&&(me=pe,ye=[]),ye.push(t))}function Fe(){var t,e;return t=pe,Re(),(e=Ve())!==i?(Re(),fe=t,t=Dt(e)):(pe=t,t=i),t}function Ae(){var e,r,n,o,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(pe)?(a=l,pe++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=Pt(o)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,t.substr(pe,3)===c?(r=c,pe+=3):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=St()),(e=r)===i&&(e=pe,r=pe,be++,92===t.charCodeAt(pe)?(n=u,pe++):(n=i,0===be&&Ce(L)),n===i&&(t.substr(pe,2)===s?(n=s,pe+=2):(n=i,0===be&&Ce(B))),be--,n===i?r=void 0:(pe=r,r=i),r!==i?(t.length>pe?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=Ot()):(pe=e,e=i)):(pe=e,e=i),e===i))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],I.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(q)),o!==i)for(;o!==i;)n.push(o),I.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(q));else n=i;n!==i?(125===t.charCodeAt(pe)?(o=l,pe++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=Mt()):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;e===i&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i&&(fe=e,r=It()),(e=r)===i&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=i,0===be&&Ce(L)),r!==i?(t.substr(pe,2)===s?(n=s,pe+=2):(n=i,0===be&&Ce(B)),n!==i?(fe=e,e=Tt(n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=i,0===be&&Ce(L)),r!==i?(t.length>pe?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=zt(n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=Nt()),e=r))))}return e}function Ve(){var e,r,n,o,a,s;return e=pe,(r=De())!==i?(Re(),63===t.charCodeAt(pe)?(n=d,pe++):(n=i,0===be&&Ce(G)),n!==i?(Re(),(o=Ve())!==i?(Re(),58===t.charCodeAt(pe)?(a=g,pe++):(a=i,0===be&&Ce(Z)),a!==i?(Re(),(s=Ve())!==i?(fe=e,e=Jt(r,o,s)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=De()),e}function De(){var e,r,n,o,a,s,l,c;if(e=pe,(r=je())!==i){for(n=[],o=pe,a=Re(),t.substr(pe,2)===v?(s=v,pe+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(c=je())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),t.substr(pe,2)===v?(s=v,pe+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(c=je())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);fe=e,e=Rt(r,n)}else pe=e,e=i;return e}function je(){var e,r,n,o,a,s,l,c;if(e=pe,(r=Pe())!==i){for(n=[],o=pe,a=Re(),t.substr(pe,2)===p?(s=p,pe+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(c=Pe())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),t.substr(pe,2)===p?(s=p,pe+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(c=Pe())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);fe=e,e=Bt(r,n)}else pe=e,e=i;return e}function Pe(){var e,r,n,o,a,s,l,c;if(e=pe,(r=Se())!==i){for(n=[],o=pe,a=Re(),t.substr(pe,2)===f?(s=f,pe+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(pe,2)===h?(s=h,pe+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(c=Se())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),t.substr(pe,2)===f?(s=f,pe+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(pe,2)===h?(s=h,pe+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(c=Se())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);fe=e,e=Ut(r,n)}else pe=e,e=i;return e}function Se(){var e,r,n,o,a,s,l,c;if(e=pe,(r=Oe())!==i){for(n=[],o=pe,a=Re(),t.substr(pe,2)===m?(s=m,pe+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(pe)?(s=y,pe++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(pe,2)===b?(s=b,pe+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(pe)?(s=_,pe++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(c=Oe())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),t.substr(pe,2)===m?(s=m,pe+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(pe)?(s=y,pe++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(pe,2)===b?(s=b,pe+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(pe)?(s=_,pe++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(c=Oe())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);fe=e,e=Wt(r,n)}else pe=e,e=i;return e}function Oe(){var e,r,n,o,a,s,l,c;if(e=pe,(r=Me())!==i){for(n=[],o=pe,a=Re(),43===t.charCodeAt(pe)?(s=w,pe++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(c=Me())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),43===t.charCodeAt(pe)?(s=w,pe++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(pe)?(s=x,pe++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(c=Me())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);fe=e,e=Lt(r,n)}else pe=e,e=i;return e}function Me(){var e,r,n,o,a,s,l,c;if(e=pe,(r=Ie())!==i){for(n=[],o=pe,a=Re(),47===t.charCodeAt(pe)?(s=k,pe++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(pe)?(s=$,pe++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(pe)?(s=E,pe++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(c=Ie())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,a=Re(),47===t.charCodeAt(pe)?(s=k,pe++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(pe)?(s=$,pe++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(pe)?(s=E,pe++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(c=Ie())!==i?o=a=[a,s,l,c]:(pe=o,o=i)):(pe=o,o=i);fe=e,e=Ht(r,n)}else pe=e,e=i;return e}function Ie(){var e,r,n;return(e=Ne())===i&&(e=ze())===i&&(e=pe,33===t.charCodeAt(pe)?(r=C,pe++):(r=i,0===be&&Ce(ct)),r===i&&(43===t.charCodeAt(pe)?(r=w,pe++):(r=i,0===be&&Ce(nt)),r===i&&(45===t.charCodeAt(pe)?(r=x,pe++):(r=i,0===be&&Ce(ot)))),r!==i?(Re(),(n=Ie())!==i?(fe=e,e=qt(r,n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=pe,(r=Je())!==i?(Re(),40===t.charCodeAt(pe)?(n=F,pe++):(n=i,0===be&&Ce(ut)),n!==i?(Re(),o=function(){var e,r,n,o,a,s;if(e=pe,(r=Ve())!==i){for(n=[],o=pe,Re(),44===t.charCodeAt(pe)?(a=V,pe++):(a=i,0===be&&Ce(gt)),a!==i?(Re(),(s=Ve())!==i?o=s:(pe=o,o=i)):(pe=o,o=i);o!==i;)n.push(o),o=pe,Re(),44===t.charCodeAt(pe)?(a=V,pe++):(a=i,0===be&&Ce(gt)),a!==i?(Re(),(s=Ve())!==i?o=s:(pe=o,o=i)):(pe=o,o=i);fe=e,e=Yt(r,n)}else pe=e,e=i;return e===i&&(e=Re()),e}(),o!==i?(Re(),41===t.charCodeAt(pe)?(a=A,pe++):(a=i,0===be&&Ce(dt)),a!==i?(fe=e,e=Gt(r,o)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,(r=Je())!==i&&(fe=e,r=Zt(r)),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return be++,e=pe,39===t.charCodeAt(pe)?(r=D,pe++):(r=i,0===be&&Ce(pt)),r!==i?(n=function(){var t,e,r;for(t=pe,e=[],r=Te();r!==i;)e.push(r),r=Te();return fe=t,t=e=Qt(e)}(),39===t.charCodeAt(pe)?(o=D,pe++):(o=i,0===be&&Ce(pt)),o!==i?(fe=e,e=Kt(n)):(pe=e,e=i)):(pe=e,e=i),be--,e===i&&(r=i,0===be&&Ce(vt)),e}(),e===i&&(e=Ne())===i&&(e=ze())===i&&(e=function(){var e,r;return be++,e=pe,t.substr(pe,4)===O?(r=O,pe+=4):(r=i,0===be&&Ce(kt)),r!==i&&(fe=e,r=de()),(e=r)===i&&(e=pe,t.substr(pe,5)===M?(r=M,pe+=5):(r=i,0===be&&Ce($t)),r!==i&&(fe=e,r=ge()),e=r),be--,e===i&&(r=i,0===be&&Ce(xt)),e}(),e===i&&(e=pe,40===t.charCodeAt(pe)?(r=F,pe++):(r=i,0===be&&Ce(ut)),r!==i&&(n=Ve())!==i?(41===t.charCodeAt(pe)?(o=A,pe++):(o=i,0===be&&Ce(dt)),o!==i?(fe=e,e=Xt(n)):(pe=e,e=i)):(pe=e,e=i))),e}())),e}())),e}function Te(){var e,r,n,o,a;if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(pe)?(a=l,pe++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=te(o)):(pe=e,e=i)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,t.substr(pe,3)===c?(r=c,pe+=3):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=ee()),(e=r)===i&&(e=pe,r=pe,be++,92===t.charCodeAt(pe)?(n=u,pe++):(n=i,0===be&&Ce(L)),n===i&&(39===t.charCodeAt(pe)?(n=D,pe++):(n=i,0===be&&Ce(pt)),n===i&&(t.substr(pe,2)===s?(n=s,pe+=2):(n=i,0===be&&Ce(B)))),be--,n===i?r=void 0:(pe=r,r=i),r!==i?(t.length>pe?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=re()):(pe=e,e=i)):(pe=e,e=i),e===i))){if(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],T.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(ft)),o!==i)for(;o!==i;)n.push(o),T.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(ft));else n=i;n!==i?(125===t.charCodeAt(pe)?(o=l,pe++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=ie()):(pe=e,e=i)):(pe=e,e=i)}else pe=e,e=i;e===i&&(e=pe,t.substr(pe,2)===s?(r=s,pe+=2):(r=i,0===be&&Ce(B)),r!==i&&(fe=e,r=ne()),(e=r)===i&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=i,0===be&&Ce(L)),r!==i?(t.substr(pe,2)===s?(n=s,pe+=2):(n=i,0===be&&Ce(B)),n!==i?(fe=e,e=oe(n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=i,0===be&&Ce(L)),r!==i?(t.length>pe?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=ae(n)):(pe=e,e=i)):(pe=e,e=i),e===i&&(e=pe,92===t.charCodeAt(pe)?(r=u,pe++):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=se()),e=r))))}return e}function ze(){var e,r,n,o;if(be++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt));else n=i;return n!==i?(fe=e,e=le()):(pe=e,e=i),be--,e===i&&(r=i,0===be&&Ce(ht)),e}function Ne(){var e,r,n,o,a,s,l,c,u,d;for(be++,e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt));o!==i;)n.push(o),z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt));if(46===t.charCodeAt(pe)?(o=j,pe++):(o=i,0===be&&Ce(bt)),o!==i){if(a=[],z.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,0===be&&Ce(mt)),s!==i)for(;s!==i;)a.push(s),z.test(t.charAt(pe))?(s=t.charAt(pe),pe++):(s=i,0===be&&Ce(mt));else a=i;if(a!==i){if(s=pe,101===t.charCodeAt(pe)?(l=P,pe++):(l=i,0===be&&Ce(_t)),l===i&&(69===t.charCodeAt(pe)?(l=S,pe++):(l=i,0===be&&Ce(wt))),l!==i){if(43===t.charCodeAt(pe)?(c=w,pe++):(c=i,0===be&&Ce(nt)),c===i&&(45===t.charCodeAt(pe)?(c=x,pe++):(c=i,0===be&&Ce(ot))),c===i&&(c=null),u=[],z.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=i,0===be&&Ce(mt)),d!==i)for(;d!==i;)u.push(d),z.test(t.charAt(pe))?(d=t.charAt(pe),pe++):(d=i,0===be&&Ce(mt));else u=i;u!==i?s=l=[l,c,u]:(pe=s,s=i)}else pe=s,s=i;s===i&&(s=null),fe=e,e=ce()}else pe=e,e=i}else pe=e,e=i;if(e===i){if(e=pe,45===t.charCodeAt(pe)?(r=x,pe++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),z.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(mt));else n=i;if(n!==i)if(101===t.charCodeAt(pe)?(o=P,pe++):(o=i,0===be&&Ce(_t)),o===i&&(69===t.charCodeAt(pe)?(o=S,pe++):(o=i,0===be&&Ce(wt))),o!==i){if(43===t.charCodeAt(pe)?(a=w,pe++):(a=i,0===be&&Ce(nt)),a===i&&(45===t.charCodeAt(pe)?(a=x,pe++):(a=i,0===be&&Ce(ot))),a===i&&(a=null),s=[],z.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=i,0===be&&Ce(mt)),l!==i)for(;l!==i;)s.push(l),z.test(t.charAt(pe))?(l=t.charAt(pe),pe++):(l=i,0===be&&Ce(mt));else s=i;s!==i?(fe=e,e=ue()):(pe=e,e=i)}else pe=e,e=i;else pe=e,e=i}return be--,e===i&&(r=i,0===be&&Ce(yt)),e}function Je(){var e,r,n,o,a;if(be++,e=pe,r=pe,be++,n=function(){var e,r,n,o;return e=pe,t.substr(pe,4)===O?(r=O,pe+=4):(r=i,0===be&&Ce(kt)),r===i&&(t.substr(pe,5)===M?(r=M,pe+=5):(r=i,0===be&&Ce($t))),r!==i?(n=pe,be++,N.test(t.charAt(pe))?(o=t.charAt(pe),pe++):(o=i,0===be&&Ce(Et)),be--,o===i?n=void 0:(pe=n,n=i),n!==i?e=r=[r,n]:(pe=e,e=i)):(pe=e,e=i),e}(),be--,n===i?r=void 0:(pe=r,r=i),r!==i)if(J.test(t.charAt(pe))?(n=t.charAt(pe),pe++):(n=i,0===be&&Ce(Ft)),n!==i){for(o=[],N.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=i,0===be&&Ce(Et));a!==i;)o.push(a),N.test(t.charAt(pe))?(a=t.charAt(pe),pe++):(a=i,0===be&&Ce(Et));fe=e,e=ve()}else pe=e,e=i;else pe=e,e=i;return be--,e===i&&(r=i,0===be&&Ce(Ct)),e}function Re(){var e,r;for(be++,e=[],R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,0===be&&Ce(Vt));r!==i;)e.push(r),R.test(t.charAt(pe))?(r=t.charAt(pe),pe++):(r=i,0===be&&Ce(Vt));return be--,r=i,0===be&&Ce(At),e}if((r=a())!==i&&pe===t.length)return r;throw r!==i&&pe<t.length&&Ce({type:"end"}),function(t,e,r){return new Nr(Nr.buildMessage(t,e),t,e,r)}(ye,me<t.length?t.charAt(me):null,me<t.length?Ee(me,me+1):Ee(me,me))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Nr,Error),Nr.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){i=t[r].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,a=this.location.source+":"+o.line+":"+o.column;if(i){var s=this.location.end,l=Jr("",o.line.toString().length," "),c=i[n.line-1],u=(n.line===s.line?s.column:c.length+1)-n.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+Jr("",n.column-1," ")+Jr("",u,"^")}else e+="\n at "+a}return e},Nr.buildMessage=function(t,e){var r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,i=t.map(a);if(i.sort(),i.length>0){for(e=1,r=1;e<i.length;e++)i[e-1]!==i[e]&&(i[r]=i[e],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(t)+" but "+function(t){return t?'"'+n(t)+'"':"end of input"}(e)+" found."};const Br=new Map,Ur=new Map;function Wr(t,e,r){const i={args:e,cb:r},n=Br.get(t)||[];Br.has(t)||Br.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Ur.set(o,i)}function Lr(t,e){let r=t.args.length,i=t.args.length;const n=t.args[t.args.length-1];if("object"==typeof n&&n.isVararg&&(--r,i=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>i)return{type:"many",expected:i,found:e.length};for(let r=0;r<e.length;++r){let i=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof i&&(i={type:i}),i.type!==e[r].type)return{type:"mismatch",expected:i.type,found:e[r].type}}return{type:"match"}}function Hr(t,e){var r;switch(null===(r=e[t.type])||void 0===r||r.call(e,t),t.type){case"TemplateLiteral":t.expressions.forEach((t=>{Hr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":Hr(t.left,e),Hr(t.right,e);break;case"UnaryExpression":Hr(t.argument,e);break;case"ConditionalExpression":Hr(t.test,e),Hr(t.consequent,e),Hr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{Hr(t,e)}))}}function qr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function Gr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function Zr(t){if("string"===t.type)return t.value;if("integer"===t.type)return String(t.value);if("number"===t.type){let e=String(t.value);return e.includes(".")||(e.includes("e")?e=e.replace("e",".0e"):e+=".0"),e=e.replace(/e\+?/i,"E"),e}if("boolean"===t.type)return t.value?"true":"false";if("datetime"===t.type)return Gr(t.value);if("color"===t.type)return ii(ri(t.value));if("url"===t.type)return t.value;if("dict"===t.type)return"<dict>";throw new Error(`Unexpected type ${t.type}`)}function Yr(t){let e=Zr(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function Xr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function Kr(t,e){if(Ke)return rr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function Qr(t,e){if(e<er||e>tr)throw new Error("Integer overflow.");!Ke&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function ti(t){const e=[];return Hr(t,{Variable(t){e.push(t.id.name)}}),e}function ei(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function ri(t){const e=at(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function ii(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return nt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function ni(t){return ii(ri(t))}const oi=Number.MAX_VALUE,ai=Number.MIN_VALUE,si="string",li="integer",ci="number",ui="boolean",di="color",gi="url",vi="datetime",pi="dict";function fi(t,e){return{type:si,value:Zr(e)}}function hi(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:ci,value:r}}function mi(t,e,r,i){const n=t.variables.get(e.value);let o;return o=n&&n.getType()===i?n.getValue():r.value,"color"===i&&(o=ni(o)),{type:i,value:o}}function yi(t,e,r){return mi(t,e,r,r.type)}function bi(t,e,r){return mi(t,e,r,"color")}function _i(t,e,r){return mi(t,e,r,"url")}const wi=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:li,value:rr(i)}},xi=wi("getUTCFullYear"),ki=wi("getUTCMonth"),$i=wi("getUTCDate"),Ei=wi("getUTCDay"),Ci=wi("getUTCHours"),Fi=wi("getUTCMinutes"),Ai=wi("getUTCSeconds"),Vi=wi("getUTCMilliseconds");function Di(t,e,r,i){if(!i.value.length)return t.warnings.push(K(new Error("String for padding is empty."),{level:"warn"})),"";let n="";const o=e.type===si?e.value:Zr(e);for(;n.length+o.length<r.value;)n+=i.value;return n.length>0&&n.length+o.length>r.value&&(n=n.substring(0,Number(r.value)-Number(o.length))),n}function ji(t,e,r,i){const n=Di(t,e,r,i);return{type:si,value:n+Zr(e)}}function Pi(t,e,r,i){const n=Di(t,e,r,i);return{type:si,value:Zr(e)+n}}function Si(t){return(e,r)=>{const i=ri(r.value);return{type:ci,value:i[t]/255}}}function Oi(t){return(e,r,i)=>{const n=ri(r.value);return n[t]=255*i.value,{type:di,value:ii(n)}}}const Mi=Si("a"),Ii=Si("r"),Ti=Si("g"),zi=Si("b"),Ni=Oi("a"),Ji=Oi("r"),Ri=Oi("g"),Bi=Oi("b");function Ui(t,e,r,i){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=rr(e.value)/rr(r);return Qr(t,n),"number"==typeof n&&(n=Math.floor(n)),i&&(n=rr(n)%rr(i)),{type:li,value:n}}const Wi=36e5;function Li(t,e){return(r,i,...n)=>{let o=function(t,e){let r=t;for(let t=0;t<e.length;++t){if(!r)throw new Error(`Missing property "${e[t]}" in the dict.`);const i=r[e[t]];if(void 0===i)throw new Error(`Missing property "${e[t]}" in the dict.`);r=i}return r}(i.value,n.map((t=>t.value))),a=typeof o;if(a!==t)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(o!==Math.round(o))throw new Error("Cannot convert value to integer.");Qr(r,o)}return"string"===t&&"color"===e&&(o=ni(o)),{type:e,value:o}}}function Hi(t,e){return(r,i,n,...o)=>{try{return t(r,n,...o)}catch(t){let r=i.value;return"color"===e&&(r=ni(r)),{type:e,value:r}}}}const qi=Li("string","string"),Gi=Li("number","number"),Zi=Li("number","integer"),Yi=Li("boolean","boolean"),Xi=Li("string","color"),Ki=Li("string","url"),Qi=Hi(qi,"string"),tn=Hi(Gi,"number"),en=Hi(Zi,"integer"),rn=Hi(Yi,"boolean"),nn=Hi(Xi,"color"),on=Hi(Ki,"url");function an(t){return t.map(Yr).join(", ")}Wr("toString",[li],fi),Wr("toString",[ci],fi),Wr("toString",[ui],fi),Wr("toString",[di],fi),Wr("toString",[gi],fi),Wr("toNumber",[li],hi),Wr("toNumber",[si],hi),Wr("toInteger",[ci],(function(t,e){if(e.value>tr||e.value<er)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:li,value:rr(r)}})),Wr("toInteger",[si],(function(t,e){let r;try{r=rr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>tr||r<er)throw new Error("Unable to convert value to Integer.");return{type:li,value:r}})),Wr("toInteger",[ui],(function(t,e){return{type:li,value:rr(e.value?1:0)}})),Wr("toBoolean",[li],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:ui,value:r}})),Wr("toBoolean",[si],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:ui,value:"true"===e.value?1:0}})),Wr("toColor",[si],(function(t,e){return{type:di,value:ni(e.value)}})),Wr("toUrl",[si],(function(t,e){return{type:gi,value:e.value}})),Wr("encodeUri",[si],(function(t,e){try{return{type:si,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Wr("decodeUri",[si],(function(t,e){try{return{type:si,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Wr("getIntegerValue",[si,li],yi),Wr("getNumberValue",[si,ci],yi),Wr("getBooleanValue",[si,ui],yi),Wr("getStringValue",[si,si],yi),Wr("getColorValue",[si,di],bi),Wr("getColorValue",[si,si],bi),Wr("getUrlValue",[si,gi],_i),Wr("getUrlValue",[si,si],_i),Wr("parseUnixTime",[li],(function(t,e){return{type:vi,value:new Date(1e3*Number(e.value))}})),Wr("nowLocal",[],(function(){return{type:vi,value:new Date}})),Wr("addMillis",[vi,li],(function(t,e,r){return{type:vi,value:new Date(e.value.getTime()+Number(r.value))}})),Wr("setYear",[vi,li],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(Number(r.value)),{type:vi,value:i}})),Wr("setMonth",[vi,li],(function(t,e,r){const i=Number(r.value);if(i<1||i>12)throw new Error(`Expecting month in [1..12], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMonth(i-1),{type:vi,value:n}})),Wr("setDay",[vi,li],(function(t,e,r){const i=new Date(e.value),n=Number(r.value);if(n<=0&&-1!==n||n>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(i))throw new Error(`Unable to set day ${n} for date ${Zr(e)}.`);return i.setUTCDate(-1===n?0:n),{type:vi,value:i}})),Wr("setHours",[vi,li],(function(t,e,r){const i=Number(r.value);if(i<0||i>23)throw new Error(`Expecting hours in [0..23], instead got ${i}.`);const n=new Date(e.value);return n.setUTCHours(i),{type:vi,value:n}})),Wr("setMinutes",[vi,li],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting minutes in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMinutes(i),{type:vi,value:n}})),Wr("setSeconds",[vi,li],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting seconds in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCSeconds(i),{type:vi,value:n}})),Wr("setMillis",[vi,li],(function(t,e,r){const i=Number(r.value);if(i<0||i>999)throw new Error(`Expecting millis in [0..999], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMilliseconds(i),{type:vi,value:n}})),Wr("getYear",[vi],xi),Wr("getMonth",[vi],ki),Wr("getDay",[vi],$i),Wr("getDayOfWeek",[vi],Ei),Wr("getHours",[vi],Ci),Wr("getMinutes",[vi],Fi),Wr("getSeconds",[vi],Ai),Wr("getMillis",[vi],Vi),Wr("getIntervalSeconds",[li],(function(t,e){return Ui(t,e,1e3,60)})),Wr("getIntervalTotalSeconds",[li],(function(t,e){return Ui(t,e,1e3)})),Wr("getIntervalMinutes",[li],(function(t,e){return Ui(t,e,6e4,60)})),Wr("getIntervalTotalMinutes",[li],(function(t,e){return Ui(t,e,6e4)})),Wr("getIntervalHours",[li],(function(t,e){return Ui(t,e,Wi,24)})),Wr("getIntervalTotalHours",[li],(function(t,e){return Ui(t,e,Wi)})),Wr("getIntervalTotalDays",[li],(function(t,e){return Ui(t,e,864e5)})),Wr("getIntervalTotalWeeks",[li],(function(t,e){return Ui(t,e,6048e5)})),Wr("len",[si],(function(t,e){return{type:li,value:rr(e.value.length)}})),Wr("contains",[si,si],(function(t,e,r){return{type:ui,value:e.value.includes(r.value)?1:0}})),Wr("substring",[si,li,li],(function(t,e,r,i){if(i.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||i.value<0||i.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:si,value:e.value.substring(Number(r.value),Number(i.value))}})),Wr("replaceAll",[si,si,si],(function(t,e,r,i){let n;return n=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),i.value):e.value,{type:si,value:n}})),Wr("index",[si,si],(function(t,e,r){return{type:li,value:rr(e.value.indexOf(r.value))}})),Wr("lastIndex",[si,si],(function(t,e,r){return{type:li,value:rr(e.value.lastIndexOf(r.value))}})),Wr("trim",[si],(function(t,e){return{type:si,value:e.value.trim()}})),Wr("trimLeft",[si],(function(t,e){return{type:si,value:e.value.replace(/^\s+/,"")}})),Wr("trimRight",[si],(function(t,e){return{type:si,value:e.value.replace(/\s+$/,"")}})),Wr("toUpperCase",[si],(function(t,e){return{type:si,value:e.value.toUpperCase()}})),Wr("toLowerCase",[si],(function(t,e){return{type:si,value:e.value.toLowerCase()}})),Wr("padStart",[si,li,si],ji),Wr("padStart",[li,li,si],ji),Wr("padEnd",[si,li,si],Pi),Wr("padEnd",[li,li,si],Pi),Wr("testRegex",[si,si],(function(t,e,r){let i;try{i=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:ui,value:i.test(e.value)?1:0}})),Wr("div",[li,li],(function(t,e,r){if(r.value===ir)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return i=Kr(0,i),Qr(t,i),{type:li,value:i}})),Wr("div",[ci,ci],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value/r.value;return{type:ci,value:i}})),Wr("mod",[li,li],(function(t,e,r){if(r.value===ir)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return i=Kr(0,i),Qr(t,i),{type:li,value:i}})),Wr("mod",[ci,ci],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value%r.value;return{type:ci,value:i}})),Wr("mul",[{type:li,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:ir;for(let i=1;i<e.length;++i)r*=e[i].value,r=Kr(0,r),Qr(t,r);return{type:li,value:r}})),Wr("mul",[{type:ci,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:ci,value:r}})),Wr("sub",[{type:li,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:ir;for(let i=1;i<e.length;++i)r-=e[i].value,r=Kr(0,r),Qr(t,r);return{type:li,value:r}})),Wr("sub",[{type:ci,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:ci,value:r}})),Wr("sum",[{type:li,isVararg:!0}],(function(t,...e){let r=ir;for(let i=0;i<e.length;++i)r+=e[i].value,r=Kr(0,r),Qr(t,r);return{type:li,value:r}})),Wr("sum",[{type:ci,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:ci,value:r}})),Wr("abs",[li],(function(t,e){const r=nr(e.value);return Qr(t,r),{type:e.type,value:r}})),Wr("abs",[ci],(function(t,e){const r=Math.abs(e.value);return{type:ci,value:r}})),Wr("max",[{type:li,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:li,value:r}})),Wr("max",[{type:ci,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:ci,value:Math.max(...e.map((t=>t.value)))}})),Wr("min",[{type:li,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:li,value:r}})),Wr("min",[{type:ci,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:ci,value:Math.min(...e.map((t=>t.value)))}})),Wr("maxNumber",[],(function(){return{type:ci,value:oi}})),Wr("minNumber",[],(function(){return{type:ci,value:ai}})),Wr("maxInteger",[],(function(t){return Qr(t,tr),{type:li,value:tr}})),Wr("minInteger",[],(function(t){return Qr(t,er),{type:li,value:er}})),Wr("round",[ci],(function(t,e){const r=Math.sign(e.value);return{type:ci,value:r*Math.round(Math.abs(e.value))}})),Wr("floor",[ci],(function(t,e){return{type:ci,value:Math.floor(e.value)}})),Wr("ceil",[ci],(function(t,e){return{type:ci,value:Math.ceil(e.value)}})),Wr("signum",[li],(function(t,e){return{type:li,value:or(e.value)}})),Wr("signum",[ci],(function(t,e){return{type:ci,value:Math.sign(e.value)}})),Wr("copySign",[li,li],(function(t,e,r){let i;if(r.value===ir)i=e.value;else if(e.value===ir)i=0;else{const t=or(r.value);i=nr(e.value)*t}return Qr(t,i),{type:li,value:i}})),Wr("copySign",[ci,ci],(function(t,e,r){let i=Math.sign(r.value);0===i&&(i=Object.is(i,0)?1:-1);const n=Math.abs(e.value)*i;return{type:ci,value:n}})),Wr("getColorAlpha",[si],Mi),Wr("getColorAlpha",[di],Mi),Wr("getColorRed",[si],Ii),Wr("getColorRed",[di],Ii),Wr("getColorGreen",[si],Ti),Wr("getColorGreen",[di],Ti),Wr("getColorBlue",[si],zi),Wr("getColorBlue",[di],zi),Wr("setColorAlpha",[si,ci],Ni),Wr("setColorAlpha",[di,ci],Ni),Wr("setColorRed",[si,ci],Ji),Wr("setColorRed",[di,ci],Ji),Wr("setColorGreen",[si,ci],Ri),Wr("setColorGreen",[di,ci],Ri),Wr("setColorBlue",[si,ci],Bi),Wr("setColorBlue",[di,ci],Bi),Wr("rgb",[ci,ci,ci],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:di,value:ii(n)}})),Wr("argb",[ci,ci,ci,ci],(function(t,e,r,i,n){const o={a:255*e.value,r:255*r.value,g:255*i.value,b:255*n.value};return{type:di,value:ii(o)}})),Wr("getDictString",[pi,{type:si,isVararg:!0}],qi),Wr("getDictNumber",[pi,{type:si,isVararg:!0}],Gi),Wr("getDictInteger",[pi,{type:si,isVararg:!0}],Zi),Wr("getDictBoolean",[pi,{type:si,isVararg:!0}],Yi),Wr("getDictColor",[pi,{type:si,isVararg:!0}],Xi),Wr("getDictUrl",[pi,{type:si,isVararg:!0}],Ki),Wr("getDictOptString",[si,pi,{type:si,isVararg:!0}],Qi),Wr("getDictOptNumber",[ci,pi,{type:si,isVararg:!0}],tn),Wr("getDictOptInteger",[li,pi,{type:si,isVararg:!0}],en),Wr("getDictOptBoolean",[ui,pi,{type:si,isVararg:!0}],rn),Wr("getDictOptColor",[di,pi,{type:si,isVararg:!0}],nn),Wr("getDictOptColor",[si,pi,{type:si,isVararg:!0}],nn),Wr("getDictOptUrl",[si,pi,{type:si,isVararg:!0}],on),Wr("getDictOptUrl",[gi,pi,{type:si,isVararg:!0}],on);const sn={StringLiteral:function(t,e){return{type:si,value:e.value}},NumberLiteral:function(t,e){return{type:ci,value:e.value}},IntegerLiteral:function(t,e){return Qr(t,e.value),{type:li,value:e.value}},BooleanLiteral:function(t,e){return{type:ui,value:e.value?1:0}},UnaryExpression:function(t,e){const r=qr(ln(t,e.argument));switch(e.operator){case"!":if(r.type===ui)return{type:ui,value:r.value?0:1};ei(`${e.operator}${Yr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const i="+"===e.operator?1:-1;if(r.type===li){const e=r.value*rr(i);return Qr(t,e),{type:li,value:e}}if(r.type===ci)return{type:ci,value:r.value*i};ei(`${e.operator}${Yr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=qr(ln(t,e.test));if(r.type===ui)return r.value?ln(t,e.consequent):ln(t,e.alternate);ei(`${Yr(r)} ? ${Yr(ln(t,e.consequent))} : ${Yr(ln(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return ln(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=Zr(ln(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:si,value:r}},LogicalExpression:function(t,e){const r=qr(ln(t,e.left));if(r.type!==ui&&ei(`${Yr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:ui,value:0};const i=qr(ln(t,e.right));return i.type!==ui&&ei(`${Yr(r)} ${e.operator} ${Yr(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${Xr(i.type)}.`),{type:ui,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=ln(t,e.left),n=ln(t,e.right);if(i.type!==n.type&&ei(`${Yr(i)} ${e.operator} ${Yr(n)}`,`Operator '${r}' cannot be applied to different types: ${Xr(i.type)} and ${Xr(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===vi&&r.type===vi?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:ui,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==ci&&e.type!==li&&e.type!==vi&&ei(`${Yr(e)} ${t} ${Yr(r)}`,`Operator '${t}' cannot be applied to ${Xr(e.type)} type.`);const n=e.type===vi?e.value.getTime():e.value,o=r.type===vi?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:ui,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r,i){if(r.type!==si&&r.type!==ci&&r.type!==li&&ei(`${Yr(r)} ${e} ${Yr(i)}`,`Operator '${e}' cannot be applied to ${Xr(r.type)} type.`),r.type===si)return"-"===e&&ei(`${Yr(r)} - ${Yr(i)}`,`Operator '${e}' cannot be applied to ${Xr(r.type)} type.`),{type:si,value:r.value+i.value};let n="+"===e?r.value+i.value:r.value-i.value;if(r.type===li)try{n=Kr(0,n),Qr(t,n)}catch(t){ei(`${Yr(r)} ${e} ${Yr(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r,i){let n;if(r.type!==li&&r.type!==ci&&ei(`${Yr(r)} ${e} ${Yr(i)}`,`Operator '${e}' cannot be applied to ${Xr(r.type)} type.`),"*"===e)n=r.value*i.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(i.value)&&ei(`${Yr(r)} ${e} ${Yr(i)}`,"Division by zero is not supported."),n="/"===e?r.value/i.value:r.value%i.value}if(r.type===li)try{n=Kr(0,n),Qr(t,n)}catch(t){ei(`${Yr(r)} ${e} ${Yr(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let i;const n=e.arguments.map((e=>ln(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(Ur.has(o))i=Ur.get(o);else{const t=function(t,e){const r=Br.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=Lr(r[t],e);if("match"===n.type)return r[t];i||(i=n)}if(!i)throw new Error("Missing function");return i}(r,n);if("expected"in t||"type"in t&&"missing"===t.type){const e=n.map((t=>Xr(t.type))).join(", "),i=`${r}(${an(n)})`;"few"===t.type&&0===n.length?ei(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?ei(i,`Function '${r}' has no matching override for given argument types: ${e}.`):ei(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){ei(`${r}(${an(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.variables.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' is missing.`)}};function ln(t,e){if(e.type in sn)return sn[e.type](t,e);throw new Error("Unsupported expression")}function cn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(Hr(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const i=ln(r,e);return r.safeIntegerOverflow&&r.warnings.push(K(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:i,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class un{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return Hr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=cn(t,this.ast);r.warnings.forEach(e);const i=r.result;if("error"===i.type)return void e(K(new Error("Expression execution error"),{additional:{message:i.value}}));const n=i.value;if(n instanceof Date)return Gr(n);if("boolean"===i.type)return Boolean(n);if("color"===i.type){const t=at(String(n));if(t)return ii(t);e(K(new Error("Expression execution error")))}return"integer"===i.type?n>2147483647||n<-2147483648?void e(K(new Error("Expression result is out of 32-bit int range"))):Number(n):n}catch(t){return void e(K(new Error("Expression execution error")))}}}function dn(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=Rr(t,{startRule:"JsonStringContents"}),i=ti(r);return e.vars.push(...i),new un(r)}catch(e){return void r(K(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>dn(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=dn(t[n],e,r);return i}}var i;return t}function gn(t,e,r){if(t){if(t instanceof un)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>gn(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=gn(t[n],e,r);return i}}return t}function vn(t,e){const r={vars:[],hasExpression:!1},i=dn(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>gn(i,t,e)}}const pn={pagers:function(){return W(new Map)}},fn=new Map,hn=new Map;function mn(t){const e=fn.get(t)||W("");return fn.has(t)||fn.set(t,e),e}function yn(t){const e=hn.get(t)||new Map;return hn.has(t)||hn.set(t,e),e}class bn{setVariable(t){const e=t.getName(),r=yn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),mn(this).set(e)}getVariable(t){return yn(this).get(t)}}function _n(){return new bn}function wn(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const xn=new Set(["start","stop","pause","resume","cancel","reset"]);class kn{constructor(t){wn(this,"timers",new Map),wn(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(K(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(K(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&xn.has(e)))return void this.logError(K(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const i=this.timers.get(t);this[r](i)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const i=t.tickStarted=performance.now(),n=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-i-n)%r,e()}),n)};e()}}start(t){if("running"===t.state)return void this.logError(K(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(K(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(K(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(K(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(K(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(K(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(K(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(K(new Error("The timer is already running"))):this.logError(K(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}let $n=W(!0),En=0;function Cn(){$n.set(!1)}function Fn(){$n.set(!0)}const An=N(((t,e,r,i)=>{let n,o;var s,l,c,u;let{id:v}=e,{json:p={}}=e,{platform:f="auto"}=e,{theme:h="system"}=e,{globalVariablesController:m=new bn}=e,{mix:y=""}=e,{customization:b={}}=e,{builtinProtocols:w=["http","https","tel","mailto","intent"]}=e,{extensions:x=new Map}=e,{onError:k}=e,{onStat:$}=e,{onCustomAction:E}=e,{onComponent:C}=e,{typefaceProvider:F=(t=>"")}=e,{fetchInit:A={}}=e,V=W("desktop"===f);if(o=a(V,(t=>n=t)),"auto"===f&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");V.set(!t.matches),t.addListener((()=>{V.set(!t.matches)}))}let D="light",P=null;function S(t){h=t}function O(){}const M=new Set(w);let T=!1;p||(T=!0,Y(K(new Error('"json" prop is required')))),v||(T=!0,Y(K(new Error('"id" prop is required'))));let z=function(t){if(!t)return K(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return K(new Error("Missing card"));if(!e.states||!e.states.length)return K(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Ar)return K(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return K(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return K(new Error("Missing state_id"),{additional:{index:t}})}return null}(p);const N=p.templates||{};z&&(T=!0,Y(z));const J={stateChange:!1},R=mn(m),B=yn(m),U=new Map,H=new Map,q=new Map;let G=null;function Z(t){const e=vn(t,Y);return e.hasExpression?e.applyVars(H):t}function Y(t){k?k({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function Q(t,e){$&&$({type:t,action:e})}let tt=0;function et(t){return`${v}-${tt++}`}let rt={},it={};function nt(t){const e=t.url?String(t.url):"";if(e)try{const r=e.replace(/div-action:\/\//,""),i=/([^?]+)\?(.+)/.exec(r);if(!i)return;const n=new URLSearchParams(i[2]);switch(i[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=vt,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const i=r[t],n=r[t+1];let o=e.getChild(i);if(!o)return;o.setState(n),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=ut(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=ut(t);r&&r.setPreviousItem(e)}(n.get("id"),n.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=ut(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const i=n.get("name"),o=n.get("value");if(i&&null!==o){const t=H.get(i);t?"dict"===t.getType()?Y(K(new Error("Setting dict variables is not supported"),{additional:{name:i}})):t.set(o):Y(K(new Error("Cannot find variable"),{additional:{name:i}}))}else Y(K(new Error("Incorrect set_variable_action"),{additional:{url:r}}));break;case"timer":const a=n.get("action"),s=n.get("id");G?G.execTimerAction(s,a):Y(K(new Error("Incorrect timer action"),{additional:{id:s,action:a}}));break;case"video":!function(t,e){if(t){const r=ut(t);r?"start"===e?r.start():"pause"===e?r.pause():Y(K(new Error("Unknown video action"),{additional:{id:t,action:e}})):Y(K(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else Y(K(new Error("Missing id in video action"),{additional:{action:e}}))}(n.get("id"),n.get("action"));break;case"download":!function(t,e){if(t){let r;r="function"==typeof A?A(t):A,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,n,o;if(r){if(r.templates)for(const t in r.templates)N.hasOwnProperty(t)||(N[t]=r.templates[t]);if(Array.isArray(null===(i=r.patch)||void 0===i?void 0:i.changes)){if("transactional"===r.patch.mode){const i=r.patch.changes.find((t=>!ct.has(t.id)));if(i)return Y(K(new Error("Skipping transactional, child is not found"),{additional:{url:t,id:i.id}})),void ot(null===(n=e.download_callbacks)||void 0===n?void 0:n.on_fail_actions)}r.patch.changes.forEach((t=>{const e=ct.get(t.id);e&&e.replaceWith(t.id,t.items)})),ot(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_success_actions)}}else Y(K(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var i;Y(K(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),ot(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_fail_actions)}))}else Y(K(new Error("Missing url in download action"),{additional:{url:t}}))}(n.get("url"),t);break;default:Y(K(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){Y(K(t,{additional:{url:e}}))}}async function ot(t,e){if(t&&Array.isArray(t)){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url;if(n){const t=pt(n);if(t)if(ft(t,M)){if(e)if("_blank"===i.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=n)}else location.href=n}else"div-action"===t?(nt(i),await _()):i.log_id&&(at(i),await _())}}t.forEach((t=>{t.log_id&&Q("click",t)}))}}function at(t){null==E||E(t)}const st=new Map,ct=new Map;function ut(t){if(st.has(t))return st.get(t);Y(K(new Error("Missing instance with id"),{additional:{id:t}}))}const dt=new Map;function gt(t){for(const e of t)H.has(e)&&t.delete(e);return t}g(X,{logError:Y,logStat:Q,hasTemplate:function(t){return t in N},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in N;){if(({json:t,templateContext:e}=jr(t,e,N,Y)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:et,genClass:function(t){return`divkit-${et()}`},execAction:nt,execAnyActions:ot,execCustomAction:at,isRunning:function(t){return J[t]},setRunning:function(t,e){J[t]=e},registerInstance:function(t,e){st.has(t)?Y(K(new Error("Duplicate instance id"),{additional:{id:t}})):st.set(t,e)},unregisterInstance:function(t){st.delete(t)},registerParentOf:function(t,e){ct.set(t,e)},unregisterParentOf:function(t){ct.delete(t)},addSvgFilter:function(t,e){const r=`${t}:${e}`;if(it[r]=it[r]||0,++it[r],rt[r])return rt[r];const i=`${et()}-svg-filter`;return rt=Object.assign(Object.assign({},rt),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;it[r]&&0==--it[r]&&(rt=Object.keys(rt).reduce(((t,e)=>(it[e]&&(t[e]=rt[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Sr(t);const e=vn(t,Y);return e.vars.length?L(e.vars.map((t=>H.get(t)||function(t){const e=q.get(t)||W(void 0);return q.has(t)||q.set(t,e),e}(t))).filter(lt),(()=>e.applyVars(H))):e.hasExpression?Sr(e.applyVars(H)):Sr(t)},getJsonWithVars:Z,getStore:function(t){return dt.has(t)||function(t){dt.has(t)||dt.set(t,pn[t]())}(t),dt.get(t)},getVariable:function(t,e){const r=H.get(t);if(r){const i=r.getType();if(i!==e)return void Y(K(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==b?void 0:b[t]},getBuiltinProtocols:function(){return M},getExtension:function(t,e){const r=x.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:H,logError:Y}},typefaceProvider:F,isDesktop:V,isPointerFocus:$n,registerComponent:void 0,unregisterComponent:void 0}),g(Tt,{hasAction:()=>!1});const vt={setState(t){throw new Error("Not implemented")},getChild(t){if(ht&&ht.has(t))return ht.get(t);Y(K(new Error("Missing state block with id"),{additional:{id:t}}))}};let ht=null;g(xt,{registerInstance(t,e){ht||(ht=new Map),ht.has(t)?Y(K(new Error("Duplicate state with id"),{additional:{id:t}})):ht.set(t,e)},unregisterInstance(t){null==ht||ht.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,i)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const mt=null===(s=null==p?void 0:p.card)||void 0===s?void 0:s.variables;Array.isArray(mt)&&mt.forEach((t=>{if(t&&t.type in sr&&t.name){if(U.has(t.name))return void Y(K(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&Y(K(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=lr(t.name,t.type,t.value);U.set(t.name,e),H.set(t.name,e)}catch(e){Y(K(e,{additional:{name:t.name}}))}}}));const yt=p.palette;yt&&yt[D].forEach((t=>{if(U.has(t.name))Y(K(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=lr(t.name,"color",t.color);U.set(t.name,e),H.set(t.name,e)}catch(e){Y(K(e,{additional:{name:t.name}}))}}));for(const[t,e]of B)H.has(t)||H.set(t,e);R.subscribe((t=>{if(t&&!H.has(t)){const e=B.get(t);H.set(t,e);const r=q.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const bt=null===(l=null==p?void 0:p.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(bt)&&bt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void Y(K(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const i=Rr(t.condition,{startRule:"JsonStringContents"}),n=ti(i);if(!n.length)return void Y(K(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return gt(e),e.size?new Promise((t=>{const r=R.subscribe((()=>{gt(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{L(n.map((t=>H.get(t))).filter(lt),(()=>{const t=cn(H,i);return t.warnings.forEach(Y),t.result})).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=Z(t);e.log_id&&nt(e)})),e=Boolean(i.value)):Y(K(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){Y(K(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else Y(K(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const _t=null===(c=null==p?void 0:p.card)||void 0===c?void 0:c.timers;if(_t){const t=G=new kn({logError:Y,applyVars:Z,hasVariableWithType:function(t,e){const r=H.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=H.get(t);r?r.setValue(e):Y(K(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:ot});_t.forEach((e=>t.createTimer(e)))}const wt=null===(u=null==p?void 0:p.card)||void 0===u?void 0:u.states;let kt;return wt&&!T&&(kt={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:wt.map((t=>({state_id:t.state_id.toString(),div:t.div})))}),d((()=>{En--,En||(window.removeEventListener("keydown",Cn),window.removeEventListener("pointerdown",Fn)),G&&G.destroy()})),void 0===e.id&&r.id&&void 0!==v&&r.id(v),void 0===e.json&&r.json&&void 0!==p&&r.json(p),void 0===e.platform&&r.platform&&void 0!==f&&r.platform(f),void 0===e.theme&&r.theme&&void 0!==h&&r.theme(h),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==b&&r.customization(b),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==w&&r.builtinProtocols(w),void 0===e.extensions&&r.extensions&&void 0!==x&&r.extensions(x),void 0===e.onError&&r.onError&&void 0!==k&&r.onError(k),void 0===e.onStat&&r.onStat&&void 0!==$&&r.onStat($),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==E&&r.onCustomAction(E),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==F&&r.typefaceProvider(F),void 0===e.fetchInit&&r.fetchInit&&void 0!==A&&r.fetchInit(A),void 0===e.setTheme&&r.setTheme&&void 0!==S&&r.setTheme(S),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==O&&r.getDebugVariables(O),void 0===e.execAction&&r.execAction&&void 0!==nt&&r.execAction(nt),"light"===h||"dark"===h?D=h:"system"===h?"undefined"!=typeof matchMedia?(P||(P=matchMedia("(prefers-color-scheme: dark)"),P.addListener((function(){"system"===h&&P&&(D=P.matches?"dark":"light")}))),D=P.matches?"dark":"light"):D="light":Y(K(new Error("Unsupported theme"))),D&&(yt&&yt[D].forEach((t=>{const e=H.get(t.name);e&&e.setValue(t.color)}))),o(),!T&&kt?`<div class="${j("divkit-b023c",!0)+j(n?" divkit-ee112":"",!0)+j(y?` ${y}`:"",!0)}">${I(Dr,"RootSvgFilters").$$render(t,{svgFiltersMap:rt},{},{})}\n ${I(Vr,"Unknown").$$render(t,{div:kt,templateContext:{}},{},{})}</div>`:""})),Vn=An;function Dn(t){return Vn.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,typefaceProvider:t.typefaceProvider,platform:t.platform}).html}var jn=exports;for(var Pn in e)jn[Pn]=e[Pn];e.__esModule&&Object.defineProperty(jn,"__esModule",{value:!0})})();
1
+ (()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{createGlobalVariablesController:()=>Vn,createVariable:()=>mr,render:()=>Nn}),new Set;const r="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function i(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class n{constructor(t){i(this,"_listeners","WeakMap"in r?new WeakMap:void 0),i(this,"_observer",void 0),i(this,"options",void 0),this.options=t}observe(t,e){return this._listeners.set(t,e),this._getObserver().observe(t,this.options),()=>{this._listeners.delete(t),this._observer.unobserve(t)}}_getObserver(){var t;return null!==(t=this._observer)&&void 0!==t?t:this._observer=new ResizeObserver((t=>{for(const r of t){var e;n.entries.set(r.target,r),null===(e=this._listeners.get(r.target))||void 0===e||e(r)}}))}}function o(){}function a(t){return t()}function s(t){t.forEach(a)}function l(t,...e){if(null==t){for(const t of e)t(void 0);return o}const r=t.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function c(t,e,r){return t.set(r),e}let u;function d(t){u=t}function v(){if(!u)throw new Error("Function called outside component initialization");return u}function p(t){v().$$.on_destroy.push(t)}function g(t,e){return v().$$.context.set(t,e),e}function f(t){return v().$$.context.get(t)}n.entries="WeakMap"in r?new WeakMap:void 0,new Map;const h=[],m=[];let y=[];const b=[],_=Promise.resolve();let w=!1;function $(){return w||(w=!0,_.then(C)),_}function x(t){y.push(t)}const k=new Set;let E=0;function C(){if(0!==E)return;const t=u;do{try{for(;E<h.length;){const t=h[E];E++,d(t),F(t.$$)}}catch(t){throw h.length=0,E=0,t}for(d(null),h.length=0,E=0;m.length;)m.pop()();for(let t=0;t<y.length;t+=1){const e=y[t];k.has(e)||(k.add(e),e())}y.length=0}while(h.length);for(;b.length;)b.pop()();w=!1,k.clear(),d(t)}function F(t){if(null!==t.fragment){t.update(),s(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(x)}}new Set;const A=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),V=/[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;function D(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,i=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),i&&(null==r.style?r.style=U(i):r.style=U(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),i=e.slice(0,t).trim(),n=e.slice(t+1).trim();i&&(r[i]=n)}for(const t in e){const i=e[t];i?r[t]=i:delete r[t]}return r}(r.style,i)))}let i="";return Object.keys(r).forEach((t=>{if(V.test(t))return;const e=r[t];!0===e?i+=" "+t:A.has(t.toLowerCase())?e&&(i+=" "+t):null!=e&&(i+=` ${t}="${e}"`)})),i}const j=/[&"]/g,P=/[&<]/g;function S(t,e=!1){const r=String(t),i=e?j:P;i.lastIndex=0;let n="",o=0;for(;i.test(r);){const t=i.lastIndex-1,e=r[t];n+=r.substring(o,t)+("&"===e?"&amp;":'"'===e?"&quot;":"&lt;"),o=t+1}return n+r.substring(o)}function O(t){return"string"==typeof t||t&&"object"==typeof t?S(t,!0):t}function I(t){const e={};for(const r in t)e[r]=O(t[r]);return e}function M(t,e){var r;t=void 0!==(null==(r=t)?void 0:r.length)?r:Array.from(r);let i="";for(let r=0;r<t.length;r+=1)i+=e(t[r],r);return i}const T={$$render:()=>""};function z(t,e){if(!t||!t.$$render)throw"svelte:component"===e&&(e+=" this={...}"),new Error(`<${e}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${e}>.`);return t}let N,J;function R(t){function e(e,r,i,n,o){const a=u;d({$$:{on_destroy:N,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const s=t(e,r,i,n);return d(a),s}return{render:(t={},{$$slots:r={},context:i=new Map}={})=>{N=[];const n={title:"",head:"",css:new Set},o=e(n,t,{},r,i);return s(N),{html:o,css:{code:Array.from(n.css).map((t=>t.code)).join("\n"),map:null},head:n.title+n.head}},$$render:e}}function B(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${S(e,!0)}"`}`}function U(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${O(t[e])};`)).join(" ")}function L(t){const e=U(t);return e?` style="${e}"`:""}function W(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function H(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?W(Object(r),!0).forEach((function(e){q(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function q(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t,e,r,i){var n;const o=null===(n=r[t])||void 0===n?void 0:n.type;if(e="Boolean"===o&&"boolean"!=typeof e?null!=e:e,!i||!r[t])return e;if("toAttribute"===i)switch(o){case"Object":case"Array":return null==e?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return null==e?null:e;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":default:return e;case"Number":return null!=e?+e:e}}"function"==typeof HTMLElement&&(J=class extends HTMLElement{constructor(t,e,r){super(),q(this,"$$ctor",void 0),q(this,"$$s",void 0),q(this,"$$c",void 0),q(this,"$$cn",!1),q(this,"$$d",{}),q(this,"$$r",!1),q(this,"$$p_d",{}),q(this,"$$l",{}),q(this,"$$l_u",new Map),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){const r=this.$$c.$on(t,e);this.$$l_u.set(e,r)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){const t=this.$$l_u.get(e);t&&(t(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn)return;function t(t){return()=>{let e;return{c:function(){e=function(t){return document.createElement(t)}("slot"),"default"!==t&&function(t,e,r){null==r?t.removeAttribute(e):t.getAttribute(e)!==r&&t.setAttribute(e,r)}(e,"name",t)},m:function(t,r){!function(t,e,r){t.insertBefore(e,r||null)}(t,e,r)},d:function(t){t&&function(t){t.parentNode&&t.parentNode.removeChild(t)}(e)}}}}const e={},r=function(t){const e={};return t.childNodes.forEach((t=>{e[t.slot||"default"]=!0})),e}(this);for(const n of this.$$s)n in r&&(e[n]=[t(n)]);for(const o of this.attributes){const a=this.$$g_p(o.name);a in this.$$d||(this.$$d[a]=G(a,o.value,this.$$p_d,"toProp"))}this.$$c=new this.$$ctor({target:this.shadowRoot||this,props:H(H({},this.$$d),{},{$$slots:e,$$scope:{ctx:[]}})});const i=()=>{this.$$r=!0;for(const t in this.$$p_d)if(this.$$d[t]=this.$$c.$$.ctx[this.$$c.$$.props[t]],this.$$p_d[t].reflect){const e=G(t,this.$$d[t],this.$$p_d,"toAttribute");null==e?this.removeAttribute(t):this.setAttribute(this.$$p_d[t].attribute||t,e)}this.$$r=!1};this.$$c.$$.after_update.push(i),i();for(const s in this.$$l)for(const l of this.$$l[s]){const c=this.$$c.$on(s,l);this.$$l_u.set(l,c)}this.$$l={}}}attributeChangedCallback(t,e,r){var i;this.$$r||(t=this.$$g_p(t),this.$$d[t]=G(t,r,this.$$p_d,"toProp"),null===(i=this.$$c)||void 0===i||i.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then((()=>{this.$$cn||(this.$$c.$destroy(),this.$$c=void 0)}))}$$g_p(t){return Object.keys(this.$$p_d).find((e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t))||t}});const Z=[];function Y(t,e=o){let r;const i=new Set;function n(e){if(o=e,((n=t)!=n?o==o:n!==o||n&&"object"==typeof n||"function"==typeof n)&&(t=e,r)){const e=!Z.length;for(const e of i)e[1](),Z.push(e,t);if(e){for(let t=0;t<Z.length;t+=2)Z[t][0](Z[t+1]);Z.length=0}}var n,o}function a(e){n(e(t))}return{set:n,update:a,subscribe:function(s,l=o){const c=[s,l];return i.add(c),1===i.size&&(r=e(n,a)||o),s(t),()=>{i.delete(c),0===i.size&&r&&(r(),r=null)}}}}function X(t,e,r){const i=!Array.isArray(t),n=i?[t]:t;if(!n.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const a=e.length<2;return c=(t,r)=>{let c=!1;const u=[];let d=0,v=o;const p=()=>{if(d)return;v();const n=e(i?u[0]:u,t,r);a?t(n):v="function"==typeof n?n:o},g=n.map(((t,e)=>l(t,(t=>{u[e]=t,d&=~(1<<e),c&&p()}),(()=>{d|=1<<e}))));return c=!0,p(),function(){s(g),v(),c=!1}},{subscribe:Y(r,c).subscribe};var c}const K="divkit-bd259",Q="divkit-d9099",tt="divkit-c016b",et="divkit-ee112",rt="divkit-aa145",it="divkit-f0cba",nt=Symbol("root");function ot(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const at={"text-range":"divkit-faf07",text:"divkit-d9b0e",text_halign_left:"divkit-a4cb7",text_halign_center:"divkit-e1659",text_halign_right:"divkit-ea280",text_valign_top:"divkit-d8ce0",text_valign_center:"divkit-ef58e",text_valign_bottom:"divkit-fe8ed",text_valign_baseline:"divkit-e0c6c",text__inner:"divkit-b8528",text_singleline:"divkit-ef11c",text_truncate_none:"divkit-c6ea1",text_multiline:"divkit-ee8e3",text__inner_gradient:"divkit-cb8e0",text__image:"divkit-bf6e2",text__image_hidden:"divkit-f1002"},st={outer:"divkit-d65a7","outer_hide-on-transition-in":"divkit-a6d12","outer_halign-self_start":"divkit-cc452","outer_halign-self_center":"divkit-b8331","outer_halign-self_end":"divkit-c573c","outer_halign-self_stretch":"divkit-dcc74","outer_valign-self_start":"divkit-e8077","outer_valign-self_center":"divkit-d40a7","outer_valign-self_end":"divkit-e9f84","outer_valign-self_stretch":"divkit-b7aa3","outer_parent-flex_vertical":"divkit-c143f","outer_parent-flex_horizontal":"divkit-ef302","outer_valign-self_baseline":"divkit-e72b5",outer_width_content:"divkit-b8f4d",outer_height_content:"divkit-faa66","outer_width-constrained":"divkit-d3211","outer_parent-grid":"divkit-ff439","outer_height-constrained":"divkit-a5256","outer_parent-overlap":"divkit-dab2d","outer_parent-overlap-absolute":"divkit-d43fb","outer_scroll-snap_center":"divkit-d9e38","outer_scroll-snap_start":"divkit-efd1e",outer__border:"divkit-d4056",outer_visibility_invisible:"divkit-f018b",outer_visibility_gone:"divkit-e784b","outer_has-action-animation":"divkit-f4980","outer_has-custom-focus":"divkit-c7f14"};function lt(t){if(!t)return;let e="";for(const r in t)if(t.hasOwnProperty(r)){if(!t[r]&&0!==t[r])continue;e&&(e+=";"),e+=r+":"+String(t[r])}return e||void 0}function ct(t){if("number"!=typeof t&&"string"!=typeof t||!t)return"0";const e=Number(t);return isNaN(e)?"0":Math.ceil(1e3*e)/1e4+"em"}function ut(t){let e=ct(t);return"0"===e&&(e+="em"),e}function dt(t,e){for(;t.length<e;)t="0"+t;return t}function vt(t,e=1,r="transparent"){if("#"!==(t=("string"==typeof t&&t||"").toLowerCase()).charAt(0))return r;const i=pt(t);return i?(i.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>dt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(i)):r}function pt(t){const e=t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])$/i)||t.match(/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i)||t.match(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i);if(e){if(5===e.length){const[t,r,i,n,o]=e,a=2===i.length?i:i+i,s=2===n.length?n:n+n,l=2===o.length?o:o+o,c=2===r.length?r:r+r;return{a:parseInt(c,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,i,n]=e,o=2===r.length?r:r+r,a=2===i.length?i:i+i,s=2===n.length?n:n+n;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function gt(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&amp;")),e.indexOf("<")>-1&&(e=e.replace(/</g,"&lt;")),e.indexOf(">")>-1&&(e=e.replace(/>/g,"&gt;")),e.indexOf('"')>-1&&(e=e.replace(/"/g,"&quot;")),e}const ft=Boolean;function ht(t){if(1===t.length&&"solid"===t[0].type)return{color:vt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=vt(t.bg.color||"transparent");return{size:void 0,pos:void 0,image:`linear-gradient(to bottom,${e},${e})`}}({bg:t}):"gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(ft);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>vt(t))).join(",")+")"}:void 0}({bg:t}):"image"===t.type?function(t){var e;const r=null===(e=t.bg)||void 0===e?void 0:e.image_url;if(r)return{size:bt(t.bg.scale),pos:_t(t.bg),image:'url("'+gt(r)+'")'}}({bg:t}):"radial_gradient"===t.type?function(t){var e;if(!Array.isArray(null===(e=t.bg)||void 0===e?void 0:e.colors))return;const r=t.bg.colors.filter(ft);if(!r.length)return;const i=t.bg.radius;let n;i&&"object"==typeof i&&"type"in i&&void 0!==i.value&&("fixed"===i.type?n=ut(i.value):"relative"===i.type&&(n=mt[i.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${n||"farthest-corner"} at ${yt(t.bg.center_x)} ${yt(t.bg.center_y)},`+r.map((t=>vt(t))).join(",")+")"}}({bg:t}):void 0)).filter(ft).reverse().reduce((function(t,e){return t.image.push(e.image),t.size.push(e.size||"auto"),t.position.push(e.pos||"50% 50%"),t}),{image:[],size:[],position:[]});return{image:e.image.join(","),size:e.size.join(","),position:e.position.join(",")}}const mt={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function yt(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return ut(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function bt(t){return"fit"===t?"contain":"stretch"===t?"fill":"no_scale"===t?"none":"cover"}function _t(t){let e,r;return e="left"===t.content_alignment_horizontal?"0%":"right"===t.content_alignment_horizontal?"100%":"50%",r="top"===t.content_alignment_vertical?"0%":"bottom"===t.content_alignment_vertical?"100%":"50%",e+" "+r}function wt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}function $t(t,e){return e.has(t)}function xt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function kt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?xt(Object(r),!0).forEach((function(e){Et(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Et(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ct(t,e,r){return"number"==typeof e&&(t&&e>0&&e<=100||!t&&e>=0&&e<100)?e:r}function Ft(t,e){e&&t.push(e)}function At(t,e,r){const i=[];Ft(i,e[t]);for(const n in r)if(r.hasOwnProperty(n)){const o=r[n];o&&Ft(i,e[`${t}_${n}`+("string"==typeof o?`_${o}`:"")])}return i.join(" ")}const Vt=Symbol("state");function Dt(t){return ct(t.top||0)+" "+ct(t.right||0)+" "+ct(t.bottom||0)+" "+ct(t.left||0)}function jt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function Pt(t){return jt(t)&&t>=0}function St(t,e){if(!t)return e;const r=[t.top,t.right,t.bottom,t.left];for(let t=0;t<r.length;++t)if(r[t]&&!Pt(r[t]))return e;return Dt(t)}function Ot(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const It=Object.prototype.hasOwnProperty;function Mt(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return Object.is(t,e);const r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(let i=0;i<r.length;i++){const n=r[i];if(!It.call(e,n)||!Mt(t[n],e[n]))return!1}return!0}function Tt(t,e){return Mt(t,e)?e:t}function zt(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:e}function Nt(t,e){const r=Number(t);return isNaN(r)?e:r}function Jt(t){const e=[];return"set"===t.name?(t.items||[]).forEach((t=>{e.push(...Jt(t))})):e.push(t),e}function Rt(t,e){if(!t||"object"!=typeof t)return e;const r=["top","right","bottom","left"];for(let i=0;i<r.length;++i)if(t[r[i]]&&!Pt(t[r[i]]))return e;return t}function Bt(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>ct((t||e)/r*10))).join(" ")}function Ut(){}const Lt=Symbol("action"),Wt=R(((t,e,r,i)=>{let{actions:n}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:c}=e,{use:u=Ut}=e,{customAction:d=null}=e,{isNativeActionAnimation:v=!0}=e;const p=f(nt),h=f(Lt);let m;g(Lt,{hasAction:()=>Boolean(h.hasAction()||(null==n?void 0:n.length))});let y,b="",_=!1;if(void 0===e.actions&&r.actions&&void 0!==n&&r.actions(n),void 0===e.doubleTapActions&&r.doubleTapActions&&void 0!==o&&r.doubleTapActions(o),void 0===e.longTapActions&&r.longTapActions&&void 0!==a&&r.longTapActions(a),void 0===e.cls&&r.cls&&void 0!==s&&r.cls(s),void 0===e.style&&r.style&&void 0!==l&&r.style(l),void 0===e.attrs&&r.attrs&&void 0!==c&&r.attrs(c),void 0===e.use&&r.use&&void 0!==u&&r.use(u),void 0===e.customAction&&r.customAction&&void 0!==d&&r.customAction(d),void 0===e.isNativeActionAnimation&&r.isNativeActionAnimation&&void 0!==v&&r.isNativeActionAnimation(v),Array.isArray(n)&&(null==n?void 0:n.length))for(let t=0;t<n.length;++t){const e=n[t].url;if(e){b=e,y=n[t].target||void 0;break}}return Array.isArray(n)&&(null==n?void 0:n.length)&&h.hasAction()&&(b="",p.logError(ot(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:n}}))),_=Boolean(d),b&&!$t(wt(b),p.getBuiltinProtocols())?(b="",_=!0):!b&&Array.isArray(n)&&(null==n?void 0:n.length)&&(_=!0,p.logError(ot(new Error("The component has a list of actions, but does not have a real action"),{level:"warn",additional:{actions:n}}))),b?`<a${D([{href:O(b)},{target:O(y)},{style:O(l)},{class:S(s,!0)+" "+S(v?K:Q,!0)+" "+S(null!=a&&a.length?it:"",!0)},I(c)],{})}${B("this",m,0)}>${i.default?i.default({}):""}</a>`:` <span${D([{class:S(s,!0)+S(_?` ${v?K:Q} ${tt}`:"",!0)+" "+S(null!=a&&a.length?it:"",!0)},{style:O(l)},{role:O(_?"button":null)},{tabindex:O(_?0:null)},I(c)],{})}${B("this",m,0)}>${i.default?i.default({}):""}</span>`})),Ht=Wt,qt="divkit-b921d";function Gt(t){return jt(t)&&t>0}function Zt(t,e){return t.map((t=>{if("blur"===(null==t?void 0:t.type)){if(Gt(t.radius))return`blur(${ut(t.radius/2)})`}else e(ot(new Error("Unknown filter"),{level:"warn",additional:{filter:null==t?void 0:t.type}}))})).filter(Boolean).join(" ")}const Yt=R(((t,e,r,i)=>{let n,{background:o=[]}=e,{radius:a=""}=e;const s=f(nt);return void 0===e.background&&r.background&&void 0!==o&&r.background(o),void 0===e.radius&&r.radius&&void 0!==a&&r.radius(a),n=o.map((t=>{const e={},r={style:e};if("nine_patch_image"===t.type&&t.insets)e["border-image"]=`url("${t.image_url}") ${t.insets.top||0} ${t.insets.right||0} ${t.insets.bottom||0} ${t.insets.left||0} fill`,e["border-image-width"]="auto";else{const i=ht([t]);"solid"===t.type&&(e["background-color"]=i.color),"gradient"===t.type&&(e["background-image"]=i.image),"image"===t.type&&(e.opacity=Number(t.alpha),r.image_url=t.image_url,e["object-fit"]=i.size,e["object-position"]=i.position,Array.isArray(t.filters)&&t.filters.length&&(e.filter=Zt(t.filters,s.logError)))}return r})),`<span${B("class","divkit-bf253"+(a?" divkit-dcad7":""),0)}${L({"border-radius":a})}>${M(n,(t=>t.image_url?`<img${B("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${B("class",qt,0)}${B("style",lt(t.style),0)}>`:`<span${B("class",qt,0)}${B("style",lt(t.style),0)}></span>`))}</span>`})),Xt=Yt,Kt=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,g,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,S,O,I,M,T,N,J,R,U,L,W,H,q,G,Z,Y,X,K,Q,tt,et,rt=o,it=o,at=o,dt=o,pt=o,gt=o,mt=o,yt=o,bt=o,_t=o,xt=o,Et=o,Ft=o,jt=o,It=o,Mt=o,Ut=o,Lt=o,Wt=o;var qt,Gt,Zt,Yt,Kt,Qt;let{json:te={}}=e,{origJson:ee}=e,{templateContext:re}=e,{cls:ie=""}=e,{style:ne}=e,{layoutParams:oe={}}=e,{customDescription:ae=!1}=e,{customPaddings:se=!1}=e,{customActions:le=""}=e,{additionalPaddings:ce=null}=e,{heightByAspect:ue=!1}=e,{parentOf:de}=e,{replaceItems:ve}=e;const pe={left:"start",center:"center",right:"end"},ge={top:"start",center:"center",bottom:"end",baseline:"baseline"},fe=f(nt),he=f(Vt);let me,ye,be=null,_e=[];function we(t,e){if(!Array.isArray(de)||!ve)return;const r=de.findIndex((e=>(null==e?void 0:e.id)===t)),i=de.slice();i.splice(r,1,...e||[]),de=i,ve(i)}let $e,xe,ke,Ee,Ce,Fe,Ae,Ve,De,je,Pe={},Se={},Oe=!1,Ie=1,Me="transparent",Te=0,ze={"top-left":0,"top-right":0,"bottom-right":0,"bottom-left":0},Ne="",Je=null,Re="",Be={},Ue=0,Le=0,We=0,He=!1,qe=!1,Ge={},Ze=0,Ye=0,Xe=0,Ke=!1,Qe=!1,tr=1;const er=oe.fakeElement?[]:te.transition_triggers||["state_change","visibility_change"],rr=-1!==er.indexOf("state_change")&&te.id,ir=-1!==er.indexOf("visibility_change")&&te.id;let nr,or,ar,sr,lr,cr,ur,dr,vr,pr,gr=[],fr=[],hr=[],mr=[],yr=[],br=[],_r="",wr=!1,$r="visible",xr=0,kr=0;function Er(){te.focus&&(I||(pr=!0),fe.execAnyActions(mr))}function Cr(){te.focus&&(pr=!1,fe.execAnyActions(yr))}p((()=>{var t;_e.forEach((t=>{fe.unregisterParentOf(t)})),_e=[],null===(t=te.tooltips)||void 0===t||t.forEach((t=>{fe.unregisterTooltip(t)}))})),void 0===e.json&&r.json&&void 0!==te&&r.json(te),void 0===e.origJson&&r.origJson&&void 0!==ee&&r.origJson(ee),void 0===e.templateContext&&r.templateContext&&void 0!==re&&r.templateContext(re),void 0===e.cls&&r.cls&&void 0!==ie&&r.cls(ie),void 0===e.style&&r.style&&void 0!==ne&&r.style(ne),void 0===e.layoutParams&&r.layoutParams&&void 0!==oe&&r.layoutParams(oe),void 0===e.customDescription&&r.customDescription&&void 0!==ae&&r.customDescription(ae),void 0===e.customPaddings&&r.customPaddings&&void 0!==se&&r.customPaddings(se),void 0===e.customActions&&r.customActions&&void 0!==le&&r.customActions(le),void 0===e.additionalPaddings&&r.additionalPaddings&&void 0!==ce&&r.additionalPaddings(ce),void 0===e.heightByAspect&&r.heightByAspect&&void 0!==ue&&r.heightByAspect(ue),void 0===e.parentOf&&r.parentOf&&void 0!==de&&r.parentOf(de),void 0===e.replaceItems&&r.replaceItems&&void 0!==ve&&r.replaceItems(ve),_e.forEach((t=>{fe.unregisterParentOf(t)})),_e=[],de&&de.forEach((t=>{t.id&&(_e.push(t.id),fe.registerParentOf(t.id,{replaceWith:we}))})),n=fe.getDerivedFromVars(te.focus),pt(),pt=l(n,(t=>J=t)),a=fe.getDerivedFromVars(te.border),Wt(),Wt=l(a,(t=>et=t));{const t=pr&&(null==J?void 0:J.border)?J.border:et;let e={},r={},i=!1,n="";if(t){if(t.has_shadow){const r=t.shadow;e["box-shadow"]=r?ct((null===(Gt=null===(qt=r.offset)||void 0===qt?void 0:qt.x)||void 0===Gt?void 0:Gt.value)||0)+" "+ct((null===(Yt=null===(Zt=r.offset)||void 0===Zt?void 0:Zt.y)||void 0===Yt?void 0:Yt.value)||0)+" "+ct(null!==(Kt=r.blur)&&void 0!==Kt?Kt:2)+" "+vt(r.color||"#000000",null!==(Qt=r.alpha)&&void 0!==Qt?Qt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}if(t.stroke&&(i=!0,Ie=Ot(t.stroke.width,Ie),Me=vt(t.stroke.color,1,Me),r.border=`${ct(Ie)} solid ${Me}`),t.corners_radius?(ze=function(t,e){const r=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<r.length;++t)if(r[t]&&!Pt(r[t]))return e;return t}(t.corners_radius,ze),r["border-radius"]=e["border-radius"]=Bt(ze)):t.corner_radius&&(Te=Ot(t.corner_radius,Te),ze={"top-left":Te,"top-right":Te,"bottom-right":Te,"bottom-left":Te},r["border-radius"]=e["border-radius"]=ct(Te)),i&&Ie&&(t.corners_radius||t.corner_radius)){let t=Object.assign({},ze);["top-left","top-right","bottom-right","bottom-left"].forEach((e=>{t[e]=(t[e]||0)+Ie/2})),n=Bt(t)}}Pe=Tt(e,Pe),Se=Tt(r,Se),Oe=i,Ne=n}s=fe.getDerivedFromVars(te.paddings),Lt(),Lt=l(s,(t=>tt=t)),Je=Rt(tt&&!se?tt:void 0,Je),c=Dt(function(t,e){if(!t&&!e)return{};if(!e)return t;if(!t)return e;const r={};return["top","right","bottom","left"].forEach((i=>{const n=t[i];n&&(r[i]=n);const o=e[i];o&&(r[i]=(r[i]||0)+o)})),r}(Je,ce)),u=fe.getDerivedFromVars(te.margins),Mt(),Mt=l(u,(t=>K=t)),Re=St(K,Re),d=fe.getDerivedFromVars(te.width),jt(),jt=l(d,(t=>Y=t)),v=fe.getDerivedFromVars(te.alignment_horizontal),Ut(),Ut=l(v,(t=>Q=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Y?void 0:Y.type;if("fixed"===c)Ue=Ot(null==Y?void 0:Y.value,Ue),e=ct(Ue);else if("wrap_content"!==c&&(oe.overlapParent||"match_parent"!==c&&c||!oe.parentHorizontalWrapContent))t="parent","vertical"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,fe.logError(ot(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===oe.parentLayoutOrientation?e=`calc(100% - ${ut(((null==K?void 0:K.left)||0)+((null==K?void 0:K.right)||0))})`:"horizontal"===oe.parentContainerOrientation&&(o=Y&&"weight"in Y&&Y.weight||1,oe.parentContainerWrap&&(s=!0));else{if(t="content",("wrap_content"===c&&(null==Y?void 0:Y.constrained)||("match_parent"===c||!c)&&oe.parentHorizontalWrapContent)&&(n["width-constrained"]=!0,"horizontal"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Y;t.min_size&&Pt(t.min_size.value)&&(r=ct(t.min_size.value)),t.max_size&&Pt(t.max_size.value)&&(i=ct(t.max_size.value))}"match_parent"!==c&&c||fe.logError(ot(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}if("parent"===t)n["halign-self"]="stretch";else{const t=Q;n["halign-self"]="left"===t||"center"===t||"right"===t?pe[t]:oe.parentHAlign||"start"}t&&(n.width=t),$e=e,xe=r,ke=i,Le=o,We=a,Be=Tt(n,Be),He=s,qe=l}g=fe.getDerivedFromVars(te.height),Ft(),Ft=l(g,(t=>Z=t)),h=fe.getDerivedFromVars(te.alignment_vertical),It(),It=l(h,(t=>X=t));{let t,e,r,i,n={},o=0,a=0,s=!1,l=!1;const c=null==Z?void 0:Z.type;if(ue);else if("fixed"===c)Ze=Ot(null==Z?void 0:Z.value,Ze),e=ct(Ze);else if("match_parent"!==c||!oe.overlapParent&&oe.parentVerticalWrapContent){if(t="content",("wrap_content"===c&&(null==Z?void 0:Z.constrained)||"match_parent"===c&&oe.parentVerticalWrapContent)&&(n["height-constrained"]=!0,"vertical"===oe.parentContainerOrientation&&(a=1)),"wrap_content"===c){const t=Z;(null==t?void 0:t.min_size)&&Pt(t.min_size.value)&&(r=ct(t.min_size.value)),(null==t?void 0:t.max_size)&&Pt(t.max_size.value)&&(i=ct(t.max_size.value))}"match_parent"===c&&fe.logError(ot(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))}else t="parent","horizontal"===oe.parentContainerOrientation&&oe.parentContainerWrap&&(l=!0,fe.logError(ot(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===oe.parentLayoutOrientation?e=`calc(100% - ${ut(((null==K?void 0:K.top)||0)+((null==K?void 0:K.bottom)||0))})`:"vertical"===oe.parentContainerOrientation&&(o=(null==Z?void 0:Z.weight)||1,oe.parentContainerWrap&&(s=!0));if("parent"===t)n["valign-self"]="stretch";else{const t=X;"top"===t||"center"===t||"bottom"===t||"baseline"===t&&"horizontal"===oe.parentContainerOrientation?n["valign-self"]=ge[t]:n["valign-self"]=oe.parentVAlign||"start"}t&&(n.height=t),Ee=e,Ce=r,Fe=i,Ye=o,Xe=a,Ge=Tt(n,Ge),Ke=s,Qe=l}var Fr,Ar,Vr;if(m=!!oe.overlapParent||void 0,y=oe.overlapParent&&(!Y||"match_parent"===Y.type)&&"match_parent"===(null==Z?void 0:Z.type),b=oe.gridArea?`${oe.gridArea.y+1}/${oe.gridArea.x+1}/span ${oe.gridArea.rowSpan}/span ${oe.gridArea.colSpan}`:void 0,_=fe.getDerivedFromVars(te.alpha),Et(),Et=l(_,(t=>G=t)),Ar=tr,tr=!Pt(Fr=G)||void 0===Fr||Fr>1?Ar:Number(Fr),Ae=1===tr?void 0:tr,w=fe.getDerivedFromVars(te.accessibility),xt(),xt=l(w,(t=>q=t)),ye=void 0,q&&!ae&&q.description&&(ye={},ye["aria-label"]=q.description),x=fe.getDerivedFromVars(te.background),_t(),_t=l(x,(t=>H=t)),Ve=pr&&(null==J?void 0:J.background)?J.background:H,De={},je=!1,Array.isArray(Ve)&&(je=Ve.some((t=>"image"===t.type||"nine_patch_image"===t.type))||Boolean(Ne),!je)){const t=ht(Ve);De["background-color"]=t.color,De["background-image"]=t.image,De["background-size"]=t.size,De["background-position"]=t.position,De["background-repeat"]="no-repeat"}nr=void 0,rr&&te.transition_in&&fe.isRunning("stateChange")&&(nr=!0),ar=void 0,rr&&te.transition_change&&fe.isRunning("stateChange")&&he.hasTransitionChange(te.id)&&(ar=!0),k=fe.getDerivedFromVars(te.action),yt(),yt=l(k,(t=>L=t)),E=fe.getDerivedFromVars(te.actions),bt(),bt=l(E,(t=>W=t)),C=fe.getDerivedFromVars(te.doubletap_actions),mt(),mt=l(C,(t=>U=t)),F=fe.getDerivedFromVars(te.longtap_actions),gt(),gt=l(F,(t=>R=t));{let t=W||L&&[L]||[],e=U||[],r=R||[],i=(null==J?void 0:J.on_focus)||[],n=(null==J?void 0:J.on_blur)||[];oe.fakeElement?(t=[],e=[],r=[],i=[],n=[]):(Array.isArray(t)||(t=[],fe.logError(ot(new Error("Actions should be array")))),Array.isArray(e)||(e=[],fe.logError(ot(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],fe.logError(ot(new Error("LongTapActions should be array")))),Array.isArray(i)||(i=[],fe.logError(ot(new Error("FocusActions should be array")))),Array.isArray(n)||(n=[],fe.logError(ot(new Error("BlurActions should be array"))))),(t.length||e.length||r.length)&&le&&(t=[],e=[],r=[],fe.logError(ot(new Error(`Cannot use action on component "${le}"`)))),gr=t,fr=e,hr=r,mr=i,yr=n}A=fe.getDerivedFromVars(te.action_animation),dt(),dt=l(A,(t=>N=t)),N&&(br=Jt(N),_r=br.map((function(t){const e=Nt(t.start_value,1),r=Nt(t.end_value,1),i=Ot(t.start_delay,0),n=Ot(t.duration,300),o=zt(t.interpolator,"ease_in_out").replace(/_/g,"-");switch(t.name){case"fade":return sr=e,lr=r,`opacity ${n}ms ${o} ${i}ms`;case"scale":return cr=e,ur=r,`transform ${n}ms ${o} ${i}ms`;case"native":case"no_animation":return"";default:return fe.logError(ot(new Error("Unknown action_animation name"),{additional:{animation:t.name}})),""}})).filter(Boolean).join(", ")),V=fe.getDerivedFromVars(te.visibility),at(),at=l(V,(t=>T=t));{const t=$r,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(T,$r);t!==e&&(!wr||"visible"!==$r&&"visible"!==e?$r=e:async function(t){$r=t;const e="visible"===t?"in":"out",r="in"===e?te.transition_in:te.transition_out;ir&&r&&(await $(),"in"===e&&(or=!0),he.runVisibilityTransition(Object.assign(Object.assign({},te),{visibility:"visible"}),re,r,me,e).then((()=>{"in"===e&&(or=!1)})).catch((t=>{throw"in"===e&&(or=!1),t})))}(e)),wr||(wr=!0)}if(D=Object.assign(Object.assign(Object.assign({},Be),Ge),{"parent-overlap":m,"parent-overlap-absolute":y,"scroll-snap":oe.scrollSnap,"hide-on-transition-in":nr||or||ar,visibility:$r,"has-action-animation":Boolean(_r),"parent-flex":oe.parentContainerOrientation||void 0,"parent-grid":Boolean(oe.gridArea)||void 0,"has-custom-focus":Boolean(pr&&te.focus)}),j=fe.getDerivedFromVars(te.transform),it(),it=l(j,(t=>M=t)),M&&void 0!==M.rotation){const t=M.pivot_x||{type:"pivot-percentage",value:50};xr=Nt(t.value,xr);const e="pivot-fixed"===t.type?ct(xr):`${xr}%`,r=M.pivot_y||{type:"pivot-percentage",value:50};kr=Nt(r.value,kr),dr=`${e} ${"pivot-fixed"===r.type?ct(kr):`${kr}%`}`,vr=`rotate(${M.rotation}deg)`}return P=He||Ke?"100%":Le||Ye?0:void 0,S=Object.assign(Object.assign(Object.assign(Object.assign({},ne),De),Pe),{width:$e,"min-width":xe,"max-width":ke,height:Ee,"min-height":Ce,"max-height":Fe||(null==ne?void 0:ne["max-height"]),"grid-area":b,padding:c,margin:Re,opacity:Ae,transition:_r,"transform-origin":dr,transform:vr,"flex-grow":Le||Ye||void 0,"flex-shrink":We||Xe?1:void 0,"flex-basis":P,"--divkit-animation-opacity-start":sr,"--divkit-animation-opacity-end":lr,"--divkit-animation-scale-start":cr,"--divkit-animation-scale-end":ur}),O=fe.isPointerFocus,rt(),rt=l(O,(t=>I=t)),rt(),it(),at(),dt(),pt(),gt(),mt(),yt(),bt(),_t(),xt(),Et(),Ft(),jt(),It(),Mt(),Ut(),Lt(),Wt(),qe||Qe?"":`${z(Ht,"Actionable").$$render(t,{use:function(t){var e;me=t,rr&&te.transition_in&&he.registerChildWithTransitionIn(te,re,te.transition_in,t).then((()=>{nr=!1})).catch((t=>{throw nr=!1,t})),rr&&te.transition_out&&he.registerChildWithTransitionOut(te,re,te.transition_out,t),rr&&te.transition_change&&he.registerChildWithTransitionChange(te,re,te.transition_change,t).then((()=>{ar=!1})).catch((t=>{throw ar=!1,t}));const r=oe.fakeElement?[]:te.visibility_actions||te.visibility_action&&[te.visibility_action],i=oe.fakeElement?[]:te.disappear_actions;(Array.isArray(r)&&r.length||Array.isArray(i)&&i.length)&&function(t,{visibilityActions:e,disappearActions:r,rootCtx:i}){const n=[];e&&e.forEach((t=>{n.push({type:"visibility",index:n.length,action:t,visible:!1,count:0,finished:!1})})),r&&r.forEach((t=>{n.push({type:"disappear",index:n.length,action:t,visible:!1,count:0,finished:!1})}));const o=n.map((t=>{const e="visibility"===t.type,r=i.getJsonWithVars({visibility_percentage:t.action.visibility_percentage,visibility_duration:e?t.action.visibility_duration:t.action.disappear_duration,log_limit:t.action.log_limit});return kt(kt({},r),{},{visibility_percentage:Ct(e,r.visibility_percentage,e?50:0)})})),a=[...new Set(o.map((t=>t.visibility_percentage/100)))];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const r=o[e.index],n="visibility"===e.type;let a;a=0===r.visibility_percentage?t.intersectionRatio>=1e-12:t.intersectionRatio>=r.visibility_percentage/100;const s=n?!e.visible&&a:e.visible&&!a,l=n?!a:a;s?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===r.log_limit?1/0:r.log_limit||1;++e.count>=t&&(e.finished=!0);const o=i.getJsonWithVars(e.action),a=o.url;if(a){const t=wt(a);t&&!$t(t,i.getBuiltinProtocols())&&("div-action"===t?i.execAction(o):o.log_id&&i.execCustomAction(o))}i.logStat(n?"visible":"disappear",o)}),o[e.index].visibility_duration||800)):l&&e.timer&&clearTimeout(e.timer),e.visible=a}))}))}),{threshold:a}).observe(t)}(t,{visibilityActions:r,disappearActions:i,rootCtx:fe});const n=te.id;n&&he.registerChild(n),null===(e=te.tooltips)||void 0===e||e.forEach((e=>{fe.registerTooltip(t,e)}));let o=null;if(Array.isArray(te.extensions)){const e=fe.getExtensionContext();be=te.extensions.map((r=>{var i;const n=fe.getExtension(r.id,r.params);return n&&(null===(i=n.mountView)||void 0===i||i.call(n,t,e)),n})).filter(ft)}return{destroy(){if(n&&he.unregisterChild(n),be){const e=fe.getExtensionContext();be.forEach((r=>{var i;null===(i=r.unmountView)||void 0===i||i.call(r,t,e)})),be=null}o&&o.destroy()}}},cls:ie+" "+At("outer",st,D),style:lt(S),actions:gr,doubleTapActions:fr,longTapActions:hr,attrs:ye,isNativeActionAnimation:!br.length||(Vr=br,Vr.some((t=>"native"===t.name)))},{},{default:()=>` ${je?`${z(Xt,"OuterBackground").$$render(t,{background:Ve,radius:Ne},{},{})}`:""}${i.default?i.default({focusHandler:Er,blurHandler:Cr,hasCustomFocus:pr}):""}${Oe?`<span${B("class",st.outer__border,0)}${B("style",lt(Se),0)}></span>`:""}`})}`})),Qt=Kt,te={"text-range":"divkit-faf07","text-range_singleline":"divkit-ccb64","text-range__top-offset":"divkit-d9237","text-range_decoration_both":"divkit-d7e07","text-range_decoration_underline":"divkit-f3dde","text-range_decoration_strike":"divkit-d27b7","text-range_decoration_none":"divkit-c6b0f"};function ee(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function re(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function ie(t,e){return re(t)||e}const ne=R(((t,e,r,i)=>{let n,o,a,s,l;var c,u;let{text:d}=e,{rootFontSize:v}=e,{textStyles:p={}}=e,{singleline:g=!1}=e,{actions:h}=e;const m=f(nt);let y,b="none",_=12,w=1.25,$="",x="",k="",E=null;void 0===e.text&&r.text&&void 0!==d&&r.text(d),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==v&&r.rootFontSize(v),void 0===e.textStyles&&r.textStyles&&void 0!==p&&r.textStyles(p),void 0===e.singleline&&r.singleline&&void 0!==g&&r.singleline(g),void 0===e.actions&&r.actions&&void 0!==h&&r.actions(h);{let t="none";(p.underline||p.strike)&&("single"===p.underline&&"single"===p.strike?t="both":"single"===p.underline?t="underline":"single"===p.strike&&(t="strike")),b=t}return _=ee(p.font_size,_),Gt(p.line_height)&&(w=Number(p.line_height)/_),Pt(p.letter_spacing)&&($=ct(p.letter_spacing)),y=ie(p.font_weight,y),x="string"==typeof p.font_family&&p.font_family?m.typefaceProvider(p.font_family,{fontWeight:y||400}):"",k=vt(p.text_color,1,k),n=p.top_offset?ct(p.top_offset):"",o=p.background?ht([p.background]):null,E=(null===(c=p.border)||void 0===c?void 0:c.stroke)&&"transparent"!==vt(p.border.stroke.color)&&Gt(p.border.stroke.width)?{color:p.border.stroke.color,width:p.border.stroke.width}:null,a=ee(null===(u=p.border)||void 0===u?void 0:u.corner_radius,0),s={singleline:g,decoration:b},l={"font-size":ct(10*_/v),"line-height":w,"letter-spacing":$,"font-weight":y,"font-family":x,color:k,background:(null==o?void 0:o.color)||void 0,"box-shadow":E?`inset 0 0 0 ${ct(E.width)} ${E.color}`:void 0,"border-radius":a?ct(a):void 0},`${n?`<span${B("class",te["text-range__top-offset"],0)}${L({"margin-top":n})}></span>`:""}${z(Ht,"Actionable").$$render(t,{cls:At("text-range",te,s),actions:h,style:lt(l)},{},{default:()=>`${S(d)}`})}`})),oe=ne;function ae(t,e){return"left"===t||"center"===t||"right"===t?t:e}function se(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t?t:e}function le(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}function ce(t,e){return"source_in"===t||"source_atop"===t||"darken"===t||"lighten"===t||"multiply"===t||"screen"===t?t:e}const ue=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,g,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,I,T,N,J,R,U,L,W,H=o,q=o,G=o,Z=o,Y=o,X=o,K=o,Q=o,et=o,rt=o,it=o,st=o,ut=o,dt=o,{json:pt={}}=e,{templateContext:gt}=e,{origJson:ft}=e,{layoutParams:mt}=e;const yt=f(nt);let bt=!1,_t="",wt=12,$t=1.25,xt=!1,kt="",Et="",Ct=!1,Ft="left",Vt="top",Dt="",jt="",Pt="",St=!1,Ot=[],It=[];var Mt,Tt;p((()=>{It.forEach((([t,e])=>{yt.removeSvgFilter(t,e)}))})),void 0===e.json&&r.json&&void 0!==pt&&r.json(pt),void 0===e.templateContext&&r.templateContext&&void 0!==gt&&r.templateContext(gt),void 0===e.origJson&&r.origJson&&void 0!==ft&&r.origJson(ft),void 0===e.layoutParams&&r.layoutParams&&void 0!==mt&&r.layoutParams(mt),n=yt.getDerivedFromVars(pt.text),dt(),dt=l(n,(t=>W=t)),Mt=W,Tt=_t,_t=String(null!=Mt?Mt:"")||Tt,_t?bt=!1:(bt=!0,yt.logError(ot(new Error('Missing "text" prop for div "text"')))),a=yt.getDerivedFromVars(pt.ranges),q(),q=l(a,(t=>D=t)),s=yt.getDerivedFromVars(pt.images),H(),H=l(s,(t=>V=t)),c=yt.getDerivedFromVars({font_size:pt.font_size,letter_spacing:pt.letter_spacing,font_weight:pt.font_weight,font_family:pt.font_family,text_color:pt.text_color,underline:pt.underline,strike:pt.strike,line_height:pt.line_height}),G(),G=l(c,(t=>j=t)),u=yt.getDerivedFromVars(pt.font_size),ut(),ut=l(u,(t=>L=t)),wt=ee(L,wt),d=yt.getDerivedFromVars(pt.line_height),st(),st=l(d,(t=>U=t));{const t=U;Gt(t)?($t=Number(t)/wt,xt=!0):xt=!1}v=yt.getDerivedFromVars(pt.max_lines),et(),et=l(v,(t=>N=t)),g=1===N;{let t="",e="",r=!1;if(N&&N>1){let i=Number(N);t=i*$t+"em",D||V||(e=i,r=!0)}kt=t,Et=e,Ct=r}h=yt.getDerivedFromVars(pt.text_alignment_horizontal),it(),it=l(h,(t=>R=t)),Ft=ae(R,Ft),m=yt.getDerivedFromVars(pt.text_alignment_vertical),rt(),rt=l(m,(t=>J=t)),Vt=se(J,Vt),y=!D||_t&&1===D.length&&D[0]&&0===D[0].start&&"number"==typeof D[0].end&&D[0].end>=_t.length,b=yt.getDerivedFromVars(pt.text_color),Q(),Q=l(b,(t=>T=t)),_=Boolean(T)!==Boolean(D&&D[0]&&D[0].text_color);{let t="";N&&y&&_&&(t=vt(T||D&&D[0]&&D[0].text_color,1,Dt)),Dt=t}w=yt.getDerivedFromVars(pt.focused_text_color),K(),K=l(w,(t=>I=t)),jt=vt(I,1,jt),$=yt.getDerivedFromVars(pt.truncate),X(),X=l($,(t=>O=t)),x="none"===O?"none":"",k=yt.getDerivedFromVars(pt.text_gradient),Y(),Y=l(k,(t=>S=t));{let t="";if(S){const e=ht([S]);e.image&&(t=e.image)}Pt=t}return E=yt.getDerivedFromVars(pt.selectable),Z(),Z=l(E,(t=>P=t)),St=le(P,St),function(t,e,r){let i=[];if(It.forEach((([t,e])=>{yt.removeSvgFilter(t,e)})),It=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Ot=[]);const n=t;let o=e||[{start:0,end:n.length}],a=r||[],s=0,l=[],c=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(c.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),c.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=n.length&&c.push({index:t.start,image:t,type:"image",arrayIndex:e})})),c.sort(((t,e)=>t.index===e.index?t.type!==e.type?"image"===t.type?-1:"image"===e.type?1:t.type<e.type?-1:1:"image"===t.type&&"image"===e.type?e.arrayIndex-t.arrayIndex:"rangeStart"===t.type&&"rangeStart"===e.type?t.range.end-e.range.end:"rangeStart"===t.type?1:"rangeStart"===e.type?-1:"image"!==t.type&&"image"!==e.type?t.range.start-e.range.start:0:t.index-e.index)),c.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},j),...l);i.push({text:n.substring(s,o),textStyles:r,actions:"rangeEnd"===t.type&&(null===(e=t.range)||void 0===e?void 0:e.actions)||void 0})}if("rangeStart"===t.type&&r)l.push(r);else if("rangeEnd"===t.type)l=l.filter((e=>e!==t.range));else if("image"===t.type){let e=Object.assign(Object.assign({},j),...l),r=ct(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),n=ct(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":ct(10*(Number(e.font_size)||12)/wt)};let a="";const s=t.image.tint_color,c=ce(t.image.tint_mode,"source_in");if(s){const e=vt(t.image.tint_color);a=yt.addSvgFilter(e,c),It.push([e,c])}i.push({image:{url:t.image.url,width:r,height:n,wrapperStyle:o,svgFilterId:a}})}s=o})),s<n.length&&i.push({text:n.substring(s),textStyles:Object.assign({},j)}),Ot=i}(_t,D,V),C={singleline:g,multiline:Ct,halign:Ft,valign:Vt,truncate:x},F={gradient:Boolean(Pt)},A={"font-size":ct(wt),"line-height":$t,"max-height":kt,"-webkit-line-clamp":Et,color:Dt,"background-image":Pt,"--divkit-text-focus-color":jt},H(),q(),G(),Z(),Y(),X(),K(),Q(),et(),rt(),it(),st(),ut(),dt(),bt?"":`${z(Qt,"Outer").$$render(t,{cls:At("text",at,C)+" "+(St?"":tt),json:pt,origJson:ft,templateContext:gt,layoutParams:mt},{},{default:()=>`<span${B("class",At("text__inner",at,F),0)}${B("style",lt(A),0)}>${Ot.length?`${M(Ot,((e,r)=>"text"in e?e.text?`${z(oe,"TextRangeView").$$render(t,{text:e.text,rootFontSize:wt,textStyles:e.textStyles,singleline:g,actions:e.actions},{},{})}`:"":e.image?`<span${B("style",lt(e.image.wrapperStyle),0)}><img${B("class",at.text__image,0)}${B("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${B("style",lt({width:e.image.width,height:e.image.height,"margin-top":xt?`-${e.image.height}`:void 0,"margin-bottom":xt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${z(oe,"TextRangeView").$$render(t,{text:_t,rootFontSize:wt,textStyles:j,singleline:g},{},{})}`}</span>`})}`})),de=ue,ve={container:"divkit-d37d6",container_wrap:"divkit-c8551",container_orientation_vertical:"divkit-ddc33",container_valign_top:"divkit-a331a",container_valign_center:"divkit-aae61",container_valign_bottom:"divkit-c2226","container_valign_space-between":"divkit-ce053","container_valign_space-around":"divkit-cf29b","container_valign_space-evenly":"divkit-b4b04",container_halign_left:"divkit-a3091",container_halign_center:"divkit-bac9d",container_halign_right:"divkit-f4230","container_halign_space-between":"divkit-e5c38","container_halign_space-around":"divkit-feff2","container_halign_space-evenly":"divkit-e5e05",container_orientation_horizontal:"divkit-fe458",container_orientation_overlap:"divkit-a644d"};function pe(t){return{top:Number(null==t?void 0:t.top)||0,right:Number(null==t?void 0:t.right)||0,bottom:Number(null==t?void 0:t.bottom)||0,left:Number(null==t?void 0:t.left)||0}}function ge(t,e,r){const i=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),n=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0);null!=e&&e.show_at_start&&(r?t.top=e.style.height+n:t.left=e.style.width+i),null!=e&&e.show_at_end&&(r?t.bottom=e.style.height+n:t.right=e.style.width+i)}function fe(t,e,r){let i;const n=((null==e?void 0:e.margins.left)||0)+((null==e?void 0:e.margins.right)||0),o=((null==e?void 0:e.margins.top)||0)+((null==e?void 0:e.margins.bottom)||0),a=((null==r?void 0:r.margins.left)||0)+((null==r?void 0:r.margins.right)||0),s=((null==r?void 0:r.margins.top)||0)+((null==r?void 0:r.margins.bottom)||0);return i="horizontal"===t?[null!=r&&r.show_between?r.style.height+s:0,null!=e&&e.show_between?e.style.width+n:0]:[null!=e&&e.show_between?e.style.height+o:0,null!=r&&r.show_between?r.style.width+a:0],i.map(ct).join(" ")}function he(t,e,r){if(!(t&&t.shape&&t.shape.type&&e.includes(t.shape.type)&&"shape_drawable"===t.type))return r;let i;if("rounded_rectangle"===t.shape.type)n=t.shape,i={width:Number((null===(o=n.item_width)||void 0===o?void 0:o.value)||10),height:Number((null===(a=n.item_height)||void 0===a?void 0:a.value)||10),radius:Number(null!==(s=null===(l=n.corner_radius)||void 0===l?void 0:l.value)&&void 0!==s?s:5)};else{if("circle"!==t.shape.type)return r;i=function(t){var e;const r=2*Number((null===(e=t.radius)||void 0===e?void 0:e.value)||10);return{width:r,height:r,radius:r}}(t.shape)}var n,o,a,s,l;return function(t,e,r){var i;const n={},o=e.stroke||(null==r?void 0:r.stroke),a=null!=o&&o.color?vt(o.color):"",s=null!=o&&o.width?Number(null!==(i=o.width)&&void 0!==i?i:1):"";n.width=t.width,n.height=t.height,n.borderRadius=t.radius;const l=e.background_color||(null==r?void 0:r.color);return n.background=vt(l),a&&s&&(n.boxShadow=`inset 0 0 0 ${ct(s)} ${a}`),n}(i,t.shape,{color:t.color,stroke:t.stroke})}let me;function ye(){if(void 0!==me)return me;const t=document.createElement("div");return t.style.position="absolute",t.style.display="flex",t.style.flexDirection="column",t.style.gap="1px",t.appendChild(document.createElement("div")),t.appendChild(document.createElement("div")),document.body.appendChild(t),me=1===t.scrollHeight,document.body.removeChild(t),me}const be="divkit-a7719",_e="divkit-f6e9a";function we(t,e,r,i,n,o){const a=e.margins.left,s=e.margins.right,l=e.margins.top,c=e.margins.bottom;o?t.push({top:r.bottom+l,left:n.left+a,width:Math.max(0,n.right-n.left-a-s),height:i.top-r.bottom-l-c,style:e.style}):t.push({top:n.top+l,left:r.right+a,width:i.left-r.right-a-s,height:Math.max(0,n.bottom-n.top-l-c),style:e.style})}function $e(t,e,r,i){const n={top:Math.min(...r.map((t=>t.top))),right:Math.max(...r.map((t=>t.right))),bottom:Math.max(...r.map((t=>t.bottom))),left:Math.min(...r.map((t=>t.left)))};if((null==e?void 0:e.show_at_start)&&we(t,e,{top:0,right:r[0].left-e.style.width-e.margins.left-e.margins.right,bottom:r[0].top-e.style.height-e.margins.top-e.margins.bottom,left:0},r[0],n,i),null==e?void 0:e.show_between)for(let o=0;o<r.length-1;++o)we(t,e,r[o],r[o+1],n,i);if(null==e?void 0:e.show_at_end){const o=r[r.length-1];we(t,e,o,{top:o.bottom+e.style.height+e.margins.top+e.margins.bottom,right:0,bottom:0,left:o.right+e.style.width+e.margins.left+e.margins.right},n,i)}}const xe=R(((t,e,r,i)=>{let n,{orientation:o}=e,{separator:a}=e,{lineSeparator:s}=e;const l=function(t,e){let r,i=0,n=!1;return function(){const e=Date.now();return!i||Math.abs(e-i)>10?(i=e,r=t.apply(this,arguments)):(n||(n=!0,setTimeout((()=>{n=!1,r=t.apply(this,arguments)}),10)),r)}}((function(){if(!n)return;const t=n.getBoundingClientRect();u=[];let e=[...n.children].filter((t=>t!==c&&!t.classList.contains(st.outer__border))),r=[];for(;e.length;){const t=[],i=e.shift();t.push(i);let n=i.getBoundingClientRect(),a=n.right,s=n.bottom;for(;e.length;){let r=e[0],i=r.getBoundingClientRect();if("vertical"===o){if(i.top<s)break}else if(i.left<a)break;a=Math.max(a,i.right),s=Math.max(s,i.bottom),t.push(r),e.shift()}r.push(t)}const i=[];r.forEach((t=>{const e=t.map((t=>function(t){const e=t.getBoundingClientRect(),r=getComputedStyle(t);return{top:e.top-parseFloat(r.marginTop),right:e.right+parseFloat(r.marginRight),bottom:e.bottom+parseFloat(r.marginBottom),left:e.left-parseFloat(r.marginLeft)}}(t)));a&&$e(u,a,e,"vertical"===o);const r={top:Math.min(...e.map((t=>t.top))),right:Math.max(...e.map((t=>t.right))),bottom:Math.max(...e.map((t=>t.bottom))),left:Math.min(...e.map((t=>t.left)))};i.push(r)})),s&&$e(u,s,i,"horizontal"===o),u.forEach((e=>{e.top-=t.top,e.left-=t.left}))}));let c,u=[],d=!1,v=null,g=null;return p((()=>{d=!1})),void 0===e.orientation&&r.orientation&&void 0!==o&&r.orientation(o),void 0===e.separator&&r.separator&&void 0!==a&&r.separator(a),void 0===e.lineSeparator&&r.lineSeparator&&void 0!==s&&r.lineSeparator(s),n=null,(d&&n||v||g)&&(v&&(v.disconnect(),v=null),g&&(g.disconnect(),g=null),d&&n&&("undefined"!=typeof MutationObserver&&(v=new MutationObserver((function(t){t.some((t=>{var e;const r=null===(e=t.target)||void 0===e?void 0:e.classList;return!(null==r?void 0:r.contains(_e))&&!(null==r?void 0:r.contains(be))}))&&l()})),v.observe(n,{childList:!0,attributes:!0,characterData:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(g=new ResizeObserver(l),g.observe(n)))),d&&n&&l(),` <div${B("class",be,0)}${B("this",c,0)}>${M(u,(t=>`<div${B("class","divkit-c770e",0)}${L({left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`})}><div${B("class",_e,0)}${L({width:`${t.style.width}px`,height:`${t.style.height}px`,"border-radius":`${t.style.borderRadius}px`,background:t.style.background,"box-shadow":t.style.boxShadow})}></div> </div>`))}</div>`})),ke=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,p,g,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j=o,P=o,S=o,O=o,I=o,T=o,N=o,J=o,R=o;var B,U,L,W,H,q;let{json:G={}}=e,{templateContext:Z}=e,{origJson:Y}=e,{layoutParams:X}=e;const K={left:"start",center:"center",right:"end","space-between":"start","space-around":"start","space-evenly":"start"},Q={top:"start",center:"center",bottom:"end",baseline:"baseline","space-between":"start","space-around":"start","space-evenly":"start"},tt=["rounded_rectangle","circle"],et=f(nt);let rt,it=!1,at="vertical",st="top",lt="left",ct=null,ut=null,dt={};if(void 0===e.json&&r.json&&void 0!==G&&r.json(G),void 0===e.templateContext&&r.templateContext&&void 0!==Z&&r.templateContext(Z),void 0===e.origJson&&r.origJson&&void 0!==Y&&r.origJson(Y),void 0===e.layoutParams&&r.layoutParams&&void 0!==X&&r.layoutParams(X),n=G.items,(null==n?void 0:n.length)&&Array.isArray(n)?it=!1:(it=!0,et.logError(ot(new Error('Incorrect or empty "items" prop for div "container"')))),a=(!it&&n||[]).map((t=>{let e=t,r=Z;return({templateContext:r,json:e}=et.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=et.getDerivedFromVars(G.orientation),R(),R=l(s,(t=>D=t)),at=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(D,at),c=et.getDerivedFromVars(G.content_alignment_vertical),J(),J=l(c,(t=>V=t)),st=function(t,e){return"top"===t||"center"===t||"bottom"===t||"baseline"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(V,st),u=et.getDerivedFromVars(G.content_alignment_horizontal),N(),N=l(u,(t=>A=t)),lt=function(t,e){return"left"===t||"center"===t||"right"===t||"space-between"===t||"space-around"===t||"space-evenly"===t?t:e}(A,lt),d=et.getDerivedFromVars(G.layout_mode),T(),T=l(d,(t=>F=t)),v="wrap"===F,p=et.getDerivedFromVars(G.separator),I(),I=l(p,(t=>C=t)),(null==C?void 0:C.style)&&"overlap"!==at&&ye()){const t=he(C.style,tt,(null==ct?void 0:ct.style)||null);ct=t?{show_at_start:Boolean(null!==(B=C.show_at_start)&&void 0!==B&&B),show_at_end:Boolean(null!==(U=C.show_at_end)&&void 0!==U&&U),show_between:Boolean(null===(L=C.show_between)||void 0===L||L),style:t,margins:pe(C.margins)}:null}else ct=null;if(g=et.getDerivedFromVars(G.line_separator),O(),O=l(g,(t=>E=t)),(null==E?void 0:E.style)&&"overlap"!==at&&ye()){const t=he(E.style,tt,(null==ut?void 0:ut.style)||null);ut=t?{show_at_start:Boolean(null!==(W=E.show_at_start)&&void 0!==W&&W),show_at_end:Boolean(null!==(H=E.show_at_end)&&void 0!==H&&H),show_between:Boolean(null===(q=E.show_between)||void 0===q||q),style:t,margins:pe(E.margins)}:null}else ut=null;h=ct||ut?function(t,e,r){const i={};return ge(i,e,"vertical"===t),ge(i,r,"horizontal"===t),i}(at,ct,ut):null,m=et.getDerivedFromVars(G.aspect),S(),S=l(m,(t=>k=t));{const t=null==k?void 0:k.ratio;rt=t&&Gt(t)?t:void 0}y=et.getDerivedFromVars(G.width),j(),j=l(y,(t=>$=t)),b=et.getDerivedFromVars(G.height),P(),P=l(b,(t=>x=t));{let t={};(null==X?void 0:X.fakeElement)&&(t.fakeElement=!0),"overlap"===at&&(t.overlapParent=!0),"horizontal"!==at&&(t.parentHAlign=v?"start":K[lt],rt||x&&"wrap_content"!==x.type&&("match_parent"!==x.type||!(null==X?void 0:X.parentVerticalWrapContent))||(t.parentVerticalWrapContent=!0)),"vertical"!==at&&(t.parentVAlign=v?"start":Q[st],("wrap_content"===(null==$?void 0:$.type)||"match_parent"===(null==$?void 0:$.type)&&(null==X?void 0:X.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===at&&(t.parentContainerOrientation="horizontal"),"vertical"===at&&(t.parentContainerOrientation="vertical"),v&&(t.parentContainerWrap=!0),dt=Tt(t,dt)}return _={orientation:at,valign:st,halign:lt,wrap:v},w={gap:ct||ut?fe(at,ct,ut):void 0,"aspect-ratio":rt},j(),P(),S(),O(),I(),T(),N(),J(),R(),it?"":`${z(Qt,"Outer").$$render(t,{cls:At("container",ve,_),style:w,json:G,origJson:Y,templateContext:Z,layoutParams:X,additionalPaddings:h,heightByAspect:Boolean(rt),parentOf:n,replaceItems:function(t){G=Object.assign(Object.assign({},G),{items:t})}},{},{default:()=>`${M(a,(e=>`${z(zr,"Unknown").$$render(t,{layoutParams:dt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} ${ct||ut?`${z(xe,"ContainerSeparators").$$render(t,{separator:ct,lineSeparator:ut,orientation:at},{},{})}`:""}`})}`})),Ee=ke,Ce={separator:"divkit-a30bb",separator_orientation_horizontal:"divkit-f529e",separator_orientation_vertical:"divkit-e9e27",separator__inner:"divkit-db7d8"};function Fe(t,e){return"vertical"===t||"horizontal"===t?t:e}const Ae=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,p=o,{json:g={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const b=f(nt);let _="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&r.json&&void 0!==g&&r.json(g),void 0===e.templateContext&&r.templateContext&&void 0!==h&&r.templateContext(h),void 0===e.origJson&&r.origJson&&void 0!==m&&r.origJson(m),void 0===e.layoutParams&&r.layoutParams&&void 0!==y&&r.layoutParams(y),n=b.getDerivedFromVars(g.delimiter_style),p(),p=l(n,(t=>v=t)),_=Fe(null==v?void 0:v.orientation,_),a=!((null==v?void 0:v.color)&&("transparent"===v.color||9===v.color.length&&0===v.color.indexOf("#00"))),w=vt(null==v?void 0:v.color,1,w),s="horizontal"===_?"100%":ct(1),c="horizontal"===_?ct(1):"100%",u={background:w,width:s,height:c},d={orientation:_},p(),`${z(Qt,"Outer").$$render(t,{cls:At("separator",Ce,d),json:g,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>a?`<span${B("class",Ce.separator__inner,0)}${B("style",lt(u),0)}></span>`:""})}`})),Ve={image:"divkit-a448f","image_is-width-content":"divkit-fe14a","image_is-height-content":"divkit-f4d92",image__image:"divkit-ce046",image_error:"divkit-f10d9","image__aspect-wrapper":"divkit-dc808",image_aspect:"divkit-ae784",image_loaded:"divkit-cf4e0","divkit-image-appearance":"divkit-e555f","image_before-appearance":"divkit-ffe8a"};function De(t){return t.startsWith("data:")?gt(t):`data:image/jpg;base64,${gt(t)}`}const je=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,g,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,S,O,I,M,T,N,J,R,U,W=o,H=o,q=o,G=o,Z=o,Y=o,X=o,K=o,Q=o,tt=o,et=o,rt=o,it=o,at=o,{json:st={}}=e,{templateContext:ct}=e,{origJson:ut}=e,{layoutParams:dt}=e;const pt=f(nt);let gt,ft=0,ht="rgba(0,0,0,0.08)",mt=!1,yt="",wt="none",$t="50% 50%",xt="0",kt="source_in",Et="",Ct="",Ft=0,Vt=0,Dt=0,jt="",Pt="";p((()=>{pt.removeSvgFilter(gt,kt)})),void 0===e.json&&r.json&&void 0!==st&&r.json(st),void 0===e.templateContext&&r.templateContext&&void 0!==ct&&r.templateContext(ct),void 0===e.origJson&&r.origJson&&void 0!==ut&&r.origJson(ut),void 0===e.layoutParams&&r.layoutParams&&void 0!==dt&&r.layoutParams(dt),n=pt.getDerivedFromVars(st.image_url),at(),at=l(n,(t=>U=t)),a=pt.getDerivedFromVars(st.gif_url),it(),it=l(a,(t=>R=t)),s=U||R,ft=0,s?mt=!1:(mt=!0,pt.logError(ot(new Error('Missing "image_url" for "image"')))),c=pt.getDerivedFromVars(st.width),rt(),rt=l(c,(t=>J=t)),u="wrap_content"===(null==J?void 0:J.type),d=pt.getDerivedFromVars(st.height),et(),et=l(d,(t=>N=t)),v="wrap_content"===(null==N?void 0:N.type),g=pt.getDerivedFromVars(st.preview),tt(),tt=l(g,(t=>T=t)),yt=T?`url("${De(T)}")`:"",h=pt.getDerivedFromVars(st.placeholder_color),Q(),Q=l(h,(t=>M=t)),ht=vt(M,1,ht),m=pt.getDerivedFromVars(st.scale),K(),K=l(m,(t=>I=t)),wt=bt(I)||wt,y=pt.getDerivedFromVars({content_alignment_horizontal:st.content_alignment_horizontal,content_alignment_vertical:st.content_alignment_vertical}),X(),X=l(y,(t=>O=t)),$t=function(t,e){const r=t.content_alignment_horizontal,i=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||i&&"top"!==i&&"center"!==i&&"bottom"!==i?e:_t(t)}(O,$t),b=pt.getDerivedFromVars(st.accessibility),Y(),Y=l(b,(t=>S=t)),_=(null==S?void 0:S.description)||"",w=pt.getDerivedFromVars(st.aspect),Z(),Z=l(w,(t=>P=t));{const t=null==P?void 0:P.ratio;xt=t&&Gt(t)?(100/Number(t)).toFixed(2):"0"}$=pt.getDerivedFromVars(st.tint_color),G(),G=l($,(t=>j=t)),x=pt.getDerivedFromVars(st.tint_mode),q(),q=l(x,(t=>D=t));{const t=j?vt(j):void 0,e=ce(D,kt);t===gt&&e===kt||(pt.removeSvgFilter(gt,kt),Et=t?pt.addSvgFilter(t,e):"",gt=t,kt=e)}if(k=pt.getDerivedFromVars(st.appearance_animation),H(),H=l(k,(t=>V=t)),V&&"fade"===V.type){const t=V;Ct=zt(t.interpolator,"ease_in_out").replace(/_/g,"-"),Dt=Ot(t.duration,300),Vt=Ot(t.start_delay,0),Ft=Ot(t.alpha,0)}E=pt.getDerivedFromVars(st.filters),W(),W=l(E,(t=>A=t));{let t="",e="";Array.isArray(A)&&A.length&&(t=Zt(A,pt.logError)),t&&(e="polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%)"),jt=t,Pt=e}return C={aspect:"0"!==xt,"is-width-content":u,"is-height-content":v,loaded:!1,"before-appearance":Boolean(Ct)&&!0},F={"background-image":yt,"background-color":yt?void 0:ht,"background-size":wt,"clip-path":Pt||void 0,"object-fit":wt,"object-position":$t,filter:["",jt].filter(Boolean).join(" "),"--divkit-appearance-interpolator":Ct||void 0,"--divkit-appearance-fade-start":Ct?Ft:void 0,"--divkit-appearance-delay":Ct?`${Vt}ms`:void 0,"--divkit-appearance-duration":Ct?`${Dt}ms`:void 0},W(),H(),q(),G(),Z(),Y(),X(),K(),Q(),tt(),et(),rt(),it(),at(),mt?"":`${z(Qt,"Outer").$$render(t,{cls:At("image",Ve,C),json:st,origJson:ut,templateContext:ct,layoutParams:dt,customDescription:!0},{},{default:()=>C.aspect?`<span${B("class",Ve["image__aspect-wrapper"],0)}${L({"padding-bottom":`${xt}%`})}><img${B("class",Ve.image__image,0)}${B("src",s,0)} loading="lazy" decoding="async"${B("style",lt(F),0)}${B("alt",_,0)}${B("aria-hidden",_?null:"true",0)}></span>`:`<img${B("class",Ve.image__image,0)}${B("src",s,0)} loading="lazy" decoding="async"${B("style",lt(F),0)}${B("alt",_,0)}${B("aria-hidden",_?null:"true",0)}>`})}`})),Pe={grid:"divkit-d9080",grid_halign_left:"divkit-f63b3",grid_halign_center:"divkit-a14a6",grid_halign_right:"divkit-b0717",grid_valign_top:"divkit-fbca8",grid_valign_center:"divkit-d4310",grid_valign_bottom:"divkit-e4205"};function Se(t){return t>0&&t<1}function Oe(t){return String(Math.ceil(1e3*t)/1e3)}function Ie(t,e,r){if(t.some(Se)){const e=Math.max(...t.filter(Se).map((t=>1/t)));t=t.map((t=>t*e))}let i=0,n=0;const o=[];if(t.every(Boolean)){n=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*n;r>i&&(i=r)}}for(let e=0;e<r;++e)i?o[e]=`minmax(${ct(i*t[e]/n)},${Oe(t[e])}fr)`:t[e]?o[e]=`${Oe(t[e])}fr`:o[e]="auto";return o.join(" ")}const Me=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,p,g,h,m,y,b=o,_=o,w=o,$=o,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=f(nt);let A,V,D=!1,j=1,P=[],S=[],O=[],I=[],T=0,N=!1,J="top",R="left";void 0===e.json&&r.json&&void 0!==x&&r.json(x),void 0===e.templateContext&&r.templateContext&&void 0!==k&&r.templateContext(k),void 0===e.origJson&&r.origJson&&void 0!==E&&r.origJson(E),void 0===e.layoutParams&&r.layoutParams&&void 0!==C&&r.layoutParams(C),n=x.items,(null==n?void 0:n.length)&&Array.isArray(n)?D=!1:(D=!0,F.logError(ot(new Error('Incorrect or empty "items" prop for div "grid"')))),a=F.getDerivedFromVars(x.column_count),$(),$=l(a,(t=>y=t)),j=ee(y,j),s=(!D&&n||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=F.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];s.forEach((e=>{t.push(F.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=X(t,(t=>[...t])),w(),w=l(A,(t=>m=t))}{const t={};let e=0,r=0;P=[],S=[],O=[],I=[],N=!1,V=s.map(((i,n)=>{var o,a,s,l;const c=m[n],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,v={x:e,y:r,colSpan:u,rowSpan:d},p="match_parent"===(null===(o=c.width)||void 0===o?void 0:o.type)?Number(c.width.weight||1)/u:0,g="match_parent"===(null===(a=c.height)||void 0===a?void 0:a.type)?Number(c.height.weight||1)/d:0,f=1===u&&"fixed"===(null===(s=c.width)||void 0===s?void 0:s.type)&&c.width.value?Number(c.width.value)/u:0,h=1===d&&"fixed"===(null===(l=c.height)||void 0===l?void 0:l.type)&&c.height.value?Number(c.height.value)/d:0;for(let i=e;i<e+u;++i)for(let e=r;e<r+d;++e)t[i+"_"+e]?N=!0:(t[i+"_"+e]=!0,(!P[i]||P[i]<p)&&(P[i]=p),(!S[e]||S[e]<g)&&(S[e]=g),(!O[i]||O[i]<f)&&(O[i]=f),(!I[e]||I[e]<h)&&(I[e]=h));do{++e,e>=j&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},i),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(ot(new Error('Mismatching "grid" rows/columns'))),T=r}return c=F.getDerivedFromVars(x.content_alignment_vertical),_(),_=l(c,(t=>h=t)),J=se(h,J),u=F.getDerivedFromVars(x.content_alignment_horizontal),b(),b=l(u,(t=>g=t)),R=ae(g,R),d={valign:J,halign:R},v={"grid-template-columns":Ie(P,O,j),"grid-template-rows":Ie(S,I,T)},p=D||N,b(),_(),w(),$(),p?"":`${z(Qt,"Outer").$$render(t,{cls:At("grid",Pe,d),json:x,origJson:E,templateContext:k,style:v,layoutParams:C,parentOf:x.items,replaceItems:function(t){x=Object.assign(Object.assign({},x),{items:t})}},{},{default:()=>`${M(V,(e=>`${z(zr,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Te=Me,ze={gallery:"divkit-cbb0f",gallery_orientation_horizontal:"divkit-c9be7",gallery_orientation_vertical:"divkit-a72d5",gallery__scroller:"divkit-a4e39","gallery_scroll-snap":"divkit-f606e","gallery__items-grid":"divkit-eb4a5",gallery__items:"divkit-af276",gallery__arrow:"divkit-b72d7","gallery__arrow-icon":"divkit-d100d",gallery__arrow_left:"divkit-a0a5d",gallery__arrow_right:"divkit-f0f59","gallery__arrow-icon-path":"divkit-b4173"};function Ne(t){const e=[];let r=t[0],i=1;for(let n=1;n<=t.length;n++)t[n]!==r?(e.push(i>1?`repeat(${i}, ${r})`:r),r=t[n],i=1):i++;return e.join(" ")}function Je(t,e){let r;return function(...i){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,i),r=null}),e)}}const Re=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,g,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,O,I,T,N,J=o,R=o,U=o,L=o,W=o,H=o,q=o,G=o,Z=o,Y=o,{json:K={}}=e,{templateContext:Q}=e,{origJson:tt}=e,{layoutParams:et}=e;const it=f(nt);let at,st,ut=[],dt=!1,vt=!1,pt=null,gt=!1;const ft=it.getCustomization("galleryLeftClass"),ht=it.getCustomization("galleryRightClass");let mt=!1;T=l(it.isDesktop,(t=>I=t));let yt,bt,_t,wt,$t=1,xt="horizontal",kt="start",Et=8,Ct="",Ft=[],Vt={},Dt=!1,jt={},Pt=0;const It=Je((function(){if(!at)return;const t=at.scrollLeft,e=at.scrollWidth,r=at.offsetWidth;dt=t>2,vt=t+r<e-2}),50);function Mt(){let t=[],e=ut[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<$t;++e){const i=ut[e].children[r];i&&t.push(i)}return t}function zt(t,e,r="smooth"){const i="horizontal"===xt,n=i?"offsetLeft":"offsetTop",o=i?"left":"top",a=t[e];a&&at.scroll({[o]:Math.max(0,a[n]+.01-Et/2),behavior:r})}function Nt(t){const e=Mt(),r=at.getBoundingClientRect(),i=e.findIndex((t=>function(t,e){return"horizontal"===xt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==i)return i;const n=e.map((t=>function(t,e){return"horizontal"===xt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=n.findIndex(Boolean);return-1!==o?"prev"===t&&2===n.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!K.id||mt||(null==et?void 0:et.fakeElement)||it.registerInstance(K.id,{setCurrentItem(t){const e=Mt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');zt(e,t)},setPreviousItem(t){const e=Nt("prev"),r=Mt();let i=e-1;i<0&&(i="ring"===t?r.length-1:e),zt(r,i)},setNextItem(t){const e="horizontal"===xt?at.scrollLeft+at.offsetWidth===at.scrollWidth:at.scrollTop+at.offsetHeight===at.scrollHeight,r=Mt();if(e&&"ring"===t)return void zt(r,0);const i=Nt("next");let n=i+1;n>r.length-1&&(n="ring"===t?0:i),zt(r,n)}}),p((()=>{gt=!1,K.id&&!(null==et?void 0:et.fakeElement)&&it.unregisterInstance(K.id)})),void 0===e.json&&r.json&&void 0!==K&&r.json(K),void 0===e.templateContext&&r.templateContext&&void 0!==Q&&r.templateContext(Q),void 0===e.origJson&&r.origJson&&void 0!==tt&&r.origJson(tt),void 0===e.layoutParams&&r.layoutParams&&void 0!==et&&r.layoutParams(et),n=K.items,(null==n?void 0:n.length)&&Array.isArray(n)?mt=!1:(mt=!0,it.logError(ot(new Error('Incorrect or empty "items" prop for div "gallery"')))),a=(!mt&&n||[]).map((t=>{let e=t,r=Q;return({templateContext:r,json:e}=it.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=I&&gt&&!mt,s?"undefined"!=typeof ResizeObserver&&(pt=new ResizeObserver((()=>{It()})),pt.observe(st)):pt&&(pt.disconnect(),pt=null),c=it.getDerivedFromVars(K.column_count),Z(),Z=l(c,(t=>O=t)),$t=ee(O,$t),u=function(t,e){let r=0,i=[];for(let n=0;n<t.length;++n)i[r]||(i[r]=[]),i[r].push(t[n]),++r>=e&&(r=0);return i}(a,$t),d=it.getDerivedFromVars(K.orientation),G(),G=l(d,(t=>P=t)),xt=Fe(P,xt),v=it.getDerivedFromVars(K.cross_content_alignment),q(),q=l(v,(t=>j=t)),kt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(j,kt),g=it.getDerivedFromVars(K.item_spacing),H(),H=l(g,(t=>D=t)),Et=Ot(D,Et),yt=ct(Et),h=it.getDerivedFromVars(K.cross_spacing),W(),W=l(h,(t=>V=t)),_t=Ot(V,Et),bt=ct(_t),m=it.getDerivedFromVars(K.paddings),L(),L=l(m,(t=>A=t)),Ct=St(A,Ct),y="horizontal"===xt?"grid-template-columns":"grid-template-rows";{let t=[];a.forEach((e=>{const r="horizontal"===xt?"width":"height";t.push(it.getDerivedFromVars(e.json[r]))})),wt=X(t,(t=>t)),U(),U=l(wt,(t=>F=t))}Ft=[],$t>1?Ft.push("auto"):F.forEach((t=>{!t&&"horizontal"===xt||"match_parent"===(null==t?void 0:t.type)?Ft.push("100%"):Ft.push("max-content")})),b=it.getDerivedFromVars(K.scroll_mode),R(),R=l(b,(t=>C=t));{const t={};let e={};Dt=!1,(null==et?void 0:et.fakeElement)&&(e.fakeElement=!0),"horizontal"===xt?e.parentVAlign=kt:e.parentHAlign=kt,"paging"===C&&(Dt=!0,e.scrollSnap="start",t["horizontal"===xt?"scroll-padding-left":"scroll-padding-top"]=ct(Et/2)),1===$t&&(e.parentLayoutOrientation=xt),Vt=Tt(t,Vt),jt=Tt(e,jt)}return _=it.getDerivedFromVars(K.restrict_parent_scroll),Y(),Y=l(_,(t=>N=t)),w={padding:Ct,"grid-gap":bt},$={"grid-gap":yt,[y]:Ne(Ft)},x={orientation:xt,"scroll-snap":Dt},k=it.getDerivedFromVars(K.default_item),J(),J=l(k,(t=>E=t)),Pt=Ot(E,Pt),J(),R(),U(),L(),W(),H(),q(),G(),Z(),T(),Y()," "+(mt?"":`${z(Qt,"Outer").$$render(t,{cls:At("gallery",ze,x),json:K,origJson:tt,templateContext:Q,layoutParams:et,customPaddings:!0,customActions:"gallery",parentOf:n,replaceItems:function(t){K=Object.assign(Object.assign({},K),{items:t})}},{},{default:()=>`<div class="${S(ze.gallery__scroller,!0)+" "+S(N?rt:"",!0)}"${B("style",lt(Vt),0)}${B("this",at,0)}><div${B("class",ze["gallery__items-grid"],0)}${B("style",lt(w),0)}${B("this",st,0)}>${M(u,((e,r)=>`<div${B("class",ze.gallery__items,0)}${B("style",lt($),0)}${B("this",ut[r],0)}>${M(e,(e=>`${z(zr,"Unknown").$$render(t,{layoutParams:jt,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))} </div>`))}</div></div> ${"horizontal"===xt?`${dt&&s?` <div${B("class",ft||`${ze.gallery__arrow} ${ze.gallery__arrow_left}`,0)}>${ft?"":`<svg${B("class",ze["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${B("class",ze["gallery__arrow-icon-path"],0)} d="m10 16 8.3 8 1.03-1-4-6-.7-1 .7-1 4-6-1.03-1z"></path></svg>`}</div>`:""} ${vt&&s?` <div${B("class",ht||`${ze.gallery__arrow} ${ze.gallery__arrow_right}`,0)}>${ht?"":`<svg${B("class",ze["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${B("class",ze["gallery__arrow-icon-path"],0)} d="M22 16l-8.3 8-1.03-1 4-6 .7-1-.7-1-4-6 1.03-1 8.3 8z"></path></svg>`}</div>`:""}`:""}`})}`)})),Be=Re,Ue={tabs:"divkit-e0df5",tabs__list:"divkit-ea19b",tabs__item:"divkit-c25c7",tabs__item_selected:"divkit-d560a",tabs__item_actionable:"divkit-dfda0",tabs__panels:"divkit-f5dc0",tabs__swiper:"divkit-eb42c",tabs__swiper_animated:"divkit-b9f18",tabs__swiper_inited:"divkit-fa574",tabs__panel:"divkit-cc9fb",tabs__panel_visible:"divkit-e7306",tabs__separator:"divkit-b85bf"},Le=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,g,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,O=o,I=o,T=o,N=o,J=o,R=o,U=o,W=o,H=o;var q,G;let{json:Z={}}=e,{templateContext:X}=e,{origJson:K}=e,{layoutParams:Q}=e;const tt=f(nt),et=tt.genId("tabs");let it=!1,at=Y([]);x=l(at,(t=>w=t));let st,dt,pt,gt={};const ft=tt.getJsonWithVars(Z.selected_tab);let ht,mt,yt=ft&&Number(ft)||0,bt=12,_t="",wt="",$t="",xt="",kt="",Et="",Ct="",Ft="",Vt="",jt="",It=0,Mt="",zt="",Nt=null,Jt=!1,Ut=!1,Lt=yt,Wt=[],qt=[];async function Zt(t,e=!1){if(Lt=yt,yt=t,Jt||(Jt=!0,dt.style.height=ct(dt.clientHeight),pt.style.transform=`translate3d(${100*-Lt}%,0,0)`),Ut=!0,async function(t){await $(),pt.style.transform=`translate3d(${t}%,0,0)`}(100*-yt),function(t=!1){const e=t?Math.max(0,yt-1):Math.min(yt,Lt),r=t?Math.min(n.length-1,yt+1):Math.max(yt,Lt);Wt=Wt.map(((t,i)=>t||i>=e&&i<=r)),qt=qt.map(((t,i)=>i>=e&&i<=r))}(),async function(){await $();const t=document.getElementById(`${et}-panel-${yt}`);t&&(dt.style.height=ct(t.offsetHeight))}(),Xt&&clearTimeout(Xt),Xt=window.setTimeout((()=>{qt=n.map(((t,e)=>e===yt))}),400),Yt=-yt*dt.clientWidth,e){await $();const t=st.querySelector(`.${Ue.tabs__item_selected}`);t&&t.focus()}}let Yt,Xt=null;if(!Z.id||it||(null==Q?void 0:Q.fakeElement)||tt.registerInstance(Z.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');Zt(t)},setPreviousItem(t){let e=yt-1;e<0&&(e="ring"===t?n.length-1:yt),Zt(e)},setNextItem(t){let e=yt+1;e>n.length-1&&(e="ring"===t?0:yt),Zt(e)}}),p((()=>{Z.id&&!(null==Q?void 0:Q.fakeElement)&&tt.unregisterInstance(Z.id)})),void 0===e.json&&r.json&&void 0!==Z&&r.json(Z),void 0===e.templateContext&&r.templateContext&&void 0!==X&&r.templateContext(X),void 0===e.origJson&&r.origJson&&void 0!==K&&r.origJson(K),void 0===e.layoutParams&&r.layoutParams&&void 0!==Q&&r.layoutParams(Q),n=Z.items||[],Array.isArray(n)&&n.length){let t=[];n.forEach(((e,r)=>{const i=tt.getJsonWithVars({index:r,title:e.title,title_click_action:e.title_click_action});i.title&&"string"==typeof i.title?t.push(i):tt.logError(ot(new Error("Incorrect title for the tab"),{additional:{index:r}}))})),at.set(t)}else at.set([]);(null==w?void 0:w.length)?it=!1:(it=!0,tt.logError(ot(new Error('Incorrect or empty "items" prop for div "tabs"')))),a=tt.getDerivedFromVars(Z.width),W(),W=l(a,(t=>j=t)),s=tt.getDerivedFromVars(Z.height),U(),U=l(s,(t=>D=t));{let t={};(null==Q?void 0:Q.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==j?void 0:j.type)&&(t.parentHorizontalWrapContent=!0),D&&"wrap_content"!==D.type||(t.parentVerticalWrapContent=!0),gt=Tt(t,gt)}if(!it&&(yt<0||yt>=n.length)&&(tt.logError(ot(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Z.selected_tab,length:n.length}})),yt=yt<0?0:n.length-1),it||w.some((t=>yt===t.index))||(tt.logError(ot(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:Z.selected_tab}})),yt=(null===(q=w[0])||void 0===q?void 0:q.index)||0),c=tt.getDerivedFromVars(Z.tab_title_style),R(),R=l(c,(t=>V=t)),u=V||{},bt=ee(u.font_size,bt),u.font_size||u.paddings){const t=u.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/bt*10,right:(Number(t.right)||0)/bt*10,bottom:(Number(t.bottom)||0)/bt*10,left:(Number(t.left)||0)/bt*10};_t=St(e,_t)}{const t=u.line_height;void 0!==t&&Gt(t)&&(wt=ct(t/bt*10))}{const t=u.letter_spacing;void 0!==t&&Pt(t)&&($t=ct(t/bt*10))}if(u.corner_radius||u.corners_radius||u.font_size){const t=null!==(G=u.corner_radius)&&void 0!==G?G:1e3;u.corners_radius?xt=function(t,e,r,i){const n=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<n.length;++t)if(n[t]&&!Pt(n[t]))return i;return Bt(t,e,r)}(u.corners_radius,t,bt,xt):Pt(t)&&(xt=ct(t/bt*10))}return ht=ie(u.active_font_weight||u.font_weight,ht),kt=u.font_family&&"string"==typeof u.font_family?tt.typefaceProvider(u.font_family,{fontWeight:ht||400}):"",mt=ie(u.inactive_font_weight||u.font_weight,mt),Et=u.font_family&&"string"==typeof u.font_family?tt.typefaceProvider(u.font_family,{fontWeight:mt||400}):"",Ct=vt(u.active_text_color,1,Ct),Ft=vt(u.inactive_text_color,1,Ft),Vt=vt(u.active_background_color,1,Vt),jt=vt(u.inactive_background_color,1,jt),It=Ot(u.item_spacing,It),d=tt.getDerivedFromVars(Z.has_separator),J(),J=l(d,(t=>A=t)),v=tt.getDerivedFromVars(Z.separator_color),N(),N=l(v,(t=>F=t)),g=tt.getDerivedFromVars(Z.separator_paddings),T(),T=l(g,(t=>C=t)),A&&(F&&(Mt=vt(F,1,Mt)),C&&(zt=St(C,zt))),h={background:Mt,margin:zt},m=tt.getDerivedFromVars(Z.switch_tabs_by_content_swipe_enabled),I(),I=l(m,(t=>E=t)),y=void 0===E||Boolean(E),b=tt.getDerivedFromVars(Z.restrict_parent_scroll),H(),H=l(b,(t=>P=t)),_=tt.getDerivedFromVars(Z.title_paddings),O(),O=l(_,(t=>k=t)),Nt=Rt(k||void 0,Nt),it||(Wt=n.map(((t,e)=>e===yt)),qt=n.map(((t,e)=>e===yt))),x(),O(),I(),T(),N(),J(),R(),U(),W(),H(),it?"":`${z(Qt,"Outer").$$render(t,{cls:At("tabs",Ue,{}),json:Z,origJson:K,templateContext:X,layoutParams:Q,customActions:"tabs"},{},{default:()=>` <div class="${S(Ue.tabs__list,!0)+" "+S(P?rt:"",!0)}" role="tablist"${L({"--divkit-tabs-title-padding":Nt?Dt(Nt):"","--divkit-tabs-font-size":ct(bt),"--divkit-tabs-paddings":_t,"--divkit-tabs-line-height":wt,"--divkit-tabs-letter-spacing":$t,"--divkit-tabs-active-font-weight":ht||"","--divkit-tabs-inactive-font-weight":mt||"","--divkit-tabs-active-font-family":kt||"","--divkit-tabs-inactive-font-family":Et||"","--divkit-tabs-active-text-color":Ct,"--divkit-tabs-inactive-text-color":Ft,"--divkit-tabs-active-background-color":Vt,"--divkit-tabs-inactive-background-color":jt,"--divkit-tabs-border-radius":xt,"--divkit-tabs-items-spacing":It?ut(It):""})}${B("this",st,0)}>${M(w,(e=>{let r=e.index,i=r===yt;return` ${z(Ht,"Actionable").$$render(t,{cls:At("tabs__item",Ue,{selected:i,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=Q&&Q.fakeElement?[]:[e.title_click_action],attrs:{id:`${et}-tab-${r}`,"aria-controls":`${et}-panel-${r}`,role:"tab",tabindex:!i||null!=Q&&Q.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":i?"true":"false"},customAction:null!=Q&&Q.fakeElement?null:t=>function(t,e){return yt===e||(Zt(e),!1)}(0,r)},{},{default:()=>`${S(e.title)} `})}`}))}</div> ${A?`<div${B("class",Ue.tabs__separator,0)}${B("style",lt(h),0)}></div>`:""} <div class="${S(Ue.tabs__panels,!0)+" "+S(P?rt:"",!0)}"${B("this",dt,0)}><div${B("class",At("tabs__swiper",Ue,{inited:Jt,animated:Ut}),0)}${B("this",pt,0)}>${M(w,(e=>{let r=e.index;return` <div${B("class",At("tabs__panel",Ue,{visible:qt[r]}),0)} role="tabpanel" id="${S(et,!0)+"-panel-"+S(r,!0)}" aria-labelledby="${S(et,!0)+"-tab-"+S(r,!0)}" style="${"left: "+S(100*r,!0)+"%"}">${Wt[r]?`${z(zr,"Unknown").$$render(t,{div:n[r].div,templateContext:X,layoutParams:gt},{},{})}`:""} </div>`}))}</div></div>`})}`})),We=Le,He="divkit-eb860",qe="divkit-e08c6";function Ge(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,i=Math.floor(r),n=r-i;return t[i]*n+t[i+1]*(1-n)}}Ge([.0021,.0045,.0071,.01,.0131,.0165,.0202,.0242,.0284,.033,.0378,.0429,.0483,.054,.0601,.0664,.0731,.08,.0872,.0948,.1026,.1108,.1192,.1279,.1369,.1461,.1556,.1653,.1753,.1855,.1958,.2064,.2171,.2279,.2389,.25,.2612,.2725,.2839,.2952,.3067,.3181,.3295,.341,.3524,.3637,.375,.3863,.3974,.4085,.4195,.4304,.4412,.4519,.4624,.4729,.4832,.4934,.5034,.5133,.5231,.5327,.5422,.5516,.5608,.5699,.5788,.5876,.5963,.6048,.6132,.6214,.6295,.6375,.6453,.653,.6606,.668,.6754,.6825,.6896,.6965,.7034,.7101,.7166,.7231,.7295,.7357,.7418,.7479,.7538,.7596,.7653,.7709,.7764,.7818,.7871,.7923,.7974,.8024,.8073,.8122,.8169,.8216,.8261,.8306,.835,.8394,.8436,.8478,.8518,.8558,.8598,.8636,.8674,.8711,.8747,.8783,.8818,.8852,.8886,.8919,.8951,.8983,.9014,.9044,.9074,.9103,.9131,.9159,.9187,.9213,.924,.9265,.929,.9315,.9339,.9362,.9385,.9408,.943,.9451,.9472,.9492,.9512,.9532,.9551,.9569,.9587,.9605,.9622,.9638,.9655,.967,.9686,.9701,.9715,.9729,.9743,.9756,.9769,.9782,.9794,.9805,.9817,.9828,.9838,.9848,.9858,.9868,.9877,.9886,.9894,.9902,.991,.9917,.9924,.9931,.9937,.9943,.9949,.9954,.9959,.9964,.9969,.9973,.9977,.998,.9983,.9986,.9989,.9991,.9993,.9995,.9997,.9998,.9999,.9999,1,1]),Ge([5e-4,.002,.0045,.0078,.0119,.0168,.0224,.0286,.0355,.0429,.0508,.0592,.0681,.0774,.087,.0969,.1072,.1177,.1285,.1395,.1507,.1621,.1736,.1853,.197,.2089,.2208,.2328,.2448,.2569,.2689,.281,.293,.305,.317,.3289,.3408,.3526,.3644,.376,.3876,.3991,.4105,.4218,.433,.444,.455,.4658,.4765,.4871,.4975,.5078,.518,.528,.5379,.5477,.5573,.5668,.5761,.5853,.5944,.6033,.612,.6206,.6291,.6374,.6456,.6537,.6616,.6693,.677,.6845,.6918,.699,.7061,.713,.7199,.7265,.7331,.7395,.7458,.752,.758,.764,.7698,.7755,.781,.7865,.7918,.7971,.8022,.8072,.8121,.8169,.8216,.8262,.8307,.8351,.8394,.8436,.8477,.8517,.8557,.8595,.8633,.8669,.8705,.874,.8775,.8808,.8841,.8873,.8904,.8934,.8964,.8993,.9022,.9049,.9076,.9103,.9129,.9154,.9178,.9202,.9226,.9249,.9271,.9293,.9314,.9335,.9355,.9375,.9394,.9413,.9431,.9449,.9466,.9483,.95,.9516,.9532,.9547,.9562,.9576,.9591,.9605,.9618,.9631,.9644,.9657,.9669,.9681,.9692,.9703,.9714,.9725,.9736,.9746,.9756,.9765,.9775,.9784,.9793,.9802,.981,.9818,.9826,.9834,.9842,.9849,.9856,.9863,.987,.9877,.9883,.989,.9896,.9902,.9908,.9913,.9919,.9924,.993,.9935,.994,.9944,.9949,.9954,.9958,.9963,.9967,.9971,.9975,.9979,.9983,.9986,.999,.9993,.9997,1]);const Ze={tooltip:"divkit-f1907",tooltip_visible:"divkit-e5914"},Ye=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,g,h,m,y,b,_,w=o,$=o,x=o,k=o,E=o,C=o;var F,A,V,D;let{ownerNode:j}=e,{data:P}=e,{internalId:O}=e,{templateContext:I}=e;const M=f(nt);Date.now();return p((()=>{})),void 0===e.ownerNode&&r.ownerNode&&void 0!==j&&r.ownerNode(j),void 0===e.data&&r.data&&void 0!==P&&r.data(P),void 0===e.internalId&&r.internalId&&void 0!==O&&r.internalId(O),void 0===e.templateContext&&r.templateContext&&void 0!==I&&r.templateContext(I),n=M.isDesktop,k(),k=l(n,(t=>y=t)),a=M.getDerivedFromVars(P.position),x(),x=l(a,(t=>m=t)),s=M.getDerivedFromVars(null===(A=null===(F=P.offset)||void 0===F?void 0:F.x)||void 0===A?void 0:A.value),$(),$=l(s,(t=>h=t)),c=M.getDerivedFromVars(null===(D=null===(V=P.offset)||void 0===V?void 0:V.y)||void 0===D?void 0:D.value),w(),w=l(c,(t=>g=t)),u=M.getDerivedFromVars(P.animation_in),E(),E=l(u,(t=>b=t)),d=M.getDerivedFromVars(P.animation_out),C(),C=l(d,(t=>_=t)),v={visible:!1},w(),$(),x(),k(),E(),C(),` <div class="${S(At("tooltip",Ze,v),!0)+" "+S(y?et:"",!0)}"${L({top:"",left:"",width:"",height:""})}${B("this",undefined,0)}>${z(zr,"Unknown").$$render(t,{div:P.div,templateContext:I},{},{})}</div>`})),Xe=R(((t,e,r,i)=>{let n,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=f(nt),u=f(Vt);let d=new Map,v=new Set,h=!1,m=null,y=[],b=[],_=[],w=[];const x=o.div_id||o.id;let k;x?(null==l?void 0:l.fakeElement)||(u.registerInstance(x,{async setState(t){if(k===t)return;c.setRunning("stateChange",!0),new Set(v),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],w.forEach((t=>{d.set(t.id,t.node.getBoundingClientRect())})),b=[],_=[],w=[];const e=n.find((e=>e.state_id===t))||null;e?(k=t,E=e):c.logError(ot(new Error("Cannot find state with id"),{additional:{stateId:t}})),await $()},getChild(t){if(m&&m.has(t))return m.get(t);c.logError(ot(new Error("Missing state block with id"),{additional:{id:t}}))}}),g(Vt,{registerInstance(t,e){m||(m=new Map),m.has(t)?c.logError(ot(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return b.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,i){const n={json:t,templateContext:e,transitions:r,node:i};return _.push(n),new Promise((t=>{n.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,i){const n=t.id;if(!n)return Promise.resolve();const o={id:n,json:t,templateContext:e,transitions:r,node:i};return w.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&d.has(t),registerChild(t){v.add(t)},unregisterChild(t){v.delete(t)}})):(h=!0,c.logError(ot(new Error('Missing "id" prop for div "state"'))));let E=null;const C=c.getJsonWithVars(o.default_state_id);let F=!1;return p((()=>{x&&!(null==l?void 0:l.fakeElement)&&u.unregisterInstance(x)})),void 0===e.json&&r.json&&void 0!==o&&r.json(o),void 0===e.templateContext&&r.templateContext&&void 0!==a&&r.templateContext(a),void 0===e.origJson&&r.origJson&&void 0!==s&&r.origJson(s),void 0===e.layoutParams&&r.layoutParams&&void 0!==l&&r.layoutParams(l),o&&(v=new Set),n=o.states||[],(null==n?void 0:n.length)?h=!1:(h=!0,c.logError(ot(new Error('Empty "states" prop for div "state"')))),function(t){F||(F=!0,t.length&&(C?(k=C,E=t.find((t=>t.state_id===k))||null,E||c.logError(ot(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(n),h?"":`${z(Qt,"Outer").$$render(t,{cls:"divkit-b8efc",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${z(zr,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""} <div${B("class","divkit-adaae",0)} aria-hidden="true"${B("this",undefined,0)}>${M(y,(e=>"direction"in e?`<div${B("class",He,0)}${L({left:`${e.offsetLeft}px`,top:`${e.offsetTop}px`,width:`${e.width}px`,height:`${e.height}px`})}><div${B("class",qe,0)}>${z(zr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`:`<div${B("class",He,0)}><div${B("class",qe,0)}>${z(zr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div> </div>`))}</div>`}})} ${null!=l&&l.tooltips?`${M(null==l?void 0:l.tooltips,(e=>`${z(Ye,"TooltipView").$$render(t,{ownerNode:e.ownerNode,data:e.desc,internalId:e.internalId,templateContext:a},{},{})}`))}`:""}`})),Ke={pager:"divkit-c5feb",pager__items:"divkit-f6987",pager__item:"divkit-feca7",pager_orientation_horizontal:"divkit-b0a1c",pager_orientation_vertical:"divkit-f772f"},Qe=R(((t,e,r,i)=>{let n,a,s,u,d,v,g,h,m,y,b,_,w,$,x,k,E,C=o,F=o,A=o,V=o,D=o,j=o;var P,O,I,T,N,J,R;let{json:U={}}=e,{templateContext:L}=e,{origJson:W}=e,{layoutParams:H}=e;const q=f(nt),G=q.genId("pager");let Z,Y=!1,X=!1,K=0,Q=0,tt=!1,et="horizontal",it="",at="",st="";function dt(t,e="smooth"){const r="horizontal"===et,i=Z.children[t],n=r?"offsetLeft":"offsetTop",o=r?"left":"top";Z.scroll({[o]:i[n],behavior:e}),K=t}Je((function(){if(!Y)return;const t=function(){const t=Array.from(Z.children),e=Z.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,i=t.getBoundingClientRect(),"horizontal"===et?i.left>=r.left&&i.right<=r.right:i.top>=r.top&&i.bottom<=r.bottom;var r,i}));return-1!==r?r:K}();t!==K&&(K=t)}),50),U.id&&!(null==H?void 0:H.fakeElement)&&q.registerInstance(U.id,{setCurrentItem(t){if(t<0||t>n.length-1)throw new Error('Item is out of range in "set-current-item" action');dt(t)},setPreviousItem(t){let e=K-1;e<0&&(e="ring"===t?n.length-1:K),dt(e)},setNextItem(t){let e=K+1;e>n.length-1&&(e="ring"===t?0:K),dt(e)}}),p((()=>{Y=!1,U.id&&!(null==H?void 0:H.fakeElement)&&q.unregisterInstance(U.id)})),void 0===e.json&&r.json&&void 0!==U&&r.json(U),void 0===e.templateContext&&r.templateContext&&void 0!==L&&r.templateContext(L),void 0===e.origJson&&r.origJson&&void 0!==W&&r.origJson(W),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),(null===(P=U.items)||void 0===P?void 0:P.length)&&Array.isArray(U.items)?X=!1:(X=!0,q.logError(ot(new Error('Incorrect or empty "items" prop for div "pager"')))),n=(!X&&U.items||[]).map((t=>{let e=t,r=L;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),a=q.getDerivedFromVars(U.layout_mode),F(),F=l(a,(t=>w=t)),w?"percentage"!==w.type&&"fixed"!==w.type?(tt=!0,q.logError(ot(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):tt=!1:(tt=!0,q.logError(ot(new Error('Empty "layout_mode" prop for div "pager"')))),s=q.getDerivedFromVars(U.orientation),D(),D=l(s,(t=>k=t)),et=Fe(k,et),u=q.getDerivedFromVars(U.item_spacing),V(),V=l(u,(t=>x=t));{const t=null==x?void 0:x.value;t&&Pt(t)&&(it=ct(t||0))}if(d=q.getDerivedFromVars(U.paddings),A(),A=l(d,(t=>$=t)),at=St($,at),v=q.getDerivedFromVars(U.restrict_parent_scroll),j(),j=l(v,(t=>E=t)),g="horizontal"===et?"grid-auto-columns":"grid-auto-rows","fixed"===(null==w?void 0:w.type)){const t=ut("horizontal"===et?((null===(O=U.paddings)||void 0===O?void 0:O.left)||0)+((null===(I=U.paddings)||void 0===I?void 0:I.right)||0):((null===(T=U.paddings)||void 0===T?void 0:T.top)||0)+((null===(N=U.paddings)||void 0===N?void 0:N.bottom)||0)),e=null===(J=w.neighbour_page_width)||void 0===J?void 0:J.value;st=e?`calc(100% + ${t} - 2 * ${ut(e)} - 2 * ${it})`:"100%"}else if("percentage"===(null==w?void 0:w.type)){const t=null===(R=w.page_width)||void 0===R?void 0:R.value;st=`${Number(t)}%`}return h={"grid-gap":it,padding:at,[g]:st},m={orientation:et},y=X||tt,b=q.getStore("pagers"),C(),C=l(b,(t=>_=t)),function(t,e){const r=U.id;if(r){const i=new Map(_);c(b,_=i.set(r,{instId:G,size:t,currentItem:e,scrollToPagerItem:dt}),_)}}(n.length,K),function(t){var e;if(t===Q)return;Q=t;const r=q.getJsonWithVars(null===(e=n[t].json)||void 0===e?void 0:e.selected_actions);(null==r?void 0:r.length)&&q.execAnyActions(r)}(K),C(),F(),A(),V(),D(),j(),y?"":`${z(Qt,"Outer").$$render(t,{cls:At("pager",Ke,m),json:U,origJson:W,templateContext:L,layoutParams:H,customPaddings:!0,parentOf:U.items,replaceItems:function(t){U=Object.assign(Object.assign({},U),{items:t})}},{},{default:()=>`<div class="${S(Ke.pager__items,!0)+" "+S(E?rt:"",!0)}"${B("style",lt(h),0)}${B("this",Z,0)}>${M(n,(e=>`<div${B("class",Ke.pager__item,0)}>${z(zr,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=H&&H.fakeElement?{fakeElement:!0}:void 0},{},{})} </div>`))}</div>`})}`})),tr=Qe,er={indicator:"divkit-d8e3f",indicator__scroller:"divkit-b5db0",indicator__items:"divkit-d5d94",indicator__item:"divkit-f6629",indicator_placement_default:"divkit-c1670",indicator__item_active:"divkit-b39cd",indicator_placement_stretch:"divkit-b6bd3"},rr=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,p,g,h,m,y,b,_,w,x,k,E,C,F=o,A=o,V=o,D=o,j=o,P=o,O=o,I=o,T=o;var N,J;let{json:R={}}=e,{templateContext:U}=e,{origJson:W}=e,{layoutParams:H}=e;const q=["rounded_rectangle","circle"],G=f(nt);let Z,Y,X,Q={width:13,height:13,borderRadius:6.5,background:"#ffdc60"},tt={width:10,height:10,borderRadius:5,background:"#33919cb5"},et="default",rt=15,it=10,ot=5;if(void 0===e.json&&r.json&&void 0!==R&&r.json(R),void 0===e.templateContext&&r.templateContext&&void 0!==U&&r.templateContext(U),void 0===e.origJson&&r.origJson&&void 0!==W&&r.origJson(W),void 0===e.layoutParams&&r.layoutParams&&void 0!==H&&r.layoutParams(H),n=G.getDerivedFromVars(R.shape),P(),P=l(n,(t=>x=t)),a=G.getDerivedFromVars(R.active_item_color),D(),D=l(a,(t=>_=t)),s=G.getDerivedFromVars(R.inactive_item_color),j(),j=l(s,(t=>w=t)),c=G.getDerivedFromVars(R.active_item_size),O(),O=l(c,(t=>k=t)),u=G.getDerivedFromVars(R.active_shape),T(),T=l(u,(t=>C=t)),d=G.getDerivedFromVars(R.inactive_shape),I(),I=l(d,(t=>E=t)),C&&(Q=he({type:"shape_drawable",shape:C},q,Q)),E&&(tt=he({type:"shape_drawable",shape:E},q,tt)),!C&&!E&&x){const t=ee(k,1.3);tt=he({type:"shape_drawable",shape:x,color:tt.background},q,tt),tt.background=vt(w,1,tt.background),Q=Object.assign(Object.assign({},tt),{width:tt.width*t,height:tt.height*t,borderRadius:tt.borderRadius*t,background:Q.background}),Q.background=vt(_,1,Q.background)}if(v=G.getDerivedFromVars(R.space_between_centers),A(),A=l(v,(t=>y=t)),p=G.getDerivedFromVars(R.items_placement),V(),V=l(p,(t=>b=t)),!b||"default"!==b.type&&"stretch"!==b.type)et="default",y&&(rt=Ot(y.value,rt));else if(et=b.type,"default"===et)rt=Ot(null===(N=b.space_between_centers)||void 0===N?void 0:N.value,rt);else if("stretch"===et){const t=b;it=ee(t.max_visible_items,it),ot=Ot(null===(J=t.item_spacing)||void 0===J?void 0:J.value,ot)}return g=G.getStore("pagers"),F(),F=l(g,(t=>m=t)),async function(t){if(R.pager_id&&t.has(R.pager_id)&&(X=t.get(R.pager_id),await $(),Y)){const t=Y.children[X.currentItem].offsetLeft;Z.scroll({left:t-Z.clientWidth/2,behavior:"smooth"})}}(m),h={placement:et},F(),A(),V(),D(),j(),P(),O(),I(),T(),`${z(Qt,"Outer").$$render(t,{cls:At("indicator",er,h),json:R,origJson:W,templateContext:U,layoutParams:H},{},{default:()=>`<div${B("class",er.indicator__scroller,0)}${B("this",Z,0)}><div${B("class",er.indicator__items,0)} role="tablist"${L({margin:"default"===et?`0 ${ct(Math.max(0,Q.width-tt.width)/2)}`:"","--divkit-indicator-inactive-width":ct(tt.width),"--divkit-indicator-inactive-height":ct(tt.height),"--divkit-indicator-inactive-border-radius":ct(tt.borderRadius),"--divkit-indicator-inactive-background":tt.background||"","--divkit-indicator-inactive-box-shadow":tt.boxShadow||"","--divkit-indicator-active-width":ct(Q.width),"--divkit-indicator-active-height":ct(Q.height),"--divkit-indicator-active-border-radius":ct(Q.borderRadius),"--divkit-indicator-active-background":Q.background||"","--divkit-indicator-active-box-shadow":Q.boxShadow||"","--divkit-indicator-active-scale":Q.width/tt.width,"--divkit-indicator-default-margin":"default"===et?`0 ${ct((rt-tt.width)/2)}`:"","--divkit-indicator-stretch-margin":"stretch"===et?ct(ot):"","--divkit-indicator-stretch-max-count":"stretch"===et?it:"","--divkit-indicator-stretch-max-spacer":"stretch"===et?ct((it-1)*ot):""})}${B("this",Y,0)}>${X?`${M(Array(X.size),((t,e)=>{let r=e===X.currentItem;return` <div class="${S(At("indicator__item",er,{active:r}),!0)+" "+S(K,!0)}" role="tab" id="${S(X.instId,!0)+"-tab-"+S(e,!0)}" aria-controls="${S(X.instId,!0)+"-panel-"+S(e,!0)}"${B("aria-selected",r?"true":"false",0)}${B("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),ir=rr,nr={slider:"divkit-ef4f7",slider__input:"divkit-d1d65",slider__input_secondary:"divkit-c7980",slider__thumb:"divkit-f3453",slider__thumb_secondary:"divkit-e1984","slider__tracks-wrapper":"divkit-f7338","slider__tracks-inner":"divkit-ac903",slider__track:"divkit-e956c","slider__active-track":"divkit-ec5bf","slider__thumb-text":"divkit-c4af5","slider__thumb-text_secondary":"divkit-d8821",slider__tick:"divkit-bd9bf",slider__tick_active:"divkit-d8ce2",slider__tick_inactive:"divkit-e71e7"};function or(t,e){if(!t||!t.font_size)return e;const r=t.offset,i=t.text_color&&vt(t.text_color)||"#000",n=re(t.font_weight);if(Gt(t.font_size)&&"transparent"!==i){var o,a;const e={fontSize:ct(t.font_size),fontWeight:n,textColor:i};return"number"==typeof(null==r||null===(o=r.x)||void 0===o?void 0:o.value)&&"number"==typeof(null==r||null===(a=r.y)||void 0===a?void 0:a.value)&&(e.offset={x:r.x.value,y:r.y.value}),e}}function ar(t,e,r){return Math.max(e,Math.min(r,Number(t)))}const sr="function"==typeof BigInt;function lr(t){return sr?BigInt(t):Number(t)}const cr=lr("9223372036854775807"),ur=lr("-9223372036854775808");function dr(t){const e=lr(t);if(e>cr||e<ur)throw new Error("Integer overflow.");return e}const vr=dr(0);function pr(t){let e=t;return e<0&&(e=-e),e}function gr(t){let e=0;return t>0?e=1:t<0&&(e=-1),dr(e)}class fr{constructor(t,e){const r=this.convertValue(e);this.name=t,this.value=r}getName(){return this.name}subscribe(t){return this.store||(this.store=Y(this.value)),this.store.subscribe(t)}set(t){const e=this.fromString(t);this.setValue(e)}setValue(t){const e=this.convertValue(t);this.value=e,this.store&&this.store.set(e)}getValue(){return this.value}}const hr={string:class extends fr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends fr{convertValue(t){if("number"!=typeof t||isNaN(t)||!isFinite(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"number"}},integer:class extends fr{convertValue(t){if("bigint"!=typeof t&&"number"!=typeof t||"number"==typeof t&&(isNaN(t)||t!==Math.round(t))||t>cr||t<ur)throw new Error("Incorrect variable value");return dr(t)}fromString(t){const e=dr(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends fr{convertValue(t){if(1!==t&&0!==t&&!0!==t&&!1!==t)throw new Error("Incorrect variable value");return Number(t)}fromString(t){if("1"===t||"true"===t)return 1;if("0"===t||"false"===t)return 0;throw new Error("Incorrect variable value")}getType(){return"boolean"}},color:class extends fr{convertValue(t){if("string"!=typeof t||!pt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends fr{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}},dict:class extends fr{convertValue(t){if("object"!=typeof t||!t)throw new Error("Incorrect variable value");return t}fromString(t){throw new Error("Dict variable does not support setter from string")}getType(){return"dict"}}};function mr(t,e,r){if(!(e in hr))throw new Error("Unsupported variable type");return new hr[e](t,r)}function yr(t,e,r,i,n){let o=[];if(n)for(let n=t;n<e;++n)o.push((n-r)/(i-r));else{for(let e=r;e<t;++e)o.push((e-r)/(i-r));for(let t=e;t<i+1;++t)o.push((t-r)/(i-r))}return o}const br=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,p,g,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,O,I,T,N,J,R,U,W,H,q,G=o,Z=o,Y=o,X=o,K=o,Q=o,tt=o,et=o,rt=o,it=o,at=o,st=o;var lt,dt,vt,pt;let{json:gt={}}=e,{templateContext:ft}=e,{origJson:ht}=e,{layoutParams:mt}=e;const yt={width:10,height:10,borderRadius:5,background:"#000"},bt=["rounded_rectangle","circle"],_t=["rounded_rectangle"],wt=f(nt),$t=f(Lt);let xt,kt=0,Et=100;const Ct=gt.thumb_value_variable,Ft=gt.thumb_secondary_value_variable;W=l(Ct&&wt.getVariable(Ct,"integer")||mr("temp","integer",0),(t=>U=t)),R=l(Ft&&wt.getVariable(Ft,"integer")||mr("temp","integer",0),(t=>J=t));let Vt,Dt,jt,St=ar(U||0,kt,Et),Ot=ar(J||0,kt,Et),It=yt,Mt=It,Tt=yt,zt=yt,Jt=null,Rt=null,Bt=jt,Ut="",Wt="",Ht=!1,qt=!1;function Gt(){if(!xt)return;const t=Et-kt,e=(null==Jt?void 0:Jt.width)||0,r=(null==Rt?void 0:Rt.width)||0;Math.max(e,r)*t>=(null==xt?void 0:xt.clientWidth)?qt||(wt.logError(ot(new Error("Slider ticks overlap each other"),{level:"warn"})),qt=!0):qt=!1}Je(Gt,50),void 0===e.json&&r.json&&void 0!==gt&&r.json(gt),void 0===e.templateContext&&r.templateContext&&void 0!==ft&&r.templateContext(ft),void 0===e.origJson&&r.origJson&&void 0!==ht&&r.origJson(ht),void 0===e.layoutParams&&r.layoutParams&&void 0!==mt&&r.layoutParams(mt),n=wt.getDerivedFromVars(gt.min_value),st(),st=l(n,(t=>q=t)),a=wt.getDerivedFromVars(gt.max_value),at(),at=l(a,(t=>H=t)),kt=Nt(q,kt),Et=Nt(H,Et),Gt();{const t=ar(U||0,kt,Et);t!==St&&(St=t)}{const t=ar(J||0,kt,Et);t!==Ot&&(Ot=t)}s=wt.getDerivedFromVars(gt.thumb_style),it(),it=l(s,(t=>N=t)),It=he(N,bt,It),c=wt.getDerivedFromVars(gt.thumb_secondary_style),rt(),rt=l(c,(t=>T=t)),Mt=he(T,bt,It),u=wt.getDerivedFromVars(gt.track_inactive_style),et(),et=l(u,(t=>I=t)),Tt=he(I,_t,Tt),d=wt.getDerivedFromVars(gt.track_active_style),tt(),tt=l(d,(t=>O=t)),zt=he(O,_t,zt),v=wt.getDerivedFromVars(gt.tick_mark_active_style),Q(),Q=l(v,(t=>P=t));{let t=he(P,bt,yt);t!==yt&&(Jt=t)}Jt?(Vt=Ft?yr(Math.min(St,Ot),Math.max(St,Ot)+1,kt,Et,!0):yr(kt,St,kt,Et,!0),Gt()):Vt=[],p=wt.getDerivedFromVars(gt.tick_mark_inactive_style),K(),K=l(p,(t=>j=t));{let t=he(j,bt,yt);t!==yt&&(Rt=t)}Rt?(Dt=Ft?yr(Math.min(St,Ot),Math.max(St,Ot)+1,kt,Et,!1):yr(St+1,Et+1,kt,Et,!0),Gt()):Dt=[],g=wt.getDerivedFromVars(gt.thumb_text_style),X(),X=l(g,(t=>D=t)),jt=or(D,jt),h=wt.getDerivedFromVars(gt.thumb_secondary_text_style),Y(),Y=l(h,(t=>V=t)),Bt=or(V,jt),m=wt.getDerivedFromVars(gt.accessibility),Z(),Z=l(m,(t=>A=t)),(null==A?void 0:A.description)?Ut=A.description:wt.logError(ot(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=wt.getDerivedFromVars(gt.secondary_value_accessibility),G(),G=l(y,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Ft&&wt.logError(ot(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;$t.hasAction()?(wt.logError(ot(new Error('Cannot show "slider" inside component with action'))),t=!0):It===yt?(wt.logError(ot(new Error('Missing "thumb_style" in slider'))),t=!0):zt===yt?(wt.logError(ot(new Error('Missing "track_active_style" in slider'))),t=!0):Tt===yt&&(wt.logError(ot(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Ht&&(Ht=t)}return b=ct(Math.max(...[It.width,Mt.width,0].filter(Pt))),_=ct(Math.max(...[It.height,Mt.height,0].filter(Pt))),w=(St-kt)/(Et-kt),$=Ft?(Ot-kt)/(Et-kt):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":ct(It.width),"--divkit-slider-thumb-height":ct(It.height),"--divkit-slider-thumb-secondary-width":ct(Mt.width),"--divkit-slider-thumb-secondary-height":ct(Mt.height),"--divkit-slider-text-offset-x":(null===(lt=null==jt?void 0:jt.offset)||void 0===lt?void 0:lt.x)?ut(jt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(dt=null==jt?void 0:jt.offset)||void 0===dt?void 0:dt.y)?ut(jt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===(vt=null==Bt?void 0:Bt.offset)||void 0===vt?void 0:vt.x)?ut(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(pt=null==Bt?void 0:Bt.offset)||void 0===pt?void 0:pt.y)?ut(Bt.offset.y):void 0,"--divkit-slider-tick-active-width":Jt?ct(Jt.width):void 0,"--divkit-slider-tick-active-height":Jt?ct(Jt.height):void 0,"--divkit-slider-tick-active-border-radius":Jt?ct(Jt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Jt?void 0:Jt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Jt?void 0:Jt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Rt?ct(Rt.width):void 0,"--divkit-slider-tick-inactive-height":Rt?ct(Rt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Rt?ct(Rt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Rt?void 0:Rt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Rt?void 0:Rt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":b,"--divkit-slider-max-thumb-height":_,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},G(),Z(),Y(),X(),K(),Q(),tt(),et(),rt(),it(),R(),W(),at(),st()," "+(Ht?"":`${z(Qt,"Outer").$$render(t,{cls:At("slider",nr,C),style:E,customDescription:!0,customActions:"slider",json:gt,origJson:ht,templateContext:ft,layoutParams:mt},{},{default:()=>{var t,e,r,i,n,o;return`<div${B("class",nr["slider__tracks-wrapper"],0)}><div${B("class",nr["slider__tracks-inner"],0)}${B("this",xt,0)}><div${B("class",nr.slider__track,0)}${L({height:ct(Tt.height),"border-radius":ct(Tt.borderRadius),background:Tt.background,"box-shadow":Tt.boxShadow||""})}></div> <div${B("class",nr["slider__active-track"],0)}${L({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:ct(zt.height),"border-radius":ct(zt.borderRadius),background:zt.background,"box-shadow":zt.boxShadow||""})}></div> ${M(Vt,(t=>`<div class="${S(nr.slider__tick,!0)+" "+S(nr.slider__tick_active,!0)}"${L({"--divkit-slider-tick":t})}></div>`))} ${M(Dt,(t=>`<div class="${S(nr.slider__tick,!0)+" "+S(nr.slider__tick_inactive,!0)}"${L({"--divkit-slider-tick":t})}></div>`))} <div${B("class",nr.slider__thumb,0)}${L({"border-radius":ct(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${jt?`<div${B("class",nr["slider__thumb-text"],0)}><div${B("class",nr["slider__thumb-text-inner"],0)}${L({"font-size":(null===(t=jt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=jt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=jt)||void 0===r?void 0:r.textColor)||"#000"})}>${S(St)}</div></div>`:""}</div> ${Ft?`<div class="${S(nr.slider__thumb,!0)+" "+S(nr.slider__thumb_secondary,!0)}"${L({"border-radius":ct(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Bt?`<div class="${S(nr["slider__thumb-text"],!0)+" "+S(nr["slider__thumb-text_secondary"],!0)}"><div${B("class",nr["slider__thumb-text-inner"],0)}${L({"font-size":(null===(i=Bt)||void 0===i?void 0:i.fontSize)||"1em","font-weight":(null===(n=Bt)||void 0===n?void 0:n.fontWeight)||"",color:(null===(o=Bt)||void 0===o?void 0:o.textColor)||"#000"})}>${S(Ot)}</div></div>`:""}</div>`:""} <input type="range"${B("class",nr.slider__input,0)}${B("min",kt,0)}${B("max",Et,0)} step="1"${B("value",St,0)}${B("aria-label",Ut,0)}> ${Ft?`<input type="range"${B("class",`${nr.slider__input} ${nr.slider__input_secondary}`,0)}${B("min",kt,0)}${B("max",Et,0)} step="1"${B("value",Ot,0)}${B("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),_r={input:"divkit-c3a4c","input_alignment-horizontal_center":"divkit-fc52a","input_alignment-horizontal_right":"divkit-e8038",input__input:"divkit-f11e0",input__placeholder:"divkit-b7593","input_alignment-vertical_top":"divkit-bdccd","input_alignment-vertical_bottom":"divkit-fc670","input_alignment-vertical_baseline":"divkit-dd6af","input_highlight-color":"divkit-cc00f",input__input_singleline:"divkit-ffd1e","input__scroll-wrapper":"divkit-ad8a3",input__input_multiline:"divkit-f61f0","input__input_has-custom-focus":"divkit-e6b50"};function wr(t,e){if(t===e)return{start:t.length,added:0,removed:0};if(t.length>e.length){const r=wr(e,t);return{start:r.start,added:r.removed,removed:r.added}}let r=0,i=e.length-1;const n=e.length-t.length;for(;r<i&&r<t.length&&t[r]===e[r];)++r;for(;i-n>=r&&t[i-n]===e[i];)--i;return++i,{start:r,added:i-r,removed:i-r-n}}function $r(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class xr{constructor(t){this.char=t}}class kr{constructor(t,e,r){this.char=t,this.filter=e,this.placeholder=r}}class Er{constructor(t){$r(this,"filters",new Map),$r(this,"destructedValue",[]),$r(this,"cursorPos",0),this.maskData=t,this.updateMaskData(t)}get cursorPosition(){return this.cursorPos}get rawValue(){return this.collectValueRange(0,this.destructedValue.length-1)}get value(){let t="";for(let e=0;e<this.destructedValue.length;++e){const r=this.destructedValue[e];if(r instanceof xr)t+=r.char;else if(r instanceof kr)if(r.char)t+=r.char;else{if(!this.maskData.alwaysVisible)break;t+=r.placeholder}}return t}firstEmptyHolderIndex(){const t=this.destructedValue.findIndex((t=>t instanceof kr&&!t.char));return-1!==t?t:this.destructedValue.length}updateMaskData(t,e=!0){const r=this.maskData!==t&&e?this.rawValue:null;this.filters=new Map,this.maskData=t,this.maskData.decoding.forEach((t=>{if(t.filter)try{const e=new RegExp(t.filter);this.filters.set(t.key,e)}catch(e){this.onException(ot(e,{level:"error",additional:{key:t.key}}))}})),this.destructedValue=this.maskData.pattern.split("").map((t=>{const e=this.maskData.decoding.find((e=>e.key===t));return e?new kr(null,this.filters.get(e.key),e.placeholder):new xr(t)})),null!==r&&this.overrideRawValue(r)}overrideRawValue(t){this.clearRange(0,this.destructedValue.length),this.replaceChars(t,0),this.cursorPos=Math.min(this.cursorPos,this.value.length)}applyChangeFrom(t,e){const r=wr(this.value,t);void 0!==e&&(r.start=Math.max(0,e-r.added));const i=this.buildBodySubstring(r,t),n=this.buildTailSubstring(r);this.cleanup(r);const o=this.firstEmptyHolderIndex(),a=this.calculateMaxShift(n,o);this.replaceChars(i,o,a);const s=this.firstEmptyHolderIndex();this.replaceChars(n,s),this.calculateCursorPosition(r,s)}buildBodySubstring(t,e){return e.substring(t.start,t.start+t.added)}buildTailSubstring(t){return this.collectValueRange(t.start+t.removed,this.destructedValue.length-1)}calculateMaxShift(t,e){if(this.filters.size<=1){let r=0,i=e;for(;i<this.destructedValue.length;)this.destructedValue[i]instanceof kr&&++r,++i;return Math.max(0,r-t.length)}const r=this.calculateInsertableSubstring(t,e);let i=0;for(;i<this.destructedValue.length&&r===this.calculateInsertableSubstring(t,e+i);)++i;return Math.max(0,i-1)}cleanup(t){if(0===t.added&&1===t.removed){let e=t.start;for(;e>=0;){const t=this.destructedValue[e];if(t instanceof kr&&null!==t.char){t.char=null;break}--e}}this.clearRange(t.start,this.destructedValue.length)}clearRange(t,e){let r=t;for(;r<e&&r<this.destructedValue.length;){const t=this.destructedValue[r];t instanceof kr&&(t.char=null),++r}}calculateCursorPosition(t,e){const r=this.firstEmptyHolderIndex();let i;i=t.start<r?Math.min(this.firstHolderAfter(e),this.value.length):r,this.cursorPos=i}calculateInsertableSubstring(t,e){let r="",i=e;const n=()=>{for(var t;i<this.destructedValue.length&&!(this.destructedValue[i]instanceof kr);)++i;return null===(t=this.destructedValue[i])||void 0===t?void 0:t.filter};return t.split("").forEach((t=>{const e=n();null!=e&&e.test(t)&&(r+=t,++i)})),r}collectValueRange(t,e){let r="",i=t;for(;i<=e;){const t=this.destructedValue[i];t instanceof kr&&null!==t.char&&(r+=t.char),++i}return r}replaceChars(t,e,r){let i=this.calculateInsertableSubstring(t,e);void 0!==r&&(i=i.substring(0,r));let n=e,o=0;for(;n<this.destructedValue.length&&o<i.length;){const t=this.destructedValue[n],e=i[o];t instanceof kr&&(t.char=e,++o),++n}}firstHolderAfter(t){let e=t;for(;e<this.destructedValue.length&&!(this.destructedValue[e]instanceof kr);)++e;return e}}class Cr extends Er{constructor(t,e){super(t),this.logError=e}onException(t){this.logError(t)}}function Fr(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class Ar extends Er{constructor(t=void 0,e){super({pattern:"",decoding:[],alwaysVisible:!1}),Fr(this,"currencyFormatter",new Intl.NumberFormat),Fr(this,"decimalSeparator","."),Fr(this,"localeDigits",{}),Fr(this,"trimZeroRegExp",new RegExp("")),this.logError=e,this.initFormatter(t)}updateCurrencyParams(t){const e=this.parseFormat(this.rawValue)||0;this.initFormatter(t);const r=e.toString().replace(".",this.decimalSeparator);this.applyChangeFrom(r)}initFormatter(t){try{this.currencyFormatter=new Intl.NumberFormat(t,{minimumFractionDigits:2,maximumFractionDigits:2}),this.decimalSeparator=this.currencyFormatter.format(0)[1],this.localeDigits=new Array(10).fill("").reduce(((t,e,r)=>(t[r]=this.currencyFormatter.format(r)[0],t)),{}),this.trimZeroRegExp=new RegExp(`^${this.localeDigits[0]}+`)}catch(e){this.onException(ot(e,{level:"error",additional:{locale:t}}))}}invalidateMaskDataForFormatted(t){const e=this.currencyFormatter.format(t),r=this.formatPattern(e),i=[{key:"#",filter:`[${[...Object.values(this.localeDigits)].join("")}]`,placeholder:this.localeDigits[0]},{key:this.decimalSeparator,filter:`[${this.decimalSeparator}]`,placeholder:this.decimalSeparator}];this.updateMaskData({pattern:r,decoding:i,alwaysVisible:this.maskData.alwaysVisible},!1)}overrideRawValue(t){const e=this.parseFormat(t)||0;this.invalidateMaskDataForFormatted(e),super.overrideRawValue(t)}applyChangeFrom(t,e){const r=wr(this.value,t),i=this.value.lastIndexOf(this.decimalSeparator),n=t.lastIndexOf(this.decimalSeparator),o=i!==n||-1===i&&-1===n,a=this.validFormat(t,r);this.cleanup(r);const s=this.parseFormat(a)||0;o&&this.invalidateMaskDataForFormatted(s),this.replaceChars(a,0),this.value.length>r.start&&!this.isDigit(this.value[r.start])?this.cursorPos=null!=e?e:this.cursorPosition:this.cursorPos=Math.abs(this.value.length-(t.length-(null!=e?e:this.cursorPosition)))}parseFormat(t){return parseFloat(t.replace(/./g,(t=>this.localeDigits[t]||(t===this.decimalSeparator?".":""))))}formatPattern(t){let e="";for(const r of t)e+=this.isDigit(r)?"#":r;return e}validFormat(t,e){if(!t)return"";let r=-1,i=0;for(;i<t.length;){if(t[i]===this.decimalSeparator&&!this.inDiff(e,i)){r=i;break}i++}let n=-1;1===e.added&&0===e.removed&&[",","."].includes(t[e.start])&&(n=e.start);const o=this.currencyFormatter.resolvedOptions().maximumFractionDigits;let a=o;if(-1!==r)for(i=r;i<t.length;)this.isDigit(t[i])&&!this.inDiff(e,i)&&a--,i++;else{let r=!1;for(let i=0;i<t.length;i++){const n=t[i];n===this.decimalSeparator?r=!0:!this.inDiff(e,i)&&r&&this.isDigit(n)&&a--}}const s=t.includes(this.decimalSeparator)||-1!==n,l=[];i=t.length-1;let c=!1;for(;i>=0;){const u=t[i],d=l.length<=o;this.isDigit(u)?this.inDiff(e,i)&&!c&&s?a>0&&(l.push(u),a--):l.push(u):d&&-1===r&&i===n?(l.push(this.decimalSeparator),c=!0):!d||u!==this.decimalSeparator||r!==i&&-1!==r||(l.push(this.decimalSeparator),c=!0,r=i),i--}return l.reverse().join("").replace(this.trimZeroRegExp,"")}inDiff(t,e){return t.start<=e&&e<t.start+t.added}isDigit(t){return Boolean(this.localeDigits[t])}onException(t){this.logError(t)}}function Vr(t){const e=t.textContent;let r=0;return"string"==typeof e&&(r+=e.length,t instanceof HTMLElement&&("DIV"===t.tagName||"BR"===t.tagName)&&++r),r}function Dr(t,e){if(3!==t.nodeType)if(t instanceof HTMLElement&&"BR"===t.tagName)try{const e=window.getSelection();if(e){e.removeAllRanges();const r=document.createRange(),i=t.parentNode,n=Array.from(i.childNodes).indexOf(t)+1;r.setStart(i,n),r.setEnd(i,n),e.addRange(r)}}catch(t){}else for(let r=0,i=t.childNodes.length;r<i;++r){const i=t.childNodes[r],n=Vr(i);if(e<=n)return void Dr(i,e);e-=n}else try{const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStart(t,e),i.setEnd(t,e),r.addRange(i)}}catch(t){}}const jr=R(((t,e,r,i)=>{let n,a,s,u,d,v,p,g,h,m,y,b,_,w,x,k,E,C,F,A,V,D,j,P,O,I,M,T,N,J,R,U,L,W,H,q,G,Z,Y,X,K,Q,tt,et,rt=o,it=o;var at;let{json:st={}}=e,{templateContext:dt}=e,{origJson:pt}=e,{layoutParams:gt}=e;const ft=f(nt);let ht,mt=null;const yt=st.text_variable,bt=null===(at=st.mask)||void 0===at?void 0:at.raw_text_variable;let _t=!1;yt||(_t=!0,ft.logError(ot(new Error('Missing "text_variable" in "input"'))));let wt=yt&&ft.getVariable(yt,"string")||mr("temp","string","");m=l(wt,(t=>h=t));let $t=bt&&ft.getVariable(bt,"string")||mr("temp","string","");b=l($t,(t=>y=t));let xt="",kt="";C=l(ft.getDerivedFromVars(st.mask),(t=>E=t)),Q=l(ft.getDerivedFromVars(st.hint_text),(t=>K=t)),X=l(ft.getDerivedFromVars(st.hint_color),(t=>Y=t));let Et="";Z=l(ft.getDerivedFromVars(st.font_size),(t=>G=t));let Ct,Ft=12;q=l(ft.getDerivedFromVars(st.font_weight),(t=>H=t)),W=l(ft.getDerivedFromVars(st.font_family),(t=>L=t));let Vt,Pt="";U=l(ft.getDerivedFromVars(st.line_height),(t=>R=t)),J=l(ft.getDerivedFromVars(st.letter_spacing),(t=>N=t));let St="";T=l(ft.getDerivedFromVars(st.text_color),(t=>M=t));let It="#000";I=l(ft.getDerivedFromVars(st.highlight_color),(t=>O=t));let Mt="";P=l(ft.getDerivedFromVars(st.text_alignment_horizontal),(t=>j=t));let Tt="left";D=l(ft.getDerivedFromVars(st.text_alignment_vertical),(t=>V=t));let zt="center";A=l(ft.getDerivedFromVars(st.keyboard_type),(t=>F=t));const Nt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let Jt="multi_line_text",Bt="text";const Ut=document&&"inputMode"in document.createElement("input");let Lt;k=l(ft.getDerivedFromVars(st.max_visible_lines),(t=>x=t));let Wt="",Ht=null,qt="",Zt="",Yt="";function Xt(t){ht instanceof HTMLInputElement?ht.selectionStart=ht.selectionEnd=t:Dr(ht,t)}async function Kt(){if(!ht||!mt)return;mt.overrideRawValue(y),$t.set(mt.rawValue),c(wt,h=xt=kt=mt.value,h);const t=mt.cursorPosition;await $(),document.activeElement===ht&&Xt(t)}var te;et=l(ft.getDerivedFromVars(st.select_all_on_focus),(t=>tt=t)),void 0===e.json&&r.json&&void 0!==st&&r.json(st),void 0===e.templateContext&&r.templateContext&&void 0!==dt&&r.templateContext(dt),void 0===e.origJson&&r.origJson&&void 0!==pt&&r.origJson(pt),void 0===e.layoutParams&&r.layoutParams&&void 0!==gt&&r.layoutParams(gt),"fixed_length"===(null==(te=E)?void 0:te.type)?mt=function(t,e,r){if("string"==typeof t.pattern&&Array.isArray(t.pattern_elements)&&t.pattern_elements.every((t=>t.key&&"string"==typeof t.key))){const i={pattern:t.pattern,alwaysVisible:Boolean(t.always_visible),decoding:t.pattern_elements.map((t=>({key:t.key,filter:t.regex&&"string"==typeof t.regex?t.regex:void 0,placeholder:t.placeholder&&"string"==typeof t.placeholder?t.placeholder:"_"})))};return r?(r.updateMaskData(i),r):new Cr(i,e)}return r||null}(te,ft.logError,mt):"currency"===(null==te?void 0:te.type)&&(mt=function(t,e,r){return r?(r.updateCurrencyParams(t.locale),r):new Ar(t.locale,e)}(te,ft.logError,mt)),mt&&Kt(),mt||xt===h||(xt=kt=h),mt&&mt.rawValue!==y&&Kt(),n=K,Et=vt(Y,1,Et),Ft=ee(G,Ft),Ct=ie(H,Ct),Pt=L&&"string"==typeof L?ft.typefaceProvider(L,{fontWeight:Ct||400}):"";{const t=R;Gt(t)&&(Vt=t/Ft)}return jt(N)&&(St=ct(N)),It=vt(M,1,It),Mt=vt(O,1,Mt),Tt=ae(j,Tt),zt=se(V,zt),F&&F in Nt&&(Bt=Nt[F],Jt=F),"currency"===(null==E?void 0:E.type)&&(Bt=Ut?"text":"tel",Lt="decimal"),a="multi_line_text"===Jt,s=ft.getDerivedFromVars(st.paddings),it(),it=l(s,(t=>w=t)),Gt(x)&&(Wt=`calc(${x*(Vt||1.25)*(Ft/10)+"em"} + ${ut(Ot(null==w?void 0:w.top,0)+Ot(null==w?void 0:w.bottom,0))})`),Ht=Rt(w||void 0,Ht),qt=Ht?Dt({top:(Number(Ht.top)||0)/Ft*10,right:(Number(Ht.right)||0)/Ft*10,bottom:(Number(Ht.bottom)||0)/Ft*10,left:(Number(Ht.left)||0)/Ft*10}):"",Zt=Ht?Dt({top:(Number(Ht.top)||0)/Ft*10,bottom:(Number(Ht.bottom)||0)/Ft*10}):"",u=ft.getDerivedFromVars(st.accessibility),rt(),rt=l(u,(t=>_=t)),(null==_?void 0:_.description)?Yt=_.description:ft.logError(ot(new Error('Missing accessibility "description" for input'),{level:"warn"})),d={"highlight-color":Boolean(Mt),multiline:a,"alignment-horizontal":Tt,"alignment-vertical":zt},v={"--divkit-input-hint-color":Et,"--divkit-input-highlight-color":Mt,"--divkit-input-line-height":Vt,"font-weight":Ct,"font-family":Pt,"letter-spacing":St,color:It,"max-height":Wt},p={"font-size":ct(Ft),padding:qt},g={"font-size":ct(Ft),padding:Zt},m(),b(),rt(),it(),k(),C(),A(),D(),P(),I(),T(),J(),U(),W(),q(),Z(),X(),Q(),et(),_t?"":`${z(Qt,"Outer").$$render(t,{cls:At("input",_r,d),style:v,customDescription:!0,customActions:"input",customPaddings:!0,json:st,origJson:pt,templateContext:dt,layoutParams:gt},{},{default:({focusHandler:t,blurHandler:e,hasCustomFocus:r})=>{return a?`<span${B("class",_r["input__scroll-wrapper"],0)}>${!kt&&n?`<div${B("class",_r.input__placeholder,0)} aria-hidden="true"${B("style",lt(p),0)}>${S(n)}</div>`:""} <span aria-hidden="true"${B("style",lt(g),0)}>​</span> <span${B("class",At("input__input",_r,{"has-custom-focus":r,multiline:!0}),0)} autocapitalize="off" contenteditable="true"${B("aria-label",Yt,0)}${B("style",lt(p),0)}${B("this",ht,0)}>${i=kt,void 0===i?"":i}</span></span>`:`<input${B("type",Bt,0)}${B("inputmode",Lt,0)}${B("class",At("input__input",_r,{"has-custom-focus":r,singleline:!0}),0)} autocomplete="off" autocapitalize="off"${B("aria-label",Yt,0)}${B("style",lt(p),0)}${B("placeholder",n,0)}${B("value",xt,0)}${B("this",ht,0)}>`;var i}})}`})),Pr={select:"divkit-feef3","select__select-text":"divkit-cd862",select_hint:"divkit-a3cf6",select__select:"divkit-bdb72","select__select_has-custom-focused":"divkit-a46ad","has-custom-focused":"divkit-fc5dc",select__option:"divkit-e774b"},Sr=R(((t,e,r,i)=>{let n,a,s,c,u,d,v,p,g,h,m,y,b,_,w,$,x,k,E,C,F,A,V,D,j,P,O,I=o,T=o,{json:N={}}=e,{templateContext:J}=e,{origJson:R}=e,{layoutParams:U}=e;const L=f(nt),W=N.value_variable;let H=!1;W||(H=!0,L.logError(ot(new Error('Missing "value_variable" in "select"')))),O=l(W&&L.getVariable(W,"string")||mr("temp","string",""),(t=>P=t));let q="";const G=N.options,Z=Array.isArray(G)&&G.filter((t=>"string"==typeof t.value))||[];Array.isArray(Z)&&Z.length||L.logError(ot(new Error('Empty selection "items" in "select"')));let Y="",X=null,K="";D=l(L.getDerivedFromVars(N.hint_text),(t=>V=t)),A=l(L.getDerivedFromVars(N.hint_color),(t=>F=t));let Q="rgba(0,0,0,.45)";C=l(L.getDerivedFromVars(N.font_size),(t=>E=t));let tt,et=12;k=l(L.getDerivedFromVars(N.font_weight),(t=>x=t)),$=l(L.getDerivedFromVars(N.font_family),(t=>w=t));let rt,it="";_=l(L.getDerivedFromVars(N.line_height),(t=>b=t)),y=l(L.getDerivedFromVars(N.letter_spacing),(t=>m=t));let at="";h=l(L.getDerivedFromVars(N.text_color),(t=>g=t));let st="#000",ut="";void 0===e.json&&r.json&&void 0!==N&&r.json(N),void 0===e.templateContext&&r.templateContext&&void 0!==J&&r.templateContext(J),void 0===e.origJson&&r.origJson&&void 0!==R&&r.origJson(R),void 0===e.layoutParams&&r.layoutParams&&void 0!==U&&r.layoutParams(U),q=P;{const t=Z.find((t=>t.value===P));t?Y="string"==typeof t.text?t.text:t.value:(Y="",P&&L.logError(ot(new Error('Value from the variable was not found in the selection items for "select"'))))}n=L.getDerivedFromVars(N.paddings),T(),T=l(n,(t=>j=t)),et=ee(E,et),X=Rt(j||void 0,X),K=X?Dt({top:(Number(X.top)||0)/et*10,right:(Number(X.right)||0)/et*10,bottom:(Number(X.bottom)||0)/et*10,left:(Number(X.left)||0)/et*10}):"",a=V,Q=vt(F,1,Q),tt=ie(x,tt),it=w&&"string"==typeof w?L.typefaceProvider(w,{fontWeight:tt||400}):"";{const t=b;Gt(t)&&(rt=t/et)}return jt(m)&&(at=ct(m/et*10)),st=vt(g,1,st),s=L.getDerivedFromVars(N.accessibility),I(),I=l(s,(t=>p=t)),(null==p?void 0:p.description)?ut=p.description:L.logError(ot(new Error('Missing accessibility "description" for select'),{level:"warn"})),c={hint:!Y},u={"--divkit-input-hint-color":Q,"font-weight":tt,"font-family":it,color:st},d={padding:K,"font-size":ct(et),"line-height":rt,"letter-spacing":at},v={"font-size":ct(et),"line-height":rt,"letter-spacing":at},I(),h(),y(),_(),$(),k(),C(),A(),D(),T(),O(),H?"":`${z(Qt,"Outer").$$render(t,{cls:At("select",Pr,c),style:u,customDescription:!0,customActions:"select",customPaddings:!0,json:N,origJson:R,templateContext:J,layoutParams:U},{},{default:({hasCustomFocus:t,focusHandler:e,blurHandler:r})=>`<span${B("class",Pr["select__select-text"],0)}${B("style",lt(d),0)} aria-hidden="true"> ${S(Y||a||"​")}</span> <select${B("class",At("select__select",Pr,{"has-custom-focus":t}),0)}${B("aria-label",ut,0)}${B("style",lt(v),0)}>${M(Z,(t=>`<option${B("class",Pr.select__option,0)}${B("value",t.value,0)}>${S(t.text||t.value)}</option>`))}</select>`})}`})),Or={video__video:"divkit-c11f9"},Ir=R(((t,e,r,i)=>{let n,o,a,s,c,u,d,v,g,h,{json:m={}}=e,{templateContext:y}=e,{origJson:b}=e,{layoutParams:_}=e;const w=f(nt);let $=!1,x=!1;h=l(w.getDerivedFromVars(m.video_sources),(t=>g=t));let k=[];v=l(w.getDerivedFromVars(m.repeatable),(t=>d=t));let E=!1;u=l(w.getDerivedFromVars(m.autostart),(t=>c=t));let C=!1;s=l(w.getDerivedFromVars(m.muted),(t=>a=t));let F,A=!1;o=l(w.getDerivedFromVars(m.preview),(t=>n=t));const V=m.elapsed_time_variable;var D,j;return(V&&w.getVariable(V,"integer")||mr("temp","integer",0)).subscribe((t=>{x&&(x=!1)})),!m.id||$||(null==_?void 0:_.fakeElement)||w.registerInstance(m.id,{pause(){},start(){}}),p((()=>{!m.id||$||(null==_?void 0:_.fakeElement)||w.unregisterInstance(m.id)})),void 0===e.json&&r.json&&void 0!==m&&r.json(m),void 0===e.templateContext&&r.templateContext&&void 0!==y&&r.templateContext(y),void 0===e.origJson&&r.origJson&&void 0!==b&&r.origJson(b),void 0===e.layoutParams&&r.layoutParams&&void 0!==_&&r.layoutParams(_),D=g,j=k,k=Array.isArray(D)&&D.length?D.filter((t=>"video_source"===(null==t?void 0:t.type)&&"string"==typeof t.url&&"string"==typeof t.mime_type)).map((t=>{const e={src:t.url};return t.mime_type&&(e.type=t.mime_type),e})):j,k.length?$=!1:($=!0,w.logError(ot(new Error('Missing "video_sources" in "video"')))),E=le(d,E),C=le(c,C),A=le(a,A),F="string"==typeof n?De(n):F,o(),s(),u(),v(),h(),$?"":`${z(Qt,"Outer").$$render(t,{cls:Or.video,customActions:"video",json:m,origJson:b,templateContext:y,layoutParams:_},{},{default:()=>`<video${B("class",Or.video__video,0)} playsinline ${E?"loop":""} ${C?"autoplay":""} ${A?"muted":""}${B("poster",F,0)}${B("this",undefined,0)}>${M(k,(t=>`<source${B("src",t.src,0)}${B("type",t.type,0)}>`))}</video>`})}`})),Mr=Ir,Tr={};Tr.text=de,Tr.container=Ee,Tr.separator=Ae,Tr.image=je,Tr.gif=je,Tr.grid=Te,Tr.gallery=Be,Tr.tabs=We,Tr.state=Xe,Tr.pager=tr,Tr.indicator=ir,Tr.slider=br,Tr.input=jr,Tr.select=Sr,Tr.video=Mr;const zr=R(((t,e,r,i)=>{let{div:n}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=f(nt);let c,u,d;if(void 0===e.div&&r.div&&void 0!==n&&r.div(n),void 0===e.templateContext&&r.templateContext&&void 0!==o&&r.templateContext(o),void 0===e.origJson&&r.origJson&&void 0!==a&&r.origJson(a),void 0===e.layoutParams&&r.layoutParams&&void 0!==s&&r.layoutParams(s),c=n,u=o,d=c&&Tr[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Tr[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(ot(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${z(d||T,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||n},{},{})}`:""})),Nr=R(((t,e,r,i)=>{let{svgFiltersMap:n}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==n&&r.svgFiltersMap(n),Object.keys(n).length?`<svg${B("class","divkit-dc22b",0)} aria-hidden="true"><defs>${M([...Object.keys(n)],(t=>{let[e,r]=t.split(":");return` <filter${B("id",n[t],0)}><feFlood${B("flood-color",e,0)}></feFlood>${"source_in"===r||"source_atop"===r?`<feComposite in2="SourceGraphic"${B("operator",r.split("_")[1],0)}></feComposite>`:"multiply"===r?'<feComposite in2="SourceGraphic" operator="arithmetic" k1="1" k2="0" k3="0" k4="0"></feComposite>':`<feBlend in2="SourceGraphic"${B("mode",r,0)}></feBlend>`}</filter>`}))}</defs></svg>`:""}));function Jr(t,e,r,i){const n=r[t.type];if(!n)return i(ot(new Error("No such template"),{additional:{template:t.type}})),{json:t,templateContext:e};let o;const a={};for(o in e)e.hasOwnProperty(o)&&(a[o]=e[o]);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(a[o]=t[o]);const s=function t(e,r){const i=Object.keys(r).filter((t=>"__proto__"!==t)),n=i.filter((t=>"$"!==t.charAt(0))),o=i.filter((t=>"$"===t.charAt(0)));return n.forEach((i=>{const n=r[i];"object"==typeof n&&null!==n?(e[i]=Array.isArray(n)?[]:{},t(e[i],n)):e[i]=n})),o.forEach((t=>{const i=r[t],n=a[i];if(void 0!==n){const r=t.substring(1);e[r]=n}})),e}({},n);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Rr(){}function Br(t){return{subscribe:e=>(e(t),Rr)}}function Ur(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Lr(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Wr(t){if(t.every((t=>"string"==typeof t)))return{type:"StringLiteral",value:t.join("")};let e=t.reduce(((t,e)=>("string"==typeof e&&"string"==typeof t[t.length-1]?t[t.length-1]+=e:t.push(e),t)),[]).reduce(((t,e)=>("string"==typeof e?t.quasis.push({type:"StringLiteral",value:e}):(t.quasis.length===t.expressions.length&&t.quasis.push({type:"StringLiteral",value:""}),t.expressions.push(e)),t)),{type:"TemplateLiteral",quasis:[],expressions:[]});return e.quasis.length===e.expressions.length&&e.quasis.push({type:"StringLiteral",value:""}),e}function Hr(t){try{return dr(t)}catch(e){throw new Error(`Value ${t} can't be converted to Integer type.`)}}function qr(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Gr(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,Gr.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}function Zr(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function Yr(t,e){var r,i={},n=(e=void 0!==e?e:{}).grammarSource,o={start:Fe,JsonStringContents:function(){var t,e,r;for(t=ge,e=[],r=Ae();r!==i;)e.push(r),r=Ae();return fe=t,e=jt(e)}},a=Fe,s="@{",l="}",c="@{}",u="\\",d="?",v=":",p="||",g="&&",f="==",h="!=",m=">=",y=">",b="<=",_="<",w="+",$="-",x="/",k="*",E="%",C="!",F="(",A=")",V=",",D="'",j=".",P="e",S="E",O="true",I="false",M=/^[^}]/,T=/^[^'}]/,z=/^[0-9]/,N=/^[a-zA-Z_0-9.]/,J=/^[a-zA-Z_]/,R=/^[ \t\r\n]/,B=we("@{",!1),U=we("}",!1),L=we("@{}",!1),W=we("\\",!1),H={type:"any"},q=$e(["}"],!0,!1),G=we("?",!1),Z=we(":",!1),Y=we("||",!1),X=we("&&",!1),K=we("==",!1),Q=we("!=",!1),tt=we(">=",!1),et=we(">",!1),rt=we("<=",!1),it=we("<",!1),nt=we("+",!1),ot=we("-",!1),at=we("/",!1),st=we("*",!1),lt=we("%",!1),ct=we("!",!1),ut=we("(",!1),dt=we(")",!1),vt=we(",",!1),pt=xe("string"),gt=we("'",!1),ft=$e(["'","}"],!0,!1),ht=xe("integer"),mt=$e([["0","9"]],!1,!1),yt=xe("number"),bt=we(".",!1),_t=we("e",!1),wt=we("E",!1),$t=xe("boolean"),xt=we("true",!1),kt=we("false",!1),Et=$e([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),Ct=xe("identifier"),Ft=$e([["a","z"],["A","Z"],"_"],!1,!1),At=xe("whitespace"),Vt=$e([" ","\t","\r","\n"],!1,!1),Dt=function(t){return t},jt=function(t){return Wr(t)},Pt=function(t){return t},St=function(){return""},Ot=function(){return _e()},It=function(){throw new Error("Error tokenizing '"+t+"'.")},Mt=function(){throw new Error("Error tokenizing '"+t+"'.")},Tt=function(t){return t},zt=function(t){return qr(t)},Nt=function(){throw new Error("Error tokenizing '"+t+"'.")},Jt=function(t,e,r){return{type:"ConditionalExpression",test:t,consequent:e,alternate:r}},Rt=function(t,e){return Lr(t,e)},Bt=function(t,e){return Lr(t,e)},Ut=function(t,e){return Ur(t,e)},Lt=function(t,e){return Ur(t,e)},Wt=function(t,e){return Ur(t,e)},Ht=function(t,e){return Ur(t,e)},qt=function(t,e){return{type:"UnaryExpression",operator:t,argument:e}},Gt=function(t,e){return{type:"CallExpression",callee:t,arguments:e}},Zt=function(t){return{type:"Variable",id:t}},Yt=function(t,e){return[t,...e]},Xt=function(t){return t},Kt=function(t){return t},Qt=function(t){return Wr(t)},te=function(t){return t},ee=function(){return""},re=function(){return _e()},ie=function(){throw new Error("Error tokenizing '"+t+"'.")},ne=function(){throw new Error("Error tokenizing '"+t+"'.")},oe=function(t){return t},ae=function(t){return qr(t)},se=function(){throw new Error("Error tokenizing '"+t+"'.")},le=function(){return{type:"IntegerLiteral",value:Hr(_e())}},ce=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},ue=function(){return{type:"NumberLiteral",value:parseFloat(_e())}},de=function(){return{type:"BooleanLiteral",value:!0}},ve=function(){return{type:"BooleanLiteral",value:!1}},pe=function(){return{type:"Identifier",name:_e()}},ge=0,fe=0,he=[{line:1,column:1}],me=0,ye=[],be=0;if("startRule"in e){if(!(e.startRule in o))throw new Error("Can't start parsing from rule \""+e.startRule+'".');a=o[e.startRule]}function _e(){return t.substring(fe,ge)}function we(t,e){return{type:"literal",text:t,ignoreCase:e}}function $e(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function xe(t){return{type:"other",description:t}}function ke(e){var r,i=he[e];if(i)return i;for(r=e-1;!he[r];)r--;for(i={line:(i=he[r]).line,column:i.column};r<e;)10===t.charCodeAt(r)?(i.line++,i.column=1):i.column++,r++;return he[e]=i,i}function Ee(t,e,r){var i=ke(t),o=ke(e),a={source:n,start:{offset:t,line:i.line,column:i.column},end:{offset:e,line:o.line,column:o.column}};return r&&n&&"function"==typeof n.offset&&(a.start=n.offset(a.start),a.end=n.offset(a.end)),a}function Ce(t){ge<me||(ge>me&&(me=ge,ye=[]),ye.push(t))}function Fe(){var t,e;return t=ge,Re(),(e=Ve())!==i?(Re(),fe=t,t=Dt(e)):(ge=t,t=i),t}function Ae(){var e,r,n,o,a;if(e=ge,t.substr(ge,2)===s?(r=s,ge+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(ge)?(a=l,ge++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=Pt(o)):(ge=e,e=i)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=ge,t.substr(ge,3)===c?(r=c,ge+=3):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=St()),(e=r)===i&&(e=ge,r=ge,be++,92===t.charCodeAt(ge)?(n=u,ge++):(n=i,0===be&&Ce(W)),n===i&&(t.substr(ge,2)===s?(n=s,ge+=2):(n=i,0===be&&Ce(B))),be--,n===i?r=void 0:(ge=r,r=i),r!==i?(t.length>ge?(n=t.charAt(ge),ge++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=Ot()):(ge=e,e=i)):(ge=e,e=i),e===i))){if(e=ge,t.substr(ge,2)===s?(r=s,ge+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],M.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(q)),o!==i)for(;o!==i;)n.push(o),M.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(q));else n=i;n!==i?(125===t.charCodeAt(ge)?(o=l,ge++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=It()):(ge=e,e=i)):(ge=e,e=i)}else ge=e,e=i;e===i&&(e=ge,t.substr(ge,2)===s?(r=s,ge+=2):(r=i,0===be&&Ce(B)),r!==i&&(fe=e,r=Mt()),(e=r)===i&&(e=ge,92===t.charCodeAt(ge)?(r=u,ge++):(r=i,0===be&&Ce(W)),r!==i?(t.substr(ge,2)===s?(n=s,ge+=2):(n=i,0===be&&Ce(B)),n!==i?(fe=e,e=Tt(n)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=ge,92===t.charCodeAt(ge)?(r=u,ge++):(r=i,0===be&&Ce(W)),r!==i?(t.length>ge?(n=t.charAt(ge),ge++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=zt(n)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=ge,92===t.charCodeAt(ge)?(r=u,ge++):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=Nt()),e=r))))}return e}function Ve(){var e,r,n,o,a,s;return e=ge,(r=De())!==i?(Re(),63===t.charCodeAt(ge)?(n=d,ge++):(n=i,0===be&&Ce(G)),n!==i?(Re(),(o=Ve())!==i?(Re(),58===t.charCodeAt(ge)?(a=v,ge++):(a=i,0===be&&Ce(Z)),a!==i?(Re(),(s=Ve())!==i?(fe=e,e=Jt(r,o,s)):(ge=e,e=i)):(ge=e,e=i)):(ge=e,e=i)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=De()),e}function De(){var e,r,n,o,a,s,l,c;if(e=ge,(r=je())!==i){for(n=[],o=ge,a=Re(),t.substr(ge,2)===p?(s=p,ge+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(c=je())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);o!==i;)n.push(o),o=ge,a=Re(),t.substr(ge,2)===p?(s=p,ge+=2):(s=i,0===be&&Ce(Y)),s!==i?(l=Re(),(c=je())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);fe=e,e=Rt(r,n)}else ge=e,e=i;return e}function je(){var e,r,n,o,a,s,l,c;if(e=ge,(r=Pe())!==i){for(n=[],o=ge,a=Re(),t.substr(ge,2)===g?(s=g,ge+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(c=Pe())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);o!==i;)n.push(o),o=ge,a=Re(),t.substr(ge,2)===g?(s=g,ge+=2):(s=i,0===be&&Ce(X)),s!==i?(l=Re(),(c=Pe())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);fe=e,e=Bt(r,n)}else ge=e,e=i;return e}function Pe(){var e,r,n,o,a,s,l,c;if(e=ge,(r=Se())!==i){for(n=[],o=ge,a=Re(),t.substr(ge,2)===f?(s=f,ge+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(ge,2)===h?(s=h,ge+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(c=Se())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);o!==i;)n.push(o),o=ge,a=Re(),t.substr(ge,2)===f?(s=f,ge+=2):(s=i,0===be&&Ce(K)),s===i&&(t.substr(ge,2)===h?(s=h,ge+=2):(s=i,0===be&&Ce(Q))),s!==i?(l=Re(),(c=Se())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);fe=e,e=Ut(r,n)}else ge=e,e=i;return e}function Se(){var e,r,n,o,a,s,l,c;if(e=ge,(r=Oe())!==i){for(n=[],o=ge,a=Re(),t.substr(ge,2)===m?(s=m,ge+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(ge)?(s=y,ge++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(ge,2)===b?(s=b,ge+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(ge)?(s=_,ge++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(c=Oe())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);o!==i;)n.push(o),o=ge,a=Re(),t.substr(ge,2)===m?(s=m,ge+=2):(s=i,0===be&&Ce(tt)),s===i&&(62===t.charCodeAt(ge)?(s=y,ge++):(s=i,0===be&&Ce(et)),s===i&&(t.substr(ge,2)===b?(s=b,ge+=2):(s=i,0===be&&Ce(rt)),s===i&&(60===t.charCodeAt(ge)?(s=_,ge++):(s=i,0===be&&Ce(it))))),s!==i?(l=Re(),(c=Oe())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);fe=e,e=Lt(r,n)}else ge=e,e=i;return e}function Oe(){var e,r,n,o,a,s,l,c;if(e=ge,(r=Ie())!==i){for(n=[],o=ge,a=Re(),43===t.charCodeAt(ge)?(s=w,ge++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(ge)?(s=$,ge++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(c=Ie())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);o!==i;)n.push(o),o=ge,a=Re(),43===t.charCodeAt(ge)?(s=w,ge++):(s=i,0===be&&Ce(nt)),s===i&&(45===t.charCodeAt(ge)?(s=$,ge++):(s=i,0===be&&Ce(ot))),s!==i?(l=Re(),(c=Ie())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);fe=e,e=Wt(r,n)}else ge=e,e=i;return e}function Ie(){var e,r,n,o,a,s,l,c;if(e=ge,(r=Me())!==i){for(n=[],o=ge,a=Re(),47===t.charCodeAt(ge)?(s=x,ge++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(ge)?(s=k,ge++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(ge)?(s=E,ge++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(c=Me())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);o!==i;)n.push(o),o=ge,a=Re(),47===t.charCodeAt(ge)?(s=x,ge++):(s=i,0===be&&Ce(at)),s===i&&(42===t.charCodeAt(ge)?(s=k,ge++):(s=i,0===be&&Ce(st)),s===i&&(37===t.charCodeAt(ge)?(s=E,ge++):(s=i,0===be&&Ce(lt)))),s!==i?(l=Re(),(c=Me())!==i?o=a=[a,s,l,c]:(ge=o,o=i)):(ge=o,o=i);fe=e,e=Ht(r,n)}else ge=e,e=i;return e}function Me(){var e,r,n;return(e=Ne())===i&&(e=ze())===i&&(e=ge,33===t.charCodeAt(ge)?(r=C,ge++):(r=i,0===be&&Ce(ct)),r===i&&(43===t.charCodeAt(ge)?(r=w,ge++):(r=i,0===be&&Ce(nt)),r===i&&(45===t.charCodeAt(ge)?(r=$,ge++):(r=i,0===be&&Ce(ot)))),r!==i?(Re(),(n=Me())!==i?(fe=e,e=qt(r,n)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=function(){var e,r,n,o,a;return e=ge,(r=Je())!==i?(Re(),40===t.charCodeAt(ge)?(n=F,ge++):(n=i,0===be&&Ce(ut)),n!==i?(Re(),o=function(){var e,r,n,o,a,s;if(e=ge,(r=Ve())!==i){for(n=[],o=ge,Re(),44===t.charCodeAt(ge)?(a=V,ge++):(a=i,0===be&&Ce(vt)),a!==i?(Re(),(s=Ve())!==i?o=s:(ge=o,o=i)):(ge=o,o=i);o!==i;)n.push(o),o=ge,Re(),44===t.charCodeAt(ge)?(a=V,ge++):(a=i,0===be&&Ce(vt)),a!==i?(Re(),(s=Ve())!==i?o=s:(ge=o,o=i)):(ge=o,o=i);fe=e,e=Yt(r,n)}else ge=e,e=i;return e===i&&(e=Re()),e}(),o!==i?(Re(),41===t.charCodeAt(ge)?(a=A,ge++):(a=i,0===be&&Ce(dt)),a!==i?(fe=e,e=Gt(r,o)):(ge=e,e=i)):(ge=e,e=i)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=ge,(r=Je())!==i&&(fe=e,r=Zt(r)),(e=r)===i&&(e=function(){var e,r,n,o;return e=function(){var e,r,n,o;return be++,e=ge,39===t.charCodeAt(ge)?(r=D,ge++):(r=i,0===be&&Ce(gt)),r!==i?(n=function(){var t,e,r;for(t=ge,e=[],r=Te();r!==i;)e.push(r),r=Te();return fe=t,t=e=Qt(e)}(),39===t.charCodeAt(ge)?(o=D,ge++):(o=i,0===be&&Ce(gt)),o!==i?(fe=e,e=Kt(n)):(ge=e,e=i)):(ge=e,e=i),be--,e===i&&(r=i,0===be&&Ce(pt)),e}(),e===i&&(e=Ne())===i&&(e=ze())===i&&(e=function(){var e,r;return be++,e=ge,t.substr(ge,4)===O?(r=O,ge+=4):(r=i,0===be&&Ce(xt)),r!==i&&(fe=e,r=de()),(e=r)===i&&(e=ge,t.substr(ge,5)===I?(r=I,ge+=5):(r=i,0===be&&Ce(kt)),r!==i&&(fe=e,r=ve()),e=r),be--,e===i&&(r=i,0===be&&Ce($t)),e}(),e===i&&(e=ge,40===t.charCodeAt(ge)?(r=F,ge++):(r=i,0===be&&Ce(ut)),r!==i&&(n=Ve())!==i?(41===t.charCodeAt(ge)?(o=A,ge++):(o=i,0===be&&Ce(dt)),o!==i?(fe=e,e=Xt(n)):(ge=e,e=i)):(ge=e,e=i))),e}())),e}())),e}function Te(){var e,r,n,o,a;if(e=ge,t.substr(ge,2)===s?(r=s,ge+=2):(r=i,0===be&&Ce(B)),r!==i?(n=Re(),(o=Ve())!==i?(Re(),125===t.charCodeAt(ge)?(a=l,ge++):(a=i,0===be&&Ce(U)),a!==i?(fe=e,e=te(o)):(ge=e,e=i)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=ge,t.substr(ge,3)===c?(r=c,ge+=3):(r=i,0===be&&Ce(L)),r!==i&&(fe=e,r=ee()),(e=r)===i&&(e=ge,r=ge,be++,92===t.charCodeAt(ge)?(n=u,ge++):(n=i,0===be&&Ce(W)),n===i&&(39===t.charCodeAt(ge)?(n=D,ge++):(n=i,0===be&&Ce(gt)),n===i&&(t.substr(ge,2)===s?(n=s,ge+=2):(n=i,0===be&&Ce(B)))),be--,n===i?r=void 0:(ge=r,r=i),r!==i?(t.length>ge?(n=t.charAt(ge),ge++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=re()):(ge=e,e=i)):(ge=e,e=i),e===i))){if(e=ge,t.substr(ge,2)===s?(r=s,ge+=2):(r=i,0===be&&Ce(B)),r!==i){if(n=[],T.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(ft)),o!==i)for(;o!==i;)n.push(o),T.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(ft));else n=i;n!==i?(125===t.charCodeAt(ge)?(o=l,ge++):(o=i,0===be&&Ce(U)),o!==i?(fe=e,e=ie()):(ge=e,e=i)):(ge=e,e=i)}else ge=e,e=i;e===i&&(e=ge,t.substr(ge,2)===s?(r=s,ge+=2):(r=i,0===be&&Ce(B)),r!==i&&(fe=e,r=ne()),(e=r)===i&&(e=ge,92===t.charCodeAt(ge)?(r=u,ge++):(r=i,0===be&&Ce(W)),r!==i?(t.substr(ge,2)===s?(n=s,ge+=2):(n=i,0===be&&Ce(B)),n!==i?(fe=e,e=oe(n)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=ge,92===t.charCodeAt(ge)?(r=u,ge++):(r=i,0===be&&Ce(W)),r!==i?(t.length>ge?(n=t.charAt(ge),ge++):(n=i,0===be&&Ce(H)),n!==i?(fe=e,e=ae(n)):(ge=e,e=i)):(ge=e,e=i),e===i&&(e=ge,92===t.charCodeAt(ge)?(r=u,ge++):(r=i,0===be&&Ce(W)),r!==i&&(fe=e,r=se()),e=r))))}return e}function ze(){var e,r,n,o;if(be++,e=ge,45===t.charCodeAt(ge)?(r=$,ge++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],z.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),z.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(mt));else n=i;return n!==i?(fe=e,e=le()):(ge=e,e=i),be--,e===i&&(r=i,0===be&&Ce(ht)),e}function Ne(){var e,r,n,o,a,s,l,c,u,d;for(be++,e=ge,45===t.charCodeAt(ge)?(r=$,ge++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],z.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(mt));o!==i;)n.push(o),z.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(mt));if(46===t.charCodeAt(ge)?(o=j,ge++):(o=i,0===be&&Ce(bt)),o!==i){if(a=[],z.test(t.charAt(ge))?(s=t.charAt(ge),ge++):(s=i,0===be&&Ce(mt)),s!==i)for(;s!==i;)a.push(s),z.test(t.charAt(ge))?(s=t.charAt(ge),ge++):(s=i,0===be&&Ce(mt));else a=i;if(a!==i){if(s=ge,101===t.charCodeAt(ge)?(l=P,ge++):(l=i,0===be&&Ce(_t)),l===i&&(69===t.charCodeAt(ge)?(l=S,ge++):(l=i,0===be&&Ce(wt))),l!==i){if(43===t.charCodeAt(ge)?(c=w,ge++):(c=i,0===be&&Ce(nt)),c===i&&(45===t.charCodeAt(ge)?(c=$,ge++):(c=i,0===be&&Ce(ot))),c===i&&(c=null),u=[],z.test(t.charAt(ge))?(d=t.charAt(ge),ge++):(d=i,0===be&&Ce(mt)),d!==i)for(;d!==i;)u.push(d),z.test(t.charAt(ge))?(d=t.charAt(ge),ge++):(d=i,0===be&&Ce(mt));else u=i;u!==i?s=l=[l,c,u]:(ge=s,s=i)}else ge=s,s=i;s===i&&(s=null),fe=e,e=ce()}else ge=e,e=i}else ge=e,e=i;if(e===i){if(e=ge,45===t.charCodeAt(ge)?(r=$,ge++):(r=i,0===be&&Ce(ot)),r===i&&(r=null),n=[],z.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(mt)),o!==i)for(;o!==i;)n.push(o),z.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(mt));else n=i;if(n!==i)if(101===t.charCodeAt(ge)?(o=P,ge++):(o=i,0===be&&Ce(_t)),o===i&&(69===t.charCodeAt(ge)?(o=S,ge++):(o=i,0===be&&Ce(wt))),o!==i){if(43===t.charCodeAt(ge)?(a=w,ge++):(a=i,0===be&&Ce(nt)),a===i&&(45===t.charCodeAt(ge)?(a=$,ge++):(a=i,0===be&&Ce(ot))),a===i&&(a=null),s=[],z.test(t.charAt(ge))?(l=t.charAt(ge),ge++):(l=i,0===be&&Ce(mt)),l!==i)for(;l!==i;)s.push(l),z.test(t.charAt(ge))?(l=t.charAt(ge),ge++):(l=i,0===be&&Ce(mt));else s=i;s!==i?(fe=e,e=ue()):(ge=e,e=i)}else ge=e,e=i;else ge=e,e=i}return be--,e===i&&(r=i,0===be&&Ce(yt)),e}function Je(){var e,r,n,o,a;if(be++,e=ge,r=ge,be++,n=function(){var e,r,n,o;return e=ge,t.substr(ge,4)===O?(r=O,ge+=4):(r=i,0===be&&Ce(xt)),r===i&&(t.substr(ge,5)===I?(r=I,ge+=5):(r=i,0===be&&Ce(kt))),r!==i?(n=ge,be++,N.test(t.charAt(ge))?(o=t.charAt(ge),ge++):(o=i,0===be&&Ce(Et)),be--,o===i?n=void 0:(ge=n,n=i),n!==i?e=r=[r,n]:(ge=e,e=i)):(ge=e,e=i),e}(),be--,n===i?r=void 0:(ge=r,r=i),r!==i)if(J.test(t.charAt(ge))?(n=t.charAt(ge),ge++):(n=i,0===be&&Ce(Ft)),n!==i){for(o=[],N.test(t.charAt(ge))?(a=t.charAt(ge),ge++):(a=i,0===be&&Ce(Et));a!==i;)o.push(a),N.test(t.charAt(ge))?(a=t.charAt(ge),ge++):(a=i,0===be&&Ce(Et));fe=e,e=pe()}else ge=e,e=i;else ge=e,e=i;return be--,e===i&&(r=i,0===be&&Ce(Ct)),e}function Re(){var e,r;for(be++,e=[],R.test(t.charAt(ge))?(r=t.charAt(ge),ge++):(r=i,0===be&&Ce(Vt));r!==i;)e.push(r),R.test(t.charAt(ge))?(r=t.charAt(ge),ge++):(r=i,0===be&&Ce(Vt));return be--,r=i,0===be&&Ce(At),e}if((r=a())!==i&&ge===t.length)return r;throw r!==i&&ge<t.length&&Ce({type:"end"}),function(t,e,r){return new Gr(Gr.buildMessage(t,e),t,e,r)}(ye,me<t.length?t.charAt(me):null,me<t.length?Ee(me,me+1):Ee(me,me))}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Gr,Error),Gr.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,i=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){i=t[r].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(n):n,a=this.location.source+":"+o.line+":"+o.column;if(i){var s=this.location.end,l=Zr("",o.line.toString().length," "),c=i[n.line-1],u=(n.line===s.line?s.column:c.length+1)-n.column||1;e+="\n --\x3e "+a+"\n"+l+" |\n"+o.line+" | "+c+"\n"+l+" | "+Zr("",n.column-1," ")+Zr("",u,"^")}else e+="\n at "+a}return e},Gr.buildMessage=function(t,e){var r={literal:function(t){return'"'+n(t.text)+'"'},class:function(t){var e=t.parts.map((function(t){return Array.isArray(t)?o(t[0])+"-"+o(t[1]):o(t)}));return"["+(t.inverted?"^":"")+e.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(t){return t.description}};function i(t){return t.charCodeAt(0).toString(16).toUpperCase()}function n(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+i(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+i(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,i=t.map(a);if(i.sort(),i.length>0){for(e=1,r=1;e<i.length;e++)i[e-1]!==i[e]&&(i[r]=i[e],r++);i.length=r}switch(i.length){case 1:return i[0];case 2:return i[0]+" or "+i[1];default:return i.slice(0,-1).join(", ")+", or "+i[i.length-1]}}(t)+" but "+function(t){return t?'"'+n(t)+'"':"end of input"}(e)+" found."};const Xr=new Map,Kr=new Map;function Qr(t,e,r){const i={args:e,cb:r},n=Xr.get(t)||[];Xr.has(t)||Xr.set(t,n),n.push(i);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");Kr.set(o,i)}function ti(t,e){let r=t.args.length,i=t.args.length;const n=t.args[t.args.length-1];if("object"==typeof n&&n.isVararg&&(--r,i=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>i)return{type:"many",expected:i,found:e.length};for(let r=0;r<e.length;++r){let i=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof i&&(i={type:i}),i.type!==e[r].type)return{type:"mismatch",expected:i.type,found:e[r].type}}return{type:"match"}}function ei(t,e){var r;switch(null===(r=e[t.type])||void 0===r||r.call(e,t),t.type){case"TemplateLiteral":t.expressions.forEach((t=>{ei(t,e)}));break;case"BinaryExpression":case"LogicalExpression":ei(t.left,e),ei(t.right,e);break;case"UnaryExpression":ei(t.argument,e);break;case"ConditionalExpression":ei(t.test,e),ei(t.consequent,e),ei(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{ei(t,e)}))}}function ri(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function ii(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function ni(t){if("string"===t.type)return t.value;if("integer"===t.type)return String(t.value);if("number"===t.type){let e=String(t.value);return e.includes(".")||(e.includes("e")?e=e.replace("e",".0e"):e+=".0"),e=e.replace(/e\+?/i,"E"),e}if("boolean"===t.type)return t.value?"true":"false";if("datetime"===t.type)return ii(t.value);if("color"===t.type)return vi(di(t.value));if("url"===t.type)return t.value;if("dict"===t.type)return"<dict>";throw new Error(`Unexpected type ${t.type}`)}function oi(t){let e=ni(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'"),e}function ai(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}function si(t,e){if(sr)return dr(e);if(e<0){const t=-Math.floor(-e);return 0===t?0:t}return Math.floor(e)}function li(t,e){if(e<ur||e>cr)throw new Error("Integer overflow.");!sr&&(e>Number.MAX_SAFE_INTEGER||e<Number.MIN_SAFE_INTEGER)&&(t.safeIntegerOverflow=!0)}function ci(t){const e=[];return ei(t,{Variable(t){e.push(t.id.name)}}),e}function ui(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function di(t){const e=pt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function vi(t){return`#${[t.a,t.r,t.g,t.b].map((t=>{if(t<0||t>255)throw new Error("Value out of range 0..1.");return dt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function pi(t){return vi(di(t))}const gi=Number.MAX_VALUE,fi=Number.MIN_VALUE,hi="string",mi="integer",yi="number",bi="boolean",_i="color",wi="url",$i="datetime",xi="dict";function ki(t,e){return{type:hi,value:ni(e)}}function Ei(t,e){const r=Number(e.value);if(isNaN(r)||!Number.isFinite(r))throw new Error("Unable to convert value to Number.");return{type:yi,value:r}}function Ci(t,e,r,i){const n=t.variables.get(e.value);let o;return o=n&&n.getType()===i?n.getValue():r.value,"color"===i&&(o=pi(o)),{type:i,value:o}}function Fi(t,e,r){return Ci(t,e,r,r.type)}function Ai(t,e,r){return Ci(t,e,r,"color")}function Vi(t,e,r){return Ci(t,e,r,"url")}const Di=t=>(e,r)=>{let i=new Date(r.value.getTime())[t]();return"getUTCMonth"===t?++i:"getUTCDay"===t&&0===i&&(i=7),{type:mi,value:dr(i)}},ji=Di("getUTCFullYear"),Pi=Di("getUTCMonth"),Si=Di("getUTCDate"),Oi=Di("getUTCDay"),Ii=Di("getUTCHours"),Mi=Di("getUTCMinutes"),Ti=Di("getUTCSeconds"),zi=Di("getUTCMilliseconds");function Ni(t,e,r,i){if(!i.value.length)return t.warnings.push(ot(new Error("String for padding is empty."),{level:"warn"})),"";let n="";const o=e.type===hi?e.value:ni(e);for(;n.length+o.length<r.value;)n+=i.value;return n.length>0&&n.length+o.length>r.value&&(n=n.substring(0,Number(r.value)-Number(o.length))),n}function Ji(t,e,r,i){const n=Ni(t,e,r,i);return{type:hi,value:n+ni(e)}}function Ri(t,e,r,i){const n=Ni(t,e,r,i);return{type:hi,value:ni(e)+n}}function Bi(t){return(e,r)=>{const i=di(r.value);return{type:yi,value:i[t]/255}}}function Ui(t){return(e,r,i)=>{const n=di(r.value);return n[t]=255*i.value,{type:_i,value:vi(n)}}}const Li=Bi("a"),Wi=Bi("r"),Hi=Bi("g"),qi=Bi("b"),Gi=Ui("a"),Zi=Ui("r"),Yi=Ui("g"),Xi=Ui("b");function Ki(t,e,r,i){if(e.value<0)throw new Error("Expecting non-negative number of milliseconds.");let n=dr(e.value)/dr(r);return li(t,n),"number"==typeof n&&(n=Math.floor(n)),i&&(n=dr(n)%dr(i)),{type:mi,value:n}}const Qi=36e5;function tn(t,e){return(r,i,...n)=>{let o=function(t,e){let r=t;for(let t=0;t<e.length;++t){if(!r)throw new Error(`Missing property "${e[t]}" in the dict.`);const i=r[e[t]];if(void 0===i)throw new Error(`Missing property "${e[t]}" in the dict.`);r=i}return r}(i.value,n.map((t=>t.value))),a=typeof o;if(a!==t)throw"object"===a&&(a=Array.isArray(o)?"array":null===o?"null":"dict"),new Error(`Incorrect value type: expected "${e}", got "${a}".`);if("number"===t&&"integer"===e){if(o!==Math.round(o))throw new Error("Cannot convert value to integer.");li(r,o)}return"string"===t&&"color"===e&&(o=pi(o)),{type:e,value:o}}}function en(t,e){return(r,i,n,...o)=>{try{return t(r,n,...o)}catch(t){let r=i.value;return"color"===e&&(r=pi(r)),{type:e,value:r}}}}const rn=tn("string","string"),nn=tn("number","number"),on=tn("number","integer"),an=tn("boolean","boolean"),sn=tn("string","color"),ln=tn("string","url"),cn=en(rn,"string"),un=en(nn,"number"),dn=en(on,"integer"),vn=en(an,"boolean"),pn=en(sn,"color"),gn=en(ln,"url");function fn(t){return t.map(oi).join(", ")}Qr("toString",[mi],ki),Qr("toString",[yi],ki),Qr("toString",[bi],ki),Qr("toString",[_i],ki),Qr("toString",[wi],ki),Qr("toNumber",[mi],Ei),Qr("toNumber",[hi],Ei),Qr("toInteger",[yi],(function(t,e){if(e.value>cr||e.value<ur)throw new Error("Unable to convert value to Integer.");const r=e.value-e.value%1;return{type:mi,value:dr(r)}})),Qr("toInteger",[hi],(function(t,e){let r;try{r=dr(e.value)}catch(t){throw new Error("Unable to convert value to Integer.")}if("number"==typeof r&&(isNaN(r)||r%1!=0)||r>cr||r<ur)throw new Error("Unable to convert value to Integer.");return{type:mi,value:r}})),Qr("toInteger",[bi],(function(t,e){return{type:mi,value:dr(e.value?1:0)}})),Qr("toBoolean",[mi],(function(t,e){const r=Number(e.value);if(1!==r&&0!==r)throw new Error("Unable to convert value to Boolean.");return{type:bi,value:r}})),Qr("toBoolean",[hi],(function(t,e){if("true"!==e.value&&"false"!==e.value)throw new Error("Unable to convert value to Boolean.");return{type:bi,value:"true"===e.value?1:0}})),Qr("toColor",[hi],(function(t,e){return{type:_i,value:pi(e.value)}})),Qr("toUrl",[hi],(function(t,e){return{type:wi,value:e.value}})),Qr("encodeUri",[hi],(function(t,e){try{return{type:hi,value:encodeURIComponent(e.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),Qr("decodeUri",[hi],(function(t,e){try{return{type:hi,value:decodeURIComponent(e.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),Qr("getIntegerValue",[hi,mi],Fi),Qr("getNumberValue",[hi,yi],Fi),Qr("getBooleanValue",[hi,bi],Fi),Qr("getStringValue",[hi,hi],Fi),Qr("getColorValue",[hi,_i],Ai),Qr("getColorValue",[hi,hi],Ai),Qr("getUrlValue",[hi,wi],Vi),Qr("getUrlValue",[hi,hi],Vi),Qr("parseUnixTime",[mi],(function(t,e){return{type:$i,value:new Date(1e3*Number(e.value))}})),Qr("nowLocal",[],(function(){return{type:$i,value:new Date}})),Qr("addMillis",[$i,mi],(function(t,e,r){return{type:$i,value:new Date(e.value.getTime()+Number(r.value))}})),Qr("setYear",[$i,mi],(function(t,e,r){const i=new Date(e.value);return i.setUTCFullYear(Number(r.value)),{type:$i,value:i}})),Qr("setMonth",[$i,mi],(function(t,e,r){const i=Number(r.value);if(i<1||i>12)throw new Error(`Expecting month in [1..12], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMonth(i-1),{type:$i,value:n}})),Qr("setDay",[$i,mi],(function(t,e,r){const i=new Date(e.value),n=Number(r.value);if(n<=0&&-1!==n||n>function(t){const e=new Date(t);return e.setUTCMonth(e.getUTCMonth()+1),e.setUTCDate(0),e.getUTCDate()}(i))throw new Error(`Unable to set day ${n} for date ${ni(e)}.`);return i.setUTCDate(-1===n?0:n),{type:$i,value:i}})),Qr("setHours",[$i,mi],(function(t,e,r){const i=Number(r.value);if(i<0||i>23)throw new Error(`Expecting hours in [0..23], instead got ${i}.`);const n=new Date(e.value);return n.setUTCHours(i),{type:$i,value:n}})),Qr("setMinutes",[$i,mi],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting minutes in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMinutes(i),{type:$i,value:n}})),Qr("setSeconds",[$i,mi],(function(t,e,r){const i=Number(r.value);if(i<0||i>59)throw new Error(`Expecting seconds in [0..59], instead got ${i}.`);const n=new Date(e.value);return n.setUTCSeconds(i),{type:$i,value:n}})),Qr("setMillis",[$i,mi],(function(t,e,r){const i=Number(r.value);if(i<0||i>999)throw new Error(`Expecting millis in [0..999], instead got ${i}.`);const n=new Date(e.value);return n.setUTCMilliseconds(i),{type:$i,value:n}})),Qr("getYear",[$i],ji),Qr("getMonth",[$i],Pi),Qr("getDay",[$i],Si),Qr("getDayOfWeek",[$i],Oi),Qr("getHours",[$i],Ii),Qr("getMinutes",[$i],Mi),Qr("getSeconds",[$i],Ti),Qr("getMillis",[$i],zi),Qr("getIntervalSeconds",[mi],(function(t,e){return Ki(t,e,1e3,60)})),Qr("getIntervalTotalSeconds",[mi],(function(t,e){return Ki(t,e,1e3)})),Qr("getIntervalMinutes",[mi],(function(t,e){return Ki(t,e,6e4,60)})),Qr("getIntervalTotalMinutes",[mi],(function(t,e){return Ki(t,e,6e4)})),Qr("getIntervalHours",[mi],(function(t,e){return Ki(t,e,Qi,24)})),Qr("getIntervalTotalHours",[mi],(function(t,e){return Ki(t,e,Qi)})),Qr("getIntervalTotalDays",[mi],(function(t,e){return Ki(t,e,864e5)})),Qr("getIntervalTotalWeeks",[mi],(function(t,e){return Ki(t,e,6048e5)})),Qr("len",[hi],(function(t,e){return{type:mi,value:dr(e.value.length)}})),Qr("contains",[hi,hi],(function(t,e,r){return{type:bi,value:e.value.includes(r.value)?1:0}})),Qr("substring",[hi,mi,mi],(function(t,e,r,i){if(i.value<r.value)throw new Error("Indexes should be in ascending order.");if(r.value<0||r.value>e.value.length||i.value<0||i.value>e.value.length)throw new Error("Indexes are out of bounds.");return{type:hi,value:e.value.substring(Number(r.value),Number(i.value))}})),Qr("replaceAll",[hi,hi,hi],(function(t,e,r,i){let n;return n=r.value?e.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(r.value),"g"),i.value):e.value,{type:hi,value:n}})),Qr("index",[hi,hi],(function(t,e,r){return{type:mi,value:dr(e.value.indexOf(r.value))}})),Qr("lastIndex",[hi,hi],(function(t,e,r){return{type:mi,value:dr(e.value.lastIndexOf(r.value))}})),Qr("trim",[hi],(function(t,e){return{type:hi,value:e.value.trim()}})),Qr("trimLeft",[hi],(function(t,e){return{type:hi,value:e.value.replace(/^\s+/,"")}})),Qr("trimRight",[hi],(function(t,e){return{type:hi,value:e.value.replace(/\s+$/,"")}})),Qr("toUpperCase",[hi],(function(t,e){return{type:hi,value:e.value.toUpperCase()}})),Qr("toLowerCase",[hi],(function(t,e){return{type:hi,value:e.value.toLowerCase()}})),Qr("padStart",[hi,mi,hi],Ji),Qr("padStart",[mi,mi,hi],Ji),Qr("padEnd",[hi,mi,hi],Ri),Qr("padEnd",[mi,mi,hi],Ri),Qr("testRegex",[hi,hi],(function(t,e,r){let i;try{i=new RegExp(r.value)}catch(t){throw new Error("Invalid regular expression.")}return{type:bi,value:i.test(e.value)?1:0}})),Qr("div",[mi,mi],(function(t,e,r){if(r.value===vr)throw new Error("Division by zero is not supported.");let i=e.value/r.value;return i=si(0,i),li(t,i),{type:mi,value:i}})),Qr("div",[yi,yi],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value/r.value;return{type:yi,value:i}})),Qr("mod",[mi,mi],(function(t,e,r){if(r.value===vr)throw new Error("Division by zero is not supported.");let i=e.value%r.value;return i=si(0,i),li(t,i),{type:mi,value:i}})),Qr("mod",[yi,yi],(function(t,e,r){if(0===r.value)throw new Error("Division by zero is not supported.");const i=e.value%r.value;return{type:yi,value:i}})),Qr("mul",[{type:mi,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:vr;for(let i=1;i<e.length;++i)r*=e[i].value,r=si(0,r),li(t,r);return{type:mi,value:r}})),Qr("mul",[{type:yi,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r*=e[t].value;return{type:yi,value:r}})),Qr("sub",[{type:mi,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:vr;for(let i=1;i<e.length;++i)r-=e[i].value,r=si(0,r),li(t,r);return{type:mi,value:r}})),Qr("sub",[{type:yi,isVararg:!0}],(function(t,...e){let r=e.length?e[0].value:0;for(let t=1;t<e.length;++t)r-=e[t].value;return{type:yi,value:r}})),Qr("sum",[{type:mi,isVararg:!0}],(function(t,...e){let r=vr;for(let i=0;i<e.length;++i)r+=e[i].value,r=si(0,r),li(t,r);return{type:mi,value:r}})),Qr("sum",[{type:yi,isVararg:!0}],(function(t,...e){let r=0;for(let t=0;t<e.length;++t)r+=e[t].value;return{type:yi,value:r}})),Qr("abs",[mi],(function(t,e){const r=pr(e.value);return li(t,r),{type:e.type,value:r}})),Qr("abs",[yi],(function(t,e){const r=Math.abs(e.value);return{type:yi,value:r}})),Qr("max",[{type:mi,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value>r&&(r=e[t].value);return{type:mi,value:r}})),Qr("max",[{type:yi,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'max'.");return{type:yi,value:Math.max(...e.map((t=>t.value)))}})),Qr("min",[{type:mi,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");let r=e[0].value;for(let t=1;t<e.length;++t)e[t].value<r&&(r=e[t].value);return{type:mi,value:r}})),Qr("min",[{type:yi,isVararg:!0}],(function(t,...e){if(!e.length)throw new Error("Non empty argument list is required for function 'min'.");return{type:yi,value:Math.min(...e.map((t=>t.value)))}})),Qr("maxNumber",[],(function(){return{type:yi,value:gi}})),Qr("minNumber",[],(function(){return{type:yi,value:fi}})),Qr("maxInteger",[],(function(t){return li(t,cr),{type:mi,value:cr}})),Qr("minInteger",[],(function(t){return li(t,ur),{type:mi,value:ur}})),Qr("round",[yi],(function(t,e){const r=Math.sign(e.value);return{type:yi,value:r*Math.round(Math.abs(e.value))}})),Qr("floor",[yi],(function(t,e){return{type:yi,value:Math.floor(e.value)}})),Qr("ceil",[yi],(function(t,e){return{type:yi,value:Math.ceil(e.value)}})),Qr("signum",[mi],(function(t,e){return{type:mi,value:gr(e.value)}})),Qr("signum",[yi],(function(t,e){return{type:yi,value:Math.sign(e.value)}})),Qr("copySign",[mi,mi],(function(t,e,r){let i;if(r.value===vr)i=e.value;else if(e.value===vr)i=0;else{const t=gr(r.value);i=pr(e.value)*t}return li(t,i),{type:mi,value:i}})),Qr("copySign",[yi,yi],(function(t,e,r){let i=Math.sign(r.value);0===i&&(i=Object.is(i,0)?1:-1);const n=Math.abs(e.value)*i;return{type:yi,value:n}})),Qr("getColorAlpha",[hi],Li),Qr("getColorAlpha",[_i],Li),Qr("getColorRed",[hi],Wi),Qr("getColorRed",[_i],Wi),Qr("getColorGreen",[hi],Hi),Qr("getColorGreen",[_i],Hi),Qr("getColorBlue",[hi],qi),Qr("getColorBlue",[_i],qi),Qr("setColorAlpha",[hi,yi],Gi),Qr("setColorAlpha",[_i,yi],Gi),Qr("setColorRed",[hi,yi],Zi),Qr("setColorRed",[_i,yi],Zi),Qr("setColorGreen",[hi,yi],Yi),Qr("setColorGreen",[_i,yi],Yi),Qr("setColorBlue",[hi,yi],Xi),Qr("setColorBlue",[_i,yi],Xi),Qr("rgb",[yi,yi,yi],(function(t,e,r,i){const n={a:255,r:255*e.value,g:255*r.value,b:255*i.value};return{type:_i,value:vi(n)}})),Qr("argb",[yi,yi,yi,yi],(function(t,e,r,i,n){const o={a:255*e.value,r:255*r.value,g:255*i.value,b:255*n.value};return{type:_i,value:vi(o)}})),Qr("getDictString",[xi,{type:hi,isVararg:!0}],rn),Qr("getDictNumber",[xi,{type:hi,isVararg:!0}],nn),Qr("getDictInteger",[xi,{type:hi,isVararg:!0}],on),Qr("getDictBoolean",[xi,{type:hi,isVararg:!0}],an),Qr("getDictColor",[xi,{type:hi,isVararg:!0}],sn),Qr("getDictUrl",[xi,{type:hi,isVararg:!0}],ln),Qr("getDictOptString",[hi,xi,{type:hi,isVararg:!0}],cn),Qr("getDictOptNumber",[yi,xi,{type:hi,isVararg:!0}],un),Qr("getDictOptInteger",[mi,xi,{type:hi,isVararg:!0}],dn),Qr("getDictOptBoolean",[bi,xi,{type:hi,isVararg:!0}],vn),Qr("getDictOptColor",[_i,xi,{type:hi,isVararg:!0}],pn),Qr("getDictOptColor",[hi,xi,{type:hi,isVararg:!0}],pn),Qr("getDictOptUrl",[hi,xi,{type:hi,isVararg:!0}],gn),Qr("getDictOptUrl",[wi,xi,{type:hi,isVararg:!0}],gn);const hn={StringLiteral:function(t,e){return{type:hi,value:e.value}},NumberLiteral:function(t,e){return{type:yi,value:e.value}},IntegerLiteral:function(t,e){return li(t,e.value),{type:mi,value:e.value}},BooleanLiteral:function(t,e){return{type:bi,value:e.value?1:0}},UnaryExpression:function(t,e){const r=ri(mn(t,e.argument));switch(e.operator){case"!":if(r.type===bi)return{type:bi,value:r.value?0:1};ui(`${e.operator}${oi(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const i="+"===e.operator?1:-1;if(r.type===mi){const e=r.value*dr(i);return li(t,e),{type:mi,value:e}}if(r.type===yi)return{type:yi,value:r.value*i};ui(`${e.operator}${oi(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=ri(mn(t,e.test));if(r.type===bi)return r.value?mn(t,e.consequent):mn(t,e.alternate);ui(`${oi(r)} ? ${oi(mn(t,e.consequent))} : ${oi(mn(t,e.alternate))}`,"Ternary must be called with a Boolean value as a condition.")},TemplateLiteral:function(t,e){let r="";if(2===e.quasis.length&&""===e.quasis[0].value&&""===e.quasis[1].value)return mn(t,e.expressions[0]);for(let i=0;i<e.expressions.length;++i)r+=e.quasis[i].value,r+=ni(mn(t,e.expressions[i]));return r+=e.quasis[e.quasis.length-1].value,{type:hi,value:r}},LogicalExpression:function(t,e){const r=ri(mn(t,e.left));if(r.type!==bi&&ui(`${oi(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:bi,value:0};const i=ri(mn(t,e.right));return i.type!==bi&&ui(`${oi(r)} ${e.operator} ${oi(i)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${ai(i.type)}.`),{type:bi,value:i.value}},BinaryExpression:function(t,e){const r=e.operator,i=mn(t,e.left),n=mn(t,e.right);if(i.type!==n.type&&ui(`${oi(i)} ${e.operator} ${oi(n)}`,`Operator '${r}' cannot be applied to different types: ${ai(i.type)} and ${ai(n.type)}.`),"=="===r||"!="===r)return function(t,e,r){let i;return i=e.type===$i&&r.type===$i?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(i=!i),{type:bi,value:i?1:0}}(r,i,n);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let i;e.type!==yi&&e.type!==mi&&e.type!==$i&&ui(`${oi(e)} ${t} ${oi(r)}`,`Operator '${t}' cannot be applied to ${ai(e.type)} type.`);const n=e.type===$i?e.value.getTime():e.value,o=r.type===$i?r.value.getTime():r.value;return i=">"===t?n>o:">="===t?n>=o:"<"===t?n<o:n<=o,{type:bi,value:i?1:0}}(r,i,n);if("+"===r||"-"===r)return function(t,e,r,i){if(r.type!==hi&&r.type!==yi&&r.type!==mi&&ui(`${oi(r)} ${e} ${oi(i)}`,`Operator '${e}' cannot be applied to ${ai(r.type)} type.`),r.type===hi)return"-"===e&&ui(`${oi(r)} - ${oi(i)}`,`Operator '${e}' cannot be applied to ${ai(r.type)} type.`),{type:hi,value:r.value+i.value};let n="+"===e?r.value+i.value:r.value-i.value;if(r.type===mi)try{n=si(0,n),li(t,n)}catch(t){ui(`${oi(r)} ${e} ${oi(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);if("/"===r||"*"===r||"%"===r)return function(t,e,r,i){let n;if(r.type!==mi&&r.type!==yi&&ui(`${oi(r)} ${e} ${oi(i)}`,`Operator '${e}' cannot be applied to ${ai(r.type)} type.`),"*"===e)n=r.value*i.value;else{if("/"!==e&&"%"!==e)throw new Error(`Unsupported operation ${e}`);0===Number(i.value)&&ui(`${oi(r)} ${e} ${oi(i)}`,"Division by zero is not supported."),n="/"===e?r.value/i.value:r.value%i.value}if(r.type===mi)try{n=si(0,n),li(t,n)}catch(t){ui(`${oi(r)} ${e} ${oi(i)}`,t.message)}return{type:r.type,value:n}}(t,r,i,n);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;let i;const n=e.arguments.map((e=>mn(t,e))),o=r+":"+n.map((t=>t.type)).join("#");if(Kr.has(o))i=Kr.get(o);else{const t=function(t,e){const r=Xr.get(t);if(!r)return{type:"missing"};let i=null;for(let t=0;t<r.length;++t){const n=ti(r[t],e);if("match"===n.type)return r[t];i||(i=n)}if(!i)throw new Error("Missing function");return i}(r,n);if("expected"in t||"type"in t&&"missing"===t.type){const e=n.map((t=>ai(t.type))).join(", "),i=`${r}(${fn(n)})`;"few"===t.type&&0===n.length?ui(i,`Non empty argument list is required for function '${r}'.`):"many"===t.type||"few"===t.type||"mismatch"===t.type?ui(i,`Function '${r}' has no matching override for given argument types: ${e}.`):ui(i,`Unknown function name: ${r}.`)}i=t}if(!i)throw new Error("Function not found");try{return i.cb(t,...n)}catch(t){ui(`${r}(${fn(n)})`,t.message)}},Variable:function(t,e){const r=e.id.name,i=t.variables.get(r);if(i)return function(t){return{type:t.getType(),value:t.getValue()}}(i);throw new Error(`Variable '${r}' is missing.`)}};function mn(t,e){if(e.type in hn)return hn[e.type](t,e);throw new Error("Unsupported expression")}function yn(t,e){try{const r={variables:t,warnings:[],safeIntegerOverflow:!1};!function(t,e){let r="";if(ei(e,{Variable(e){r||t.variables.has(e.id.name)||(r=e.id.name)}}),r)throw new Error(`Variable '${r}' is missing.`)}(r,e);const i=mn(r,e);return r.safeIntegerOverflow&&r.warnings.push(ot(new Error("Safe integer overflow, values may lose accuracy."),{level:"warn"})),{result:i,warnings:r.warnings}}catch(t){return{result:{type:"error",value:t.message},warnings:[]}}}class bn{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return ei(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=yn(t,this.ast);r.warnings.forEach(e);const i=r.result;if("error"===i.type)return void e(ot(new Error("Expression execution error"),{additional:{message:i.value}}));const n=i.value;if(n instanceof Date)return ii(n);if("boolean"===i.type)return Boolean(n);if("color"===i.type){const t=pt(String(n));if(t)return vi(t);e(ot(new Error("Expression execution error")))}return"integer"===i.type?n>2147483647||n<-2147483648?void e(ot(new Error("Expression result is out of 32-bit int range"))):Number(n):n}catch(t){return void e(ot(new Error("Expression execution error")))}}}function _n(t,e,r){if(t)if("string"==typeof t){if((i=t).indexOf("@{")>-1||i.indexOf("\\")>-1){e.hasExpression=!0;try{const r=Yr(t,{startRule:"JsonStringContents"}),i=ci(r);return e.vars.push(...i),new bn(r)}catch(e){return void r(ot(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>_n(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=_n(t[n],e,r);return i}}var i;return t}function wn(t,e,r){if(t){if(t instanceof bn)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>wn(t,e,r)));if("object"==typeof t){const i={};for(const n in t)i[n]=wn(t[n],e,r);return i}}return t}function $n(t,e){const r={vars:[],hasExpression:!1},i=_n(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>wn(i,t,e)}}const xn={pagers:function(){return Y(new Map)}},kn=new Map,En=new Map;function Cn(t){const e=kn.get(t)||Y("");return kn.has(t)||kn.set(t,e),e}function Fn(t){const e=En.get(t)||new Map;return En.has(t)||En.set(t,e),e}class An{setVariable(t){const e=t.getName(),r=Fn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Cn(this).set(e)}getVariable(t){return Fn(this).get(t)}}function Vn(){return new An}function Dn(t,e,r){return e=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const jn=new Set(["start","stop","pause","resume","cancel","reset"]);class Pn{constructor(t){Dn(this,"timers",new Map),Dn(this,"awaitActions",[]),this.logError=t.logError,this.applyVars=t.applyVars,this.hasVariableWithType=t.hasVariableWithType,this.setVariableValue=t.setVariableValue,this.execAnyActions=t.execAnyActions,this.visibilityHandler=()=>{"visible"===document.visibilityState?(this.awaitActions.forEach((({id:t,action:e})=>{this.execTimerAction(t,e)})),this.awaitActions=[],this.unholdAll()):this.holdAll()},document.addEventListener("visibilitychange",this.visibilityHandler)}destroy(){document.removeEventListener("visibilitychange",this.visibilityHandler);for(const[t,e]of this.timers)this.stopTimerTimeouts(e)}createTimer(t){null!=t&&t.id?t.duration||t.tick_interval&&(t.value_variable||t.tick_actions)?this.timers.set(t.id,{state:"stopped",definition:t}):this.logError(ot(new Error("Misconfigured timer"),{additional:{id:t.id}})):this.logError(ot(new Error("Missing timer id")))}execTimerAction(t,e){if(!(t&&e&&this.timers.has(t)&&jn.has(e)))return void this.logError(ot(new Error("Incorrect timer action"),{additional:{id:t,action:e}}));const r=e;if("visible"!==document.visibilityState)return void this.awaitActions.push({id:t,action:r});const i=this.timers.get(t);this[r](i)}stopTimerTimeouts(t){t.durationTimeout&&(clearTimeout(t.durationTimeout),t.durationTimeout=void 0),t.tickTimeout&&(clearTimeout(t.tickTimeout),t.tickTimeout=void 0)}tickOrUnholdAction(t){const e=performance.now(),r=(t.durationPassed||0)+e-(t.durationStarted||0);t.duration&&r>t.duration||(this.updateVariable(t,r),this.callActions(t,"tick"),void 0!==t.tickCount&&++t.tickCount)}startOrResume(t){t.state="running",t.hold=!1,t.durationStarted=performance.now();const e=t.duration;e&&(t.durationTimeout=window.setTimeout((()=>{this.updateVariable(t,e),t.tickCountPredict&&void 0!==t.tickCount&&t.tickCount<t.tickCountPredict&&this.callActions(t,"tick"),this.stop(t)}),Math.max(0,e-(t.durationPassed||0))));const r=t.tick;if(r){const e=()=>{const i=t.tickStarted=performance.now(),n=Math.max(0,r-(t.tickPassed||0));t.tickTimeout=window.setTimeout((()=>{this.tickOrUnholdAction(t),t.tickPassed=(performance.now()-i-n)%r,e()}),n)};e()}}start(t){if("running"===t.state)return void this.logError(ot(new Error("The timer is already running")));if("paused"===t.state)return void this.logError(ot(new Error("The timer is paused")));const e=t.definition.value_variable;!e||this.hasVariableWithType(e,"integer")?(e&&this.setVariableValue(e,0),t.definition.duration&&(t.duration=this.applyVars(t.definition.duration)),t.definition.tick_interval&&(t.tick=this.applyVars(t.definition.tick_interval)),void 0!==t.duration&&t.duration<0||void 0!==t.tick&&t.tick<=0?this.logError(ot(new Error("Incorrect timer properties"),{additional:{id:t.definition.id}})):(void 0!==t.duration&&void 0!==t.tick&&(t.tickCount=0,t.tickCountPredict=Math.floor(t.duration/t.tick)),this.startOrResume(t))):this.logError(ot(new Error("Cannot find variable"),{additional:{name:e}}))}stop(t){"stopped"!==t.state?(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t),this.callActions(t,"end")):this.logError(ot(new Error("The timer has already been stopped")))}pause(t){if("stopped"===t.state)return void this.logError(ot(new Error("The timer has already been stopped")));if("paused"===t.state)return void this.logError(ot(new Error("The timer has already been paused")));t.state="paused",this.stopTimerTimeouts(t);const e=performance.now();t.durationStarted&&(t.durationPassed=(t.durationPassed||0)+e-t.durationStarted),t.tickStarted&&(t.tickPassed=(t.tickPassed||0)+e-t.tickStarted);const r=t.definition.value_variable;r&&t.durationPassed&&this.setVariableValue(r,Math.round(t.durationPassed))}resume(t){"stopped"!==t.state?"running"!==t.state?this.startOrResume(t):this.logError(ot(new Error("The timer is already running"))):this.logError(ot(new Error("The timer has already been stopped")))}cancel(t){"stopped"!==t.state&&(t.state="stopped",t.durationPassed=0,t.tickPassed=0,this.stopTimerTimeouts(t))}reset(t){this.cancel(t),this.start(t)}updateVariable(t,e){const r=t.definition.value_variable;r&&this.setVariableValue(r,Math.round(e))}callActions(t,e){const r=t.definition["end"===e?"end_actions":"tick_actions"];if(r){const t=this.applyVars(r);this.execAnyActions(t,!1)}}holdAll(){for(const[t,e]of this.timers)"running"===e.state&&(e.hold=!0,this.stopTimerTimeouts(e))}unholdAll(){for(const[t,e]of this.timers)if("running"===e.state&&e.hold){const t=performance.now();e.durationStarted&&(e.durationPassed=(e.durationPassed||0)+t-e.durationStarted),e.tickStarted&&(e.tickPassed=(e.tickPassed||0)+t-e.tickStarted),e.tick&&this.tickOrUnholdAction(e),this.startOrResume(e)}}}let Sn=Y(!0),On=0;function In(){Sn.set(!1)}function Mn(){Sn.set(!0)}const Tn=R(((t,e,r,i)=>{let n,o;var a,s,c,u;let{id:d}=e,{json:v={}}=e,{platform:f="auto"}=e,{theme:h="system"}=e,{globalVariablesController:m=new An}=e,{mix:y=""}=e,{customization:b={}}=e,{builtinProtocols:_=["http","https","tel","mailto","intent"]}=e,{extensions:w=new Map}=e,{onError:x}=e,{onStat:k}=e,{onCustomAction:E}=e,{onComponent:C}=e,{typefaceProvider:F=(t=>"")}=e,{fetchInit:A={}}=e,{tooltipRoot:V}=e,D=Y("desktop"===f);if(o=l(D,(t=>n=t)),"auto"===f&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");D.set(!t.matches),t.addListener((()=>{D.set(!t.matches)}))}let j="light",P=null;function O(t){h=t}function I(){}const M=new Set(_);let T=!1;v||(T=!0,Q(ot(new Error('"json" prop is required')))),d||(T=!0,Q(ot(new Error('"id" prop is required'))));let N=function(t){if(!t)return ot(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return ot(new Error("Missing card"));if(!e.states||!e.states.length)return ot(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Tr)return ot(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return ot(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return ot(new Error("Missing state_id"),{additional:{index:t}})}return null}(v);const J=v.templates||{};N&&(T=!0,Q(N));const R={stateChange:!1},B=Cn(m),U=Fn(m),L=new Map,W=new Map,H=new Map;let q=null,G=0,Z=[];function K(t){const e=$n(t,Q);return e.hasExpression?e.applyVars(W):t}function Q(t){x?x({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}function tt(t,e){k&&k({type:t,action:e})}let rt=0;function it(t){return`${d}-${rt++}`}let at={},st={};function lt(t){const e=t.url?String(t.url):"";if(e)try{const r=e.replace(/div-action:\/\//,""),i=/([^?]+)\?(.+)/.exec(r);if(!i)return;const n=new URLSearchParams(i[2]);switch(i[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=yt,r=t.split("/");if(r=["root",...r],r.length<2||r.length%2!=0)throw new Error("Incorrect state id format");for(let t=0;t<r.length;t+=2){const i=r[t],n=r[t+1];let o=e.getChild(i);if(!o)return;o.setState(n),e=o}}(n.get("state_id"));break;case"set_current_item":!function(t,e){if(!t||!e)throw new Error('Missing data for "set-current-item" action');if(isNaN(Number(e)))throw new Error('Incorrect item for "set-current-item" action');const r=gt(t);r&&r.setCurrentItem(Number(e))}(n.get("id"),n.get("item"));break;case"set_previous_item":!function(t,e){if(!t)throw new Error('Missing id for "set-previous-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-previous-item" action');e=e||"clamp";const r=gt(t);r&&r.setPreviousItem(e)}(n.get("id"),n.get("overflow"));break;case"set_next_item":!function(t,e){if(!t)throw new Error('Missing id for "set-next-item" action');if(e&&"clamp"!==e&&"ring"!==e)throw new Error('Incorrect overflow value for "set-next-item" action');e=e||"clamp";const r=gt(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const i=n.get("name"),o=n.get("value");if(i&&null!==o){const t=W.get(i);t?"dict"===t.getType()?Q(ot(new Error("Setting dict variables is not supported"),{additional:{name:i}})):t.set(o):Q(ot(new Error("Cannot find variable"),{additional:{name:i}}))}else Q(ot(new Error("Incorrect set_variable_action"),{additional:{url:r}}));break;case"timer":const a=n.get("action"),s=n.get("id");q?q.execTimerAction(s,a):Q(ot(new Error("Incorrect timer action"),{additional:{id:s,action:a}}));break;case"video":!function(t,e){if(t){const r=gt(t);r?"start"===e?r.start():"pause"===e?r.pause():Q(ot(new Error("Unknown video action"),{additional:{id:t,action:e}})):Q(ot(new Error("Video component is not found"),{additional:{id:t,action:e}}))}else Q(ot(new Error("Missing id in video action"),{additional:{action:e}}))}(n.get("id"),n.get("action"));break;case"download":!function(t,e){if(t){let r;r="function"==typeof A?A(t):A,fetch(t,r).then((t=>{if(!t.ok)throw new Error("Response is not ok");return t.json()})).then((r=>{var i,n,o;if(r){if(r.templates)for(const t in r.templates)J.hasOwnProperty(t)||(J[t]=r.templates[t]);if(Array.isArray(null===(i=r.patch)||void 0===i?void 0:i.changes)){if("transactional"===r.patch.mode){const i=r.patch.changes.find((t=>!vt.has(t.id)));if(i)return Q(ot(new Error("Skipping transactional, child is not found"),{additional:{url:t,id:i.id}})),void ct(null===(n=e.download_callbacks)||void 0===n?void 0:n.on_fail_actions)}r.patch.changes.forEach((t=>{const e=vt.get(t.id);e&&e.replaceWith(t.id,t.items)})),ct(null===(o=e.download_callbacks)||void 0===o?void 0:o.on_success_actions)}}else Q(ot(new Error("Incorrect patch"),{additional:{url:t}}))})).catch((r=>{var i;Q(ot(new Error("Failed to download the patch"),{additional:{url:t,originalError:r}})),ct(null===(i=e.download_callbacks)||void 0===i?void 0:i.on_fail_actions)}))}else Q(ot(new Error("Missing url in download action"),{additional:{url:t}}))}(n.get("url"),t);break;case"show_tooltip":!function(t,e){var r;if(!t)return void Q(ot(new Error("Missing id in show_tooltip action")));const i=pt.get(t);if(!i)return void Q(ot(new Error("Tooltip with the provided id is not found"),{additional:{id:t}}));if("true"!==e&&Z.some((e=>e.desc.id===t)))return;const n={internalId:++G,ownerNode:i.onwerNode,desc:i.tooltip,timeoutId:0};Z=[...Z,n];const o=null!==(r=i.tooltip.duration)&&void 0!==r?r:5e3;o&&(n.timeoutId=window.setTimeout((()=>{n.timeoutId=0,Z=Z.filter((t=>t.internalId!==n.internalId))}),o))}(n.get("id"),n.get("multiple"));break;case"hide_tooltip":!function(t){t?Z=Z.filter((e=>{const r=e.desc.id!==t;return!r&&e.timeoutId&&(clearTimeout(e.timeoutId),e.timeoutId=null),r})):Q(ot(new Error("Missing id in hide_tooltip action")))}(n.get("id"));break;default:Q(ot(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){Q(ot(t,{additional:{url:e}}))}}async function ct(t,e){if(t&&Array.isArray(t)){for(let r=0;r<t.length;++r){let i=t[r];const n=i.url;if(n){const t=wt(n);if(t)if($t(t,M)){if(e)if("_blank"===i.target){const t=window.open("","_blank");t&&(t.opener=null,t.location=n)}else location.href=n}else"div-action"===t?(lt(i),await $()):i.log_id&&(ut(i),await $())}}t.forEach((t=>{t.log_id&&tt("click",t)}))}}function ut(t){null==E||E(t)}const dt=new Map,vt=new Map,pt=new Map;function gt(t){if(dt.has(t))return dt.get(t);Q(ot(new Error("Missing instance with id"),{additional:{id:t}}))}const ht=new Map;function mt(t){for(const e of t)W.has(e)&&t.delete(e);return t}g(nt,{logError:Q,logStat:tt,hasTemplate:function(t){return t in J},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in J;){if(({json:t,templateContext:e}=Jr(t,e,J,Q)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:it,genClass:function(t){return`divkit-${it()}`},execAction:lt,execAnyActions:ct,execCustomAction:ut,isRunning:function(t){return R[t]},setRunning:function(t,e){R[t]=e},registerInstance:function(t,e){dt.has(t)?Q(ot(new Error("Duplicate instance id"),{additional:{id:t}})):dt.set(t,e)},unregisterInstance:function(t){dt.delete(t)},registerParentOf:function(t,e){vt.set(t,e)},unregisterParentOf:function(t){vt.delete(t)},registerTooltip:function(t,e){pt.has(e.id)&&Q(ot(new Error("Duplicate tooltip id"),{additional:{id:e.id}})),pt.set(e.id,{onwerNode:t,tooltip:e})},unregisterTooltip:function(t){pt.delete(t.id),Z.some((e=>e.desc.id===t.id))&&(Z=Z.filter((e=>e.desc.id!==t.id)))},onTooltipClose:function(t){Z=Z.filter((e=>e.internalId!==t))},tooltipRoot:V,addSvgFilter:function(t,e){const r=`${t}:${e}`;if(st[r]=st[r]||0,++st[r],at[r])return at[r];const i=`${it()}-svg-filter`;return at=Object.assign(Object.assign({},at),{[r]:i}),i},removeSvgFilter:function(t,e){if(!t)return;const r=`${t}:${e}`;st[r]&&0==--st[r]&&(at=Object.keys(at).reduce(((t,e)=>(st[e]&&(t[e]=at[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Br(t);const e=$n(t,Q);return e.vars.length?X(e.vars.map((t=>W.get(t)||function(t){const e=H.get(t)||Y(void 0);return H.has(t)||H.set(t,e),e}(t))).filter(ft),(()=>e.applyVars(W))):e.hasExpression?Br(e.applyVars(W)):Br(t)},getJsonWithVars:K,getStore:function(t){return ht.has(t)||function(t){ht.has(t)||ht.set(t,xn[t]())}(t),ht.get(t)},getVariable:function(t,e){const r=W.get(t);if(r){const i=r.getType();if(i!==e)return void Q(ot(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:i}}))}return r},getCustomization:function(t){return null==b?void 0:b[t]},getBuiltinProtocols:function(){return M},getExtension:function(t,e){const r=w.get(t);if(r)return new r(e||{})},getExtensionContext:function(){return{variables:W,logError:Q}},typefaceProvider:F,isDesktop:D,isPointerFocus:Sn,registerComponent:void 0,unregisterComponent:void 0}),g(Lt,{hasAction:()=>!1});const yt={setState(t){throw new Error("Not implemented")},getChild(t){if(bt&&bt.has(t))return bt.get(t);Q(ot(new Error("Missing state block with id"),{additional:{id:t}}))}};let bt=null;g(Vt,{registerInstance(t,e){bt||(bt=new Map),bt.has(t)?Q(ot(new Error("Duplicate state with id"),{additional:{id:t}})):bt.set(t,e)},unregisterInstance(t){null==bt||bt.delete(t)},runVisibilityTransition:(t,e,r,i,n)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,i)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,i)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const _t=null===(a=null==v?void 0:v.card)||void 0===a?void 0:a.variables;Array.isArray(_t)&&_t.forEach((t=>{if(t&&t.type in hr&&t.name){if(L.has(t.name))return void Q(ot(new Error("Duplicate variable"),{additional:{name:t.name}}));"integer"===t.type&&"number"==typeof t.value&&(t.value>Number.MAX_SAFE_INTEGER||t.value<Number.MIN_SAFE_INTEGER)&&Q(ot(new Error("The value of the integer variable could lose accuracy"),{level:"warn",additional:{name:t.name,value:t.value}}));try{const e=mr(t.name,t.type,t.value);L.set(t.name,e),W.set(t.name,e)}catch(e){Q(ot(e,{additional:{name:t.name}}))}}}));const xt=v.palette;xt&&xt[j].forEach((t=>{if(L.has(t.name))Q(ot(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=mr(t.name,"color",t.color);L.set(t.name,e),W.set(t.name,e)}catch(e){Q(ot(e,{additional:{name:t.name}}))}}));for(const[t,e]of U)W.has(t)||W.set(t,e);B.subscribe((t=>{if(t&&!W.has(t)){const e=U.get(t);W.set(t,e);const r=H.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const kt=null===(s=null==v?void 0:v.card)||void 0===s?void 0:s.variable_triggers;Array.isArray(kt)&&kt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void Q(ot(new Error("variable_trigger has a condition that is not a string"),{additional:{condition:t.condition}}));const r=t.mode||"on_condition";if("on_variable"===r||"on_condition"===r)try{const i=Yr(t.condition,{startRule:"JsonStringContents"}),n=ci(i);if(!n.length)return void Q(ot(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return mt(e),e.size?new Promise((t=>{const r=B.subscribe((()=>{mt(e),e.size||(r(),t())}))})):Promise.resolve()})(n).then((()=>{X(n.map((t=>W.get(t))).filter(ft),(()=>{const t=yn(W,i);return t.warnings.forEach(Q),t.result})).subscribe((i=>{"error"!==i.type?(i.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=K(t);e.log_id&&lt(e)})),e=Boolean(i.value)):Q(ot(new Error("variable_trigger condition execution error"),{additional:{message:i.value}}))}))}))}catch(e){Q(ot(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else Q(ot(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const Et=null===(c=null==v?void 0:v.card)||void 0===c?void 0:c.timers;if(Et){const t=q=new Pn({logError:Q,applyVars:K,hasVariableWithType:function(t,e){const r=W.get(t);return(null==r?void 0:r.getType())===e},setVariableValue:function(t,e){const r=W.get(t);r?r.setValue(e):Q(ot(new Error("Cannot find variable"),{additional:{name:t}}))},execAnyActions:ct});Et.forEach((e=>t.createTimer(e)))}const Ct=null===(u=null==v?void 0:v.card)||void 0===u?void 0:u.states;let Ft;return Ct&&!T&&(Ft={type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:Ct.map((t=>({state_id:t.state_id.toString(),div:t.div})))}),p((()=>{On--,On||(window.removeEventListener("keydown",In),window.removeEventListener("pointerdown",Mn)),q&&q.destroy(),Z.forEach((t=>{t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=null)}))})),void 0===e.id&&r.id&&void 0!==d&&r.id(d),void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.platform&&r.platform&&void 0!==f&&r.platform(f),void 0===e.theme&&r.theme&&void 0!==h&&r.theme(h),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==m&&r.globalVariablesController(m),void 0===e.mix&&r.mix&&void 0!==y&&r.mix(y),void 0===e.customization&&r.customization&&void 0!==b&&r.customization(b),void 0===e.builtinProtocols&&r.builtinProtocols&&void 0!==_&&r.builtinProtocols(_),void 0===e.extensions&&r.extensions&&void 0!==w&&r.extensions(w),void 0===e.onError&&r.onError&&void 0!==x&&r.onError(x),void 0===e.onStat&&r.onStat&&void 0!==k&&r.onStat(k),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==E&&r.onCustomAction(E),void 0===e.onComponent&&r.onComponent&&void 0!==C&&r.onComponent(C),void 0===e.typefaceProvider&&r.typefaceProvider&&void 0!==F&&r.typefaceProvider(F),void 0===e.fetchInit&&r.fetchInit&&void 0!==A&&r.fetchInit(A),void 0===e.tooltipRoot&&r.tooltipRoot&&void 0!==V&&r.tooltipRoot(V),void 0===e.setTheme&&r.setTheme&&void 0!==O&&r.setTheme(O),void 0===e.getDebugVariables&&r.getDebugVariables&&void 0!==I&&r.getDebugVariables(I),void 0===e.execAction&&r.execAction&&void 0!==lt&&r.execAction(lt),"light"===h||"dark"===h?j=h:"system"===h?"undefined"!=typeof matchMedia?(P||(P=matchMedia("(prefers-color-scheme: dark)"),P.addListener((function(){"system"===h&&P&&(j=P.matches?"dark":"light")}))),j=P.matches?"dark":"light"):j="light":Q(ot(new Error("Unsupported theme"))),j&&(xt&&xt[j].forEach((t=>{const e=W.get(t.name);e&&e.setValue(t.color)}))),o(),!T&&Ft?`<div class="${S("divkit-b023c",!0)+S(n?` ${et}`:"",!0)+S(y?` ${y}`:"",!0)}">${z(Nr,"RootSvgFilters").$$render(t,{svgFiltersMap:at},{},{})} ${z(zr,"Unknown").$$render(t,{div:Ft,templateContext:{},layoutParams:{tooltips:Z}},{},{})}</div>`:""})),zn=Tn;function Nn(t){return zn.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,mix:t.mix,customization:t.customization,builtinProtocols:t.builtinProtocols,onError:t.onError,typefaceProvider:t.typefaceProvider,platform:t.platform}).html}var Jn=exports;for(var Rn in e)Jn[Rn]=e[Rn];e.__esModule&&Object.defineProperty(Jn,"__esModule",{value:!0})})();
2
2
  //# sourceMappingURL=server.js.map