PageSourceSearch

https://hlst.ru/_next/static/chunks/2187.b62ba6927169eb01.js

js hlst.ru collected 2026-09-25 09:49:14 UTC 63,439 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2187],{2879:(e,t,l)=>{"use strict";l.d(t,{EK:()=>r,Ui:()=>u,qs:()=>a});var n=l(43533);let r=e=>{let t=[],l=[],n=e=>{if(e){if("group"===e.type){let t=e.children;t&&"function"==typeof t.forEach&&t.forEach(n);return}"text"===e.type?t.push(e):"table"===e.type&&l.push(e)}};return(null!=e?e:[]).forEach(n),{texts:t,tables:l}},o=e=>{let t=null==e?void 0:e.focusedCells;if(t&&"number"==typeof t.length&&t.length>0)return{cells:Array.from(t),focused:!0};let l=null==e?void 0:e.cells;return{cells:l&&"function"==typeof l.forEach?Array.from(l):[],focused:!1}},a=e=>{let t=new Map,l=e=>{if("string"!=typeof e)return;let l=(0,n.Ir)(e);if(!l)return;let r=(0,n.cp)(l),o=t.get(r);o?o.count+=1:t.set(r,{family:l,count:1})},{texts:a,tables:i}=r(e);return a.forEach(e=>{if(l(e.fontFamily),"string"==typeof e.text&&e.text.includes("font-family")){let t=new Set;(0,n.uo)(e.text,t),t.forEach(l)}}),i.forEach(e=>{let{cells:t,focused:n}=o(e);if(n)return void t.forEach(t=>{var n;return l(null!=(n=null==t?void 0:t.fontFamily)?n:e.fontFamily)});l(e.fontFamily),t.forEach(e=>l(null==e?void 0:e.fontFamily))}),Array.from(t.values()).sort((e,t)=>t.count-e.count).map(e=>e.family)},i=/(font-weight:\s*)([^;"'&<>]+)/,s=/style="([^"]*)"/g,c=function(e,t,l,r){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e||!e.includes('style="'))return e;let a=null===t?null:(0,n.cp)(t),c=e=>e.replace(i,(e,t)=>"".concat(t).concat(r));return e.replace(s,(e,t)=>{let s,u,d;return'style="'.concat((s=!1,u=!1,d=t.replace((0,n.Nm)(),function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];s=!0;let{prefix:o,quote:i,family:c}=(0,n.Gs)(t);if(null!==a&&(0,n.cp)(c)!==a)return t[0];if(u=!0,"&quot;"===i)return"".concat(o,"&quot;").concat((0,n.bv)(l),"&quot;");if(i)return"".concat(o).concat(i).concat(l).concat(i);if(/['&]/.test(l))return"".concat(o,"&quot;").concat((0,n.bv)(l),"&quot;");let d=/\s/.test(l)?"'":"";return"".concat(o).concat(d).concat(l).concat(d)}),r&&(u?d=i.test(d)?c(d):"".concat(d.replace(/;?\s*$/,""),"; font-weight: ").concat(r):!s&&o&&i.test(d)&&(d=c(d))),d),'"')})},u=function(e,t,a,i){var s;let u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},d=(0,n.Ir)(String(null!=i?i:""));if(!d)return!1;let p=u.fontWeight?String(u.fontWeight):null,h=null===a?null:(0,n.cp)(a),f=e=>null===h||"string"==typeof e&&(0,n.cp)(e)===h,g=e=>{var t;let l={};return e.fontFamily!==d&&(l.fontFamily=d),null!==p&&String(null!=(t=e.fontWeight)?t:"")!==p&&(l.fontWeight=p),l},{texts:m,tables:v}=r(t),b=!1,y=()=>{m.forEach(e=>{let t=f(e.fontFamily),l=t?g(e):{};if("string"==typeof e.text&&e.text.includes('style="')){let n=c(e.text,a,d,p,t);n!==e.text&&(l.text=n)}Object.keys(l).length&&(e.set(l),b=!0)}),v.forEach(e=>{let{cells:t,focused:l}=o(e);if(t.forEach(t=>{if(!t)return;let n=t.fontFamily;if(!f(l&&null==n?e.fontFamily:n))return;let r=g(t);Object.keys(r).length&&(t.set(r),b=!0)}),!l&&f(e.fontFamily)){let t=g(e);Object.keys(t).length&&(e.set(t),b=!0)}})};return"function"==typeof(null==e||null==(s=e.history)?void 0:s.transaction)?e.history.transaction(y):y(),b&&Promise.all([l.e(6790),l.e(4321)]).then(l.bind(l,14321)).then(t=>{let{loadFontMirrored:l}=t;return l(e,d,"normal",null!=p?p:400)}).catch(()=>{}),b}},13581:e=>{e.exports={body:"ColorReplacePanel_body__rvXqk",content:"ColorReplacePanel_content__XrdWr",section:"ColorReplacePanel_section__IxLWD",hexBar:"ColorReplacePanel_hexBar__p6Kv1",hexField:"ColorReplacePanel_hexField__1ZO2U",hexPrefix:"ColorReplacePanel_hexPrefix__4LlqO",hexInput:"ColorReplacePanel_hexInput__eiNLr",hexClear:"ColorReplacePanel_hexClear__IJw7e",hexAdd:"ColorReplacePanel_hexAdd__jruIN",grid:"ColorReplacePanel_grid__3vSo0",slotTipTarget:"ColorReplacePanel_slotTipTarget__SX1QC",cube:"ColorReplacePanel_cube__3g6jf",strip:"ColorReplacePanel_strip__8ndVW",cubeOn:"ColorReplacePanel_cubeOn__SyhhQ",cubeTool:"ColorReplacePanel_cubeTool__XDiks",cubeToolOn:"ColorReplacePanel_cubeToolOn__zT_iX",cubeCustom:"ColorReplacePanel_cubeCustom__ssGmu",cubeAdd:"ColorReplacePanel_cubeAdd__2BQOg",cubeTransparent:"ColorReplacePanel_cubeTransparent__XJgg0",cubePhoto:"ColorReplacePanel_cubePhoto__8lwlc",stripStage:"ColorReplacePanel_stripStage__37nJT",colorStripDrillIn:"ColorReplacePanel_colorStripDrillIn__1VYTm",cubeBack:"ColorReplacePanel_cubeBack__73lnk"}},15063:(e,t,l)=>{"use strict";l.d(t,{a:()=>n});let n=e=>!!e&&"tables"===e.studio},28506:(e,t,l)=>{"use strict";l.d(t,{Gt:()=>j,IH:()=>w,JK:()=>C,T:()=>d,Uo:()=>A,VW:()=>y,fD:()=>m,h$:()=>s,iY:()=>u,ig:()=>c,xE:()=>p});let n="#ADADAD",r="transparent",o=[{subType:"circle",width:300,height:300},{subType:"rect",width:300,height:300},{subType:"rect",width:360,height:240},{subType:"rect",width:360,height:240,cornerRadius:48},{subType:"triangle",width:300,height:260},{subType:"diamond",width:300,height:300},{subType:"hexagon",width:300,height:300},{subType:"circle",width:360,height:240},{subType:"star",width:300,height:300},{subType:"speechBubble",width:300,height:260},{subType:"x-heartSoft",width:300,height:300}].map(e=>{var t;return{...e,cornerRadius:null!=(t=e.cornerRadius)?t:0,fill:r,stroke:n,strokeWidth:24,maskFill:n}}),a=(e,t)=>Math.abs(t)*e/2,i={arc:!0,width:324,height:a(300,-.7)+24,length:300,thickness:24,curve:-.7,color:n},s=[...o.slice(0,8),i,...o.slice(8)],c=e=>!!e&&!0===e.arc,u=function(e,t,l,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-.7,o=a(t,r);return{type:"line",x:e.x-t/2,y:e.y+o/2-l/2,width:t,height:l,color:n,curve:r}},d=(e,t,l)=>{let n=Math.max(1,t),r=Math.max(n,e.width-n),o=-Math.min(1,2*Math.max(1,Math.min(e.height-n,a(r,-.7)))/r);return u({x:e.x+e.width/2,y:e.y+e.height/2},r,n,l,o)},p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,{length:t,thickness:l,curve:n,color:r}=e,o=a(t,n),s=l/2,c=o+l/2,u="M ".concat(s," ").concat(c," Q ").concat(s+t/2," ").concat(c+n*t," ").concat(s+t," ").concat(c);return'<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(t+l,'" height="').concat(o+l,'" viewBox="0 0 ').concat(t+l," ").concat(o+l,'">')+'<path d="'.concat(u,'" fill="none" stroke="').concat(r,'" stroke-width="').concat(l,'" stroke-linecap="butt"/></svg>')},h=/^(?:rgba?|hsla?)\((.*)\)$/i,f=e=>{if(null==e)return!0;let t=String(e).trim().toLowerCase();if(!t||"none"===t||"transparent"===t)return!0;
1if(t.includes("gradient("))return!1;let l=h.exec(t);if(l){let e=l[1].split(/[\s,/]+/).filter(Boolean);if(e.length<4)return!1;let t=parseFloat(e[e.length-1]);return Number.isFinite(t)&&0===t}return/^#[0-9a-f]{8}$/.test(t)?t.endsWith("00"):!!/^#[0-9a-f]{4}$/.test(t)&&t.endsWith("0")},g=e=>{let t=Number(null==e?void 0:e.strokeWidth);return Number.isFinite(t)&&t>0?t:0},m=e=>!!e&&(void 0===e.type||"figure"===e.type)&&g(e)>0&&f(e.fill),v=e=>{if("string"!=typeof e)return null;let t=e.trim();return!t||t.includes("gradient(")||f(t)?null:t},b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300,l=Number(null==e?void 0:e.width),n=Number(null==e?void 0:e.height),r=Math.min(Number.isFinite(l)&&l>0?l:t,Number.isFinite(n)&&n>0?n:t);return r>0?r:t},y=e=>Math.max(2,Math.round(b(e,100)/2)),x=(e,t)=>{let l=g(e);if(!l)return 0;let n=l*b(t)/300;return Math.min(y(t),Math.max(1,Math.round(n)))},k=(e,t)=>{let l=Number(null==e?void 0:e.cornerRadius);return!Number.isFinite(l)||l<=0?0:Math.round(l*b(t)/b(e))},w=(e,t)=>{var l,o,a,i,s,c;let u=m(e);if(m(t)){let s=k(t,e);if(u){let o=Math.min(y(e),g(e));return{fill:r,stroke:null!=(l=v(e.stroke))?l:n,strokeWidth:o||x(t,e),cornerRadius:s}}return{fill:r,stroke:null!=(i=null!=(a=null!=(o=v(e.fill))?o:v(e.stroke))?a:v(t.stroke))?i:n,strokeWidth:x(t,e),cornerRadius:s}}return u?{fill:null!=(c=null!=(s=v(e.stroke))?s:v(null==t?void 0:t.fill))?c:n,strokeWidth:0}:{}},C=(e,t)=>({fill:"string"==typeof(null==e?void 0:e.fill)&&e.fill?e.fill:"#8f8f8f",stroke:"string"==typeof(null==e?void 0:e.stroke)&&e.stroke?e.stroke:"#0c0c0c",strokeWidth:m(e)?x(e,t):g(e),cornerRadius:k(e,t)}),j=(e,t)=>{let l=Number.isFinite(t)&&t>0?t:1,n=g(e),r=Number(null==e?void 0:e.cornerRadius);return{strokeWidth:n?Math.max(1,Math.round(n*l)):0,cornerRadius:Number.isFinite(r)&&r>0?Math.round(r*l):0}},A=e=>{var t,l;let r=m(e),o=null!=(l=null!=(t=r?v(null==e?void 0:e.stroke):v(null==e?void 0:e.fill))?t:v(null==e?void 0:e.stroke))?l:n;return{thickness:Math.max(1,r?g(e):x({strokeWidth:24},e)),color:o}}},33089:(e,t,l)=>{"use strict";l.d(t,{A6:()=>f,OV:()=>c,UG:()=>p,ae:()=>i,cW:()=>d,dA:()=>s,eX:()=>y,h_:()=>k,sf:()=>u,vK:()=>b,wG:()=>v,z_:()=>g});var n=l(86887),r=l(28586);let o="hlstBackgroundImage",a="hlstBackgroundSource",i=r.ie.OPEN_BACKGROUND_PANEL,s=e=>{var t,l;let n=u(e.activePage);(null==n?void 0:n.id)&&(null==(t=e.selectElements)||t.call(e,[n.id])),null==(l=e.openSidePanel)||l.call(e,"custombackground"),window.dispatchEvent(new Event(i))},c=e=>{var t;return(null==e?void 0:e.type)==="image"&&!!(null==(t=e.custom)?void 0:t[o])},u=e=>{var t;return(null==e||null==(t=e.children)?void 0:t.find(e=>c(e)))||null},d=(e,t)=>{let l=(null==e?void 0:e.computedBleed)||{},n=Number(null==e?void 0:e.bleed)||0,r=e=>{let t=Number(e);return Number.isFinite(t)?t:n},o={left:r(l.left),right:r(l.right),top:r(l.top),bottom:r(l.bottom)};return{x:-o.left,y:-o.top,width:((null==e?void 0:e.computedWidth)||(null==t?void 0:t.width)||1)+o.left+o.right,height:((null==e?void 0:e.computedHeight)||(null==t?void 0:t.height)||1)+o.top+o.bottom}},p=e=>{var t;let l=u(e);return l&&(null==(t=e.children)?void 0:t[0])!==l&&l.moveBottom(),l},h=e=>((null==e?void 0:e.children)||[]).filter(e=>!c(e)),f=(e,t)=>{var l,n;let r=new Set(t);if(!r.size)return!1;let o=u(e);if(!o)return null!=(n=null==e||null==(l=e.canMoveElementsDown)?void 0:l.call(e,[...t]))&&n;if(r.has(o.id))return!1;let a=h(e);return a.some((e,t)=>r.has(e.id)&&t>0&&!r.has(a[t-1].id))},g=(e,t)=>{var l,n;let r=new Set(t);if(!r.size)return!1;let o=u(e);if(!o)return null!=(n=null==e||null==(l=e.canMoveElementsBottom)?void 0:l.call(e,[...t]))&&n;if(r.has(o.id))return!1;let a=h(e),i=a.filter(e=>r.has(e.id)).length;return!!i&&a.slice(0,i).some(e=>!r.has(e.id))},m=(e,t)=>{var l;(null==(l=e.history)?void 0:l.transaction)?e.history.transaction(t):t()},v=(e,t)=>{let l=e.activePage;if(l&&f(l,t)){if(!u(l))return void l.moveElementsDown([...t]);m(e,()=>{l.moveElementsDown([...t]),p(l)})}},b=(e,t)=>{let l=e.activePage;if(l&&g(l,t)){if(!u(l))return void l.moveElementsBottom([...t]);m(e,()=>{l.moveElementsBottom([...t]),p(l)})}},y=e=>{var t;let l=null==e||null==(t=e.custom)?void 0:t[a];if("images"===l||"uploads"===l)return l;let n=String((null==e?void 0:e.src)||"");return/(?:images\.unsplash\.com|\/proxy\/unsplash\/)/i.test(n)?"images":"uploads"},x=async(e,t,l)=>{let r=t&&l?{width:t,height:l}:null;try{let t=await Promise.race([(0,n.pG)(e),new Promise(e=>setTimeout(()=>e(null),4e3))]);return(null==t?void 0:t.width)&&(null==t?void 0:t.height)?t:r}catch(e){return r}},k=async e=>{var t;
1let{store:l,src:r,sourceWidth:i,sourceHeight:s,source:u}=e;if(!r)return null;let p=await x(r,i,s),h=l.activePage;if(!h)return null;let f=d(h,l),g=p?(0,n.$d)({width:f.width,height:f.height},p):{cropX:0,cropY:0,cropWidth:1,cropHeight:1},m=null==(t=h.children)?void 0:t.find(e=>c(e));return l.history.transaction(()=>{(e=>{if("string"!=typeof e)return!1;let t=e.trim();return!!t&&(/^(?:https?:|blob:|data:image\/|\/)/i.test(t)||/^url\(/i.test(t)||/\.(?:avif|gif|jpe?g|png|svg|webp)(?:[?#]|$)/i.test(t))})(h.background)&&h.set({background:"#ffffff"});let e={src:r,...f,rotation:0,keepRatio:!1,stretchEnabled:!1,draggable:!1,resizable:!1,selectable:!1,contentEditable:!0,styleEditable:!0,...g};m?m.set({...e,custom:{...m.custom||{},[o]:!0,[a]:u}}):m=h.addElement({type:"image",name:"Фон",custom:{[o]:!0,[a]:u},...e}),null==m||m.moveBottom()}),(null==m?void 0:m.id)&&l.selectElements([m.id]),m||null}},37473:(e,t,l)=>{"use strict";l.d(t,{At:()=>j,FO:()=>w,Hr:()=>m,L_:()=>h,hh:()=>g,j:()=>f,ys:()=>C});var n=l(75933),r=l(2879),o=l(55342),a=l(37824),i=l(23008),s=l(67773),c=l(33089),u=l(89804),d=l(60824);let p=e=>{var t,l;if(!e)return"";if((0,c.OV)(e))return"background";switch(e.type){case"svg":if((0,u.IH)(e))return"chart";if((0,u.WX)(e))return"svg-table";if("barcode"===e.name||(null==(t=e.custom)?void 0:t.format))return"barcode";if("qr"===e.name)return"qr";return"svg";case"image":return(0,n.OP)(e)?"emoji":"image";case"group":return(0,o.Si)(e)?"lib-table":"group";default:return String(null!=(l=e.type)?l:"")}},h=e=>Array.from(new Set((null!=e?e:[]).map(p))).sort().join("+"),f=e=>!!(null==e?void 0:e.length)&&!(1===e.length&&(0,c.OV)(e[0])),g=e=>(null==e?void 0:e.length)===1&&((0,u.WX)(e[0])||(0,u.IH)(e[0])),m=(e,t)=>({element:f(e),kind:t?h(e):null}),v=new Set(["text","image","svg","figure","line"]),b=e=>{let t=1===e.length?e[0]:void 0;return(null==t?void 0:t.type)==="image"&&!!t.contentEditable&&!t._cropModeEnabled&&!(0,c.OV)(t)},y=e=>1===e.length&&((0,u.WX)(e[0])||(0,u.IH)(e[0])),x=new Map([["font",(e,t)=>(e=>{let{texts:t,tables:l}=(0,r.EK)(e);return t.length>0||l.length>0})(t)],["element-effects",(e,t)=>(e=>{var t;let l=null==(t=e[0])?void 0:t.type;return v.has(l)&&e.every(e=>e.type===l&&!(e=>(0,u.IH)(e)||(0,u.At)(e))(e)&&!(0,c.OV)(e))})(t)],["element-masks",(e,t)=>b(t)],["custom-clip",(e,t)=>b(t)],["element-color",(e,t)=>1===t.length&&!!(0,s.W)(e,(0,i.jX)(),t[0])],["studio-colors",(e,t)=>y(t)],["studio-font",(e,t)=>y(t)],["ai-replace",(e,t)=>1===t.length&&(0,a.AV)(t[0])],["settings",()=>!0]]),k=(e,t)=>{var l,n;return!!(null==(l=x.get(t))?void 0:l(e,null!=(n=e.selectedElements)?n:[]))},w=(e,t)=>!x.has(t)||k(e,t);(0,d.Qm)(w);let C=(e,t,l)=>{var n;let r=null!=(n=e.selectedElements)?n:[];return!!(null==l?void 0:l.element)&&!!f(r)&&(null===l.kind||l.kind===h(r))&&k(e,t)},j=(e,t,l)=>{var n;if(!l)return!1;let r=null==(n=e.getElementById)?void 0:n.call(e,l);return!(r&&(0,c.OV)(r))&&C(e,t,{element:!0,kind:null})}},37824:(e,t,l)=>{"use strict";l.d(t,{AV:()=>h,L_:()=>m,RA:()=>f,VL:()=>g,Xn:()=>i,g4:()=>p});var n=l(14232),r=l(75933),o=l(60824),a=l(89804);let i="ai-replace",s=null,c=new Set,u=()=>c.forEach(e=>e()),d=e=>(c.add(e),()=>{c.delete(e)}),p=()=>(0,n.useSyncExternalStore)(d,()=>s,()=>null),h=e=>{var t;return!!e&&"string"==typeof e.src&&!!e.src&&("image"===e.type?!(0,r.OP)(e):!("svg"!==e.type||(0,a.IH)(e)||(0,a.At)(e))&&!((null==(t=e.custom)?void 0:t.format)||"qr"===e.name||"barcode"===e.name))},f=(e,t)=>{var l;let n=e.openedSidePanel||"";s={elementId:t.id,returnPanel:n===i?null!=(l=null==s?void 0:s.returnPanel)?l:null:n},u(),(0,o._K)(e,i)},g=e=>{s&&s.elementId!==e&&(s={...s,elementId:e},u())},m=e=>{let t=s;s=null,u(),(e.openedSidePanel||"")===i&&((null==t?void 0:t.returnPanel)?e.openSidePanel(t.returnPanel):(0,o.Oy)(e))}},42983:(e,t,l)=>{"use strict";l.d(t,{JW:()=>o,dC:()=>a});let n=e=>e.replace(/<[^>]+>/g,"").replace(/&nbsp;/g," ").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;|&apos;/g,"'").replace(/&amp;/g,"&"),r=e=>{var t,l;return null!=(l=null==(t=new DOMParser().parseFromString("<!DOCTYPE html><body>".concat(e),"text/html").body)?void 0:t.textContent)?l:""},o=e=>e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");function a(e){var t;return t="undefined"==typeof DOMParser?n:r,e?-1===e.indexOf("<")?-1===e.indexOf("&")?e:t(e):t(e.replace(/<\s*br\s*\/?>/gi,"\n").replace(/<\/\s*(?:p|div|li|h[1-6]|blockquote)\s*>/gi,"\n")).replace(/\n{3,}/g,"\n\n").replace(/\s+$/g,""):""}},46697:e=>{e.exports={panelRoot:"panelBase_panelRoot__3Od82",panelScroll:"panelBase_panelScroll__KInjI",panelDivider:"panelBase_panelDivider__gevV_",panelSectionHeader:"panelBase_panelSectionHeader__FRpVE",panelSectionHeaderStatic:"panelBase_panelSectionHeaderStatic__XghnW",panelChevron:"panelBase_panelChevron__L6v3c",panelFieldLabel:"panelBase_panelFieldLabel___gY2R",panelEyedropper:"panelBase_panelEyedropper__FhoDg"}},47116:(e,t,l)=>{"use strict";l.d(t,{AY:()=>c,NQ:()=>s,o6:()=>d,s7:()=>p,t:()=>u});var n=l(68117),r=l(33982),o=l(42983),a=l(74035);function i(e){let t=(0,r.xN)();if(!t||t.store!==e||!t.instance)return null;let l=t.instance.getSelection?t.instance.getSelection():null;if(l&&l.length>0)return{instance:t.instance,range:{index:l.index,length:l.length}};let n=t.lastSelection;return n&&n.length>0?{instance:t.instance,range:{index:n.index,length:n.length}}:null}function s(e,t,l,n){let o;if("string"==typeof(o=t.fill)&&o.includes("gradient"))return void l();if(n||!i(e))l();else{let l=i(e);if(l)try{l.instance.setSelection(l.range.index,l.range.length,"silent")}catch(e){}(0,r.wz)(e).applyTextFormat(t)}}function c(e){return(0,o.dC)(e)}function u(e){return(0,o.JW)(e)}function d(e,t){if(Number.isFinite(t)&&!(t<=0))for(let l=0;l<e.length;l+=1){let r=e[l];"text"===r.type&&"string"==typeof r.text&&"function"==typeof r.set?(0,n.Ti)(r,{fontSize:t}):r.set({fontSize:t})}}function p(e,t){if(!Number.isFinite(t)||t<=0)return;let l={fontSize:t},n=t/e.fontSize;if("string"==typeof e.text&&Number.isFinite(n)&&n>0){let t=(0,a.BO)(e.text,n);t!==e.text&&(l.text=t)}e.set(l)}},55342:(e,t,l)=>{"use strict";l.d(t,{Nc:()=>c,Si:()=>r,TP:()=>n,bY:()=>d,jI:()=>i,uh:()=>a,xZ:()=>s});let n=e=>!!(null==e?void 0:e.lt)&&"string"==typeof e.lt.design&&"number"==typeof e.lt.v&&e.lt.v>=1,r=e=>!!e&&"group"===e.type&&n(e.custom),o=e=>r(e)?e.custom.lt:null,a=e=>{if(r(e))return e;let t=null==e?void 0:e.top;return t&&r(t)?t:null},i=e=>
1{let t=o(e);return!!t&&("rows"===t.axis||"both"===t.axis)},s=e=>{let t=o(e);return!!t&&("cols"===t.axis||"both"===t.axis)},c=e=>{var t,l;let n=new Set,r=new Set,o=-1,a=-1;for(let i of null!=(t=null==e?void 0:e.children)?t:[]){let e=null==i||null==(l=i.custom)?void 0:l.lt;e&&"cell"===e.role&&("number"==typeof e.r&&e.r>=0&&(n.add(e.r),o=Math.max(o,e.r)),"number"==typeof e.c&&(r.add(e.c),a=Math.max(a,e.c)))}return{rows:n.size,cols:r.size,canRemoveRow:o>=1,canRemoveColumn:a>=2}},u=()=>({has:!1,dash:[],width:2}),d=e=>{var t,l,n;let r={rows:u(),cols:u(),frame:u(),canRows:!1,canCols:!1},o=new Set,a=new Set,i=(e,t,l)=>{e.has||(e.has=!0,e.dash=Array.isArray(t)?Array.from(t):[],e.width=Number(l)>0?Number(l):2)};for(let s of null!=(t=null==e?void 0:e.children)?t:[]){let e=null==s||null==(l=s.custom)?void 0:l.lt;e&&("cell"===e.role?("number"==typeof e.r&&o.add(e.r),"number"==typeof e.c&&a.add(e.c)):"hline"===e.role&&"line"===s.type?i(r.rows,s.dash,s.height):"vline"===e.role&&"line"===s.type?i(r.cols,s.dash,s.height):"frame"===e.role&&"figure"===s.type&&(null!=(n=s.strokeWidth)?n:0)>0&&i(r.frame,s.dash,s.strokeWidth))}return r.canRows=o.size>=2,r.canCols=a.size>=2,r}},61188:(e,t,l)=>{"use strict";l.d(t,{JM:()=>s,Rr:()=>i,Sr:()=>a,US:()=>r,c1:()=>o});var n=l(37876);l(14232);let r=()=>(0,n.jsx)("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M6 6L18 18M18 6L6 18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),o=()=>(0,n.jsx)("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),a=()=>(0,n.jsx)("svg",{focusable:"false",preserveAspectRatio:"xMidYMid meet","aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M13 24 4 15 5.414 13.586 13 21.171 26.586 7.586 28 9 13 24z"})}),i=e=>{let{size:t=15}=e;return(0,n.jsx)("svg",{"aria-hidden":"true",focusable:"false",preserveAspectRatio:"xMidYMid meet",fill:"currentColor",width:t,height:t,viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M22.59,19.41,26.17,23H19.55l-4.37-7,4.37-7h6.62l-3.58,3.59L24,14l6-6L24,2,22.59,3.41,26.17,7H19.55a2,2,0,0,0-1.69.94L14,14.11,10.14,7.94A2,2,0,0,0,8.45,7H2V9H8.45l4.37,7L8.45,23H2v2H8.45a2,2,0,0,0,1.69-.94L14,17.89l3.86,6.17a2,2,0,0,0,1.69.94h6.62l-3.58,3.59L24,30l6-6-6-6Z"})})},s=e=>{let{size:t=18}=e;return(0,n.jsxs)("svg",{focusable:"false",preserveAspectRatio:"xMidYMid meet",fill:"currentColor",width:t,height:t,viewBox:"0 0 32 32","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("path",{d:"M6 18 7.41 19.41 15 11.83 15 30 17 30 17 11.83 24.59 19.41 26 18 16 8 6 18z"}),(0,n.jsx)("path",{d:"M6,8V4H26V8h2V4a2,2,0,0,0-2-2H6A2,2,0,0,0,4,4V8Z"})]})}},62822:(e,t,l)=>{"use strict";l.d(t,{V:()=>s});var n=l(63510),r=l(14232),o=l(92494),a=l(88934);let i=new Map,s=e=>{let t=e?(0,a.j7)(e):[],l=t.join("\n"),[s,c]=r.useState({});return r.useEffect(()=>{let e=!1;return t.length?(Promise.all(t.map(e=>(e=>{let t=i.get(e);if(t)return t;let l=n.urlToString(e).then(e=>(0,a.Pk)((0,o.M)(e))).catch(()=>(i.delete(e),[]));return i.set(e,l),l})(e).then(t=>[e,t]))).then(t=>{e||c(Object.fromEntries(t))}),()=>{e=!0}):void c({})},[l]),s}},67773:(e,t,l)=>{"use strict";l.d(t,{W:()=>u});var n=l(47116),r=l(28506),o=l(88934),a=l(55342),i=l(89804);let s=(e,t)=>"string"==typeof e&&e?e:t,c=(e,t,l)=>{let n=(0,o.ac)(l)[0];return n?{targetId:t.id,value:n.color,allowGradient:!0,mode:"libtable",follow:!0,apply:t=>void(0,o.tM)(e,l,n,t)}:null},u=(e,t,l)=>{if(!(null==t?void 0:t.follow)||!t.targetId||!(null==l?void 0:l.id))return null;if("libtable"===t.mode){let t=(0,a.uh)(l);if(t)return c(e,l,t)}return((e,t)=>{if(!(null==t?void 0:t.id))return null;let l={targetId:t.id,allowGradient:!0,follow:!0};switch(t.type){case"text":return{...l,value:s(t.fill,"#000000"),apply:l=>(0,n.NQ)(e,{fill:l},()=>{var n,r;return null==(r=e.history)||null==(n=r.transaction)?void 0:n.call(r,()=>t.set({fill:l}))})};case"line":return{...l,value:s(t.color,"#000000"),apply:e=>t.set({color:e})};case"figure":{let e=(0,r.fD)(t)?"stroke":"fill";return{...l,value:s(t[e],"#000000"),apply:l=>t.set({[e]:l})}}case"svg":if((0,i.IH)(t)||(0,i.At)(t)||"function"!=typeof t.replaceColor)return null;return{...l,value:"",apply:()=>void 0};case"group":return(0,a.Si)(t)?c(e,t,t):null;default:return null}})(e,l)}},72187:(e,t,l)=>{"use strict";l.d(t,{X1:()=>en,bu:()=>ee,Ay:()=>er,Ix:()=>X});var n=l(37876),r=l(93975),o=l(76732),a=l(49995),i=l(5811),s=l(63510),c=l(14232),u=l(49578),d=l(52873),p=l(92494),h=l(83222),f=l(61188),g=l(11333),m=l(79459),v=l(37473),b=l(88934),y=l(55342),x=l(62822),k=l(99763),w=l(46003),C=l(73812),j=l(18232),A=l(76542),N=l(13581),_=l.n(N),S=l(69330),M=l(23008),E=l(18245),O=l(48211),P=l.n(O),D=l(65293),I=l(5865),T=l(22631);let R=new Map,F=e=>Math.max(0,Math.min(255,Math.round(e))).toString(16).padStart(2,"0"),L=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,l="".concat(t,"|").concat(e),n=R.get(l);if(n)return n;let r=new Promise(l=>{if("undefined"==typeof document)return void l([]);let n=new Image;n.crossOrigin="anonymous";let r=!1,o=e=>{r||(r=!0,window.clearTimeout(a),l(e))},a=window.setTimeout(()=>
1o([]),4e3);n.onload=()=>{try{let e=n.naturalWidth||1,l=n.naturalHeight||1,r=Math.min(1,48/Math.max(e,l)),a=Math.max(1,Math.round(e*r)),i=Math.max(1,Math.round(l*r)),s=document.createElement("canvas");s.width=a,s.height=i;let c=s.getContext("2d",{willReadFrequently:!0});if(!c)return void o([]);c.drawImage(n,0,0,a,i);let u=c.getImageData(0,0,a,i).data,d=new Map;for(let e=0;e<u.length;e+=4){if(u[e+3]<128)continue;let t=u[e],l=u[e+1],n=u[e+2],r=t>>4<<8|l>>4<<4|n>>4,o=d.get(r);o?(o.n+=1,o.r+=t,o.g+=l,o.b+=n):d.set(r,{n:1,r:t,g:l,b:n})}let p=Array.from(d.values()).sort((e,t)=>t.n-e.n).map(e=>({r:e.r/e.n,g:e.g/e.n,b:e.b/e.n})),h=[];for(let e of[64,32,0]){for(let l of p){if(h.length>=t)break;!h.includes(l)&&h.every(t=>Math.hypot(t.r-l.r,t.g-l.g,t.b-l.b)>=e)&&h.push(l)}if(h.length>=t)break}o(h.map(e=>"#".concat(F(e.r)).concat(F(e.g)).concat(F(e.b))))}catch(e){o([])}},n.onerror=()=>o([]),n.src=e});return R.set(l,r),r};var B=l(67773),H=l(8569),W=l(46697),V=l.n(W);let G=e=>e.includes("gradient"),z=[],q=e=>{let t=e.trim().toLowerCase();if("transparent"===t)return!0;try{return 0===(0,o.Ay)(t).alpha()}catch(e){return!1}},$=(e,t)=>{if(!e||!t)return!1;let l=e.trim().toLowerCase(),n=t.trim().toLowerCase();if(l===n)return!0;if(G(l)||G(n))return!1;if(q(l)||q(n))return q(l)&&q(n);try{return(0,o.Ay)(l).hex()===(0,o.Ay)(n).hex()&&(0,o.Ay)(l).alpha()===(0,o.Ay)(n).alpha()}catch(e){return!1}},X=e=>{if(q(e))return"Прозрачный";if(G(e))return"Градиент";try{return(0,o.Ay)(e).hex().toUpperCase()}catch(t){return e}},K=e=>{if("string"!=typeof e||!e)return null;if(G(e)){let t=e.match(/#[0-9a-fA-F]{3,8}|rgba?\([^)]*\)/g)||[];if(!t.length)return null;try{return o.Ay.average(t).hex()}catch(e){return null}}try{if(.9>(0,o.Ay)(e).alpha())return null;return e}catch(e){return null}},Y=/(color:\s*)(#[0-9a-fA-F]{3,8}|rgba?\([^)]*\))/g,J="Вставьте HEX: 4F46E5",U={border:"none",outline:"none",boxShadow:"none"},Q=/^([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,Z=e=>{let{colors:t,activeValue:l,onPick:r,portalClassName:o}=e;return(0,n.jsx)("div",{className:_().grid,children:t.map((e,t)=>(0,n.jsx)(A.A,{content:X(e),position:"top",compact:!0,hoverOpenDelay:150,portalClassName:o,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,$(e,l)&&_().cubeOn),style:{background:e},"aria-label":X(e),onMouseDown:e=>e.preventDefault(),onClick:()=>r(e)})},"".concat(e,"-").concat(t)))})},ee=e=>{var t,l;let{slots:r,activeKey:o,onPick:i,renderTip:s,portalClassName:c,label:u,action:p,onAdd:h,addLabel:f}=e,g=(null==(l=(0,d.S)("design"))||null==(t=l.polotno)?void 0:t.toolbar)||{},m=u||g.replaceColors||"Цвета для замены";if(!r.length)return null;let v=f||"Добавить цвет";return(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{action:p,children:m}),(0,n.jsxs)("div",{className:_().grid,children:[r.map(e=>(0,n.jsx)(el,{slot:e,active:e.key===o,onPick:()=>i(e.key),renderTip:s,portalClassName:c},e.key)),h&&(0,n.jsx)(A.A,{content:v,position:"top",compact:!0,hoverOpenDelay:150,portalClassName:c,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,_().cubeTool,_().cubeAdd),style:{background:"linear-gradient(var(--background-01), var(--background-01)) padding-box, ".concat(H.N," border-box")},"aria-label":v,onMouseDown:e=>e.preventDefault(),onClick:h,children:(0,n.jsx)(w.c1,{size:16})})})]})]})},et=e=>{var t,l;let{colors:r,gradient:o,active:i,onPick:s}=e,c=(null==(l=(0,d.S)("design"))||null==(t=l.polotno)?void 0:t.toolbar)||{},u=c.gradientColors||"Цвета градиента",p=c.wholeGradient||"Весь градиент";return(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:u}),(0,n.jsxs)("div",{className:_().grid,children:[r.map((e,t)=>(0,n.jsx)(A.A,{content:X(e),position:"top",compact:!0,hoverOpenDelay:150,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,t===i&&_().cubeOn),style:{background:e},"aria-label":"".concat(u,": ").concat(X(e)),"aria-pressed":t===i,onMouseDown:e=>e.preventDefault(),onClick:()=>s(t)})},"".concat(e,"-").concat(t))),(0,n.jsx)(A.A,{content:p,position:"top",compact:!0,hoverOpenDelay:150,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,"all"===i&&_().cubeOn),style:{background:o},"aria-label":p,"aria-pressed":"all"===i,onMouseDown:e=>e.preventDefault(),onClick:()=>s("all")})})]})]})},el=e=>{var t;let{slot:l,active:o,onPick:i,renderTip:s,portalClassName:u}=e,[d,p]=c.useState(!1),h=c.useRef(null),f=()=>{h.current&&clearTimeout(h.current),h.current=setTimeout(()=>p(!0),90)},g=()=>{h.current&&(clearTimeout(h.current),h.current=null),p(!1)};c.useEffect(()=>()=>{h.current&&clearTimeout(h.current)},[]);let m=q(l.color),v=null!=(t=l.tip)?t:"".concat(l.label,": ").concat(X(l.color)),b=(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,m&&_().cubeTransparent,o&&_().cubeOn),style:m?void 0:{background:l.color},"aria-label":v,"aria-pressed":o,onMouseDown:e=>e.preventDefault(),onClick:i});return s?(0,n.jsx)(r.A,{isOpen:d,minimal:!0,placement:"top",portalClassName:u,modifiers:{offset:{options:{offset:[0,8]}}},content:(0,n.jsx)(n.Fragment,{children:s(l)}),renderTarget:e=>{let{ref:t}=e;return(0,n.jsx)("span",{ref:t,className:_().slotTipTarget,onMouseEnter:f,onMouseLeave:g,children:b})}}):(0,n.jsx)(A.A,{content:v,position:"top",compact:!0,hoverOpenDelay:150,portalClassName:u,children:b})},en=(0,i.PA)(e=>{var t,l,r;let{store:i,value:s,allowGradient:p,showTransparent:v,onApply:b,shuffle:y,beforeSections:x,headSections:k,snapshotKey:C,ownColors:N,suggested:M,hideBrand:O,tipPortalClassName:T,dense:R,pinValue:F,openPicker:B,layout:W="grid"}=e,V=(0,d.S)("design"),z=(null==V||null==(t=V.polotno)?void 0:t.toolbar)||{},K="strip"===W,Y=c.useRef(null),[ee,et]=c.useState(!!B),[el,en]=c.useState(null),[er,eo]=c.useState(null),[ea,ei]=c.useState(2),[es,ec]=c.useState([]),[eu,ed]=c.useState(""),{hasColors:ep,colors:eh,gradients:ef}=(0,m.A)(),eg=e=>{(!G(e)||p)&&b(e)},em=e=>{"picker"!==e&&et(!1),"base"!==e&&en(null),"cat"!==e&&(eo(null),ec([]))},ev=e=>{em(),eg(e)},eb=c.useRef({key:"",pool:[],idx:-1}),ey=eu.trim().replace(/^#/,""),ex=Q.test(ey),ek=()=>{ex&&(eg("#".concat(ey.toLowerCase())),ed(""))},ew=c.useMemo(()=>
1N?[]:(0,E.K)(i),[C,!!N,s]),eC=N?N.colors:ew,ej=c.useMemo(()=>(e=>{var t;let l=[],n=e=>{e&&("image"===e.type&&"string"==typeof e.src&&e.src&&l.push(e.src),e.children&&e.children.forEach(n))};return((null==e||null==(t=e.activePage)?void 0:t.children)||[]).forEach(n),Array.from(new Set(l)).slice(0,4)})(i),[C,null==i||null==(l=i.activePage)?void 0:l.id]),eA=ej.join("|"),[eN,e_]=c.useState([]);c.useEffect(()=>{let e=!1;return ej.length?(Promise.all(ej.map(e=>L(e,7).then(t=>({src:e,colors:t})))).then(t=>{e||e_(t.filter(e=>e.colors.length>0))}),()=>{e=!0}):void e_([])},[eA]);let eS=p?eC:eC.filter(e=>!G(e)),eM=F&&!q(s)&&(G(s)?p:o.Ay.valid(s))?s:null,eE=eM&&("missing"!==F||!eS.some(e=>$(e,eM)))?eM:null,eO=eE?eS.filter(e=>!$(e,eE)):eS,eP=ep&&!O?[...g.o.map(e=>{var t;return null==(t=eh.find(t=>t.role===e))?void 0:t.rgba}).filter(Boolean),...p?ef:[]]:[],eD=el?[...(0,S.JL)(el),...(0,S.f0)(el)]:[];c.useEffect(()=>{et(!!B),en(null),eo(null),ec([])},[C]),c.useEffect(()=>{K&&Y.current&&(Y.current.scrollLeft=0)},[K,el]);let eI=z.customColor||"Свой цвет",eT=z.eyedropperHint||"Пипетка: выберите цвет с экрана",eR=z.transparentColor||"Прозрачный",eF=z.shuffleColor||"Перемешать цвет",eL=(e,t)=>(0,n.jsx)(A.A,{content:X(e),position:"top",compact:!0,hoverOpenDelay:150,portalClassName:T,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,$(e,s)&&_().cubeOn),style:{background:e},"aria-label":X(e),onMouseDown:e=>e.preventDefault(),onClick:()=>ev(e)})},t),eB=(0,n.jsx)(A.A,{content:eI,position:"top",compact:!0,hoverOpenDelay:150,portalClassName:T,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,_().cubeTool,_().cubeCustom,ee&&_().cubeToolOn),style:{background:H.N},"aria-label":eI,"aria-expanded":ee,onMouseDown:e=>e.preventDefault(),onClick:()=>{em("picker"),et(e=>!e)},children:(0,n.jsx)(w.v1,{size:18})})}),eH=(0,n.jsx)(A.A,{content:eT,position:"top",compact:!0,hoverOpenDelay:150,portalClassName:T,children:(0,n.jsx)(D.A,{className:(0,a.A)(_().cube,_().cubeTool),ariaLabel:eT,preferNative:!0,onPick:ev})}),eW=y?(0,n.jsx)(A.A,{content:eF,position:"top",compact:!0,hoverOpenDelay:150,portalClassName:T,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,_().cubeTool),"aria-label":eF,onMouseDown:e=>e.preventDefault(),onClick:()=>{var e,t;if(!y)return;em();let l=y.backdrop(),n=[],r=e=>{!(G(e)||q(e))&&(n.some(t=>$(t,e))||n.push(e))};if((null!=(t=null==(e=y.pool)?void 0:e.call(y))?t:[]).forEach(r),y.poolOnly&&n.length>=6||(eP.forEach(r),eN.forEach(e=>e.colors.forEach(r)),eC.forEach(r),S.V8.forEach(r),S.V8.forEach(e=>{(0,S.JL)(e).forEach((e,t)=>{t%3==1&&r(e)})})),!n.length)return;let a=n;if(l){let e=n.filter(e=>o.Ay.contrast(e,l)>=y.contrastTarget);a=(a=e.length>=3?e:n.map(e=>(0,h.ag)(e,l,y.contrastTarget))).filter((e,t)=>a.findIndex(t=>$(t,e))===t)}if(!a.length)return;let i="".concat(y.key||"","|").concat(l||"free","|").concat(a.length);if(eb.current.key!==i){let e=[...a];for(let t=e.length-1;t>0;t-=1){let l=Math.floor(Math.random()*(t+1));[e[t],e[l]]=[e[l],e[t]]}eb.current={key:i,pool:e,idx:-1}}let c=eb.current;for(let e=0;e<c.pool.length;e+=1){c.idx=(c.idx+1)%c.pool.length;let e=c.pool[c.idx];if(!$(e,s))return void eg(e)}},children:(0,n.jsx)(f.Rr,{size:18})})}):null,eV=v?(0,n.jsx)(A.A,{content:eR,position:"top",compact:!0,hoverOpenDelay:150,portalClassName:T,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,_().cubeTool,_().cubeTransparent,q(s)&&_().cubeToolOn),"aria-label":eR,onMouseDown:e=>e.preventDefault(),onClick:()=>ev("transparent")})}):null,eG=ee?(0,n.jsx)(E.A,{portalClassName:T,inline:!0,pickerOnly:!0,size:16,value:s,allowGradient:p,onChange:eg,store:i}):null;if(K){let e=(null!=(r=null==M?void 0:M.colors)?r:[]).filter(e=>!eS.some(t=>$(t,e))),t=function(e,t,l){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,$(e,s)&&_().cubeOn),style:{background:e},"aria-label":X(e),"aria-haspopup":r||void 0,onMouseDown:e=>e.preventDefault(),onClick:l},t)};return(0,n.jsxs)("div",{className:_().content,children:[k,x,(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)("div",{ref:Y,className:_().strip,children:(0,n.jsx)("div",{className:_().stripStage,children:el?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,_().cubeTool,_().cubeBack),"aria-label":"К цветам",onMouseDown:e=>e.preventDefault(),onClick:()=>en(null),children:(0,n.jsx)(w.YJ,{size:20})}),eD.map((e,l)=>t(e,"shade-".concat(l),()=>eg(e)))]}):(0,n.jsxs)(n.Fragment,{children:[eB,eH,eW,eE&&eL(eE,"pinned"),eV,eO.map((e,t)=>eL(e,"own-".concat(e,"-").concat(t))),e.map((e,t)=>eL(e,"suggested-".concat(e,"-").concat(t))),S.V8.map(e=>t(e,"base-".concat(e),()=>{em("base"),eg(e),en(e)},!0))]})},null!=el?el:"root")}),eG]})]})}return(0,n.jsxs)("div",{className:_().content,"data-dense":R?"1":void 0,children:[k,(0,n.jsx)("div",{className:_().hexBar,children:(0,n.jsxs)("div",{className:_().hexField,children:[(0,n.jsx)("span",{className:_().hexPrefix,"aria-hidden":"true",children:"#"}),(0,n.jsx)("input",{className:_().hexInput,style:U,placeholder:J,"aria-label":J,value:eu,spell
1Check:!1,autoComplete:"off",onChange:e=>ed(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ek()}}),ex?(0,n.jsx)("button",{type:"button",className:_().hexAdd,"aria-label":"Добавить цвет",onClick:ek,children:(0,n.jsx)(w.Sr,{size:12})}):eu&&(0,n.jsx)("button",{type:"button",className:_().hexClear,"aria-label":"Очистить поле HEX",onClick:()=>ed(""),children:(0,n.jsx)(w.w0,{strokeWidth:1.7,size:10})})]})}),x,(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:N?N.label:z.documentColors||"Цвета документа"}),(0,n.jsxs)("div",{className:_().grid,children:[eB,eH,eW,eE&&eL(eE,"pinned"),eV,eO.map((e,t)=>eL(e,"".concat(e,"-").concat(t)))]}),eG]}),eP.length>0&&(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:z.brandColors||"Фирменный стиль"}),(0,n.jsx)(Z,{colors:eP,activeValue:s,onPick:ev,portalClassName:T})]}),M&&M.colors.length>0&&(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:M.label}),(0,n.jsx)(Z,{colors:M.colors,activeValue:s,onPick:ev,portalClassName:T})]}),eN.length>0&&(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:z.photoColors||"Цвета с фото"}),eN.map(e=>{let{src:t,colors:l}=e;return(0,n.jsxs)("div",{className:_().grid,children:[(0,n.jsx)("div",{className:(0,a.A)(_().cube,_().cubePhoto),style:{backgroundImage:'url("'.concat(t,'")')},"aria-hidden":"true"}),l.map((e,t)=>(0,n.jsx)(A.A,{content:X(e),position:"top",compact:!0,hoverOpenDelay:150,portalClassName:T,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,$(e,s)&&_().cubeOn),style:{background:e},"aria-label":X(e),onMouseDown:e=>e.preventDefault(),onClick:()=>ev(e)})},"".concat(e,"-").concat(t)))]},t)})]}),(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:z.solidColors||"Сплошные цвета"}),(0,n.jsx)("div",{className:_().grid,children:S.V8.map(e=>(0,n.jsx)(A.A,{content:X(e),position:"top",compact:!0,hoverOpenDelay:150,portalClassName:T,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,el===e&&_().cubeToolOn),style:{background:e},"aria-label":X(e),"aria-expanded":el===e,onMouseDown:e=>e.preventDefault(),onClick:()=>(e=>{em("base"),en(t=>t===e?null:e)})(e)})},e))}),eD.length>0&&(0,n.jsx)(Z,{colors:eD,activeValue:s,portalClassName:T,onPick:e=>{em("base"),eg(e)}})]}),p&&(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:z.gradients||"Градиенты"}),(0,n.jsx)("div",{className:_().grid,children:u.gradientCategories.map((e,t)=>(0,n.jsx)(A.A,{content:e.name,position:"top",compact:!0,hoverOpenDelay:150,portalClassName:T,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,er===t&&_().cubeToolOn),style:{background:"linear-gradient(45deg, ".concat(e.subcategories[0].baseColors[0],", ").concat(e.subcategories[0].baseColors[1],")")},"aria-label":e.name,"aria-expanded":er===t,onMouseDown:e=>e.preventDefault(),onClick:()=>(e=>{if(em("cat"),er===e){eo(null),ec([]);return}eo(e),ec((0,I.ot)((0,I._I)(e),ea))})(t)})},t))}),null!==er&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:P().gpFilters,children:I.nH.map(e=>(0,n.jsx)("button",{type:"button",className:(0,a.A)(P().gpChip,ea===e.key&&P().gpChipOn),onClick:()=>(e=>{ei(e),null!==er&&ec((0,I.ot)((0,I._I)(er),e))})(e.key),children:e.label},e.key))}),(0,n.jsx)(Z,{colors:es,activeValue:s,portalClassName:T,onPick:e=>{em("cat"),eg(e)}})]})]})]})}),er=(0,i.PA)(e=>{var t,l,r,o,i,u,h,f;let{store:g}=e,m=(0,d.S)("design"),w=(null==m||null==(t=m.polotno)?void 0:t.toolbar)||{},N=(0,M.YS)(),[S,E]=c.useState({src:null,colors:[]}),[O,P]=c.useState(0),D=(null==N?void 0:N.targetId)?null==(l=g.getElementById)?void 0:l.call(g,N.targetId):null,I=(null==N?void 0:N.mode)==="libtable"&&D?(0,y.uh)(D):null,R=(0,x.V)(I),F=I?(0,b.ac)(I,R):[],L=!!I&&F.length>0,[H,W]=c.useState(null),J=(null==N?void 0:N.mode)==="libtable"&&N.slotKey?N:null;c.useEffect(()=>{var e;W(null!=(e=null==J?void 0:J.slotKey)?e:null)},[null==N?void 0:N.targetId,J]);let U=L?null!=(o=F.find(e=>e.key===H))?o:F[0]:null,Q=(null==D?void 0:D.type)==="svg"?D.src:null,Z=Q&&S.src===Q?S.colors:z;c.useEffect(()=>{let e=!1;if(P(0),Q)return s.urlToString(Q).then(t=>{e||E({src:Q,colors:(0,k._g)((0,p.M)(t))})}).catch(()=>{e||E({src:Q,colors:[]})}),()=>{e=!0}},[Q,null==N?void 0:N.targetId]);let el=(null==D?void 0:D.type)!=="text"||L?[]:(e=>{let t,l=[],n=e=>{l.some(t=>$(t,e))||l.push(e)};"string"==typeof(null==e?void 0:e.fill)&&e.fill&&!G(e.fill)&&n(e.fill);let r=String((null==e?void 0:e.text)||"");for(Y.lastIndex=0;t=Y.exec(r);)n(t[2]);return l})(D),er=el.length>1,[eo,ea]=c.useState(0);c.useEffect(()=>{ea(0)},[null==N?void 0:N.targetId]),c.useEffect(()=>{"all"!==eo&&eo>=el.length&&ea(0)},[eo,el.length]);let[ei,es]=c.useState(0);c.useEffect(()=>{es(0)},[null==N?void 0:N.targetId]),c.useEffect(()=>()=>(0,M.OE)(),[]);let ec=g.selectedElements.map(e=>e.id).join("|"),eu=c.useMemo(()=>{var e,t,l;let n=null!=(l=null==N?void 0:N.targetId)?l:null;return{backdrop:()=>{var e;if(!n)return null;let t=null==(e=g.getElementById)?void 0:e.call(g,n);return t?((e,t)=>{var l,n,r,o,a,i,s,c,u,d,p,h;let f=K(null==(l=e.activePage)?void 0:l.background)||"#ffffff";if(!t)return f;let g=(e=>{var t;let l=[],n=e=>{if(e&&!1!==e.visible){if("group"===e.type&&e.children)return void e.children.forEac
1h(n);l.push(e)}};return((null==e||null==(t=e.activePage)?void 0:t.children)||[]).forEach(n),l})(e),m=g.indexOf(t),v=(null!=(n=t.x)?n:0)+(null!=(r=t.width)?r:0)/2,b=(null!=(o=t.y)?o:0)+(null!=(a=t.height)?a:0)/2;for(let e=(-1===m?g.length:m)-1;e>=0;e-=1){let l=g[e];if(l===t||"figure"!==l.type||(null!=(i=l.opacity)?i:1)<.9||!(v>=(null!=(s=l.x)?s:0)&&v<=(null!=(c=l.x)?c:0)+(null!=(u=l.width)?u:0)&&b>=(null!=(d=l.y)?d:0)&&b<=(null!=(p=l.y)?p:0)+(null!=(h=l.height)?h:0)))continue;let n=K(l.fill);if(n)return n}return f})(g,t):null},contrastTarget:"text"===(n?null==(t=g.getElementById)||null==(e=t.call(g,n))?void 0:e.type:null)?4.5:1.4}},[null==N?void 0:N.targetId,g]);if(c.useEffect(()=>{var e;let t=(0,M.jX)();if(!t||!t.targetId)return;let l=1===g.selectedElements.length?null==(e=g.selectedElements[0])?void 0:e.id:null;if(!l||l!==t.targetId){if((0,v.At)(g,M.CN,t.targetId)){let e=(0,B.W)(g,t,g.selectedElements[0]);if(e)return void(0,M.uZ)(e)}(0,M.yc)(g,e=>(0,v.FO)(g,e))}},[ec,g]),!N)return null;let ed=!L&&!!D&&Z.length>0,ep=ed&&Z.length>1,eh=ed?Z.map(e=>(0,k.NB)((0,k.eI)(D),e)):[],ef=U?U.color:ed?null!=(i=eh[O])?i:N.value:er?"all"===eo?"string"==typeof(null==D?void 0:D.fill)?D.fill:N.value:null!=(u=el[eo])?u:N.value:N.value,eg=N.allowGradient&&(!U||U.allowGradient),em=eg&&G(ef)?(0,T.xS)(ef):[],ev=em.length>0,eb=ev&&"all"!==ei?em[Math.min(ei,em.length-1)]:null,ey=null!=eb?eb:ef,ex=e=>{if(!G(e)||N.allowGradient){if(U&&I){(0,b.tM)(g,I,U,e)&&W((0,b.jG)(U,e));return}if(ed&&D){var t;(0,k.wU)(D,null!=(t=Z[O])?t:Z[0],e);return}if(er&&D)return"all"===eo?void((e,t,l)=>{var n,r;let o=String(t.text||"").replace(Y,"");null==(r=e.history)||null==(n=r.transaction)||n.call(r,()=>t.set({fill:l,text:o}))})(g,D,e):void(G(e)||((e,t,l,n)=>{var r,o;let a={text:String(t.text||"").replace(Y,(e,t,r)=>$(r,l)?"".concat(t).concat(n):e)};$(t.fill,l)&&(a.fill=n),null==(o=e.history)||null==(r=o.transaction)||r.call(o,()=>t.set(a))})(g,D,el[eo],e));(0,M.O$)(e)}},ek=null==(r=g.selectedElements)?void 0:r[0],ew=U?U.transparentOk:!!N.targetId&&!!ek&&"text"!==ek.type,eC=w.closeReplaceColor||"Закрыть замену цвета",ej=w.replaceColors||"Цвета для замены",eA=w.allColors||"Все цвета",eN=L?(0,n.jsx)(ee,{slots:F,activeKey:null==U?void 0:U.key,onPick:e=>{W(e),es(0)}}):void 0,e_=ep?(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:ej}),(0,n.jsx)("div",{className:_().grid,children:eh.map((e,t)=>(0,n.jsx)(A.A,{content:X(e),position:"top",compact:!0,hoverOpenDelay:150,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,q(e)&&_().cubeTransparent,t===O&&_().cubeOn),style:q(e)?void 0:{background:e},"aria-label":X(e),"aria-pressed":t===O,onMouseDown:e=>e.preventDefault(),onClick:()=>{P(t),es(0)}})},t))})]}):void 0,eS=er?(0,n.jsxs)("div",{className:_().section,children:[(0,n.jsx)(j.L0,{children:ej}),(0,n.jsxs)("div",{className:_().grid,children:[el.map((e,t)=>(0,n.jsx)(A.A,{content:X(e),position:"top",compact:!0,hoverOpenDelay:150,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,eo===t&&_().cubeOn),style:{background:e},"aria-label":X(e),"aria-pressed":eo===t,onMouseDown:e=>e.preventDefault(),onClick:()=>{ea(t),es(0)}})},"".concat(e,"-").concat(t))),(0,n.jsx)(A.A,{content:eA,position:"top",compact:!0,hoverOpenDelay:150,children:(0,n.jsx)("button",{type:"button",className:(0,a.A)(_().cube,"all"===eo&&_().cubeOn),style:{background:"conic-gradient(from 0deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000)"},"aria-label":eA,"aria-pressed":"all"===eo,onMouseDown:e=>e.preventDefault(),onClick:()=>{ea("all"),es(0)}})})]})]}):void 0,eM=ev?(0,n.jsx)(et,{colors:em,gradient:ef,active:"all"===ei?"all":Math.min(ei,em.length-1),onPick:es}):void 0,eE=null!=(h=null!=eN?eN:e_)?h:eS;return(0,n.jsxs)("div",{className:V().panelRoot,"data-polotno-keep-focus":!0,children:[(0,n.jsx)(C.A,{title:w.replaceColor||"Заменить цвет",actionLabel:eC,onAction:()=>(0,M.yc)(g)}),(0,n.jsx)("div",{className:"".concat(V().panelScroll," ").concat(_().body),children:(0,n.jsx)(en,{store:g,value:ey,allowGradient:eg&&!eb,showTransparent:ew,onApply:e=>{if(!eb)return void ex(e);if(G(e))return;let t=(0,T.cI)(ef,eb,e);if(t&&t!==ef){if(er&&D&&"all"===eo){var l,n;null==(n=g.history)||null==(l=n.transaction)||l.call(n,()=>D.set({fill:t}));return}ex(t)}},shuffle:eu,beforeSections:eE||eM?(0,n.jsxs)(n.Fragment,{children:[eE,eM]}):void 0,pinValue:"missing",openPicker:ev&&"all"===ei,snapshotKey:"".concat(null!=(f=N.targetId)?f:"unbound","|g:").concat(ei)})})]})})},73812:(e,t,l)=>{"use strict";l.d(t,{A:()=>s});var n=l(37876),r=l(49995);l(14232);var o=l(46003),a=l(80598),i=l.n(a);let s=e=>{let{title:t,action:l="close",actionLabel:a,onAction:s,side:c="back"===l?"start":"end",size:u="panel",endContent:d,className:p}=e,h=(0,n.jsx)("button",{type:"button",className:i().control,"data-action":l,"aria-label":a,onClick:s,children:"back"===l?(0,n.jsx)(o.YJ,{size:22}):(0,n.jsx)(o.$v,{size:22})});return(0,n.jsxs)("div",{className:(0,r.A)(i().panelHeader,"inline"===u?i().inline:i().panel,"end"===c&&i().sideEnd,p),children:["start"===c&&h,(0,n.jsx)("span",{className:i().title,children:t}),d,"end"===c&&h]})}},75933:(e,t,l)=>{"use strict";l.d(t,{OP:()=>r,QX:()=>o});let n="assetSource",r=e=>(null==e?void 0:e.type)==="image"&&"emoji"===(e=>{var t;return(null==e||null==(t=e.custom)?void 0:t[n])==="emoji"?"emoji":null})(e),o=(e,t)=>{let l={...e||{}};return t?l[n]=t:delete l[n],l}},80598:e=>{e.exports={panelHeader:"PanelHeader_panelHeader__IdVcs",sideEnd:"PanelHeader_sideEnd__tAVfy",panel:"PanelHeader_panel__4ERfS",inline:"PanelHeader_inl
1ine__L9tvJ",title:"PanelHeader_title__1ihCe",control:"PanelHeader_control__m5BFZ"}},83222:(e,t,l)=>{"use strict";l.d(t,{IK:()=>d,ag:()=>h,vG:()=>p});var n=l(79349);let r=e=>{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)};function o(e){return .2126*r(e.r)+.7152*r(e.g)+.0722*r(e.b)}function a(e,t){let l=o(e),n=o(t);return(Math.max(l,n)+.05)/(Math.min(l,n)+.05)}let i={r:0,g:0,b:0,a:1},s={r:255,g:255,b:255,a:1};function c(e){return o(e)>.179?i:s}function u(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4.5;return a(e,t)>=l}function d(e,t){var l;let r=(0,n.H0)(e);if(!r)return"#000000";let o=null!=(l=null==t?void 0:t.target)?l:4.5;if(null==t?void 0:t.prefer){let e=(0,n.H0)(t.prefer);if(e&&u(e,r,o))return(0,n.a3)(e)}return(0,n.a3)(c(r))}function p(e,t){let l=(0,n.H0)(e),r=(0,n.H0)(t);return l&&r?a(l,r):1}function h(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4.5,r=(0,n.H0)(e),a=(0,n.H0)(t);return r&&a?(0,n.a3)(function(e,t){let l,r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4.5;if(u(e,t,a))return e;let i=(0,n.Y2)(e),d=.179>=o(t);d?(l=i.L,r=1):(l=0,r=i.L);let p=null;for(let e=0;e<24;e++){let e=(l+r)/2,o=(0,n.sC)({...i,L:e});u(o,t,a)?(p=o,d?r=e:l=e):d?l=e:r=e}if(p)return{...p,a:e.a};let h=c(t),f=(0,n.sC)({L:h===s?.96:.15,C:Math.min(i.C,.03),H:i.H,alpha:e.a});return u(f,t,a)?f:{...h,a:e.a}}(r,a,l)):e}},83727:(e,t,l)=>{"use strict";l.d(t,{A:()=>c});var n=l(37876);l(14232);var r=l(6061),o=l(18245),a=l(92978),i=l.n(a),s=l(76542);let c=e=>{var t;let{tip:l,value:a,onChange:c,store:u,mixed:d,pickerPortalClassName:p,controlKey:h="color",allowTransparent:f=!1,transparentSwatch:g=!1}=e,m=(0,r.PY)(),v=(null==l?void 0:l.trim())||"Цвет",b=(null==m?void 0:m.renderItem)?19:16;return(0,r.$5)(m,h,v,(0,n.jsx)(s.A,{content:v,position:null!=(t=null==m?void 0:m.placement)?t:"bottom",hoverOpenDelay:300,portalClassName:"ai-studio-tooltip-portal",children:(0,n.jsx)("span",{className:i().colorSwatchWra
1p,"data-color-swatch-control":!0,children:(0,n.jsx)(o.A,{value:a,size:b,swatchOnly:!0,mixed:d,allowTransparent:f,transparentSwatch:g,paletteOnly:!!(null==m?void 0:m.renderItem),dockOverlay:(null==m?void 0:m.onToggleOverlay)?{controlKey:h,label:v}:void 0,position:null==m?void 0:m.placement,portalClassName:p,onChange:c,replacePanel:!(null==m?void 0:m.renderItem),replaceFollow:!0,store:u})})}))}},88934:(e,t,l)=>{"use strict";l.d(t,{Pk:()=>c,ac:()=>j,j7:()=>g,jG:()=>C,tM:()=>A});var n=l(76732),r=l(55342);let o=e=>/gradient\(/i.test(e),a=e=>"string"==typeof e&&e.trim().length>0,i=e=>{let t=e.trim();if(o(t))return t.replace(/\s+/g," ").toLowerCase();if("transparent"===t.toLowerCase())return"transparent";try{return(0,n.Ay)(t).hex("rgba").toLowerCase()}catch(e){return t.toLowerCase()}},s=(e,t)=>i(e)===i(t),c=e=>{let t=new Set,l=[];for(let n of e){if(!a(n))continue;let e=i(n);t.has(e)||(t.add(e),l.push(n))}return l},u=/(color:\s*)(#[0-9a-fA-F]{3,8}|rgba?\([^)]*\))/g,d=(e,t,l)=>("string"==typeof e?e:"").replace(u,(e,n,r)=>s(r,t)?"".concat(n).concat(l):e),p=e=>{var t,l;return(e=>{if(e instanceof Map)return e;let t=null==e?void 0:e.entries;return"function"==typeof t?new Map(t.call(e)):e&&"object"==typeof e?new Map(Object.entries(e)):new Map})(null!=(l=null==e?void 0:e.colorsReplace)?l:null==e||null==(t=e.data)?void 0:t.colorsReplace)},h=(e,t)=>{for(let[l,n]of Array.from(e.entries()))if(s(l,t))return n;return t},f=(e,t,l)=>{var r,o,a;let i=p(e),c=t;for(let e of Array.from(i.keys()))if(s(e,t)){c=e;break}null==(r=e.replaceColor)||r.call(e,c,(e=>{if(!e.startsWith("#"))return e;try{let[t,l,r,o]=(0,n.Ay)(e).rgba();return"rgba(".concat(t,",").concat(l,",").concat(r,",").concat(o,")")}catch(t){return e}})(l)),null==(o=e.set)||o.call(e,{data:{...null!=(a=e.data)?a:{},colorsReplace:Object.fromEntries(p(e))}})},g=e=>{let t=new Set,l=e=>{if(e){if("group"===e.type){var n;(null!=(n=e.children)?n:[]).forEach(l);return}"svg"===e.type&&a(e.src)&&t.add(e.src)}};return l(e),Array.from(t)},m={"cell|text":"Текст","cell|figure":"Плашка ячейки","cell|svg":"Иконка","cell|image":"Картинка","cell|line":"Линия ячейки","title|text":"Заголовок","title|figure":"Плашка заголовка","footer|text":"Итого","footer|figure":"Плашка итога",cell:"Ячейка",title:"Заголовок",footer:"Итого",rowBg:"Подложка строки",colBg:"Подложка колонки",plate:"Фон",frame:"Фон",hline:"Линия строк",vline:"Линия колонок",other:"Элемент"},v={fill:"",svg:"",background:"фон",stroke:"обводка",shadow:"тень",span:"фрагмент"},b={"frame::stroke":"Рамка"},y=["cell|text","title|text","footer|text","rowBg","colBg","plate","cell|figure","title|figure","footer|figure","frame","hline","vline","cell|svg","cell|image","cell|line","other"],x=["fill","svg","background","stroke","shadow","span"],k=(e,t,l)=>{let n=e.indexOf(t);return n<0?l:n},w=(e,t,l,n)=>[e,t,i(l),n?i(n):""].join("::"),C=(e,t)=>{let[l,n]=e.key.split("::");return w(l,n,t,e.original)},j=(e,t)=>{var l;if(!(0,r.Si)(e))return[];let n=[],o=e=>{if(e){if("group"===e.type){var l;
1(null!=(l=e.children)?l:[]).forEach(o);return}(e=>{var l,r,o,i,d,f,g,m;let v=null!=(o=null==e||null==(r=e.custom)||null==(l=r.lt)?void 0:l.role)?o:"other",b=null!=(i=null==e?void 0:e.type)?i:"",y=((e,t)=>"cell"===e||"title"===e||"footer"===e?"".concat(e,"|").concat(t):e)(v,b),x=function(t,l){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n.push({family:y,kind:t,color:l,el:e,gradientOk:!1,textInk:!1,...r})};switch(b){case"text":for(let t of(a(e.fill)&&x("fill",e.fill,{gradientOk:!0,textInk:!0}),c((e=>{let t,l="string"==typeof e?e:"",n=[];for(u.lastIndex=0;t=u.exec(l);)n.push(t[2]);return n})(e.text))))a(e.fill)&&s(t,e.fill)||x("span",t,{textInk:!0});e.backgroundEnabled&&a(e.backgroundColor)&&x("background",e.backgroundColor),(null!=(d=e.strokeWidth)?d:0)>0&&a(e.stroke)&&x("stroke",e.stroke);break;case"figure":a(e.fill)&&x("fill",e.fill,{gradientOk:!0}),(null!=(f=e.strokeWidth)?f:0)>0&&a(e.stroke)&&x("stroke",e.stroke);break;case"line":a(e.color)&&x("fill",e.color);break;case"svg":{let l=p(e);for(let n of c(a(e.src)&&(null==t?void 0:t[e.src])||Array.from(l.keys())))x("svg",h(l,n),{original:n,gradientOk:!0});(null!=(g=e.borderSize)?g:0)>0&&a(e.borderColor)&&x("stroke",e.borderColor);break}case"image":(null!=(m=e.borderSize)?m:0)>0&&a(e.borderColor)&&x("stroke",e.borderColor)}(null==e?void 0:e.shadowEnabled)&&a(e.shadowColor)&&x("shadow",e.shadowColor)})(e)}};
1(null!=(l=e.children)?l:[]).forEach(o);let i=new Map;return n.forEach((e,t)=>{let l=w(e.family,e.kind,e.color,e.original),n={id:String(e.el.id),type:String(e.el.type)},r=i.get(l);if(r){r.members.some(e=>e.id===n.id)||r.members.push(n),r.allowGradient=r.allowGradient&&e.gradientOk,r.transparentOk=r.transparentOk&&!(e.textInk&&"shadow"!==e.kind);return}i.set(l,{key:l,label:((e,t)=>{var l,n;let r=b["".concat(e,"::").concat(t)];if(r)return r;let o=null!=(n=null!=(l=m[e])?l:m[e.split("|")[0]])?n:m.other,a=v[t];return a?"".concat(o," \xb7 ").concat(a):o})(e.family,e.kind),kind:e.kind,color:e.color,original:e.original,members:[n],allowGradient:e.gradientOk,transparentOk:!(e.textInk&&"shadow"!==e.kind),order:t})}),Array.from(i.values()).sort((e,t)=>{let[l,n]=e.key.split("::"),[r,o]=t.key.split("::"),a=k(y,l,99)-k(y,r,99);if(a)return a;let i=k(x,n,99)-k(x,o,99);return i||e.order-t.order}).map(e=>{let{order:t,...l}=e;return l})},A=(e,t,l,n)=>{var i;if(!(0,r.Si)(t)||!a(n)||o(n)&&!l.allowGradient)return!1;let s=(e=>{var t;let l=new Map,n=e=>{if(e){if("group"===e.type){var t;(null!=(t=e.children)?t:[]).forEach(n);return}null!=e.id&&l.set(String(e.id),e)}};return(null!=(t=null==e?void 0:e.children)?t:[]).forEach(n),l})(t),c=()=>{for(let e of l.members){let t=s.get(e.id);if(t)switch(l.kind){case"fill":"line"===t.type?t.set({color:n}):"text"===t.type?t.set({fill:n,text:d(t.text,l.color,n)}):t.set({fill:n});break;case"svg":l.original&&f(t,l.original,n);break;case"background":t.set({backgroundColor:n});break;case"stroke":t.set("image"===t.type||"svg"===t.type?{borderColor:n}:{stroke:n});break;case"shadow":t.set({shadowColor:n});break;case"span":t.set({text:d(t.text,l.color,n)})}}};return"function"==typeof(null==e||null==(i=e.history)?void 0:i.transaction)?e.history.transaction(c):c(),!0}},89804:(e,t,l)=>{"use strict";l.d(t,{At:()=>i,FH:()=>s,IH:()=>c,WX:()=>u,dJ:()=>d,dw:()=>p,gB:()=>f,m$:()=>h});var n=l(67083),r=l(15063);let o=null,a=null,i=e=>!!e&&(0,r.a)(e.custom),s=(e,t)=>{i(e)&&e.id&&(o={studio:"tables",elementId:e.id},t((0,n.Bl)(!0)))},c=e=>!!e&&"svg"===e.type&&!!e.custom&&"charts"===e.custom.studio,u=e=>!!e&&"svg"===e.type&&i(e),d=(e,t)=>{c(e)&&e.id&&(o={studio:"charts",elementId:e.id},t((0,n.Zr)(!0)))},p=e=>{if(o&&o.studio===e){let e=o;return o=null,e}return null},h=(e,t)=>{Array.isArray(e)&&e.length&&(a=e,t((0,n.Zr)(!0)))},f=()=>{let e=a;return a=null,e}},92494:(e,t,l)=>{"use strict";l.d(t,{M:()=>N,L:()=>_});var n=l(63510),r=l(76732);let o=["fill","stroke"],a=new Set(["path","rect","circle","line","polygon","polyline","ellipse","text","tspan","textPath","use"]),i=new Set(["defs","clipPath"]),s=e=>new DOMParser().parseFromString(e,"image/svg+xml"),c=e=>e.localName||e.nodeName,u=(e,t)=>{let l=(e.getAttribute("style")||"").match(RegExp("(?:^|;)\\s*".concat(t.replace(/-/g,"\\-"),"\\s*:\\s*([^;]+)"),"i"));return l?l[1].replace(/!important/i,"").trim():""},d=(e,t)=>{let l=e.getAttribute(t);return null!==l&&""!==l?l.trim():u(e,t)},p=e=>"mask"===c(e)&&/alpha/i.test((e.getAttribute("mask-type")||"")+" "+u(e,"mask-type")),h=(e,t)=>{let l=e;for(;l;){let n=c(l);if(l!==e&&(i.has(n)||p(l))||"none"===d(l,"display").toLowerCase()||"hidden"===d(l,"visibility").toLowerCase())return!0;let r=parseFloat(d(l,"opacity"));if(!Number.isNaN(r)&&r<=0)return!0;if(l===t)break;l=l.parentElement}return!1},f=e=>{let t="",l=0;for(;l<e.length;){if("@"===e[l]){let t=e.indexOf("{",l),n=e.indexOf(";",l);if(t<0||n>=0&&n<t){l=n>=0?n+1:e.length;continue}let r=0,o=t;for(;o<e.length;o++)if("{"===e[o])r++;else if("}"===e[o]&&0==--r)break;l=o+1;continue}t+=e[l],l++}return t},g=(e,t,l)=>{let n=e.getAttribute(l);
1if(n&&n.trim()&&"inherit"!==n.trim())return{value:n.trim(),source:"attr"};let r=((e,t)=>{let l={},n=e.getAttribute("id");if(n&&t["#".concat(n)])l={...t["#".concat(n)]};else for(let n of(e.getAttribute("class")||"").split(/\s+/))n&&t[".".concat(n)]&&(l={...l,...t[".".concat(n)]});let r=t[c(e)];return r&&(l={...l,...r}),l})(e,t)[l];if(r&&"inherit"!==r)return{value:r,source:"css"};let o=u(e,l);return o&&"inherit"!==o?{value:o,source:"inline"}:null},m=(e,t,l)=>{let n=g(e,t,l);return n&&"none"!==n.value?n.value:""},v=e=>null!==e.getAttribute("fill")||null!==e.getAttribute("stroke")||!!u(e,"fill")||a.has(c(e)),b=(e,t,l,n)=>{let r=e;for(;r;){let e=g(r,l,n);if(e)return{owner:r,decl:e};if(r===t)break;r=r.parentElement}return null},y=(e,t,l,n)=>{let r=e;for(;r;){let e=d(r,l);if(e){let t=parseFloat(e);if(!Number.isNaN(t))return t}if(r===t)break;r=r.parentElement}return n},x=/^(?:linear|radial)-gradient\(/i,k=/^url\(/i,w=e=>{let t=e.trim();if(!t||k.test(t)||x.test(t))return null;if(/^transparent$/i.test(t))return{r:0,g:0,b:0,a:0};if(/^currentcolor$/i.test(t))return{r:0,g:0,b:0,a:1};if(!r.Ay.valid(t))return null;let[l,n,o,a]=(0,r.Ay)(t).rgba();return{r:Math.round(l),g:Math.round(n),b:Math.round(o),a}},C=(e,t)=>e.a<=.002&&t.a<=.002||e.r===t.r&&e.g===t.g&&e.b===t.b&&.005>Math.abs(e.a-t.a),j=(e,t,l,n)=>{let r=/^transparent$/i.test(e.trim()),o=/^transparent$/i.test(t.trim());return r||o?r&&o:l.r===n.r&&l.g===n.g&&l.b===n.b&&l.a===n.a},A=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,n=null,r=null;try{n=(null==(r=l(e))?void 0:r.documentElement)||null}catch(e){n=null}if(!r||!n||"svg"!==c(n))return[...t];let i=(e=>{let t={},l=e.querySelectorAll("style");for(let e=0;e<l.length;e++){let n,r=f((l[e].textContent||"").replace(/\/\*[\s\S]*?\*\//g,"")),o=/([^{}]+)\{([^{}]*)\}/g;for(;n=o.exec(r);){let e={};for(let t of n[2].split(";")){let l=t.indexOf(":");if(l<0)continue;let n=t.slice(0,l).trim(),r="fill"===n?"fill":"stroke"===n?"stroke":null,o=t.slice(l+1).trim();r&&o&&!/!important/i.test(o)&&(e[r]=o)}for(let l of n[1].split(",")){let n=l.trim();n&&(t[n]={...t[n]||{},...e})}}}return t})(r),u=o.some(e=>"currentColor"===m(n,i,e)),d=[],p=!1,A=e=>{let t=w(e);t&&!d.some(e=>C(e,t))&&d.push(t)},N=n.querySelectorAll("*");for(let e=0;e<N.length;e++){let t=N[e],l=c(t);if(!a.has(l)||h(t,n))continue;if("text"===l){let e=t.querySelectorAll("tspan, textPath"),l=e.length>0,n="";for(let t=0;t<e.length&&l;t++)g(e[t],i,"fill")||(l=!1),n+=e[t].textContent||"";let r=(t.textContent||"").replace(/\s+/g,"");if(l&&r.length<=n.replace(/\s+/g,"").length)continue}
1let r=m(t,i,"fill"),s=m(t,i,"stroke"),d=!r&&!s&&!u;for(let e of o){if("stroke"===e){if(0>=y(t,n,"stroke-width",1)||0>=y(t,n,"stroke-opacity",1))continue}else if(0>=y(t,n,"fill-opacity",1))continue;let l=b(t,n,i,e);if(!l){"fill"===e&&d&&A("black");continue}let{value:r,source:o}=l.decl;if("none"!==r){if(l.owner!==t&&!v(l.owner)){"fill"===e&&d&&A("black");continue}if(k.test(r)){p=!0;continue}"inline"===o&&/^currentcolor$/i.test(r)||A(r)}}}let _=[],S=[];for(let e of t){if(x.test(e.trim())){p&&!_.includes(e)&&_.push(e);continue}let t=w(e);if(!t){_.includes(e)||_.push(e);continue}d.some(e=>C(e,t))&&(S.some(l=>j(l.key,e,l.rgba,t))||(S.push({key:e,rgba:t}),_.push(e)))}return _},N=e=>A(e,(n.getColors(e)||[]).filter(e=>n.sameColors(e,e))),_=(e,t)=>{for(let[l]of(e=>e?"function"==typeof e.entries?Array.from(e.entries.call(e)):"object"==typeof e?Object.entries(e):[]:[])(e))if(l===t||n.sameColors(l,t))return l;return t}},99763:(e,t,l)=>{"use strict";l.d(t,{Ay:()=>_,NB:()=>w,_g:()=>C,eI:()=>x,wU:()=>A});var n=l(37876),r=l(58522),o=l(76732),a=l(5811),i=l(63510),s=l(14232),c=l(92494),u=l(23008),d=l(18245),p=l(48211),h=l.n(p),f=l(8569),g=l(92978),m=l.n(g),v=l(83727),b=l(76542),y=l(6061);let x=e=>{var t,l;return(e=>{if(e instanceof Map)return e;let t=null==e?void 0:e.entries;return"function"==typeof t?new Map(t.call(e)):e&&"object"==typeof e?new Map(Object.entries(e)):new Map})(null!=(l=e.colorsReplace)?l:null==(t=e.data)?void 0:t.colorsReplace)},k=(e,t)=>Array.from(e.keys()).find(e=>i.sameColors(e,t)),w=(e,t)=>{let l=k(e,t);return e.get(l||"")||t},C=e=>e.reduce((e,t)=>(e.some(e=>i.sameColors(e,t))||e.push(t),e),[]),j=e=>{if("transparent"===e.trim().toLowerCase())return!0;try{return 0===(0,o.Ay)(e).alpha()}catch(e){return!1}},A=(e,t,l)=>{var n,o;let a=k(x(e),t)||t;null==(n=e.replaceColor)||n.call(e,a,(e=>{if(!e.startsWith("#"))return e;let t=(0,r.RV)(e),{r:l,g:n,b:o,a}=(0,r.ss)(t);return"rgba(".concat(l,",").concat(n,",").concat(o,",").concat(a,")")})(l)),null==(o=e.set)||o.call(e,{data:{...e.data,colorsReplace:Object.fromEntries(x(e))}})},N=(0,a.PA)(e=>{let{store:t,el:l,svgColors:r,allowTransparent:o}=e,a=s.useRef(null),[i,c]=s.useState(null),u=s.useMemo(()=>(0,d.K)(t),[l,t]);return s.useEffect(()=>{c(null)},[l,r]),s.useEffect(()=>{var e,t;let l=null==(t=a.current)||null==(e=t.closest("[data-quick-control-overlay-content]"))?void 0:e.parentElement;null==l||l.scrollTo({left:0,behavior:"smooth"})},[i]),(0,n.jsx)("div",{ref:a,className:h().dockColorPalette,children:(0,n.jsx)("div",{className:h().dockColorPaletteStage,children:i?(0,n.jsx)(f.A,{value:w(x(l),i),documentColors:u,allowGradient:!0,allowTransparent:o,onBack:()=>c(null),onColorSelect:e=>A(l,i,e),onGradientSelect:e=>A(l,i,e)}):r.map((e,t)=>{let r=w(x(l),e),o=j(r);return(0,n.jsx)("button",{type:"button",className:"".concat(h().dockColorSwatch," ").concat(o?h().dockColorTransparent:""),style:o?void 0:{background:r},onClick:()=>c(e),"aria-label":r},"".concat(e,"-").concat(t))})})})}),_=(0,a.PA)(e=>{var t,l,r;let{store:o,allowTransparent:a=!1,singleLabel:d="Цвет SVG",multipleLabel:p="Цвета SVG"}=e,h=(0,y.PY)(),f=(null==h?void 0:h.renderItem)?{width:19,height:19}:void 0,g=o.selectedElements[0],[k,_]=s.useState(null);if(s.useEffect(()=>{let e=!1;return(_(null),(null==g?void 0:g.src)&&"svg"===g.type)?(i.urlToString(g.src).then(t=>{e||_(C((0,c.M)(t)))}).catch(t=>{console.error("SVG tooltip color extraction error",t),e||_([])}),()=>{e=!0}):(_([]),()=>{e=!0})},[null==g?void 0:g.src,null==g?void 0:g.type]),!g||"svg"!==g.type)return null;if(null===k)return(0,y.$5)(h,"svg.color",d,(0,n.jsx)(b.A,{content:d,position:null!=(t=null==h?void 0:h.placement)?t:"bottom",hoverOpenDelay:300,portalClassName:"ai-studio-tooltip-portal",children:(0,n.jsx)("button",{type:"button",className:m().svgColorButton,disabled:!0,"aria-label":"Загрузка цветов SVG",children:(0,n.jsx)("span",{className:"".concat(m().svgColorSquare," ").concat(m().svgColorLoading),style:f})})}));if(!k.length||!g.replaceColor)return null;if(1===k.length){let e=k[0],t=w(x(g),e);return(0,n.jsx)(v.A,{controlKey:"svg.color",tip:d,value:t,allowTransparent:a,transparentSwatch:j(t),pickerPortalClassName:"ai-studio-tooltip-portal",onChange:t=>{A(g,e,t)},store:o})}return(null==h?void 0:h.onToggleOverlay)?(0,y.$5)(h,"svg.colors",p,(0,n.jsx)(b.A,{content:p,position:null!=(l=h.placement)?l:"bottom",hoverOpenDelay:300,portalClassName:"ai-studio-tooltip-portal",children:(0,n.jsx)(y.GF,{minimal:!0,controlKey:"svg.colors",label:p,content:(0,n.jsx)(N,{store:o,el:g,svgColors:k,allowTransparent:a}),position:h.placement,children:(0,n.jsx)("button",{type:"button",className:m().svgColorButton,"aria-label":"Открыть цвета SVG",children:(0,n.jsx)("span",{className:"".concat(m().svgColorSquare," ").concat(m().svgColorMixed),style:f})})})})):(0,y.$5)(h,"svg.colors",p,(0,n.jsx)(b.A,{content:p,position:null!=(r=null==h?void 0:h.placement)?r:"bottom",hoverOpenDelay:300,portalClassName:"ai-studio-tooltip-portal",children:(0,n.jsx)("button",{type:"button",className:m().svgColorButton,onClick:()=>((e,t,l)=>{var n,r;let o=x(t);(0,u.Ue)(e,{targetId:t.id||(null==(r=e.selectedElements)||null==(n=r[0])?void 0:n.id)||null,value:w(o,l[0]),allowGradient:!0,apply:e=>A(t,l[0],e),follow:!0})})(o,g,k),"aria-label":"Открыть цвета SVG",children:(0,n.jsx)("span",{className:"".concat(m().svgColorSquare," ").concat(m().svgColorMixed),style:f})})}))})}}]);

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