@divkitframework/divkit 10.0.0 → 11.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/browser/client-devtool.js +1 -1
- package/dist/browser/client-devtool.js.map +1 -1
- package/dist/browser/client-hydratable.js +1 -1
- package/dist/browser/client-hydratable.js.map +1 -1
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/client-devtool.js +1 -1
- package/dist/client-devtool.js.map +1 -1
- package/dist/client-hydratable.js +1 -1
- package/dist/client-hydratable.js.map +1 -1
- package/dist/client.css +1 -1
- package/dist/client.css.map +1 -1
- package/dist/client.js +1 -1
- package/dist/client.js.map +1 -1
- package/dist/esm/client-devtool.mjs +1 -1
- package/dist/esm/client-devtool.mjs.map +1 -1
- package/dist/esm/client-hydratable.mjs +1 -1
- package/dist/esm/client-hydratable.mjs.map +1 -1
- package/dist/esm/client.mjs +1 -1
- package/dist/esm/client.mjs.map +1 -1
- package/dist/esm/server.mjs +1 -1
- package/dist/esm/server.mjs.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let s;function l(t){s=t}function u(){if(!s)throw new Error("Function called outside component initialization");return s}function c(t){u().$$.on_destroy.push(t)}function d(t,e){return u().$$.context.set(t,e),e}function v(t){return u().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>Qr,createVariable:()=>ze,render:()=>rn}),new Set,new Map;const g=[],p=[],f=[],h=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){f.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<g.length;){const t=g[$];$++,l(t),k(t.$$)}for(l(null),g.length=0,$=0;p.length;)p.pop()();for(let t=0;t<f.length;t+=1){const e=f[t];w.has(e)||(w.add(e),e())}f.length=0}while(g.length);for(;h.length;)h.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(b)}}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","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 E(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=T(n):r.style=T(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(F.test(t))return;const e=r[t];!0===e?n+=" "+t:C.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return i+r.substring(o)}function D(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]=D(t[r]);return e}function P(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const z={$$render:()=>""};function M(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`);return t}let I,O;function J(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:I,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const u=t(e,r,n,i);return l(a),u}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{I=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(I),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function T(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function U(t){const e=T(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(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){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.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 B=[];function L(t,e=r){let n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!B.length;for(const e of i)e[1](),B.push(e,t);if(e){for(let t=0;t<B.length;t+=2)B[t][0](B[t+1]);B.length=0}}var r,o}return{set:o,update:function(e){o(e(t))},subscribe:function(a,s=r){const l=[a,s];return i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function R(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,u=e.length<2;return c=t=>{let n=!1;const c=[];let d=0,v=r;const g=()=>{if(d)return;v();const n=e(s?c[0]:c,t);u?t(n):v=o(n)?n:r},p=l.map(((t,e)=>a(t,(t=>{c[e]=t,d&=~(1<<e),n&&g()}),(()=>{d|=1<<e}))));return n=!0,g(),function(){i(p),v()}},{subscribe:L(n,c).subscribe};var c}const W="divkit-bd25",q="divkit-c016",H=Symbol("root");function G(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const Z={text:"divkit-d9b0",text_halign_left:"divkit-a4cb",text_halign_center:"divkit-e165",text_halign_right:"divkit-ea28",text_valign_top:"divkit-d8ce",text_valign_center:"divkit-ef58",text_valign_bottom:"divkit-fe8e",text_width_content:"divkit-f41f",text_height_content:"divkit-ea52",text__inner:"divkit-b852",text_singleline:"divkit-ef11",text_truncate_none:"divkit-c6ea",text_multiline:"divkit-ee8e",text__inner_gradient:"divkit-cb8e",text__image:"divkit-bf6e",text__image_hidden:"divkit-f100"},Y={outer:"divkit-d65a","outer_hide-on-transition-in":"divkit-a6d1","outer_halign-self_start":"divkit-cc45","outer_halign-self_center":"divkit-b833","outer_halign-self_end":"divkit-c573","outer_halign-self_stretch":"divkit-dcc7","outer_valign-self_start":"divkit-e807","outer_valign-self_center":"divkit-d40a","outer_valign-self_end":"divkit-e9f8","outer_valign-self_stretch":"divkit-b7aa","outer_parent-flex_vertical":"divkit-c143","outer_parent-flex_horizontal":"divkit-ef30","outer_width-constrained":"divkit-d321","outer_height-constrained":"divkit-a525","outer_parent-overlap":"divkit-dab2","outer_parent-overlap-absolute":"divkit-d43f","outer_scroll-snap_center":"divkit-d9e3","outer_scroll-snap_start":"divkit-efd1",outer__border:"divkit-d405",outer_visibility_invisible:"divkit-f018",outer_visibility_gone:"divkit-e784","outer_has-action-animation":"divkit-f498"};function X(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 K(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 Q(t){let e=K(t);return"0"===e&&(e+="em"),e}function tt(t,e){for(;t.length<e;)t="0"+t;return t}function et(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=rt(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>tt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function rt(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,n,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,l=2===o.length?o:o+o,u=2===r.length?r:r+r;return{a:parseInt(u,16),r:parseInt(a,16),g:parseInt(s,16),b:parseInt(l,16)}}const[t,r,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function nt(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const it=Boolean;function ot(t){if(1===t.length&&"solid"===t[0].type)return{color:et(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=et(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(it);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>et(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:lt(t.bg.scale),pos:ut(t.bg),image:'url("'+nt(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(it);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=Q(n.value):"relative"===n.type&&(i=at[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${st(t.bg.center_x)} ${st(t.bg.center_y)},`+r.map((t=>et(t))).join(",")+")"}}({bg:t}):void 0)).filter(it).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 at={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function st(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return Q(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function lt(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function ut(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 ct(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const dt=new Set(["http","https","tel","mailto","intent"]);function vt(t){return dt.has(t)}function gt(t,e){e&&t.push(e)}function pt(t,e,r){const n=[];gt(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&>(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const ft=Symbol("state");function ht(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function mt(t){return ht(t)&&t>=0}function yt(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!mt(i[t]))return n;return function(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>K((t||e)/r*10))).join(" ")}(t,e,r)}function _t(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]&&!mt(r[t]))return e;return function(t){return K(t.top||0)+" "+K(t.right||0)+" "+K(t.bottom||0)+" "+K(t.left||0)}(t)}function bt(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const wt=Object.prototype.hasOwnProperty;function $t(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),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(!wt.call(e,i)||!$t(t[i],e[i]))return!1}return!0}function xt(t,e){return $t(t,e)?e:t}function kt(){}const Ct=Symbol("action"),Ft=J(((t,e,r,n)=>{let{actions:i}=e,{cls:o=""}=e,{style:a=null}=e,{attrs:s}=e,{use:l=kt}=e,{customAction:u=null}=e,{hasActionAnimation:c=!1}=e;const g=v(H),p=v(Ct);d(Ct,{hasAction:()=>Boolean(p.hasAction()||(null==i?void 0:i.length))});let f,h="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){h=e,f=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&p.hasAction()&&(h="",g.logError(G(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let m=Boolean(u);return h&&!vt(ct(h))&&(h="",m=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),void 0===e.cls&&r.cls&&void 0!==o&&r.cls(o),void 0===e.style&&r.style&&void 0!==a&&r.style(a),void 0===e.attrs&&r.attrs&&void 0!==s&&r.attrs(s),void 0===e.use&&r.use&&void 0!==l&&r.use(l),void 0===e.customAction&&r.customAction&&void 0!==u&&r.customAction(u),void 0===e.hasActionAnimation&&r.hasActionAnimation&&void 0!==c&&r.hasActionAnimation(c),h?`<a${E([{href:D(h)},{target:D(f)},{style:D(a)},{class:j(o,!0)+" "+j(c?"":W,!0)},S(s)],{})}>${n.default?n.default({}):""}</a>`:`<span${E([{class:j(o,!0)+j(m?` ${c?"":W} divkit-c016`:"",!0)},{style:D(a)},{role:D(m?"button":null)},S(s)],{})}>${n.default?n.default({}):""}</span>`})),Et=Ft,At="divkit-b921",Vt=J(((t,e,r,n)=>{let{background:i=[]}=e;const o=i.map((t=>{const e={},r=ot([t]),n={style:e};return"solid"===t.type&&(e["background-color"]=r.color),"gradient"===t.type&&(e["background-image"]=r.image),"image"===t.type&&(e.opacity=Number(t.alpha),n.image_url=t.image_url,e["object-fit"]=r.size,e["object-position"]=r.position),n}));return void 0===e.background&&r.background&&void 0!==i&&r.background(i),`<span${N("class","divkit-bf25",0)}>${P(o,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class",At,0)}${N("style",X(t.style),0)}>`:`<span${N("class",At,0)}${N("style",X(t.style),0)}></span>`))}</span>`}));function jt(t,e){const r=Number(t);return isNaN(r)?e:r}const Dt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,b,w,$,x,k,C,F,E,A,V,j,D,S,P,z,I,O,J,T,U,B,L,R,W=r,q=r,Z=r,tt=r,rt=r,nt=r,it=r,at=r,st=r,lt=r,ut=r,dt=r,gt=r,ht=r,wt=r;var $t,kt,Ct,Ft,At,Dt;let{json:St={}}=e,{origJson:Pt}=e,{templateContext:zt}=e,{cls:Mt=""}=e,{style:It}=e,{layoutParams:Ot={}}=e,{customDescription:Jt=!1}=e,{customPaddings:Nt=!1}=e,{customActions:Tt=""}=e,{forceWidth:Ut=!1}=e,{forceHeight:Bt=!1}=e;const Lt={left:"start",center:"center",right:"end"},Rt={top:"start",center:"center",bottom:"end"},Wt=v(H),qt=v(ft);let Ht,Gt,Zt,Yt,Xt,Kt,Qt,te={},ee={},re=!1,ne=1,ie="transparent",oe=0,ae="",se="",le="",ue={},ce=0,de=0,ve=0,ge={},pe=0,fe=0,he=0,me=1;const ye=St.transition_triggers||["state_change","visibility_change"],_e=-1!==ye.indexOf("state_change")&&St.id,be=-1!==ye.indexOf("visibility_change")&&St.id;let we,$e,xe,ke,Ce,Fe,Ee,Ae,Ve,je=[],De="",Se=!1,Pe="visible",ze=0,Me=0;void 0===e.json&&n.json&&void 0!==St&&n.json(St),void 0===e.origJson&&n.origJson&&void 0!==Pt&&n.origJson(Pt),void 0===e.templateContext&&n.templateContext&&void 0!==zt&&n.templateContext(zt),void 0===e.cls&&n.cls&&void 0!==Mt&&n.cls(Mt),void 0===e.style&&n.style&&void 0!==It&&n.style(It),void 0===e.layoutParams&&n.layoutParams&&void 0!==Ot&&n.layoutParams(Ot),void 0===e.customDescription&&n.customDescription&&void 0!==Jt&&n.customDescription(Jt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Nt&&n.customPaddings(Nt),void 0===e.customActions&&n.customActions&&void 0!==Tt&&n.customActions(Tt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Ut&&n.forceWidth(Ut),void 0===e.forceHeight&&n.forceHeight&&void 0!==Bt&&n.forceHeight(Bt),o=Wt.getDerivedFromVars(St.border),wt(),wt=a(o,(t=>R=t));{let t={},e={},r=!1;if(R){if(R.has_shadow){const e=R.shadow;t["box-shadow"]=e?K((null===(kt=null===($t=e.offset)||void 0===$t?void 0:$t.x)||void 0===kt?void 0:kt.value)||0)+" "+K((null===(Ft=null===(Ct=e.offset)||void 0===Ct?void 0:Ct.y)||void 0===Ft?void 0:Ft.value)||0)+" "+K(null!==(At=e.blur)&&void 0!==At?At:2)+" "+et(e.color||"#000000",null!==(Dt=e.alpha)&&void 0!==Dt?Dt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}R.stroke&&(r=!0,ne=bt(R.stroke.width,ne),ie=et(R.stroke.color,1,ie),e.border=`${K(ne)} solid ${ie}`),R.corners_radius?(ae=yt(R.corners_radius,0,10,ae),e["border-radius"]=t["border-radius"]=ae):R.corner_radius&&(oe=bt(R.corner_radius,oe),e["border-radius"]=t["border-radius"]=K(oe))}te=xt(t,te),ee=xt(e,ee),re=r}s=Wt.getDerivedFromVars(St.paddings),ht(),ht=a(s,(t=>L=t)),se=_t(L&&!Nt?L:void 0,se),l=Wt.getDerivedFromVars(St.margins),dt(),dt=a(l,(t=>U=t)),le=_t(U,le),u=Wt.getDerivedFromVars(St.width),lt(),lt=a(u,(t=>J=t)),c=Wt.getDerivedFromVars(St.alignment_horizontal),gt(),gt=a(c,(t=>B=t));{let t,e,r={},n=0,i=0;const o=null==J?void 0:J.type;if("fixed"===o?(ce=bt(null==J?void 0:J.value,ce),e=K(ce)):"wrap_content"===o||!Ot.overlapParent&&"match_parent"===o&&Ot.parentHorizontalWrapContent?(t="content",("wrap_content"===o&&(null==J?void 0:J.constrained)||"match_parent"===o&&Ot.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===o&&Wt.logError(G(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Ot.parentLayoutOrientation?e=`calc(100% - ${Q(((null==U?void 0:U.left)||0)+((null==U?void 0:U.right)||0))})`:"horizontal"===Ot.parentContainerOrientation&&(n=J&&"weight"in J&&J.weight||1)),"content"===t&&Ut&&(t="parent",Wt.logError(G(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=B;r["halign-self"]="left"===t||"center"===t||"right"===t?Lt[t]:Ot.parentHAlign||"start"}t&&(r.width=t),Zt=e,de=n,ve=i,ue=xt(r,ue)}d=Wt.getDerivedFromVars(St.height),st(),st=a(d,(t=>O=t)),g=Wt.getDerivedFromVars(St.alignment_vertical),ut(),ut=a(g,(t=>T=t));{let t,e,r={},n=0,i=0;const o=null==O?void 0:O.type;if("fixed"===o?(pe=bt(null==O?void 0:O.value,pe),e=K(pe)):"match_parent"!==o||!Ot.overlapParent&&Ot.parentVerticalWrapContent?(t="content",("wrap_content"===o&&(null==O?void 0:O.constrained)||"match_parent"===o&&Ot.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===o&&Wt.logError(G(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Ot.parentLayoutOrientation?e=`calc(100% - ${Q(((null==U?void 0:U.top)||0)+((null==U?void 0:U.bottom)||0))})`:"vertical"===Ot.parentContainerOrientation&&(n=(null==O?void 0:O.weight)||1)),"content"===t&&Bt&&(t="parent",Wt.logError(G(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=T;r["valign-self"]="top"===t||"center"===t||"bottom"===t?Rt[t]:Ot.parentVAlign||"start"}t&&(r.height=t),Yt=e,fe=n,he=i,ge=xt(r,ge)}var Ie,Oe;if(p=!!Ot.overlapParent||void 0,f=Ot.overlapParent&&(!J||"match_parent"===J.type)&&"match_parent"===(null==O?void 0:O.type),h=Ot.gridArea?`${Ot.gridArea.y+1}/${Ot.gridArea.x+1}/span ${Ot.gridArea.rowSpan}/span ${Ot.gridArea.colSpan}`:void 0,m=Wt.getDerivedFromVars(St.alpha),at(),at=a(m,(t=>I=t)),Oe=me,me=!mt(Ie=I)||void 0===Ie||Ie>1?Oe:Number(Ie),Xt=1===me?void 0:me,y=Wt.getDerivedFromVars(St.accessibility),it(),it=a(y,(t=>z=t)),Gt=void 0,z&&!Jt&&z.description&&(Gt={},Gt["aria-label"]=z.description),b=Wt.getDerivedFromVars(St.background),nt(),nt=a(b,(t=>P=t)),Kt={},Qt=!1,P&&(Qt=P.some((t=>"image"===t.type)),!Qt)){const t=ot(P);Kt["background-color"]=t.color,Kt["background-image"]=t.image,Kt["background-size"]=t.size,Kt["background-position"]=t.position,Kt["background-repeat"]="no-repeat"}we=void 0,_e&&St.transition_in&&Wt.isRunning("stateChange")&&(we=!0),xe=void 0,_e&&St.transition_change&&Wt.isRunning("stateChange")&&qt.hasTransitionChange(St.id)&&(xe=!0),w=Wt.getDerivedFromVars(St.action),tt(),tt=a(w,(t=>D=t)),$=Wt.getDerivedFromVars(St.actions),rt(),rt=a($,(t=>S=t));{let t=S||D&&[D]||[];Array.isArray(t)?t.length&&Tt&&(t=[],Wt.logError(G(new Error(`Cannot use action on component "${Tt}"`)))):(t=[],Wt.logError(G(new Error("Actions should be array")))),je=t}x=Wt.getDerivedFromVars(St.action_animation),Z(),Z=a(x,(t=>j=t)),j&&(De=function t(e){var r;const n=jt(e.start_value,1),i=jt(e.end_value,1),o=bt(e.start_delay,0),a=bt(e.duration,300),s=function(t,e){return"linear"===t||"ease"===t||"ease_in_out"===t||"ease_in"===t||"ease_out"===t?t:"ease_in_out"}(e.interpolator).replace(/_/g,"-");switch(e.name){case"fade":return ke=n,Ce=i,`opacity ${a}ms ${s} ${o}ms`;case"scale":return Fe=n,Ee=i,`transform ${a}ms ${s} ${o}ms`;case"set":return(null===(r=e.items)||void 0===r?void 0:r.length)?e.items.map(t).join(", "):(Wt.logError(G(new Error("Empty items value for action_animation with name='set'"))),"");default:return Wt.logError(G(new Error("Unknown action_animation name"),{additional:{animation:e.name}})),""}}(j)),k=Wt.getDerivedFromVars(St.visibility),q(),q=a(k,(t=>V=t));{const t=Pe,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(V,Pe);t!==e&&(!Se||"visible"!==Pe&&"visible"!==e?Pe=e:async function(t){Pe=t;const e="visible"===t?"in":"out",r="in"===e?St.transition_in:St.transition_out;be&&r&&(await _(),"in"===e&&($e=!0),qt.runVisibilityTransition(Object.assign(Object.assign({},St),{visibility:"visible"}),zt,r,Ht,e).then((()=>{"in"===e&&($e=!1)})).catch((t=>{throw"in"===e&&($e=!1),t})))}(e)),Se||(Se=!0)}if(C=Object.assign(Object.assign(Object.assign({},ue),ge),{"parent-overlap":p,"parent-overlap-absolute":f,"scroll-snap":Ot.scrollSnap,"hide-on-transition-in":we||$e||xe,visibility:Pe,"has-action-animation":Boolean(De),"parent-flex":Ot.parentContainerOrientation||void 0}),F=Wt.getDerivedFromVars(St.transform),W(),W=a(F,(t=>A=t)),A&&void 0!==A.rotation){const t=A.pivot_x||{type:"pivot-percentage",value:50};ze=jt(t.value,ze);const e="pivot-fixed"===t.type?K(ze):`${ze}%`,r=A.pivot_y||{type:"pivot-percentage",value:50};Me=jt(r.value,Me),Ae=`${e} ${"pivot-fixed"===r.type?K(Me):`${Me}%`}`,Ve=`rotate(${A.rotation}deg)`}return E=Object.assign(Object.assign(Object.assign(Object.assign({},It),Kt),te),{width:Zt,height:Yt,"grid-area":h,padding:se,margin:le,opacity:Xt,transition:De,"transform-origin":Ae,transform:Ve,"flex-grow":de||fe||void 0,"flex-shrink":ve||he?1:void 0,"flex-basis":de||fe?0:void 0,"--divkit-animation-opacity-start":ke,"--divkit-animation-opacity-end":Ce,"--divkit-animation-scale-start":Fe,"--divkit-animation-scale-end":Ee}),W(),q(),Z(),tt(),rt(),nt(),it(),at(),st(),lt(),ut(),dt(),gt(),ht(),wt(),`${M(Et,"Actionable").$$render(t,{use:function(t){Ht=t,_e&&St.transition_in&&qt.registerChildWithTransitionIn(St,zt,St.transition_in,t).then((()=>{we=!1})).catch((t=>{throw we=!1,t})),_e&&St.transition_out&&qt.registerChildWithTransitionOut(St,zt,St.transition_out,t),_e&&St.transition_change&&qt.registerChildWithTransitionChange(St,zt,St.transition_change,t).then((()=>{xe=!1})).catch((t=>{throw xe=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=ct(n);t&&!vt(t)&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Wt.getJsonWithVars(St.visibility_actions||St.visibility_action&&[St.visibility_action]),rootCtx:Wt});const e=St.id;e&&qt.registerChild(e);let r=null;return{destroy(){e&&qt.unregisterChild(e),r&&r.destroy()}}},cls:Mt+" "+pt("outer",Y,C),style:X(E),actions:je,attrs:Gt,hasActionAnimation:Boolean(De)},{},{default:()=>`${Qt?`${M(Vt,"OuterBackground").$$render(t,{background:P},{},{})}`:""}${i.default?i.default({}):""}${re?`<span${N("class",Y.outer__border,0)}${N("style",X(ee),0)}></span>`:""}`})}`})),St={"text-range":"divkit-faf0","text-range_singleline":"divkit-ccb6","text-range__top-offset":"divkit-d923","text-range_decoration_both":"divkit-d7e0","text-range_decoration_underline":"divkit-f3dd","text-range_decoration_strike":"divkit-d27b","text-range_decoration_none":"divkit-c6b0"};function Pt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function zt(t){return ht(t)&&t>0}function Mt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function It(t,e){return Mt(t)||e}const Ot=J(((t,e,r,n)=>{let i,o,a,s,{text:l}=e,{rootFontSize:u}=e,{textStyles:c={}}=e,{singleline:d=!1}=e,{actions:v}=e,g="none",p=12,f=1.25,h="",m="";void 0===e.text&&r.text&&void 0!==l&&r.text(l),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==u&&r.rootFontSize(u),void 0===e.textStyles&&r.textStyles&&void 0!==c&&r.textStyles(c),void 0===e.singleline&&r.singleline&&void 0!==d&&r.singleline(d),void 0===e.actions&&r.actions&&void 0!==v&&r.actions(v);{let t="none";(c.underline||c.strike)&&("single"===c.underline&&"single"===c.strike?t="both":"single"===c.underline?t="underline":"single"===c.strike&&(t="strike")),g=t}return p=Pt(c.font_size,p),zt(c.line_height)&&(f=Number(c.line_height)/p),mt(c.letter_spacing)&&(h=K(c.letter_spacing)),s=It(c.font_weight,s),m=et(c.text_color,1,m),i=c.top_offset?K(c.top_offset):"",o={singleline:d,decoration:g},a={"font-size":K(10*p/u),"line-height":f,"letter-spacing":h,"font-weight":s,color:m},`${i?`<span${N("class",St["text-range__top-offset"],0)}${U({"margin-top":i})}></span>`:""}${M(Et,"Actionable").$$render(t,{cls:pt("text-range",St,o),actions:v,style:X(a)},{},{default:()=>`${j(l)}`})}`}));function Jt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Nt(t,e){return"top"===t||"center"===t||"bottom"===t?t:e}const Tt=J(((t,e,n,i)=>{let o,s,l,u,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V,j,D,S,z,I,O,J,T,U,B,L,R,W,Y,Q,tt=r,rt=r,nt=r,it=r,at=r,st=r,lt=r,ut=r,ct=r,dt=r,vt=r,gt=r,ft=r,ht=r,mt=r,{json:yt={}}=e,{templateContext:_t}=e,{origJson:bt}=e,{layoutParams:wt}=e;const $t=v(H);let xt=!1,kt="",Ct=12,Ft=1.25,Et=!1,At="",Vt="",jt=!1,St="left",Mt="top",It="",Tt="",Ut=!1,Bt=[],Lt=[];var Rt,Wt;c((()=>{Lt.forEach((t=>{$t.removeSvgFilter(t)}))})),void 0===e.json&&n.json&&void 0!==yt&&n.json(yt),void 0===e.templateContext&&n.templateContext&&void 0!==_t&&n.templateContext(_t),void 0===e.origJson&&n.origJson&&void 0!==bt&&n.origJson(bt),void 0===e.layoutParams&&n.layoutParams&&void 0!==wt&&n.layoutParams(wt),o=$t.getDerivedFromVars(yt.text),mt(),mt=a(o,(t=>Q=t)),Rt=Q,Wt=kt,kt=String(null!=Rt?Rt:"")||Wt,kt?xt=!1:(xt=!0,$t.logError(G(new Error('Missing "text" prop for div "text"')))),s=$t.getDerivedFromVars(yt.ranges),it(),it=a(s,(t=>z=t)),l=$t.getDerivedFromVars(yt.images),nt(),nt=a(l,(t=>S=t)),u=$t.getDerivedFromVars({font_size:yt.font_size,letter_spacing:yt.letter_spacing,font_weight:yt.font_weight,text_color:yt.text_color,underline:yt.underline,strike:yt.strike,line_height:yt.line_height}),at(),at=a(u,(t=>I=t)),d=$t.getDerivedFromVars(yt.font_size),ht(),ht=a(d,(t=>Y=t)),Ct=Pt(Y,Ct),g=$t.getDerivedFromVars(yt.line_height),ft(),ft=a(g,(t=>W=t));{const t=W;zt(t)?(Ft=Number(t)/Ct,Et=!0):Et=!1}p=$t.getDerivedFromVars(yt.max_lines),dt(),dt=a(p,(t=>B=t)),f=1===B;{let t="",e="",r=!1;if(B&&B>1){let n=Number(B);t=n*Ft+"em",z||S||(e=n,r=!0)}At=t,Vt=e,jt=r}h=$t.getDerivedFromVars(yt.text_alignment_horizontal),gt(),gt=a(h,(t=>R=t)),St=Jt(R,St),m=$t.getDerivedFromVars(yt.text_alignment_vertical),vt(),vt=a(m,(t=>L=t)),Mt=Nt(L,Mt),y=!z||kt&&1===z.length&&z[0]&&0===z[0].start&&"number"==typeof z[0].end&&z[0].end>=kt.length,_=$t.getDerivedFromVars(yt.text_color),ct(),ct=a(_,(t=>U=t)),b=Boolean(U)!==Boolean(z&&z[0]&&z[0].text_color);{let t="";B&&y&&b&&(t=et(U||z&&z[0]&&z[0].text_color,1,It)),It=t}w=$t.getDerivedFromVars(yt.truncate),ut(),ut=a(w,(t=>T=t)),$="none"===T?"none":"",x=$t.getDerivedFromVars(yt.text_gradient),lt(),lt=a(x,(t=>J=t));{let t="";if(J){const e=ot([J]);e.image&&(t=e.image)}Tt=t}return k=$t.getDerivedFromVars(yt.selectable),st(),st=a(k,(t=>O=t)),Ut=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(O,Ut),C=$t.getDerivedFromVars(yt.width),rt(),rt=a(C,(t=>D=t)),F=$t.getDerivedFromVars(yt.height),tt(),tt=a(F,(t=>j=t)),function(t,e,r){let n=[];if(Lt.forEach((t=>{$t.removeSvgFilter(t)})),Lt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(Bt=[]);const i=t;let o=e||[{start:0,end:i.length}],a=r||[],s=0,l=[],u=[];o.forEach((t=>{void 0!==t.start&&void 0!==t.end&&(u.push({index:t.start,range:t,type:"rangeStart",isStart:!0}),u.push({index:t.end,range:t,type:"rangeEnd"}))})),a.forEach(((t,e)=>{void 0!==t.start&&t.url&&t.start<=i.length&&u.push({index:t.start,image:t,type:"image",arrayIndex:e})})),u.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)),u.forEach((t=>{var e;let r="image"===t.type?null:t.range,o=t.index;if(o>s){let r=Object.assign(Object.assign({},I),...l);n.push({text:i.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({},I),...l),r=K(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=K(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":K(10*(Number(e.font_size)||12)/Ct)};let a="";if(t.image.tint_color){const e=et(t.image.tint_color);a=$t.addSvgFilter(e),Lt.push(e)}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},I)}),Bt=n}(kt,z,S),E={singleline:f,multiline:jt,halign:St,valign:Mt,truncate:$,width:"wrap_content"!==(null==D?void 0:D.type)||D.constrained?"":"content",height:!j||"wrap_content"===j.type&&!j.constrained?"content":""},A={gradient:Boolean(Tt)},V={"font-size":K(Ct),"line-height":Ft,"max-height":At,"-webkit-line-clamp":Vt,color:It,"background-image":Tt},tt(),rt(),nt(),it(),at(),st(),lt(),ut(),ct(),dt(),vt(),gt(),ft(),ht(),mt(),xt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("text",Z,E)+" "+(Ut?"":q),json:yt,origJson:bt,templateContext:_t,layoutParams:wt},{},{default:()=>`<span${N("class",pt("text__inner",Z,A),0)}${N("style",X(V),0)}>${Bt.length?`${P(Bt,((e,r)=>"text"in e?e.text?`${M(Ot,"TextRangeView").$$render(t,{text:e.text,rootFontSize:Ct,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",X(e.image.wrapperStyle),0)}><img${N("class",Z.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",X({width:e.image.width,height:e.image.height,"margin-top":Et?`-${e.image.height}`:void 0,"margin-bottom":Et?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${M(Ot,"TextRangeView").$$render(t,{text:kt,rootFontSize:Ct,textStyles:I,singleline:f},{},{})}`}</span>`})}`})),Ut=Tt,Bt={container:"divkit-d37d",container_orientation_vertical:"divkit-ddc3",container_valign_top:"divkit-a331",container_valign_center:"divkit-aae6",container_valign_bottom:"divkit-c222",container_orientation_horizontal:"divkit-fe45",container_halign_left:"divkit-a309",container_halign_center:"divkit-bac9",container_halign_right:"divkit-f423",container_orientation_overlap:"divkit-a644"},Lt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b=r,w=r,$=r,x=r,k=r,{json:C={}}=e,{templateContext:F}=e,{origJson:E}=e,{layoutParams:A}=e;const V={left:"start",center:"center",right:"end"},j={top:"start",center:"center",bottom:"end"},D=v(H);let S=!1,z="vertical",I="top",O="left",J={};void 0===e.json&&n.json&&void 0!==C&&n.json(C),void 0===e.templateContext&&n.templateContext&&void 0!==F&&n.templateContext(F),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==A&&n.layoutParams(A),o=C.items,(null==o?void 0:o.length)&&Array.isArray(o)?S=!1:(S=!0,D.logError(G(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!S&&o||[]).map((t=>{let e=t,r=F;return({templateContext:r,json:e}=D.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=D.getDerivedFromVars(C.orientation),k(),k=a(l,(t=>_=t)),z=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}(_,z),u=D.getDerivedFromVars(C.content_alignment_vertical),x(),x=a(u,(t=>y=t)),I=Nt(y,I),c=D.getDerivedFromVars(C.content_alignment_horizontal),$(),$=a(c,(t=>m=t)),O=Jt(m,O),d=D.getDerivedFromVars(C.width),b(),b=a(d,(t=>f=t)),g=D.getDerivedFromVars(C.height),w(),w=a(g,(t=>h=t));{let t={};"overlap"===z&&(t.overlapParent=!0),"horizontal"!==z&&(t.parentHAlign=V[O],(!h||"wrap_content"===h.type||"match_parent"===h.type&&(null==A?void 0:A.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==z&&(t.parentVAlign=j[I],("wrap_content"===(null==f?void 0:f.type)||"match_parent"===(null==f?void 0:f.type)&&(null==A?void 0:A.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===z&&(t.parentContainerOrientation="horizontal"),"vertical"===z&&(t.parentContainerOrientation="vertical"),J=xt(t,J)}return p={orientation:z,valign:I,halign:O},b(),w(),$(),x(),k(),S?"":`${M(Dt,"Outer").$$render(t,{cls:pt("container",Bt,p),json:C,origJson:E,templateContext:F,layoutParams:A},{},{default:()=>`${P(s,(e=>`${M(Te,"Unknown").$$render(t,{layoutParams:J,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Rt={separator:"divkit-a30b",separator_orientation_horizontal:"divkit-f529",separator_orientation_vertical:"divkit-e9e2",separator__inner:"divkit-db7d"};function Wt(t,e){return"vertical"===t||"horizontal"===t?t:e}const qt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(H);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==f&&n.json(f),void 0===e.templateContext&&n.templateContext&&void 0!==h&&n.templateContext(h),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=_.getDerivedFromVars(f.delimiter_style),p(),p=a(o,(t=>g=t)),b=Wt(null==g?void 0:g.orientation,b),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=et(null==g?void 0:g.color,1,w),l="horizontal"===b?"100%":K(1),u="horizontal"===b?K(1):"100%",c={background:w,width:l,height:u},d={orientation:b},p(),`${M(Dt,"Outer").$$render(t,{cls:pt("separator",Rt,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>s?`<span${N("class",Rt.separator__inner,0)}${N("style",X(c),0)}></span>`:""})}`})),Ht={image:"divkit-a448","image_is-width-content":"divkit-fe14","image_is-height-content":"divkit-f4d9",image__image:"divkit-ce04",image_error:"divkit-f10d","image__aspect-wrapper":"divkit-dc80",image_aspect:"divkit-ae78"},Gt=J(((t,e,n,i)=>{let o,s,l,u,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V,j,D,S,P,z,I,O,J=r,T=r,B=r,L=r,R=r,W=r,q=r,Z=r,Y=r,K=r,Q=r,{json:tt={}}=e,{templateContext:rt}=e,{origJson:it}=e,{layoutParams:ot}=e;const at=v(H);let st,ct=!1,dt=!0,vt="rgba(0,0,0,0.08)",gt=!1,ft="",ht="none",mt="50% 50%",yt="0",_t="";c((()=>{at.removeSvgFilter(st)})),void 0===e.json&&n.json&&void 0!==tt&&n.json(tt),void 0===e.templateContext&&n.templateContext&&void 0!==rt&&n.templateContext(rt),void 0===e.origJson&&n.origJson&&void 0!==it&&n.origJson(it),void 0===e.layoutParams&&n.layoutParams&&void 0!==ot&&n.layoutParams(ot),o=at.getDerivedFromVars(tt.image_url),Q(),Q=a(o,(t=>O=t)),s=at.getDerivedFromVars(tt.gif_url),K(),K=a(s,(t=>I=t)),l=O||I,dt=!0,ct=!1,l?gt=!1:(gt=!0,at.logError(G(new Error('Missing "image_url" for "image"')))),u=at.getDerivedFromVars(tt.width),Y(),Y=a(u,(t=>z=t)),d="wrap_content"===(null==z?void 0:z.type),g=at.getDerivedFromVars(tt.height),Z(),Z=a(g,(t=>P=t)),p="wrap_content"===(null==P?void 0:P.type),f=at.getDerivedFromVars(tt.preview),q(),q=a(f,(t=>S=t));{const t=S;ft=t?t.startsWith("data:")?`url("${nt(t)}")`:`url("data:image/jpg;base64,${nt(t)}")`:""}h=at.getDerivedFromVars(tt.placeholder_color),W(),W=a(h,(t=>D=t)),vt=et(D,1,vt),m=at.getDerivedFromVars(tt.scale),R(),R=a(m,(t=>j=t)),ht=lt(j)||ht,y=at.getDerivedFromVars({content_alignment_horizontal:tt.content_alignment_horizontal,content_alignment_vertical:tt.content_alignment_vertical}),L(),L=a(y,(t=>V=t)),mt=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:ut(t)}(V,mt),_=at.getDerivedFromVars(tt.accessibility),B(),B=a(_,(t=>A=t)),b=(null==A?void 0:A.description)||"",w=at.getDerivedFromVars(tt.aspect),T(),T=a(w,(t=>E=t));{const t=null==E?void 0:E.ratio;yt=t&&zt(t)?(100/Number(t)).toFixed(2):"0"}$=at.getDerivedFromVars(tt.tint_color),J(),J=a($,(t=>F=t));{const t=F,e=t?et(t):void 0;e!==st&&(at.removeSvgFilter(st),_t=e?at.addSvgFilter(e):"",st=e)}return x={aspect:"0"!==yt,"is-width-content":d,"is-height-content":p},k={"background-image":ft,"background-color":vt,"object-fit":ht,"object-position":mt,filter:""},C=X(k),J(),T(),B(),L(),R(),W(),q(),Z(),Y(),K(),Q(),gt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("image",Ht,x),json:tt,origJson:it,templateContext:rt,layoutParams:ot,customDescription:!0},{},{default:()=>x.aspect?`<span${N("class",Ht["image__aspect-wrapper"],0)}${U({"padding-bottom":`${yt}%`})}><img${N("class",Ht.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",C,0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",Ht.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",X(k),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),Zt={grid:"divkit-d908",grid_halign_left:"divkit-f63b",grid_halign_center:"divkit-a14a",grid_halign_right:"divkit-b071",grid_valign_top:"divkit-fbca",grid_valign_center:"divkit-d431",grid_valign_bottom:"divkit-e420"};function Yt(t){return t>0&&t<1}function Xt(t){return String(Math.ceil(1e3*t)/1e3)}function Kt(t,e,r){if(t.some(Yt)){const e=Math.max(...t.filter(Yt).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${K(n*t[e]/i)},${Xt(t[e])}fr)`:t[e]?o[e]=`${Xt(t[e])}fr`:o[e]="auto";return o.join(" ")}const Qt=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:C}=e,{layoutParams:F}=e;const E=v(H);let A,V,j=!1,D=1,S=[],z=[],I=[],O=[],J=0,N=!1,T="top",U="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==C&&n.origJson(C),void 0===e.layoutParams&&n.layoutParams&&void 0!==F&&n.layoutParams(F),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,E.logError(G(new Error('Incorrect or empty "items" prop for div "grid"')))),s=E.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=Pt(y,D),l=(!j&&o||[]).map((t=>{let e=t,r=k;return({templateContext:r,json:e}=E.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}}));{let t=[];l.forEach((e=>{t.push(E.getDerivedFromVars({rowSpan:e.json.row_span,columnSpan:e.json.column_span,width:e.json.width,height:e.json.height}))})),A=R(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],z=[],I=[],O=[],N=!1,V=l.map(((n,i)=>{var o,a,s,l;const u=m[i],c=Number(u.columnSpan)||1,d=Number(u.rowSpan)||1,v={x:e,y:r,colSpan:c,rowSpan:d},g="match_parent"===(null===(o=u.width)||void 0===o?void 0:o.type)?Number(u.width.weight||1)/c:0,p="match_parent"===(null===(a=u.height)||void 0===a?void 0:a.type)?Number(u.height.weight||1)/d:0,f=1===c&&"fixed"===(null===(s=u.width)||void 0===s?void 0:s.type)&&u.width.value?Number(u.width.value)/c:0,h=1===d&&"fixed"===(null===(l=u.height)||void 0===l?void 0:l.type)&&u.height.value?Number(u.height.value)/d:0;for(let n=e;n<e+c;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<g)&&(S[n]=g),(!z[e]||z[e]<p)&&(z[e]=p),(!I[n]||I[n]<f)&&(I[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v}})})),0!==e&&(N=!0),N&&E.logError(G(new Error('Mismatching "grid" rows/columns'))),J=r}return u=E.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(u,(t=>h=t)),T=Nt(h,T),c=E.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(c,(t=>f=t)),U=Jt(f,U),d={valign:T,halign:U},g={"grid-template-columns":Kt(S,I,D),"grid-template-rows":Kt(z,O,J)},p=j||N,_(),b(),w(),$(),p?"":`${M(Dt,"Outer").$$render(t,{cls:pt("grid",Zt,d),json:x,origJson:C,templateContext:k,style:g,layoutParams:F},{},{default:()=>`${P(V,(e=>`${M(Te,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),te=Qt,ee={gallery:"divkit-cbb0",gallery_orientation_horizontal:"divkit-c9be",gallery_orientation_vertical:"divkit-a72d",gallery__scroller:"divkit-a4e3","gallery_scroll-snap":"divkit-f606","gallery__items-grid":"divkit-eb4a",gallery__items:"divkit-af27",gallery__arrow:"divkit-b72d","gallery__arrow-icon":"divkit-d100",gallery__arrow_left:"divkit-a0a5",gallery__arrow_right:"divkit-f0f5","gallery__arrow-icon-path":"divkit-b417"};function re(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}const ne=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V=r,j=r,D=r,S=r,z=r,I=r,O=r,J=r,{json:T={}}=e,{templateContext:U}=e,{origJson:B}=e,{layoutParams:L}=e;const W=v(H);let q,Z,Y,Q=[],tt=!1,et=1,rt="horizontal",nt="start",it=8,ot="",at=[],st={},lt=!1,ut={},ct=0;function dt(){let t=[],e=Q[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<et;++e){const n=Q[e].children[r];n&&t.push(n)}return t}function vt(t,e,r="smooth"){const n="horizontal"===rt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";q.scroll({[o]:Math.max(0,t[e][i]-it/2),behavior:r})}function gt(t){const e=dt(),r=q.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===rt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==n)return n;const i=e.map((t=>function(t,e){return"horizontal"===rt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}T.id&&!tt&&W.registerInstance(T.id,{setCurrentItem(t){const e=dt();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');vt(e,t)},setPreviousItem(t){const e=gt("prev"),r=dt();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),vt(r,n)},setNextItem(t){const e="horizontal"===rt?q.scrollLeft+q.offsetWidth===q.scrollWidth:q.scrollTop+q.offsetHeight===q.scrollHeight,r=dt();if(e&&"ring"===t)return void vt(r,0);const n=gt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),vt(r,i)}}),void 0===e.json&&n.json&&void 0!==T&&n.json(T),void 0===e.templateContext&&n.templateContext&&void 0!==U&&n.templateContext(U),void 0===e.origJson&&n.origJson&&void 0!==B&&n.origJson(B),void 0===e.layoutParams&&n.layoutParams&&void 0!==L&&n.layoutParams(L),o=T.items,(null==o?void 0:o.length)&&Array.isArray(o)?tt=!1:(tt=!0,W.logError(G(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!tt&&o||[]).map((t=>{let e=t,r=U;return({templateContext:r,json:e}=W.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=W.getDerivedFromVars(T.column_count),J(),J=a(l,(t=>A=t)),et=Pt(A,et),u=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(s,et),c=W.getDerivedFromVars(T.orientation),O(),O=a(c,(t=>E=t)),rt=Wt(E,rt),d=W.getDerivedFromVars(T.cross_content_alignment),I(),I=a(d,(t=>F=t)),nt=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(F,nt),g=W.getDerivedFromVars(T.item_spacing),z(),z=a(g,(t=>C=t)),it=bt(C,it),Z=K(it),p=W.getDerivedFromVars(T.paddings),S(),S=a(p,(t=>k=t)),ot=_t(k,ot),f="horizontal"===rt?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===rt?"width":"height";t.push(W.getDerivedFromVars(e.json[r]))})),Y=R(t,(t=>t)),D(),D=a(Y,(t=>x=t))}at=[],et>1?at.push("auto"):x.forEach((t=>{!t&&"horizontal"===rt||"match_parent"===(null==t?void 0:t.type)?at.push("100%"):at.push("max-content")})),h=W.getDerivedFromVars(T.scroll_mode),j(),j=a(h,(t=>$=t));{const t={};let e={};lt=!1,"horizontal"===rt?e.parentVAlign=nt:e.parentHAlign=nt,"paging"===$&&(lt=!0,e.scrollSnap="start",t["horizontal"===rt?"scroll-padding-left":"scroll-padding-top"]=K(it/2)),1===et&&(e.parentLayoutOrientation=rt),st=xt(t,st),ut=xt(e,ut)}return m={padding:ot,"grid-gap":Z},y={"grid-gap":Z,[f]:re(at)},_={orientation:rt,"scroll-snap":lt},b=W.getDerivedFromVars(T.default_item),V(),V=a(b,(t=>w=t)),ct=bt(w,ct),V(),j(),D(),S(),z(),I(),O(),J(),tt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("gallery",ee,_),json:T,origJson:B,templateContext:U,layoutParams:L,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===rt,forceWidth:"horizontal"===rt},{},{default:()=>`<div${N("class",ee.gallery__scroller,0)}${N("style",X(st),0)}${N("this",q,0)}><div${N("class",ee["gallery__items-grid"],0)}${N("style",X(m),0)}>${P(u,((e,r)=>`<div${N("class",ee.gallery__items,0)}${N("style",X(y),0)}${N("this",Q[r],0)}>${P(e,(e=>`${M(Te,"Unknown").$$render(t,{layoutParams:ut,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===rt?"\n ":""}`})}`})),ie=ne,oe={tabs:"divkit-e0df",tabs__list:"divkit-ea19",tabs__item:"divkit-c25c",tabs__item_selected:"divkit-d560",tabs__item_actionable:"divkit-dfda",tabs__panels:"divkit-f5dc",tabs__swiper:"divkit-eb42",tabs__swiper_animated:"divkit-b9f1",tabs__swiper_inited:"divkit-fa57",tabs__panel:"divkit-cc9f",tabs__panel_visible:"divkit-e730",tabs__separator:"divkit-b85b"},ae=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,b,w,$,x,k,C,F=r,E=r,A=r,V=r,D=r,S=r,z=r;var I;let{json:O={}}=e,{templateContext:J}=e,{origJson:T}=e,{layoutParams:B}=e;const L=v(H),R=L.genId("tabs");let W,q,Z,Y=!1,Q={};const tt=L.getJsonWithVars(O.selected_tab);let rt,nt,it=tt&&Number(tt)||0,ot=12,at="",st="",lt="",ut="",ct="",dt="",vt="",gt="",ft="",ht="",bt=!1,wt=!1,$t=it,kt=[],Ct=[];async function Ft(t,e=!1){if($t=it,it=t,bt||(bt=!0,q.style.height=K(q.clientHeight),Z.style.transform=`translate3d(${100*-$t}%,0,0)`),wt=!0,async function(t){await _(),Z.style.transform=`translate3d(${t}%,0,0)`}(100*-it),function(t=!1){const e=t?Math.max(0,it-1):Math.min(it,$t),r=t?Math.min(o.length-1,it+1):Math.max(it,$t);kt=kt.map(((t,n)=>t||n>=e&&n<=r)),Ct=Ct.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${R}-panel-${it}`);t&&(q.style.height=K(t.offsetHeight))}(),Vt&&clearTimeout(Vt),Vt=window.setTimeout((()=>{Ct=o.map(((t,e)=>e===it))}),400),At=-it*q.clientWidth,e){await _();const t=W.querySelector(`.${oe.tabs__item_selected}`);t&&t.focus()}}let At,Vt=null;O.id&&!Y&&L.registerInstance(O.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');Ft(t)},setPreviousItem(t){let e=it-1;e<0&&(e="ring"===t?o.length-1:it),Ft(e)},setNextItem(t){let e=it+1;e>o.length-1&&(e="ring"===t?0:it),Ft(e)}}),void 0===e.json&&n.json&&void 0!==O&&n.json(O),void 0===e.templateContext&&n.templateContext&&void 0!==J&&n.templateContext(J),void 0===e.origJson&&n.origJson&&void 0!==T&&n.origJson(T),void 0===e.layoutParams&&n.layoutParams&&void 0!==B&&n.layoutParams(B),o=O.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?Y=!1:(Y=!0,L.logError(G(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=L.getDerivedFromVars(O.width),z(),z=a(s,(t=>C=t)),l=L.getDerivedFromVars(O.height),S(),S=a(l,(t=>k=t));{let t={};"wrap_content"===(null==C?void 0:C.type)&&(t.parentHorizontalWrapContent=!0),k&&"wrap_content"!==k.type||(t.parentVerticalWrapContent=!0),Q=xt(t,Q)}if(!Y&&(it<0||it>=o.length)&&(L.logError(G(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:O.selected_tab,length:o.length}})),it=it<0?0:o.length-1),u=L.getDerivedFromVars(O.tab_title_style),D(),D=a(u,(t=>x=t)),c=x||{},ot=Pt(c.font_size,ot),c.font_size||c.paddings){const t=c.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ot*10,right:(Number(t.right)||0)/ot*10,bottom:(Number(t.bottom)||0)/ot*10,left:(Number(t.left)||0)/ot*10};at=_t(e,at)}{const t=c.line_height;void 0!==t&&zt(t)&&(st=K(t/ot*10))}{const t=c.letter_spacing;void 0!==t&&mt(t)&&(lt=K(t/ot*10))}if(c.corner_radius||c.corners_radius||c.font_size){const t=null!==(I=c.corner_radius)&&void 0!==I?I:1e3;c.corners_radius?ut=yt(c.corners_radius,t,ot,ut):mt(t)&&(ut=K(t/ot*10))}return rt=It(c.active_font_weight||c.font_weight,rt),nt=It(c.inactive_font_weight||c.font_weight,nt),ct=et(c.active_text_color,1,ct),dt=et(c.inactive_text_color,1,dt),vt=et(c.active_background_color,1,vt),gt=et(c.inactive_background_color,1,gt),d=L.getDerivedFromVars(O.has_separator),V(),V=a(d,(t=>$=t)),g=L.getDerivedFromVars(O.separator_color),A(),A=a(g,(t=>w=t)),p=L.getDerivedFromVars(O.separator_paddings),E(),E=a(p,(t=>b=t)),$&&(w&&(ft=et(w,1,ft)),b&&(ht=_t(b,ht))),f={background:ft,margin:ht},h=L.getDerivedFromVars(O.switch_tabs_by_content_swipe_enabled),F(),F=a(h,(t=>y=t)),m=void 0===y||Boolean(y),Y||(kt=o.map(((t,e)=>e===it)),Ct=o.map(((t,e)=>e===it))),F(),E(),A(),V(),D(),S(),z(),Y?"":`${M(Dt,"Outer").$$render(t,{cls:pt("tabs",oe,{}),json:O,origJson:T,templateContext:J,layoutParams:B,customActions:"tabs"},{},{default:()=>`<div${N("class",oe.tabs__list,0)} role="tablist"${U({"--divkit-tabs-font-size":K(ot),"--divkit-tabs-paddings":at,"--divkit-tabs-line-height":st,"--divkit-tabs-letter-spacing":lt,"--divkit-tabs-active-font-weight":rt||"","--divkit-tabs-inactive-font-weight":nt||"","--divkit-tabs-active-text-color":ct,"--divkit-tabs-inactive-text-color":dt,"--divkit-tabs-active-background-color":vt,"--divkit-tabs-inactive-background-color":gt,"--divkit-tabs-border-radius":ut})}${N("this",W,0)}>${P(o,((e,r)=>{let n=r===it;return`\n\n ${M(Et,"Actionable").$$render(t,{cls:pt("tabs__item",oe,{selected:n,actionable:Boolean(e.title_click_action)}),actions:e.title_click_action?[e.title_click_action]:[],attrs:{id:`${R}-tab-${r}`,"aria-controls":`${R}-panel-${r}`,role:"tab",tabindex:n?e.title_click_action?void 0:"0":"-1","aria-selected":n?"true":"false"},customAction:t=>function(t,e){return it===e||(Ft(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${$?`<div${N("class",oe.tabs__separator,0)}${N("style",X(f),0)}></div>`:""}\n <div${N("class",oe.tabs__panels,0)}${N("this",q,0)}><div${N("class",pt("tabs__swiper",oe,{inited:bt,animated:wt}),0)}${N("this",Z,0)}>${P(o,((e,r)=>`<div${N("class",pt("tabs__panel",oe,{visible:Ct[r]}),0)} role="tabpanel" id="${j(R,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(R,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${kt[r]?`${M(Te,"Unknown").$$render(t,{div:e.div,templateContext:J,layoutParams:Q},{},{})}`:""}\n </div>`))}</div></div>`})}`})),se=ae,le="divkit-eb86",ue="divkit-e08c";function ce(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),i=r-n;return t[n]*i+t[n+1]*(1-i)}}ce([.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]),ce([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 de=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const u=v(H);let c=new Map,g=new Set,p=!1,f=null,h=[],m=[],y=[],b=[];const w=o.div_id||o.id;w?(v(ft).registerInstance(w,{async setState(t){if($===t)return;u.setRunning("stateChange",!0),new Set(g),h.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),h=[],b.forEach((t=>{c.set(t.id,t.node.getBoundingClientRect())})),m=[],y=[],b=[];const e=i.find((e=>e.state_id===t))||null;e?($=t,x=e):u.logError(G(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(f&&f.has(t))return f.get(t);u.logError(G(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(ft,{registerInstance(t,e){f||(f=new Map),f.has(t)?u.logError(G(new Error("Duplicate state with id"),{additional:{id:t}})):f.set(t,e)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return m.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return y.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return b.push(o),new Promise((t=>{o.resolvePromise=t}))},hasTransitionChange:t=>!!t&&c.has(t),registerChild(t){g.add(t)},unregisterChild(t){g.delete(t)}})):(p=!0,u.logError(G(new Error('Missing "id" prop for div "state"'))));let $,x=null;const k=u.getJsonWithVars(o.default_state_id);let C=!1;return 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&&(g=new Set),i=o.states||[],(null==i?void 0:i.length)?p=!1:(p=!0,u.logError(G(new Error('Empty "states" prop for div "state"')))),function(t){C||(C=!0,t.length&&(k?($=k,x=t.find((t=>t.state_id===$))||null,x||u.logError(G(new Error("Cannot find state for default_state_id"),{additional:{selectedId:$}}))):(x=t[0],$=x.state_id)))}(i),p?"":`${M(Dt,"Outer").$$render(t,{cls:"divkit-b8ef",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=x)&&void 0!==e&&e.div?`${M(Te,"Unknown").$$render(t,{div:x.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaa",0)}${N("this",undefined,0)}>${P(h,(e=>"direction"in e?`<div${N("class",le,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${N("class",ue,0)}>${M(Te,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`:`<div${N("class",le,0)}><div${N("class",ue,0)}>${M(Te,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext},{},{})}</div>\n </div>`))}</div>`}})}`})),ve={pager:"divkit-c5fe",pager__items:"divkit-f698",pager__item:"divkit-feca",pager_orientation_horizontal:"divkit-b0a1",pager_orientation_vertical:"divkit-f772"},ge=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b,w,$=r,x=r,k=r,C=r,F=r;var E,A,V,j,D,S,z;let{json:I={}}=e,{templateContext:O}=e,{origJson:J}=e,{layoutParams:T}=e;const U=v(H),B=U.genId("pager");let L,R=!1,W=0,q=!1,Z="horizontal",Y="",tt="",et="";function rt(t,e="smooth"){const r="horizontal"===Z,n=L.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";L.scroll({[o]:n[i],behavior:e}),W=t}I.id&&U.registerInstance(I.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');rt(t)},setPreviousItem(t){let e=W-1;e<0&&(e="ring"===t?o.length-1:W),rt(e)},setNextItem(t){let e=W+1;e>o.length-1&&(e="ring"===t?0:W),rt(e)}}),void 0===e.json&&n.json&&void 0!==I&&n.json(I),void 0===e.templateContext&&n.templateContext&&void 0!==O&&n.templateContext(O),void 0===e.origJson&&n.origJson&&void 0!==J&&n.origJson(J),void 0===e.layoutParams&&n.layoutParams&&void 0!==T&&n.layoutParams(T),(null===(E=I.items)||void 0===E?void 0:E.length)&&Array.isArray(I.items)?R=!1:(R=!0,U.logError(G(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!R&&I.items||[]).map((t=>{let e=t,r=O;return({templateContext:r,json:e}=U.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=U.getDerivedFromVars(I.layout_mode),x(),x=a(s,(t=>y=t)),y?"percentage"!==y.type&&"fixed"!==y.type?(q=!0,U.logError(G(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):q=!1:(q=!0,U.logError(G(new Error('Empty "layout_mode" prop for div "pager"')))),l=U.getDerivedFromVars(I.orientation),F(),F=a(l,(t=>w=t)),Z=Wt(w,Z),u=U.getDerivedFromVars(I.item_spacing),C(),C=a(u,(t=>b=t));{const t=null==b?void 0:b.value;t&&mt(t)&&(Y=K(t||0))}if(c=U.getDerivedFromVars(I.paddings),k(),k=a(c,(t=>_=t)),tt=_t(_,tt),d="horizontal"===Z?"grid-auto-columns":"grid-auto-rows","fixed"===(null==y?void 0:y.type)){const t=Q("horizontal"===Z?((null===(A=I.paddings)||void 0===A?void 0:A.left)||0)+((null===(V=I.paddings)||void 0===V?void 0:V.right)||0):((null===(j=I.paddings)||void 0===j?void 0:j.top)||0)+((null===(D=I.paddings)||void 0===D?void 0:D.bottom)||0)),e=null===(S=y.neighbour_page_width)||void 0===S?void 0:S.value;et=e?`calc(100% + ${t} - 2 * ${Q(e)} - 2 * ${Y})`:"100%"}else if("percentage"===(null==y?void 0:y.type)){const t=null===(z=y.page_width)||void 0===z?void 0:z.value;et=`${Number(t)}%`}return g={"grid-gap":Y,padding:tt,[d]:et},p={orientation:Z},f=R||q,h=U.getStore("pagers"),$(),$=a(h,(t=>m=t)),function(t,e){const r=I.id;if(r){const o=new Map(m);n=h,m=o.set(r,{instId:B,size:t,currentItem:e,scrollToPagerItem:rt}),i=m,n.set(i)}var n,i}(o.length,W),$(),x(),k(),C(),F(),f?"":`${M(Dt,"Outer").$$render(t,{cls:pt("pager",ve,p),json:I,origJson:J,templateContext:O,layoutParams:T,customPaddings:!0},{},{default:()=>`<div${N("class",ve.pager__items,0)}${N("style",X(g),0)}${N("this",L,0)}>${P(o,(e=>`<div${N("class",ve.pager__item,0)}>${M(Te,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}\n </div>`))}</div>`})}`})),pe=ge,fe={indicator:"divkit-d8e3",indicator__scroller:"divkit-b5db",indicator__items:"divkit-d5d9",indicator__item:"divkit-f662",indicator__item_active:"divkit-b39c"},he=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,b=r,w=r,$=r,x=r,k=r,C=r,{json:F={}}=e,{templateContext:E}=e,{origJson:A}=e,{layoutParams:V}=e;const D=v(H);let S,z,I,O=10,J=10,T=5,B="#ffdc60",L=et("#33919cb5"),R=15,q=1.3;return void 0===e.json&&n.json&&void 0!==F&&n.json(F),void 0===e.templateContext&&n.templateContext&&void 0!==E&&n.templateContext(E),void 0===e.origJson&&n.origJson&&void 0!==A&&n.origJson(A),void 0===e.layoutParams&&n.layoutParams&&void 0!==V&&n.layoutParams(V),o=D.getDerivedFromVars(F.shape),C(),C=a(o,(t=>y=t)),y&&(y.item_width&&(O=bt(y.item_width.value,O)),y.item_height&&(J=bt(y.item_height.value,J)),y.corner_radius&&(T=bt(y.corner_radius.value,T))),s=D.getDerivedFromVars(F.active_item_color),k(),k=a(s,(t=>m=t)),B=et(m,1,B),l=D.getDerivedFromVars(F.inactive_item_color),x(),x=a(l,(t=>h=t)),L=et(h,1,L),u=D.getDerivedFromVars(F.space_between_centers),$(),$=a(u,(t=>f=t)),f&&(R=bt(f.value,R)),c=D.getDerivedFromVars(F.active_item_size),w(),w=a(c,(t=>p=t)),q=Pt(p,q),d=D.getStore("pagers"),b(),b=a(d,(t=>g=t)),async function(t){if(F.pager_id&&t.has(F.pager_id)){I=t.get(F.pager_id),await _();const e=z.children[I.currentItem].offsetLeft;S.scroll({left:e-S.clientWidth/2,behavior:"smooth"})}}(g),b(),w(),$(),x(),k(),C(),`${M(Dt,"Outer").$$render(t,{cls:pt("indicator",fe,{}),json:F,origJson:A,templateContext:E,layoutParams:V},{},{default:()=>`<div${N("class",fe.indicator__scroller,0)}${N("this",S,0)}><div${N("class",fe.indicator__items,0)} role="tablist"${U({margin:`0 ${K((q-1)*O/2)}`,"--divkit-indicator-width":K(O),"--divkit-indicator-height":K(J),"--divkit-indicator-border-radius":K(T),"--divkit-indicator-active-color":B,"--divkit-indicator-inactive-color":L,"--divkit-indicator-active-scale":q,"--divkit-indicator-margin":`0 ${K((R-O)/2)}`})}${N("this",z,0)}>${I?`${P(Array(I.size),((t,e)=>{let r=e===I.currentItem;return`\n <div class="${j(pt("indicator__item",fe,{active:r}),!0)+" "+j(W,!0)}" role="tab" id="${j(I.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(I.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),me=he,ye={slider:"divkit-ef4f",slider__input:"divkit-d1d6",slider__input_secondary:"divkit-c798",slider__thumb:"divkit-f345",slider__thumb_secondary:"divkit-e198","slider__tracks-wrapper":"divkit-f733","slider__tracks-inner":"divkit-ac90",slider__track:"divkit-e956","slider__active-track":"divkit-ec5b","slider__thumb-text-wrapper":"divkit-ee57","slider__thumb-text":"divkit-c4af","slider__thumb-text_secondary":"divkit-d882",slider__tick:"divkit-bd9b",slider__tick_active:"divkit-d8ce",slider__tick_inactive:"divkit-e71e"};function _e(t,e){var r,n,i;if(!t||!t.shape||!t.color)return e;const o=et(t.color),a=Number((null===(r=t.shape.item_width)||void 0===r?void 0:r.value)||10),s=Number((null===(n=t.shape.item_height)||void 0===n?void 0:n.value)||10),l=Number((null===(i=t.shape.corner_radius)||void 0===i?void 0:i.value)||5);if("shape_drawable"===t.type&&"transparent"!==o&&"rounded_rectangle"===t.shape.type){var u,c;const e={},r=null!==(u=t.stroke)&&void 0!==u&&u.color?et(t.stroke.color):"",n=null!==(c=t.stroke)&&void 0!==c&&c.width?Number(t.stroke.width||1):"";return e.width=a,e.height=s,e.borderRadius=l,e.background=o,r&&n&&(e.boxShadow=`inset 0 0 0 ${K(n)} ${r}`),e}return e}function be(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&et(t.text_color)||"#000",i=Mt(t.font_weight);if(zt(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:K(t.font_size),fontWeight:i,textColor:n};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 we(t,e,r){return Math.max(e,Math.min(r,t))}const $e=2147483647,xe=-2147483648,ke=Number.MAX_VALUE,Ce=Number.MIN_VALUE,Fe="string",Ee="integer",Ae="number",Ve="boolean",je="color",De="datetime";class Se{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=L(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 Pe={string:class extends Se{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Se{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 Se{convertValue(t){if("number"!=typeof t||isNaN(t)||t>$e||t<xe||t!==Math.round(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Se{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 Se{convertValue(t){if("string"!=typeof t||!rt(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Se{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function ze(t,e,r){if(!(e in Pe))throw new Error("Unsupported variable type");return new Pe[e](t,r)}function Me(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const Ie=J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V,D,S,z,I,O,J,T,B,L,R,W,q,Z,Y,X,tt,et,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ut=r,ct=r,dt=r,vt=r,gt=r;var ft,ht,yt,_t,bt,wt,$t,xt;let{json:kt={}}=e,{templateContext:Ft}=e,{origJson:Et}=e,{layoutParams:At}=e;const Vt={width:10,height:10,borderRadius:5,background:"#000"},St=v(H),Pt=v(Ct);let zt=0,Mt=100;const It=St.getJsonWithVars(kt.thumb_value_variable),Ot=St.getJsonWithVars(kt.thumb_secondary_value_variable);X=a(It&&St.getVariable(It,"integer")||ze("temp","integer",0),(t=>Y=t)),Z=a(Ot&&St.getVariable(Ot,"integer")||ze("temp","integer",0),(t=>q=t));let Jt,Nt,Tt,Ut=we(Y||0,zt,Mt),Bt=we(q||0,zt,Mt),Lt=Vt,Rt=Lt,Wt=Vt,qt=Vt,Ht=null,Gt=null,Zt=Tt,Yt="",Xt="",Kt=!1;void 0===e.json&&n.json&&void 0!==kt&&n.json(kt),void 0===e.templateContext&&n.templateContext&&void 0!==Ft&&n.templateContext(Ft),void 0===e.origJson&&n.origJson&&void 0!==Et&&n.origJson(Et),void 0===e.layoutParams&&n.layoutParams&&void 0!==At&&n.layoutParams(At),o=St.getDerivedFromVars(kt.min_value),gt(),gt=a(o,(t=>et=t)),s=St.getDerivedFromVars(kt.max_value),vt(),vt=a(s,(t=>tt=t)),zt=jt(et,zt),Mt=jt(tt,Mt);{const t=we(Y||0,zt,Mt);t!==Ut&&(Ut=t)}{const t=we(q||0,zt,Mt);t!==Bt&&(Bt=t)}if(l=St.getDerivedFromVars(kt.thumb_style),dt(),dt=a(l,(t=>W=t)),Lt=_e(W,Lt),u=St.getDerivedFromVars(kt.thumb_secondary_style),ct(),ct=a(u,(t=>R=t)),Rt=_e(R,Lt),c=St.getDerivedFromVars(kt.track_inactive_style),ut(),ut=a(c,(t=>L=t)),Wt=_e(L,Wt),d=St.getDerivedFromVars(kt.track_active_style),lt(),lt=a(d,(t=>B=t)),qt=_e(B,qt),g=Mt-zt+1<=20,p=St.getDerivedFromVars(kt.tick_mark_active_style),st(),st=a(p,(t=>T=t)),g){let t=_e(T,Vt);t!==Vt&&(Ht=t)}else Ht=null;if(Jt=Ht?Ot?Me(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!0):Me(zt,Ut,zt,Mt,!0):[],f=St.getDerivedFromVars(kt.tick_mark_inactive_style),at(),at=a(f,(t=>J=t)),g){let t=_e(J,Vt);t!==Vt&&(Gt=t)}else Gt=null;Nt=Gt?Ot?Me(Math.min(Ut,Bt),Math.max(Ut,Bt)+1,zt,Mt,!1):Me(Ut+1,Mt+1,zt,Mt,!0):[],h=St.getDerivedFromVars(kt.thumb_text_style),ot(),ot=a(h,(t=>O=t)),Tt=be(O,Tt),m=St.getDerivedFromVars(kt.thumb_secondary_text_style),it(),it=a(m,(t=>I=t)),Zt=be(I,Tt),y=St.getDerivedFromVars(kt.accessibility),nt(),nt=a(y,(t=>z=t)),(null==z?void 0:z.description)?Yt=z.description:St.logError(G(new Error('Missing accessibility "description" for slider'),{level:"warn"})),_=St.getDerivedFromVars(kt.secondary_value_accessibility),rt(),rt=a(_,(t=>S=t)),(null==S?void 0:S.description)?Xt=S.description:Ot&&St.logError(G(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;Pt.hasAction()?(St.logError(G(new Error('Cannot show "slider" inside component with action'))),t=!0):Lt===Vt?(St.logError(G(new Error('Missing "thumb_style" in slider'))),t=!0):qt===Vt?(St.logError(G(new Error('Missing "track_active_style" in slider'))),t=!0):Wt===Vt&&(St.logError(G(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Kt&&(Kt=t)}return b=Math.max(...[Lt.height,Rt.height,Wt.height,qt.height,0].filter(mt)),w=K(Math.max(...[Lt.width,Rt.width,0].filter(mt))),$=K(Math.max(...[Lt.height,Rt.height,0].filter(mt))),x=(Ut-zt)/(Mt-zt),k=Ot?(Bt-zt)/(Mt-zt):void 0,C=void 0!==k?Math.abs(k-x):x,F=void 0!==k?Math.min(k,x):0,E=-Math.min(...[(b-Lt.height)/2+((null===(ft=null==Tt?void 0:Tt.offset)||void 0===ft?void 0:ft.y)||0),Ot?(b-Rt.height)/2+((null===(ht=null==Zt?void 0:Zt.offset)||void 0===ht?void 0:ht.y)||0):0,0].filter((t=>void 0!==t&&"number"==typeof t&&!isNaN(t)))),A=Math.max(...[((null===(yt=null==Tt?void 0:Tt.offset)||void 0===yt?void 0:yt.y)||0)-(b-Lt.height)/2,Ot?((null===(_t=null==Zt?void 0:Zt.offset)||void 0===_t?void 0:_t.y)||0)-(b-Rt.height)/2:0,0].filter((t=>void 0!==t&&"number"==typeof t&&!isNaN(t)))),V={"--divkit-slider-thumb-width":K(Lt.width),"--divkit-slider-thumb-height":K(Lt.height),"--divkit-slider-thumb-secondary-width":K(Rt.width),"--divkit-slider-thumb-secondary-height":K(Rt.height),"--divkit-slider-text-offset-x":(null===(bt=null==Tt?void 0:Tt.offset)||void 0===bt?void 0:bt.x)?Q(Tt.offset.x):void 0,"--divkit-slider-text-offset-y":(null===(wt=null==Tt?void 0:Tt.offset)||void 0===wt?void 0:wt.y)?Q(Tt.offset.y):void 0,"--divkit-slider-text-secondary-offset-x":(null===($t=null==Zt?void 0:Zt.offset)||void 0===$t?void 0:$t.x)?Q(Zt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(xt=null==Zt?void 0:Zt.offset)||void 0===xt?void 0:xt.y)?Q(Zt.offset.y):void 0,"--divkit-slider-tick-active-width":Ht?K(Ht.width):void 0,"--divkit-slider-tick-active-height":Ht?K(Ht.height):void 0,"--divkit-slider-tick-active-border-radius":Ht?K(Ht.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Ht?void 0:Ht.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Ht?void 0:Ht.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Gt?K(Gt.width):void 0,"--divkit-slider-tick-inactive-height":Gt?K(Gt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Gt?K(Gt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Gt?void 0:Gt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Gt?void 0:Gt.boxShadow)||void 0,"--divkit-slider-max-height":K(b),"--divkit-slider-max-thumb-width":w,"--divkit-slider-max-thumb-height":$,"--divkit-slider-track-part":x,"--divkit-slider-track-secondary-part":k,"--divkit-slider-offset-top":Q(E),"--divkit-slider-offset-bottom":Q(A)},D={},rt(),nt(),it(),ot(),at(),st(),lt(),ut(),ct(),dt(),Z(),X(),vt(),gt(),Kt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("slider",ye,D),style:V,customDescription:!0,customActions:"slider",json:kt,origJson:Et,templateContext:Ft,layoutParams:At},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",ye["slider__tracks-wrapper"],0)}>${Tt||Ot&&Zt?`<div${N("class",ye["slider__thumb-text-wrapper"],0)} aria-hidden="true">${Tt?`<div${N("class",ye["slider__thumb-text"],0)}><div${N("class",ye["slider__thumb-text-inner"],0)}${U({"font-size":(null===(t=Tt)||void 0===t?void 0:t.fontSize)||"1em","font-weight":(null===(e=Tt)||void 0===e?void 0:e.fontWeight)||"",color:(null===(r=Tt)||void 0===r?void 0:r.textColor)||"#000"})}>${j(Ut)}</div></div>`:""}\n ${Ot?`<div class="${j(ye["slider__thumb-text"],!0)+" "+j(ye["slider__thumb-text_secondary"],!0)}"><div${N("class",ye["slider__thumb-text-inner"],0)}${U({"font-size":(null===(n=Zt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Zt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Zt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(Bt)}</div></div>`:""}</div>`:""}\n <div${N("class",ye["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",ye.slider__track,0)}${U({height:K(Wt.height),"border-radius":K(Wt.borderRadius),background:Wt.background,"box-shadow":Wt.boxShadow||""})}></div>\n <div${N("class",ye["slider__active-track"],0)}${U({left:(100*F).toFixed(2)+"%",width:(100*C).toFixed(2)+"%",height:K(qt.height),"border-radius":K(qt.borderRadius),background:qt.background,"box-shadow":qt.boxShadow||""})}></div>\n ${P(Jt,(t=>`<div class="${j(ye.slider__tick,!0)+" "+j(ye.slider__tick_active,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n ${P(Nt,(t=>`<div class="${j(ye.slider__tick,!0)+" "+j(ye.slider__tick_inactive,!0)}"${U({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",ye.slider__thumb,0)}${U({"border-radius":K(Lt.borderRadius),background:Lt.background,"box-shadow":Lt.boxShadow||""})}></div>\n ${Ot?`<div class="${j(ye.slider__thumb,!0)+" "+j(ye.slider__thumb_secondary,!0)}"${U({"border-radius":K(Rt.borderRadius),background:Rt.background,"box-shadow":Rt.boxShadow||""})}></div>`:""}\n <input type="range"${N("class",ye.slider__input,0)}${N("min",zt,0)}${N("max",Mt,0)} step="1"${N("value",Ut,0)}${N("aria-label",Yt,0)}>\n ${Ot?`<input type="range"${N("class",`${ye.slider__input} ${ye.slider__input_secondary}`,0)}${N("min",zt,0)}${N("max",Mt,0)} step="1"${N("value",Bt,0)}${N("aria-label",Xt,0)}>`:""}</div></div>`}})}`})),Oe={input:"divkit-c3a4",input__wrapper:"divkit-ef7e",input__holder:"divkit-bb3d",input_multiline:"divkit-e48a",input__input:"divkit-f11e","input_highlight-color":"divkit-cc00","input_vertical-overflow":"divkit-b707"},Je={text:Ut,container:Lt,separator:qt,image:Gt,gif:Gt,grid:te,gallery:ie,tabs:se,state:de,pager:pe,indicator:me,slider:Ie,input:J(((t,e,n,i)=>{let o,s,l,u,c,d,g,p,f,h,m,y,_,b,w,$,x,k,C,F,E,A,V,D,S,P,z,I,O,J,T,U,B=r,L=r,{json:R={}}=e,{templateContext:W}=e,{origJson:q}=e,{layoutParams:Z}=e;const Y=v(H);let X;const tt=Y.getJsonWithVars(R.text_variable);let rt=!1;tt||(rt=!0,Y.logError(G(new Error('Missing "text_variable" in "input"')))),J=a(tt&&Y.getVariable(tt,"string")||ze("temp","string",""),(t=>O=t));let nt="";I=a(Y.getDerivedFromVars(R.hint_text),(t=>z=t)),P=a(Y.getDerivedFromVars(R.hint_color),(t=>S=t));let it="";D=a(Y.getDerivedFromVars(R.font_size),(t=>V=t));let ot,at,st=12;A=a(Y.getDerivedFromVars(R.font_weight),(t=>E=t)),F=a(Y.getDerivedFromVars(R.line_height),(t=>C=t)),k=a(Y.getDerivedFromVars(R.letter_spacing),(t=>x=t));let lt="";$=a(Y.getDerivedFromVars(R.text_color),(t=>w=t));let ut="#000";b=a(Y.getDerivedFromVars(R.highlight_color),(t=>_=t));let ct="";y=a(Y.getDerivedFromVars(R.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let vt="multi_line_text",gt="text";h=a(Y.getDerivedFromVars(R.max_visible_lines),(t=>f=t));let ft="",mt="";U=a(Y.getDerivedFromVars(R.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==Z&&n.layoutParams(Z),nt=O,o=z,it=et(S,1,it),st=Pt(V,st),ot=It(E,ot);{const t=C;zt(t)&&(at=t/st)}return ht(x)&&(lt=K(x/st*10)),ut=et(w,1,ut),ct=et(_,1,ct),m&&m in dt&&(gt=dt[m],vt=m),s="multi_line_text"===vt,l=Y.getDerivedFromVars(R.paddings),L(),L=a(l,(t=>p=t)),zt(f)&&(ft=`calc(${f*(at||1.25)+"em"} + ${Q(bt(null==p?void 0:p.top,0)+bt(null==p?void 0:p.bottom,0))})`),u=Y.getDerivedFromVars(R.accessibility),B(),B=a(u,(t=>g=t)),(null==g?void 0:g.description)?mt=g.description:Y.logError(G(new Error('Missing accessibility "description" for input'),{level:"warn"})),c={"highlight-color":Boolean(ct),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ct,"font-size":K(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ut,"max-height":ft},B(),L(),h(),y(),b(),$(),k(),F(),A(),D(),P(),I(),J(),U(),rt?"":`${M(Dt,"Outer").$$render(t,{cls:pt("input",Oe,c),style:d,customDescription:!0,customActions:"input",json:R,origJson:q,templateContext:W,layoutParams:Z},{},{default:()=>`<span${N("class",Oe.input__wrapper,0)}><span${N("class",Oe.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(nt)}${nt.endsWith("\n")||!nt?"":""}</span>\n ${s?`<textarea${N("class",Oe.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("this",X,0)}>${j(nt,!0)}</textarea>`:`<input${N("type",gt,0)}${N("class",Oe.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",mt,0)}${N("placeholder",o,0)}${N("value",nt,0)}${N("this",X,0)}>`}</span>`})}`}))},Ne=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(H);let u,c,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),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),u=i,c=o,d=u&&Je[u.type]||void 0,!d&&(({templateContext:c,json:u}=l.processTemplate(u,c)),d=u&&Je[u.type]||void 0,!d)){let t;t=(null==u?void 0:u.type)&&l.hasTemplate(u.type)?"Recursive template":"Unknown component",l.logError(G(new Error(t),{additional:{component:(null==u?void 0:u.type)||"<missing>"}}))}return d?`${M(d||z,"svelte:component").$$render(t,{json:u,templateContext:c,layoutParams:s,origJson:a||i},{},{})}`:""})),Te=Ne,Ue=J(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>`<filter${N("id",i[t],0)}><feFlood${N("flood-color",t,0)}></feFlood><feComposite in2="SourceGraphic" operator="in"></feComposite></filter>`))}</defs></svg>`:""}));function Be(t,e,r,n){const i=r[t.type];if(!i)return n(G(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 e(r,i){const o=Object.keys(i).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const n=i[t];"object"==typeof n&&null!==n?(r[t]=Array.isArray(n)?[]:{},e(r[t],n)):r[t]=n})),l.forEach((e=>{const o=i[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else n(G(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function Le(){}function Re(t){return{subscribe:e=>(e(t),Le)}}function We(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function qe(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function He(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 Ge(t){var e=parseInt(t,10);if(e>$e||e<xe)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function Ze(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function Ye(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,Ye.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function Xe(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,t+(r+=r.repeat(e)).slice(0,e))}function Ke(t,e){var r,n,i,o,a={},s=(e=void 0!==e?e:{}).grammarSource,l={start:St,JsonStringContents:function(){var t,e,r;for(t=_t,e=[],r=Pt();r!==a;)e.push(r),r=Pt();return bt=t,e=yt(e)}},u=St,c="@{",d="}",v="@{}",g="\\",p="||",f="&&",h="==",m="!=",y=">=",_="<=",b="+",w="-",$="true",x="false",k=/^[^}]/,C=/^[^'}]/,F=/^[0-9]/,E=/^[a-zA-Z_0-9.]/,A=/^[a-zA-Z_]/,V=/^[ \t\r\n]/,j=Ft("@{",!1),D=Ft("}",!1),S=Ft("@{}",!1),P=Ft("\\",!1),z={type:"any"},M=Et(["}"],!0,!1),I=Ft("?",!1),O=Ft(":",!1),J=Ft("||",!1),N=Ft("&&",!1),T=Ft("==",!1),U=Ft("!=",!1),B=Ft(">=",!1),L=Ft(">",!1),R=Ft("<=",!1),W=Ft("<",!1),q=Ft("+",!1),H=Ft("-",!1),G=Ft("/",!1),Z=Ft("*",!1),Y=Ft("%",!1),X=Ft("!",!1),K=Ft("(",!1),Q=Ft(")",!1),tt=Ft(",",!1),et=At("string"),rt=Ft("'",!1),nt=Et(["'","}"],!0,!1),it=At("integer"),ot=Et([["0","9"]],!1,!1),at=At("number"),st=Ft(".",!1),lt=Ft("e",!1),ut=Ft("E",!1),ct=At("boolean"),dt=Ft("true",!1),vt=Ft("false",!1),gt=Et([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),pt=At("identifier"),ft=Et([["a","z"],["A","Z"],"_"],!1,!1),ht=At("whitespace"),mt=Et([" ","\t","\r","\n"],!1,!1),yt=function(t){return He(t)},_t=0,bt=0,wt=[{line:1,column:1}],$t=0,xt=[],kt=0;if("startRule"in e){if(!(e.startRule in l))throw new Error("Can't start parsing from rule \""+e.startRule+'".');u=l[e.startRule]}function Ct(){return t.substring(bt,_t)}function Ft(t,e){return{type:"literal",text:t,ignoreCase:e}}function Et(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function At(t){return{type:"other",description:t}}function Vt(e){var r,n=wt[e];if(n)return n;for(r=e-1;!wt[r];)r--;for(n={line:(n=wt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return wt[e]=n,n}function jt(t,e){var r=Vt(t),n=Vt(e);return{source:s,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Dt(t){_t<$t||(_t>$t&&($t=_t,xt=[]),xt.push(t))}function St(){var t,e;return t=_t,qt(),(e=zt())!==a?(qt(),bt=t,t=e):(_t=t,t=a),t}function Pt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ct()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(M)),i!==a)for(;i!==a;)n.push(i),k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(M));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ze(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function zt(){var e,r,n,i,o,s;return e=_t,(r=Mt())!==a?(qt(),63===t.charCodeAt(_t)?(n="?",_t++):(n=a,0===kt&&Dt(I)),n!==a?(qt(),(i=zt())!==a?(qt(),58===t.charCodeAt(_t)?(o=":",_t++):(o=a,0===kt&&Dt(O)),o!==a?(qt(),(s=zt())!==a?(bt=e,e={type:"ConditionalExpression",test:r,consequent:i,alternate:s}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=Mt()),e}function Mt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=It())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(u=It())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(u=It())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=qe(r,n)}else _t=e,e=a;return e}function It(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Ot())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(u=Ot())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(u=Ot())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=qe(r,n)}else _t=e,e=a;return e}function Ot(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Jt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(U))),s!==a?(l=qt(),(u=Jt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(U))),s!==a?(l=qt(),(u=Jt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=We(r,n)}else _t=e,e=a;return e}function Jt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Nt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(B)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(L)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(W))))),s!==a?(l=qt(),(u=Nt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(B)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(L)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(W))))),s!==a?(l=qt(),(u=Nt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=We(r,n)}else _t=e,e=a;return e}function Nt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Tt())!==a){for(n=[],i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(u=Tt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(u=Tt())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=We(r,n)}else _t=e,e=a;return e}function Tt(){var e,r,n,i,o,s,l,u;if(e=_t,(r=Ut())!==a){for(n=[],i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Z)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Y)))),s!==a?(l=qt(),(u=Ut())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Z)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Y)))),s!==a?(l=qt(),(u=Ut())!==a?i=o=[o,s,l,u]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=We(r,n)}else _t=e,e=a;return e}function Ut(){var e,r,n;return(e=Rt())===a&&(e=Lt())===a&&(e=_t,33===t.charCodeAt(_t)?(r="!",_t++):(r=a,0===kt&&Dt(X)),r===a&&(43===t.charCodeAt(_t)?(r=b,_t++):(r=a,0===kt&&Dt(q)),r===a&&(45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)))),r!==a?(qt(),(n=Ut())!==a?(bt=e,e={type:"UnaryExpression",operator:r,argument:n}):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=function(){var e,r,n,i,o;return e=_t,(r=Wt())!==a?(qt(),40===t.charCodeAt(_t)?(n="(",_t++):(n=a,0===kt&&Dt(K)),n!==a?(qt(),i=function(){var e,r,n,i,o,s,l;if(e=_t,(r=zt())!==a){for(n=[],i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);bt=e,l=n,e=[r,...l]}else _t=e,e=a;return e===a&&(e=qt()),e}(),i!==a?(qt(),41===t.charCodeAt(_t)?(o=")",_t++):(o=a,0===kt&&Dt(Q)),o!==a?(bt=e,e={type:"CallExpression",callee:r,arguments:i}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,(r=Wt())!==a&&(bt=e,r={type:"Variable",id:r}),(e=r)===a&&(e=function(){var e,r,n,i;return e=function(){var e,r,n,i;return kt++,e=_t,39===t.charCodeAt(_t)?(r="'",_t++):(r=a,0===kt&&Dt(rt)),r!==a?(n=function(){var t,e,r;for(t=_t,e=[],r=Bt();r!==a;)e.push(r),r=Bt();return bt=t,e=He(e)}(),39===t.charCodeAt(_t)?(i="'",_t++):(i=a,0===kt&&Dt(rt)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(et)),e}(),e===a&&(e=Rt())===a&&(e=Lt())===a&&(e=function(){var e,r;return kt++,e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===a&&(e=_t,t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!1}),e=r),kt--,e===a&&(r=a,0===kt&&Dt(ct)),e}(),e===a&&(e=_t,40===t.charCodeAt(_t)?(r="(",_t++):(r=a,0===kt&&Dt(K)),r!==a&&(n=zt())!==a?(41===t.charCodeAt(_t)?(i=")",_t++):(i=a,0===kt&&Dt(Q)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a))),e}())),e}())),e}function Bt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(39===t.charCodeAt(_t)?(n="'",_t++):(n=a,0===kt&&Dt(rt)),n===a&&(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ct()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt)),i!==a)for(;i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===c?(r=c,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===c?(n=c,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Ze(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Lt(){var e,r,n,i;if(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;return n!==a?(bt=e,e={type:"IntegerLiteral",value:Ge(Ct())}):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(it)),e}function Rt(){var e,r,n,i,o,s,l,u,c,d;for(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));if(46===t.charCodeAt(_t)?(i=".",_t++):(i=a,0===kt&&Dt(st)),i!==a){if(o=[],F.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot)),s!==a)for(;s!==a;)o.push(s),F.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot));else o=a;if(o!==a){if(s=_t,101===t.charCodeAt(_t)?(l="e",_t++):(l=a,0===kt&&Dt(lt)),l===a&&(69===t.charCodeAt(_t)?(l="E",_t++):(l=a,0===kt&&Dt(ut))),l!==a){if(43===t.charCodeAt(_t)?(u=b,_t++):(u=a,0===kt&&Dt(q)),u===a&&(45===t.charCodeAt(_t)?(u=w,_t++):(u=a,0===kt&&Dt(H))),u===a&&(u=null),c=[],F.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot)),d!==a)for(;d!==a;)c.push(d),F.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot));else c=a;c!==a?s=l=[l,u,c]:(_t=s,s=a)}else _t=s,s=a;s===a&&(s=null),bt=e,e={type:"NumberLiteral",value:parseFloat(Ct())}}else _t=e,e=a}else _t=e,e=a;if(e===a){if(e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;if(n!==a)if(101===t.charCodeAt(_t)?(i="e",_t++):(i=a,0===kt&&Dt(lt)),i===a&&(69===t.charCodeAt(_t)?(i="E",_t++):(i=a,0===kt&&Dt(ut))),i!==a){if(43===t.charCodeAt(_t)?(o=b,_t++):(o=a,0===kt&&Dt(q)),o===a&&(45===t.charCodeAt(_t)?(o=w,_t++):(o=a,0===kt&&Dt(H))),o===a&&(o=null),s=[],F.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot)),l!==a)for(;l!==a;)s.push(l),F.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot));else s=a;s!==a?(bt=e,e={type:"NumberLiteral",value:parseFloat(Ct())}):(_t=e,e=a)}else _t=e,e=a;else _t=e,e=a}return kt--,e===a&&(r=a,0===kt&&Dt(at)),e}function Wt(){var e,r,n,i,o;if(kt++,e=_t,r=_t,kt++,n=function(){var e,r,n,i;return e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r===a&&(t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt))),r!==a?(n=_t,kt++,E.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(gt)),kt--,i===a?n=void 0:(_t=n,n=a),n!==a?e=r=[r,n]:(_t=e,e=a)):(_t=e,e=a),e}(),kt--,n===a?r=void 0:(_t=r,r=a),r!==a)if(A.test(t.charAt(_t))?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(ft)),n!==a){for(i=[],E.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));o!==a;)i.push(o),E.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));bt=e,e={type:"Identifier",name:Ct()}}else _t=e,e=a;else _t=e,e=a;return kt--,e===a&&(r=a,0===kt&&Dt(pt)),e}function qt(){var e,r;for(kt++,e=[],V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));r!==a;)e.push(r),V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));return kt--,r=a,0===kt&&Dt(ht),e}if((r=u())!==a&&_t===t.length)return r;throw r!==a&&_t<t.length&&Dt({type:"end"}),n=xt,i=$t<t.length?t.charAt($t):null,o=$t<t.length?jt($t,$t+1):jt($t,$t),new Ye(Ye.buildMessage(n,i),n,i,o)}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(Ye,Error),Ye.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,s=Xe("",i.line.toString().length," "),l=n[i.line-1],u=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+Xe("",i.column-1," ")+Xe("",u,"^")}else e+="\n at "+o}return e},Ye.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(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 n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."};const Qe=new Map,tr=new Map;function er(t,e,r){const n={args:e,cb:r},i=Qe.get(t)||[];Qe.has(t)||Qe.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");tr.set(o,n)}function rr(t,e){let r=t.args.length,n=t.args.length;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function nr(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=>{nr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":nr(t.left,e),nr(t.right,e);break;case"UnaryExpression":nr(t.argument,e);break;case"ConditionalExpression":nr(t.test,e),nr(t.consequent,e),nr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{nr(t,e)}))}}function ir(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function or(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function ar(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 or(t.value);if("color"===t.type)return fr(pr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function sr(t){let e=ar(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function lr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const ur=new Int32Array(1);function cr(t){return ur[0]=t,ur[0]}function dr(t){if(t<xe||t>$e)throw new Error("Integer overflow.")}function vr(t){const e=[];return nr(t,{Variable(t){e.push(t.id.name)}}),e}function gr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function pr(t){const e=rt(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function fr(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 tt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function hr(t){return{type:Fe,value:ar(t)}}function mr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Ae,value:e}}function yr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===Ee&&(r=cr(r)),{type:t.type,value:r}}function _r(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===Ee&&(r=cr(r)),{type:t.type,value:r}}function br(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===Ee&&(e=cr(e));return{type:t[0].type,value:e}}function wr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===Ee&&(e=cr(e));return{type:t.length?t[0].type:Ee,value:e}}function $r(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===Ee&&(e=cr(e));return{type:t.length?t[0].type:Ee,value:e}}function xr(t){const e=Math.abs(t.value);return t.type===Ee&&dr(e),{type:t.type,value:e}}function kr(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function Cr(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function Fr(t){return{type:t.type,value:Math.sign(t.value)}}function Er(t,e){let r;if(0===e.value&&t.type===Ee)r=t.value;else if(0===t.value&&t.type===Ee)r=0;else{let n=Math.sign(e.value);t.type===Ae&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===Ee&&dr(r),{type:t.type,value:r}}function Ar(t){return e=>{const r=pr(e.value);return{type:Ae,value:r[t]/255}}}function Vr(t){return(e,r)=>{const n=pr(e.value);return n[t]=255*r.value,{type:e.type,value:fr(n)}}}const jr=Ar("a"),Dr=Ar("r"),Sr=Ar("g"),Pr=Ar("b"),zr=Vr("a"),Mr=Vr("r"),Ir=Vr("g"),Or=Vr("b");function Jr(t){return t.map(sr).join(", ")}er("toString",[Ee],hr),er("toString",[Ae],hr),er("toString",[Ve],hr),er("toString",[je],hr),er("toString",["url"],hr),er("toNumber",[Ee],mr),er("toNumber",[Fe],mr),er("toInteger",[Ae],(function(t){if(t.value>$e||t.value<xe)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:Ee,value:e}})),er("toInteger",[Fe],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>$e||e<xe)throw new Error("Unable to convert value to Integer.");return{type:Ee,value:e}})),er("toInteger",[Ve],(function(t){return{type:Ee,value:t.value?1:0}})),er("toBoolean",[Ee],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ve,value:t.value}})),er("toBoolean",[Fe],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Ve,value:"true"===t.value?1:0}})),er("encodeUri",[Fe],(function(t){try{return{type:Fe,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),er("decodeUri",[Fe],(function(t){try{return{type:Fe,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),er("parseUnixTime",[Ee],(function(t){return{type:De,value:new Date(1e3*t.value)}})),er("nowLocal",[],(function(){return{type:De,value:new Date}})),er("addMillis",[De,Ee],(function(t,e){return{type:De,value:new Date(t.value.getTime()+e.value)}})),er("setYear",[De,Ee],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:De,value:r}})),er("setMonth",[De,Ee],(function(t,e){if(e.value<1||e.value>12)throw new Error(`Expecting month in [1..12], instead got ${e.value}.`);const r=new Date(t.value);return r.setMonth(e.value-1),{type:De,value:r}})),er("setDay",[De,Ee],(function(t,e){const r=new Date(t.value);if(e.value<=0&&-1!==e.value||e.value>function(t){const e=new Date(t);return e.setMonth(e.getMonth()+1),e.setDate(0),e.getDate()}(r))throw new Error(`Unable to set day ${e.value} for date ${ar(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:De,value:r}})),er("setHours",[De,Ee],(function(t,e){if(e.value<0||e.value>23)throw new Error(`Expecting hours in [0..23], instead got ${e.value}.`);const r=new Date(t.value);return r.setHours(e.value-r.getTimezoneOffset()/60),{type:De,value:r}})),er("setMinutes",[De,Ee],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setMinutes(e.value),{type:De,value:r}})),er("setSeconds",[De,Ee],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setSeconds(e.value),{type:De,value:r}})),er("setMillis",[De,Ee],(function(t,e){if(e.value<0||e.value>999)throw new Error(`Expecting millis in [0..999], instead got ${e.value}.`);const r=new Date(t.value);return r.setMilliseconds(e.value),{type:De,value:r}})),er("len",[Fe],(function(t){return{type:Ee,value:t.value.length}})),er("contains",[Fe,Fe],(function(t,e){return{type:Ve,value:t.value.includes(e.value)?1:0}})),er("substring",[Fe,Ee,Ee],(function(t,e,r){if(r.value<e.value)throw new Error("Indexes should be in ascending order.");if(e.value<0||e.value>t.value.length||r.value<0||r.value>t.value.length)throw new Error("Indexes are out of bounds.");return{type:Fe,value:t.value.substring(e.value,r.value)}})),er("replaceAll",[Fe,Fe,Fe],(function(t,e,r){let n;return n=e.value?t.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e.value),"g"),r.value):t.value,{type:Fe,value:n}})),er("index",[Fe,Fe],(function(t,e){return{type:Ee,value:t.value.indexOf(e.value)}})),er("lastIndex",[Fe,Fe],(function(t,e){return{type:Ee,value:t.value.lastIndexOf(e.value)}})),er("trim",[Fe],(function(t){return{type:Fe,value:t.value.trim()}})),er("trimLeft",[Fe],(function(t){return{type:Fe,value:t.value.replace(/^\s+/,"")}})),er("trimRight",[Fe],(function(t){return{type:Fe,value:t.value.replace(/\s+$/,"")}})),er("toUpperCase",[Fe],(function(t){return{type:Fe,value:t.value.toUpperCase()}})),er("toLowerCase",[Fe],(function(t){return{type:Fe,value:t.value.toLowerCase()}})),er("div",[Ee,Ee],yr),er("div",[Ae,Ae],yr),er("mod",[Ee,Ee],_r),er("mod",[Ae,Ae],_r),er("mul",[{type:Ee,isVararg:!0}],br),er("mul",[{type:Ae,isVararg:!0}],br),er("sub",[{type:Ee,isVararg:!0}],wr),er("sub",[{type:Ae,isVararg:!0}],wr),er("sum",[{type:Ee,isVararg:!0}],$r),er("sum",[{type:Ae,isVararg:!0}],$r),er("abs",[Ee],xr),er("abs",[Ae],xr),er("max",[{type:Ee,isVararg:!0}],kr),er("max",[{type:Ae,isVararg:!0}],kr),er("min",[{type:Ee,isVararg:!0}],Cr),er("min",[{type:Ae,isVararg:!0}],Cr),er("maxNumber",[],(function(){return{type:Ae,value:ke}})),er("minNumber",[],(function(){return{type:Ae,value:Ce}})),er("maxInteger",[],(function(){return{type:Ee,value:$e}})),er("minInteger",[],(function(){return{type:Ee,value:xe}})),er("round",[Ae],(function(t){const e=Math.sign(t.value);return{type:Ae,value:e*Math.round(Math.abs(t.value))}})),er("floor",[Ae],(function(t){return{type:Ae,value:Math.floor(t.value)}})),er("ceil",[Ae],(function(t){return{type:Ae,value:Math.ceil(t.value)}})),er("signum",[Ae],Fr),er("signum",[Ee],Fr),er("copySign",[Ae,Ae],Er),er("copySign",[Ee,Ee],Er),er("getColorAlpha",[Fe],jr),er("getColorAlpha",[je],jr),er("getColorRed",[Fe],Dr),er("getColorRed",[je],Dr),er("getColorGreen",[Fe],Sr),er("getColorGreen",[je],Sr),er("getColorBlue",[Fe],Pr),er("getColorBlue",[je],Pr),er("setColorAlpha",[Fe,Ae],zr),er("setColorAlpha",[je,Ae],zr),er("setColorRed",[Fe,Ae],Mr),er("setColorRed",[je,Ae],Mr),er("setColorGreen",[Fe,Ae],Ir),er("setColorGreen",[je,Ae],Ir),er("setColorBlue",[Fe,Ae],Or),er("setColorBlue",[je,Ae],Or),er("rgb",[Ae,Ae,Ae],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:Fe,value:fr(n)}})),er("argb",[Ae,Ae,Ae,Ae],(function(t,e,r,n){const i={a:255*t.value,r:255*e.value,g:255*r.value,b:255*n.value};return{type:Fe,value:fr(i)}}));const Nr={StringLiteral:function(t,e){return{type:Fe,value:e.value}},NumberLiteral:function(t,e){return{type:Ae,value:e.value}},IntegerLiteral:function(t,e){return{type:Ee,value:e.value}},BooleanLiteral:function(t,e){return{type:Ve,value:e.value?1:0}},UnaryExpression:function(t,e){const r=ir(Tr(t,e.argument));switch(e.operator){case"!":if(r.type===Ve)return{type:Ve,value:r.value?0:1};gr(`${e.operator}${sr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===Ee)return{type:Ee,value:r.value*t};if(r.type===Ae)return{type:Ae,value:r.value*t};gr(`${e.operator}${sr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=ir(Tr(t,e.test));if(r.type===Ve)return r.value?Tr(t,e.consequent):Tr(t,e.alternate);gr(`${sr(r)} ? ${sr(Tr(t,e.consequent))} : ${sr(Tr(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 Tr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=ar(Tr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:Fe,value:r}},LogicalExpression:function(t,e){const r=ir(Tr(t,e.left));if(r.type!==Ve&&gr(`${sr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Ve,value:0};const n=ir(Tr(t,e.right));return n.type!==Ve&&gr(`${sr(r)} ${e.operator} ${sr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${lr(n.type)}.`),{type:Ve,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Tr(t,e.left),i=Tr(t,e.right);if(n.type!==i.type&&gr(`${sr(n)} ${e.operator} ${sr(i)}`,`Operator '${r}' cannot be applied to different types: ${lr(n.type)} and ${lr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===De&&r.type===De?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Ve,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Ae&&e.type!==Ee&&e.type!==De&&gr(`${sr(e)} ${t} ${sr(r)}`,`Operator '${t}' cannot be applied to ${lr(e.type)} type.`);const i=e.type===De?e.value.getTime():e.value,o=r.type===De?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Ve,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==Fe&&e.type!==Ae&&e.type!==Ee&&gr(`${sr(e)} ${t} ${sr(r)}`,`Operator '${t}' cannot be applied to ${lr(e.type)} type.`),e.type===Fe)return"-"===t&&gr(`${sr(e)} - ${sr(r)}`,`Operator '${t}' cannot be applied to ${lr(e.type)} type.`),{type:Fe,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===Ee&&(n=cr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==Ee&&e.type!==Ae&&gr(`${sr(e)} ${t} ${sr(r)}`,`Operator '${t}' cannot be applied to ${lr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&gr(`${sr(e)} ${t} ${sr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===Ee&&(n=cr(n)),{type:e.type,value:n}}(r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;if(!Qe.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Tr(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(tr.has(o))n=tr.get(o);else{const t=function(t,e){const r=Qe.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=rr(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t){const e=i.map((t=>lr(t.type))).join(", "),n=`${r}(${Jr(i)})`;"few"===t.type&&0===i.length?gr(n,`Non empty argument list is required for function '${r}'.`):(t.type,gr(n,`Function '${r}' has no matching override for given argument types: ${e}.`))}n=t}if(!n)throw new Error("Function not found");try{return n.cb(...i)}catch(t){gr(`${r}(${Jr(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' has value null`)}};function Tr(t,e){if(e.type in Nr)return Nr[e.type](t,e);throw new Error("Unsupported expression")}function Ur(t,e){try{return Tr(t,e)}catch(t){return{type:"error",value:t.message}}}const Br=/(?:[^\\]|^)@{.+}/i;class Lr{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return nr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Ur(t,this.ast);if("error"===r.type)return void e(G(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;return n instanceof Date?or(n):n}catch(t){return void e(G(new Error("Expression execution error")))}}}function Rr(t,e,r){if(t)if("string"==typeof t){if(n=t,Br.test(n))try{const r=Ke(t,{startRule:"JsonStringContents"}),n=vr(r);return e.push(...n),new Lr(r)}catch(e){return void r(G(new Error("Unable to parse expression"),{additional:{expression:t}}))}}else{if(Array.isArray(t))return t.map((t=>Rr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Rr(t[i],e,r);return n}}var n;return t}function Wr(t,e,r){if(t){if(t instanceof Lr)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Wr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Wr(t[i],e,r);return n}}return t}function qr(t,e){let r=[];const n=Rr(t,r,e);return r=[...new Set(r)],{vars:r,applyVars:t=>Wr(n,t,e)}}const Hr={pagers:function(){return L(new Map)}},Gr=new Map,Zr=new Map;function Yr(t){const e=Gr.get(t)||L("");return Gr.has(t)||Gr.set(t,e),e}function Xr(t){const e=Zr.get(t)||new Map;return Zr.has(t)||Zr.set(t,e),e}class Kr{setVariable(t){const e=t.getName(),r=Xr(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Yr(this).set(e)}getVariable(t){return Xr(this).get(t)}}function Qr(){return new Kr}const tn=J(((t,e,r,n)=>{var i,o,a,s,l;let{id:u}=e,{json:c={}}=e,{platform:v="auto"}=e,{theme:g="system"}=e,{globalVariablesController:p=new Kr}=e,{onError:f}=e,{onStat:h}=e,{onCustomAction:m}=e,{onComponent:y}=e,_="desktop"===v;if("auto"===v&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");_=!t.matches,t.addListener((()=>{_=!t.matches}))}let b="light";if("light"===g||"dark"===g)b=g;else if("system"===g)if("undefined"!=typeof matchMedia){const t=matchMedia("(prefers-color-scheme: dark)");b=t.matches?"dark":"light",t.addListener((()=>{b=t.matches?"dark":"light",K&&K[b].forEach((t=>{const e=A.get(t.name);e&&e.setValue(t.color)}))}))}else b="light";else z(G(new Error("Unsupported theme")));let w=!1;c||(w=!0,z(G(new Error('"json" prop is required')))),u||(w=!0,z(G(new Error('"id" prop is required'))));let $=function(t){if(!t)return G(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return G(new Error("Missing card"));if(!e.states||!e.states.length)return G(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Je)return G(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t)if(!e.states[t].div)return G(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});return null}(c);const x=c.templates||{};$&&(w=!0,z($));const k={stateChange:!1},C=Yr(p),F=Xr(p),E=new Map,A=new Map,V=new Map;function D(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=A.get(t);r&&r.setValue(e)}}function S(t){const e=A.get(t);return null==e?void 0:e.getValue()}function P(t){const e=qr(t,z);return e.vars.length?e.applyVars(A):t}function z(t){f?f({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}let I=0;function O(t){return`${u}-${I++}`}let J={},N={};function T(t){const e=String(t.url);if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=t.split("/");const r=e.shift()||"";if(e=[r,"root","0",...e],e.length<5||e.length%2!=1)throw new Error("Incorrect state id format");let n=Z;for(let t=1;t<e.length;t+=2){const r=e[t],i=e[t+1];let o=n.getChild(r);if(!o)return;o.setState(i),n=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=B(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=B(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=B(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=A.get(r);t?t.set(i):z(G(new Error("Cannot find variable"),{additional:{name:r}}))}else z(G(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:z(G(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){z(G(t,{additional:{url:e}}))}}const U=new Map;function B(t){if(U.has(t))return U.get(t);z(G(new Error("Missing instance with id"),{additional:{id:t}}))}const W=new Map;function q(t){for(const e of t)A.has(e)&&t.delete(e);return t}d(H,{logError:z,logStat:function(t,e){h&&h({type:t,action:e})},hasTemplate:function(t){return t in x},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in x;){if(({json:t,templateContext:e}=Be(t,e,x,z)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:O,genClass:function(t){return`divkit-${O()}`},execAction:T,execCustomAction:function(t){null==m||m(t)},isRunning:function(t){return k[t]},setRunning:function(t,e){k[t]=e},registerInstance:function(t,e){U.has(t)?z(G(new Error("Duplicate instance id"),{additional:{id:t}})):U.set(t,e)},addSvgFilter:function(t){if(N[t]=N[t]||0,++N[t],J[t])return J[t];const e=`${O()}-svg-filter`;return J=Object.assign(Object.assign({},J),{[t]:e}),e},removeSvgFilter:function(t){t&&N[t]&&0==--N[t]&&(J=Object.keys(J).reduce(((t,e)=>(N[e]&&(t[e]=J[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Re(t);const e=qr(t,z);return e.vars.length?R(e.vars.map((t=>A.get(t)||function(t){const e=V.get(t)||L(void 0);return V.has(t)||V.set(t,e),e}(t))).filter(it),(()=>e.applyVars(A))):Re(t)},getJsonWithVars:P,getStore:function(t){return W.has(t)||function(t){W.has(t)||W.set(t,Hr[t]())}(t),W.get(t)},getVariable:function(t,e){const r=A.get(t);if(r){const n=r.getType();if(n!==e)return void z(G(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},registerComponent:void 0,unregisterComponent:void 0}),d(Ct,{hasAction:()=>!1});const Z={setState(t){throw new Error("Not implemented")},getChild(t){if(Y&&Y.has(t))return Y.get(t);z(G(new Error("Missing state block with id"),{additional:{id:t}}))}};let Y=null;d(ft,{registerInstance(t,e){Y||(Y=new Map),Y.has(t)?z(G(new Error("Duplicate state with id"),{additional:{id:t}})):Y.set(t,e)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const X=null===(i=null==c?void 0:c.card)||void 0===i?void 0:i.variables;Array.isArray(X)&&X.forEach((t=>{if(t&&t.type in Pe&&t.name){if(E.has(t.name))return void z(G(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=ze(t.name,t.type,t.value);E.set(t.name,e),A.set(t.name,e)}catch(e){z(G(e,{additional:{name:t.name}}))}}}));const K=c.palette;K&&K[b].forEach((t=>{if(E.has(t.name))z(G(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=ze(t.name,"color",t.color);E.set(t.name,e),A.set(t.name,e)}catch(e){z(G(e,{additional:{name:t.name}}))}}));for(const[t,e]of F)A.has(t)||A.set(t,e);C.subscribe((t=>{if(t&&!A.has(t)){const e=F.get(t);A.set(t,e);const r=V.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const Q=null===(o=null==c?void 0:c.card)||void 0===o?void 0:o.variable_triggers;Array.isArray(Q)&&Q.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void z(G(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 n=Ke(t.condition,{startRule:"JsonStringContents"}),i=vr(n);if(!i.length)return void z(G(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return q(e),e.size?new Promise((t=>{const r=C.subscribe((()=>{q(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{R(i.map((t=>A.get(t))).filter(it),(()=>Ur(A,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=P(t);e.log_id&&T(e)})),e=Boolean(n.value)):z(G(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){z(G(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else z(G(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));let tt=null===(l=null===(s=null===(a=null==c?void 0:c.card)||void 0===a?void 0:a.states)||void 0===s?void 0:s[0])||void 0===l?void 0:l.div,et=tt&&{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:[{state_id:"0",div:tt}]};return void 0===e.id&&r.id&&void 0!==u&&r.id(u),void 0===e.json&&r.json&&void 0!==c&&r.json(c),void 0===e.platform&&r.platform&&void 0!==v&&r.platform(v),void 0===e.theme&&r.theme&&void 0!==g&&r.theme(g),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==p&&r.globalVariablesController(p),void 0===e.onError&&r.onError&&void 0!==f&&r.onError(f),void 0===e.onStat&&r.onStat&&void 0!==h&&r.onStat(h),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==m&&r.onCustomAction(m),void 0===e.onComponent&&r.onComponent&&void 0!==y&&r.onComponent(y),void 0===e.setVariable&&r.setVariable&&void 0!==D&&r.setVariable(D),void 0===e.getVariable&&r.getVariable&&void 0!==S&&r.getVariable(S),void 0===e.execAction&&r.execAction&&void 0!==T&&r.execAction(T),!w&&et?`<div class="${j("divkit-b023",!0)+j(_?" divkit-ee11":"",!0)}">${M(Ue,"RootSvgFilters").$$render(t,{svgFiltersMap:J},{},{})}\n ${M(Te,"Unknown").$$render(t,{div:et,templateContext:{}},{},{})}</div>`:""})),en=tn;function rn(t){return en.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var nn=exports;for(var on in e)nn[on]=e[on];e.__esModule&&Object.defineProperty(nn,"__esModule",{value:!0})})();
|
|
1
|
+
(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},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 n(t){return t()}function i(t){t.forEach(n)}function o(t){return"function"==typeof t}function a(t,...e){if(null==t)return r;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}let s;function l(t){s=t}function c(){if(!s)throw new Error("Function called outside component initialization");return s}function u(t){c().$$.on_destroy.push(t)}function d(t,e){return c().$$.context.set(t,e),e}function v(t){return c().$$.context.get(t)}t.r(e),t.d(e,{createGlobalVariablesController:()=>rn,createVariable:()=>Je,render:()=>an}),new Set,new Map;const g=[],p=[],f=[],h=[],m=Promise.resolve();let y=!1;function _(){return y||(y=!0,m.then(x)),m}function b(t){f.push(t)}const w=new Set;let $=0;function x(){const t=s;do{for(;$<g.length;){const t=g[$];$++,l(t),k(t.$$)}for(l(null),g.length=0,$=0;p.length;)p.pop()();for(let t=0;t<f.length;t+=1){const e=f[t];w.has(e)||(w.add(e),e())}f.length=0}while(g.length);for(;h.length;)h.pop()();y=!1,w.clear(),l(t)}function k(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(b)}}new Set,"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;const E=new Set(["allowfullscreen","allowpaymentrequest","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","hidden","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),C=/[\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 F(t,e){const r=Object.assign({},...t);if(e){const t=e.classes,n=e.styles;t&&(null==r.class?r.class=t:r.class+=" "+t),n&&(null==r.style?r.style=T(n):r.style=T(function(t,e){const r={};for(const e of t.split(";")){const t=e.indexOf(":"),n=e.slice(0,t).trim(),i=e.slice(t+1).trim();n&&(r[n]=i)}for(const t in e){const n=e[t];n?r[t]=n:delete r[t]}return r}(r.style,n)))}let n="";return Object.keys(r).forEach((t=>{if(C.test(t))return;const e=r[t];!0===e?n+=" "+t:E.has(t.toLowerCase())?e&&(n+=" "+t):null!=e&&(n+=` ${t}="${e}"`)})),n}const A=/[&"]/g,V=/[&<]/g;function j(t,e=!1){const r=String(t),n=e?A:V;n.lastIndex=0;let i="",o=0;for(;n.test(r);){const t=n.lastIndex-1,e=r[t];i+=r.substring(o,t)+("&"===e?"&":'"'===e?""":"<"),o=t+1}return i+r.substring(o)}function D(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]=D(t[r]);return e}function P(t,e){let r="";for(let n=0;n<t.length;n+=1)r+=e(t[n],n);return r}const z={$$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`);return t}let M,O;function J(t){function e(e,r,n,i,o){const a=s;l({$$:{on_destroy:M,context:new Map(o||(a?a.$$.context:[])),on_mount:[],before_update:[],after_update:[],callbacks:Object.create(null)}});const c=t(e,r,n,i);return l(a),c}return{render:(t={},{$$slots:r={},context:n=new Map}={})=>{M=[];const o={title:"",head:"",css:new Set},a=e(o,t,{},r,n);return i(M),{html:a,css:{code:Array.from(o.css).map((t=>t.code)).join("\n"),map:null},head:o.title+o.head}},$$render:e}}function N(t,e,r){return null==e||r&&!e?"":` ${t}${r&&!0===e?"":`="${j(e,!0)}"`}`}function T(t){return Object.keys(t).filter((e=>t[e])).map((e=>`${e}: ${t[e]};`)).join(" ")}function B(t){const e=T(t);return e?` style="${e}"`:""}"function"==typeof HTMLElement&&(O=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(n).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,r){this[t]=r}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){(function(t,e){const r=t.$$;null!==r.fragment&&(i(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){const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(e),()=>{const t=r.indexOf(e);-1!==t&&r.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 n;const i=new Set;function o(e){if(o=e,((r=t)!=r?o==o:r!==o||r&&"object"==typeof r||"function"==typeof r)&&(t=e,n)){const e=!U.length;for(const e of i)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 i.add(l),1===i.size&&(n=e(o)||r),a(t),()=>{i.delete(l),0===i.size&&(n(),n=null)}}}}function R(t,e,n){const s=!Array.isArray(t),l=s?[t]:t,c=e.length<2;return u=t=>{let n=!1;const u=[];let d=0,v=r;const g=()=>{if(d)return;v();const n=e(s?u[0]:u,t);c?t(n):v=o(n)?n:r},p=l.map(((t,e)=>a(t,(t=>{u[e]=t,d&=~(1<<e),n&&g()}),(()=>{d|=1<<e}))));return n=!0,g(),function(){i(p),v()}},{subscribe:W(n,u).subscribe};var u}const L="divkit-bd25",q="divkit-c016",H="divkit-aa14",G="divkit-f0cb",Z=Symbol("root");function Y(t,e={}){const r=t;return r.level=e.level||"error",e.additional&&(r.additional=e.additional),r}const X={text:"divkit-d9b0",text_halign_left:"divkit-a4cb",text_halign_center:"divkit-e165",text_halign_right:"divkit-ea28",text_valign_top:"divkit-d8ce",text_valign_center:"divkit-ef58",text_valign_bottom:"divkit-fe8e",text__inner:"divkit-b852",text_singleline:"divkit-ef11",text_truncate_none:"divkit-c6ea",text_multiline:"divkit-ee8e",text__inner_gradient:"divkit-cb8e",text__image:"divkit-bf6e",text__image_hidden:"divkit-f100"},K={outer:"divkit-d65a","outer_hide-on-transition-in":"divkit-a6d1","outer_halign-self_start":"divkit-cc45","outer_halign-self_center":"divkit-b833","outer_halign-self_end":"divkit-c573","outer_halign-self_stretch":"divkit-dcc7","outer_valign-self_start":"divkit-e807","outer_valign-self_center":"divkit-d40a","outer_valign-self_end":"divkit-e9f8","outer_valign-self_stretch":"divkit-b7aa","outer_parent-flex_vertical":"divkit-c143","outer_parent-flex_horizontal":"divkit-ef30",outer_width_content:"divkit-b8f4",outer_height_content:"divkit-faa6","outer_width-constrained":"divkit-d321","outer_height-constrained":"divkit-a525","outer_parent-overlap":"divkit-dab2","outer_parent-overlap-absolute":"divkit-d43f","outer_scroll-snap_center":"divkit-d9e3","outer_scroll-snap_start":"divkit-efd1",outer__border:"divkit-d405",outer_visibility_invisible:"divkit-f018",outer_visibility_gone:"divkit-e784","outer_has-action-animation":"divkit-f498"};function Q(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 tt(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 et(t){let e=tt(t);return"0"===e&&(e+="em"),e}function rt(t,e){for(;t.length<e;)t="0"+t;return t}function nt(t,e=1,r="transparent"){if("#"!==(t=(t||"").toLowerCase()).charAt(0))return r;const n=it(t);return n?(n.a*=e,function(t){return 255===t.a?`#${[t.r,t.g,t.b].map((t=>rt(Math.round(t).toString(16),2))).join("")}`:`rgba(${t.r},${t.g},${t.b},${(t.a/255).toFixed(2)})`}(n)):r}function it(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,n,i,o]=e,a=2===n.length?n:n+n,s=2===i.length?i:i+i,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,n,i]=e,o=2===r.length?r:r+r,a=2===n.length?n:n+n,s=2===i.length?i:i+i;return{a:255,r:parseInt(o,16),g:parseInt(a,16),b:parseInt(s,16)}}return null}function ot(t){let e=String(t);return e.indexOf("&")>-1&&(e=e.replace(/&/g,"&")),e.indexOf("<")>-1&&(e=e.replace(/</g,"<")),e.indexOf(">")>-1&&(e=e.replace(/>/g,">")),e.indexOf('"')>-1&&(e=e.replace(/"/g,""")),e}const at=Boolean;function st(t){if(1===t.length&&"solid"===t[0].type)return{color:nt(t[0].color||"transparent"),size:"auto",position:"50% 50%"};const e=t.map((t=>"solid"===t.type?function(t){const e=nt(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(at);return r.length?{size:void 0,pos:void 0,image:"linear-gradient("+(90-Number(t.bg.angle||0))+"deg,"+r.map((t=>nt(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:ut(t.bg.scale),pos:dt(t.bg),image:'url("'+ot(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(at);if(!r.length)return;const n=t.bg.radius;let i;n&&"object"==typeof n&&"type"in n&&void 0!==n.value&&("fixed"===n.type?i=et(n.value):"relative"===n.type&&(i=lt[n.value]));return{size:void 0,pos:void 0,image:`radial-gradient(circle ${i||"farthest-corner"} at ${ct(t.bg.center_x)} ${ct(t.bg.center_y)},`+r.map((t=>nt(t))).join(",")+")"}}({bg:t}):void 0)).filter(at).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 lt={nearest_corner:"closest-corner",farthest_corner:"farthest-corner",nearest_side:"closest-side",farthest_side:"farthest-side"};function ct(t){if(t&&"object"==typeof t&&"type"in t&&void 0!==t.value){if("fixed"===t.type)return et(t.value);if("relative"===t.type)return 100*Number(t.value)+"%"}return"50%"}function ut(t){return"fill"!==t&&t?"fit"===t?"contain":void 0:"cover"}function dt(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 vt(t){const e=/^([^/]+):\/\//.exec(t);return e&&e[1]||""}const gt=new Set(["http","https","tel","mailto","intent"]);function pt(t){return gt.has(t)}function ft(t,e){e&&t.push(e)}function ht(t,e,r){const n=[];ft(n,e[t]);for(const i in r)if(r.hasOwnProperty(i)){const o=r[i];o&&ft(n,e[`${t}_${i}`+("string"==typeof o?`_${o}`:"")])}return n.join(" ")}const mt=Symbol("state");function yt(t){if("number"!=typeof t&&"string"!=typeof t)return!1;const e=Number(t);return!isNaN(e)}function _t(t){return yt(t)&&t>=0}function bt(t,e,r,n){const i=[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]];for(let t=0;t<i.length;++t)if(i[t]&&!_t(i[t]))return n;return function(t,e=0,r=10){return[t["top-left"],t["top-right"],t["bottom-right"],t["bottom-left"]].map((t=>tt((t||e)/r*10))).join(" ")}(t,e,r)}function wt(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]&&!_t(r[t]))return e;return function(t){return tt(t.top||0)+" "+tt(t.right||0)+" "+tt(t.bottom||0)+" "+tt(t.left||0)}(t)}function $t(t,e){const r=Number(t);return isNaN(r)||r<0?e:r}const xt=Object.prototype.hasOwnProperty;function kt(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),n=Object.keys(e);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++){const i=r[n];if(!xt.call(e,i)||!kt(t[i],e[i]))return!1}return!0}function Et(t,e){return kt(t,e)?e:t}function Ct(){}const Ft=Symbol("action"),At=J(((t,e,r,n)=>{let{actions:i}=e,{doubleTapActions:o}=e,{longTapActions:a}=e,{cls:s=""}=e,{style:l=null}=e,{attrs:c}=e,{use:u=Ct}=e,{customAction:g=null}=e,{hasActionAnimation:p=!1}=e;const f=v(Z),h=v(Ft);d(Ft,{hasAction:()=>Boolean(h.hasAction()||(null==i?void 0:i.length))});let m,y="";if(Array.isArray(i)&&(null==i?void 0:i.length))for(let t=0;t<i.length;++t){const e=i[t].url;if(e){y=e,m=i[t].target||void 0;break}}Array.isArray(i)&&(null==i?void 0:i.length)&&h.hasAction()&&(y="",f.logError(Y(new Error("Actionable element is forbidden inside other actionable element"),{level:"warn",additional:{actions:i}})));let _=Boolean(g);return y&&!pt(vt(y))&&(y="",_=!0),void 0===e.actions&&r.actions&&void 0!==i&&r.actions(i),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!==g&&r.customAction(g),void 0===e.hasActionAnimation&&r.hasActionAnimation&&void 0!==p&&r.hasActionAnimation(p),y?`<a${F([{href:D(y)},{target:D(m)},{style:D(l)},{class:j(s,!0)+" "+j(p?"":L,!0)+" "+j(null!=a&&a.length?G:"",!0)},S(c)],{})}>${n.default?n.default({}):""}</a>`:`<span${F([{class:j(s,!0)+j(_?` ${p?"":L} divkit-c016`:"",!0)+" "+j(null!=a&&a.length?G:"",!0)},{style:D(l)},{role:D(_?"button":null)},{tabindex:D(_?0:null)},S(c)],{})}>${n.default?n.default({}):""}</span>`})),Vt=At,jt="divkit-b921",Dt=J(((t,e,r,n)=>{let{background:i=[]}=e;const o=i.map((t=>{const e={},r=st([t]),n={style:e};return"solid"===t.type&&(e["background-color"]=r.color),"gradient"===t.type&&(e["background-image"]=r.image),"image"===t.type&&(e.opacity=Number(t.alpha),n.image_url=t.image_url,e["object-fit"]=r.size,e["object-position"]=r.position),n}));return void 0===e.background&&r.background&&void 0!==i&&r.background(i),`<span${N("class","divkit-bf25",0)}>${P(o,(t=>t.image_url?`<img${N("src",t.image_url,0)} alt="" aria-hidden="true" loading="lazy" decoding="async"${N("class",jt,0)}${N("style",Q(t.style),0)}>`:`<span${N("class",jt,0)}${N("style",Q(t.style),0)}></span>`))}</span>`}));function St(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}const zt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b,w,$,x,k,E,C,F,A,V,j,D,S,P,z,M,O,J,T,B,U,W,R,L,q,H,G,X,rt=r,it=r,ot=r,at=r,lt=r,ct=r,ut=r,dt=r,gt=r,ft=r,yt=r,xt=r,kt=r,Ct=r,Ft=r,At=r,jt=r;var zt,It,Mt,Ot,Jt,Nt;let{json:Tt={}}=e,{origJson:Bt}=e,{templateContext:Ut}=e,{cls:Wt=""}=e,{style:Rt}=e,{layoutParams:Lt={}}=e,{customDescription:qt=!1}=e,{customPaddings:Ht=!1}=e,{customActions:Gt=""}=e,{forceWidth:Zt=!1}=e,{forceHeight:Yt=!1}=e;const Xt={left:"start",center:"center",right:"end"},Kt={top:"start",center:"center",bottom:"end"},Qt=v(Z),te=v(mt);let ee,re,ne,ie,oe,ae,se,le={},ce={},ue=!1,de=1,ve="transparent",ge=0,pe="",fe="",he="",me={},ye=0,_e=0,be=0,we=!1,$e=!1,xe={},ke=0,Ee=0,Ce=0,Fe=!1,Ae=!1,Ve=1;const je=Lt.fakeElement?[]:Tt.transition_triggers||["state_change","visibility_change"],De=-1!==je.indexOf("state_change")&&Tt.id,Se=-1!==je.indexOf("visibility_change")&&Tt.id;let Pe,ze,Ie,Me,Oe,Je,Ne,Te,Be,Ue=[],We=[],Re=[],Le="",qe=!1,He="visible",Ge=0,Ze=0;void 0===e.json&&n.json&&void 0!==Tt&&n.json(Tt),void 0===e.origJson&&n.origJson&&void 0!==Bt&&n.origJson(Bt),void 0===e.templateContext&&n.templateContext&&void 0!==Ut&&n.templateContext(Ut),void 0===e.cls&&n.cls&&void 0!==Wt&&n.cls(Wt),void 0===e.style&&n.style&&void 0!==Rt&&n.style(Rt),void 0===e.layoutParams&&n.layoutParams&&void 0!==Lt&&n.layoutParams(Lt),void 0===e.customDescription&&n.customDescription&&void 0!==qt&&n.customDescription(qt),void 0===e.customPaddings&&n.customPaddings&&void 0!==Ht&&n.customPaddings(Ht),void 0===e.customActions&&n.customActions&&void 0!==Gt&&n.customActions(Gt),void 0===e.forceWidth&&n.forceWidth&&void 0!==Zt&&n.forceWidth(Zt),void 0===e.forceHeight&&n.forceHeight&&void 0!==Yt&&n.forceHeight(Yt),o=Qt.getDerivedFromVars(Tt.border),jt(),jt=a(o,(t=>X=t));{let t={},e={},r=!1;if(X){if(X.has_shadow){const e=X.shadow;t["box-shadow"]=e?tt((null===(It=null===(zt=e.offset)||void 0===zt?void 0:zt.x)||void 0===It?void 0:It.value)||0)+" "+tt((null===(Ot=null===(Mt=e.offset)||void 0===Mt?void 0:Mt.y)||void 0===Ot?void 0:Ot.value)||0)+" "+tt(null!==(Jt=e.blur)&&void 0!==Jt?Jt:2)+" "+nt(e.color||"#000000",null!==(Nt=e.alpha)&&void 0!==Nt?Nt:.19):"0 1px 2px 0 rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.07)"}X.stroke&&(r=!0,de=$t(X.stroke.width,de),ve=nt(X.stroke.color,1,ve),e.border=`${tt(de)} solid ${ve}`),X.corners_radius?(pe=bt(X.corners_radius,0,10,pe),e["border-radius"]=t["border-radius"]=pe):X.corner_radius&&(ge=$t(X.corner_radius,ge),e["border-radius"]=t["border-radius"]=tt(ge))}le=Et(t,le),ce=Et(e,ce),ue=r}s=Qt.getDerivedFromVars(Tt.paddings),At(),At=a(s,(t=>G=t)),fe=wt(G&&!Ht?G:void 0,fe),l=Qt.getDerivedFromVars(Tt.margins),Ct(),Ct=a(l,(t=>q=t)),he=wt(q,he),c=Qt.getDerivedFromVars(Tt.width),xt(),xt=a(c,(t=>R=t)),u=Qt.getDerivedFromVars(Tt.alignment_horizontal),Ft(),Ft=a(u,(t=>H=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const s=null==R?void 0:R.type;if("fixed"===s?(ye=$t(null==R?void 0:R.value,ye),e=tt(ye)):"wrap_content"===s||!Lt.overlapParent&&"match_parent"===s&&Lt.parentHorizontalWrapContent?(t="content",("wrap_content"===s&&(null==R?void 0:R.constrained)||"match_parent"===s&&Lt.parentHorizontalWrapContent)&&(r["width-constrained"]=!0,i=1),"match_parent"===s&&Qt.logError(Y(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","vertical"===Lt.parentContainerOrientation&&Lt.parentContainerWrap&&(a=!0,Qt.logError(Y(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"vertical"===Lt.parentLayoutOrientation?e=`calc(100% - ${et(((null==q?void 0:q.left)||0)+((null==q?void 0:q.right)||0))})`:"horizontal"===Lt.parentContainerOrientation&&(n=R&&"weight"in R&&R.weight||1,Lt.parentContainerWrap&&(o=!0))),"content"===t&&Zt&&(t="parent",Qt.logError(Y(new Error("Incorrect usage of width with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["halign-self"]="stretch";else{const t=H;r["halign-self"]="left"===t||"center"===t||"right"===t?Xt[t]:Lt.parentHAlign||"start"}t&&(r.width=t),ne=e,_e=n,be=i,me=Et(r,me),we=o,$e=a}d=Qt.getDerivedFromVars(Tt.height),yt(),yt=a(d,(t=>W=t)),g=Qt.getDerivedFromVars(Tt.alignment_vertical),kt(),kt=a(g,(t=>L=t));{let t,e,r={},n=0,i=0,o=!1,a=!1;const s=null==W?void 0:W.type;if("fixed"===s?(ke=$t(null==W?void 0:W.value,ke),e=tt(ke)):"match_parent"!==s||!Lt.overlapParent&&Lt.parentVerticalWrapContent?(t="content",("wrap_content"===s&&(null==W?void 0:W.constrained)||"match_parent"===s&&Lt.parentVerticalWrapContent)&&(r["height-constrained"]=!0,i=1),"match_parent"===s&&Qt.logError(Y(new Error("Cannot place child with match_parent size inside wrap_content"),{level:"warn"}))):(t="parent","horizontal"===Lt.parentContainerOrientation&&Lt.parentContainerWrap&&(a=!0,Qt.logError(Y(new Error("Cannot place a match_parent items on the cross-axis of wrap"),{level:"error"}))),"horizontal"===Lt.parentLayoutOrientation?e=`calc(100% - ${et(((null==q?void 0:q.top)||0)+((null==q?void 0:q.bottom)||0))})`:"vertical"===Lt.parentContainerOrientation&&(n=(null==W?void 0:W.weight)||1,Lt.parentContainerWrap&&(o=!0))),"content"===t&&Yt&&(t="parent",Qt.logError(Y(new Error("Incorrect usage of height with value 'wrap_content'"),{level:"warn"}))),"parent"===t)r["valign-self"]="stretch";else{const t=L;r["valign-self"]="top"===t||"center"===t||"bottom"===t?Kt[t]:Lt.parentVAlign||"start"}t&&(r.height=t),ie=e,Ee=n,Ce=i,xe=Et(r,xe),Fe=o,Ae=a}var Ye,Xe;if(p=!!Lt.overlapParent||void 0,f=Lt.overlapParent&&(!R||"match_parent"===R.type)&&"match_parent"===(null==W?void 0:W.type),h=Lt.gridArea?`${Lt.gridArea.y+1}/${Lt.gridArea.x+1}/span ${Lt.gridArea.rowSpan}/span ${Lt.gridArea.colSpan}`:void 0,m=Qt.getDerivedFromVars(Tt.alpha),ft(),ft=a(m,(t=>U=t)),Xe=Ve,Ve=!_t(Ye=U)||void 0===Ye||Ye>1?Xe:Number(Ye),oe=1===Ve?void 0:Ve,y=Qt.getDerivedFromVars(Tt.accessibility),gt(),gt=a(y,(t=>B=t)),re=void 0,B&&!qt&&B.description&&(re={},re["aria-label"]=B.description),b=Qt.getDerivedFromVars(Tt.background),dt(),dt=a(b,(t=>T=t)),ae={},se=!1,T&&(se=T.some((t=>"image"===t.type)),!se)){const t=st(T);ae["background-color"]=t.color,ae["background-image"]=t.image,ae["background-size"]=t.size,ae["background-position"]=t.position,ae["background-repeat"]="no-repeat"}Pe=void 0,De&&Tt.transition_in&&Qt.isRunning("stateChange")&&(Pe=!0),Ie=void 0,De&&Tt.transition_change&&Qt.isRunning("stateChange")&&te.hasTransitionChange(Tt.id)&&(Ie=!0),w=Qt.getDerivedFromVars(Tt.action),ct(),ct=a(w,(t=>O=t)),$=Qt.getDerivedFromVars(Tt.actions),ut(),ut=a($,(t=>J=t)),x=Qt.getDerivedFromVars(Tt.doubletap_actions),lt(),lt=a(x,(t=>M=t)),k=Qt.getDerivedFromVars(Tt.longtap_actions),at(),at=a(k,(t=>z=t));{let t=J||O&&[O]||[],e=M||[],r=z||[];Lt.fakeElement?(t=[],e=[],r=[]):(Array.isArray(t)||(t=[],Qt.logError(Y(new Error("Actions should be array")))),Array.isArray(e)||(e=[],Qt.logError(Y(new Error("DoubleTapActions should be array")))),Array.isArray(r)||(r=[],Qt.logError(Y(new Error("LongTapActions should be array"))))),(t.length||e.length||r.length)&&Gt&&(t=[],e=[],r=[],Qt.logError(Y(new Error(`Cannot use action on component "${Gt}"`)))),Ue=t,We=e,Re=r}E=Qt.getDerivedFromVars(Tt.action_animation),ot(),ot=a(E,(t=>P=t)),P&&(Le=function t(e){var r;const n=Pt(e.start_value,1),i=Pt(e.end_value,1),o=$t(e.start_delay,0),a=$t(e.duration,300),s=St(e.interpolator,"ease_in_out").replace(/_/g,"-");switch(e.name){case"fade":return Me=n,Oe=i,`opacity ${a}ms ${s} ${o}ms`;case"scale":return Je=n,Ne=i,`transform ${a}ms ${s} ${o}ms`;case"set":return(null===(r=e.items)||void 0===r?void 0:r.length)?e.items.map(t).join(", "):(Qt.logError(Y(new Error("Empty items value for action_animation with name='set'"))),"");default:return Qt.logError(Y(new Error("Unknown action_animation name"),{additional:{animation:e.name}})),""}}(P)),C=Qt.getDerivedFromVars(Tt.visibility),it(),it=a(C,(t=>S=t));{const t=He,e=function(t,e){return"visible"===t||"invisible"===t||"gone"===t?t:e}(S,He);t!==e&&(!qe||"visible"!==He&&"visible"!==e?He=e:async function(t){He=t;const e="visible"===t?"in":"out",r="in"===e?Tt.transition_in:Tt.transition_out;Se&&r&&(await _(),"in"===e&&(ze=!0),te.runVisibilityTransition(Object.assign(Object.assign({},Tt),{visibility:"visible"}),Ut,r,ee,e).then((()=>{"in"===e&&(ze=!1)})).catch((t=>{throw"in"===e&&(ze=!1),t})))}(e)),qe||(qe=!0)}if(F=Object.assign(Object.assign(Object.assign({},me),xe),{"parent-overlap":p,"parent-overlap-absolute":f,"scroll-snap":Lt.scrollSnap,"hide-on-transition-in":Pe||ze||Ie,visibility:He,"has-action-animation":Boolean(Le),"parent-flex":Lt.parentContainerOrientation||void 0}),A=Qt.getDerivedFromVars(Tt.transform),rt(),rt=a(A,(t=>D=t)),D&&void 0!==D.rotation){const t=D.pivot_x||{type:"pivot-percentage",value:50};Ge=Pt(t.value,Ge);const e="pivot-fixed"===t.type?tt(Ge):`${Ge}%`,r=D.pivot_y||{type:"pivot-percentage",value:50};Ze=Pt(r.value,Ze),Te=`${e} ${"pivot-fixed"===r.type?tt(Ze):`${Ze}%`}`,Be=`rotate(${D.rotation}deg)`}return V=we||Fe?"100%":_e||Ee?0:void 0,j=Object.assign(Object.assign(Object.assign(Object.assign({},Rt),ae),le),{width:ne,height:ie,"grid-area":h,padding:fe,margin:he,opacity:oe,transition:Le,"transform-origin":Te,transform:Be,"flex-grow":_e||Ee||void 0,"flex-shrink":be||Ce?1:void 0,"flex-basis":V,"--divkit-animation-opacity-start":Me,"--divkit-animation-opacity-end":Oe,"--divkit-animation-scale-start":Je,"--divkit-animation-scale-end":Ne}),rt(),it(),ot(),at(),lt(),ct(),ut(),dt(),gt(),ft(),yt(),xt(),kt(),Ct(),Ft(),At(),jt(),$e||Ae?"":`${I(Vt,"Actionable").$$render(t,{use:function(t){ee=t,De&&Tt.transition_in&&te.registerChildWithTransitionIn(Tt,Ut,Tt.transition_in,t).then((()=>{Pe=!1})).catch((t=>{throw Pe=!1,t})),De&&Tt.transition_out&&te.registerChildWithTransitionOut(Tt,Ut,Tt.transition_out,t),De&&Tt.transition_change&&te.registerChildWithTransitionChange(Tt,Ut,Tt.transition_change,t).then((()=>{Ie=!1})).catch((t=>{throw Ie=!1,t})),function(t,{visibilityActions:e,rootCtx:r}){if(null==e||!e.length)return;const n=e.map((t=>({action:t,visible:!1,count:0,finished:!1}))),i=[...new Set([...e.map((t=>(t.visibility_percentage||50)/100))])];new IntersectionObserver((t=>{t.forEach((t=>{n.forEach((e=>{const n=t.intersectionRatio>=(e.action.visibility_percentage||50)/100;!e.visible&&n?e.finished||(e.timer=setTimeout((()=>{++e.count;const t=0===e.action.log_limit?1/0:e.action.log_limit||1;++e.count>=t&&(e.finished=!0);const n=e.action.url;if(n){const t=vt(n);t&&!pt(t)&&("div-action"===t?r.execAction(e.action):e.action.log_id&&r.execCustomAction(e.action))}r.logStat("visible",e.action)}),e.action.visibility_duration||800)):n||e.timer&&clearTimeout(e.timer),e.visible=n}))}))}),{threshold:i}).observe(t)}(t,{visibilityActions:Lt.fakeElement?[]:Qt.getJsonWithVars(Tt.visibility_actions||Tt.visibility_action&&[Tt.visibility_action]),rootCtx:Qt});const e=Tt.id;e&&te.registerChild(e);let r=null;return{destroy(){e&&te.unregisterChild(e),r&&r.destroy()}}},cls:Wt+" "+ht("outer",K,F),style:Q(j),actions:Ue,doubleTapActions:We,longTapActions:Re,attrs:re,hasActionAnimation:Boolean(Le)},{},{default:()=>`${se?`${I(Dt,"OuterBackground").$$render(t,{background:T},{},{})}`:""}${i.default?i.default({}):""}${ue?`<span${N("class",K.outer__border,0)}${N("style",Q(ce),0)}></span>`:""}`})}`})),It={"text-range":"divkit-faf0","text-range_singleline":"divkit-ccb6","text-range__top-offset":"divkit-d923","text-range_decoration_both":"divkit-d7e0","text-range_decoration_underline":"divkit-f3dd","text-range_decoration_strike":"divkit-d27b","text-range_decoration_none":"divkit-c6b0"};function Mt(t,e){const r=Number(t);return isNaN(r)||r<=0?e:r}function Ot(t){return yt(t)&&t>0}function Jt(t){if("light"===t||"medium"===t||"bold"===t||"regular"===t)return"medium"===t?500:"bold"===t?700:"light"===t?300:400}function Nt(t,e){return Jt(t)||e}const Tt=J(((t,e,r,n)=>{let i,o,a,s,{text:l}=e,{rootFontSize:c}=e,{textStyles:u={}}=e,{singleline:d=!1}=e,{actions:v}=e,g="none",p=12,f=1.25,h="",m="";void 0===e.text&&r.text&&void 0!==l&&r.text(l),void 0===e.rootFontSize&&r.rootFontSize&&void 0!==c&&r.rootFontSize(c),void 0===e.textStyles&&r.textStyles&&void 0!==u&&r.textStyles(u),void 0===e.singleline&&r.singleline&&void 0!==d&&r.singleline(d),void 0===e.actions&&r.actions&&void 0!==v&&r.actions(v);{let t="none";(u.underline||u.strike)&&("single"===u.underline&&"single"===u.strike?t="both":"single"===u.underline?t="underline":"single"===u.strike&&(t="strike")),g=t}return p=Mt(u.font_size,p),Ot(u.line_height)&&(f=Number(u.line_height)/p),_t(u.letter_spacing)&&(h=tt(u.letter_spacing)),s=Nt(u.font_weight,s),m=nt(u.text_color,1,m),i=u.top_offset?tt(u.top_offset):"",o={singleline:d,decoration:g},a={"font-size":tt(10*p/c),"line-height":f,"letter-spacing":h,"font-weight":s,color:m},`${i?`<span${N("class",It["text-range__top-offset"],0)}${B({"margin-top":i})}></span>`:""}${I(Vt,"Actionable").$$render(t,{cls:ht("text-range",It,o),actions:v,style:Q(a)},{},{default:()=>`${j(l)}`})}`}));function Bt(t,e){return"left"===t||"center"===t||"right"===t?t:e}function Ut(t,e){return"top"===t||"center"===t||"bottom"===t?t:e}const Wt=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,j,D,S,z,M,O,J,T,B,U,W,R=r,L=r,H=r,G=r,K=r,et=r,rt=r,it=r,ot=r,at=r,lt=r,ct=r,ut=r,{json:dt={}}=e,{templateContext:vt}=e,{origJson:gt}=e,{layoutParams:pt}=e;const ft=v(Z);let mt=!1,yt="",_t=12,bt=1.25,wt=!1,$t="",xt="",kt=!1,Et="left",Ct="top",Ft="",At="",Vt=!1,jt=[],Dt=[];var St,Pt;u((()=>{Dt.forEach((t=>{ft.removeSvgFilter(t)}))})),void 0===e.json&&n.json&&void 0!==dt&&n.json(dt),void 0===e.templateContext&&n.templateContext&&void 0!==vt&&n.templateContext(vt),void 0===e.origJson&&n.origJson&&void 0!==gt&&n.origJson(gt),void 0===e.layoutParams&&n.layoutParams&&void 0!==pt&&n.layoutParams(pt),o=ft.getDerivedFromVars(dt.text),ut(),ut=a(o,(t=>W=t)),St=W,Pt=yt,yt=String(null!=St?St:"")||Pt,yt?mt=!1:(mt=!0,ft.logError(Y(new Error('Missing "text" prop for div "text"')))),s=ft.getDerivedFromVars(dt.ranges),L(),L=a(s,(t=>V=t)),l=ft.getDerivedFromVars(dt.images),R(),R=a(l,(t=>A=t)),c=ft.getDerivedFromVars({font_size:dt.font_size,letter_spacing:dt.letter_spacing,font_weight:dt.font_weight,text_color:dt.text_color,underline:dt.underline,strike:dt.strike,line_height:dt.line_height}),H(),H=a(c,(t=>j=t)),d=ft.getDerivedFromVars(dt.font_size),ct(),ct=a(d,(t=>U=t)),_t=Mt(U,_t),g=ft.getDerivedFromVars(dt.line_height),lt(),lt=a(g,(t=>B=t));{const t=B;Ot(t)?(bt=Number(t)/_t,wt=!0):wt=!1}p=ft.getDerivedFromVars(dt.max_lines),it(),it=a(p,(t=>O=t)),f=1===O;{let t="",e="",r=!1;if(O&&O>1){let n=Number(O);t=n*bt+"em",V||A||(e=n,r=!0)}$t=t,xt=e,kt=r}h=ft.getDerivedFromVars(dt.text_alignment_horizontal),at(),at=a(h,(t=>T=t)),Et=Bt(T,Et),m=ft.getDerivedFromVars(dt.text_alignment_vertical),ot(),ot=a(m,(t=>J=t)),Ct=Ut(J,Ct),y=!V||yt&&1===V.length&&V[0]&&0===V[0].start&&"number"==typeof V[0].end&&V[0].end>=yt.length,_=ft.getDerivedFromVars(dt.text_color),rt(),rt=a(_,(t=>M=t)),b=Boolean(M)!==Boolean(V&&V[0]&&V[0].text_color);{let t="";O&&y&&b&&(t=nt(M||V&&V[0]&&V[0].text_color,1,Ft)),Ft=t}w=ft.getDerivedFromVars(dt.truncate),et(),et=a(w,(t=>z=t)),$="none"===z?"none":"",x=ft.getDerivedFromVars(dt.text_gradient),K(),K=a(x,(t=>S=t));{let t="";if(S){const e=st([S]);e.image&&(t=e.image)}At=t}return k=ft.getDerivedFromVars(dt.selectable),G(),G=a(k,(t=>D=t)),Vt=function(t,e){return 1===t||0===t||!1===t||!0===t?Boolean(t):e}(D,Vt),function(t,e,r){let n=[];if(Dt.forEach((t=>{ft.removeSvgFilter(t)})),Dt=[],!(Array.isArray(e)&&e.length||Array.isArray(r)&&r.length&&t))return void(jt=[]);const i=t;let o=e||[{start:0,end:i.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<=i.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);n.push({text:i.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=tt(10*(t.image.width&&t.image.width.value||20)/(e.font_size||12)),i=tt(10*(t.image.height&&t.image.height.value||20)/(e.font_size||12));const o={"font-size":tt(10*(Number(e.font_size)||12)/_t)};let a="";if(t.image.tint_color){const e=nt(t.image.tint_color);a=ft.addSvgFilter(e),Dt.push(e)}n.push({image:{url:t.image.url,width:r,height:i,wrapperStyle:o,svgFilterId:a}})}s=o})),s<i.length&&n.push({text:i.substring(s),textStyles:Object.assign({},j)}),jt=n}(yt,V,A),E={singleline:f,multiline:kt,halign:Et,valign:Ct,truncate:$},C={gradient:Boolean(At)},F={"font-size":tt(_t),"line-height":bt,"max-height":$t,"-webkit-line-clamp":xt,color:Ft,"background-image":At},R(),L(),H(),G(),K(),et(),rt(),it(),ot(),at(),lt(),ct(),ut(),mt?"":`${I(zt,"Outer").$$render(t,{cls:ht("text",X,E)+" "+(Vt?"":q),json:dt,origJson:gt,templateContext:vt,layoutParams:pt},{},{default:()=>`<span${N("class",ht("text__inner",X,C),0)}${N("style",Q(F),0)}>${jt.length?`${P(jt,((e,r)=>"text"in e?e.text?`${I(Tt,"TextRangeView").$$render(t,{text:e.text,rootFontSize:_t,textStyles:e.textStyles,singleline:f,actions:e.actions},{},{})}`:"":e.image?`<span${N("style",Q(e.image.wrapperStyle),0)}><img${N("class",X.text__image,0)}${N("src",e.image.url,0)} loading="lazy" decoding="async" aria-hidden="true" alt=""${N("style",Q({width:e.image.width,height:e.image.height,"margin-top":wt?`-${e.image.height}`:void 0,"margin-bottom":wt?`-${e.image.height}`:void 0,filter:e.image.svgFilterId?`url(#${e.image.svgFilterId})`:void 0}),0)}></span>`:""))}`:`${I(Tt,"TextRangeView").$$render(t,{text:yt,rootFontSize:_t,textStyles:j,singleline:f},{},{})}`}</span>`})}`})),Rt=Wt,Lt={container:"divkit-d37d",container_wrap:"divkit-c855",container_orientation_vertical:"divkit-ddc3",container_valign_top:"divkit-a331",container_valign_center:"divkit-aae6",container_valign_bottom:"divkit-c222",container_orientation_horizontal:"divkit-fe45",container_halign_left:"divkit-a309",container_halign_center:"divkit-bac9",container_halign_right:"divkit-f423",container_orientation_overlap:"divkit-a644"},qt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,_,b,w,$,x=r,k=r,E=r,C=r,F=r,A=r,{json:V={}}=e,{templateContext:j}=e,{origJson:D}=e,{layoutParams:S}=e;const z={left:"start",center:"center",right:"end"},M={top:"start",center:"center",bottom:"end"},O=v(Z);let J=!1,N="vertical",T="top",B="left",U={};void 0===e.json&&n.json&&void 0!==V&&n.json(V),void 0===e.templateContext&&n.templateContext&&void 0!==j&&n.templateContext(j),void 0===e.origJson&&n.origJson&&void 0!==D&&n.origJson(D),void 0===e.layoutParams&&n.layoutParams&&void 0!==S&&n.layoutParams(S),o=V.items,(null==o?void 0:o.length)&&Array.isArray(o)?J=!1:(J=!0,O.logError(Y(new Error('Incorrect or empty "items" prop for div "container"')))),s=(!J&&o||[]).map((t=>{let e=t,r=j;return({templateContext:r,json:e}=O.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=O.getDerivedFromVars(V.orientation),A(),A=a(l,(t=>$=t)),N=function(t,e){return"vertical"===t||"horizontal"===t||"overlap"===t?t:e}($,N),c=O.getDerivedFromVars(V.content_alignment_vertical),F(),F=a(c,(t=>w=t)),T=Ut(w,T),u=O.getDerivedFromVars(V.content_alignment_horizontal),C(),C=a(u,(t=>b=t)),B=Bt(b,B),d=O.getDerivedFromVars(V.layout_mode),E(),E=a(d,(t=>_=t)),g="wrap"===_,p=O.getDerivedFromVars(V.width),x(),x=a(p,(t=>m=t)),f=O.getDerivedFromVars(V.height),k(),k=a(f,(t=>y=t));{let t={};(null==S?void 0:S.fakeElement)&&(t.fakeElement=!0),"overlap"===N&&(t.overlapParent=!0),"horizontal"!==N&&(t.parentHAlign=z[B],(!y||"wrap_content"===y.type||"match_parent"===y.type&&(null==S?void 0:S.parentVerticalWrapContent))&&(t.parentVerticalWrapContent=!0)),"vertical"!==N&&(t.parentVAlign=M[T],("wrap_content"===(null==m?void 0:m.type)||"match_parent"===(null==m?void 0:m.type)&&(null==S?void 0:S.parentHorizontalWrapContent))&&(t.parentHorizontalWrapContent=!0)),"horizontal"===N&&(t.parentContainerOrientation="horizontal"),"vertical"===N&&(t.parentContainerOrientation="vertical"),g&&(t.parentContainerWrap=!0),U=Et(t,U)}return h={orientation:N,valign:T,halign:B,wrap:g},x(),k(),E(),C(),F(),A(),J?"":`${I(zt,"Outer").$$render(t,{cls:ht("container",Lt,h),json:V,origJson:D,templateContext:j,layoutParams:S},{},{default:()=>`${P(s,(e=>`${I(Re,"Unknown").$$render(t,{layoutParams:U,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),Ht={separator:"divkit-a30b",separator_orientation_horizontal:"divkit-f529",separator_orientation_vertical:"divkit-e9e2",separator__inner:"divkit-db7d"};function Gt(t,e){return"vertical"===t||"horizontal"===t?t:e}const Zt=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p=r,{json:f={}}=e,{templateContext:h}=e,{origJson:m}=e,{layoutParams:y}=e;const _=v(Z);let b="horizontal",w="rgba(0,0,0,0.08)";return void 0===e.json&&n.json&&void 0!==f&&n.json(f),void 0===e.templateContext&&n.templateContext&&void 0!==h&&n.templateContext(h),void 0===e.origJson&&n.origJson&&void 0!==m&&n.origJson(m),void 0===e.layoutParams&&n.layoutParams&&void 0!==y&&n.layoutParams(y),o=_.getDerivedFromVars(f.delimiter_style),p(),p=a(o,(t=>g=t)),b=Gt(null==g?void 0:g.orientation,b),s=!((null==g?void 0:g.color)&&("transparent"===g.color||9===g.color.length&&0===g.color.indexOf("#00"))),w=nt(null==g?void 0:g.color,1,w),l="horizontal"===b?"100%":tt(1),c="horizontal"===b?tt(1):"100%",u={background:w,width:l,height:c},d={orientation:b},p(),`${I(zt,"Outer").$$render(t,{cls:ht("separator",Ht,d),json:f,origJson:m,templateContext:h,layoutParams:y},{},{default:()=>s?`<span${N("class",Ht.separator__inner,0)}${N("style",Q(u),0)}></span>`:""})}`})),Yt={image:"divkit-a448","image_is-width-content":"divkit-fe14","image_is-height-content":"divkit-f4d9",image__image:"divkit-ce04",image_error:"divkit-f10d","image__aspect-wrapper":"divkit-dc80",image_aspect:"divkit-ae78",image_loaded:"divkit-cf4e","divkit-image-appearance":"divkit-e555","image_before-appearance":"divkit-ffe8"},Xt=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,j,D,S,P,z,M,O,J,T,U=r,W=r,R=r,L=r,q=r,H=r,G=r,X=r,K=r,tt=r,et=r,rt=r,{json:it={}}=e,{templateContext:at}=e,{origJson:st}=e,{layoutParams:lt}=e;const ct=v(Z);let vt,gt=0,pt="rgba(0,0,0,0.08)",ft=!1,mt="",yt="none",_t="50% 50%",bt="0",wt="",xt="",kt=0,Et=0,Ct=0;u((()=>{ct.removeSvgFilter(vt)})),void 0===e.json&&n.json&&void 0!==it&&n.json(it),void 0===e.templateContext&&n.templateContext&&void 0!==at&&n.templateContext(at),void 0===e.origJson&&n.origJson&&void 0!==st&&n.origJson(st),void 0===e.layoutParams&&n.layoutParams&&void 0!==lt&&n.layoutParams(lt),o=ct.getDerivedFromVars(it.image_url),rt(),rt=a(o,(t=>T=t)),s=ct.getDerivedFromVars(it.gif_url),et(),et=a(s,(t=>J=t)),l=T||J,gt=0,l?ft=!1:(ft=!0,ct.logError(Y(new Error('Missing "image_url" for "image"')))),c=ct.getDerivedFromVars(it.width),tt(),tt=a(c,(t=>O=t)),d="wrap_content"===(null==O?void 0:O.type),g=ct.getDerivedFromVars(it.height),K(),K=a(g,(t=>M=t)),p="wrap_content"===(null==M?void 0:M.type),f=ct.getDerivedFromVars(it.preview),X(),X=a(f,(t=>z=t));{const t=z;mt=t?t.startsWith("data:")?`url("${ot(t)}")`:`url("data:image/jpg;base64,${ot(t)}")`:""}h=ct.getDerivedFromVars(it.placeholder_color),G(),G=a(h,(t=>P=t)),pt=nt(P,1,pt),m=ct.getDerivedFromVars(it.scale),H(),H=a(m,(t=>S=t)),yt=ut(S)||yt,y=ct.getDerivedFromVars({content_alignment_horizontal:it.content_alignment_horizontal,content_alignment_vertical:it.content_alignment_vertical}),q(),q=a(y,(t=>D=t)),_t=function(t,e){const r=t.content_alignment_horizontal,n=t.content_alignment_vertical;return r&&"left"!==r&&"center"!==r&&"right"!==r||n&&"top"!==n&&"center"!==n&&"bottom"!==n?e:dt(t)}(D,_t),_=ct.getDerivedFromVars(it.accessibility),L(),L=a(_,(t=>j=t)),b=(null==j?void 0:j.description)||"",w=ct.getDerivedFromVars(it.aspect),R(),R=a(w,(t=>V=t));{const t=null==V?void 0:V.ratio;bt=t&&Ot(t)?(100/Number(t)).toFixed(2):"0"}$=ct.getDerivedFromVars(it.tint_color),W(),W=a($,(t=>A=t));{const t=A,e=t?nt(t):void 0;e!==vt&&(ct.removeSvgFilter(vt),wt=e?ct.addSvgFilter(e):"",vt=e)}if(x=ct.getDerivedFromVars(it.appearance_animation),U(),U=a(x,(t=>F=t)),F&&"fade"===F.type){const t=F;xt=St(t.interpolator,"ease_in_out").replace(/_/g,"-"),Ct=$t(t.duration,300),Et=$t(t.start_delay,0),kt=$t(t.alpha,0)}return k={aspect:"0"!==bt,"is-width-content":d,"is-height-content":p,loaded:!1,"before-appearance":Boolean(xt)&&!0},E={"background-image":mt,"background-color":pt},C={"object-fit":yt,"object-position":_t,filter:"","--divkit-appearance-interpolator":xt||void 0,"--divkit-appearance-fade-start":xt?kt:void 0,"--divkit-appearance-delay":xt?`${Et}ms`:void 0,"--divkit-appearance-duration":xt?`${Ct}ms`:void 0},U(),W(),R(),L(),q(),H(),G(),X(),K(),tt(),et(),rt(),ft?"":`${I(zt,"Outer").$$render(t,{cls:ht("image",Yt,k),json:it,origJson:st,templateContext:at,layoutParams:lt,style:E,customDescription:!0},{},{default:()=>k.aspect?`<span${N("class",Yt["image__aspect-wrapper"],0)}${B({"padding-bottom":`${bt}%`})}><img${N("class",Yt.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Q(C),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}></span>`:`<img${N("class",Yt.image__image,0)}${N("src",l,0)} loading="lazy" decoding="async"${N("style",Q(C),0)}${N("alt",b,0)}${N("aria-hidden",b?null:"true",0)}>`})}`})),Kt={grid:"divkit-d908",grid_halign_left:"divkit-f63b",grid_halign_center:"divkit-a14a",grid_halign_right:"divkit-b071",grid_valign_top:"divkit-fbca",grid_valign_center:"divkit-d431",grid_valign_bottom:"divkit-e420"};function Qt(t){return t>0&&t<1}function te(t){return String(Math.ceil(1e3*t)/1e3)}function ee(t,e,r){if(t.some(Qt)){const e=Math.max(...t.filter(Qt).map((t=>1/t)));t=t.map((t=>t*e))}let n=0,i=0;const o=[];if(t.every(Boolean)){i=t.reduce(((t,e)=>t+e),0);for(let o=0;o<r;++o){if(!e[o])continue;const r=e[o]/t[o]*i;r>n&&(n=r)}}for(let e=0;e<r;++e)n?o[e]=`minmax(${tt(n*t[e]/i)},${te(t[e])}fr)`:t[e]?o[e]=`${te(t[e])}fr`:o[e]="auto";return o.join(" ")}const re=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,_=r,b=r,w=r,$=r,{json:x={}}=e,{templateContext:k}=e,{origJson:E}=e,{layoutParams:C}=e;const F=v(Z);let A,V,j=!1,D=1,S=[],z=[],M=[],O=[],J=0,N=!1,T="top",B="left";void 0===e.json&&n.json&&void 0!==x&&n.json(x),void 0===e.templateContext&&n.templateContext&&void 0!==k&&n.templateContext(k),void 0===e.origJson&&n.origJson&&void 0!==E&&n.origJson(E),void 0===e.layoutParams&&n.layoutParams&&void 0!==C&&n.layoutParams(C),o=x.items,(null==o?void 0:o.length)&&Array.isArray(o)?j=!1:(j=!0,F.logError(Y(new Error('Incorrect or empty "items" prop for div "grid"')))),s=F.getDerivedFromVars(x.column_count),$(),$=a(s,(t=>y=t)),D=Mt(y,D),l=(!j&&o||[]).map((t=>{let e=t,r=k;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=R(t,(t=>[...t])),w(),w=a(A,(t=>m=t))}{const t={};let e=0,r=0;S=[],z=[],M=[],O=[],N=!1,V=l.map(((n,i)=>{var o,a,s,l;const c=m[i],u=Number(c.columnSpan)||1,d=Number(c.rowSpan)||1,v={x:e,y:r,colSpan:u,rowSpan:d},g="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 n=e;n<e+u;++n)for(let e=r;e<r+d;++e)t[n+"_"+e]?N=!0:(t[n+"_"+e]=!0,(!S[n]||S[n]<g)&&(S[n]=g),(!z[e]||z[e]<p)&&(z[e]=p),(!M[n]||M[n]<f)&&(M[n]=f),(!O[e]||O[e]<h)&&(O[e]=h));do{++e,e>=D&&(e=0,++r)}while(t[e+"_"+r]);return Object.assign(Object.assign({},n),{layoutParams:{gridArea:v,fakeElement:(null==C?void 0:C.fakeElement)||!1}})})),0!==e&&(N=!0),N&&F.logError(Y(new Error('Mismatching "grid" rows/columns'))),J=r}return c=F.getDerivedFromVars(x.content_alignment_vertical),b(),b=a(c,(t=>h=t)),T=Ut(h,T),u=F.getDerivedFromVars(x.content_alignment_horizontal),_(),_=a(u,(t=>f=t)),B=Bt(f,B),d={valign:T,halign:B},g={"grid-template-columns":ee(S,M,D),"grid-template-rows":ee(z,O,J)},p=j||N,_(),b(),w(),$(),p?"":`${I(zt,"Outer").$$render(t,{cls:ht("grid",Kt,d),json:x,origJson:E,templateContext:k,style:g,layoutParams:C},{},{default:()=>`${P(V,(e=>`${I(Re,"Unknown").$$render(t,{layoutParams:e.layoutParams,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}`})}`})),ne=re,ie={gallery:"divkit-cbb0",gallery_orientation_horizontal:"divkit-c9be",gallery_orientation_vertical:"divkit-a72d",gallery__scroller:"divkit-a4e3","gallery_scroll-snap":"divkit-f606","gallery__items-grid":"divkit-eb4a",gallery__items:"divkit-af27",gallery__arrow:"divkit-b72d","gallery__arrow-icon":"divkit-d100",gallery__arrow_left:"divkit-a0a5",gallery__arrow_right:"divkit-f0f5","gallery__arrow-icon-path":"divkit-b417"};function oe(t){const e=[];let r=t[0],n=1;for(let i=1;i<=t.length;i++)t[i]!==r?(e.push(n>1?`repeat(${n}, ${r})`:r),r=t[i],n=1):n++;return e.join(" ")}function ae(t,e){let r;return function(...n){null!==r&&clearTimeout(r),r=setTimeout((()=>{t.apply(this,n),r=null}),e)}}const se=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,z,M,O,J,T,B=r,U=r,W=r,L=r,q=r,G=r,X=r,K=r,et=r,rt=r,{json:nt={}}=e,{templateContext:it}=e,{origJson:ot}=e,{layoutParams:at}=e;const st=v(Z);let lt,ct,ut=[],dt=!1,vt=!1,gt=null,pt=!1,ft=!1;J=a(st.isDesktop,(t=>O=t));let mt,yt,_t,bt,xt=1,kt="horizontal",Ct="start",Ft=8,At="",Vt=[],jt={},Dt=!1,St={},Pt=0;const It=ae((function(){const t=lt.scrollLeft,e=lt.scrollWidth,r=lt.offsetWidth;dt=t>2,vt=t+r<e-2}),50);function Ot(){let t=[],e=ut[0].children.length;for(let r=0;r<e;++r)for(let e=0;e<xt;++e){const n=ut[e].children[r];n&&t.push(n)}return t}function Jt(t,e,r="smooth"){const n="horizontal"===kt,i=n?"offsetLeft":"offsetTop",o=n?"left":"top";lt.scroll({[o]:Math.max(0,t[e][i]-Ft/2),behavior:r})}function Nt(t){const e=Ot(),r=lt.getBoundingClientRect(),n=e.findIndex((t=>function(t,e){return"horizontal"===kt?e.left>=t.left&&e.right<=t.right:e.top>=t.top&&e.bottom<=t.bottom}(r,t.getBoundingClientRect())));if(-1!==n)return n;const i=e.map((t=>function(t,e){return"horizontal"===kt?e.right>t.left&&t.right>e.left:e.bottom>t.top&&t.bottom>e.top}(r,t.getBoundingClientRect()))),o=i.findIndex(Boolean);return-1!==o?"prev"===t&&2===i.filter(Boolean).length?o+1:o:"prev"===t?1:e.length-2}!nt.id||ft||(null==at?void 0:at.fakeElement)||st.registerInstance(nt.id,{setCurrentItem(t){const e=Ot();if(t<0||t>e.length-1)throw new Error('Item is out of range in "set-current-item" action');Jt(e,t)},setPreviousItem(t){const e=Nt("prev"),r=Ot();let n=e-1;n<0&&(n="ring"===t?r.length-1:e),Jt(r,n)},setNextItem(t){const e="horizontal"===kt?lt.scrollLeft+lt.offsetWidth===lt.scrollWidth:lt.scrollTop+lt.offsetHeight===lt.scrollHeight,r=Ot();if(e&&"ring"===t)return void Jt(r,0);const n=Nt("next");let i=n+1;i>r.length-1&&(i="ring"===t?0:n),Jt(r,i)}}),u((()=>{pt=!1,nt.id&&!(null==at?void 0:at.fakeElement)&&st.unregisterInstance(nt.id)})),void 0===e.json&&n.json&&void 0!==nt&&n.json(nt),void 0===e.templateContext&&n.templateContext&&void 0!==it&&n.templateContext(it),void 0===e.origJson&&n.origJson&&void 0!==ot&&n.origJson(ot),void 0===e.layoutParams&&n.layoutParams&&void 0!==at&&n.layoutParams(at),o=nt.items,(null==o?void 0:o.length)&&Array.isArray(o)?ft=!1:(ft=!0,st.logError(Y(new Error('Incorrect or empty "items" prop for div "gallery"')))),s=(!ft&&o||[]).map((t=>{let e=t,r=it;return({templateContext:r,json:e}=st.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),l=O&&pt&&!ft,l?"undefined"!=typeof ResizeObserver&&(gt=new ResizeObserver((()=>{It()})),gt.observe(ct)):gt&&(gt.disconnect(),gt=null),c=st.getDerivedFromVars(nt.column_count),et(),et=a(c,(t=>M=t)),xt=Mt(M,xt),d=function(t,e){let r=0,n=[];for(let i=0;i<t.length;++i)n[r]||(n[r]=[]),n[r].push(t[i]),++r>=e&&(r=0);return n}(s,xt),g=st.getDerivedFromVars(nt.orientation),K(),K=a(g,(t=>z=t)),kt=Gt(z,kt),p=st.getDerivedFromVars(nt.cross_content_alignment),X(),X=a(p,(t=>S=t)),Ct=function(t,e){return"start"===t||"center"===t||"end"===t?t:e}(S,Ct),f=st.getDerivedFromVars(nt.item_spacing),G(),G=a(f,(t=>D=t)),Ft=$t(D,Ft),mt=tt(Ft),h=st.getDerivedFromVars(nt.cross_spacing),q(),q=a(h,(t=>V=t)),_t=$t(V,Ft),yt=tt(_t),m=st.getDerivedFromVars(nt.paddings),L(),L=a(m,(t=>A=t)),At=wt(A,At),y="horizontal"===kt?"grid-template-columns":"grid-template-rows";{let t=[];s.forEach((e=>{const r="horizontal"===kt?"width":"height";t.push(st.getDerivedFromVars(e.json[r]))})),bt=R(t,(t=>t)),W(),W=a(bt,(t=>F=t))}Vt=[],xt>1?Vt.push("auto"):F.forEach((t=>{!t&&"horizontal"===kt||"match_parent"===(null==t?void 0:t.type)?Vt.push("100%"):Vt.push("max-content")})),_=st.getDerivedFromVars(nt.scroll_mode),U(),U=a(_,(t=>C=t));{const t={};let e={};Dt=!1,(null==at?void 0:at.fakeElement)&&(e.fakeElement=!0),"horizontal"===kt?e.parentVAlign=Ct:e.parentHAlign=Ct,"paging"===C&&(Dt=!0,e.scrollSnap="start",t["horizontal"===kt?"scroll-padding-left":"scroll-padding-top"]=tt(Ft/2)),1===xt&&(e.parentLayoutOrientation=kt),jt=Et(t,jt),St=Et(e,St)}return b=st.getDerivedFromVars(nt.restrict_parent_scroll),rt(),rt=a(b,(t=>T=t)),w={padding:At,"grid-gap":yt},$={"grid-gap":mt,[y]:oe(Vt)},x={orientation:kt,"scroll-snap":Dt},k=st.getDerivedFromVars(nt.default_item),B(),B=a(k,(t=>E=t)),Pt=$t(E,Pt),B(),U(),W(),L(),q(),G(),X(),K(),et(),J(),rt(),"\n\n"+(ft?"":`${I(zt,"Outer").$$render(t,{cls:ht("gallery",ie,x),json:nt,origJson:ot,templateContext:it,layoutParams:at,customPaddings:!0,customActions:"gallery",forceHeight:"vertical"===kt,forceWidth:"horizontal"===kt},{},{default:()=>`<div class="${j(ie.gallery__scroller,!0)+" "+j(T?H:"",!0)}"${N("style",Q(jt),0)}${N("this",lt,0)}><div${N("class",ie["gallery__items-grid"],0)}${N("style",Q(w),0)}${N("this",ct,0)}>${P(d,((e,r)=>`<div${N("class",ie.gallery__items,0)}${N("style",Q($),0)}${N("this",ut[r],0)}>${P(e,(e=>`${I(Re,"Unknown").$$render(t,{layoutParams:St,div:e.json,templateContext:e.templateContext,origJson:e.origJson},{},{})}`))}\n </div>`))}</div></div>\n ${"horizontal"===kt?`${dt&&l?`<div class="${j(ie.gallery__arrow,!0)+" "+j(ie.gallery__arrow_left,!0)}"><svg${N("class",ie["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",ie["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 ${vt&&l?`<div class="${j(ie.gallery__arrow,!0)+" "+j(ie.gallery__arrow_right,!0)}"><svg${N("class",ie["gallery__arrow-icon"],0)} xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none"><path${N("class",ie["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>`:""}`:""}`})}`)})),le=se,ce={tabs:"divkit-e0df",tabs__list:"divkit-ea19",tabs__item:"divkit-c25c",tabs__item_selected:"divkit-d560",tabs__item_actionable:"divkit-dfda",tabs__panels:"divkit-f5dc",tabs__swiper:"divkit-eb42",tabs__swiper_animated:"divkit-b9f1",tabs__swiper_inited:"divkit-fa57",tabs__panel:"divkit-cc9f",tabs__panel_visible:"divkit-e730",tabs__separator:"divkit-b85b"},ue=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,b,w,$,x,k,E,C,F,A,V=r,D=r,S=r,z=r,M=r,O=r,J=r,T=r;var U;let{json:W={}}=e,{templateContext:R}=e,{origJson:L}=e,{layoutParams:q}=e;const G=v(Z),X=G.genId("tabs");let K,et,rt,it=!1,ot={};const at=G.getJsonWithVars(W.selected_tab);let st,lt,ct=at&&Number(at)||0,ut=12,dt="",vt="",gt="",pt="",ft="",mt="",yt="",$t="",xt="",kt="",Ct=!1,Ft=!1,At=ct,jt=[],Dt=[];async function St(t,e=!1){if(At=ct,ct=t,Ct||(Ct=!0,et.style.height=tt(et.clientHeight),rt.style.transform=`translate3d(${100*-At}%,0,0)`),Ft=!0,async function(t){await _(),rt.style.transform=`translate3d(${t}%,0,0)`}(100*-ct),function(t=!1){const e=t?Math.max(0,ct-1):Math.min(ct,At),r=t?Math.min(o.length-1,ct+1):Math.max(ct,At);jt=jt.map(((t,n)=>t||n>=e&&n<=r)),Dt=Dt.map(((t,n)=>n>=e&&n<=r))}(),async function(){await _();const t=document.getElementById(`${X}-panel-${ct}`);t&&(et.style.height=tt(t.offsetHeight))}(),It&&clearTimeout(It),It=window.setTimeout((()=>{Dt=o.map(((t,e)=>e===ct))}),400),Pt=-ct*et.clientWidth,e){await _();const t=K.querySelector(`.${ce.tabs__item_selected}`);t&&t.focus()}}let Pt,It=null;!W.id||it||(null==q?void 0:q.fakeElement)||G.registerInstance(W.id,{setCurrentItem(t){if(t<0||t>o.length-1)throw new Error('Item is out of range in "set-current-item" action');St(t)},setPreviousItem(t){let e=ct-1;e<0&&(e="ring"===t?o.length-1:ct),St(e)},setNextItem(t){let e=ct+1;e>o.length-1&&(e="ring"===t?0:ct),St(e)}}),u((()=>{W.id&&!(null==q?void 0:q.fakeElement)&&G.unregisterInstance(W.id)})),void 0===e.json&&n.json&&void 0!==W&&n.json(W),void 0===e.templateContext&&n.templateContext&&void 0!==R&&n.templateContext(R),void 0===e.origJson&&n.origJson&&void 0!==L&&n.origJson(L),void 0===e.layoutParams&&n.layoutParams&&void 0!==q&&n.layoutParams(q),o=W.items||[],(null==o?void 0:o.length)&&Array.isArray(o)?it=!1:(it=!0,G.logError(Y(new Error('Incorrect or empty "items" prop for div "tabs"')))),s=G.getDerivedFromVars(W.width),J(),J=a(s,(t=>F=t)),l=G.getDerivedFromVars(W.height),O(),O=a(l,(t=>C=t));{let t={};(null==q?void 0:q.fakeElement)&&(t.fakeElement=!0),"wrap_content"===(null==F?void 0:F.type)&&(t.parentHorizontalWrapContent=!0),C&&"wrap_content"!==C.type||(t.parentVerticalWrapContent=!0),ot=Et(t,ot)}if(!it&&(ct<0||ct>=o.length)&&(G.logError(Y(new Error('Incorrect "selected_tab" prop for div "tabs"'),{additional:{selected:W.selected_tab,length:o.length}})),ct=ct<0?0:o.length-1),c=G.getDerivedFromVars(W.tab_title_style),M(),M=a(c,(t=>E=t)),d=E||{},ut=Mt(d.font_size,ut),d.font_size||d.paddings){const t=d.paddings||{top:6,right:8,bottom:6,left:8},e={top:(Number(t.top)||0)/ut*10,right:(Number(t.right)||0)/ut*10,bottom:(Number(t.bottom)||0)/ut*10,left:(Number(t.left)||0)/ut*10};dt=wt(e,dt)}{const t=d.line_height;void 0!==t&&Ot(t)&&(vt=tt(t/ut*10))}{const t=d.letter_spacing;void 0!==t&&_t(t)&&(gt=tt(t/ut*10))}if(d.corner_radius||d.corners_radius||d.font_size){const t=null!==(U=d.corner_radius)&&void 0!==U?U:1e3;d.corners_radius?pt=bt(d.corners_radius,t,ut,pt):_t(t)&&(pt=tt(t/ut*10))}return st=Nt(d.active_font_weight||d.font_weight,st),lt=Nt(d.inactive_font_weight||d.font_weight,lt),ft=nt(d.active_text_color,1,ft),mt=nt(d.inactive_text_color,1,mt),yt=nt(d.active_background_color,1,yt),$t=nt(d.inactive_background_color,1,$t),g=G.getDerivedFromVars(W.has_separator),z(),z=a(g,(t=>k=t)),p=G.getDerivedFromVars(W.separator_color),S(),S=a(p,(t=>x=t)),f=G.getDerivedFromVars(W.separator_paddings),D(),D=a(f,(t=>$=t)),k&&(x&&(xt=nt(x,1,xt)),$&&(kt=wt($,kt))),h={background:xt,margin:kt},m=G.getDerivedFromVars(W.switch_tabs_by_content_swipe_enabled),V(),V=a(m,(t=>w=t)),y=void 0===w||Boolean(w),b=G.getDerivedFromVars(W.restrict_parent_scroll),T(),T=a(b,(t=>A=t)),it||(jt=o.map(((t,e)=>e===ct)),Dt=o.map(((t,e)=>e===ct))),V(),D(),S(),z(),M(),O(),J(),T(),it?"":`${I(zt,"Outer").$$render(t,{cls:ht("tabs",ce,{}),json:W,origJson:L,templateContext:R,layoutParams:q,customActions:"tabs"},{},{default:()=>`<div class="${j(ce.tabs__list,!0)+" "+j(A?H:"",!0)}" role="tablist"${B({"--divkit-tabs-font-size":tt(ut),"--divkit-tabs-paddings":dt,"--divkit-tabs-line-height":vt,"--divkit-tabs-letter-spacing":gt,"--divkit-tabs-active-font-weight":st||"","--divkit-tabs-inactive-font-weight":lt||"","--divkit-tabs-active-text-color":ft,"--divkit-tabs-inactive-text-color":mt,"--divkit-tabs-active-background-color":yt,"--divkit-tabs-inactive-background-color":$t,"--divkit-tabs-border-radius":pt})}${N("this",K,0)}>${P(o,((e,r)=>{let n=r===ct;return`\n\n ${I(Vt,"Actionable").$$render(t,{cls:ht("tabs__item",ce,{selected:n,actionable:Boolean(e.title_click_action)}),actions:!e.title_click_action||null!=q&&q.fakeElement?[]:[e.title_click_action],attrs:{id:`${X}-tab-${r}`,"aria-controls":`${X}-panel-${r}`,role:"tab",tabindex:!n||null!=q&&q.fakeElement?"-1":e.title_click_action?void 0:"0","aria-selected":n?"true":"false"},customAction:null!=q&&q.fakeElement?null:t=>function(t,e){return ct===e||(St(e),!1)}(0,r)},{},{default:()=>`${j(e.title)}\n `})}`}))}</div>\n ${k?`<div${N("class",ce.tabs__separator,0)}${N("style",Q(h),0)}></div>`:""}\n <div class="${j(ce.tabs__panels,!0)+" "+j(A?H:"",!0)}"${N("this",et,0)}><div${N("class",ht("tabs__swiper",ce,{inited:Ct,animated:Ft}),0)}${N("this",rt,0)}>${P(o,((e,r)=>`<div${N("class",ht("tabs__panel",ce,{visible:Dt[r]}),0)} role="tabpanel" id="${j(X,!0)+"-panel-"+j(r,!0)}" aria-labelledby="${j(X,!0)+"-tab-"+j(r,!0)}" style="${"left: "+j(100*r,!0)+"%"}">${jt[r]?`${I(Re,"Unknown").$$render(t,{div:e.div,templateContext:R,layoutParams:ot},{},{})}`:""}\n </div>`))}</div></div>`})}`})),de=ue,ve="divkit-eb86",ge="divkit-e08c";function pe(t){return e=>{if(e<=0)return 0;if(e>=1)return 1;const r=e*t.length,n=Math.floor(r),i=r-n;return t[n]*i+t[n+1]*(1-i)}}pe([.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]),pe([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 fe=J(((t,e,r,n)=>{let i,{json:o={}}=e,{templateContext:a}=e,{origJson:s}=e,{layoutParams:l}=e;const c=v(Z),g=v(mt);let p=new Map,f=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)||(g.registerInstance(x,{async setState(t){if(k===t)return;c.setRunning("stateChange",!0),new Set(f),y.forEach((t=>{t.resolvePromise&&t.resolvePromise()})),y=[],$.forEach((t=>{p.set(t.id,t.node.getBoundingClientRect())})),b=[],w=[],$=[];const e=i.find((e=>e.state_id===t))||null;e?(k=t,E=e):c.logError(Y(new Error("Cannot find state with id"),{additional:{stateId:t}})),await _()},getChild(t){if(m&&m.has(t))return m.get(t);c.logError(Y(new Error("Missing state block with id"),{additional:{id:t}}))}}),d(mt,{registerInstance(t,e){m||(m=new Map),m.has(t)?c.logError(Y(new Error("Duplicate state with id"),{additional:{id:t}})):m.set(t,e)},unregisterInstance(t){null==m||m.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return b.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionOut(t,e,r,n){const i={json:t,templateContext:e,transitions:r,node:n};return w.push(i),new Promise((t=>{i.resolvePromise=t}))},registerChildWithTransitionChange(t,e,r,n){const i=t.id;if(!i)return Promise.resolve();const o={id:i,json:t,templateContext:e,transitions:r,node:n};return $.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(Y(new Error('Missing "id" prop for div "state"'))));let E=null;const C=c.getJsonWithVars(o.default_state_id);let F=!1;return u((()=>{x&&!(null==l?void 0:l.fakeElement)&&g.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&&(f=new Set),i=o.states||[],(null==i?void 0:i.length)?h=!1:(h=!0,c.logError(Y(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(Y(new Error("Cannot find state for default_state_id"),{additional:{selectedId:k}}))):(E=t[0],k=E.state_id)))}(i),h?"":`${I(zt,"Outer").$$render(t,{cls:"divkit-b8ef",json:o,origJson:s,templateContext:a,layoutParams:l},{},{default:()=>{var e;return`${null!==(e=E)&&void 0!==e&&e.div?`${I(Re,"Unknown").$$render(t,{div:E.div,templateContext:a},{},{})}`:""}\n <div${N("class","divkit-adaa",0)} aria-hidden="true"${N("this",undefined,0)}>${P(y,(e=>"direction"in e?`<div${N("class",ve,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${N("class",ge,0)}>${I(Re,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`:`<div${N("class",ve,0)}><div${N("class",ge,0)}>${I(Re,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,layoutParams:{fakeElement:!0}},{},{})}</div>\n </div>`))}</div>`}})}`})),he={pager:"divkit-c5fe",pager__items:"divkit-f698",pager__item:"divkit-feca",pager_orientation_horizontal:"divkit-b0a1",pager_orientation_vertical:"divkit-f772"},me=J(((t,e,n,i)=>{let o,s,l,c,d,g,p,f,h,m,y,_,b,w,$,x,k,E=r,C=r,F=r,A=r,V=r,D=r;var S,z,M,O,J,T,B;let{json:U={}}=e,{templateContext:W}=e,{origJson:R}=e,{layoutParams:L}=e;const q=v(Z),G=q.genId("pager");let X,K=!1,rt=0,nt=!1,it="horizontal",ot="",at="",st="";function lt(t,e="smooth"){const r="horizontal"===it,n=X.children[t],i=r?"offsetLeft":"offsetTop",o=r?"left":"top";X.scroll({[o]:n[i],behavior:e}),rt=t}ae((function(){const t=function(){const t=Array.from(X.children),e=X.getBoundingClientRect(),r=t.findIndex((t=>{return r=e,n=t.getBoundingClientRect(),"horizontal"===it?n.left>=r.left&&n.right<=r.right:n.top>=r.top&&n.bottom<=r.bottom;var r,n}));return-1!==r?r:rt}();t!==rt&&(rt=t)}),50),U.id&&!(null==L?void 0:L.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');lt(t)},setPreviousItem(t){let e=rt-1;e<0&&(e="ring"===t?o.length-1:rt),lt(e)},setNextItem(t){let e=rt+1;e>o.length-1&&(e="ring"===t?0:rt),lt(e)}}),u((()=>{U.id&&!(null==L?void 0:L.fakeElement)&&q.unregisterInstance(U.id)})),void 0===e.json&&n.json&&void 0!==U&&n.json(U),void 0===e.templateContext&&n.templateContext&&void 0!==W&&n.templateContext(W),void 0===e.origJson&&n.origJson&&void 0!==R&&n.origJson(R),void 0===e.layoutParams&&n.layoutParams&&void 0!==L&&n.layoutParams(L),(null===(S=U.items)||void 0===S?void 0:S.length)&&Array.isArray(U.items)?K=!1:(K=!0,q.logError(Y(new Error('Incorrect or empty "items" prop for div "pager"')))),o=(!K&&U.items||[]).map((t=>{let e=t,r=W;return({templateContext:r,json:e}=q.processTemplate(e,r)),{json:e,templateContext:r,origJson:t}})),s=q.getDerivedFromVars(U.layout_mode),C(),C=a(s,(t=>b=t)),b?"percentage"!==b.type&&"fixed"!==b.type?(nt=!0,q.logError(Y(new Error('Incorrect value of "layout_mode.type" for div "pager"')))):nt=!1:(nt=!0,q.logError(Y(new Error('Empty "layout_mode" prop for div "pager"')))),l=q.getDerivedFromVars(U.orientation),V(),V=a(l,(t=>x=t)),it=Gt(x,it),c=q.getDerivedFromVars(U.item_spacing),A(),A=a(c,(t=>$=t));{const t=null==$?void 0:$.value;t&&_t(t)&&(ot=tt(t||0))}if(d=q.getDerivedFromVars(U.paddings),F(),F=a(d,(t=>w=t)),at=wt(w,at),g=q.getDerivedFromVars(U.restrict_parent_scroll),D(),D=a(g,(t=>k=t)),p="horizontal"===it?"grid-auto-columns":"grid-auto-rows","fixed"===(null==b?void 0:b.type)){const t=et("horizontal"===it?((null===(z=U.paddings)||void 0===z?void 0:z.left)||0)+((null===(M=U.paddings)||void 0===M?void 0:M.right)||0):((null===(O=U.paddings)||void 0===O?void 0:O.top)||0)+((null===(J=U.paddings)||void 0===J?void 0:J.bottom)||0)),e=null===(T=b.neighbour_page_width)||void 0===T?void 0:T.value;st=e?`calc(100% + ${t} - 2 * ${et(e)} - 2 * ${ot})`:"100%"}else if("percentage"===(null==b?void 0:b.type)){const t=null===(B=b.page_width)||void 0===B?void 0:B.value;st=`${Number(t)}%`}return f={"grid-gap":ot,padding:at,[p]:st},h={orientation:it},m=K||nt,y=q.getStore("pagers"),E(),E=a(y,(t=>_=t)),function(t,e){const r=U.id;if(r){const o=new Map(_);n=y,_=o.set(r,{instId:G,size:t,currentItem:e,scrollToPagerItem:lt}),i=_,n.set(i)}var n,i}(o.length,rt),E(),C(),F(),A(),V(),D(),m?"":`${I(zt,"Outer").$$render(t,{cls:ht("pager",he,h),json:U,origJson:R,templateContext:W,layoutParams:L,customPaddings:!0},{},{default:()=>`<div class="${j(he.pager__items,!0)+" "+j(k?H:"",!0)}"${N("style",Q(f),0)}${N("this",X,0)}>${P(o,(e=>`<div${N("class",he.pager__item,0)}>${I(Re,"Unknown").$$render(t,{div:e.json,templateContext:e.templateContext,origJson:e.origJson,layoutParams:null!=L&&L.fakeElement?{fakeElement:!0}:void 0},{},{})}\n </div>`))}</div>`})}`})),ye=me,_e={indicator:"divkit-d8e3",indicator__scroller:"divkit-b5db",indicator__items:"divkit-d5d9",indicator__item:"divkit-f662",indicator__item_active:"divkit-b39c"},be=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,b=r,w=r,$=r,x=r,k=r,E=r,{json:C={}}=e,{templateContext:F}=e,{origJson:A}=e,{layoutParams:V}=e;const D=v(Z);let S,z,M,O=10,J=10,T=5,U="#ffdc60",W=nt("#33919cb5"),R=15,q=1.3;return void 0===e.json&&n.json&&void 0!==C&&n.json(C),void 0===e.templateContext&&n.templateContext&&void 0!==F&&n.templateContext(F),void 0===e.origJson&&n.origJson&&void 0!==A&&n.origJson(A),void 0===e.layoutParams&&n.layoutParams&&void 0!==V&&n.layoutParams(V),o=D.getDerivedFromVars(C.shape),E(),E=a(o,(t=>y=t)),y&&(y.item_width&&(O=$t(y.item_width.value,O)),y.item_height&&(J=$t(y.item_height.value,J)),y.corner_radius&&(T=$t(y.corner_radius.value,T))),s=D.getDerivedFromVars(C.active_item_color),k(),k=a(s,(t=>m=t)),U=nt(m,1,U),l=D.getDerivedFromVars(C.inactive_item_color),x(),x=a(l,(t=>h=t)),W=nt(h,1,W),c=D.getDerivedFromVars(C.space_between_centers),$(),$=a(c,(t=>f=t)),f&&(R=$t(f.value,R)),u=D.getDerivedFromVars(C.active_item_size),w(),w=a(u,(t=>p=t)),q=Mt(p,q),d=D.getStore("pagers"),b(),b=a(d,(t=>g=t)),async function(t){if(C.pager_id&&t.has(C.pager_id)){M=t.get(C.pager_id),await _();const e=z.children[M.currentItem].offsetLeft;S.scroll({left:e-S.clientWidth/2,behavior:"smooth"})}}(g),b(),w(),$(),x(),k(),E(),`${I(zt,"Outer").$$render(t,{cls:ht("indicator",_e,{}),json:C,origJson:A,templateContext:F,layoutParams:V},{},{default:()=>`<div${N("class",_e.indicator__scroller,0)}${N("this",S,0)}><div${N("class",_e.indicator__items,0)} role="tablist"${B({margin:`0 ${tt((q-1)*O/2)}`,"--divkit-indicator-width":tt(O),"--divkit-indicator-height":tt(J),"--divkit-indicator-border-radius":tt(T),"--divkit-indicator-active-color":U,"--divkit-indicator-inactive-color":W,"--divkit-indicator-active-scale":q,"--divkit-indicator-margin":`0 ${tt((R-O)/2)}`})}${N("this",z,0)}>${M?`${P(Array(M.size),((t,e)=>{let r=e===M.currentItem;return`\n <div class="${j(ht("indicator__item",_e,{active:r}),!0)+" "+j(L,!0)}" role="tab" id="${j(M.instId,!0)+"-tab-"+j(e,!0)}" aria-controls="${j(M.instId,!0)+"-panel-"+j(e,!0)}"${N("aria-selected",r?"true":"false",0)}${N("tabindex",r?0:-1,0)}></div>`}))}`:""}</div></div>`})}`})),we=be,$e={slider:"divkit-ef4f",slider__input:"divkit-d1d6",slider__input_secondary:"divkit-c798",slider__thumb:"divkit-f345",slider__thumb_secondary:"divkit-e198","slider__tracks-wrapper":"divkit-f733","slider__tracks-inner":"divkit-ac90",slider__track:"divkit-e956","slider__active-track":"divkit-ec5b","slider__thumb-text":"divkit-c4af","slider__thumb-text_secondary":"divkit-d882",slider__tick:"divkit-bd9b",slider__tick_active:"divkit-d8ce",slider__tick_inactive:"divkit-e71e"};function xe(t,e){var r,n,i;if(!t||!t.shape||!t.color)return e;const o=nt(t.color),a=Number((null===(r=t.shape.item_width)||void 0===r?void 0:r.value)||10),s=Number((null===(n=t.shape.item_height)||void 0===n?void 0:n.value)||10),l=Number((null===(i=t.shape.corner_radius)||void 0===i?void 0:i.value)||5);if("shape_drawable"===t.type&&"transparent"!==o&&"rounded_rectangle"===t.shape.type){var c,u;const e={},r=null!==(c=t.stroke)&&void 0!==c&&c.color?nt(t.stroke.color):"",n=null!==(u=t.stroke)&&void 0!==u&&u.width?Number(t.stroke.width||1):"";return e.width=a,e.height=s,e.borderRadius=l,e.background=o,r&&n&&(e.boxShadow=`inset 0 0 0 ${tt(n)} ${r}`),e}return e}function ke(t,e){if(!t||!t.font_size)return e;const r=t.offset,n=t.text_color&&nt(t.text_color)||"#000",i=Jt(t.font_weight);if(Ot(t.font_size)&&"transparent"!==n){var o,a;const e={fontSize:tt(t.font_size),fontWeight:i,textColor:n};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 Ee(t,e,r){return Math.max(e,Math.min(r,t))}const Ce=2147483647,Fe=-2147483648,Ae=Number.MAX_VALUE,Ve=Number.MIN_VALUE,je="string",De="integer",Se="number",Pe="boolean",ze="color",Ie="datetime";class Me{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 Oe={string:class extends Me{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"string"}},number:class extends Me{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 Me{convertValue(t){if("number"!=typeof t||isNaN(t)||t>Ce||t<Fe||t!==Math.round(t))throw new Error("Incorrect variable value");return t}fromString(t){const e=Number(t);return this.convertValue(e)}getType(){return"integer"}},boolean:class extends Me{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 Me{convertValue(t){if("string"!=typeof t||!it(t))throw new Error("Incorrect variable value");return t}fromString(t){return this.convertValue(t)}getType(){return"color"}},url:class extends Me{convertValue(t){if("string"!=typeof t)throw new Error("Incorrect variable value");return t}fromString(t){return t}getType(){return"url"}}};function Je(t,e,r){if(!(e in Oe))throw new Error("Unsupported variable type");return new Oe[e](t,r)}function Ne(t,e,r,n,i){let o=[];if(i)for(let i=t;i<e;++i)o.push((i-r)/(n-r));else{for(let e=r;e<t;++e)o.push((e-r)/(n-r));for(let t=e;t<n+1;++t)o.push((t-r)/(n-r))}return o}const Te=J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,z,M,O,J,T,U,W,R,L,q,H,G=r,X=r,K=r,Q=r,rt=r,nt=r,it=r,ot=r,at=r,st=r,lt=r,ct=r;var ut,dt,vt,gt;let{json:pt={}}=e,{templateContext:ft}=e,{origJson:mt}=e,{layoutParams:yt}=e;const bt={width:10,height:10,borderRadius:5,background:"#000"},wt=v(Z),$t=v(Ft);let xt=0,kt=100;const Et=wt.getJsonWithVars(pt.thumb_value_variable),Ct=wt.getJsonWithVars(pt.thumb_secondary_value_variable);L=a(Et&&wt.getVariable(Et,"integer")||Je("temp","integer",0),(t=>R=t)),W=a(Ct&&wt.getVariable(Ct,"integer")||Je("temp","integer",0),(t=>U=t));let At,Vt,jt,Dt=Ee(R||0,xt,kt),St=Ee(U||0,xt,kt),It=bt,Mt=It,Ot=bt,Jt=bt,Nt=null,Tt=null,Bt=jt,Ut="",Wt="",Rt=!1;ae((function(){}),50),void 0===e.json&&n.json&&void 0!==pt&&n.json(pt),void 0===e.templateContext&&n.templateContext&&void 0!==ft&&n.templateContext(ft),void 0===e.origJson&&n.origJson&&void 0!==mt&&n.origJson(mt),void 0===e.layoutParams&&n.layoutParams&&void 0!==yt&&n.layoutParams(yt),o=wt.getDerivedFromVars(pt.min_value),ct(),ct=a(o,(t=>H=t)),s=wt.getDerivedFromVars(pt.max_value),lt(),lt=a(s,(t=>q=t)),xt=Pt(H,xt),kt=Pt(q,kt);{const t=Ee(R||0,xt,kt);t!==Dt&&(Dt=t)}{const t=Ee(U||0,xt,kt);t!==St&&(St=t)}l=wt.getDerivedFromVars(pt.thumb_style),st(),st=a(l,(t=>T=t)),It=xe(T,It),c=wt.getDerivedFromVars(pt.thumb_secondary_style),at(),at=a(c,(t=>J=t)),Mt=xe(J,It),u=wt.getDerivedFromVars(pt.track_inactive_style),ot(),ot=a(u,(t=>O=t)),Ot=xe(O,Ot),d=wt.getDerivedFromVars(pt.track_active_style),it(),it=a(d,(t=>M=t)),Jt=xe(M,Jt),g=wt.getDerivedFromVars(pt.tick_mark_active_style),nt(),nt=a(g,(t=>z=t));{let t=xe(z,bt);t!==bt&&(Nt=t)}At=Nt?Ct?Ne(Math.min(Dt,St),Math.max(Dt,St)+1,xt,kt,!0):Ne(xt,Dt,xt,kt,!0):[],p=wt.getDerivedFromVars(pt.tick_mark_inactive_style),rt(),rt=a(p,(t=>S=t));{let t=xe(S,bt);t!==bt&&(Tt=t)}Vt=Tt?Ct?Ne(Math.min(Dt,St),Math.max(Dt,St)+1,xt,kt,!1):Ne(Dt+1,kt+1,xt,kt,!0):[],f=wt.getDerivedFromVars(pt.thumb_text_style),Q(),Q=a(f,(t=>D=t)),jt=ke(D,jt),h=wt.getDerivedFromVars(pt.thumb_secondary_text_style),K(),K=a(h,(t=>V=t)),Bt=ke(V,jt),m=wt.getDerivedFromVars(pt.accessibility),X(),X=a(m,(t=>A=t)),(null==A?void 0:A.description)?Ut=A.description:wt.logError(Y(new Error('Missing accessibility "description" for slider'),{level:"warn"})),y=wt.getDerivedFromVars(pt.secondary_value_accessibility),G(),G=a(y,(t=>F=t)),(null==F?void 0:F.description)?Wt=F.description:Ct&&wt.logError(Y(new Error('Missing second accessibility "description" for slider'),{level:"warn"}));{let t=!1;$t.hasAction()?(wt.logError(Y(new Error('Cannot show "slider" inside component with action'))),t=!0):It===bt?(wt.logError(Y(new Error('Missing "thumb_style" in slider'))),t=!0):Jt===bt?(wt.logError(Y(new Error('Missing "track_active_style" in slider'))),t=!0):Ot===bt&&(wt.logError(Y(new Error('Missing "track_inactive_style" in slider'))),t=!0),t!==Rt&&(Rt=t)}return _=tt(Math.max(...[It.width,Mt.width,0].filter(_t))),b=tt(Math.max(...[It.height,Mt.height,0].filter(_t))),w=(Dt-xt)/(kt-xt),$=Ct?(St-xt)/(kt-xt):void 0,x=void 0!==$?Math.abs($-w):w,k=void 0!==$?Math.min($,w):0,E={"--divkit-slider-thumb-width":tt(It.width),"--divkit-slider-thumb-height":tt(It.height),"--divkit-slider-thumb-secondary-width":tt(Mt.width),"--divkit-slider-thumb-secondary-height":tt(Mt.height),"--divkit-slider-text-offset-x":(null===(ut=null==jt?void 0:jt.offset)||void 0===ut?void 0:ut.x)?et(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)?et(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)?et(Bt.offset.x):void 0,"--divkit-slider-text-secondary-offset-y":(null===(gt=null==Bt?void 0:Bt.offset)||void 0===gt?void 0:gt.y)?et(Bt.offset.y):void 0,"--divkit-slider-tick-active-width":Nt?tt(Nt.width):void 0,"--divkit-slider-tick-active-height":Nt?tt(Nt.height):void 0,"--divkit-slider-tick-active-border-radius":Nt?tt(Nt.borderRadius):void 0,"--divkit-slider-tick-active-background":(null==Nt?void 0:Nt.background)||void 0,"--divkit-slider-tick-active-box-shadow":(null==Nt?void 0:Nt.boxShadow)||void 0,"--divkit-slider-tick-inactive-width":Tt?tt(Tt.width):void 0,"--divkit-slider-tick-inactive-height":Tt?tt(Tt.height):void 0,"--divkit-slider-tick-inactive-border-radius":Tt?tt(Tt.borderRadius):void 0,"--divkit-slider-tick-inactive-background":(null==Tt?void 0:Tt.background)||void 0,"--divkit-slider-tick-inactive-box-shadow":(null==Tt?void 0:Tt.boxShadow)||void 0,"--divkit-slider-max-thumb-width":_,"--divkit-slider-max-thumb-height":b,"--divkit-slider-track-part":w,"--divkit-slider-track-secondary-part":$},C={},G(),X(),K(),Q(),rt(),nt(),it(),ot(),at(),st(),W(),L(),lt(),ct(),"\n\n"+(Rt?"":`${I(zt,"Outer").$$render(t,{cls:ht("slider",$e,C),style:E,customDescription:!0,customActions:"slider",json:pt,origJson:mt,templateContext:ft,layoutParams:yt},{},{default:()=>{var t,e,r,n,i,o;return`<div${N("class",$e["slider__tracks-wrapper"],0)}><div${N("class",$e["slider__tracks-inner"],0)}${N("this",undefined,0)}><div${N("class",$e.slider__track,0)}${B({height:tt(Ot.height),"border-radius":tt(Ot.borderRadius),background:Ot.background,"box-shadow":Ot.boxShadow||""})}></div>\n <div${N("class",$e["slider__active-track"],0)}${B({left:(100*k).toFixed(2)+"%",width:(100*x).toFixed(2)+"%",height:tt(Jt.height),"border-radius":tt(Jt.borderRadius),background:Jt.background,"box-shadow":Jt.boxShadow||""})}></div>\n ${P(At,(t=>`<div class="${j($e.slider__tick,!0)+" "+j($e.slider__tick_active,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n ${P(Vt,(t=>`<div class="${j($e.slider__tick,!0)+" "+j($e.slider__tick_inactive,!0)}"${B({"--divkit-slider-tick":t})}></div>`))}\n <div${N("class",$e.slider__thumb,0)}${B({"border-radius":tt(It.borderRadius),background:It.background,"box-shadow":It.boxShadow||""})}>${jt?`<div${N("class",$e["slider__thumb-text"],0)}><div${N("class",$e["slider__thumb-text-inner"],0)}${B({"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"})}>${j(Dt)}</div></div>`:""}</div>\n ${Ct?`<div class="${j($e.slider__thumb,!0)+" "+j($e.slider__thumb_secondary,!0)}"${B({"border-radius":tt(Mt.borderRadius),background:Mt.background,"box-shadow":Mt.boxShadow||""})}>${Bt?`<div class="${j($e["slider__thumb-text"],!0)+" "+j($e["slider__thumb-text_secondary"],!0)}"><div${N("class",$e["slider__thumb-text-inner"],0)}${B({"font-size":(null===(n=Bt)||void 0===n?void 0:n.fontSize)||"1em","font-weight":(null===(i=Bt)||void 0===i?void 0:i.fontWeight)||"",color:(null===(o=Bt)||void 0===o?void 0:o.textColor)||"#000"})}>${j(St)}</div></div>`:""}</div>`:""}\n <input type="range"${N("class",$e.slider__input,0)}${N("min",xt,0)}${N("max",kt,0)} step="1"${N("value",Dt,0)}${N("aria-label",Ut,0)}>\n ${Ct?`<input type="range"${N("class",`${$e.slider__input} ${$e.slider__input_secondary}`,0)}${N("min",xt,0)}${N("max",kt,0)} step="1"${N("value",St,0)}${N("aria-label",Wt,0)}>`:""}</div></div>`}})}`)})),Be={input:"divkit-c3a4",input__wrapper:"divkit-ef7e",input__holder:"divkit-bb3d",input_multiline:"divkit-e48a",input__input:"divkit-f11e","input_highlight-color":"divkit-cc00","input_vertical-overflow":"divkit-b707"},Ue={text:Rt,container:qt,separator:Zt,image:Xt,gif:Xt,grid:ne,gallery:le,tabs:de,state:fe,pager:ye,indicator:we,slider:Te,input:J(((t,e,n,i)=>{let o,s,l,c,u,d,g,p,f,h,m,y,_,b,w,$,x,k,E,C,F,A,V,D,S,P,z,M,O,J,T,B,U=r,W=r,{json:R={}}=e,{templateContext:L}=e,{origJson:q}=e,{layoutParams:H}=e;const G=v(Z);let X;const K=G.getJsonWithVars(R.text_variable);let Q=!1;K||(Q=!0,G.logError(Y(new Error('Missing "text_variable" in "input"')))),J=a(K&&G.getVariable(K,"string")||Je("temp","string",""),(t=>O=t));let rt="";M=a(G.getDerivedFromVars(R.hint_text),(t=>z=t)),P=a(G.getDerivedFromVars(R.hint_color),(t=>S=t));let it="";D=a(G.getDerivedFromVars(R.font_size),(t=>V=t));let ot,at,st=12;A=a(G.getDerivedFromVars(R.font_weight),(t=>F=t)),C=a(G.getDerivedFromVars(R.line_height),(t=>E=t)),k=a(G.getDerivedFromVars(R.letter_spacing),(t=>x=t));let lt="";$=a(G.getDerivedFromVars(R.text_color),(t=>w=t));let ct="#000";b=a(G.getDerivedFromVars(R.highlight_color),(t=>_=t));let ut="";y=a(G.getDerivedFromVars(R.keyboard_type),(t=>m=t));const dt={email:"email",number:"number",phone:"tel",single_line_text:"text",multi_line_text:"text",uri:"url"};let vt="multi_line_text",gt="text";h=a(G.getDerivedFromVars(R.max_visible_lines),(t=>f=t));let pt="",ft="";B=a(G.getDerivedFromVars(R.select_all_on_focus),(t=>T=t)),void 0===e.json&&n.json&&void 0!==R&&n.json(R),void 0===e.templateContext&&n.templateContext&&void 0!==L&&n.templateContext(L),void 0===e.origJson&&n.origJson&&void 0!==q&&n.origJson(q),void 0===e.layoutParams&&n.layoutParams&&void 0!==H&&n.layoutParams(H),rt=O,o=z,it=nt(S,1,it),st=Mt(V,st),ot=Nt(F,ot);{const t=E;Ot(t)&&(at=t/st)}return yt(x)&&(lt=tt(x/st*10)),ct=nt(w,1,ct),ut=nt(_,1,ut),m&&m in dt&&(gt=dt[m],vt=m),s="multi_line_text"===vt,l=G.getDerivedFromVars(R.paddings),W(),W=a(l,(t=>p=t)),Ot(f)&&(pt=`calc(${f*(at||1.25)+"em"} + ${et($t(null==p?void 0:p.top,0)+$t(null==p?void 0:p.bottom,0))})`),c=G.getDerivedFromVars(R.accessibility),U(),U=a(c,(t=>g=t)),(null==g?void 0:g.description)?ft=g.description:G.logError(Y(new Error('Missing accessibility "description" for input'),{level:"warn"})),u={"highlight-color":Boolean(ut),"vertical-overflow":!1,multiline:s},d={"--divkit-input-hint-color":it,"--divkit-input-highlight-color":ut,"font-size":tt(st),"font-weight":ot,"line-height":at,"letter-spacing":lt,color:ct,"max-height":pt},U(),W(),h(),y(),b(),$(),k(),C(),A(),D(),P(),M(),J(),B(),Q?"":`${I(zt,"Outer").$$render(t,{cls:ht("input",Be,u),style:d,customDescription:!0,customActions:"input",json:R,origJson:q,templateContext:L,layoutParams:H},{},{default:()=>`<span${N("class",Be.input__wrapper,0)}><span${N("class",Be.input__holder,0)} aria-hidden="true"${N("this",undefined,0)}>\n ${j(rt)}${rt.endsWith("\n")||!rt?"":""}</span>\n ${s?`<textarea${N("class",Be.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ft,0)}${N("placeholder",o,0)}${N("this",X,0)}>${j(rt,!0)}</textarea>`:`<input${N("type",gt,0)}${N("class",Be.input__input,0)} autocomplete="off" autocapitalize="off"${N("aria-label",ft,0)}${N("placeholder",o,0)}${N("value",rt,0)}${N("this",X,0)}>`}</span>`})}`}))},We=J(((t,e,r,n)=>{let{div:i}=e,{templateContext:o}=e,{origJson:a}=e,{layoutParams:s}=e;const l=v(Z);let c,u,d;if(void 0===e.div&&r.div&&void 0!==i&&r.div(i),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=i,u=o,d=c&&Ue[c.type]||void 0,!d&&(({templateContext:u,json:c}=l.processTemplate(c,u)),d=c&&Ue[c.type]||void 0,!d)){let t;t=(null==c?void 0:c.type)&&l.hasTemplate(c.type)?"Recursive template":"Unknown component",l.logError(Y(new Error(t),{additional:{component:(null==c?void 0:c.type)||"<missing>"}}))}return d?`${I(d||z,"svelte:component").$$render(t,{json:c,templateContext:u,layoutParams:s,origJson:a||i},{},{})}`:""})),Re=We,Le=J(((t,e,r,n)=>{let{svgFiltersMap:i}=e;return void 0===e.svgFiltersMap&&r.svgFiltersMap&&void 0!==i&&r.svgFiltersMap(i),Object.keys(i).length?`<svg${N("class","divkit-dc22",0)} aria-hidden="true"><defs>${P([...Object.keys(i)],(t=>`<filter${N("id",i[t],0)}><feFlood${N("flood-color",t,0)}></feFlood><feComposite in2="SourceGraphic" operator="in"></feComposite></filter>`))}</defs></svg>`:""}));function qe(t,e,r,n){const i=r[t.type];if(!i)return n(Y(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 e(r,i){const o=Object.keys(i).filter((t=>"__proto__"!==t)),s=o.filter((t=>"$"!==t.charAt(0))),l=o.filter((t=>"$"===t.charAt(0)));return s.forEach((t=>{const n=i[t];"object"==typeof n&&null!==n?(r[t]=Array.isArray(n)?[]:{},e(r[t],n)):r[t]=n})),l.forEach((e=>{const o=i[e],s=a[o];if(void 0!==s){const t=e.substring(1);r[t]=s}else n(Y(new Error("Missing template field"),{level:"warn",additional:{key:e,template:t.type}}))})),r}({},i);for(o in t)"type"!==o&&"__proto__"!==o&&t.hasOwnProperty(o)&&(s[o]=t[o]);return{json:s,templateContext:a}}function He(){}function Ge(t){return{subscribe:e=>(e(t),He)}}function Ze(t,e){return e.reduce(((t,e)=>({type:"BinaryExpression",operator:e[1],left:t,right:e[3]})),t)}function Ye(t,e){return e.reduce(((t,e)=>({type:"LogicalExpression",operator:e[1],left:t,right:e[3]})),t)}function Xe(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 Ke(t){var e=parseInt(t,10);if(e>Ce||e<Fe)throw new Error(`Value ${t} can't be converted to Integer type.`);return e}function Qe(t){if("'"===t||"\\"===t)return t;throw new Error("Incorrect string escape")}function tr(t,e,r,n){var i=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(i,tr.prototype),i.expected=e,i.found=r,i.location=n,i.name="SyntaxError",i}function er(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,n,i,o,a={},s=(e=void 0!==e?e:{}).grammarSource,l={start:St,JsonStringContents:function(){var t,e,r;for(t=_t,e=[],r=Pt();r!==a;)e.push(r),r=Pt();return bt=t,e=yt(e)}},c=St,u="@{",d="}",v="@{}",g="\\",p="||",f="&&",h="==",m="!=",y=">=",_="<=",b="+",w="-",$="true",x="false",k=/^[^}]/,E=/^[^'}]/,C=/^[0-9]/,F=/^[a-zA-Z_0-9.]/,A=/^[a-zA-Z_]/,V=/^[ \t\r\n]/,j=Ct("@{",!1),D=Ct("}",!1),S=Ct("@{}",!1),P=Ct("\\",!1),z={type:"any"},I=Ft(["}"],!0,!1),M=Ct("?",!1),O=Ct(":",!1),J=Ct("||",!1),N=Ct("&&",!1),T=Ct("==",!1),B=Ct("!=",!1),U=Ct(">=",!1),W=Ct(">",!1),R=Ct("<=",!1),L=Ct("<",!1),q=Ct("+",!1),H=Ct("-",!1),G=Ct("/",!1),Z=Ct("*",!1),Y=Ct("%",!1),X=Ct("!",!1),K=Ct("(",!1),Q=Ct(")",!1),tt=Ct(",",!1),et=At("string"),rt=Ct("'",!1),nt=Ft(["'","}"],!0,!1),it=At("integer"),ot=Ft([["0","9"]],!1,!1),at=At("number"),st=Ct(".",!1),lt=Ct("e",!1),ct=Ct("E",!1),ut=At("boolean"),dt=Ct("true",!1),vt=Ct("false",!1),gt=Ft([["a","z"],["A","Z"],"_",["0","9"],"."],!1,!1),pt=At("identifier"),ft=Ft([["a","z"],["A","Z"],"_"],!1,!1),ht=At("whitespace"),mt=Ft([" ","\t","\r","\n"],!1,!1),yt=function(t){return Xe(t)},_t=0,bt=0,wt=[{line:1,column:1}],$t=0,xt=[],kt=0;if("startRule"in e){if(!(e.startRule in l))throw new Error("Can't start parsing from rule \""+e.startRule+'".');c=l[e.startRule]}function Et(){return t.substring(bt,_t)}function Ct(t,e){return{type:"literal",text:t,ignoreCase:e}}function Ft(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function At(t){return{type:"other",description:t}}function Vt(e){var r,n=wt[e];if(n)return n;for(r=e-1;!wt[r];)r--;for(n={line:(n=wt[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return wt[e]=n,n}function jt(t,e){var r=Vt(t),n=Vt(e);return{source:s,start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Dt(t){_t<$t||(_t>$t&&($t=_t,xt=[]),xt.push(t))}function St(){var t,e;return t=_t,qt(),(e=zt())!==a?(qt(),bt=t,t=e):(_t=t,t=a),t}function Pt(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Et()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(I)),i!==a)for(;i!==a;)n.push(i),k.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(I));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Qe(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function zt(){var e,r,n,i,o,s;return e=_t,(r=It())!==a?(qt(),63===t.charCodeAt(_t)?(n="?",_t++):(n=a,0===kt&&Dt(M)),n!==a?(qt(),(i=zt())!==a?(qt(),58===t.charCodeAt(_t)?(o=":",_t++):(o=a,0===kt&&Dt(O)),o!==a?(qt(),(s=zt())!==a?(bt=e,e={type:"ConditionalExpression",test:r,consequent:i,alternate:s}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=It()),e}function It(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Mt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(c=Mt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===p?(s=p,_t+=2):(s=a,0===kt&&Dt(J)),s!==a?(l=qt(),(c=Mt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Ye(r,n)}else _t=e,e=a;return e}function Mt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Ot())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(c=Ot())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===f?(s=f,_t+=2):(s=a,0===kt&&Dt(N)),s!==a?(l=qt(),(c=Ot())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Ye(r,n)}else _t=e,e=a;return e}function Ot(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Jt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(B))),s!==a?(l=qt(),(c=Jt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===h?(s=h,_t+=2):(s=a,0===kt&&Dt(T)),s===a&&(t.substr(_t,2)===m?(s=m,_t+=2):(s=a,0===kt&&Dt(B))),s!==a?(l=qt(),(c=Jt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Ze(r,n)}else _t=e,e=a;return e}function Jt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Nt())!==a){for(n=[],i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(U)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(W)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(L))))),s!==a?(l=qt(),(c=Nt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),t.substr(_t,2)===y?(s=y,_t+=2):(s=a,0===kt&&Dt(U)),s===a&&(62===t.charCodeAt(_t)?(s=">",_t++):(s=a,0===kt&&Dt(W)),s===a&&(t.substr(_t,2)===_?(s=_,_t+=2):(s=a,0===kt&&Dt(R)),s===a&&(60===t.charCodeAt(_t)?(s="<",_t++):(s=a,0===kt&&Dt(L))))),s!==a?(l=qt(),(c=Nt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Ze(r,n)}else _t=e,e=a;return e}function Nt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Tt())!==a){for(n=[],i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(c=Tt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),43===t.charCodeAt(_t)?(s=b,_t++):(s=a,0===kt&&Dt(q)),s===a&&(45===t.charCodeAt(_t)?(s=w,_t++):(s=a,0===kt&&Dt(H))),s!==a?(l=qt(),(c=Tt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Ze(r,n)}else _t=e,e=a;return e}function Tt(){var e,r,n,i,o,s,l,c;if(e=_t,(r=Bt())!==a){for(n=[],i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Z)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Y)))),s!==a?(l=qt(),(c=Bt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,o=qt(),47===t.charCodeAt(_t)?(s="/",_t++):(s=a,0===kt&&Dt(G)),s===a&&(42===t.charCodeAt(_t)?(s="*",_t++):(s=a,0===kt&&Dt(Z)),s===a&&(37===t.charCodeAt(_t)?(s="%",_t++):(s=a,0===kt&&Dt(Y)))),s!==a?(l=qt(),(c=Bt())!==a?i=o=[o,s,l,c]:(_t=i,i=a)):(_t=i,i=a);bt=e,e=Ze(r,n)}else _t=e,e=a;return e}function Bt(){var e,r,n;return(e=Rt())===a&&(e=Wt())===a&&(e=_t,33===t.charCodeAt(_t)?(r="!",_t++):(r=a,0===kt&&Dt(X)),r===a&&(43===t.charCodeAt(_t)?(r=b,_t++):(r=a,0===kt&&Dt(q)),r===a&&(45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)))),r!==a?(qt(),(n=Bt())!==a?(bt=e,e={type:"UnaryExpression",operator:r,argument:n}):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=function(){var e,r,n,i,o;return e=_t,(r=Lt())!==a?(qt(),40===t.charCodeAt(_t)?(n="(",_t++):(n=a,0===kt&&Dt(K)),n!==a?(qt(),i=function(){var e,r,n,i,o,s,l;if(e=_t,(r=zt())!==a){for(n=[],i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);i!==a;)n.push(i),i=_t,qt(),44===t.charCodeAt(_t)?(o=",",_t++):(o=a,0===kt&&Dt(tt)),o!==a?(qt(),(s=zt())!==a?i=s:(_t=i,i=a)):(_t=i,i=a);bt=e,l=n,e=[r,...l]}else _t=e,e=a;return e===a&&(e=qt()),e}(),i!==a?(qt(),41===t.charCodeAt(_t)?(o=")",_t++):(o=a,0===kt&&Dt(Q)),o!==a?(bt=e,e={type:"CallExpression",callee:r,arguments:i}):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,(r=Lt())!==a&&(bt=e,r={type:"Variable",id:r}),(e=r)===a&&(e=function(){var e,r,n,i;return e=function(){var e,r,n,i;return kt++,e=_t,39===t.charCodeAt(_t)?(r="'",_t++):(r=a,0===kt&&Dt(rt)),r!==a?(n=function(){var t,e,r;for(t=_t,e=[],r=Ut();r!==a;)e.push(r),r=Ut();return bt=t,e=Xe(e)}(),39===t.charCodeAt(_t)?(i="'",_t++):(i=a,0===kt&&Dt(rt)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(et)),e}(),e===a&&(e=Rt())===a&&(e=Wt())===a&&(e=function(){var e,r;return kt++,e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!0}),(e=r)===a&&(e=_t,t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt)),r!==a&&(bt=e,r={type:"BooleanLiteral",value:!1}),e=r),kt--,e===a&&(r=a,0===kt&&Dt(ut)),e}(),e===a&&(e=_t,40===t.charCodeAt(_t)?(r="(",_t++):(r=a,0===kt&&Dt(K)),r!==a&&(n=zt())!==a?(41===t.charCodeAt(_t)?(i=")",_t++):(i=a,0===kt&&Dt(Q)),i!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a))),e}())),e}())),e}function Ut(){var e,r,n,i,o;if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a?(n=qt(),(i=zt())!==a?(qt(),125===t.charCodeAt(_t)?(o=d,_t++):(o=a,0===kt&&Dt(D)),o!==a?(bt=e,e=i):(_t=e,e=a)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,t.substr(_t,3)===v?(r=v,_t+=3):(r=a,0===kt&&Dt(S)),r!==a&&(bt=e,r=""),(e=r)===a&&(e=_t,r=_t,kt++,92===t.charCodeAt(_t)?(n=g,_t++):(n=a,0===kt&&Dt(P)),n===a&&(39===t.charCodeAt(_t)?(n="'",_t++):(n=a,0===kt&&Dt(rt)),n===a&&(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)))),kt--,n===a?r=void 0:(_t=r,r=a),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Et()):(_t=e,e=a)):(_t=e,e=a),e===a))){if(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a){if(n=[],E.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt)),i!==a)for(;i!==a;)n.push(i),E.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(nt));else n=a;n!==a?(125===t.charCodeAt(_t)?(i=d,_t++):(i=a,0===kt&&Dt(D)),i!==a?(bt=e,e=function(){throw new Error("Error tokenizing '"+t+"'.")}()):(_t=e,e=a)):(_t=e,e=a)}else _t=e,e=a;e===a&&(e=_t,t.substr(_t,2)===u?(r=u,_t+=2):(r=a,0===kt&&Dt(j)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),(e=r)===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.substr(_t,2)===u?(n=u,_t+=2):(n=a,0===kt&&Dt(j)),n!==a?(bt=e,e=n):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a?(t.length>_t?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(z)),n!==a?(bt=e,e=Qe(n)):(_t=e,e=a)):(_t=e,e=a),e===a&&(e=_t,92===t.charCodeAt(_t)?(r=g,_t++):(r=a,0===kt&&Dt(P)),r!==a&&(bt=e,r=function(){throw new Error("Error tokenizing '"+t+"'.")}()),e=r))))}return e}function Wt(){var e,r,n,i;if(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;return n!==a?(bt=e,e={type:"IntegerLiteral",value:Ke(Et())}):(_t=e,e=a),kt--,e===a&&(r=a,0===kt&&Dt(it)),e}function Rt(){var e,r,n,i,o,s,l,c,u,d;for(kt++,e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));if(46===t.charCodeAt(_t)?(i=".",_t++):(i=a,0===kt&&Dt(st)),i!==a){if(o=[],C.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot)),s!==a)for(;s!==a;)o.push(s),C.test(t.charAt(_t))?(s=t.charAt(_t),_t++):(s=a,0===kt&&Dt(ot));else o=a;if(o!==a){if(s=_t,101===t.charCodeAt(_t)?(l="e",_t++):(l=a,0===kt&&Dt(lt)),l===a&&(69===t.charCodeAt(_t)?(l="E",_t++):(l=a,0===kt&&Dt(ct))),l!==a){if(43===t.charCodeAt(_t)?(c=b,_t++):(c=a,0===kt&&Dt(q)),c===a&&(45===t.charCodeAt(_t)?(c=w,_t++):(c=a,0===kt&&Dt(H))),c===a&&(c=null),u=[],C.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot)),d!==a)for(;d!==a;)u.push(d),C.test(t.charAt(_t))?(d=t.charAt(_t),_t++):(d=a,0===kt&&Dt(ot));else u=a;u!==a?s=l=[l,c,u]:(_t=s,s=a)}else _t=s,s=a;s===a&&(s=null),bt=e,e={type:"NumberLiteral",value:parseFloat(Et())}}else _t=e,e=a}else _t=e,e=a;if(e===a){if(e=_t,45===t.charCodeAt(_t)?(r=w,_t++):(r=a,0===kt&&Dt(H)),r===a&&(r=null),n=[],C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot)),i!==a)for(;i!==a;)n.push(i),C.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(ot));else n=a;if(n!==a)if(101===t.charCodeAt(_t)?(i="e",_t++):(i=a,0===kt&&Dt(lt)),i===a&&(69===t.charCodeAt(_t)?(i="E",_t++):(i=a,0===kt&&Dt(ct))),i!==a){if(43===t.charCodeAt(_t)?(o=b,_t++):(o=a,0===kt&&Dt(q)),o===a&&(45===t.charCodeAt(_t)?(o=w,_t++):(o=a,0===kt&&Dt(H))),o===a&&(o=null),s=[],C.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot)),l!==a)for(;l!==a;)s.push(l),C.test(t.charAt(_t))?(l=t.charAt(_t),_t++):(l=a,0===kt&&Dt(ot));else s=a;s!==a?(bt=e,e={type:"NumberLiteral",value:parseFloat(Et())}):(_t=e,e=a)}else _t=e,e=a;else _t=e,e=a}return kt--,e===a&&(r=a,0===kt&&Dt(at)),e}function Lt(){var e,r,n,i,o;if(kt++,e=_t,r=_t,kt++,n=function(){var e,r,n,i;return e=_t,t.substr(_t,4)===$?(r=$,_t+=4):(r=a,0===kt&&Dt(dt)),r===a&&(t.substr(_t,5)===x?(r=x,_t+=5):(r=a,0===kt&&Dt(vt))),r!==a?(n=_t,kt++,F.test(t.charAt(_t))?(i=t.charAt(_t),_t++):(i=a,0===kt&&Dt(gt)),kt--,i===a?n=void 0:(_t=n,n=a),n!==a?e=r=[r,n]:(_t=e,e=a)):(_t=e,e=a),e}(),kt--,n===a?r=void 0:(_t=r,r=a),r!==a)if(A.test(t.charAt(_t))?(n=t.charAt(_t),_t++):(n=a,0===kt&&Dt(ft)),n!==a){for(i=[],F.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));o!==a;)i.push(o),F.test(t.charAt(_t))?(o=t.charAt(_t),_t++):(o=a,0===kt&&Dt(gt));bt=e,e={type:"Identifier",name:Et()}}else _t=e,e=a;else _t=e,e=a;return kt--,e===a&&(r=a,0===kt&&Dt(pt)),e}function qt(){var e,r;for(kt++,e=[],V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));r!==a;)e.push(r),V.test(t.charAt(_t))?(r=t.charAt(_t),_t++):(r=a,0===kt&&Dt(mt));return kt--,r=a,0===kt&&Dt(ht),e}if((r=c())!==a&&_t===t.length)return r;throw r!==a&&_t<t.length&&Dt({type:"end"}),n=xt,i=$t<t.length?t.charAt($t):null,o=$t<t.length?jt($t,$t+1):jt($t,$t),new tr(tr.buildMessage(n,i),n,i,o)}!function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(tr,Error),tr.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<t.length;r++)if(t[r].source===this.location.source){n=t[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,o=this.location.source+":"+i.line+":"+i.column;if(n){var a=this.location.end,s=er("",i.line.toString().length," "),l=n[i.line-1],c=(i.line===a.line?a.column:l.length+1)-i.column||1;e+="\n --\x3e "+o+"\n"+s+" |\n"+i.line+" | "+l+"\n"+s+" | "+er("",i.column-1," ")+er("",c,"^")}else e+="\n at "+o}return e},tr.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(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 n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(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"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function a(t){return r[t.type](t)}return"Expected "+function(t){var e,r,n=t.map(a);if(n.sort(),n.length>0){for(e=1,r=1;e<n.length;e++)n[e-1]!==n[e]&&(n[r]=n[e],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."};const nr=new Map,ir=new Map;function or(t,e,r){const n={args:e,cb:r},i=nr.get(t)||[];nr.has(t)||nr.set(t,i),i.push(n);const o=t+":"+e.map((t=>"object"==typeof t?t.type:t)).join("#");ir.set(o,n)}function ar(t,e){let r=t.args.length,n=t.args.length;const i=t.args[t.args.length-1];if("object"==typeof i&&i.isVararg&&(--r,n=1/0),e.length<r)return{type:"few",expected:r,found:e.length};if(e.length>n)return{type:"many",expected:n,found:e.length};for(let r=0;r<e.length;++r){let n=r>=t.args.length?t.args[t.args.length-1]:t.args[r];if("object"!=typeof n&&(n={type:n}),n.type!==e[r].type)return{type:"mismatch",expected:n.type,found:e[r].type}}return{type:"match"}}function sr(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=>{sr(t,e)}));break;case"BinaryExpression":case"LogicalExpression":sr(t.left,e),sr(t.right,e);break;case"UnaryExpression":sr(t.argument,e);break;case"ConditionalExpression":sr(t.test,e),sr(t.consequent,e),sr(t.alternate,e);break;case"CallExpression":t.arguments.forEach((t=>{sr(t,e)}))}}function lr(t){return"url"===t.type||"color"===t.type?{type:"string",value:t.value}:t}function cr(t){return t.toISOString().replace("T"," ").replace(/\.\d{3}Z$/,"")}function ur(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 cr(t.value);if("color"===t.type)return _r(yr(t.value));if("url"===t.type)return t.value;throw new Error(`Unexpected type ${t.type}`)}function dr(t){let e=ur(t);return"string"===t.type&&(e="'"+e.replace(/\\/g,"\\'").replace(/'/g,"\\'")+"'"),e}function vr(t){return"datetime"===t?"DateTime":t.charAt(0).toUpperCase()+t.substring(1)}const gr=new Int32Array(1);function pr(t){return gr[0]=t,gr[0]}function fr(t){if(t<Fe||t>Ce)throw new Error("Integer overflow.")}function hr(t){const e=[];return sr(t,{Variable(t){e.push(t.id.name)}}),e}function mr(t,e){throw new Error(`Failed to evaluate [${t}]. ${e}`)}function yr(t){const e=it(t);if(e)return e;throw new Error("Unable to convert value to Color, expected format #AARRGGBB.")}function _r(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 rt(Math.round(t).toString(16),2)})).join("").toUpperCase()}`}function br(t){return{type:je,value:ur(t)}}function wr(t){const e=Number(t.value);if(isNaN(e)||!Number.isFinite(e))throw new Error("Unable to convert value to Number.");return{type:Se,value:e}}function $r(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value/e.value;return t.type===De&&(r=pr(r)),{type:t.type,value:r}}function xr(t,e){if(0===e.value)throw new Error("Division by zero is not supported.");let r=t.value%e.value;return t.type===De&&(r=pr(r)),{type:t.type,value:r}}function kr(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e*=t[r].value,t[0].type===De&&(e=pr(e));return{type:t[0].type,value:e}}function Er(...t){let e=t.length?t[0].value:0;for(let r=1;r<t.length;++r)e-=t[r].value,t[0].type===De&&(e=pr(e));return{type:t.length?t[0].type:De,value:e}}function Cr(...t){let e=0;for(let r=0;r<t.length;++r)e+=t[r].value,t[0].type===De&&(e=pr(e));return{type:t.length?t[0].type:De,value:e}}function Fr(t){const e=Math.abs(t.value);return t.type===De&&fr(e),{type:t.type,value:e}}function Ar(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.max(...t.map((t=>t.value)))}}function Vr(...t){if(!t.length)throw new Error("Non empty argument list is required.");return{type:t[0].type,value:Math.min(...t.map((t=>t.value)))}}function jr(t){return{type:t.type,value:Math.sign(t.value)}}function Dr(t,e){let r;if(0===e.value&&t.type===De)r=t.value;else if(0===t.value&&t.type===De)r=0;else{let n=Math.sign(e.value);t.type===Se&&0===n&&(n=Object.is(n,0)?1:-1),r=Math.abs(t.value)*n}return t.type===De&&fr(r),{type:t.type,value:r}}function Sr(t){return e=>{const r=yr(e.value);return{type:Se,value:r[t]/255}}}function Pr(t){return(e,r)=>{const n=yr(e.value);return n[t]=255*r.value,{type:ze,value:_r(n)}}}const zr=Sr("a"),Ir=Sr("r"),Mr=Sr("g"),Or=Sr("b"),Jr=Pr("a"),Nr=Pr("r"),Tr=Pr("g"),Br=Pr("b");function Ur(t){return t.map(dr).join(", ")}or("toString",[De],br),or("toString",[Se],br),or("toString",[Pe],br),or("toString",[ze],br),or("toString",["url"],br),or("toNumber",[De],wr),or("toNumber",[je],wr),or("toInteger",[Se],(function(t){if(t.value>Ce||t.value<Fe)throw new Error("Unable to convert value to Integer.");const e=t.value-t.value%1;return{type:De,value:e}})),or("toInteger",[je],(function(t){const e=Number(t.value);if(isNaN(e)||e%1!=0||e>Ce||e<Fe)throw new Error("Unable to convert value to Integer.");return{type:De,value:e}})),or("toInteger",[Pe],(function(t){return{type:De,value:t.value?1:0}})),or("toBoolean",[De],(function(t){if(1!==t.value&&0!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Pe,value:t.value}})),or("toBoolean",[je],(function(t){if("true"!==t.value&&"false"!==t.value)throw new Error("Unable to convert value to Boolean.");return{type:Pe,value:"true"===t.value?1:0}})),or("encodeUri",[je],(function(t){try{return{type:je,value:encodeURIComponent(t.value)}}catch(t){throw new Error("Unable to encodeUri string.")}})),or("decodeUri",[je],(function(t){try{return{type:je,value:decodeURIComponent(t.value)}}catch(t){throw new Error("Unable to decodeUri string.")}})),or("parseUnixTime",[De],(function(t){return{type:Ie,value:new Date(1e3*t.value)}})),or("nowLocal",[],(function(){return{type:Ie,value:new Date}})),or("addMillis",[Ie,De],(function(t,e){return{type:Ie,value:new Date(t.value.getTime()+e.value)}})),or("setYear",[Ie,De],(function(t,e){const r=new Date(t.value);return r.setFullYear(e.value),{type:Ie,value:r}})),or("setMonth",[Ie,De],(function(t,e){if(e.value<1||e.value>12)throw new Error(`Expecting month in [1..12], instead got ${e.value}.`);const r=new Date(t.value);return r.setMonth(e.value-1),{type:Ie,value:r}})),or("setDay",[Ie,De],(function(t,e){const r=new Date(t.value);if(e.value<=0&&-1!==e.value||e.value>function(t){const e=new Date(t);return e.setMonth(e.getMonth()+1),e.setDate(0),e.getDate()}(r))throw new Error(`Unable to set day ${e.value} for date ${ur(t)}.`);return r.setDate(-1===e.value?0:e.value),{type:Ie,value:r}})),or("setHours",[Ie,De],(function(t,e){if(e.value<0||e.value>23)throw new Error(`Expecting hours in [0..23], instead got ${e.value}.`);const r=new Date(t.value);return r.setHours(e.value-r.getTimezoneOffset()/60),{type:Ie,value:r}})),or("setMinutes",[Ie,De],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting minutes in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setMinutes(e.value),{type:Ie,value:r}})),or("setSeconds",[Ie,De],(function(t,e){if(e.value<0||e.value>59)throw new Error(`Expecting seconds in [0..59], instead got ${e.value}.`);const r=new Date(t.value);return r.setSeconds(e.value),{type:Ie,value:r}})),or("setMillis",[Ie,De],(function(t,e){if(e.value<0||e.value>999)throw new Error(`Expecting millis in [0..999], instead got ${e.value}.`);const r=new Date(t.value);return r.setMilliseconds(e.value),{type:Ie,value:r}})),or("len",[je],(function(t){return{type:De,value:t.value.length}})),or("contains",[je,je],(function(t,e){return{type:Pe,value:t.value.includes(e.value)?1:0}})),or("substring",[je,De,De],(function(t,e,r){if(r.value<e.value)throw new Error("Indexes should be in ascending order.");if(e.value<0||e.value>t.value.length||r.value<0||r.value>t.value.length)throw new Error("Indexes are out of bounds.");return{type:je,value:t.value.substring(e.value,r.value)}})),or("replaceAll",[je,je,je],(function(t,e,r){let n;return n=e.value?t.value.replace(new RegExp(function(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}(e.value),"g"),r.value):t.value,{type:je,value:n}})),or("index",[je,je],(function(t,e){return{type:De,value:t.value.indexOf(e.value)}})),or("lastIndex",[je,je],(function(t,e){return{type:De,value:t.value.lastIndexOf(e.value)}})),or("trim",[je],(function(t){return{type:je,value:t.value.trim()}})),or("trimLeft",[je],(function(t){return{type:je,value:t.value.replace(/^\s+/,"")}})),or("trimRight",[je],(function(t){return{type:je,value:t.value.replace(/\s+$/,"")}})),or("toUpperCase",[je],(function(t){return{type:je,value:t.value.toUpperCase()}})),or("toLowerCase",[je],(function(t){return{type:je,value:t.value.toLowerCase()}})),or("div",[De,De],$r),or("div",[Se,Se],$r),or("mod",[De,De],xr),or("mod",[Se,Se],xr),or("mul",[{type:De,isVararg:!0}],kr),or("mul",[{type:Se,isVararg:!0}],kr),or("sub",[{type:De,isVararg:!0}],Er),or("sub",[{type:Se,isVararg:!0}],Er),or("sum",[{type:De,isVararg:!0}],Cr),or("sum",[{type:Se,isVararg:!0}],Cr),or("abs",[De],Fr),or("abs",[Se],Fr),or("max",[{type:De,isVararg:!0}],Ar),or("max",[{type:Se,isVararg:!0}],Ar),or("min",[{type:De,isVararg:!0}],Vr),or("min",[{type:Se,isVararg:!0}],Vr),or("maxNumber",[],(function(){return{type:Se,value:Ae}})),or("minNumber",[],(function(){return{type:Se,value:Ve}})),or("maxInteger",[],(function(){return{type:De,value:Ce}})),or("minInteger",[],(function(){return{type:De,value:Fe}})),or("round",[Se],(function(t){const e=Math.sign(t.value);return{type:Se,value:e*Math.round(Math.abs(t.value))}})),or("floor",[Se],(function(t){return{type:Se,value:Math.floor(t.value)}})),or("ceil",[Se],(function(t){return{type:Se,value:Math.ceil(t.value)}})),or("signum",[Se],jr),or("signum",[De],jr),or("copySign",[Se,Se],Dr),or("copySign",[De,De],Dr),or("getColorAlpha",[je],zr),or("getColorAlpha",[ze],zr),or("getColorRed",[je],Ir),or("getColorRed",[ze],Ir),or("getColorGreen",[je],Mr),or("getColorGreen",[ze],Mr),or("getColorBlue",[je],Or),or("getColorBlue",[ze],Or),or("setColorAlpha",[je,Se],Jr),or("setColorAlpha",[ze,Se],Jr),or("setColorRed",[je,Se],Nr),or("setColorRed",[ze,Se],Nr),or("setColorGreen",[je,Se],Tr),or("setColorGreen",[ze,Se],Tr),or("setColorBlue",[je,Se],Br),or("setColorBlue",[ze,Se],Br),or("rgb",[Se,Se,Se],(function(t,e,r){const n={a:255,r:255*t.value,g:255*e.value,b:255*r.value};return{type:ze,value:_r(n)}})),or("argb",[Se,Se,Se,Se],(function(t,e,r,n){const i={a:255*t.value,r:255*e.value,g:255*r.value,b:255*n.value};return{type:ze,value:_r(i)}}));const Wr={StringLiteral:function(t,e){return{type:je,value:e.value}},NumberLiteral:function(t,e){return{type:Se,value:e.value}},IntegerLiteral:function(t,e){return{type:De,value:e.value}},BooleanLiteral:function(t,e){return{type:Pe,value:e.value?1:0}},UnaryExpression:function(t,e){const r=lr(Rr(t,e.argument));switch(e.operator){case"!":if(r.type===Pe)return{type:Pe,value:r.value?0:1};mr(`${e.operator}${dr(r)}`,"A Boolean is expected after a unary not.");case"+":case"-":const t="+"===e.operator?1:-1;if(r.type===De)return{type:De,value:r.value*t};if(r.type===Se)return{type:Se,value:r.value*t};mr(`${e.operator}${dr(r)}`,`A Number is expected after a unary ${"+"===e.operator?"plus":"minus"}.`)}},ConditionalExpression:function(t,e){const r=lr(Rr(t,e.test));if(r.type===Pe)return r.value?Rr(t,e.consequent):Rr(t,e.alternate);mr(`${dr(r)} ? ${dr(Rr(t,e.consequent))} : ${dr(Rr(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 Rr(t,e.expressions[0]);for(let n=0;n<e.expressions.length;++n)r+=e.quasis[n].value,r+=ur(Rr(t,e.expressions[n]));return r+=e.quasis[e.quasis.length-1].value,{type:je,value:r}},LogicalExpression:function(t,e){const r=lr(Rr(t,e.left));if(r.type!==Pe&&mr(`${dr(r)} ${e.operator} ...`,`'${e.operator}' must be called with boolean operands.`),"||"===e.operator&&r.value)return r;if("&&"===e.operator&&!r.value)return{type:Pe,value:0};const n=lr(Rr(t,e.right));return n.type!==Pe&&mr(`${dr(r)} ${e.operator} ${dr(n)}`,`Operator '${e.operator}' cannot be applied to different types: Boolean and ${vr(n.type)}.`),{type:Pe,value:n.value}},BinaryExpression:function(t,e){const r=e.operator,n=Rr(t,e.left),i=Rr(t,e.right);if(n.type!==i.type&&mr(`${dr(n)} ${e.operator} ${dr(i)}`,`Operator '${r}' cannot be applied to different types: ${vr(n.type)} and ${vr(i.type)}.`),"=="===r||"!="===r)return function(t,e,r){let n;return n=e.type===Ie&&r.type===Ie?e.value.getTime()===r.value.getTime():e.value===r.value,"!="===t&&(n=!n),{type:Pe,value:n?1:0}}(r,n,i);if(">"===r||">="===r||"<"===r||"<="===r)return function(t,e,r){let n;e.type!==Se&&e.type!==De&&e.type!==Ie&&mr(`${dr(e)} ${t} ${dr(r)}`,`Operator '${t}' cannot be applied to ${vr(e.type)} type.`);const i=e.type===Ie?e.value.getTime():e.value,o=r.type===Ie?r.value.getTime():r.value;return n=">"===t?i>o:">="===t?i>=o:"<"===t?i<o:i<=o,{type:Pe,value:n?1:0}}(r,n,i);if("+"===r||"-"===r)return function(t,e,r){if(e.type!==je&&e.type!==Se&&e.type!==De&&mr(`${dr(e)} ${t} ${dr(r)}`,`Operator '${t}' cannot be applied to ${vr(e.type)} type.`),e.type===je)return"-"===t&&mr(`${dr(e)} - ${dr(r)}`,`Operator '${t}' cannot be applied to ${vr(e.type)} type.`),{type:je,value:e.value+r.value};let n="+"===t?e.value+r.value:e.value-r.value;return e.type===De&&(n=pr(n)),{type:e.type,value:n}}(r,n,i);if("/"===r||"*"===r||"%"===r)return function(t,e,r){let n;if(e.type!==De&&e.type!==Se&&mr(`${dr(e)} ${t} ${dr(r)}`,`Operator '${t}' cannot be applied to ${vr(e.type)} type.`),"*"===t)n=e.value*r.value;else{if("/"!==t&&"%"!==t)throw new Error(`Unsupported operation ${t}`);0===r.value&&mr(`${dr(e)} ${t} ${dr(r)}`,"Division by zero is not supported."),n="/"===t?e.value/r.value:e.value%r.value}return e.type===De&&(n=pr(n)),{type:e.type,value:n}}(r,n,i);throw new Error(`Unsupported operation ${r}`)},CallExpression:function(t,e){const r=e.callee.name;if(!nr.has(r))throw new Error(`Unknown function name: ${r}.`);let n;const i=e.arguments.map((e=>Rr(t,e))),o=r+":"+i.map((t=>t.type)).join("#");if(ir.has(o))n=ir.get(o);else{const t=function(t,e){const r=nr.get(t);if(!r)throw new Error("Missing function");let n=null;for(let t=0;t<r.length;++t){const i=ar(r[t],e);if("match"===i.type)return r[t];n||(n=i)}if(!n)throw new Error("Missing function");return n}(r,i);if("expected"in t){const e=i.map((t=>vr(t.type))).join(", "),n=`${r}(${Ur(i)})`;"few"===t.type&&0===i.length?mr(n,`Non empty argument list is required for function '${r}'.`):(t.type,mr(n,`Function '${r}' has no matching override for given argument types: ${e}.`))}n=t}if(!n)throw new Error("Function not found");try{return n.cb(...i)}catch(t){mr(`${r}(${Ur(i)})`,t.message)}},Variable:function(t,e){const r=e.id.name,n=t.get(r);if(n)return function(t){return{type:t.getType(),value:t.getValue()}}(n);throw new Error(`Variable '${r}' has value null`)}};function Rr(t,e){if(e.type in Wr)return Wr[e.type](t,e);throw new Error("Unsupported expression")}function Lr(t,e){try{return Rr(t,e)}catch(t){return{type:"error",value:t.message}}}class qr{constructor(t){this.ast=t}apply(t,e){if(!function(t,e){let r=!1;return sr(t,{Variable(t){e.has(t.id.name)||(r=!0)}}),r}(this.ast,t))try{const r=Lr(t,this.ast);if("error"===r.type)return void e(Y(new Error("Expression execution error"),{additional:{message:r.value}}));const n=r.value;return n instanceof Date?cr(n):"boolean"===r.type?Boolean(n):n}catch(t){return void e(Y(new Error("Expression execution error")))}}}function Hr(t,e,r){if(t)if("string"==typeof t){if((n=t).indexOf("@{")>-1||n.indexOf("\\")>-1){e.hasExpression=!0;try{const r=rr(t,{startRule:"JsonStringContents"}),n=hr(r);return e.vars.push(...n),new qr(r)}catch(e){return void r(Y(new Error("Unable to parse expression"),{additional:{expression:t}}))}}}else{if(Array.isArray(t))return t.map((t=>Hr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Hr(t[i],e,r);return n}}var n;return t}function Gr(t,e,r){if(t){if(t instanceof qr)return t.apply(e,r);if(Array.isArray(t))return t.map((t=>Gr(t,e,r)));if("object"==typeof t){const n={};for(const i in t)n[i]=Gr(t[i],e,r);return n}}return t}function Zr(t,e){const r={vars:[],hasExpression:!1},n=Hr(t,r,e);return{vars:[...new Set(r.vars)],hasExpression:r.hasExpression,applyVars:t=>Gr(n,t,e)}}const Yr={pagers:function(){return W(new Map)}},Xr=new Map,Kr=new Map;function Qr(t){const e=Xr.get(t)||W("");return Xr.has(t)||Xr.set(t,e),e}function tn(t){const e=Kr.get(t)||new Map;return Kr.has(t)||Kr.set(t,e),e}class en{setVariable(t){const e=t.getName(),r=tn(this);if(r.has(e))throw new Error("Variable with the same name already exist");r.set(e,t),Qr(this).set(e)}getVariable(t){return tn(this).get(t)}}function rn(){return new en}const nn=J(((t,e,r,n)=>{let i,o;var s,l,c;let{id:u}=e,{json:v={}}=e,{platform:g="auto"}=e,{theme:p="system"}=e,{globalVariablesController:f=new en}=e,{onError:h}=e,{onStat:m}=e,{onCustomAction:y}=e,{onComponent:_}=e,b=W("desktop"===g);if(o=a(b,(t=>i=t)),"auto"===g&&"undefined"!=typeof matchMedia){const t=matchMedia("(any-pointer: coarse)");b.set(!t.matches),t.addListener((()=>{b.set(!t.matches)}))}let w="light";if("light"===p||"dark"===p)w=p;else if("system"===p)if("undefined"!=typeof matchMedia){const t=matchMedia("(prefers-color-scheme: dark)");w=t.matches?"dark":"light",t.addListener((()=>{w=t.matches?"dark":"light",Q&&Q[w].forEach((t=>{const e=V.get(t.name);e&&e.setValue(t.color)}))}))}else w="light";else M(Y(new Error("Unsupported theme")));let $=!1;v||($=!0,M(Y(new Error('"json" prop is required')))),u||($=!0,M(Y(new Error('"id" prop is required'))));let x=function(t){if(!t)return Y(new Error("Missing object"));const e=t.card,r=t.templates||{};if(!e)return Y(new Error("Missing card"));if(!e.states||!e.states.length)return Y(new Error("Missing states"));for(const t in r)if(r.hasOwnProperty(t)&&t in Ue)return Y(new Error("Template name collision"),{additional:{templateName:t}});for(let t=0;t<e.states.length;++t){if(!e.states[t].div)return Y(new Error("Missing state div"),{additional:{stateId:e.states[t].state_id}});if("number"!=typeof e.states[t].state_id)return Y(new Error("Missing state_id"),{additional:{index:t}})}return null}(v);const k=v.templates||{};x&&($=!0,M(x));const E={stateChange:!1},C=Qr(f),F=tn(f),A=new Map,V=new Map,D=new Map;function S(t,e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e){const r=V.get(t);r&&r.setValue(e)}}function P(t){const e=V.get(t);return null==e?void 0:e.getValue()}function z(t){const e=Zr(t,M);return e.vars.length?e.applyVars(V):t}function M(t){h?h({error:t}):"warn"===(null==t?void 0:t.level)?console.warn(t):console.error(t)}let O=0;function J(t){return`${u}-${O++}`}let N={},T={};function B(t){const e=String(t.url);if(e)try{const t=e.replace(/div-action:\/\//,""),r=/([^?]+)\?(.+)/.exec(t);if(!r)return;const n=new URLSearchParams(r[2]);switch(r[1]){case"set_state":!function(t){if(!t)throw new Error("Missing state id");let e=G,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 n=r[t],i=r[t+1];let o=e.getChild(n);if(!o)return;o.setState(i),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=L(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=L(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=L(t);r&&r.setNextItem(e)}(n.get("id"),n.get("overflow"));break;case"set_variable":const r=n.get("name"),i=n.get("value");if(r&&null!==i){const t=V.get(r);t?t.set(i):M(Y(new Error("Cannot find variable"),{additional:{name:r}}))}else M(Y(new Error("Incorrect set_variable_action"),{additional:{url:t}}));break;default:M(Y(new Error("Unknown type of action"),{additional:{url:e}}))}}catch(t){M(Y(t,{additional:{url:e}}))}}const U=new Map;function L(t){if(U.has(t))return U.get(t);M(Y(new Error("Missing instance with id"),{additional:{id:t}}))}const q=new Map;function H(t){for(const e of t)V.has(e)&&t.delete(e);return t}d(Z,{logError:M,logStat:function(t,e){m&&m({type:t,action:e})},hasTemplate:function(t){return t in k},processTemplate:function(t,e){if(!t)return{json:t,templateContext:e};const r=new Set([t.type]);for(;t.type in k;){if(({json:t,templateContext:e}=qe(t,e,k,M)),r.has(t.type))return{json:t,templateContext:e};r.add(t.type)}return{json:t,templateContext:e}},genId:J,genClass:function(t){return`divkit-${J()}`},execAction:B,execCustomAction:function(t){null==y||y(t)},isRunning:function(t){return E[t]},setRunning:function(t,e){E[t]=e},registerInstance:function(t,e){U.has(t)?M(Y(new Error("Duplicate instance id"),{additional:{id:t}})):U.set(t,e)},unregisterInstance:function(t){U.delete(t)},addSvgFilter:function(t){if(T[t]=T[t]||0,++T[t],N[t])return N[t];const e=`${J()}-svg-filter`;return N=Object.assign(Object.assign({},N),{[t]:e}),e},removeSvgFilter:function(t){t&&T[t]&&0==--T[t]&&(N=Object.keys(N).reduce(((t,e)=>(T[e]&&(t[e]=N[e]),t)),{}))},getDerivedFromVars:function(t){if(!t)return Ge(t);const e=Zr(t,M);return e.vars.length?R(e.vars.map((t=>V.get(t)||function(t){const e=D.get(t)||W(void 0);return D.has(t)||D.set(t,e),e}(t))).filter(at),(()=>e.applyVars(V))):e.hasExpression?Ge(e.applyVars(V)):Ge(t)},getJsonWithVars:z,getStore:function(t){return q.has(t)||function(t){q.has(t)||q.set(t,Yr[t]())}(t),q.get(t)},getVariable:function(t,e){const r=V.get(t);if(r){const n=r.getType();if(n!==e)return void M(Y(new Error(`Variable should have type "${e}"`),{additional:{name:t,foundType:n}}))}return r},isDesktop:b,registerComponent:void 0,unregisterComponent:void 0}),d(Ft,{hasAction:()=>!1});const G={setState(t){throw new Error("Not implemented")},getChild(t){if(X&&X.has(t))return X.get(t);M(Y(new Error("Missing state block with id"),{additional:{id:t}}))}};let X=null;d(mt,{registerInstance(t,e){X||(X=new Map),X.has(t)?M(Y(new Error("Duplicate state with id"),{additional:{id:t}})):X.set(t,e)},unregisterInstance(t){null==X||X.delete(t)},runVisibilityTransition:(t,e,r,n,i)=>Promise.resolve(),registerChildWithTransitionIn:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionOut:(t,e,r,n)=>Promise.resolve(),registerChildWithTransitionChange:(t,e,r,n)=>Promise.resolve(),hasTransitionChange:t=>!1,registerChild(t){},unregisterChild(t){}});const K=null===(s=null==v?void 0:v.card)||void 0===s?void 0:s.variables;Array.isArray(K)&&K.forEach((t=>{if(t&&t.type in Oe&&t.name){if(A.has(t.name))return void M(Y(new Error("Duplicate variable"),{additional:{name:t.name}}));try{const e=Je(t.name,t.type,t.value);A.set(t.name,e),V.set(t.name,e)}catch(e){M(Y(e,{additional:{name:t.name}}))}}}));const Q=v.palette;Q&&Q[w].forEach((t=>{if(A.has(t.name))M(Y(new Error("Duplicate variable"),{additional:{name:t.name}}));else try{const e=Je(t.name,"color",t.color);A.set(t.name,e),V.set(t.name,e)}catch(e){M(Y(e,{additional:{name:t.name}}))}}));for(const[t,e]of F)V.has(t)||V.set(t,e);C.subscribe((t=>{if(t&&!V.has(t)){const e=F.get(t);V.set(t,e);const r=D.get(t);if(r){let t=0;e.subscribe((()=>{r.set(++t)}))}}}));const tt=null===(l=null==v?void 0:v.card)||void 0===l?void 0:l.variable_triggers;Array.isArray(tt)&&tt.forEach((t=>{let e=!1;if("string"!=typeof t.condition)return void M(Y(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 n=rr(t.condition,{startRule:"JsonStringContents"}),i=hr(n);if(!i.length)return void M(Y(new Error("variable_trigger must have variables in the condition"),{additional:{condition:t.condition}}));(function(t){const e=new Set(t);return H(e),e.size?new Promise((t=>{const r=C.subscribe((()=>{H(e),e.size||(r(),t())}))})):Promise.resolve()})(i).then((()=>{R(i.map((t=>V.get(t))).filter(at),(()=>Lr(V,n))).subscribe((n=>{"error"!==n.type?(n.value&&("on_variable"===r||"on_condition"===r&&!1===e)&&t.actions.forEach((t=>{const e=z(t);e.log_id&&B(e)})),e=Boolean(n.value)):M(Y(new Error("variable_trigger condition execution error"),{additional:{message:n.value}}))}))}))}catch(e){M(Y(new Error("Unable to parse variable_trigger"),{additional:{condition:t.condition}}))}else M(Y(new Error("variable_trigger has an unsupported mode"),{additional:{mode:r}}))}));const et=null===(c=v.card)||void 0===c?void 0:c.states,rt=et&&!$?{type:"state",id:"root",width:{type:"match_parent"},height:{type:"match_parent"},states:et.map((t=>({state_id:t.state_id.toString(),div:t.div})))}:void 0;return void 0===e.id&&r.id&&void 0!==u&&r.id(u),void 0===e.json&&r.json&&void 0!==v&&r.json(v),void 0===e.platform&&r.platform&&void 0!==g&&r.platform(g),void 0===e.theme&&r.theme&&void 0!==p&&r.theme(p),void 0===e.globalVariablesController&&r.globalVariablesController&&void 0!==f&&r.globalVariablesController(f),void 0===e.onError&&r.onError&&void 0!==h&&r.onError(h),void 0===e.onStat&&r.onStat&&void 0!==m&&r.onStat(m),void 0===e.onCustomAction&&r.onCustomAction&&void 0!==y&&r.onCustomAction(y),void 0===e.onComponent&&r.onComponent&&void 0!==_&&r.onComponent(_),void 0===e.setVariable&&r.setVariable&&void 0!==S&&r.setVariable(S),void 0===e.getVariable&&r.getVariable&&void 0!==P&&r.getVariable(P),void 0===e.execAction&&r.execAction&&void 0!==B&&r.execAction(B),o(),!$&&rt?`<div class="${j("divkit-b023",!0)+j(i?" divkit-ee11":"",!0)}">${I(Le,"RootSvgFilters").$$render(t,{svgFiltersMap:N},{},{})}\n ${I(Re,"Unknown").$$render(t,{div:rt,templateContext:{}},{},{})}</div>`:""})),on=nn;function an(t){return on.render({id:t.id,json:t.json,globalVariablesController:t.globalVariablesController,onError:t.onError,platform:t.platform}).html}var sn=exports;for(var ln in e)sn[ln]=e[ln];e.__esModule&&Object.defineProperty(sn,"__esModule",{value:!0})})();
|
|
2
2
|
//# sourceMappingURL=server.js.map
|