diff --git a/_app/immutable/chunks/singletons.9fa588c5.js b/_app/immutable/chunks/singletons.9fa588c5.js new file mode 100644 index 0000000..961d05a --- /dev/null +++ b/_app/immutable/chunks/singletons.9fa588c5.js @@ -0,0 +1 @@ +import{w as u}from"./index.cdd71a1a.js";var _;const k=((_=globalThis.__sveltekit_1463t09)==null?void 0:_.base)??"";var g;const m=((g=globalThis.__sveltekit_1463t09)==null?void 0:g.assets)??k,w="1729939838616",T="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},h=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||A(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===h&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function A(e,t){return e.origin!==h||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:E()};export{I,f as P,y as S,T as a,U as b,L as c,P as d,k as e,O as f,S as g,N as h,A as i,h as o,x as s}; diff --git a/_app/immutable/entry/app.efb98fca.js b/_app/immutable/entry/app.efb98fca.js new file mode 100644 index 0000000..f134eb8 --- /dev/null +++ b/_app/immutable/entry/app.efb98fca.js @@ -0,0 +1 @@ +import{S as V,i as q,s as U,a as j,e as h,c as z,b as g,d,f as R,g as p,h as w,j as W,o as F,k as G,l as H,m as J,n as P,p as m,q as K,r as M,u as Q,v as L,t as X,w as N,x as k,y as v,z as A,A as E,B as y}from"../chunks/index.93773fab.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},B={},S=function(e,n,i){if(!n||n.length===0)return e();const s=document.getElementsByTagName("link");return Promise.all(n.map(f=>{if(f=Z(f,i),f in B)return;B[f]=!0;const t=f.endsWith(".css"),r=t?'[rel="stylesheet"]':"";if(!!i)for(let l=s.length-1;l>=0;l--){const _=s[l];if(_.href===f&&(!t||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${r}`))return;const o=document.createElement("link");if(o.rel=t?"stylesheet":Y,t||(o.as="script",o.crossOrigin=""),o.href=f,document.head.appendChild(o),t)return new Promise((l,_)=>{o.addEventListener("load",l),o.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})})).then(()=>e()).catch(f=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=f,window.dispatchEvent(t),!t.defaultPrevented)throw f})},se={};function $(a){let e,n,i;var s=a[1][0];function f(t){return{props:{data:t[3],form:t[2]}}}return s&&(e=k(s,f(a)),a[12](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&A(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),g(t,n,r),i=!0},p(t,r){const u={};if(r&8&&(u.data=t[3]),r&4&&(u.form=t[2]),r&2&&s!==(s=t[1][0])){if(e){L();const o=e;d(o.$$.fragment,1,0,()=>{y(o,1)}),R()}s?(e=k(s,f(t)),t[12](e),v(e.$$.fragment),p(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else s&&e.$set(u)},i(t){i||(e&&p(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){a[12](null),t&&w(n),e&&y(e,t)}}}function x(a){let e,n,i;var s=a[1][0];function f(t){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return s&&(e=k(s,f(a)),a[11](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&A(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),g(t,n,r),i=!0},p(t,r){const u={};if(r&8&&(u.data=t[3]),r&8215&&(u.$$scope={dirty:r,ctx:t}),r&2&&s!==(s=t[1][0])){if(e){L();const o=e;d(o.$$.fragment,1,0,()=>{y(o,1)}),R()}s?(e=k(s,f(t)),t[11](e),v(e.$$.fragment),p(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else s&&e.$set(u)},i(t){i||(e&&p(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){a[11](null),t&&w(n),e&&y(e,t)}}}function ee(a){let e,n,i;var s=a[1][1];function f(t){return{props:{data:t[4],form:t[2]}}}return s&&(e=k(s,f(a)),a[10](e)),{c(){e&&v(e.$$.fragment),n=h()},l(t){e&&A(e.$$.fragment,t),n=h()},m(t,r){e&&E(e,t,r),g(t,n,r),i=!0},p(t,r){const u={};if(r&16&&(u.data=t[4]),r&4&&(u.form=t[2]),r&2&&s!==(s=t[1][1])){if(e){L();const o=e;d(o.$$.fragment,1,0,()=>{y(o,1)}),R()}s?(e=k(s,f(t)),t[10](e),v(e.$$.fragment),p(e.$$.fragment,1),E(e,n.parentNode,n)):e=null}else s&&e.$set(u)},i(t){i||(e&&p(e.$$.fragment,t),i=!0)},o(t){e&&d(e.$$.fragment,t),i=!1},d(t){a[10](null),t&&w(n),e&&y(e,t)}}}function C(a){let e,n=a[6]&&D(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(e);n&&n.l(s),s.forEach(w),this.h()},h(){P(e,"id","svelte-announcer"),P(e,"aria-live","assertive"),P(e,"aria-atomic","true"),m(e,"position","absolute"),m(e,"left","0"),m(e,"top","0"),m(e,"clip","rect(0 0 0 0)"),m(e,"clip-path","inset(50%)"),m(e,"overflow","hidden"),m(e,"white-space","nowrap"),m(e,"width","1px"),m(e,"height","1px")},m(i,s){g(i,e,s),n&&n.m(e,null)},p(i,s){i[6]?n?n.p(i,s):(n=D(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&w(e),n&&n.d()}}}function D(a){let e;return{c(){e=K(a[7])},l(n){e=M(n,a[7])},m(n,i){g(n,e,i)},p(n,i){i&128&&Q(e,n[7])},d(n){n&&w(e)}}}function te(a){let e,n,i,s,f;const t=[x,$],r=[];function u(l,_){return l[1][1]?0:1}e=u(a),n=r[e]=t[e](a);let o=a[5]&&C(a);return{c(){n.c(),i=j(),o&&o.c(),s=h()},l(l){n.l(l),i=z(l),o&&o.l(l),s=h()},m(l,_){r[e].m(l,_),g(l,i,_),o&&o.m(l,_),g(l,s,_),f=!0},p(l,[_]){let b=e;e=u(l),e===b?r[e].p(l,_):(L(),d(r[b],1,1,()=>{r[b]=null}),R(),n=r[e],n?n.p(l,_):(n=r[e]=t[e](l),n.c()),p(n,1),n.m(i.parentNode,i)),l[5]?o?o.p(l,_):(o=C(l),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},i(l){f||(p(n),f=!0)},o(l){d(n),f=!1},d(l){r[e].d(l),l&&w(i),o&&o.d(l),l&&w(s)}}}function ne(a,e,n){let{stores:i}=e,{page:s}=e,{constructors:f}=e,{components:t=[]}=e,{form:r}=e,{data_0:u=null}=e,{data_1:o=null}=e;W(i.page.notify);let l=!1,_=!1,b=null;F(()=>{const c=i.page.subscribe(()=>{l&&(n(6,_=!0),X().then(()=>{n(7,b=document.title||"untitled page")}))});return n(5,l=!0),c});function I(c){N[c?"unshift":"push"](()=>{t[1]=c,n(0,t)})}function O(c){N[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}function T(c){N[c?"unshift":"push"](()=>{t[0]=c,n(0,t)})}return a.$$set=c=>{"stores"in c&&n(8,i=c.stores),"page"in c&&n(9,s=c.page),"constructors"in c&&n(1,f=c.constructors),"components"in c&&n(0,t=c.components),"form"in c&&n(2,r=c.form),"data_0"in c&&n(3,u=c.data_0),"data_1"in c&&n(4,o=c.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(s)},[t,f,r,u,o,l,_,b,i,s,I,O,T]}class re extends V{constructor(e){super(),q(this,e,ne,te,U,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const oe=[()=>S(()=>import("../nodes/0.1fbc94a4.js"),["../nodes/0.1fbc94a4.js","../chunks/index.93773fab.js"],import.meta.url),()=>S(()=>import("../nodes/1.1b6cbc20.js"),["../nodes/1.1b6cbc20.js","../chunks/index.93773fab.js","../chunks/singletons.9fa588c5.js","../chunks/index.cdd71a1a.js"],import.meta.url),()=>S(()=>import("../nodes/2.3e7bb9d8.js"),["../nodes/2.3e7bb9d8.js","../chunks/index.93773fab.js","../chunks/index.cdd71a1a.js","../assets/2.ce7e5492.css"],import.meta.url)],ae=[],le={"/":[2]},fe={handleError:({error:a})=>{console.error(a)}};export{le as dictionary,fe as hooks,se as matchers,oe as nodes,re as root,ae as server_loads}; diff --git a/_app/immutable/entry/start.7bdfc86f.js b/_app/immutable/entry/start.7bdfc86f.js new file mode 100644 index 0000000..6e746c2 --- /dev/null +++ b/_app/immutable/entry/start.7bdfc86f.js @@ -0,0 +1,3 @@ +import{o as me,t as we}from"../chunks/index.93773fab.js";import{S as Ge,a as Je,I as M,g as Ce,f as De,b as ye,c as le,s as te,i as _e,d as B,e as q,o as Fe,P as Me,h as Ze}from"../chunks/singletons.9fa588c5.js";function Qe(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function et(t){return t.split("%25").map(decodeURI).join("%25")}function tt(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const nt=["href","pathname","search","searchParams","toString","toJSON"];function at(t,r){const f=new URL(t);for(const i of nt)Object.defineProperty(f,i,{get(){return r(),t[i]},enumerable:!0,configurable:!0});return rt(f),f}function rt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const ot="/__data.json";function it(t){return t.replace(/\/$/,"")+ot}function st(...t){let r=5381;for(const f of t)if(typeof f=="string"){let i=f.length;for(;i;)r=r*33^f.charCodeAt(--i)}else if(ArrayBuffer.isView(f)){const i=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let h=i.length;for(;h;)r=r*33^i[--h]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Ke=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Ke(t,r));const ae=new Map;function ct(t){const r=atob(t),f=new Uint8Array(r.length);for(let i=0;i0){const i=Se(t,f),h=ae.get(i);if(h){if(performance.now(){const h=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(h)return r.push({name:h[1],matcher:h[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const E=i.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const d=ut.exec(g);if(!d)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,N,T,R,D]=d;return r.push({name:R,matcher:D,optional:!!N,rest:!!T,chained:T?m===1&&E[0]==="":!1}),T?"(.*?)":N?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function ht(t){return!/^\([^)]+\)$/.test(t)}function pt(t){return t.slice(1).split("/").filter(ht)}function gt(t,r,f){const i={},h=t.slice(1),u=h.filter(l=>l!==void 0);let E=0;for(let l=0;ld).join("/"),E=0),m===void 0){g.rest&&(i[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){i[g.name]=m;const d=r[l+1],N=h[l+1];d&&!d.rest&&d.optional&&N&&g.chained&&(E=0),!d&&!N&&Object.keys(i).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return i}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function mt({nodes:t,server_loads:r,dictionary:f,matchers:i}){const h=new Set(r);return Object.entries(f).map(([l,[g,m,d]])=>{const{pattern:N,params:T}=dt(l),R={id:l,exec:D=>{const U=N.exec(D);if(U)return gt(U,T,i)},errors:[1,...d||[]].map(D=>t[D]),layouts:[0,...m||[]].map(E),leaf:u(g)};return R.errors.length=R.layouts.length=Math.max(R.errors.length,R.layouts.length),R});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[h.has(l),t[l]]}}function ze(t){try{return JSON.parse(sessionStorage[t])}catch{}}function Ve(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const wt=-1,yt=-2,_t=-3,vt=-4,bt=-5,Et=-6;function St(t,r){if(typeof t=="number")return h(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,i=Array(f.length);function h(u,E=!1){if(u===wt)return;if(u===_t)return NaN;if(u===vt)return 1/0;if(u===bt)return-1/0;if(u===Et)return-0;if(E)throw new Error("Invalid input");if(u in i)return i[u];const l=f[u];if(!l||typeof l!="object")i[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return i[u]=m(h(l[1]));switch(g){case"Date":i[u]=new Date(l[1]);break;case"Set":const d=new Set;i[u]=d;for(let R=1;Rr!=null)}const We=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...We];const Rt=new Set([...We]);[...Rt];async function At(t,r){var f;for(const i in t)if(typeof((f=t[i])==null?void 0:f.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([h,u])=>[h,await u])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class qe{constructor(r,f){this.status=r,this.location=f}}class It extends Error{constructor(r){super(),this.status=404,this.message=`Not found: ${r}`}}const Lt="x-sveltekit-invalidated",Pt="x-sveltekit-trailing-slash",J=ze(Ge)??{},ee=ze(Je)??{};function be(t){J[t]=te()}function K(t){return location.href=t.href,new Promise(()=>{})}function Ot(t,r){var je;const f=mt(t),i=t.nodes[0],h=t.nodes[1];i(),h();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let d={branch:[],error:null,url:null},N=!1,T=!1,R=!0,D=!1,U=!1,C=!1,z=!1,V,x=(je=history.state)==null?void 0:je[M];x||(x=Date.now(),history.replaceState({...history.state,[M]:x},"",location.href));const fe=J[x];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let H,W,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),s=Z(e,!0);g=null;const n=W={},o=s&&await he(s);if(n===W&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(H=o.props.page),V.$set(o.props)}}function Re(e){l.some(s=>s==null?void 0:s.snapshot)&&(ee[e]=l.map(s=>{var n;return(n=s==null?void 0:s.snapshot)==null?void 0:n.capture()}))}function Ae(e){var s;(s=ee[e])==null||s.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(x),Ve(Ge,J),Re(x),Ve(Je,ee)}async function re(e,{noScroll:s=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,_){return typeof e=="string"&&(e=new URL(e,Ce(document))),ce({url:e,scroll:s?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:_,accepted:()=>{c&&(z=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:he(e).then(s=>(s.type==="loaded"&&s.state.error&&(g=null),s))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;d=e.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),H=e.props.page,V=new t.root({target:r,props:{...e.props,stores:B,components:l},hydrate:!0}),Ae(x);const n={from:null,to:{params:d.params,route:{id:((o=d.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),T=!0}async function X({url:e,params:s,branch:n,status:o,error:a,route:c,form:p}){let _="never";for(const y of n)(y==null?void 0:y.slash)!==void 0&&(_=y.slash);e.pathname=Qe(e.pathname,_),e.search=e.search;const b={type:"loaded",state:{url:e,params:s,branch:n,error:a,route:c},props:{constructors:kt(n).map(y=>y.node.component)}};p!==void 0&&(b.props.form=p);let v={},L=!H,A=0;for(let y=0;y(_.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(_.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:at(n,()=>{_.url=!0}),async fetch(w,O){let j;w instanceof Request?(j=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):j=w;const F=new URL(j,n);return P(F.href),F.origin===n.origin&&(j=F.href.slice(n.origin.length)),T?ft(j,F.href,O):lt(j,O)},setHeaders:()=>{},depends:P,parent(){return _.parent=!0,s()}};p=await b.universal.load.call(null,y)??null,p=p?await At(p,a.id):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:_}:null,data:p??(c==null?void 0:c.data)??null,slash:n.pathname===q||n.pathname===q+"/"?"always":((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,s,n,o,a){if(z)return!0;if(!o)return!1;if(o.parent&&e||o.route&&s||o.url&&n)return!0;for(const c of o.params)if(a[c]!==d.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,s){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?s??null:null}async function he({id:e,invalidating:s,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:_}=a,b=[...p,_];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let v=null;const L=d.url?e!==d.url.pathname+d.url.search:!1,A=d.route?a.id!==d.route.id:!1;let P=!1;const y=b.map((S,I)=>{var G;const k=d.branch[I],$=!!(S!=null&&S[0])&&((k==null?void 0:k.loader)!==S[1]||Oe(P,A,L,(G=k.server)==null?void 0:G.uses,o));return $&&(P=!0),$});if(y.some(Boolean)){try{v=await He(n,y)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(v.type==="redirect")return v}const w=v==null?void 0:v.nodes;let O=!1;const j=b.map(async(S,I)=>{var pe;if(!S)return;const k=d.branch[I],$=w==null?void 0:w[I];if((!$||$.type==="skip")&&S[1]===(k==null?void 0:k.loader)&&!Oe(O,A,L,(pe=k.universal)==null?void 0:pe.uses,o))return k;if(O=!0,($==null?void 0:$.type)==="error")throw $;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const F=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await h(),loader:h,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[_,b],status:e,error:s,route:null})}function Z(e,s){if(_e(e,q))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:s,route:o,params:tt(a),url:e}}}function se(e){return et(e.pathname.slice(q.length)||"/")}function Ue({url:e,type:s,intent:n,delta:o}){let a=!1;const c=Be(d,n,e,s);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(_=>_(p)),a?null:c}async function ce({url:e,scroll:s,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:_={},accepted:b,blocked:v}){var j,F,S;const L=Z(e,!1),A=Ue({url:e,type:c,delta:p,intent:L});if(!A){v();return}const P=x;b(),U=!0,T&&B.navigating.set(A.navigation),W=_;let y=L&&await he(L);if(!y){if(_e(e,q))return await K(e);y=await Ne(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,W!==_)return A.reject(new Error("navigation was aborted")),!1;if(y.type==="redirect")if(o>=20)y=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(y.location,e).href,{},o+1,_),!1;else((j=y.props.page)==null?void 0:j.status)>=400&&await B.updated.check()&&await K(e);if(E.length=0,z=!1,D=!0,be(P),Re(P),(F=y.props.page)!=null&&F.url&&y.props.page.url.pathname!==e.pathname&&(e.pathname=(S=y.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[M]=x+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let k=x+1;for(;ee[k]||J[k];)delete ee[k],delete J[k],k+=1}}if(g=null,T){d=y.state,y.props.page&&(y.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(k=>k(A.navigation)))).filter(k=>typeof k=="function");if(I.length>0){let k=function(){m.after_navigate=m.after_navigate.filter($=>!I.includes($))};I.push(k),m.after_navigate.push(...I)}V.$set(y.props)}else Pe(y);const{activeElement:w}=document;if(await we(),R){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));s?scrollTo(s.x,s.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),R=!0,y.props.page&&(H=y.props.page),U=!1,c==="popstate"&&Ae(x),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),B.navigating.set(null),D=!1}async function Ne(e,s,n,o){return e.origin===Fe&&e.pathname===location.pathname&&!N?await ie({status:o,error:n,url:e,route:s}):await K(e)}function Xe(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function s(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",s),u.addEventListener("touchstart",s,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const _=De(c,u);if(!_)return;const{url:b,external:v,download:L}=ye(_,q);if(v||L)return;const A=le(_);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:_,download:b}=ye(c,q);if(_||b)continue;const v=le(c);v.reload||(v.preload_code===Me.viewport&&n.observe(c),v.preload_code===Me.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,s){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:s})??{message:s.route.id===null&&e instanceof It?"Not Found":"Internal Error"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const s=m.after_navigate.indexOf(e);m.after_navigate.splice(s,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const s=m.before_navigate.indexOf(e);m.before_navigate.splice(s,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const s=m.on_navigate.indexOf(e);m.on_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(D||!T)&&(R=!1)},goto:(e,s={})=>re(e,s,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:s}=new URL(e,location.href);E.push(n=>n.href===s)}return ke()},invalidate_all:()=>(z=!0,ke()),preload_data:async e=>{const s=new URL(e,Ce(document)),n=Z(s,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${s}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const s=new URL(location.href),{branch:n,route:o}=d;if(!o)return;const a=await xe(d.branch.length,n,o.errors);if(a){const c=await X({url:s,params:d.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});d=c.state,V.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(V.$set({form:null,page:{...H,form:e.data,status:e.status}}),await we(),V.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var s;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=Be(d,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(s=navigator.connection)!=null&&s.saveData||Xe(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=De(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:_}=ye(o,q);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||_)return;if(c||b.reload){Ue({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(d.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(C=!0,be(x),e(a),!b.replace_state)return;C=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(_e(p,q))return;const _=n.target,{keep_focus:b,noscroll:v,reload:L,replace_state:A}=le(_);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(_),y=a==null?void 0:a.getAttribute("name");y&&P.append(y,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:v?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o,a;if(W={},(o=n.state)!=null&&o[M]){if(n.state[M]===x)return;const c=J[n.state[M]],p=new URL(location.href);if(((a=d.url)==null?void 0:a.href.split("#")[0])===location.href.split("#")[0]){e(p),J[x]=te(),x=n.state[M],scrollTo(c.x,c.y);return}const _=n.state[M]-x;await ce({url:p,scroll:c,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{x=n.state[M]},blocked:()=>{history.go(-_)},type:"popstate",delta:_,nav_token:W})}else if(!C){const c=new URL(location.href);e(c)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[M]:++x},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&B.navigating.set(null)});function e(n){d.url=n,B.page.set({...H,url:n}),B.page.notify()}},_hydrate:async({status:e=200,error:s,node_ids:n,params:o,route:a,data:c,form:p})=>{N=!0;const _=new URL(location.href);({params:o={},route:a={id:null}}=Z(_,!1)||{});let b;try{const v=n.map(async(P,y)=>{const w=c[y];return w!=null&&w.uses&&(w.uses=Ye(w.uses)),ue({loader:t.nodes[P],url:_,params:o,route:a,parent:async()=>{const O={};for(let j=0;jP===a.id);if(A){const P=A.layouts;for(let y=0;yu?"1":"0").join(""));const i=await Ke(f.href);if((h=i.headers.get("content-type"))!=null&&h.includes("text/html")&&await K(t),!i.ok)throw new ne(i.status,await i.json());return new Promise(async u=>{var N;const E=new Map,l=i.body.getReader(),g=new TextDecoder;function m(T){return St(T,{Promise:R=>new Promise((D,U)=>{E.set(R,{fulfil:D,reject:U})})})}let d="";for(;;){const{done:T,value:R}=await l.read();if(T&&!d)break;for(d+=!R&&d?` +`:g.decode(R);;){const D=d.indexOf(` +`);if(D===-1)break;const U=JSON.parse(d.slice(0,D));if(d=d.slice(D+1),U.type==="redirect")return u(U);if(U.type==="data")(N=U.nodes)==null||N.forEach(C=>{(C==null?void 0:C.type)==="data"&&(C.uses=Ye(C.uses),C.data=m(C.data))}),u(U);else if(U.type==="chunk"){const{id:C,data:z,error:V}=U,x=E.get(C);E.delete(C),V?x.reject(m(V)):x.fulfil(m(z))}}}})}function Ye(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url)}}function Ee(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const r=document.body,f=r.getAttribute("tabindex");r.tabIndex=-1,r.focus({preventScroll:!0,focusVisible:!1}),f!==null?r.setAttribute("tabindex",f):r.removeAttribute("tabindex");const i=getSelection();if(i&&i.type!=="None"){const h=[];for(let u=0;u{if(i.rangeCount===h.length){for(let u=0;u{h=d,u=N});return E.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((g=t.route)==null?void 0:g.id)??null},url:t.url},to:f&&{params:(r==null?void 0:r.params)??null,route:{id:((m=r==null?void 0:r.route)==null?void 0:m.id)??null},url:f},willUnload:!r,type:i,complete:E},fulfil:h,reject:u}}async function Nt(t,r,f){const i=Ot(t,r);Ze({client:i}),f?await i._hydrate(f):i.goto(location.href,{replaceState:!0}),i._start_router()}export{Nt as start}; diff --git a/_app/immutable/nodes/1.1b6cbc20.js b/_app/immutable/nodes/1.1b6cbc20.js new file mode 100644 index 0000000..4507c6b --- /dev/null +++ b/_app/immutable/nodes/1.1b6cbc20.js @@ -0,0 +1 @@ +import{S,i as q,s as x,k as _,q as f,a as H,l as d,m as g,r as h,h as u,c as k,b as m,G as v,u as $,H as E,I as y}from"../chunks/index.93773fab.js";import{d as C}from"../chunks/singletons.9fa588c5.js";const G=()=>{const s=C;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},I={subscribe(s){return G().page.subscribe(s)}};function P(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=_("h1"),o=f(r),n=H(),i=_("p"),l=f(c)},l(e){t=d(e,"H1",{});var a=g(t);o=h(a,r),a.forEach(u),n=k(e),i=d(e,"P",{});var p=g(i);l=h(p,c),p.forEach(u)},m(e,a){m(e,t,a),v(t,o),m(e,n,a),m(e,i,a),v(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&$(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&$(l,c)},i:E,o:E,d(e){e&&u(t),e&&u(n),e&&u(i)}}}function j(s,t,r){let o;return y(s,I,n=>r(0,o=n)),[o]}let A=class extends S{constructor(t){super(),q(this,t,j,P,x,{})}};export{A as component}; diff --git a/_app/immutable/nodes/2.3e7bb9d8.js b/_app/immutable/nodes/2.3e7bb9d8.js new file mode 100644 index 0000000..44828a6 --- /dev/null +++ b/_app/immutable/nodes/2.3e7bb9d8.js @@ -0,0 +1,744 @@ +var Oa=Object.defineProperty;var xa=(i,e,t)=>e in i?Oa(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var Ce=(i,e,t)=>(xa(i,typeof e!="symbol"?e+"":e,t),t);import{S as ye,i as Ee,s as $e,C as Fe,J as fe,K as Pt,e as Ge,L as Bt,m as te,h as k,M as yn,b as x,G as O,D as Ne,E as Me,F as Pe,N as He,g as v,d as w,O as Sn,P as cr,Q as ke,y as F,z as N,A as M,R as We,B as P,k as K,l as J,n as D,T as Ut,U as Je,V as Re,W as Ga,X as gt,Y as Ie,v as Oe,f as xe,Z as ja,_ as St,o as An,a as re,c as ie,$ as Ha,q as oe,r as ae,a0 as Un,p as et,a1 as oo,a2 as Va,a3 as Wa,a4 as ao,H as Be,w as ge,u as tt,a5 as Rt,a6 as qa,a7 as be,a8 as ve,a9 as Ot,aa as ut,ab as oi,I as yt,t as Vr,ac as Za}from"../chunks/index.93773fab.js";import{w as xn}from"../chunks/index.cdd71a1a.js";var Mi={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function Pi(i,e,t){const n=i.slice();return n[9]=e[t][0],n[10]=e[t][1],n}function Dr(i){let e,t=[i[10]],n={};for(let r=0;r{t(6,e=fe(fe({},e),ke(h))),t(5,r=cr(e,n)),"name"in h&&t(0,a=h.name),"color"in h&&t(1,l=h.color),"size"in h&&t(2,u=h.size),"stroke"in h&&t(3,f=h.stroke),"iconNode"in h&&t(4,c=h.iconNode),"$$scope"in h&&t(7,o=h.$$scope)},e=ke(e),[a,l,u,f,c,r,e,o,s]}class Ka extends ye{constructor(e){super(),Ee(this,e,Ya,Xa,$e,{name:0,color:1,size:2,stroke:3,iconNode:4})}}const qe=Ka;function Ja(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Qa(i){let e,t;const n=[{name:"align-center"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Ja]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class tl extends ye{constructor(e){super(),Ee(this,e,el,Qa,$e,{})}}const nl=tl;function rl(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function il(i){let e,t;const n=[{name:"align-left"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[rl]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class ol extends ye{constructor(e){super(),Ee(this,e,sl,il,$e,{})}}const al=ol;function ll(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function ul(i){let e,t;const n=[{name:"align-right"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[ll]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class cl extends ye{constructor(e){super(),Ee(this,e,fl,ul,$e,{})}}const hl=cl;function ml(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function dl(i){let e,t;const n=[{name:"arrow-bar-to-down"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[ml]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class _l extends ye{constructor(e){super(),Ee(this,e,pl,dl,$e,{})}}const gl=_l;function bl(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function vl(i){let e,t;const n=[{name:"arrow-bar-to-up"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[bl]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class wl extends ye{constructor(e){super(),Ee(this,e,$l,vl,$e,{})}}const yl=wl;function El(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function kl(i){let e,t;const n=[{name:"arrow-down"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[El]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Al extends ye{constructor(e){super(),Ee(this,e,Sl,kl,$e,{})}}const Il=Al;function Tl(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Cl(i){let e,t;const n=[{name:"arrow-up"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Tl]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Fl extends ye{constructor(e){super(),Ee(this,e,Rl,Cl,$e,{})}}const Nl=Fl;function Ml(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Pl(i){let e,t;const n=[{name:"bold"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Ml]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Dl extends ye{constructor(e){super(),Ee(this,e,Bl,Pl,$e,{})}}const zl=Dl;function Ll(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Ul(i){let e,t;const n=[{name:"border-corners"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Ll]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class xl extends ye{constructor(e){super(),Ee(this,e,Ol,Ul,$e,{})}}const Gl=xl;function jl(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Hl(i){let e,t;const n=[{name:"box-align-bottom"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[jl]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Wl extends ye{constructor(e){super(),Ee(this,e,Vl,Hl,$e,{})}}const ql=Wl;function Zl(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Xl(i){let e,t;const n=[{name:"box-align-top"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Zl]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Kl extends ye{constructor(e){super(),Ee(this,e,Yl,Xl,$e,{})}}const Jl=Kl;function Ql(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function eu(i){let e,t;const n=[{name:"box-margin"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Ql]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class nu extends ye{constructor(e){super(),Ee(this,e,tu,eu,$e,{})}}const ru=nu;function iu(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function su(i){let e,t;const n=[{name:"brand-github-filled"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[iu]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class au extends ye{constructor(e){super(),Ee(this,e,ou,su,$e,{})}}const lu=au;function uu(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function fu(i){let e,t;const n=[{name:"brand-topbuzz"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[uu]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class hu extends ye{constructor(e){super(),Ee(this,e,cu,fu,$e,{})}}const mu=hu;function du(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function pu(i){let e,t;const n=[{name:"brand-vk"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[du]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class gu extends ye{constructor(e){super(),Ee(this,e,_u,pu,$e,{})}}const bu=gu;function vu(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function $u(i){let e,t;const n=[{name:"bug"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[vu]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class yu extends ye{constructor(e){super(),Ee(this,e,wu,$u,$e,{})}}const Eu=yu;function ku(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Su(i){let e,t;const n=[{name:"chevron-down"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[ku]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Iu extends ye{constructor(e){super(),Ee(this,e,Au,Su,$e,{})}}const Tu=Iu;function Cu(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Ru(i){let e,t;const n=[{name:"copy"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Cu]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Nu extends ye{constructor(e){super(),Ee(this,e,Fu,Ru,$e,{})}}const lo=Nu;function Mu(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Pu(i){let e,t;const n=[{name:"device-floppy"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Mu]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Du extends ye{constructor(e){super(),Ee(this,e,Bu,Pu,$e,{})}}const zu=Du;function Lu(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Uu(i){let e,t;const n=[{name:"dots"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Lu]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class xu extends ye{constructor(e){super(),Ee(this,e,Ou,Uu,$e,{})}}const Gu=xu;function ju(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Hu(i){let e,t;const n=[{name:"help"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[ju]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Wu extends ye{constructor(e){super(),Ee(this,e,Vu,Hu,$e,{})}}const qu=Wu;function Zu(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Xu(i){let e,t;const n=[{name:"history"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Zu]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Ku extends ye{constructor(e){super(),Ee(this,e,Yu,Xu,$e,{})}}const Ju=Ku;function Qu(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function ef(i){let e,t;const n=[{name:"info-circle"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Qu]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class nf extends ye{constructor(e){super(),Ee(this,e,tf,ef,$e,{})}}const rf=nf;function sf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function of(i){let e,t;const n=[{name:"italic"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[sf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class lf extends ye{constructor(e){super(),Ee(this,e,af,of,$e,{})}}const uf=lf;function ff(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function cf(i){let e,t;const n=[{name:"letter-case-lower"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[ff]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class mf extends ye{constructor(e){super(),Ee(this,e,hf,cf,$e,{})}}const df=mf;function pf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function _f(i){let e,t;const n=[{name:"letter-case-upper"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[pf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class bf extends ye{constructor(e){super(),Ee(this,e,gf,_f,$e,{})}}const vf=bf;function $f(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function wf(i){let e,t;const n=[{name:"letter-case"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[$f]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Ef extends ye{constructor(e){super(),Ee(this,e,yf,wf,$e,{})}}const kf=Ef;function Sf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Af(i){let e,t;const n=[{name:"minus"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Sf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Tf extends ye{constructor(e){super(),Ee(this,e,If,Af,$e,{})}}const Cf=Tf;function Rf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Ff(i){let e,t;const n=[{name:"new-section"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Rf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Mf extends ye{constructor(e){super(),Ee(this,e,Nf,Ff,$e,{})}}const uo=Mf;function Pf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Bf(i){let e,t;const n=[{name:"photo-down"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Pf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class zf extends ye{constructor(e){super(),Ee(this,e,Df,Bf,$e,{})}}const Lf=zf;function Uf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Of(i){let e,t;const n=[{name:"photo-up"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Uf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Gf extends ye{constructor(e){super(),Ee(this,e,xf,Of,$e,{})}}const jf=Gf;function Hf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Vf(i){let e,t;const n=[{name:"photo"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Hf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class qf extends ye{constructor(e){super(),Ee(this,e,Wf,Vf,$e,{})}}const ai=qf;function Zf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Xf(i){let e,t;const n=[{name:"plus"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Zf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class Kf extends ye{constructor(e){super(),Ee(this,e,Yf,Xf,$e,{})}}const fo=Kf;function Jf(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Qf(i){let e,t;const n=[{name:"rectangle"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[Jf]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class tc extends ye{constructor(e){super(),Ee(this,e,ec,Qf,$e,{})}}const nc=tc;function rc(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function ic(i){let e,t;const n=[{name:"settings"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[rc]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class oc extends ye{constructor(e){super(),Ee(this,e,sc,ic,$e,{})}}const ac=oc;function lc(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function uc(i){let e,t;const n=[{name:"trash"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[lc]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class cc extends ye{constructor(e){super(),Ee(this,e,fc,uc,$e,{})}}const hc=cc;function mc(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function dc(i){let e,t;const n=[{name:"upload"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[mc]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class _c extends ye{constructor(e){super(),Ee(this,e,pc,dc,$e,{})}}const gc=_c;function bc(i){let e;const t=i[2].default,n=Fe(t,i,i[3],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&8)&&Ne(n,t,r,r[3],e?Pe(t,r[3],s,null):Me(r[3]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function vc(i){let e,t;const n=[{name:"x"},i[1],{iconNode:i[0]}];let r={$$slots:{default:[bc]},$$scope:{ctx:i}};for(let s=0;s{t(1,e=fe(fe({},e),ke(o))),"$$scope"in o&&t(3,r=o.$$scope)},e=ke(e),[s,e,n,r]}class wc extends ye{constructor(e){super(),Ee(this,e,$c,vc,$e,{})}}const yc=wc;function Ec(i){let e,t,n,r,s,o;const a=i[11].default,l=Fe(a,i,i[10],null);return{c(){e=K("article"),l&&l.c(),this.h()},l(u){e=J(u,"ARTICLE",{role:!0,tabindex:!0,title:!0,class:!0,style:!0});var f=te(e);l&&l.l(f),f.forEach(k),this.h()},h(){D(e,"role","button"),D(e,"tabindex",1),D(e,"title",i[4]),D(e,"class",t=Ut(i[2])+" svelte-1fxt9u9"),D(e,"style",n="justify-content:"+i[6]+";width:"+(i[8]||"100%")+";"+(i[8]?`min-width:${i[8]};max-width:${i[8]};`:"")+(i[9]?`${i[9]};`:"")+i[3]+";"),Je(e,"active",i[0]),Je(e,"disabled",i[1]),Je(e,"disablePadding",i[5]),Je(e,"border",i[7])},m(u,f){x(u,e,f),l&&l.m(e,null),r=!0,s||(o=[Re(e,"click",Ga(i[12])),Re(e,"mousemove",i[13]),Re(e,"mouseout",i[14]),Re(e,"mouseover",i[15]),Re(e,"mouseup",i[16]),Re(e,"mousedown",i[17]),Re(e,"mouseenter",i[18]),Re(e,"mouseleave",i[19]),Re(e,"touchstart",i[20],{passive:!0}),Re(e,"touchmove",i[21],{passive:!0}),Re(e,"touchcancel",i[22],{passive:!0}),Re(e,"touchend",i[23],{passive:!0}),Re(e,"keydown",i[24]),Re(e,"keyup",i[25]),Re(e,"focus",i[26]),Re(e,"focusin",i[27]),Re(e,"focusout",i[28]),Re(e,"blur",i[29])],s=!0)},p(u,[f]){l&&l.p&&(!r||f&1024)&&Ne(l,a,u,u[10],r?Pe(a,u[10],f,null):Me(u[10]),null),(!r||f&16)&&D(e,"title",u[4]),(!r||f&4&&t!==(t=Ut(u[2])+" svelte-1fxt9u9"))&&D(e,"class",t),(!r||f&840&&n!==(n="justify-content:"+u[6]+";width:"+(u[8]||"100%")+";"+(u[8]?`min-width:${u[8]};max-width:${u[8]};`:"")+(u[9]?`${u[9]};`:"")+u[3]+";"))&&D(e,"style",n),(!r||f&5)&&Je(e,"active",u[0]),(!r||f&6)&&Je(e,"disabled",u[1]),(!r||f&36)&&Je(e,"disablePadding",u[5]),(!r||f&132)&&Je(e,"border",u[7])},i(u){r||(v(l,u),r=!0)},o(u){w(l,u),r=!1},d(u){u&&k(e),l&&l.d(u),s=!1,gt(o)}}}function kc(i,e,t){let{$$slots:n={},$$scope:r}=e,{active:s=!1}=e,{disabled:o=!1}=e,{type:a="default"}=e,{style:l=""}=e,{title:u=""}=e,{disablePadding:f=!1}=e,{justifyContent:c="center"}=e,{border:h=!0}=e,{width:d=""}=e,{height:p=""}=e;function m(j){Ie.call(this,i,j)}function _(j){Ie.call(this,i,j)}function g(j){Ie.call(this,i,j)}function b(j){Ie.call(this,i,j)}function S(j){Ie.call(this,i,j)}function y(j){Ie.call(this,i,j)}function A(j){Ie.call(this,i,j)}function I(j){Ie.call(this,i,j)}function C(j){Ie.call(this,i,j)}function H(j){Ie.call(this,i,j)}function G(j){Ie.call(this,i,j)}function ne(j){Ie.call(this,i,j)}function Q(j){Ie.call(this,i,j)}function R(j){Ie.call(this,i,j)}function X(j){Ie.call(this,i,j)}function E(j){Ie.call(this,i,j)}function V(j){Ie.call(this,i,j)}function W(j){Ie.call(this,i,j)}return i.$$set=j=>{"active"in j&&t(0,s=j.active),"disabled"in j&&t(1,o=j.disabled),"type"in j&&t(2,a=j.type),"style"in j&&t(3,l=j.style),"title"in j&&t(4,u=j.title),"disablePadding"in j&&t(5,f=j.disablePadding),"justifyContent"in j&&t(6,c=j.justifyContent),"border"in j&&t(7,h=j.border),"width"in j&&t(8,d=j.width),"height"in j&&t(9,p=j.height),"$$scope"in j&&t(10,r=j.$$scope)},[s,o,a,l,u,f,c,h,d,p,r,n,m,_,g,b,S,y,A,I,C,H,G,ne,Q,R,X,E,V,W]}class Ye extends ye{constructor(e){super(),Ee(this,e,kc,Ec,$e,{active:0,disabled:1,type:2,style:3,title:4,disablePadding:5,justifyContent:6,border:7,width:8,height:9})}}const Sc=i=>({}),Di=i=>({}),Ac=i=>({}),zi=i=>({});function Li(i){let e,t,n,r,s,o,a,l,u,f,c=i[4].title&&Ui(i);const h=i[5].default,d=Fe(h,i,i[8],null);let p=i[4].footer&&xi(i);return{c(){e=K("button"),t=re(),n=K("div"),r=K("article"),c&&c.c(),s=re(),o=K("section"),d&&d.c(),a=re(),p&&p.c(),this.h()},l(m){e=J(m,"BUTTON",{class:!0}),te(e).forEach(k),t=ie(m),n=J(m,"DIV",{class:!0});var _=te(n);r=J(_,"ARTICLE",{class:!0});var g=te(r);c&&c.l(g),s=ie(g),o=J(g,"SECTION",{class:!0});var b=te(o);d&&d.l(b),b.forEach(k),a=ie(g),p&&p.l(g),g.forEach(k),_.forEach(k),this.h()},h(){D(e,"class","backdrop fixed svelte-f5gose"),D(o,"class","svelte-f5gose"),D(r,"class","svelte-f5gose"),D(n,"class","container fixed svelte-f5gose")},m(m,_){x(m,e,_),x(m,t,_),x(m,n,_),O(n,r),c&&c.m(r,null),O(r,s),O(r,o),d&&d.m(o,null),O(r,a),p&&p.m(r,null),l=!0,u||(f=[Re(e,"click",i[6]),Re(n,"keypress",i[3])],u=!0)},p(m,_){m[4].title?c?(c.p(m,_),_&16&&v(c,1)):(c=Ui(m),c.c(),v(c,1),c.m(r,s)):c&&(Oe(),w(c,1,1,()=>{c=null}),xe()),d&&d.p&&(!l||_&256)&&Ne(d,h,m,m[8],l?Pe(h,m[8],_,null):Me(m[8]),null),m[4].footer?p?(p.p(m,_),_&16&&v(p,1)):(p=xi(m),p.c(),v(p,1),p.m(r,null)):p&&(Oe(),w(p,1,1,()=>{p=null}),xe())},i(m){l||(v(c),v(d,m),v(p),l=!0)},o(m){w(c),w(d,m),w(p),l=!1},d(m){m&&k(e),m&&k(t),m&&k(n),c&&c.d(),d&&d.d(m),p&&p.d(),u=!1,gt(f)}}}function Ui(i){let e,t,n;const r=i[5].title,s=Fe(r,i,i[8],zi);let o=i[1]&&Oi(i);return{c(){e=K("header"),s&&s.c(),t=re(),o&&o.c(),this.h()},l(a){e=J(a,"HEADER",{class:!0});var l=te(e);s&&s.l(l),t=ie(l),o&&o.l(l),l.forEach(k),this.h()},h(){D(e,"class","svelte-f5gose")},m(a,l){x(a,e,l),s&&s.m(e,null),O(e,t),o&&o.m(e,null),n=!0},p(a,l){s&&s.p&&(!n||l&256)&&Ne(s,r,a,a[8],n?Pe(r,a[8],l,Ac):Me(a[8]),zi),a[1]?o?(o.p(a,l),l&2&&v(o,1)):(o=Oi(a),o.c(),v(o,1),o.m(e,null)):o&&(Oe(),w(o,1,1,()=>{o=null}),xe())},i(a){n||(v(s,a),v(o),n=!0)},o(a){w(s,a),w(o),n=!1},d(a){a&&k(e),s&&s.d(a),o&&o.d()}}}function Oi(i){let e,t;return e=new Ye({props:{title:"Закрыть",width:"auto",border:!1,$$slots:{default:[Ic]},$$scope:{ctx:i}}}),e.$on("click",i[7]),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&256&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Ic(i){let e,t;return e=new yc({}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function xi(i){let e,t;const n=i[5].footer,r=Fe(n,i,i[8],Di);return{c(){e=K("footer"),r&&r.c(),this.h()},l(s){e=J(s,"FOOTER",{class:!0});var o=te(e);r&&r.l(o),o.forEach(k),this.h()},h(){D(e,"class","svelte-f5gose")},m(s,o){x(s,e,o),r&&r.m(e,null),t=!0},p(s,o){r&&r.p&&(!t||o&256)&&Ne(r,n,s,s[8],t?Pe(n,s[8],o,Sc):Me(s[8]),Di)},i(s){t||(v(r,s),t=!0)},o(s){w(r,s),t=!1},d(s){s&&k(e),r&&r.d(s)}}}function Tc(i){let e,t,n=i[0]&&Li(i);return{c(){n&&n.c(),e=Ge()},l(r){n&&n.l(r),e=Ge()},m(r,s){n&&n.m(r,s),x(r,e,s),t=!0},p(r,[s]){r[0]?n?(n.p(r,s),s&1&&v(n,1)):(n=Li(r),n.c(),v(n,1),n.m(e.parentNode,e)):n&&(Oe(),w(n,1,1,()=>{n=null}),xe())},i(r){t||(v(n),t=!0)},o(r){w(n),t=!1},d(r){n&&n.d(r),r&&k(e)}}}function Cc(i,e,t){let{$$slots:n={},$$scope:r}=e;const s=ja(n);let{open:o=!0}=e,{closable:a=!0}=e;const l=St();function u(p="cancel"){a&&l("close",{action:p},{cancelable:!0})&&t(0,o=!1)}function f(p){o&&p.key==="Escape"&&u("cancel")}function c(p){o&&(l("paste",{event:p}),p.stopPropagation())}An(()=>(document.addEventListener("keyup",f),document.addEventListener("paste",c,{capture:!0}),()=>{document.removeEventListener("paste",c),document.removeEventListener("keyup",f)}));const h=()=>u("cancel"),d=()=>u("cancel");return i.$$set=p=>{"open"in p&&t(0,o=p.open),"closable"in p&&t(1,a=p.closable),"$$scope"in p&&t(8,r=p.$$scope)},[o,a,u,f,s,n,h,d,r]}class mn extends ye{constructor(e){super(),Ee(this,e,Cc,Tc,$e,{open:0,closable:1})}}const Rc=""+new URL("../assets/firefox_copy_helper.d346afe2.webp",import.meta.url).href;function Fc(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b;return{c(){e=K("article"),t=K("p"),n=oe(`Ваш браузер отключил или не поддерживает копирование изображений из скриптов. Вы можете + скопировать эту копию фрейма вручную с помощью ПКМ.`),r=re(),s=K("img"),a=re(),l=K("p"),u=oe("Если это Firefox версии 87 и выше, вы можете включить опцию "),f=K("span"),c=oe("dom.events.asyncClipboard.clipboardItem"),h=oe(", открыв в новой вкладке страницу "),d=K("span"),p=oe("about:config"),m=oe(`. Тогда вы перестанете видеть это + окно, а функционал копирования заработает корректно.`),_=re(),g=K("img"),this.h()},l(S){e=J(S,"ARTICLE",{class:!0});var y=te(e);t=J(y,"P",{});var A=te(t);n=ae(A,`Ваш браузер отключил или не поддерживает копирование изображений из скриптов. Вы можете + скопировать эту копию фрейма вручную с помощью ПКМ.`),A.forEach(k),r=ie(y),s=J(y,"IMG",{src:!0,alt:!0,class:!0}),a=ie(y),l=J(y,"P",{});var I=te(l);u=ae(I,"Если это Firefox версии 87 и выше, вы можете включить опцию "),f=J(I,"SPAN",{class:!0});var C=te(f);c=ae(C,"dom.events.asyncClipboard.clipboardItem"),C.forEach(k),h=ae(I,", открыв в новой вкладке страницу "),d=J(I,"SPAN",{class:!0});var H=te(d);p=ae(H,"about:config"),H.forEach(k),m=ae(I,`. Тогда вы перестанете видеть это + окно, а функционал копирования заработает корректно.`),I.forEach(k),_=ie(y),g=J(y,"IMG",{src:!0,alt:!0,class:!0}),y.forEach(k),this.h()},h(){Un(s.src,o=i[1])||D(s,"src",o),D(s,"alt","Копия фрейма"),D(s,"class","svelte-17sbmg7"),D(f,"class","svelte-17sbmg7"),D(d,"class","svelte-17sbmg7"),Un(g.src,b=Rc)||D(g,"src",b),D(g,"alt","Скриншот страницы about:config"),D(g,"class","svelte-17sbmg7"),D(e,"class","svelte-17sbmg7")},m(S,y){x(S,e,y),O(e,t),O(t,n),O(e,r),O(e,s),O(e,a),O(e,l),O(l,u),O(l,f),O(f,c),O(l,h),O(l,d),O(d,p),O(l,m),O(e,_),O(e,g)},p(S,y){y&2&&!Un(s.src,o=S[1])&&D(s,"src",o)},d(S){S&&k(e)}}}function Nc(i){let e;return{c(){e=oe("Ваш браузер не поддерживает копирование")},l(t){e=ae(t,"Ваш браузер не поддерживает копирование")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function Mc(i){let e,t;return e=new mn({props:{open:i[0]!=null,$$slots:{title:[Nc],default:[Fc]},$$scope:{ctx:i}}}),e.$on("close",i[3]),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&1&&(s.open=n[0]!=null),r&18&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Pc(i,e,t){let{fallbackBlob:n=null}=e,r=n,s="";Ha(()=>{s&&URL.revokeObjectURL(s)});const o=()=>t(0,n=null);return i.$$set=a=>{"fallbackBlob"in a&&t(0,n=a.fallbackBlob)},i.$$.update=()=>{i.$$.dirty&7&&n!=r&&(s&&URL.revokeObjectURL(s),t(2,r=n),t(1,s=r?URL.createObjectURL(r):""))},[n,s,r,o]}class Bc extends ye{constructor(e){super(),Ee(this,e,Pc,Mc,$e,{fallbackBlob:0})}}function Gi(i,e,t){const n=i.slice();return n[8]=e[t],n}const Dc=i=>({tab:i&2}),ji=i=>({tab:i[8]});function Hi(i,e,t){const n=i.slice();return n[8]=e[t],n}const zc=i=>({tab:i&2}),Vi=i=>({tab:i[8]});function Wi(i){let e,t,n=i[1],r=[];for(let o=0;ow(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;ow(h[p],1,1,()=>{h[p]=null});return{c(){e=K("article"),t=K("header"),f&&f.c(),s=re();for(let p=0;p{f=null}),xe()):f?(f.p(p,m),m&8&&v(f,1)):(f=Wi(p),f.c(),v(f,1),f.m(t,null)),(!a||m&4&&n!==(n=Ut(p[2])+" svelte-w57e1d"))&&D(t,"class",n),(!a||m&4&&r!==(r=p[2]=="horizontal"?"Двойным кликом можно свернуть/развернуть вкладки":""))&&D(t,"title",r),(!a||m&12)&&Je(t,"collapse",p[3]),m&19){c=p[1];let _;for(_=0;_t(0,o=c),f=()=>{a=="horizontal"&&(t(3,l=!l),console.log(l))};return i.$$set=c=>{"tabs"in c&&t(1,s=c.tabs),"activeTab"in c&&t(0,o=c.activeTab),"layout"in c&&t(2,a=c.layout),"$$scope"in c&&t(4,r=c.$$scope)},i.$$.update=()=>{i.$$.dirty&3&&(s.includes(o)||t(0,o=s[0]))},[o,s,a,l,r,n,u,f]}class co extends ye{constructor(e){super(),Ee(this,e,Uc,Lc,$e,{tabs:1,activeTab:0,layout:2})}}function Xi(i,e,t){const n=i.slice();return n[11]=e[t],n[13]=t,n}const Oc=i=>({item:i&2,index:i&2}),Yi=i=>({item:i[11],index:i[13]});function Ki(i,e){let t,n,r,s,o,a;const l=e[6].default,u=Fe(l,e,e[5],Yi);function f(){return e[9](e[11])}return{key:i,first:null,c(){t=K("article"),u&&u.c(),n=re(),this.h()},l(c){t=J(c,"ARTICLE",{class:!0});var h=te(t);u&&u.l(h),n=ie(h),h.forEach(k),this.h()},h(){D(t,"class","item svelte-1163nbh"),Je(t,"active",e[11].id===e[0].id),this.first=t},m(c,h){x(c,t,h),u&&u.m(t,null),O(t,n),s=!0,o||(a=[Va(r=e[4].call(null,t,{isActive:e[11].id===e[0].id})),Re(t,"click",f)],o=!0)},p(c,h){e=c,u&&u.p&&(!s||h&34)&&Ne(u,l,e,e[5],s?Pe(l,e[5],h,Oc):Me(e[5]),Yi),r&&Wa(r.update)&&h&3&&r.update.call(null,{isActive:e[11].id===e[0].id}),(!s||h&3)&&Je(t,"active",e[11].id===e[0].id)},i(c){s||(v(u,c),s=!0)},o(c){w(u,c),s=!1},d(c){c&&k(t),u&&u.d(c),o=!1,gt(a)}}}function xc(i){let e,t=[],n=new Map,r,s,o,a=i[1];const l=u=>u[11].id;for(let u=0;up.scrollIntoView(u);m&&requestAnimationFrame(_);let g=m;return{update({isActive:b}){g!=b&&(g=b)&&requestAnimationFrame(_)}}}function c(p){Ie.call(this,i,p)}function h(p){Ie.call(this,i,p)}const d=p=>t(0,o=p);return i.$$set=p=>{"items"in p&&t(1,s=p.items),"active"in p&&t(0,o=p.active),"reverse"in p&&t(2,a=p.reverse),"height"in p&&t(3,l=p.height),"$$scope"in p&&t(5,r=p.$$scope)},[o,s,a,l,f,r,n,c,h,d]}class Wr extends ye{constructor(e){super(),Ee(this,e,Gc,xc,$e,{items:1,active:0,reverse:2,height:3})}}const jc=""+new URL("../assets/transparency_background.5a910bcc.webp",import.meta.url).href;function Hc(i){let e,t,n,r,s,o;return{c(){e=K("article"),t=K("canvas"),n=re(),r=K("canvas"),this.h()},l(a){e=J(a,"ARTICLE",{class:!0});var l=te(e);t=J(l,"CANVAS",{style:!0,class:!0}),te(t).forEach(k),n=ie(l),r=J(l,"CANVAS",{class:!0}),te(r).forEach(k),l.forEach(k),this.h()},h(){D(t,"style",`background-image: url(${jc})`),D(t,"class","svelte-flcf9e"),D(r,"class","svelte-flcf9e"),D(e,"class","svelte-flcf9e")},m(a,l){x(a,e,l),O(e,t),i[4](t),O(e,n),O(e,r),i[5](r),s||(o=[Re(e,"dragover",i[2]),Re(e,"drop",i[3])],s=!0)},p:Be,i:Be,o:Be,d(a){a&&k(e),i[4](null),i[5](null),s=!1,gt(o)}}}function Vc(i,e,t){let{webgl:n}=e,{ui:r}=e;function s(u){Ie.call(this,i,u)}function o(u){Ie.call(this,i,u)}function a(u){ge[u?"unshift":"push"](()=>{n=u,t(0,n)})}function l(u){ge[u?"unshift":"push"](()=>{r=u,t(1,r)})}return i.$$set=u=>{"webgl"in u&&t(0,n=u.webgl),"ui"in u&&t(1,r=u.ui)},[n,r,s,o,a,l]}class Wc extends ye{constructor(e){super(),Ee(this,e,Vc,Hc,$e,{webgl:0,ui:1})}}function Ji(i){let e,t;return{c(){e=K("div"),t=oe(i[0]),this.h()},l(n){e=J(n,"DIV",{class:!0});var r=te(e);t=ae(r,i[0]),r.forEach(k),this.h()},h(){D(e,"class","svelte-1txamjl")},m(n,r){x(n,e,r),O(e,t)},p(n,r){r&1&&tt(t,n[0])},d(n){n&&k(e)}}}function qc(i){let e,t,n;const r=i[3].default,s=Fe(r,i,i[2],null);let o=i[0]&&Ji(i);return{c(){e=K("label"),s&&s.c(),t=re(),o&&o.c(),this.h()},l(a){e=J(a,"LABEL",{for:!0,class:!0});var l=te(e);s&&s.l(l),t=ie(l),o&&o.l(l),l.forEach(k),this.h()},h(){D(e,"for",i[1]),D(e,"class","svelte-1txamjl"),Je(e,"error",i[0])},m(a,l){x(a,e,l),s&&s.m(e,null),O(e,t),o&&o.m(e,null),n=!0},p(a,[l]){s&&s.p&&(!n||l&4)&&Ne(s,r,a,a[2],n?Pe(r,a[2],l,null):Me(a[2]),null),a[0]?o?o.p(a,l):(o=Ji(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null),(!n||l&2)&&D(e,"for",a[1]),(!n||l&1)&&Je(e,"error",a[0])},i(a){n||(v(s,a),n=!0)},o(a){w(s,a),n=!1},d(a){a&&k(e),s&&s.d(a),o&&o.d()}}}function Zc(i,e,t){let{$$slots:n={},$$scope:r}=e,{error:s=""}=e,{for:o=void 0}=e;return i.$$set=a=>{"error"in a&&t(0,s=a.error),"for"in a&&t(1,o=a.for),"$$scope"in a&&t(2,r=a.$$scope)},[s,o,r,n]}class Ze extends ye{constructor(e){super(),Ee(this,e,Zc,qc,$e,{error:0,for:1})}}function Xc(i){let e,t,n;return{c(){e=K("input"),this.h()},l(r){e=J(r,"INPUT",{type:!0,min:!0,max:!0,step:!0,class:!0}),this.h()},h(){D(e,"type","range"),D(e,"min",i[1]),D(e,"max",i[2]),D(e,"step",i[3]),D(e,"class","svelte-1kebi6n")},m(r,s){x(r,e,s),Rt(e,i[0]),t||(n=[Re(e,"change",i[5]),Re(e,"input",i[5]),Re(e,"input",i[6]),Re(e,"change",i[7])],t=!0)},p(r,[s]){s&2&&D(e,"min",r[1]),s&4&&D(e,"max",r[2]),s&8&&D(e,"step",r[3]),s&1&&Rt(e,r[0])},i:Be,o:Be,d(r){r&&k(e),t=!1,gt(n)}}}function Yc(i,e,t){let{value:n}=e,{min:r}=e,{max:s}=e,{step:o=1}=e;const a=St();function l(){n=qa(this.value),t(0,n)}const u=c=>a("input",Number(c.currentTarget.value)),f=c=>a("change",Number(c.currentTarget.value));return i.$$set=c=>{"value"in c&&t(0,n=c.value),"min"in c&&t(1,r=c.min),"max"in c&&t(2,s=c.max),"step"in c&&t(3,o=c.step)},[n,r,s,o,a,l,u,f]}class Kc extends ye{constructor(e){super(),Ee(this,e,Yc,Xc,$e,{value:0,min:1,max:2,step:3})}}function Qi(i){let e,t,n;function r(o){i[18](o)}let s={min:i[3]??i[1],max:i[4]??i[2],step:i[5]};return i[0]!==void 0&&(s.value=i[0]),e=new Kc({props:s}),ge.push(()=>be(e,"value",r)),e.$on("input",i[19]),e.$on("change",i[20]),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a&10&&(l.min=o[3]??o[1]),a&20&&(l.max=o[4]??o[2]),a&32&&(l.step=o[5]),!t&&a&1&&(t=!0,l.value=o[0],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function es(i){let e,t,n,r,s;return t=new Ye({props:{disablePadding:!0,title:i[15],$$slots:{default:[Jc]},$$scope:{ctx:i}}}),t.$on("mousedown",i[23]),t.$on("mouseup",i[24]),r=new Ye({props:{disablePadding:!0,title:i[15],$$slots:{default:[Qc]},$$scope:{ctx:i}}}),r.$on("mousedown",i[25]),r.$on("mouseup",i[26]),{c(){e=K("footer"),F(t.$$.fragment),n=re(),F(r.$$.fragment),this.h()},l(o){e=J(o,"FOOTER",{class:!0});var a=te(e);N(t.$$.fragment,a),n=ie(a),N(r.$$.fragment,a),a.forEach(k),this.h()},h(){D(e,"class","svelte-iwgdm5")},m(o,a){x(o,e,a),M(t,e,null),O(e,n),M(r,e,null),s=!0},p(o,a){const l={};a&536870912&&(l.$$scope={dirty:a,ctx:o}),t.$set(l);const u={};a&536870912&&(u.$$scope={dirty:a,ctx:o}),r.$set(u)},i(o){s||(v(t.$$.fragment,o),v(r.$$.fragment,o),s=!0)},o(o){w(t.$$.fragment,o),w(r.$$.fragment,o),s=!1},d(o){o&&k(e),P(t),P(r)}}}function Jc(i){let e,t;return e=new Cf({}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Qc(i){let e,t;return e=new fo({}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function eh(i){let e,t,n,r,s,o,a,l,u=i[7]&&Qi(i),f=i[8]&&es(i);return{c(){e=K("article"),u&&u.c(),t=re(),n=K("input"),s=re(),f&&f.c(),this.h()},l(c){e=J(c,"ARTICLE",{class:!0});var h=te(e);u&&u.l(h),t=ie(h),n=J(h,"INPUT",{style:!0}),s=ie(h),f&&f.l(h),h.forEach(k),this.h()},h(){et(n,"width",i[9]),n.value=r=+i[0].toFixed(i[6]),D(e,"class","svelte-iwgdm5")},m(c,h){x(c,e,h),u&&u.m(e,null),O(e,t),O(e,n),O(e,s),f&&f.m(e,null),o=!0,a||(l=[Re(n,"input",i[21]),Re(n,"change",i[22])],a=!0)},p(c,[h]){c[7]?u?(u.p(c,h),h&128&&v(u,1)):(u=Qi(c),u.c(),v(u,1),u.m(e,t)):u&&(Oe(),w(u,1,1,()=>{u=null}),xe()),(!o||h&512)&&et(n,"width",c[9]),(!o||h&65&&r!==(r=+c[0].toFixed(c[6]))&&n.value!==r)&&(n.value=r),c[8]?f?(f.p(c,h),h&256&&v(f,1)):(f=es(c),f.c(),v(f,1),f.m(e,null)):f&&(Oe(),w(f,1,1,()=>{f=null}),xe())},i(c){o||(v(u),v(f),o=!0)},o(c){w(u),w(f),o=!1},d(c){c&&k(e),u&&u.d(),f&&f.d(),a=!1,gt(l)}}}function th(i,e,t){let{value:n}=e,{min:r=-1/0}=e,{max:s=1/0}=e,{rangeMin:o=void 0}=e,{rangeMax:a=void 0}=e,{step:l=1}=e,{ctrlMultiplier:u=2}=e,{shiftMultiplier:f=5}=e,{precision:c=4}=e,{withRange:h=!1}=e,{withButtons:d=!0}=e,{width:p="48px"}=e;const m=St();let _=-1,g=!1;function b(W){(!W||W.button===0)&&_!==-1&&(clearInterval(_),t(10,g=!1))}function S(W){let j=1;return W.ctrlKey&&(j*=u),W.shiftKey&&(j*=f),j}function y(W){t(0,n=+Math.min(s,Math.max(r,n+W)).toFixed(c)),m("input",n),m("change",n)}function A(W){b(),_=setInterval(()=>{t(10,g=!0),y(W)},100)}An(()=>(document.addEventListener("mouseup",b),()=>document.removeEventListener("mouseup",b)));const I=`Шаг: ${l} +Ctrl: x${u} +Shift: x${f}`;function C(W){n=W,t(0,n)}function H(W){Ie.call(this,i,W)}function G(W){Ie.call(this,i,W)}const ne=W=>{const j=Number(W.currentTarget.value);if(Number.isNaN(j)){W.currentTarget.value=(+n.toFixed(c)).toString();return}t(0,n=Math.min(s,Math.max(r,j))),m("input",n)},Q=W=>m("change",Number(W.currentTarget.value)),R=W=>{W.button==0&&A(-S(W)*l)},X=W=>{W.button==0&&(g||y(-S(W)*l))},E=W=>{W.button==0&&A(+S(W)*l)},V=W=>{W.button==0&&(g||y(+S(W)*l))};return i.$$set=W=>{"value"in W&&t(0,n=W.value),"min"in W&&t(1,r=W.min),"max"in W&&t(2,s=W.max),"rangeMin"in W&&t(3,o=W.rangeMin),"rangeMax"in W&&t(4,a=W.rangeMax),"step"in W&&t(5,l=W.step),"ctrlMultiplier"in W&&t(16,u=W.ctrlMultiplier),"shiftMultiplier"in W&&t(17,f=W.shiftMultiplier),"precision"in W&&t(6,c=W.precision),"withRange"in W&&t(7,h=W.withRange),"withButtons"in W&&t(8,d=W.withButtons),"width"in W&&t(9,p=W.width)},[n,r,s,o,a,l,c,h,d,p,g,m,S,y,A,I,u,f,C,H,G,ne,Q,R,X,E,V]}class Ke extends ye{constructor(e){super(),Ee(this,e,th,eh,$e,{value:0,min:1,max:2,rangeMin:3,rangeMax:4,step:5,ctrlMultiplier:16,shiftMultiplier:17,precision:6,withRange:7,withButtons:8,width:9})}}function nh(i){const e=i-1;return e*e*e+1}function ft(i,{delay:e=0,duration:t=400,easing:n=nh,axis:r="y"}={}){const s=getComputedStyle(i),o=+s.opacity,a=r==="y"?"height":"width",l=parseFloat(s[a]),u=r==="y"?["top","bottom"]:["left","right"],f=u.map(g=>`${g[0].toUpperCase()}${g.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),h=parseFloat(s[`padding${f[1]}`]),d=parseFloat(s[`margin${f[0]}`]),p=parseFloat(s[`margin${f[1]}`]),m=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:n,css:g=>`overflow: hidden;opacity: ${Math.min(g*20,1)*o};${a}: ${g*l}px;padding-${u[0]}: ${g*c}px;padding-${u[1]}: ${g*h}px;margin-${u[0]}: ${g*d}px;margin-${u[1]}: ${g*p}px;border-${u[0]}-width: ${g*m}px;border-${u[1]}-width: ${g*_}px;`}}const rh=i=>({}),ts=i=>({}),ih=i=>({}),ns=i=>({});function sh(i){let e,t,n;const r=i[10].header,s=Fe(r,i,i[15],ns);return t=new Tu({}),{c(){s&&s.c(),e=re(),F(t.$$.fragment)},l(o){s&&s.l(o),e=ie(o),N(t.$$.fragment,o)},m(o,a){s&&s.m(o,a),x(o,e,a),M(t,o,a),n=!0},p(o,a){s&&s.p&&(!n||a&32768)&&Ne(s,r,o,o[15],n?Pe(r,o[15],a,ih):Me(o[15]),ns)},i(o){n||(v(s,o),v(t.$$.fragment,o),n=!0)},o(o){w(s,o),w(t.$$.fragment,o),n=!1},d(o){s&&s.d(o),o&&k(e),P(t,o)}}}function rs(i){let e,t,n,r,s,o;const a=i[10].content,l=Fe(a,i,i[15],ts);return{c(){e=K("section"),l&&l.c(),this.h()},l(u){e=J(u,"SECTION",{style:!0,class:!0});var f=te(e);l&&l.l(f),f.forEach(k),this.h()},h(){D(e,"style",t=`max-height:${i[7]}px;width:${i[6]}px;left:${i[9]}px;top:${i[8]}px;`),D(e,"class","svelte-wcd5xi")},m(u,f){x(u,e,f),l&&l.m(e,null),r=!0,s||(o=[Re(e,"mouseover",i[13]),Re(e,"mouseout",i[14])],s=!0)},p(u,f){l&&l.p&&(!r||f&32768)&&Ne(l,a,u,u[15],r?Pe(a,u[15],f,rh):Me(u[15]),ts),(!r||f&960&&t!==(t=`max-height:${u[7]}px;width:${u[6]}px;left:${u[9]}px;top:${u[8]}px;`))&&D(e,"style",t)},i(u){r||(v(l,u),Ot(()=>{r&&(n||(n=ut(e,ft,{duration:150},!0)),n.run(1))}),r=!0)},o(u){w(l,u),n||(n=ut(e,ft,{duration:150},!1)),n.run(0),r=!1},d(u){u&&k(e),l&&l.d(u),u&&n&&n.end(),s=!1,gt(o)}}}function oh(i){let e,t,n,r,s;t=new Ye({props:{title:i[0],type:i[1],style:`height:${i[3].height};width:${i[3].width};`,justifyContent:"space-between",$$slots:{default:[sh]},$$scope:{ctx:i}}}),t.$on("click",i[11]),t.$on("focusout",i[12]);let o=(i[5]&&!i[2]||i[4])&&rs(i);return{c(){e=K("article"),F(t.$$.fragment),n=re(),o&&o.c(),this.h()},l(a){e=J(a,"ARTICLE",{style:!0,class:!0});var l=te(e);N(t.$$.fragment,l),n=ie(l),o&&o.l(l),l.forEach(k),this.h()},h(){D(e,"style",r=`height:${i[3].height};width:${i[3].width};${i[3].main}`),D(e,"class","svelte-wcd5xi")},m(a,l){x(a,e,l),M(t,e,null),O(e,n),o&&o.m(e,null),s=!0},p(a,[l]){const u={};l&1&&(u.title=a[0]),l&2&&(u.type=a[1]),l&8&&(u.style=`height:${a[3].height};width:${a[3].width};`),l&32768&&(u.$$scope={dirty:l,ctx:a}),t.$set(u),a[5]&&!a[2]||a[4]?o?(o.p(a,l),l&52&&v(o,1)):(o=rs(a),o.c(),v(o,1),o.m(e,null)):o&&(Oe(),w(o,1,1,()=>{o=null}),xe()),(!s||l&8&&r!==(r=`height:${a[3].height};width:${a[3].width};${a[3].main}`))&&D(e,"style",r)},i(a){s||(v(t.$$.fragment,a),v(o),s=!0)},o(a){w(t.$$.fragment,a),w(o),s=!1},d(a){a&&k(e),P(t),o&&o.d()}}}function ah(i,e,t){let{$$slots:n={},$$scope:r}=e,{title:s=""}=e,{type:o="default"}=e,{hideOnClick:a=!1}=e,{css:l={height:"48px",width:"100%",main:""}}=e,u=!1,f=!1,c=0,h=0,d=0,p=0;const m=S=>{const y=S.currentTarget;if(!y)throw new Error("Not found target for button in drop down");if(!(y instanceof HTMLElement))throw new Error("Target for button is not html element");const A=y.getBoundingClientRect(),I=(visualViewport==null?void 0:visualViewport.height)||720;t(6,c=A.width),t(8,d=A.bottom),t(9,p=A.left),t(7,h=I-d),t(4,u=!u)},_=()=>setTimeout(()=>t(4,u=!1),100),g=()=>t(5,f=!0),b=()=>t(5,f=!1);return i.$$set=S=>{"title"in S&&t(0,s=S.title),"type"in S&&t(1,o=S.type),"hideOnClick"in S&&t(2,a=S.hideOnClick),"css"in S&&t(3,l=S.css),"$$scope"in S&&t(15,r=S.$$scope)},[s,o,a,l,u,f,c,h,d,p,n,m,_,g,b,r]}class li extends ye{constructor(e){super(),Ee(this,e,ah,oh,$e,{title:0,type:1,hideOnClick:2,css:3})}}const lh=i=>({item:i&1}),is=i=>({item:i[0]});function ss(i,e,t){const n=i.slice();return n[13]=e[t],n}const uh=i=>({item:i&2}),os=i=>({item:i[13]});function fh(i){let e;return{c(){e=oe(i[0])},l(t){e=ae(t,i[0])},m(t,n){x(t,e,n)},p(t,n){n&1&&tt(e,t[0])},d(t){t&&k(e)}}}function ch(i){let e;const t=i[8].default,n=Fe(t,i,i[12],is),r=n||fh(i);return{c(){r&&r.c()},l(s){r&&r.l(s)},m(s,o){r&&r.m(s,o),e=!0},p(s,o){n?n.p&&(!e||o&4097)&&Ne(n,t,s,s[12],e?Pe(t,s[12],o,lh):Me(s[12]),is):r&&r.p&&(!e||o&1)&&r.p(s,e?o:-1)},i(s){e||(v(r,s),e=!0)},o(s){w(r,s),e=!1},d(s){r&&r.d(s)}}}function as(i){let e,t,n,r=!1,s,o,a,l,u,f;function c(...m){return i[11](i[13],...m)}const h=i[8].default,d=Fe(h,i,i[12],os),p=d||hh(i);return l=oi(i[10][0]),{c(){e=K("label"),t=K("input"),s=re(),p&&p.c(),o=re(),this.h()},l(m){e=J(m,"LABEL",{class:!0});var _=te(e);t=J(_,"INPUT",{type:!0,class:!0}),s=ie(_),p&&p.l(_),o=ie(_),_.forEach(k),this.h()},h(){D(t,"type","radio"),t.__value=n=i[13],t.value=t.__value,D(t,"class","svelte-1plfxql"),D(e,"class","svelte-1plfxql"),Je(e,"active",i[13]===i[0]),l.p(t)},m(m,_){x(m,e,_),O(e,t),t.checked=t.__value===i[0],O(e,s),p&&p.m(e,null),O(e,o),a=!0,u||(f=[Re(t,"change",i[9]),Re(t,"change",c)],u=!0)},p(m,_){i=m,(!a||_&2&&n!==(n=i[13]))&&(t.__value=n,t.value=t.__value,r=!0),(r||_&3)&&(t.checked=t.__value===i[0]),d?d.p&&(!a||_&4098)&&Ne(d,h,i,i[12],a?Pe(h,i[12],_,uh):Me(i[12]),os):p&&p.p&&(!a||_&2)&&p.p(i,a?_:-1),(!a||_&3)&&Je(e,"active",i[13]===i[0])},i(m){a||(v(p,m),a=!0)},o(m){w(p,m),a=!1},d(m){m&&k(e),p&&p.d(m),l.r(),u=!1,gt(f)}}}function hh(i){let e=i[13]+"",t;return{c(){t=oe(e)},l(n){t=ae(n,e)},m(n,r){x(n,t,r)},p(n,r){r&2&&e!==(e=n[13]+"")&&tt(t,e)},d(n){n&&k(t)}}}function ls(i){let e,t,n=i[13]!=i[2]&&as(i);return{c(){n&&n.c(),e=Ge()},l(r){n&&n.l(r),e=Ge()},m(r,s){n&&n.m(r,s),x(r,e,s),t=!0},p(r,s){r[13]!=r[2]?n?(n.p(r,s),s&6&&v(n,1)):(n=as(r),n.c(),v(n,1),n.m(e.parentNode,e)):n&&(Oe(),w(n,1,1,()=>{n=null}),xe())},i(r){t||(v(n),t=!0)},o(r){w(n),t=!1},d(r){n&&n.d(r),r&&k(e)}}}function mh(i){let e,t,n=i[1],r=[];for(let o=0;ow(r[o],1,1,()=>{r[o]=null});return{c(){for(let o=0;o{g.currentTarget.checked&&h("change",{value:_})};return i.$$set=_=>{"value"in _&&t(0,s=_.value),"items"in _&&t(1,o=_.items),"placeholder"in _&&t(2,a=_.placeholder),"css"in _&&t(3,l=_.css),"hideOnClick"in _&&t(4,u=_.hideOnClick),"type"in _&&t(5,f=_.type),"title"in _&&t(6,c=_.title),"$$scope"in _&&t(12,r=_.$$scope)},[s,o,a,l,u,f,c,h,n,p,d,m,r]}class Et extends ye{constructor(e){super(),Ee(this,e,ph,dh,$e,{value:0,items:1,placeholder:2,css:3,hideOnClick:4,type:5,title:6})}}function _h(i){let e,t,n,r=[{width:i[5]},{height:i[5]},{viewBox:i[4]},{style:n="--sx: "+i[3]+"; --sy: "+i[2]+"; --r: "+i[1]},i[6]],s={};for(let o=0;o{e=fe(fe({},e),ke(b)),t(6,f=cr(e,u)),"type"in b&&t(7,h=b.type),"path"in b&&t(0,d=b.path),"size"in b&&t(8,p=b.size),"viewbox"in b&&t(9,m=b.viewbox),"flip"in b&&t(10,_=b.flip),"rotate"in b&&t(11,g=b.rotate)},i.$$.update=()=>{i.$$.dirty&128&&t(12,n=h?c[h]:c.default),i.$$.dirty&4352&&t(5,r=p||n.size),i.$$.dirty&4608&&t(4,s=m||n.viewbox),i.$$.dirty&1024&&t(3,o=["both","horizontal"].includes(_)?"-1":"1"),i.$$.dirty&1024&&t(2,a=["both","vertical"].includes(_)?"-1":"1"),i.$$.dirty&2048&&t(1,l=isNaN(g)?g:g+"deg")},[d,l,a,o,s,r,f,h,p,m,_,g,n]}class Vn extends ye{constructor(e){super(),Ee(this,e,gh,_h,$e,{type:7,path:0,size:8,viewbox:9,flip:10,rotate:11})}}function bh(i){let e,t,n;const r=i[1].default,s=Fe(r,i,i[0],null);return{c(){e=K("article"),s&&s.c(),this.h()},l(o){e=J(o,"ARTICLE",{class:!0});var a=te(e);s&&s.l(a),a.forEach(k),this.h()},h(){D(e,"class","svelte-i0r9v3")},m(o,a){x(o,e,a),s&&s.m(e,null),n=!0},p(o,[a]){s&&s.p&&(!n||a&1)&&Ne(s,r,o,o[0],n?Pe(r,o[0],a,null):Me(o[0]),null)},i(o){n||(v(s,o),o&&Ot(()=>{n&&(t||(t=ut(e,ft,{},!0)),t.run(1))}),n=!0)},o(o){w(s,o),o&&(t||(t=ut(e,ft,{},!1)),t.run(0)),n=!1},d(o){o&&k(e),s&&s.d(o),o&&t&&t.end()}}}function vh(i,e,t){let{$$slots:n={},$$scope:r}=e;return i.$$set=s=>{"$$scope"in s&&t(0,r=s.$$scope)},[r,n]}class qt extends ye{constructor(e){super(),Ee(this,e,vh,bh,$e,{})}}function $h(i){let e,t,n,r,s,o,a,l,u,f,c,h;function d(g){i[2](g)}let p={step:i[1]};i[0].x!==void 0&&(p.value=i[0].x),r=new Ke({props:p}),ge.push(()=>be(r,"value",d)),r.$on("change",i[3]);function m(g){i[4](g)}let _={step:i[1]};return i[0].y!==void 0&&(_.value=i[0].y),f=new Ke({props:_}),ge.push(()=>be(f,"value",m)),f.$on("change",i[5]),{c(){e=K("section"),t=K("span"),n=oe("x"),F(r.$$.fragment),o=re(),a=K("section"),l=K("span"),u=oe("y"),F(f.$$.fragment),this.h()},l(g){e=J(g,"SECTION",{class:!0});var b=te(e);t=J(b,"SPAN",{class:!0});var S=te(t);n=ae(S,"x"),S.forEach(k),N(r.$$.fragment,b),b.forEach(k),o=ie(g),a=J(g,"SECTION",{class:!0});var y=te(a);l=J(y,"SPAN",{class:!0});var A=te(l);u=ae(A,"y"),A.forEach(k),N(f.$$.fragment,y),y.forEach(k),this.h()},h(){D(t,"class","svelte-22x9w9"),D(e,"class","svelte-22x9w9"),D(l,"class","svelte-22x9w9"),D(a,"class","svelte-22x9w9")},m(g,b){x(g,e,b),O(e,t),O(t,n),M(r,e,null),x(g,o,b),x(g,a,b),O(a,l),O(l,u),M(f,a,null),h=!0},p(g,b){const S={};b&2&&(S.step=g[1]),!s&&b&1&&(s=!0,S.value=g[0].x,ve(()=>s=!1)),r.$set(S);const y={};b&2&&(y.step=g[1]),!c&&b&1&&(c=!0,y.value=g[0].y,ve(()=>c=!1)),f.$set(y)},i(g){h||(v(r.$$.fragment,g),v(f.$$.fragment,g),h=!0)},o(g){w(r.$$.fragment,g),w(f.$$.fragment,g),h=!1},d(g){g&&k(e),P(r),g&&k(o),g&&k(a),P(f)}}}function wh(i){let e,t;return e=new qt({props:{$$slots:{default:[$h]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&67&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function yh(i,e,t){let{value:n}=e,{step:r=1}=e;function s(u){i.$$.not_equal(n.x,u)&&(n.x=u,t(0,n))}function o(u){Ie.call(this,i,u)}function a(u){i.$$.not_equal(n.y,u)&&(n.y=u,t(0,n))}function l(u){Ie.call(this,i,u)}return i.$$set=u=>{"value"in u&&t(0,n=u.value),"step"in u&&t(1,r=u.step)},[n,r,s,o,a,l]}class In extends ye{constructor(e){super(),Ee(this,e,yh,wh,$e,{value:0,step:1})}}function Eh(i){let e,t,n,r;return{c(){e=oe("Цвет"),t=K("input"),this.h()},l(s){e=ae(s,"Цвет"),t=J(s,"INPUT",{type:!0}),this.h()},h(){D(t,"type","color")},m(s,o){x(s,e,o),x(s,t,o),Rt(t,i[0].color),n||(r=[Re(t,"input",i[2]),Re(t,"change",i[1])],n=!0)},p(s,o){o&1&&Rt(t,s[0].color)},d(s){s&&k(e),s&&k(t),n=!1,gt(r)}}}function kh(i){let e,t,n,r;function s(a){i[3](a)}let o={};return i[0].offset!==void 0&&(o.value=i[0].offset),t=new In({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[4]),{c(){e=oe("Сдвиг"),F(t.$$.fragment)},l(a){e=ae(a,"Сдвиг"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].offset,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function Sh(i){let e,t,n,r;function s(a){i[5](a)}let o={min:0,max:1e3};return i[0].blur!==void 0&&(o.value=i[0].blur),t=new Ke({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[6]),{c(){e=oe("Размытие"),F(t.$$.fragment)},l(a){e=ae(a,"Размытие"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].blur,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function Ah(i){let e,t,n,r;function s(a){i[7](a)}let o={min:-1,max:1,step:.01,withRange:!0};return i[0].saturation!==void 0&&(o.value=i[0].saturation),t=new Ke({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[8]),{c(){e=oe("Насыщенность "),F(t.$$.fragment)},l(a){e=ae(a,"Насыщенность "),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].saturation,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function Ih(i){let e,t,n,r,s,o,a,l;return e=new Ze({props:{$$slots:{default:[Eh]},$$scope:{ctx:i}}}),n=new Ze({props:{$$slots:{default:[kh]},$$scope:{ctx:i}}}),s=new Ze({props:{$$slots:{default:[Sh]},$$scope:{ctx:i}}}),a=new Ze({props:{$$slots:{default:[Ah]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment),r=re(),F(s.$$.fragment),o=re(),F(a.$$.fragment)},l(u){N(e.$$.fragment,u),t=ie(u),N(n.$$.fragment,u),r=ie(u),N(s.$$.fragment,u),o=ie(u),N(a.$$.fragment,u)},m(u,f){M(e,u,f),x(u,t,f),M(n,u,f),x(u,r,f),M(s,u,f),x(u,o,f),M(a,u,f),l=!0},p(u,f){const c={};f&513&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const h={};f&513&&(h.$$scope={dirty:f,ctx:u}),n.$set(h);const d={};f&513&&(d.$$scope={dirty:f,ctx:u}),s.$set(d);const p={};f&513&&(p.$$scope={dirty:f,ctx:u}),a.$set(p)},i(u){l||(v(e.$$.fragment,u),v(n.$$.fragment,u),v(s.$$.fragment,u),v(a.$$.fragment,u),l=!0)},o(u){w(e.$$.fragment,u),w(n.$$.fragment,u),w(s.$$.fragment,u),w(a.$$.fragment,u),l=!1},d(u){P(e,u),u&&k(t),P(n,u),u&&k(r),P(s,u),u&&k(o),P(a,u)}}}function Th(i){let e,t;return e=new qt({props:{$$slots:{default:[Ih]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&513&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Ch(i,e,t){let{value:n}=e;function r(h){Ie.call(this,i,h)}function s(){n.color=this.value,t(0,n)}function o(h){i.$$.not_equal(n.offset,h)&&(n.offset=h,t(0,n))}function a(h){Ie.call(this,i,h)}function l(h){i.$$.not_equal(n.blur,h)&&(n.blur=h,t(0,n))}function u(h){Ie.call(this,i,h)}function f(h){i.$$.not_equal(n.saturation,h)&&(n.saturation=h,t(0,n))}function c(h){Ie.call(this,i,h)}return i.$$set=h=>{"value"in h&&t(0,n=h.value)},[n,r,s,o,a,l,u,f,c]}class Rh extends ye{constructor(e){super(),Ee(this,e,Ch,Th,$e,{value:0})}}function Fh(i){let e,t,n;return{c(){e=K("input"),this.h()},l(r){e=J(r,"INPUT",{type:!0}),this.h()},h(){D(e,"type","color")},m(r,s){x(r,e,s),Rt(e,i[0]),t||(n=Re(e,"input",i[1]),t=!0)},p(r,[s]){s&1&&Rt(e,r[0])},i:Be,o:Be,d(r){r&&k(e),t=!1,n()}}}function Nh(i,e,t){let{value:n}=e;function r(){n=this.value,t(0,n)}return i.$$set=s=>{"value"in s&&t(0,n=s.value)},[n,r]}class pn extends ye{constructor(e){super(),Ee(this,e,Nh,Fh,$e,{value:0})}}function Mh(i){let e,t,n,r;function s(a){i[1](a)}let o={};return i[0].value!==void 0&&(o.value=i[0].value),t=new pn({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[2]),{c(){e=oe("Цвет"),F(t.$$.fragment)},l(a){e=ae(a,"Цвет"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].value,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function Ph(i){let e,t;return e=new Ze({props:{$$slots:{default:[Mh]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&9&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Bh(i,e,t){let{value:n}=e;function r(o){i.$$.not_equal(n.value,o)&&(n.value=o,t(0,n))}function s(o){Ie.call(this,i,o)}return i.$$set=o=>{"value"in o&&t(0,n=o.value)},[n,r,s]}class Dh extends ye{constructor(e){super(),Ee(this,e,Bh,Ph,$e,{value:0})}}function zh(i){let e;const t=i[4].default,n=Fe(t,i,i[6],null);return{c(){n&&n.c()},l(r){n&&n.l(r)},m(r,s){n&&n.m(r,s),e=!0},p(r,s){n&&n.p&&(!e||s&64)&&Ne(n,t,r,r[6],e?Pe(t,r[6],s,null):Me(r[6]),null)},i(r){e||(v(n,r),e=!0)},o(r){w(n,r),e=!1},d(r){n&&n.d(r)}}}function Lh(i){let e,t;return e=new Ye({props:{title:i[2],active:i[0],width:i[1],$$slots:{default:[zh]},$$scope:{ctx:i}}}),e.$on("click",i[5]),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&4&&(s.title=n[2]),r&1&&(s.active=n[0]),r&2&&(s.width=n[1]),r&64&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Uh(i,e,t){let{$$slots:n={},$$scope:r}=e,{value:s}=e,{width:o=""}=e,{title:a=""}=e;const l=St(),u=()=>l("change",t(0,s=!s));return i.$$set=f=>{"value"in f&&t(0,s=f.value),"width"in f&&t(1,o=f.width),"title"in f&&t(2,a=f.title),"$$scope"in f&&t(6,r=f.$$scope)},[s,o,a,l,n,u,r]}class Dn extends ye{constructor(e){super(),Ee(this,e,Uh,Lh,$e,{value:0,width:1,title:2})}}function Oh(i){let e;return{c(){e=oe("Выбрать файл...")},l(t){e=ae(t,"Выбрать файл...")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function xh(i){let e,t,n,r,s,o,a;const l=i[5].default,u=Fe(l,i,i[4],null),f=u||Oh();return{c(){e=K("label"),f&&f.c(),t=re(),n=K("input"),this.h()},l(c){e=J(c,"LABEL",{class:!0});var h=te(e);f&&f.l(h),t=ie(h),n=J(h,"INPUT",{accept:!0,type:!0,class:!0}),h.forEach(k),this.h()},h(){D(n,"accept",i[0]),D(n,"type","file"),D(n,"class","svelte-187m8cr"),D(e,"class",r=Ut(i[2])+" svelte-187m8cr")},m(c,h){x(c,e,h),f&&f.m(e,null),O(e,t),O(e,n),s=!0,o||(a=Re(n,"change",i[6]),o=!0)},p(c,[h]){u&&u.p&&(!s||h&16)&&Ne(u,l,c,c[4],s?Pe(l,c[4],h,null):Me(c[4]),null),(!s||h&1)&&D(n,"accept",c[0]),(!s||h&4&&r!==(r=Ut(c[2])+" svelte-187m8cr"))&&D(e,"class",r)},i(c){s||(v(f,c),s=!0)},o(c){w(f,c),s=!1},d(c){c&&k(e),f&&f.d(c),o=!1,a()}}}function Gh(i,e,t){let{$$slots:n={},$$scope:r}=e,{accept:s=void 0}=e,{typeFilter:o=/.*/}=e,{class:a=""}=e;const l=St(),u=f=>{const c=f.currentTarget.files;if(!c||c.length===0)return;const h=Array.from(c).filter(d=>{var p;return(p=d.type)==null?void 0:p.match(o)});h.length!==0&&(l("change",h),f.currentTarget.value="")};return i.$$set=f=>{"accept"in f&&t(0,s=f.accept),"typeFilter"in f&&t(1,o=f.typeFilter),"class"in f&&t(2,a=f.class),"$$scope"in f&&t(4,r=f.$$scope)},[s,o,a,l,r,n,u]}class ur extends ye{constructor(e){super(),Ee(this,e,Gh,xh,$e,{accept:0,typeFilter:1,class:2})}}function jh(i){let e;return{c(){e=oe("Выберите файл")},l(t){e=ae(t,"Выберите файл")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function Hh(i){let e,t;return e=new Ye({props:{$$slots:{default:[jh]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&32&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Vh(i){let e,t,n,r,s,o,a,l;return t=new ur({props:{accept:i[0],typeFilter:i[1],$$slots:{default:[Hh]},$$scope:{ctx:i}}}),t.$on("change",i[3]),{c(){e=K("article"),F(t.$$.fragment),n=re(),r=K("span"),s=oe("или перетащите сюда."),this.h()},l(u){e=J(u,"ARTICLE",{class:!0});var f=te(e);N(t.$$.fragment,f),n=ie(f),r=J(f,"SPAN",{class:!0});var c=te(r);s=ae(c,"или перетащите сюда."),c.forEach(k),f.forEach(k),this.h()},h(){D(r,"class","svelte-1r5ucwz"),D(e,"class","svelte-1r5ucwz")},m(u,f){x(u,e,f),M(t,e,null),O(e,n),O(e,r),O(r,s),o=!0,a||(l=[Re(e,"dragover",Wh),Re(e,"drop",i[2])],a=!0)},p(u,[f]){const c={};f&1&&(c.accept=u[0]),f&2&&(c.typeFilter=u[1]),f&32&&(c.$$scope={dirty:f,ctx:u}),t.$set(c)},i(u){o||(v(t.$$.fragment,u),o=!0)},o(u){w(t.$$.fragment,u),o=!1},d(u){u&&k(e),P(t),a=!1,gt(l)}}}const Wh=i=>i.preventDefault();function qh(i,e,t){let{accept:n=void 0}=e,{typeFilter:r=/.*/g}=e;const s=St();function o(l){var c;l.preventDefault();const u=(c=l.dataTransfer)==null?void 0:c.files;if(!u)return;const f=Array.from(u).filter(h=>{var d;return(d=h.type)==null?void 0:d.match(r)});f.length&&s("change",f)}function a(l){Ie.call(this,i,l)}return i.$$set=l=>{"accept"in l&&t(0,n=l.accept),"typeFilter"in l&&t(1,r=l.typeFilter)},[n,r,o,a]}class ho extends ye{constructor(e){super(),Ee(this,e,qh,Vh,$e,{accept:0,typeFilter:1})}}function us(i){let e,t,n,r,s,o,a,l;return n=new Ze({props:{error:i[1],$$slots:{default:[Zh]},$$scope:{ctx:i}}}),{c(){e=K("section"),t=K("section"),F(n.$$.fragment),r=re(),s=K("section"),o=K("img"),this.h()},l(u){e=J(u,"SECTION",{class:!0});var f=te(e);t=J(f,"SECTION",{class:!0});var c=te(t);N(n.$$.fragment,c),c.forEach(k),r=ie(f),s=J(f,"SECTION",{class:!0});var h=te(s);o=J(h,"IMG",{src:!0,alt:!0,class:!0}),h.forEach(k),f.forEach(k),this.h()},h(){D(t,"class","svelte-n6jyo5"),Un(o.src,a=i[4])||D(o,"src",a),D(o,"alt",i[5]),D(o,"class","svelte-n6jyo5"),D(s,"class","svelte-n6jyo5"),D(e,"class","preview svelte-n6jyo5")},m(u,f){x(u,e,f),O(e,t),M(n,t,null),O(e,r),O(e,s),O(s,o),l=!0},p(u,f){const c={};f&2&&(c.error=u[1]),f&131110&&(c.$$scope={dirty:f,ctx:u}),n.$set(c),(!l||f&16&&!Un(o.src,a=u[4]))&&D(o,"src",a),(!l||f&32)&&D(o,"alt",u[5])},i(u){l||(v(n.$$.fragment,u),l=!0)},o(u){w(n.$$.fragment,u),l=!1},d(u){u&&k(e),P(n)}}}function Zh(i){let e,t,n,r;return{c(){e=oe("Название "),t=K("input"),this.h()},l(s){e=ae(s,"Название "),t=J(s,"INPUT",{class:!0}),this.h()},h(){D(t,"class","svelte-n6jyo5")},m(s,o){x(s,e,o),x(s,t,o),Rt(t,i[5]),n||(r=[Re(t,"input",i[11]),Re(t,"input",i[12])],n=!0)},p(s,o){o&32&&t.value!==s[5]&&Rt(t,s[5])},d(s){s&&k(e),s&&k(t),n=!1,gt(r)}}}function Xh(i){let e,t,n,r;e=new ho({props:{accept:"image/*",typeFilter:/^image\//}}),e.$on("change",i[7]);let s=i[3]&&us(i);return{c(){F(e.$$.fragment),t=re(),s&&s.c(),n=Ge()},l(o){N(e.$$.fragment,o),t=ie(o),s&&s.l(o),n=Ge()},m(o,a){M(e,o,a),x(o,t,a),s&&s.m(o,a),x(o,n,a),r=!0},p(o,a){o[3]?s?(s.p(o,a),a&8&&v(s,1)):(s=us(o),s.c(),v(s,1),s.m(n.parentNode,n)):s&&(Oe(),w(s,1,1,()=>{s=null}),xe())},i(o){r||(v(e.$$.fragment,o),v(s),r=!0)},o(o){w(e.$$.fragment,o),w(s),r=!1},d(o){P(e,o),o&&k(t),s&&s.d(o),o&&k(n)}}}function Yh(i){let e,t,n,r,s,o;return t=new qt({props:{$$slots:{default:[Xh]},$$scope:{ctx:i}}}),{c(){e=K("article"),F(t.$$.fragment),n=re(),r=K("section"),s=oe(`Добавленные паттерны пропадут между перезагрузками страницы, но их можно сохранить в .meme + файле.`),this.h()},l(a){e=J(a,"ARTICLE",{class:!0});var l=te(e);N(t.$$.fragment,l),n=ie(l),r=J(l,"SECTION",{});var u=te(r);s=ae(u,`Добавленные паттерны пропадут между перезагрузками страницы, но их можно сохранить в .meme + файле.`),u.forEach(k),l.forEach(k),this.h()},h(){D(e,"class","svelte-n6jyo5")},m(a,l){x(a,e,l),M(t,e,null),O(e,n),O(e,r),O(r,s),o=!0},p(a,l){const u={};l&131134&&(u.$$scope={dirty:l,ctx:a}),t.$set(u)},i(a){o||(v(t.$$.fragment,a),o=!0)},o(a){w(t.$$.fragment,a),o=!1},d(a){a&&k(e),P(t)}}}function Kh(i){let e,t;return{c(){e=K("header"),t=oe("Добавить паттерн"),this.h()},l(n){e=J(n,"HEADER",{slot:!0});var r=te(e);t=ae(r,"Добавить паттерн"),r.forEach(k),this.h()},h(){D(e,"slot","title")},m(n,r){x(n,e,r),O(e,t)},p:Be,d(n){n&&k(e)}}}function Jh(i){let e;return{c(){e=oe("Отмена")},l(t){e=ae(t,"Отмена")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function Qh(i){let e;return{c(){e=oe("Добавить")},l(t){e=ae(t,"Добавить")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function e0(i){let e,t,n,r,s;return t=new Ye({props:{width:"128px",type:"danger",$$slots:{default:[Jh]},$$scope:{ctx:i}}}),t.$on("click",i[10]),r=new Ye({props:{width:"128px",type:"primary",style:"margin-left:16px;",disabled:!i[5],$$slots:{default:[Qh]},$$scope:{ctx:i}}}),r.$on("click",i[9]),{c(){e=K("footer"),F(t.$$.fragment),n=re(),F(r.$$.fragment),this.h()},l(o){e=J(o,"FOOTER",{slot:!0,class:!0});var a=te(e);N(t.$$.fragment,a),n=ie(a),N(r.$$.fragment,a),a.forEach(k),this.h()},h(){D(e,"slot","footer"),D(e,"class","svelte-n6jyo5")},m(o,a){x(o,e,a),M(t,e,null),O(e,n),M(r,e,null),s=!0},p(o,a){const l={};a&131072&&(l.$$scope={dirty:a,ctx:o}),t.$set(l);const u={};a&32&&(u.disabled=!o[5]),a&131072&&(u.$$scope={dirty:a,ctx:o}),r.$set(u)},i(o){s||(v(t.$$.fragment,o),v(r.$$.fragment,o),s=!0)},o(o){w(t.$$.fragment,o),w(r.$$.fragment,o),s=!1},d(o){o&&k(e),P(t),P(r)}}}function t0(i){let e,t,n;function r(o){i[13](o)}let s={$$slots:{footer:[e0],title:[Kh],default:[Yh]},$$scope:{ctx:i}};return i[0]!==void 0&&(s.open=i[0]),e=new mn({props:s}),ge.push(()=>be(e,"open",r)),e.$on("close",i[8]),e.$on("paste",i[14]),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,[a]){const l={};a&131134&&(l.$$scope={dirty:a,ctx:o}),!t&&a&1&&(t=!0,l.open=o[0],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function n0(i,e,t){let{open:n=!0}=e,{error:r=""}=e,{validateName:s=()=>""}=e,o=null,a="",l="";function u(y){o!=y&&(a&&(URL.revokeObjectURL(a),t(4,a="")),t(3,o=y),o&&(t(4,a=URL.createObjectURL(o)),t(5,l=o.name.substring(0,o.name.lastIndexOf(".")))))}function f(y){var C,H;const A=document.activeElement;if(A instanceof HTMLInputElement||A instanceof HTMLTextAreaElement)return;const I=(C=y.clipboardData)==null?void 0:C.items;if(I)for(let G=0;G()=>{a&&URL.revokeObjectURL(a)});const m=()=>d();function _(){l=this.value,t(5,l)}const g=()=>{t(1,r=s(l))};function b(y){n=y,t(0,n)}const S=y=>f(y.detail.event);return i.$$set=y=>{"open"in y&&t(0,n=y.open),"error"in y&&t(1,r=y.error),"validateName"in y&&t(2,s=y.validateName)},[n,r,s,o,a,l,f,c,d,p,m,_,g,b,S]}class r0 extends ye{constructor(e){super(),Ee(this,e,n0,t0,$e,{open:0,error:1,validateName:2})}}class i0{constructor(e=new Array){Ce(this,"subscribers",new Set);this.patterns=e}subscribe(e){return this.subscribers.add(e),e(this.patterns),()=>{this.subscribers.delete(e)}}addPattern(...e){this.patterns=this.patterns.filter(t=>!e.find(n=>n.name==t.name)),this.patterns.push(...e),this.subscribers.forEach(t=>t(this.patterns))}getTexture(e){const t=this.patterns.find(n=>n.name==e);if(!t)throw new Error(`Not found pattern '${e}'`);return t.textureId}has(e){return this.patterns.find(n=>n.name==e)!=null}delete(e){this.patterns.splice(this.patterns.findIndex(t=>t.name==e),1),this.subscribers.forEach(t=>t(this.patterns))}clear(){this.patterns=[],this.subscribers.forEach(e=>e(this.patterns))}}const Ct=new i0;function s0(i){let e=i[17]+"",t;return{c(){t=oe(e)},l(n){t=ae(n,e)},m(n,r){x(n,t,r)},p(n,r){r&131072&&e!==(e=n[17]+"")&&tt(t,e)},d(n){n&&k(t)}}}function o0(i){let e,t;return e=new fo({props:{size:28}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function a0(i){let e,t,n,r,s,o;function a(u){i[5](u)}let l={items:i[2].map(cs),$$slots:{default:[s0,({item:u})=>({17:u}),({item:u})=>u?131072:0]},$$scope:{ctx:i}};return i[0].name!==void 0&&(l.value=i[0].name),t=new Et({props:l}),ge.push(()=>be(t,"value",a)),s=new Ye({props:{title:"Добавить изображение как паттерн",width:"fin-content",$$slots:{default:[o0]},$$scope:{ctx:i}}}),s.$on("click",i[6]),{c(){e=oe("Паттерн "),F(t.$$.fragment),r=re(),F(s.$$.fragment)},l(u){e=ae(u,"Паттерн "),N(t.$$.fragment,u),r=ie(u),N(s.$$.fragment,u)},m(u,f){x(u,e,f),M(t,u,f),x(u,r,f),M(s,u,f),o=!0},p(u,f){const c={};f&4&&(c.items=u[2].map(cs)),f&393216&&(c.$$scope={dirty:f,ctx:u}),!n&&f&1&&(n=!0,c.value=u[0].name,ve(()=>n=!1)),t.$set(c);const h={};f&262144&&(h.$$scope={dirty:f,ctx:u}),s.$set(h)},i(u){o||(v(t.$$.fragment,u),v(s.$$.fragment,u),o=!0)},o(u){w(t.$$.fragment,u),w(s.$$.fragment,u),o=!1},d(u){u&&k(e),P(t,u),u&&k(r),P(s,u)}}}function l0(i){let e,t,n,r;function s(a){i[7](a)}let o={withRange:!0,min:-360,max:360,step:.5};return i[0].rotate!==void 0&&(o.value=i[0].rotate),t=new Ke({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[8]),{c(){e=oe("Поворот "),F(t.$$.fragment)},l(a){e=ae(a,"Поворот "),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].rotate,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function u0(i){let e,t,n,r;function s(a){i[9](a)}let o={};return i[0].shift!==void 0&&(o.value=i[0].shift),t=new In({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[10]),{c(){e=oe("Сдвиг"),F(t.$$.fragment)},l(a){e=ae(a,"Сдвиг"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].shift,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function f0(i){let e;return{c(){e=oe("Авто")},l(t){e=ae(t,"Авто")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function c0(i){let e,t,n;return t=new Dn({props:{title:"Авто = растягивать по прямоугольнику",value:i[0].scale==="font",$$slots:{default:[f0]},$$scope:{ctx:i}}}),t.$on("change",i[11]),t.$on("change",i[12]),{c(){e=oe("Масштаб "),F(t.$$.fragment)},l(r){e=ae(r,"Масштаб "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=r[0].scale==="font"),s&262144&&(o.$$scope={dirty:s,ctx:r}),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function fs(i){let e,t;return e=new Ze({props:{$$slots:{default:[h0]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&262145&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function h0(i){let e,t,n,r,s;function o(l){i[13](l)}let a={step:.1};return i[0].scale!==void 0&&(a.value=i[0].scale),n=new In({props:a}),ge.push(()=>be(n,"value",o)),n.$on("change",i[14]),{c(){e=K("div"),t=re(),F(n.$$.fragment)},l(l){e=J(l,"DIV",{}),te(e).forEach(k),t=ie(l),N(n.$$.fragment,l)},m(l,u){x(l,e,u),x(l,t,u),M(n,l,u),s=!0},p(l,u){const f={};!r&&u&1&&(r=!0,f.value=l[0].scale,ve(()=>r=!1)),n.$set(f)},i(l){s||(v(n.$$.fragment,l),s=!0)},o(l){w(n.$$.fragment,l),s=!1},d(l){l&&k(e),l&&k(t),P(n,l)}}}function m0(i){let e,t,n,r,s,o,a,l,u,f,c,h;e=new Ze({props:{for:"ignore",$$slots:{default:[a0]},$$scope:{ctx:i}}}),n=new Ze({props:{$$slots:{default:[l0]},$$scope:{ctx:i}}}),s=new Ze({props:{$$slots:{default:[u0]},$$scope:{ctx:i}}}),a=new Ze({props:{$$slots:{default:[c0]},$$scope:{ctx:i}}});let d=i[0].scale!=="font"&&fs(i);function p(_){i[15](_)}let m={validateName:i[3]};return i[1]!==void 0&&(m.open=i[1]),f=new r0({props:m}),ge.push(()=>be(f,"open",p)),f.$on("submit",i[4]),{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment),r=re(),F(s.$$.fragment),o=re(),F(a.$$.fragment),l=re(),d&&d.c(),u=re(),F(f.$$.fragment)},l(_){N(e.$$.fragment,_),t=ie(_),N(n.$$.fragment,_),r=ie(_),N(s.$$.fragment,_),o=ie(_),N(a.$$.fragment,_),l=ie(_),d&&d.l(_),u=ie(_),N(f.$$.fragment,_)},m(_,g){M(e,_,g),x(_,t,g),M(n,_,g),x(_,r,g),M(s,_,g),x(_,o,g),M(a,_,g),x(_,l,g),d&&d.m(_,g),x(_,u,g),M(f,_,g),h=!0},p(_,[g]){const b={};g&262151&&(b.$$scope={dirty:g,ctx:_}),e.$set(b);const S={};g&262145&&(S.$$scope={dirty:g,ctx:_}),n.$set(S);const y={};g&262145&&(y.$$scope={dirty:g,ctx:_}),s.$set(y);const A={};g&262145&&(A.$$scope={dirty:g,ctx:_}),a.$set(A),_[0].scale!=="font"?d?(d.p(_,g),g&1&&v(d,1)):(d=fs(_),d.c(),v(d,1),d.m(u.parentNode,u)):d&&(Oe(),w(d,1,1,()=>{d=null}),xe());const I={};!c&&g&2&&(c=!0,I.open=_[1],ve(()=>c=!1)),f.$set(I)},i(_){h||(v(e.$$.fragment,_),v(n.$$.fragment,_),v(s.$$.fragment,_),v(a.$$.fragment,_),v(d),v(f.$$.fragment,_),h=!0)},o(_){w(e.$$.fragment,_),w(n.$$.fragment,_),w(s.$$.fragment,_),w(a.$$.fragment,_),w(d),w(f.$$.fragment,_),h=!1},d(_){P(e,_),_&&k(t),P(n,_),_&&k(r),P(s,_),_&&k(o),P(a,_),_&&k(l),d&&d.d(_),_&&k(u),P(f,_)}}}const cs=i=>i.name;function d0(i,e,t){let n;yt(i,Ct,y=>t(2,n=y));let{value:r}=e;const s=St();function o(y){return Ct.has(y)?"Это имя уже занято":""}function a(y){s("addPattern",y.detail),t(0,r.name=y.detail.name,r)}let l=!1;function u(y){i.$$.not_equal(r.name,y)&&(r.name=y,t(0,r))}const f=()=>t(1,l=!0);function c(y){i.$$.not_equal(r.rotate,y)&&(r.rotate=y,t(0,r))}function h(y){Ie.call(this,i,y)}function d(y){i.$$.not_equal(r.shift,y)&&(r.shift=y,t(0,r))}function p(y){Ie.call(this,i,y)}const m=y=>t(0,r.scale=y.detail?"font":{x:1,y:1},r);function _(y){Ie.call(this,i,y)}function g(y){i.$$.not_equal(r.scale,y)&&(r.scale=y,t(0,r))}function b(y){Ie.call(this,i,y)}function S(y){l=y,t(1,l)}return i.$$set=y=>{"value"in y&&t(0,r=y.value)},[r,l,n,o,a,u,f,c,h,d,p,m,_,g,b,S]}class p0 extends ye{constructor(e){super(),Ee(this,e,d0,m0,$e,{value:0})}}function _0(i){let e,t,n,r;function s(a){i[1](a)}let o={};return i[0].color1!==void 0&&(o.value=i[0].color1),t=new pn({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[2]),{c(){e=oe("Слева"),F(t.$$.fragment)},l(a){e=ae(a,"Слева"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].color1,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function g0(i){let e,t,n,r;function s(a){i[3](a)}let o={};return i[0].color2!==void 0&&(o.value=i[0].color2),t=new pn({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[4]),{c(){e=oe("Справа"),F(t.$$.fragment)},l(a){e=ae(a,"Справа"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].color2,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function b0(i){let e,t,n,r;function s(a){i[5](a)}let o={};return i[0].color3!==void 0&&(o.value=i[0].color3),t=new pn({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[6]),{c(){e=oe("Сверху"),F(t.$$.fragment)},l(a){e=ae(a,"Сверху"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].color3,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function v0(i){let e,t,n,r;function s(a){i[7](a)}let o={};return i[0].color4!==void 0&&(o.value=i[0].color4),t=new pn({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[8]),{c(){e=oe("Снизу"),F(t.$$.fragment)},l(a){e=ae(a,"Снизу"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].color4,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function $0(i){let e,t,n,r,s,o,a,l;return e=new Ze({props:{$$slots:{default:[_0]},$$scope:{ctx:i}}}),n=new Ze({props:{$$slots:{default:[g0]},$$scope:{ctx:i}}}),s=new Ze({props:{$$slots:{default:[b0]},$$scope:{ctx:i}}}),a=new Ze({props:{$$slots:{default:[v0]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment),r=re(),F(s.$$.fragment),o=re(),F(a.$$.fragment)},l(u){N(e.$$.fragment,u),t=ie(u),N(n.$$.fragment,u),r=ie(u),N(s.$$.fragment,u),o=ie(u),N(a.$$.fragment,u)},m(u,f){M(e,u,f),x(u,t,f),M(n,u,f),x(u,r,f),M(s,u,f),x(u,o,f),M(a,u,f),l=!0},p(u,[f]){const c={};f&513&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const h={};f&513&&(h.$$scope={dirty:f,ctx:u}),n.$set(h);const d={};f&513&&(d.$$scope={dirty:f,ctx:u}),s.$set(d);const p={};f&513&&(p.$$scope={dirty:f,ctx:u}),a.$set(p)},i(u){l||(v(e.$$.fragment,u),v(n.$$.fragment,u),v(s.$$.fragment,u),v(a.$$.fragment,u),l=!0)},o(u){w(e.$$.fragment,u),w(n.$$.fragment,u),w(s.$$.fragment,u),w(a.$$.fragment,u),l=!1},d(u){P(e,u),u&&k(t),P(n,u),u&&k(r),P(s,u),u&&k(o),P(a,u)}}}function w0(i,e,t){let{value:n}=e;function r(h){i.$$.not_equal(n.color1,h)&&(n.color1=h,t(0,n))}function s(h){Ie.call(this,i,h)}function o(h){i.$$.not_equal(n.color2,h)&&(n.color2=h,t(0,n))}function a(h){Ie.call(this,i,h)}function l(h){i.$$.not_equal(n.color3,h)&&(n.color3=h,t(0,n))}function u(h){Ie.call(this,i,h)}function f(h){i.$$.not_equal(n.color4,h)&&(n.color4=h,t(0,n))}function c(h){Ie.call(this,i,h)}return i.$$set=h=>{"value"in h&&t(0,n=h.value)},[n,r,s,o,a,l,u,f,c]}class y0 extends ye{constructor(e){super(),Ee(this,e,w0,$0,$e,{value:0})}}function E0(i){let e,t,n,r;return{c(){e=K("textarea"),this.h()},l(s){e=J(s,"TEXTAREA",{rows:!0,class:!0}),te(e).forEach(k),this.h()},h(){var s,o;e.value=i[1],D(e,"rows",t=((o=(s=i[1])==null?void 0:s.split(` +`))==null?void 0:o.length)||1),D(e,"class","svelte-1g0ox8l")},m(s,o){x(s,e,o),n||(r=Re(e,"change",i[2]),n=!0)},p(s,[o]){var a,l;o&2&&(e.value=s[1]),o&2&&t!==(t=((l=(a=s[1])==null?void 0:a.split(` +`))==null?void 0:l.length)||1)&&D(e,"rows",t)},i:Be,o:Be,d(s){s&&k(e),n=!1,r()}}}function k0(i,e,t){let{value:n}=e,r="";const s=o=>{try{t(0,n=JSON.parse(o.currentTarget.value))}catch(a){console.warn(a)}};return i.$$set=o=>{"value"in o&&t(0,n=o.value)},i.$$.update=()=>{i.$$.dirty&1&&t(1,r=JSON.stringify(n,void 0,4))},[n,r,s]}class mo extends ye{constructor(e){super(),Ee(this,e,k0,E0,$e,{value:0})}}function S0(i){let e,t,n,r,s,o;return{c(){e=K("article"),t=K("input"),n=re(),r=K("span"),this.h()},l(a){e=J(a,"ARTICLE",{class:!0});var l=te(e);t=J(l,"INPUT",{type:!0,class:!0}),n=ie(l),r=J(l,"SPAN",{class:!0}),te(r).forEach(k),l.forEach(k),this.h()},h(){D(t,"type","checkbox"),D(t,"class","svelte-t8yx33"),D(r,"class","svelte-t8yx33"),D(e,"class","svelte-t8yx33")},m(a,l){x(a,e,l),O(e,t),t.checked=i[0],O(e,n),O(e,r),s||(o=[Re(t,"change",i[2]),Re(t,"input",i[3]),Re(t,"change",i[4])],s=!0)},p(a,[l]){l&1&&(t.checked=a[0])},i:Be,o:Be,d(a){a&&k(e),s=!1,gt(o)}}}function A0(i,e,t){let{value:n}=e;const r=St();function s(){n=this.checked,t(0,n)}const o=l=>r("input",l.currentTarget.checked),a=l=>r("change",l.currentTarget.checked);return i.$$set=l=>{"value"in l&&t(0,n=l.value)},[n,r,s,o,a]}class po extends ye{constructor(e){super(),Ee(this,e,A0,S0,$e,{value:0})}}function hs(i){const e=i[0].settings.type;i[19]=e}function I0(i){let e=i[2][i[20]]+"",t;return{c(){t=oe(e)},l(n){t=ae(n,e)},m(n,r){x(n,t,r)},p(n,r){r&1048576&&e!==(e=n[2][n[20]]+"")&&tt(t,e)},d(n){n&&k(t)}}}function ms(i){let e,t;return e=new qt({props:{$$slots:{default:[P0]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&2097153&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function T0(i){let e,t,n,r,s;function o(l){i[12](l)}let a={};return i[0].settings!==void 0&&(a.value=i[0].settings),t=new mo({props:a}),ge.push(()=>be(t,"value",o)),{c(){e=K("div"),F(t.$$.fragment)},l(l){e=J(l,"DIV",{});var u=te(e);N(t.$$.fragment,u),u.forEach(k)},m(l,u){x(l,e,u),M(t,e,null),s=!0},p(l,u){const f={};!n&&u&1&&(n=!0,f.value=l[0].settings,ve(()=>n=!1)),t.$set(f)},i(l){s||(v(t.$$.fragment,l),l&&Ot(()=>{s&&(r||(r=ut(e,ft,{},!0)),r.run(1))}),s=!0)},o(l){w(t.$$.fragment,l),l&&(r||(r=ut(e,ft,{},!1)),r.run(0)),s=!1},d(l){l&&k(e),P(t),l&&r&&r.end()}}}function C0(i){let e,t,n,r,s;function o(l){i[11](l)}let a={};return i[0].settings!==void 0&&(a.value=i[0].settings),t=new y0({props:a}),ge.push(()=>be(t,"value",o)),{c(){e=K("div"),F(t.$$.fragment)},l(l){e=J(l,"DIV",{});var u=te(e);N(t.$$.fragment,u),u.forEach(k)},m(l,u){x(l,e,u),M(t,e,null),s=!0},p(l,u){const f={};!n&&u&1&&(n=!0,f.value=l[0].settings,ve(()=>n=!1)),t.$set(f)},i(l){s||(v(t.$$.fragment,l),l&&Ot(()=>{s&&(r||(r=ut(e,ft,{},!0)),r.run(1))}),s=!0)},o(l){w(t.$$.fragment,l),l&&(r||(r=ut(e,ft,{},!1)),r.run(0)),s=!1},d(l){l&&k(e),P(t),l&&r&&r.end()}}}function R0(i){let e,t,n,r,s;function o(l){i[8](l)}let a={};return i[0].settings!==void 0&&(a.value=i[0].settings),t=new p0({props:a}),ge.push(()=>be(t,"value",o)),t.$on("change",i[9]),t.$on("addPattern",i[10]),{c(){e=K("div"),F(t.$$.fragment)},l(l){e=J(l,"DIV",{});var u=te(e);N(t.$$.fragment,u),u.forEach(k)},m(l,u){x(l,e,u),M(t,e,null),s=!0},p(l,u){const f={};!n&&u&1&&(n=!0,f.value=l[0].settings,ve(()=>n=!1)),t.$set(f)},i(l){s||(v(t.$$.fragment,l),l&&Ot(()=>{s&&(r||(r=ut(e,ft,{},!0)),r.run(1))}),s=!0)},o(l){w(t.$$.fragment,l),l&&(r||(r=ut(e,ft,{},!1)),r.run(0)),s=!1},d(l){l&&k(e),P(t),l&&r&&r.end()}}}function F0(i){let e,t,n,r,s;function o(l){i[6](l)}let a={};return i[0].settings!==void 0&&(a.value=i[0].settings),t=new Dh({props:a}),ge.push(()=>be(t,"value",o)),t.$on("change",i[7]),{c(){e=K("div"),F(t.$$.fragment)},l(l){e=J(l,"DIV",{});var u=te(e);N(t.$$.fragment,u),u.forEach(k)},m(l,u){x(l,e,u),M(t,e,null),s=!0},p(l,u){const f={};!n&&u&1&&(n=!0,f.value=l[0].settings,ve(()=>n=!1)),t.$set(f)},i(l){s||(v(t.$$.fragment,l),l&&Ot(()=>{s&&(r||(r=ut(e,ft,{},!0)),r.run(1))}),s=!0)},o(l){w(t.$$.fragment,l),l&&(r||(r=ut(e,ft,{},!1)),r.run(0)),s=!1},d(l){l&&k(e),P(t),l&&r&&r.end()}}}function N0(i){let e,t,n;return t=new Ke({props:{withRange:!0,min:0,max:100,step:1,value:100-i[0].alpha*100}}),t.$on("change",i[13]),t.$on("input",i[14]),{c(){e=oe("Прозрачность (%) "),F(t.$$.fragment)},l(r){e=ae(r,"Прозрачность (%) "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=100-r[0].alpha*100),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function M0(i){let e,t,n;return t=new po({props:{value:i[0].shadow!==void 0}}),t.$on("change",i[15]),t.$on("change",i[16]),{c(){e=oe("Тень "),F(t.$$.fragment)},l(r){e=ae(r,"Тень "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=r[0].shadow!==void 0),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function ds(i){let e,t,n,r;function s(a){i[17](a)}let o={};return i[0].shadow!==void 0&&(o.value=i[0].shadow),t=new Rh({props:o}),ge.push(()=>be(t,"value",s)),t.$on("change",i[18]),{c(){e=K("div"),F(t.$$.fragment)},l(a){e=J(a,"DIV",{});var l=te(e);N(t.$$.fragment,l),l.forEach(k)},m(a,l){x(a,e,l),M(t,e,null),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].shadow,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t)}}}function P0(i){hs(i);let e,t,n,r,s,o,a,l,u,f;const c=[F0,R0,C0,T0],h=[];function d(m,_){return m[19]==="color"?0:m[19]==="pattern"?1:m[19]==="gradient4"?2:3}e=d(i),t=h[e]=c[e](i),s=new Ze({props:{$$slots:{default:[N0]},$$scope:{ctx:i}}}),a=new Ze({props:{$$slots:{default:[M0]},$$scope:{ctx:i}}});let p=i[0].shadow&&ds(i);return{c(){t.c(),n=re(),r=K("div"),F(s.$$.fragment),o=re(),F(a.$$.fragment),l=re(),p&&p.c()},l(m){t.l(m),n=ie(m),r=J(m,"DIV",{});var _=te(r);N(s.$$.fragment,_),o=ie(_),N(a.$$.fragment,_),l=ie(_),p&&p.l(_),_.forEach(k)},m(m,_){h[e].m(m,_),x(m,n,_),x(m,r,_),M(s,r,null),O(r,o),M(a,r,null),O(r,l),p&&p.m(r,null),f=!0},p(m,_){hs(m);let g=e;e=d(m),e===g?h[e].p(m,_):(Oe(),w(h[g],1,1,()=>{h[g]=null}),xe(),t=h[e],t?t.p(m,_):(t=h[e]=c[e](m),t.c()),v(t,1),t.m(n.parentNode,n));const b={};_&2097153&&(b.$$scope={dirty:_,ctx:m}),s.$set(b);const S={};_&2097153&&(S.$$scope={dirty:_,ctx:m}),a.$set(S),m[0].shadow?p?(p.p(m,_),_&1&&v(p,1)):(p=ds(m),p.c(),v(p,1),p.m(r,null)):p&&(Oe(),w(p,1,1,()=>{p=null}),xe())},i(m){f||(v(t),v(s.$$.fragment,m),v(a.$$.fragment,m),v(p),m&&Ot(()=>{f&&(u||(u=ut(r,ft,{},!0)),u.run(1))}),f=!0)},o(m){w(t),w(s.$$.fragment,m),w(a.$$.fragment,m),w(p),m&&(u||(u=ut(r,ft,{},!1)),u.run(0)),f=!1},d(m){h[e].d(m),m&&k(n),m&&k(r),P(s),P(a),p&&p.d(),m&&u&&u.end()}}}function B0(i){let e,t,n,r,s;n=new Et({props:{value:i[0].settings.type,items:i[3],$$slots:{default:[I0,({item:a})=>({20:a}),({item:a})=>a?1048576:0]},$$scope:{ctx:i}}}),n.$on("change",i[1]),n.$on("change",i[5]);let o=i[0].settings.type!=="disabled"&&ms(i);return{c(){e=K("article"),t=K("header"),F(n.$$.fragment),r=re(),o&&o.c(),this.h()},l(a){e=J(a,"ARTICLE",{class:!0});var l=te(e);t=J(l,"HEADER",{});var u=te(t);N(n.$$.fragment,u),u.forEach(k),r=ie(l),o&&o.l(l),l.forEach(k),this.h()},h(){D(e,"class","svelte-1b7lwvz")},m(a,l){x(a,e,l),O(e,t),M(n,t,null),O(e,r),o&&o.m(e,null),s=!0},p(a,[l]){const u={};l&1&&(u.value=a[0].settings.type),l&3145728&&(u.$$scope={dirty:l,ctx:a}),n.$set(u),a[0].settings.type!=="disabled"?o?(o.p(a,l),l&1&&v(o,1)):(o=ms(a),o.c(),v(o,1),o.m(e,null)):o&&(Oe(),w(o,1,1,()=>{o=null}),xe())},i(a){s||(v(n.$$.fragment,a),v(o),s=!0)},o(a){w(n.$$.fragment,a),w(o),s=!1},d(a){a&&k(e),P(n),o&&o.d()}}}function D0(i,e,t){let{value:n}=e,{defaults:r}=e;function s(I){const C=r.find(H=>H.type===I.detail.value);if(!C)throw new Error(`Not found default value for type ${I.detail.value}`);t(0,n.settings=structuredClone(C),n)}const o={disabled:"Выключить",color:"Цвет",pattern:"Паттерн",gradient4:"Градиент (крестовой)"},a=Object.keys(o);function l(I){Ie.call(this,i,I)}function u(I){i.$$.not_equal(n.settings,I)&&(n.settings=I,t(0,n))}function f(I){Ie.call(this,i,I)}function c(I){i.$$.not_equal(n.settings,I)&&(n.settings=I,t(0,n))}function h(I){Ie.call(this,i,I)}function d(I){Ie.call(this,i,I)}function p(I){i.$$.not_equal(n.settings,I)&&(n.settings=I,t(0,n))}function m(I){i.$$.not_equal(n.settings,I)&&(n.settings=I,t(0,n))}function _(I){Ie.call(this,i,I)}const g=I=>{t(0,n.alpha=(100-I.detail)/100,n)},b=I=>{t(0,n.shadow=I.detail?{blur:10,color:"#000000",offset:{x:0,y:0},saturation:0}:void 0,n)};function S(I){Ie.call(this,i,I)}function y(I){i.$$.not_equal(n.shadow,I)&&(n.shadow=I,t(0,n))}function A(I){Ie.call(this,i,I)}return i.$$set=I=>{"value"in I&&t(0,n=I.value),"defaults"in I&&t(4,r=I.defaults)},[n,s,o,a,r,l,u,f,c,h,d,p,m,_,g,b,S,y,A]}class _o extends ye{constructor(e){super(),Ee(this,e,D0,B0,$e,{value:0,defaults:4})}}function Ht({italic:i,smallCaps:e,bold:t,family:n},r){return`${i?"italic":"normal"} ${e?"small-caps":"normal"} ${t?"bold":"normal"} ${r}px "${n}"`}class Nn{constructor(e){Ce(this,"subscribers",new Set);this.value=e}update(e){this.set(e(this.value))}subscribe(e){return e(this.value),this.subscribers.add(e),()=>{this.subscribers.delete(e)}}set(e){this.value=e,this.subscribers.forEach(t=>t(e))}}function hr(i,e){if(i===e)return!0;if(typeof i!=typeof e)return!1;if(typeof i=="number"&&isNaN(i)&&isNaN(e))return!0;if(typeof i!="object"||typeof e!="object"||i===null||e===null)return!1;if(Array.isArray(i)){if(Array.isArray(e)){if(i.length!=e.length)return!1;for(let s=0;s + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/main/LICENSE +*/(function(i,e){(function(t){i.exports=t()})(function(){return function t(n,r,s){function o(u,f){if(!r[u]){if(!n[u]){var c=typeof Jn=="function"&&Jn;if(!f&&c)return c(u,!0);if(a)return a(u,!0);var h=new Error("Cannot find module '"+u+"'");throw h.code="MODULE_NOT_FOUND",h}var d=r[u]={exports:{}};n[u][0].call(d.exports,function(p){var m=n[u][1][p];return o(m||p)},d,d.exports,t,n,r,s)}return r[u].exports}for(var a=typeof Jn=="function"&&Jn,l=0;l>2,d=(3&u)<<4|f>>4,p=1>6:64,m=2>4,f=(15&h)<<4|(d=a.indexOf(l.charAt(m++)))>>2,c=(3&d)<<6|(p=a.indexOf(l.charAt(m++))),b[_++]=u,d!==64&&(b[_++]=f),p!==64&&(b[_++]=c);return b}},{"./support":30,"./utils":32}],2:[function(t,n,r){var s=t("./external"),o=t("./stream/DataWorker"),a=t("./stream/Crc32Probe"),l=t("./stream/DataLengthProbe");function u(f,c,h,d,p){this.compressedSize=f,this.uncompressedSize=c,this.crc32=h,this.compression=d,this.compressedContent=p}u.prototype={getContentWorker:function(){var f=new o(s.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),c=this;return f.on("end",function(){if(this.streamInfo.data_length!==c.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new o(s.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},u.createWorkerFrom=function(f,c,h){return f.pipe(new a).pipe(new l("uncompressedSize")).pipe(c.compressWorker(h)).pipe(new l("compressedSize")).withStreamInfo("compression",c)},n.exports=u},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,n,r){var s=t("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new s("STORE compression")},uncompressWorker:function(){return new s("STORE decompression")}},r.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,n,r){var s=t("./utils"),o=function(){for(var a,l=[],u=0;u<256;u++){a=u;for(var f=0;f<8;f++)a=1&a?3988292384^a>>>1:a>>>1;l[u]=a}return l}();n.exports=function(a,l){return a!==void 0&&a.length?s.getTypeOf(a)!=="string"?function(u,f,c,h){var d=o,p=h+c;u^=-1;for(var m=h;m>>8^d[255&(u^f[m])];return-1^u}(0|l,a,a.length,0):function(u,f,c,h){var d=o,p=h+c;u^=-1;for(var m=h;m>>8^d[255&(u^f.charCodeAt(m))];return-1^u}(0|l,a,a.length,0):0}},{"./utils":32}],5:[function(t,n,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(t,n,r){var s=null;s=typeof Promise<"u"?Promise:t("lie"),n.exports={Promise:s}},{lie:37}],7:[function(t,n,r){var s=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",o=t("pako"),a=t("./utils"),l=t("./stream/GenericWorker"),u=s?"uint8array":"array";function f(c,h){l.call(this,"FlateWorker/"+c),this._pako=null,this._pakoAction=c,this._pakoOptions=h,this.meta={}}r.magic="\b\0",a.inherits(f,l),f.prototype.processChunk=function(c){this.meta=c.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(u,c.data),!1)},f.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new o[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var c=this;this._pako.onData=function(h){c.push({data:h,meta:c.meta})}},r.compressWorker=function(c){return new f("Deflate",c)},r.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,n,r){function s(d,p){var m,_="";for(m=0;m>>=8;return _}function o(d,p,m,_,g,b){var S,y,A=d.file,I=d.compression,C=b!==u.utf8encode,H=a.transformTo("string",b(A.name)),G=a.transformTo("string",u.utf8encode(A.name)),ne=A.comment,Q=a.transformTo("string",b(ne)),R=a.transformTo("string",u.utf8encode(ne)),X=G.length!==A.name.length,E=R.length!==ne.length,V="",W="",j="",q=A.dir,ee=A.date,we={crc32:0,compressedSize:0,uncompressedSize:0};p&&!m||(we.crc32=d.crc32,we.compressedSize=d.compressedSize,we.uncompressedSize=d.uncompressedSize);var L=0;p&&(L|=8),C||!X&&!E||(L|=2048);var Z=0,Se=0;q&&(Z|=16),g==="UNIX"?(Se=798,Z|=function(_e,ce){var Ae=_e;return _e||(Ae=ce?16893:33204),(65535&Ae)<<16}(A.unixPermissions,q)):(Se=20,Z|=function(_e){return 63&(_e||0)}(A.dosPermissions)),S=ee.getUTCHours(),S<<=6,S|=ee.getUTCMinutes(),S<<=5,S|=ee.getUTCSeconds()/2,y=ee.getUTCFullYear()-1980,y<<=4,y|=ee.getUTCMonth()+1,y<<=5,y|=ee.getUTCDate(),X&&(W=s(1,1)+s(f(H),4)+G,V+="up"+s(W.length,2)+W),E&&(j=s(1,1)+s(f(Q),4)+R,V+="uc"+s(j.length,2)+j);var me="";return me+=` +\0`,me+=s(L,2),me+=I.magic,me+=s(S,2),me+=s(y,2),me+=s(we.crc32,4),me+=s(we.compressedSize,4),me+=s(we.uncompressedSize,4),me+=s(H.length,2),me+=s(V.length,2),{fileRecord:c.LOCAL_FILE_HEADER+me+H+V,dirRecord:c.CENTRAL_FILE_HEADER+s(Se,2)+me+s(Q.length,2)+"\0\0\0\0"+s(Z,4)+s(_,4)+H+V+Q}}var a=t("../utils"),l=t("../stream/GenericWorker"),u=t("../utf8"),f=t("../crc32"),c=t("../signature");function h(d,p,m,_){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=m,this.encodeFileName=_,this.streamFiles=d,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(h,l),h.prototype.push=function(d){var p=d.meta.percent||0,m=this.entriesCount,_=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,l.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:m?(p+100*(m-_-1))/m:100}}))},h.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var p=this.streamFiles&&!d.file.dir;if(p){var m=o(d,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(d){this.accumulate=!1;var p=this.streamFiles&&!d.file.dir,m=o(d,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),p)this.push({data:function(_){return c.DATA_DESCRIPTOR+s(_.crc32,4)+s(_.compressedSize,4)+s(_.uncompressedSize,4)}(d),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var d=this.bytesWritten,p=0;p=this.index;l--)u=(u<<8)+this.byteAt(l);return this.index+=a,u},readString:function(a){return s.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC(1980+(a>>25&127),(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(31&a)<<1))}},n.exports=o},{"../utils":32}],19:[function(t,n,r){var s=t("./Uint8ArrayReader");function o(a){s.call(this,a)}t("../utils").inherits(o,s),o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,n,r){var s=t("./DataReader");function o(a){s.call(this,a)}t("../utils").inherits(o,s),o.prototype.byteAt=function(a){return this.data.charCodeAt(this.zero+a)},o.prototype.lastIndexOfSignature=function(a){return this.data.lastIndexOf(a)-this.zero},o.prototype.readAndCheckSignature=function(a){return a===this.readData(4)},o.prototype.readData=function(a){this.checkOffset(a);var l=this.data.slice(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./DataReader":18}],21:[function(t,n,r){var s=t("./ArrayReader");function o(a){s.call(this,a)}t("../utils").inherits(o,s),o.prototype.readData=function(a){if(this.checkOffset(a),a===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+a);return this.index+=a,l},n.exports=o},{"../utils":32,"./ArrayReader":17}],22:[function(t,n,r){var s=t("../utils"),o=t("../support"),a=t("./ArrayReader"),l=t("./StringReader"),u=t("./NodeBufferReader"),f=t("./Uint8ArrayReader");n.exports=function(c){var h=s.getTypeOf(c);return s.checkSupport(h),h!=="string"||o.uint8array?h==="nodebuffer"?new u(c):o.uint8array?new f(s.transformTo("uint8array",c)):new a(s.transformTo("array",c)):new l(c)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,n,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,n,r){var s=t("./GenericWorker"),o=t("../utils");function a(l){s.call(this,"ConvertWorker to "+l),this.destType=l}o.inherits(a,s),a.prototype.processChunk=function(l){this.push({data:o.transformTo(this.destType,l.data),meta:l.meta})},n.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(t,n,r){var s=t("./GenericWorker"),o=t("../crc32");function a(){s.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(a,s),a.prototype.processChunk=function(l){this.streamInfo.crc32=o(l.data,this.streamInfo.crc32||0),this.push(l)},n.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,n,r){var s=t("../utils"),o=t("./GenericWorker");function a(l){o.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}s.inherits(a,o),a.prototype.processChunk=function(l){if(l){var u=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=u+l.data.length}o.prototype.processChunk.call(this,l)},n.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(t,n,r){var s=t("../utils"),o=t("./GenericWorker");function a(l){o.call(this,"DataWorker");var u=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(f){u.dataIsReady=!0,u.data=f,u.max=f&&f.length||0,u.type=s.getTypeOf(f),u.isPaused||u._tickAndRepeat()},function(f){u.error(f)})}s.inherits(a,o),a.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,s.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(s.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,u=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,u);break;case"uint8array":l=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":l=this.data.slice(this.index,u)}return this.index=u,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},n.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(t,n,r){function s(o){this.name=o||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}s.prototype={push:function(o){this.emit("data",o)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(o){this.emit("error",o)}return!0},error:function(o){return!this.isFinished&&(this.isPaused?this.generatedError=o:(this.isFinished=!0,this.emit("error",o),this.previous&&this.previous.error(o),this.cleanUp()),!0)},on:function(o,a){return this._listeners[o].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(o,a){if(this._listeners[o])for(var l=0;l "+o:o}},n.exports=s},{}],29:[function(t,n,r){var s=t("../utils"),o=t("./ConvertWorker"),a=t("./GenericWorker"),l=t("../base64"),u=t("../support"),f=t("../external"),c=null;if(u.nodestream)try{c=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function h(p,m){return new f.Promise(function(_,g){var b=[],S=p._internalType,y=p._outputType,A=p._mimeType;p.on("data",function(I,C){b.push(I),m&&m(C)}).on("error",function(I){b=[],g(I)}).on("end",function(){try{var I=function(C,H,G){switch(C){case"blob":return s.newBlob(s.transformTo("arraybuffer",H),G);case"base64":return l.encode(H);default:return s.transformTo(C,H)}}(y,function(C,H){var G,ne=0,Q=null,R=0;for(G=0;G"u")r.blob=!1;else{var s=new ArrayBuffer(0);try{r.blob=new Blob([s],{type:"application/zip"}).size===0}catch{try{var o=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);o.append(s),r.blob=o.getBlob("application/zip").size===0}catch{r.blob=!1}}}try{r.nodestream=!!t("readable-stream").Readable}catch{r.nodestream=!1}},{"readable-stream":16}],31:[function(t,n,r){for(var s=t("./utils"),o=t("./support"),a=t("./nodejsUtils"),l=t("./stream/GenericWorker"),u=new Array(256),f=0;f<256;f++)u[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;u[254]=u[254]=1;function c(){l.call(this,"utf-8 decode"),this.leftOver=null}function h(){l.call(this,"utf-8 encode")}r.utf8encode=function(d){return o.nodebuffer?a.newBufferFrom(d,"utf-8"):function(p){var m,_,g,b,S,y=p.length,A=0;for(b=0;b>>6:(_<65536?m[S++]=224|_>>>12:(m[S++]=240|_>>>18,m[S++]=128|_>>>12&63),m[S++]=128|_>>>6&63),m[S++]=128|63&_);return m}(d)},r.utf8decode=function(d){return o.nodebuffer?s.transformTo("nodebuffer",d).toString("utf-8"):function(p){var m,_,g,b,S=p.length,y=new Array(2*S);for(m=_=0;m>10&1023,y[_++]=56320|1023&g)}return y.length!==_&&(y.subarray?y=y.subarray(0,_):y.length=_),s.applyFromCharCode(y)}(d=s.transformTo(o.uint8array?"uint8array":"array",d))},s.inherits(c,l),c.prototype.processChunk=function(d){var p=s.transformTo(o.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(o.uint8array){var m=p;(p=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),p.set(m,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var _=function(b,S){var y;for((S=S||b.length)>b.length&&(S=b.length),y=S-1;0<=y&&(192&b[y])==128;)y--;return y<0||y===0?S:y+u[b[y]]>S?y:S}(p),g=p;_!==p.length&&(o.uint8array?(g=p.subarray(0,_),this.leftOver=p.subarray(_,p.length)):(g=p.slice(0,_),this.leftOver=p.slice(_,p.length))),this.push({data:r.utf8decode(g),meta:d.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,s.inherits(h,l),h.prototype.processChunk=function(d){this.push({data:r.utf8encode(d.data),meta:d.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,n,r){var s=t("./support"),o=t("./base64"),a=t("./nodejsUtils"),l=t("./external");function u(m){return m}function f(m,_){for(var g=0;g>8;this.dir=!!(16&this.externalFileAttributes),d==0&&(this.dosPermissions=63&this.externalFileAttributes),d==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var d=s(this.extraFields[1].value);this.uncompressedSize===o.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===o.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===o.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===o.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var p,m,_,g=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4>>6:(d<65536?h[_++]=224|d>>>12:(h[_++]=240|d>>>18,h[_++]=128|d>>>12&63),h[_++]=128|d>>>6&63),h[_++]=128|63&d);return h},r.buf2binstring=function(c){return f(c,c.length)},r.binstring2buf=function(c){for(var h=new s.Buf8(c.length),d=0,p=h.length;d>10&1023,b[p++]=56320|1023&m)}return f(b,p)},r.utf8border=function(c,h){var d;for((h=h||c.length)>c.length&&(h=c.length),d=h-1;0<=d&&(192&c[d])==128;)d--;return d<0||d===0?h:d+l[c[d]]>h?d:h}},{"./common":41}],43:[function(t,n,r){n.exports=function(s,o,a,l){for(var u=65535&s|0,f=s>>>16&65535|0,c=0;a!==0;){for(a-=c=2e3>>1:o>>>1;a[l]=o}return a}();n.exports=function(o,a,l,u){var f=s,c=u+l;o^=-1;for(var h=u;h>>8^f[255&(o^a[h])];return-1^o}},{}],46:[function(t,n,r){var s,o=t("../utils/common"),a=t("./trees"),l=t("./adler32"),u=t("./crc32"),f=t("./messages"),c=0,h=4,d=0,p=-2,m=-1,_=4,g=2,b=8,S=9,y=286,A=30,I=19,C=2*y+1,H=15,G=3,ne=258,Q=ne+G+1,R=42,X=113,E=1,V=2,W=3,j=4;function q($,ue){return $.msg=f[ue],ue}function ee($){return($<<1)-(4<$?9:0)}function we($){for(var ue=$.length;0<=--ue;)$[ue]=0}function L($){var ue=$.state,se=ue.pending;se>$.avail_out&&(se=$.avail_out),se!==0&&(o.arraySet($.output,ue.pending_buf,ue.pending_out,se,$.next_out),$.next_out+=se,ue.pending_out+=se,$.total_out+=se,$.avail_out-=se,ue.pending-=se,ue.pending===0&&(ue.pending_out=0))}function Z($,ue){a._tr_flush_block($,0<=$.block_start?$.block_start:-1,$.strstart-$.block_start,ue),$.block_start=$.strstart,L($.strm)}function Se($,ue){$.pending_buf[$.pending++]=ue}function me($,ue){$.pending_buf[$.pending++]=ue>>>8&255,$.pending_buf[$.pending++]=255&ue}function _e($,ue){var se,U,B=$.max_chain_length,Y=$.strstart,he=$.prev_length,pe=$.nice_match,z=$.strstart>$.w_size-Q?$.strstart-($.w_size-Q):0,T=$.window,le=$.w_mask,de=$.prev,Te=$.strstart+ne,Ve=T[Y+he-1],Ue=T[Y+he];$.prev_length>=$.good_match&&(B>>=2),pe>$.lookahead&&(pe=$.lookahead);do if(T[(se=ue)+he]===Ue&&T[se+he-1]===Ve&&T[se]===T[Y]&&T[++se]===T[Y+1]){Y+=2,se++;do;while(T[++Y]===T[++se]&&T[++Y]===T[++se]&&T[++Y]===T[++se]&&T[++Y]===T[++se]&&T[++Y]===T[++se]&&T[++Y]===T[++se]&&T[++Y]===T[++se]&&T[++Y]===T[++se]&&Yz&&--B!=0);return he<=$.lookahead?he:$.lookahead}function ce($){var ue,se,U,B,Y,he,pe,z,T,le,de=$.w_size;do{if(B=$.window_size-$.lookahead-$.strstart,$.strstart>=de+(de-Q)){for(o.arraySet($.window,$.window,de,de,0),$.match_start-=de,$.strstart-=de,$.block_start-=de,ue=se=$.hash_size;U=$.head[--ue],$.head[ue]=de<=U?U-de:0,--se;);for(ue=se=de;U=$.prev[--ue],$.prev[ue]=de<=U?U-de:0,--se;);B+=de}if($.strm.avail_in===0)break;if(he=$.strm,pe=$.window,z=$.strstart+$.lookahead,T=B,le=void 0,le=he.avail_in,T=G)for(Y=$.strstart-$.insert,$.ins_h=$.window[Y],$.ins_h=($.ins_h<<$.hash_shift^$.window[Y+1])&$.hash_mask;$.insert&&($.ins_h=($.ins_h<<$.hash_shift^$.window[Y+G-1])&$.hash_mask,$.prev[Y&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=Y,Y++,$.insert--,!($.lookahead+$.insert=G&&($.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+G-1])&$.hash_mask,se=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),se!==0&&$.strstart-se<=$.w_size-Q&&($.match_length=_e($,se)),$.match_length>=G)if(U=a._tr_tally($,$.strstart-$.match_start,$.match_length-G),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=G){for($.match_length--;$.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+G-1])&$.hash_mask,se=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart,--$.match_length!=0;);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;else U=a._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(U&&(Z($,!1),$.strm.avail_out===0))return E}return $.insert=$.strstart=G&&($.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+G-1])&$.hash_mask,se=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),$.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=G-1,se!==0&&$.prev_length<$.max_lazy_match&&$.strstart-se<=$.w_size-Q&&($.match_length=_e($,se),$.match_length<=5&&($.strategy===1||$.match_length===G&&4096<$.strstart-$.match_start)&&($.match_length=G-1)),$.prev_length>=G&&$.match_length<=$.prev_length){for(B=$.strstart+$.lookahead-G,U=a._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-G),$.lookahead-=$.prev_length-1,$.prev_length-=2;++$.strstart<=B&&($.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+G-1])&$.hash_mask,se=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),--$.prev_length!=0;);if($.match_available=0,$.match_length=G-1,$.strstart++,U&&(Z($,!1),$.strm.avail_out===0))return E}else if($.match_available){if((U=a._tr_tally($,0,$.window[$.strstart-1]))&&Z($,!1),$.strstart++,$.lookahead--,$.strm.avail_out===0)return E}else $.match_available=1,$.strstart++,$.lookahead--}return $.match_available&&(U=a._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0),$.insert=$.strstart$.pending_buf_size-5&&(se=$.pending_buf_size-5);;){if($.lookahead<=1){if(ce($),$.lookahead===0&&ue===c)return E;if($.lookahead===0)break}$.strstart+=$.lookahead,$.lookahead=0;var U=$.block_start+se;if(($.strstart===0||$.strstart>=U)&&($.lookahead=$.strstart-U,$.strstart=U,Z($,!1),$.strm.avail_out===0)||$.strstart-$.block_start>=$.w_size-Q&&(Z($,!1),$.strm.avail_out===0))return E}return $.insert=0,ue===h?(Z($,!0),$.strm.avail_out===0?W:j):($.strstart>$.block_start&&(Z($,!1),$.strm.avail_out),E)}),new De(4,4,8,4,Ae),new De(4,5,16,8,Ae),new De(4,6,32,32,Ae),new De(4,4,16,16,ze),new De(8,16,32,32,ze),new De(8,16,128,128,ze),new De(8,32,128,256,ze),new De(32,128,258,1024,ze),new De(32,258,258,4096,ze)],r.deflateInit=function($,ue){return at($,ue,b,15,8,0)},r.deflateInit2=at,r.deflateReset=lt,r.deflateResetKeep=Xe,r.deflateSetHeader=function($,ue){return $&&$.state?$.state.wrap!==2?p:($.state.gzhead=ue,d):p},r.deflate=function($,ue){var se,U,B,Y;if(!$||!$.state||5>8&255),Se(U,U.gzhead.time>>16&255),Se(U,U.gzhead.time>>24&255),Se(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),Se(U,255&U.gzhead.os),U.gzhead.extra&&U.gzhead.extra.length&&(Se(U,255&U.gzhead.extra.length),Se(U,U.gzhead.extra.length>>8&255)),U.gzhead.hcrc&&($.adler=u($.adler,U.pending_buf,U.pending,0)),U.gzindex=0,U.status=69):(Se(U,0),Se(U,0),Se(U,0),Se(U,0),Se(U,0),Se(U,U.level===9?2:2<=U.strategy||U.level<2?4:0),Se(U,3),U.status=X);else{var he=b+(U.w_bits-8<<4)<<8;he|=(2<=U.strategy||U.level<2?0:U.level<6?1:U.level===6?2:3)<<6,U.strstart!==0&&(he|=32),he+=31-he%31,U.status=X,me(U,he),U.strstart!==0&&(me(U,$.adler>>>16),me(U,65535&$.adler)),$.adler=1}if(U.status===69)if(U.gzhead.extra){for(B=U.pending;U.gzindex<(65535&U.gzhead.extra.length)&&(U.pending!==U.pending_buf_size||(U.gzhead.hcrc&&U.pending>B&&($.adler=u($.adler,U.pending_buf,U.pending-B,B)),L($),B=U.pending,U.pending!==U.pending_buf_size));)Se(U,255&U.gzhead.extra[U.gzindex]),U.gzindex++;U.gzhead.hcrc&&U.pending>B&&($.adler=u($.adler,U.pending_buf,U.pending-B,B)),U.gzindex===U.gzhead.extra.length&&(U.gzindex=0,U.status=73)}else U.status=73;if(U.status===73)if(U.gzhead.name){B=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>B&&($.adler=u($.adler,U.pending_buf,U.pending-B,B)),L($),B=U.pending,U.pending===U.pending_buf_size)){Y=1;break}Y=U.gzindexB&&($.adler=u($.adler,U.pending_buf,U.pending-B,B)),Y===0&&(U.gzindex=0,U.status=91)}else U.status=91;if(U.status===91)if(U.gzhead.comment){B=U.pending;do{if(U.pending===U.pending_buf_size&&(U.gzhead.hcrc&&U.pending>B&&($.adler=u($.adler,U.pending_buf,U.pending-B,B)),L($),B=U.pending,U.pending===U.pending_buf_size)){Y=1;break}Y=U.gzindexB&&($.adler=u($.adler,U.pending_buf,U.pending-B,B)),Y===0&&(U.status=103)}else U.status=103;if(U.status===103&&(U.gzhead.hcrc?(U.pending+2>U.pending_buf_size&&L($),U.pending+2<=U.pending_buf_size&&(Se(U,255&$.adler),Se(U,$.adler>>8&255),$.adler=0,U.status=X)):U.status=X),U.pending!==0){if(L($),$.avail_out===0)return U.last_flush=-1,d}else if($.avail_in===0&&ee(ue)<=ee(se)&&ue!==h)return q($,-5);if(U.status===666&&$.avail_in!==0)return q($,-5);if($.avail_in!==0||U.lookahead!==0||ue!==c&&U.status!==666){var pe=U.strategy===2?function(z,T){for(var le;;){if(z.lookahead===0&&(ce(z),z.lookahead===0)){if(T===c)return E;break}if(z.match_length=0,le=a._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++,le&&(Z(z,!1),z.strm.avail_out===0))return E}return z.insert=0,T===h?(Z(z,!0),z.strm.avail_out===0?W:j):z.last_lit&&(Z(z,!1),z.strm.avail_out===0)?E:V}(U,ue):U.strategy===3?function(z,T){for(var le,de,Te,Ve,Ue=z.window;;){if(z.lookahead<=ne){if(ce(z),z.lookahead<=ne&&T===c)return E;if(z.lookahead===0)break}if(z.match_length=0,z.lookahead>=G&&0z.lookahead&&(z.match_length=z.lookahead)}if(z.match_length>=G?(le=a._tr_tally(z,1,z.match_length-G),z.lookahead-=z.match_length,z.strstart+=z.match_length,z.match_length=0):(le=a._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++),le&&(Z(z,!1),z.strm.avail_out===0))return E}return z.insert=0,T===h?(Z(z,!0),z.strm.avail_out===0?W:j):z.last_lit&&(Z(z,!1),z.strm.avail_out===0)?E:V}(U,ue):s[U.level].func(U,ue);if(pe!==W&&pe!==j||(U.status=666),pe===E||pe===W)return $.avail_out===0&&(U.last_flush=-1),d;if(pe===V&&(ue===1?a._tr_align(U):ue!==5&&(a._tr_stored_block(U,0,0,!1),ue===3&&(we(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),L($),$.avail_out===0))return U.last_flush=-1,d}return ue!==h?d:U.wrap<=0?1:(U.wrap===2?(Se(U,255&$.adler),Se(U,$.adler>>8&255),Se(U,$.adler>>16&255),Se(U,$.adler>>24&255),Se(U,255&$.total_in),Se(U,$.total_in>>8&255),Se(U,$.total_in>>16&255),Se(U,$.total_in>>24&255)):(me(U,$.adler>>>16),me(U,65535&$.adler)),L($),0=se.w_size&&(Y===0&&(we(se.head),se.strstart=0,se.block_start=0,se.insert=0),T=new o.Buf8(se.w_size),o.arraySet(T,ue,le-se.w_size,se.w_size,0),ue=T,le=se.w_size),he=$.avail_in,pe=$.next_in,z=$.input,$.avail_in=le,$.next_in=0,$.input=ue,ce(se);se.lookahead>=G;){for(U=se.strstart,B=se.lookahead-(G-1);se.ins_h=(se.ins_h<>>=G=H>>>24,S-=G,(G=H>>>16&255)===0)V[f++]=65535&H;else{if(!(16&G)){if(!(64&G)){H=y[(65535&H)+(b&(1<>>=G,S-=G),S<15&&(b+=E[l++]<>>=G=H>>>24,S-=G,!(16&(G=H>>>16&255))){if(!(64&G)){H=A[(65535&H)+(b&(1<>>=G,S-=G,(G=f-c)>3,b&=(1<<(S-=ne<<3))-1,s.next_in=l,s.next_out=f,s.avail_in=l>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new s.Buf16(320),this.work=new s.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(R){var X;return R&&R.state?(X=R.state,R.total_in=R.total_out=X.total=0,R.msg="",X.wrap&&(R.adler=1&X.wrap),X.mode=p,X.last=0,X.havedict=0,X.dmax=32768,X.head=null,X.hold=0,X.bits=0,X.lencode=X.lendyn=new s.Buf32(m),X.distcode=X.distdyn=new s.Buf32(_),X.sane=1,X.back=-1,h):d}function y(R){var X;return R&&R.state?((X=R.state).wsize=0,X.whave=0,X.wnext=0,S(R)):d}function A(R,X){var E,V;return R&&R.state?(V=R.state,X<0?(E=0,X=-X):(E=1+(X>>4),X<48&&(X&=15)),X&&(X<8||15=j.wsize?(s.arraySet(j.window,X,E-j.wsize,j.wsize,0),j.wnext=0,j.whave=j.wsize):(V<(W=j.wsize-j.wnext)&&(W=V),s.arraySet(j.window,X,E-V,W,j.wnext),(V-=W)?(s.arraySet(j.window,X,E-V,V,0),j.wnext=V,j.whave=j.wsize):(j.wnext+=W,j.wnext===j.wsize&&(j.wnext=0),j.whave>>8&255,E.check=a(E.check,Y,2,0),Z=L=0,E.mode=2;break}if(E.flags=0,E.head&&(E.head.done=!1),!(1&E.wrap)||(((255&L)<<8)+(L>>8))%31){R.msg="incorrect header check",E.mode=30;break}if((15&L)!=8){R.msg="unknown compression method",E.mode=30;break}if(Z-=4,$=8+(15&(L>>>=4)),E.wbits===0)E.wbits=$;else if($>E.wbits){R.msg="invalid window size",E.mode=30;break}E.dmax=1<<$,R.adler=E.check=1,E.mode=512&L?10:12,Z=L=0;break;case 2:for(;Z<16;){if(ee===0)break e;ee--,L+=V[j++]<>8&1),512&E.flags&&(Y[0]=255&L,Y[1]=L>>>8&255,E.check=a(E.check,Y,2,0)),Z=L=0,E.mode=3;case 3:for(;Z<32;){if(ee===0)break e;ee--,L+=V[j++]<>>8&255,Y[2]=L>>>16&255,Y[3]=L>>>24&255,E.check=a(E.check,Y,4,0)),Z=L=0,E.mode=4;case 4:for(;Z<16;){if(ee===0)break e;ee--,L+=V[j++]<>8),512&E.flags&&(Y[0]=255&L,Y[1]=L>>>8&255,E.check=a(E.check,Y,2,0)),Z=L=0,E.mode=5;case 5:if(1024&E.flags){for(;Z<16;){if(ee===0)break e;ee--,L+=V[j++]<>>8&255,E.check=a(E.check,Y,2,0)),Z=L=0}else E.head&&(E.head.extra=null);E.mode=6;case 6:if(1024&E.flags&&(ee<(_e=E.length)&&(_e=ee),_e&&(E.head&&($=E.head.extra_len-E.length,E.head.extra||(E.head.extra=new Array(E.head.extra_len)),s.arraySet(E.head.extra,V,j,_e,$)),512&E.flags&&(E.check=a(E.check,V,_e,j)),ee-=_e,j+=_e,E.length-=_e),E.length))break e;E.length=0,E.mode=7;case 7:if(2048&E.flags){if(ee===0)break e;for(_e=0;$=V[j+_e++],E.head&&$&&E.length<65536&&(E.head.name+=String.fromCharCode($)),$&&_e>9&1,E.head.done=!0),R.adler=E.check=0,E.mode=12;break;case 10:for(;Z<32;){if(ee===0)break e;ee--,L+=V[j++]<>>=7&Z,Z-=7&Z,E.mode=27;break}for(;Z<3;){if(ee===0)break e;ee--,L+=V[j++]<>>=1)){case 0:E.mode=14;break;case 1:if(ne(E),E.mode=20,X!==6)break;L>>>=2,Z-=2;break e;case 2:E.mode=17;break;case 3:R.msg="invalid block type",E.mode=30}L>>>=2,Z-=2;break;case 14:for(L>>>=7&Z,Z-=7&Z;Z<32;){if(ee===0)break e;ee--,L+=V[j++]<>>16^65535)){R.msg="invalid stored block lengths",E.mode=30;break}if(E.length=65535&L,Z=L=0,E.mode=15,X===6)break e;case 15:E.mode=16;case 16:if(_e=E.length){if(ee<_e&&(_e=ee),we<_e&&(_e=we),_e===0)break e;s.arraySet(W,V,j,_e,q),ee-=_e,j+=_e,we-=_e,q+=_e,E.length-=_e;break}E.mode=12;break;case 17:for(;Z<14;){if(ee===0)break e;ee--,L+=V[j++]<>>=5,Z-=5,E.ndist=1+(31&L),L>>>=5,Z-=5,E.ncode=4+(15&L),L>>>=4,Z-=4,286>>=3,Z-=3}for(;E.have<19;)E.lens[he[E.have++]]=0;if(E.lencode=E.lendyn,E.lenbits=7,se={bits:E.lenbits},ue=u(0,E.lens,0,19,E.lencode,0,E.work,se),E.lenbits=se.bits,ue){R.msg="invalid code lengths set",E.mode=30;break}E.have=0,E.mode=19;case 19:for(;E.have>>16&255,Le=65535&B,!((ze=B>>>24)<=Z);){if(ee===0)break e;ee--,L+=V[j++]<>>=ze,Z-=ze,E.lens[E.have++]=Le;else{if(Le===16){for(U=ze+2;Z>>=ze,Z-=ze,E.have===0){R.msg="invalid bit length repeat",E.mode=30;break}$=E.lens[E.have-1],_e=3+(3&L),L>>>=2,Z-=2}else if(Le===17){for(U=ze+3;Z>>=ze)),L>>>=3,Z-=3}else{for(U=ze+7;Z>>=ze)),L>>>=7,Z-=7}if(E.have+_e>E.nlen+E.ndist){R.msg="invalid bit length repeat",E.mode=30;break}for(;_e--;)E.lens[E.have++]=$}}if(E.mode===30)break;if(E.lens[256]===0){R.msg="invalid code -- missing end-of-block",E.mode=30;break}if(E.lenbits=9,se={bits:E.lenbits},ue=u(f,E.lens,0,E.nlen,E.lencode,0,E.work,se),E.lenbits=se.bits,ue){R.msg="invalid literal/lengths set",E.mode=30;break}if(E.distbits=6,E.distcode=E.distdyn,se={bits:E.distbits},ue=u(c,E.lens,E.nlen,E.ndist,E.distcode,0,E.work,se),E.distbits=se.bits,ue){R.msg="invalid distances set",E.mode=30;break}if(E.mode=20,X===6)break e;case 20:E.mode=21;case 21:if(6<=ee&&258<=we){R.next_out=q,R.avail_out=we,R.next_in=j,R.avail_in=ee,E.hold=L,E.bits=Z,l(R,me),q=R.next_out,W=R.output,we=R.avail_out,j=R.next_in,V=R.input,ee=R.avail_in,L=E.hold,Z=E.bits,E.mode===12&&(E.back=-1);break}for(E.back=0;De=(B=E.lencode[L&(1<>>16&255,Le=65535&B,!((ze=B>>>24)<=Z);){if(ee===0)break e;ee--,L+=V[j++]<>Xe)])>>>16&255,Le=65535&B,!(Xe+(ze=B>>>24)<=Z);){if(ee===0)break e;ee--,L+=V[j++]<>>=Xe,Z-=Xe,E.back+=Xe}if(L>>>=ze,Z-=ze,E.back+=ze,E.length=Le,De===0){E.mode=26;break}if(32&De){E.back=-1,E.mode=12;break}if(64&De){R.msg="invalid literal/length code",E.mode=30;break}E.extra=15&De,E.mode=22;case 22:if(E.extra){for(U=E.extra;Z>>=E.extra,Z-=E.extra,E.back+=E.extra}E.was=E.length,E.mode=23;case 23:for(;De=(B=E.distcode[L&(1<>>16&255,Le=65535&B,!((ze=B>>>24)<=Z);){if(ee===0)break e;ee--,L+=V[j++]<>Xe)])>>>16&255,Le=65535&B,!(Xe+(ze=B>>>24)<=Z);){if(ee===0)break e;ee--,L+=V[j++]<>>=Xe,Z-=Xe,E.back+=Xe}if(L>>>=ze,Z-=ze,E.back+=ze,64&De){R.msg="invalid distance code",E.mode=30;break}E.offset=Le,E.extra=15&De,E.mode=24;case 24:if(E.extra){for(U=E.extra;Z>>=E.extra,Z-=E.extra,E.back+=E.extra}if(E.offset>E.dmax){R.msg="invalid distance too far back",E.mode=30;break}E.mode=25;case 25:if(we===0)break e;if(_e=me-we,E.offset>_e){if((_e=E.offset-_e)>E.whave&&E.sane){R.msg="invalid distance too far back",E.mode=30;break}ce=_e>E.wnext?(_e-=E.wnext,E.wsize-_e):E.wnext-_e,_e>E.length&&(_e=E.length),Ae=E.window}else Ae=W,ce=q-E.offset,_e=E.length;for(we<_e&&(_e=we),we-=_e,E.length-=_e;W[q++]=Ae[ce++],--_e;);E.length===0&&(E.mode=21);break;case 26:if(we===0)break e;W[q++]=E.length,we--,E.mode=21;break;case 27:if(E.wrap){for(;Z<32;){if(ee===0)break e;ee--,L|=V[j++]<C?(G=ce[Ae+_[X]],Z[Se+_[X]]):(G=96,0),b=1<>q)+(S-=b)]=H<<24|G<<16|ne|0,S!==0;);for(b=1<>=1;if(b!==0?(L&=b-1,L+=b):L=0,X++,--me[R]==0){if(R===V)break;R=c[h+_[X]]}if(W>>7)]}function Se(B,Y){B.pending_buf[B.pending++]=255&Y,B.pending_buf[B.pending++]=Y>>>8&255}function me(B,Y,he){B.bi_valid>g-he?(B.bi_buf|=Y<>g-B.bi_valid,B.bi_valid+=he-g):(B.bi_buf|=Y<>>=1,he<<=1,0<--Y;);return he>>>1}function Ae(B,Y,he){var pe,z,T=new Array(_+1),le=0;for(pe=1;pe<=_;pe++)T[pe]=le=le+he[pe-1]<<1;for(z=0;z<=Y;z++){var de=B[2*z+1];de!==0&&(B[2*z]=ce(T[de]++,de))}}function ze(B){var Y;for(Y=0;Y>1;1<=he;he--)Xe(B,T,he);for(z=Te;he=B.heap[1],B.heap[1]=B.heap[B.heap_len--],Xe(B,T,1),pe=B.heap[1],B.heap[--B.heap_max]=he,B.heap[--B.heap_max]=pe,T[2*z]=T[2*he]+T[2*pe],B.depth[z]=(B.depth[he]>=B.depth[pe]?B.depth[he]:B.depth[pe])+1,T[2*he+1]=T[2*pe+1]=z,B.heap[1]=z++,Xe(B,T,1),2<=B.heap_len;);B.heap[--B.heap_max]=B.heap[1],function(Ue,nt){var pt,wt,Xt,it,Yt,on,At=nt.dyn_tree,Cn=nt.max_code,Xn=nt.stat_desc.static_tree,_n=nt.stat_desc.has_stree,Rn=nt.stat_desc.extra_bits,Ni=nt.stat_desc.extra_base,Fn=nt.stat_desc.max_length,Yn=0;for(it=0;it<=_;it++)Ue.bl_count[it]=0;for(At[2*Ue.heap[Ue.heap_max]+1]=0,pt=Ue.heap_max+1;pt>=7;z>>=1)if(1&Ve&&de.dyn_ltree[2*Te]!==0)return o;if(de.dyn_ltree[18]!==0||de.dyn_ltree[20]!==0||de.dyn_ltree[26]!==0)return a;for(Te=32;Te>>3,(T=B.static_len+3+7>>>3)<=z&&(z=T)):z=T=he+5,he+4<=z&&Y!==-1?U(B,Y,he,pe):B.strategy===4||T===z?(me(B,2+(pe?1:0),3),lt(B,Q,R)):(me(B,4+(pe?1:0),3),function(de,Te,Ve,Ue){var nt;for(me(de,Te-257,5),me(de,Ve-1,5),me(de,Ue-4,4),nt=0;nt>>8&255,B.pending_buf[B.d_buf+2*B.last_lit+1]=255&Y,B.pending_buf[B.l_buf+B.last_lit]=255&he,B.last_lit++,Y===0?B.dyn_ltree[2*he]++:(B.matches++,Y--,B.dyn_ltree[2*(E[he]+c+1)]++,B.dyn_dtree[2*Z(Y)]++),B.last_lit===B.lit_bufsize-1},r._tr_align=function(B){me(B,2,3),_e(B,S,Q),function(Y){Y.bi_valid===16?(Se(Y,Y.bi_buf),Y.bi_buf=0,Y.bi_valid=0):8<=Y.bi_valid&&(Y.pending_buf[Y.pending++]=255&Y.bi_buf,Y.bi_buf>>=8,Y.bi_valid-=8)}(B)}},{"../utils/common":41}],53:[function(t,n,r){n.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,n,r){(function(s){(function(o,a){if(!o.setImmediate){var l,u,f,c,h=1,d={},p=!1,m=o.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(o);_=_&&_.setTimeout?_:o,l={}.toString.call(o.process)==="[object process]"?function(y){process.nextTick(function(){b(y)})}:function(){if(o.postMessage&&!o.importScripts){var y=!0,A=o.onmessage;return o.onmessage=function(){y=!1},o.postMessage("","*"),o.onmessage=A,y}}()?(c="setImmediate$"+Math.random()+"$",o.addEventListener?o.addEventListener("message",S,!1):o.attachEvent("onmessage",S),function(y){o.postMessage(c+y,"*")}):o.MessageChannel?((f=new MessageChannel).port1.onmessage=function(y){b(y.data)},function(y){f.port2.postMessage(y)}):m&&"onreadystatechange"in m.createElement("script")?(u=m.documentElement,function(y){var A=m.createElement("script");A.onreadystatechange=function(){b(y),A.onreadystatechange=null,u.removeChild(A),A=null},u.appendChild(A)}):function(y){setTimeout(b,0,y)},_.setImmediate=function(y){typeof y!="function"&&(y=new Function(""+y));for(var A=new Array(arguments.length-1),I=0;I"u"?s===void 0?this:s:self)}).call(this,typeof Kn<"u"?Kn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(vo);var U0=vo.exports;const Gn=L0(U0),O0=""+new URL("../assets/fonts_metrics.12a7cc5a.zip",import.meta.url).href;function x0(i){const e=i.fontSize.length,t=i.fontSize[e-1],r=i.height[e-1]/t,s=[],o=[];let a=-1;for(let l=0;le.k*256)return i/e.k;const{size:t,height:n}=e.metrics;let r=0,s=t.length-1;for(;s-r>1;){const o=Math.round((r+s)/2);n[o]<=i?r=o:n[o]>i&&(s=o)}return t[r]}function j0(i,e,t,n,r){const s="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZzАаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯя",o=new Array,a=new Array,l=new Array;let u=0;for(let f=1;f<=256.1;f+=.1){f=Math.round(f*1e3)/1e3;const c=f-.05,h=f+.05,[d,p,m]=[c,f,h].map(_=>i.measureText(s,{family:e,bold:t,italic:n,smallCaps:r},_).height);Math.abs(d-p)>.5?(o.push(f,f),l.push("o","c"),a.push(d,p),u=p):Math.abs(m-p)>.5?(o.push(f,f),l.push("c","o"),a.push(p,m),u=m):u!=p&&(o.push(f),l.push("-"),a.push(p),u=p)}{const c=i.measureText(s,{family:e,bold:t,italic:n,smallCaps:r},300).height;o.push(300),l.push("-"),a.push(c)}return{fontSize:o,height:a,meta:l}}function Er(i,e="_"){const{family:t,italic:n,bold:r,smallCaps:s}=i,o=[t];return n&&o.push("italic"),r&&o.push("bold"),s&&o.push("small-caps"),o.join(e)}function H0(i,e){const t=[];for(const n of[!1,!0])for(const r of[!1,!0])for(const s of[!1,!0]){const o=Er({family:e,italic:n,smallCaps:r,bold:s}),a=j0(i,e,s,n,r);t.push({data:a,name:o})}return t}function V0(i){const e=new Array;for(const t of[!1,!0])for(const n of[!1,!0])for(const r of[!1,!0])e.push({family:i,italic:t,smallCaps:n,bold:r});return e}class W0{constructor(){Ce(this,"data")}get(e){if(!this.data)return{k:1/256,metrics:{height:[0,1],size:[0,1]}};const t=Er(e),n=this.data.get(t);if(!n)throw new Error(`Not found font statistics for ${t}`);return n}}const $o=xn(["Arial","Impact","Lobster","Helvetica","Next art","Pacifico","Caveat","Comforter","Raleway","Lora","Marck Script","Bad Script","Tektur","Unbounded","Press Start 2P","JetBrains Mono"].sort());function q0(){return Z0(O0)}function Z0(i){const e=new W0;return{store:e,then:fetch(i).then(t=>t.blob()).then(t=>Gn.loadAsync(t)).then(t=>Promise.all(Object.entries(t.files).map(([n,r])=>r.async("string").then(s=>[n.substring(0,n.length-5),JSON.parse(s)])))).then(t=>e.data=new Map(t))}}function X0(i=document.fonts){const e=new Array;return i.forEach(t=>e.push(t.load().catch(n=>(console.warn(`Failed load font ${t.family}: ${n.message}`),t)))),Promise.all(e)}function Y0(i,e){const t=Gn();return H0(i,e).forEach(n=>t.file(`${n.name}.json`,JSON.stringify(x0(n.data)))),t.generateAsync({compression:"DEFLATE",type:"blob"})}var K0="M13,6L15,4L16.42,5.42L12,9.84L7.58,5.42L9,4L11,6V2H13V6M3,11H21V13H3V11M13,18V22H11V18L9,20L7.58,18.58L12,14.16L16.42,18.58L15,20L13,18Z";function J0(i){let e,t;return e=new uf({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Q0(i){let e,t;return e=new zl({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function em(i){let e,t;return{c(){e=K("span"),t=oe("Аа"),this.h()},l(n){e=J(n,"SPAN",{style:!0});var r=te(e);t=ae(r,"Аа"),r.forEach(k),this.h()},h(){et(e,"font-size","20px"),et(e,"font-variant","small-caps")},m(n,r){x(n,e,r),O(e,t)},p:Be,d(n){n&&k(e)}}}function tm(i){let e,t;return e=new hl({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function nm(i){let e,t;return e=new nl({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function rm(i){let e,t;return e=new al({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function im(i){let e,t,n,r;const s=[rm,nm,tm],o=[];function a(l,u){return l[24]=="left"?0:l[24]=="center"?1:l[24]=="right"?2:-1}return~(e=a(i))&&(t=o[e]=s[e](i)),{c(){t&&t.c(),n=Ge()},l(l){t&&t.l(l),n=Ge()},m(l,u){~e&&o[e].m(l,u),x(l,n,u),r=!0},p(l,u){let f=e;e=a(l),e!==f&&(t&&(Oe(),w(o[f],1,1,()=>{o[f]=null}),xe()),~e?(t=o[e],t||(t=o[e]=s[e](l),t.c()),v(t,1),t.m(n.parentNode,n)):t=null)},i(l){r||(v(t),r=!0)},o(l){w(t),r=!1},d(l){~e&&o[e].d(l),l&&k(n)}}}function sm(i){let e,t;return e=new gl({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function om(i){let e,t;return e=new Vn({props:{type:"mdi",path:K0,size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function am(i){let e,t;return e=new yl({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function lm(i){let e,t,n,r;const s=[am,om,sm],o=[];function a(l,u){return l[24]=="top"?0:l[24]=="middle"?1:l[24]=="bottom"?2:-1}return~(e=a(i))&&(t=o[e]=s[e](i)),{c(){t&&t.c(),n=Ge()},l(l){t&&t.l(l),n=Ge()},m(l,u){~e&&o[e].m(l,u),x(l,n,u),r=!0},p(l,u){let f=e;e=a(l),e===f?~e&&o[e].p(l,u):(t&&(Oe(),w(o[f],1,1,()=>{o[f]=null}),xe()),~e?(t=o[e],t?t.p(l,u):(t=o[e]=s[e](l),t.c()),v(t,1),t.m(n.parentNode,n)):t=null)},i(l){r||(v(t),r=!0)},o(l){w(t),r=!1},d(l){~e&&o[e].d(l),l&&k(n)}}}function um(i){let e,t=i[24]+"",n;return{c(){e=K("section"),n=oe(t),this.h()},l(r){e=J(r,"SECTION",{style:!0});var s=te(e);n=ae(s,t),s.forEach(k),this.h()},h(){et(e,"font-family","'"+i[24]+"'"),et(e,"font-size",(i[6][i[24]]||16)+"px")},m(r,s){x(r,e,s),O(e,n)},p(r,s){s&16777216&&t!==(t=r[24]+"")&&tt(n,t),s&16777216&&et(e,"font-family","'"+r[24]+"'"),s&16777216&&et(e,"font-size",(r[6][r[24]]||16)+"px")},d(r){r&&k(e)}}}function fm(i){let e,t;return e=new df({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function cm(i){let e,t;return e=new vf({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function hm(i){let e,t;return e=new kf({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function mm(i){let e,t,n,r;const s=[hm,cm,fm],o=[];function a(l,u){return l[24]==="As is"?0:l[24]==="UPPER"?1:l[24]==="lower"?2:-1}return~(e=a(i))&&(t=o[e]=s[e](i)),{c(){t&&t.c(),n=Ge()},l(l){t&&t.l(l),n=Ge()},m(l,u){~e&&o[e].m(l,u),x(l,n,u),r=!0},p(l,u){let f=e;e=a(l),e!==f&&(t&&(Oe(),w(o[f],1,1,()=>{o[f]=null}),xe()),~e?(t=o[e],t||(t=o[e]=s[e](l),t.c()),v(t,1),t.m(n.parentNode,n)):t=null)},i(l){r||(v(t),r=!0)},o(l){w(t),r=!1},d(l){~e&&o[e].d(l),l&&k(n)}}}function dm(i){let e,t;return e=new Gu({props:{size:20}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function pm(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b,S,y,A,I,C,H,G;function ne(ce){i[8](ce)}let Q={title:"Курсив",width:Qn,$$slots:{default:[J0]},$$scope:{ctx:i}};i[0].italic!==void 0&&(Q.value=i[0].italic),t=new Dn({props:Q}),ge.push(()=>be(t,"value",ne)),t.$on("change",i[9]);function R(ce){i[10](ce)}let X={title:"Жирный",width:Qn,$$slots:{default:[Q0]},$$scope:{ctx:i}};i[0].bold!==void 0&&(X.value=i[0].bold),s=new Dn({props:X}),ge.push(()=>be(s,"value",R)),s.$on("change",i[11]);function E(ce){i[12](ce)}let V={title:"Капитель",width:Qn,$$slots:{default:[em]},$$scope:{ctx:i}};i[0].smallCaps!==void 0&&(V.value=i[0].smallCaps),l=new Dn({props:V}),ge.push(()=>be(l,"value",E)),l.$on("change",i[13]);function W(ce){i[14](ce)}let j={css:i[7],title:"Выравнивание",items:["left","center","right"],$$slots:{default:[im,({item:ce})=>({24:ce}),({item:ce})=>ce?16777216:0]},$$scope:{ctx:i}};i[2]!==void 0&&(j.value=i[2]),c=new Et({props:j}),ge.push(()=>be(c,"value",W)),c.$on("change",i[15]);function q(ce){i[16](ce)}let ee={css:i[7],title:"Позиционирование",items:["top","middle","bottom"],$$slots:{default:[lm,({item:ce})=>({24:ce}),({item:ce})=>ce?16777216:0]},$$scope:{ctx:i}};i[3]!==void 0&&(ee.value=i[3]),p=new Et({props:ee}),ge.push(()=>be(p,"value",q)),p.$on("change",i[17]);function we(ce){i[18](ce)}let L={css:{height:"48px",width:"100%",main:"min-width: 148px;"},title:"Шрифт",items:i[5],$$slots:{default:[um,({item:ce})=>({24:ce}),({item:ce})=>ce?16777216:0]},$$scope:{ctx:i}};i[0].family!==void 0&&(L.value=i[0].family),g=new Et({props:L}),ge.push(()=>be(g,"value",we)),g.$on("change",i[19]);function Z(ce){i[20](ce)}let Se={css:i[7],title:"Регистр",items:["As is","UPPER","lower"],$$slots:{default:[mm,({item:ce})=>({24:ce}),({item:ce})=>ce?16777216:0]},$$scope:{ctx:i}};i[1]!==void 0&&(Se.value=i[1]),y=new Et({props:Se}),ge.push(()=>be(y,"value",Z)),y.$on("change",i[21]);function me(ce){i[22](ce)}let _e={title:"Ещё настройки",width:Qn,$$slots:{default:[dm]},$$scope:{ctx:i}};return i[4]!==void 0&&(_e.value=i[4]),C=new Dn({props:_e}),ge.push(()=>be(C,"value",me)),C.$on("change",i[23]),{c(){e=K("article"),F(t.$$.fragment),r=re(),F(s.$$.fragment),a=re(),F(l.$$.fragment),f=re(),F(c.$$.fragment),d=re(),F(p.$$.fragment),_=re(),F(g.$$.fragment),S=re(),F(y.$$.fragment),I=re(),F(C.$$.fragment),this.h()},l(ce){e=J(ce,"ARTICLE",{class:!0});var Ae=te(e);N(t.$$.fragment,Ae),r=ie(Ae),N(s.$$.fragment,Ae),a=ie(Ae),N(l.$$.fragment,Ae),f=ie(Ae),N(c.$$.fragment,Ae),d=ie(Ae),N(p.$$.fragment,Ae),_=ie(Ae),N(g.$$.fragment,Ae),S=ie(Ae),N(y.$$.fragment,Ae),I=ie(Ae),N(C.$$.fragment,Ae),Ae.forEach(k),this.h()},h(){D(e,"class","svelte-1kluryt")},m(ce,Ae){x(ce,e,Ae),M(t,e,null),O(e,r),M(s,e,null),O(e,a),M(l,e,null),O(e,f),M(c,e,null),O(e,d),M(p,e,null),O(e,_),M(g,e,null),O(e,S),M(y,e,null),O(e,I),M(C,e,null),G=!0},p(ce,[Ae]){const ze={};Ae&33554432&&(ze.$$scope={dirty:Ae,ctx:ce}),!n&&Ae&1&&(n=!0,ze.value=ce[0].italic,ve(()=>n=!1)),t.$set(ze);const De={};Ae&33554432&&(De.$$scope={dirty:Ae,ctx:ce}),!o&&Ae&1&&(o=!0,De.value=ce[0].bold,ve(()=>o=!1)),s.$set(De);const Le={};Ae&33554432&&(Le.$$scope={dirty:Ae,ctx:ce}),!u&&Ae&1&&(u=!0,Le.value=ce[0].smallCaps,ve(()=>u=!1)),l.$set(Le);const Xe={};Ae&50331648&&(Xe.$$scope={dirty:Ae,ctx:ce}),!h&&Ae&4&&(h=!0,Xe.value=ce[2],ve(()=>h=!1)),c.$set(Xe);const lt={};Ae&50331648&&(lt.$$scope={dirty:Ae,ctx:ce}),!m&&Ae&8&&(m=!0,lt.value=ce[3],ve(()=>m=!1)),p.$set(lt);const at={};Ae&32&&(at.items=ce[5]),Ae&50331648&&(at.$$scope={dirty:Ae,ctx:ce}),!b&&Ae&1&&(b=!0,at.value=ce[0].family,ve(()=>b=!1)),g.$set(at);const $={};Ae&50331648&&($.$$scope={dirty:Ae,ctx:ce}),!A&&Ae&2&&(A=!0,$.value=ce[1],ve(()=>A=!1)),y.$set($);const ue={};Ae&33554432&&(ue.$$scope={dirty:Ae,ctx:ce}),!H&&Ae&16&&(H=!0,ue.value=ce[4],ve(()=>H=!1)),C.$set(ue)},i(ce){G||(v(t.$$.fragment,ce),v(s.$$.fragment,ce),v(l.$$.fragment,ce),v(c.$$.fragment,ce),v(p.$$.fragment,ce),v(g.$$.fragment,ce),v(y.$$.fragment,ce),v(C.$$.fragment,ce),G=!0)},o(ce){w(t.$$.fragment,ce),w(s.$$.fragment,ce),w(l.$$.fragment,ce),w(c.$$.fragment,ce),w(p.$$.fragment,ce),w(g.$$.fragment,ce),w(y.$$.fragment,ce),w(C.$$.fragment,ce),G=!1},d(ce){ce&&k(e),P(t),P(s),P(l),P(c),P(p),P(g),P(y),P(C)}}}const Qn="48px";function _m(i,e,t){let n;yt(i,$o,Q=>t(5,n=Q));let{font:r}=e,{textCase:s}=e,{align:o}=e,{baseline:a}=e;const l={"JetBrains Mono":15,"Press Start 2P":9},u={height:"48px",width:"100%",main:"min-width: 56px;max-width: 116px;"};let{moreSettings:f=!1}=e;function c(Q){i.$$.not_equal(r.italic,Q)&&(r.italic=Q,t(0,r))}function h(Q){Ie.call(this,i,Q)}function d(Q){i.$$.not_equal(r.bold,Q)&&(r.bold=Q,t(0,r))}function p(Q){Ie.call(this,i,Q)}function m(Q){i.$$.not_equal(r.smallCaps,Q)&&(r.smallCaps=Q,t(0,r))}function _(Q){Ie.call(this,i,Q)}function g(Q){o=Q,t(2,o)}function b(Q){Ie.call(this,i,Q)}function S(Q){a=Q,t(3,a)}function y(Q){Ie.call(this,i,Q)}function A(Q){i.$$.not_equal(r.family,Q)&&(r.family=Q,t(0,r))}function I(Q){Ie.call(this,i,Q)}function C(Q){s=Q,t(1,s)}function H(Q){Ie.call(this,i,Q)}function G(Q){f=Q,t(4,f)}function ne(Q){Ie.call(this,i,Q)}return i.$$set=Q=>{"font"in Q&&t(0,r=Q.font),"textCase"in Q&&t(1,s=Q.textCase),"align"in Q&&t(2,o=Q.align),"baseline"in Q&&t(3,a=Q.baseline),"moreSettings"in Q&&t(4,f=Q.moreSettings)},[r,s,o,a,f,n,l,u,c,h,d,p,m,_,g,b,S,y,A,I,C,H,G,ne]}class gm extends ye{constructor(e){super(),Ee(this,e,_m,pm,$e,{font:0,textCase:1,align:2,baseline:3,moreSettings:4})}}function bm(i){let e;return{c(){e=oe("ERROR")},l(t){e=ae(t,"ERROR")},m(t,n){x(t,e,n)},p:Be,i:Be,o:Be,d(t){t&&k(e)}}}function vm(i){let e,t,n=i[0].unit+"",r,s;function o(l){i[8](l)}let a={min:1,step:.1};return i[0].value!==void 0&&(a.value=i[0].value),e=new Ke({props:a}),ge.push(()=>be(e,"value",o)),{c(){F(e.$$.fragment),r=oe(n)},l(l){N(e.$$.fragment,l),r=ae(l,n)},m(l,u){M(e,l,u),x(l,r,u),s=!0},p(l,u){const f={};!t&&u&1&&(t=!0,f.value=l[0].value,ve(()=>t=!1)),e.$set(f),(!s||u&1)&&n!==(n=l[0].unit+"")&&tt(r,n)},i(l){s||(v(e.$$.fragment,l),s=!0)},o(l){w(e.$$.fragment,l),s=!1},d(l){P(e,l),l&&k(r)}}}function $m(i){let e,t,n=i[0].unit+"",r,s;function o(l){i[7](l)}let a={min:1};return i[0].value!==void 0&&(a.value=i[0].value),e=new Ke({props:a}),ge.push(()=>be(e,"value",o)),{c(){F(e.$$.fragment),r=oe(n)},l(l){N(e.$$.fragment,l),r=ae(l,n)},m(l,u){M(e,l,u),x(l,r,u),s=!0},p(l,u){const f={};!t&&u&1&&(t=!0,f.value=l[0].value,ve(()=>t=!1)),e.$set(f),(!s||u&1)&&n!==(n=l[0].unit+"")&&tt(r,n)},i(l){s||(v(e.$$.fragment,l),s=!0)},o(l){w(e.$$.fragment,l),s=!1},d(l){P(e,l),l&&k(r)}}}function wm(i){let e;return{c(){e=oe("Одинаковая ширина")},l(t){e=ae(t,"Одинаковая ширина")},m(t,n){x(t,e,n)},p:Be,i:Be,o:Be,d(t){t&&k(e)}}}function ym(i){let e;return{c(){e=oe("Одинаковая высота")},l(t){e=ae(t,"Одинаковая высота")},m(t,n){x(t,e,n)},p:Be,i:Be,o:Be,d(t){t&&k(e)}}}function Em(i){let e,t,n,r;const s=[ym,wm,$m,vm,bm],o=[];function a(l,u){return l[0].type==="same-height"?0:l[0].type==="same-width"?1:l[0].type==="fixed"?2:l[0].type==="relative"?3:4}return e=a(i),t=o[e]=s[e](i),{c(){t.c(),n=Ge()},l(l){t.l(l),n=Ge()},m(l,u){o[e].m(l,u),x(l,n,u),r=!0},p(l,u){let f=e;e=a(l),e===f?o[e].p(l,u):(Oe(),w(o[f],1,1,()=>{o[f]=null}),xe(),t=o[e],t?t.p(l,u):(t=o[e]=s[e](l),t.c()),v(t,1),t.m(n.parentNode,n))},i(l){r||(v(t),r=!0)},o(l){w(t),r=!1},d(l){o[e].d(l),l&&k(n)}}}function km(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b,S,y,A,I,C;return A=oi(i[2][0]),{c(){e=K("section"),t=K("label"),n=K("input"),r=oe(` + Одинаковая высота`),s=re(),o=K("label"),a=K("input"),l=oe(` + Одинаковая ширина`),u=re(),f=K("label"),c=K("input"),h=oe(` + Пункты (pt)`),d=re(),p=K("label"),m=K("input"),_=oe(` + Пиксели (px)`),g=re(),b=K("label"),S=K("input"),y=oe(` + % от высоты кадра (vh)`),this.h()},l(H){e=J(H,"SECTION",{slot:!0,class:!0});var G=te(e);t=J(G,"LABEL",{class:!0});var ne=te(t);n=J(ne,"INPUT",{type:!0,style:!0}),r=ae(ne,` + Одинаковая высота`),ne.forEach(k),s=ie(G),o=J(G,"LABEL",{class:!0});var Q=te(o);a=J(Q,"INPUT",{type:!0,style:!0}),l=ae(Q,` + Одинаковая ширина`),Q.forEach(k),u=ie(G),f=J(G,"LABEL",{class:!0});var R=te(f);c=J(R,"INPUT",{type:!0,style:!0}),h=ae(R,` + Пункты (pt)`),R.forEach(k),d=ie(G),p=J(G,"LABEL",{class:!0});var X=te(p);m=J(X,"INPUT",{type:!0,style:!0}),_=ae(X,` + Пиксели (px)`),X.forEach(k),g=ie(G),b=J(G,"LABEL",{class:!0});var E=te(b);S=J(E,"INPUT",{type:!0,style:!0}),y=ae(E,` + % от высоты кадра (vh)`),E.forEach(k),G.forEach(k),this.h()},h(){D(n,"type","radio"),n.__value={type:"same-height"},n.value=n.__value,et(n,"display","none"),D(t,"class","svelte-aalkfq"),D(a,"type","radio"),a.__value={type:"same-width"},a.value=a.__value,et(a,"display","none"),D(o,"class","svelte-aalkfq"),D(c,"type","radio"),c.__value={type:"fixed",unit:"pt",value:60},c.value=c.__value,et(c,"display","none"),D(f,"class","svelte-aalkfq"),D(m,"type","radio"),m.__value={type:"fixed",unit:"px",value:80},m.value=m.__value,et(m,"display","none"),D(p,"class","svelte-aalkfq"),D(S,"type","radio"),S.__value={type:"relative",unit:"vh",value:7.4},S.value=S.__value,et(S,"display","none"),D(b,"class","svelte-aalkfq"),D(e,"slot","content"),D(e,"class","values svelte-aalkfq"),A.p(n,a,c,m,S)},m(H,G){x(H,e,G),O(e,t),O(t,n),n.checked=n.__value===i[0],O(t,r),O(e,s),O(e,o),O(o,a),a.checked=a.__value===i[0],O(o,l),O(e,u),O(e,f),O(f,c),c.checked=c.__value===i[0],O(f,h),O(e,d),O(e,p),O(p,m),m.checked=m.__value===i[0],O(p,_),O(e,g),O(e,b),O(b,S),S.checked=S.__value===i[0],O(b,y),I||(C=[Re(n,"change",i[1]),Re(a,"change",i[3]),Re(c,"change",i[4]),Re(m,"change",i[5]),Re(S,"change",i[6])],I=!0)},p(H,G){G&1&&(n.checked=n.__value===H[0]),G&1&&(a.checked=a.__value===H[0]),G&1&&(c.checked=c.__value===H[0]),G&1&&(m.checked=m.__value===H[0]),G&1&&(S.checked=S.__value===H[0])},d(H){H&&k(e),A.r(),I=!1,gt(C)}}}function Sm(i){let e,t;return e=new li({props:{title:"Размер шрифта",css:{height:"48px",main:"min-width:156px;flex: 1",width:"100%"},$$slots:{content:[km],header:[Em]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&513&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Am(i,e,t){let{value:n}=e;const r=[[]];function s(){n=this.__value,t(0,n)}function o(){n=this.__value,t(0,n)}function a(){n=this.__value,t(0,n)}function l(){n=this.__value,t(0,n)}function u(){n=this.__value,t(0,n)}function f(h){i.$$.not_equal(n.value,h)&&(n.value=h,t(0,n))}function c(h){i.$$.not_equal(n.value,h)&&(n.value=h,t(0,n))}return i.$$set=h=>{"value"in h&&t(0,n=h.value)},[n,s,r,o,a,l,u,f,c]}class Im extends ye{constructor(e){super(),Ee(this,e,Am,Sm,$e,{value:0})}}function ps(i){let e,t;return{c(){e=K("div"),t=oe(i[0]),this.h()},l(n){e=J(n,"DIV",{class:!0});var r=te(e);t=ae(r,i[0]),r.forEach(k),this.h()},h(){D(e,"class","svelte-14wdl9")},m(n,r){x(n,e,r),O(e,t)},p(n,r){r&1&&tt(t,n[0])},d(n){n&&k(e)}}}function Tm(i){let e,t,n;const r=i[2].default,s=Fe(r,i,i[1],null);let o=i[0]&&ps(i);return{c(){e=K("article"),s&&s.c(),t=re(),o&&o.c(),this.h()},l(a){e=J(a,"ARTICLE",{class:!0});var l=te(e);s&&s.l(l),t=ie(l),o&&o.l(l),l.forEach(k),this.h()},h(){D(e,"class","svelte-14wdl9"),Je(e,"error",i[0])},m(a,l){x(a,e,l),s&&s.m(e,null),O(e,t),o&&o.m(e,null),n=!0},p(a,[l]){s&&s.p&&(!n||l&2)&&Ne(s,r,a,a[1],n?Pe(r,a[1],l,null):Me(a[1]),null),a[0]?o?o.p(a,l):(o=ps(a),o.c(),o.m(e,null)):o&&(o.d(1),o=null),(!n||l&1)&&Je(e,"error",a[0])},i(a){n||(v(s,a),n=!0)},o(a){w(s,a),n=!1},d(a){a&&k(e),s&&s.d(a),o&&o.d()}}}function Cm(i,e,t){let{$$slots:n={},$$scope:r}=e,{error:s=""}=e;return i.$$set=o=>{"error"in o&&t(0,s=o.error),"$$scope"in o&&t(1,r=o.$$scope)},[s,r,n]}class _s extends ye{constructor(e){super(),Ee(this,e,Cm,Tm,$e,{error:0})}}function gs(i,e,t){const n=i.slice();return n[4]=e[t],n}function Rm(i){let e,t,n;function r(o){i[3](o)}let s={width:"60px",min:-1,step:.125,precision:3};return i[0]!==void 0&&(s.value=i[0]),e=new Ke({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};!t&&a&1&&(t=!0,l.value=o[0],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function bs(i){let e,t,n,r,s,o,a,l;return o=oi(i[2][0]),{c(){e=K("label"),t=K("input"),n=re(),r=oe(i[4]),s=re(),this.h()},l(u){e=J(u,"LABEL",{class:!0});var f=te(e);t=J(f,"INPUT",{type:!0,style:!0}),n=ie(f),r=ae(f,i[4]),s=ie(f),f.forEach(k),this.h()},h(){D(t,"type","radio"),t.__value=i[4],t.value=t.__value,et(t,"display","none"),D(e,"class","svelte-aalkfq"),o.p(t)},m(u,f){x(u,e,f),O(e,t),t.checked=t.__value===i[0],O(e,n),O(e,r),O(e,s),a||(l=Re(t,"change",i[1]),a=!0)},p(u,f){f&1&&(t.checked=t.__value===u[0])},d(u){u&&k(e),o.r(),a=!1,l()}}}function Fm(i){let e,t=[0,.5,1,1.25],n=[];for(let r=0;r<4;r+=1)n[r]=bs(gs(i,t,r));return{c(){e=K("section");for(let r=0;r<4;r+=1)n[r].c();this.h()},l(r){e=J(r,"SECTION",{slot:!0,class:!0});var s=te(e);for(let o=0;o<4;o+=1)n[o].l(s);s.forEach(k),this.h()},h(){D(e,"slot","content"),D(e,"class","values svelte-aalkfq")},m(r,s){x(r,e,s);for(let o=0;o<4;o+=1)n[o]&&n[o].m(e,null)},p(r,s){if(s&1){t=[0,.5,1,1.25];let o;for(o=0;o<4;o+=1){const a=gs(r,t,o);n[o]?n[o].p(a,s):(n[o]=bs(a),n[o].c(),n[o].m(e,null))}for(;o<4;o+=1)n[o].d(1)}},d(r){r&&k(e),Sn(n,r)}}}function Nm(i){let e,t;return e=new li({props:{title:"Междустрочный интервал в кол-ве строк",css:{height:"48px",main:"min-width:156px;flex: 1",width:"100%"},$$slots:{content:[Fm],header:[Rm]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&129&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Mm(i,e,t){let{value:n}=e;const r=[[]];function s(){n=this.__value,t(0,n)}function o(a){n=a,t(0,n)}return i.$$set=a=>{"value"in a&&t(0,n=a.value)},[n,s,r,o]}class Pm extends ye{constructor(e){super(),Ee(this,e,Mm,Nm,$e,{value:0})}}function Bm(i){let e,t=i[35].name+"",n;return{c(){e=K("div"),n=oe(t)},l(r){e=J(r,"DIV",{});var s=te(e);n=ae(s,t),s.forEach(k)},m(r,s){x(r,e,s),O(e,n)},p(r,s){s[1]&16&&t!==(t=r[35].name+"")&&tt(n,t)},d(r){r&&k(e)}}}function Dm(i){let e,t=i[35].name+"",n,r;return{c(){e=K("div"),n=oe(t),this.h()},l(s){e=J(s,"DIV",{style:!0,title:!0});var o=te(e);n=ae(o,t),o.forEach(k),this.h()},h(){et(e,"font",Ht(i[35].preset.font,16)),D(e,"title",r=i[10](i[35].preset))},m(s,o){x(s,e,o),O(e,n)},p(s,o){o[1]&16&&t!==(t=s[35].name+"")&&tt(n,t),o[1]&16&&et(e,"font",Ht(s[35].preset.font,16)),o[1]&16&&r!==(r=s[10](s[35].preset))&&D(e,"title",r)},d(s){s&&k(e)}}}function zm(i){let e;function t(s,o){return s[35].preset?Dm:Bm}let n=t(i),r=n(i);return{c(){r.c(),e=Ge()},l(s){r.l(s),e=Ge()},m(s,o){r.m(s,o),x(s,e,o)},p(s,o){n===(n=t(s))&&r?r.p(s,o):(r.d(1),r=n(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){r.d(s),s&&k(e)}}}function vs(i){let e,t;return e=new qt({props:{$$slots:{default:[xm]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[0]&5|r[1]&32&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Lm(i){let e,t,n,r,s,o;function a(u){i[20](u)}let l={};return i[0].fontSizeStrategy!==void 0&&(l.value=i[0].fontSizeStrategy),r=new Im({props:l}),ge.push(()=>be(r,"value",a)),{c(){e=K("span"),t=oe("Размер текста"),n=re(),F(r.$$.fragment)},l(u){e=J(u,"SPAN",{});var f=te(e);t=ae(f,"Размер текста"),f.forEach(k),n=ie(u),N(r.$$.fragment,u)},m(u,f){x(u,e,f),O(e,t),x(u,n,f),M(r,u,f),o=!0},p(u,f){const c={};!s&&f[0]&1&&(s=!0,c.value=u[0].fontSizeStrategy,ve(()=>s=!1)),r.$set(c)},i(u){o||(v(r.$$.fragment,u),o=!0)},o(u){w(r.$$.fragment,u),o=!1},d(u){u&&k(e),u&&k(n),P(r,u)}}}function Um(i){let e,t,n,r,s,o;function a(u){i[21](u)}let l={};return i[0].lineSpacing!==void 0&&(l.value=i[0].lineSpacing),r=new Pm({props:l}),ge.push(()=>be(r,"value",a)),{c(){e=K("span"),t=oe("Междустрочный интервал"),n=re(),F(r.$$.fragment)},l(u){e=J(u,"SPAN",{});var f=te(e);t=ae(f,"Междустрочный интервал"),f.forEach(k),n=ie(u),N(r.$$.fragment,u)},m(u,f){x(u,e,f),O(e,t),x(u,n,f),M(r,u,f),o=!0},p(u,f){const c={};!s&&f[0]&1&&(s=!0,c.value=u[0].lineSpacing,ve(()=>s=!1)),r.$set(c)},i(u){o||(v(r.$$.fragment,u),o=!0)},o(u){w(r.$$.fragment,u),o=!1},d(u){u&&k(e),u&&k(n),P(r,u)}}}function $s(i){let e,t;return e=new Ze({props:{$$slots:{default:[Om]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[0]&1|r[1]&32&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Om(i){let e,t,n;return t=new Ke({props:{min:0,max:100,step:.5,withRange:!0,withButtons:!1,value:i[0].padding*100}}),t.$on("input",i[22]),{c(){e=oe("Отступ: "),F(t.$$.fragment)},l(r){e=ae(r,"Отступ: "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s[0]&1&&(o.value=r[0].padding*100),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function xm(i){let e,t,n,r,s,o;e=new _s({props:{$$slots:{default:[Lm]},$$scope:{ctx:i}}}),n=new _s({props:{$$slots:{default:[Um]},$$scope:{ctx:i}}});let a=i[2].type==="global"&&$s(i);return{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment),r=re(),a&&a.c(),s=Ge()},l(l){N(e.$$.fragment,l),t=ie(l),N(n.$$.fragment,l),r=ie(l),a&&a.l(l),s=Ge()},m(l,u){M(e,l,u),x(l,t,u),M(n,l,u),x(l,r,u),a&&a.m(l,u),x(l,s,u),o=!0},p(l,u){const f={};u[0]&1|u[1]&32&&(f.$$scope={dirty:u,ctx:l}),e.$set(f);const c={};u[0]&1|u[1]&32&&(c.$$scope={dirty:u,ctx:l}),n.$set(c),l[2].type==="global"?a?(a.p(l,u),u[0]&4&&v(a,1)):(a=$s(l),a.c(),v(a,1),a.m(s.parentNode,s)):a&&(Oe(),w(a,1,1,()=>{a=null}),xe())},i(l){o||(v(e.$$.fragment,l),v(n.$$.fragment,l),v(a),o=!0)},o(l){w(e.$$.fragment,l),w(n.$$.fragment,l),w(a),o=!1},d(l){P(e,l),l&&k(t),P(n,l),l&&k(r),a&&a.d(l),l&&k(s)}}}function Gm(i){let e,t;return e=new mu({props:{transform:"rotate(-12)",size:32}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function jm(i){let e,t;return e=new Vn({props:{type:"bootstrap",path:Ym,size:32}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Hm(i){let e,t,n,r,s;const o=[jm,Gm],a=[];function l(u,f){return u[34].icon==="fill"?0:u[34].icon==="stroke"?1:-1}return~(t=l(i))&&(n=a[t]=o[t](i)),{c(){e=K("div"),n&&n.c(),this.h()},l(u){e=J(u,"DIV",{class:!0,title:!0});var f=te(e);n&&n.l(f),f.forEach(k),this.h()},h(){D(e,"class","icon svelte-s55el5"),D(e,"title",r=i[34].label)},m(u,f){x(u,e,f),~t&&a[t].m(e,null),s=!0},p(u,f){let c=t;t=l(u),t===c?~t&&a[t].p(u,f):(n&&(Oe(),w(a[c],1,1,()=>{a[c]=null}),xe()),~t?(n=a[t],n?n.p(u,f):(n=a[t]=o[t](u),n.c()),v(n,1),n.m(e,null)):n=null),(!s||f[1]&8&&r!==(r=u[34].label))&&D(e,"title",r)},i(u){s||(v(n),s=!0)},o(u){w(n),s=!1},d(u){u&&k(e),~t&&a[t].d()}}}function Vm(i){let e,t,n,r,s;e=new Ze({props:{$$slots:{default:[qm]},$$scope:{ctx:i}}});function o(l){i[28](l)}let a={defaults:[{type:"disabled"},{type:"color",value:"#000000"},{type:"pattern",name:"fire",rotate:0,scale:{x:1,y:1},shift:{x:0,y:0}},{type:"gradient4",color1:"#ff0000",color2:"#00ff00",color3:"#0000ff",color4:"#fff000"}]};return i[0].stroke!==void 0&&(a.value=i[0].stroke),n=new _o({props:a}),ge.push(()=>be(n,"value",o)),n.$on("change",i[29]),n.$on("addPattern",i[30]),{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment)},l(l){N(e.$$.fragment,l),t=ie(l),N(n.$$.fragment,l)},m(l,u){M(e,l,u),x(l,t,u),M(n,l,u),s=!0},p(l,u){const f={};u[0]&1|u[1]&32&&(f.$$scope={dirty:u,ctx:l}),e.$set(f);const c={};!r&&u[0]&1&&(r=!0,c.value=l[0].stroke,ve(()=>r=!1)),n.$set(c)},i(l){s||(v(e.$$.fragment,l),v(n.$$.fragment,l),s=!0)},o(l){w(e.$$.fragment,l),w(n.$$.fragment,l),s=!1},d(l){P(e,l),l&&k(t),P(n,l)}}}function Wm(i){let e,t,n;function r(o){i[24](o)}let s={defaults:[{type:"disabled"},{type:"color",value:"#ffffff"},{type:"pattern",name:"fire",rotate:0,scale:{x:1,y:1},shift:{x:0,y:0}},{type:"gradient4",color1:"#ff0000",color2:"#00ff00",color3:"#0000ff",color4:"#fff000"}]};return i[0].fill!==void 0&&(s.value=i[0].fill),e=new _o({props:s}),ge.push(()=>be(e,"value",r)),e.$on("change",i[25]),e.$on("addPattern",i[26]),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};!t&&a[0]&1&&(t=!0,l.value=o[0].fill,ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function qm(i){let e,t,n,r;function s(a){i[27](a)}let o={min:0,rangeMax:50,withRange:!0};return i[0].strokeWidth!==void 0&&(o.value=i[0].strokeWidth),t=new Ke({props:o}),ge.push(()=>be(t,"value",s)),{c(){e=oe(`Толщина обводки (%) + `),F(t.$$.fragment)},l(a){e=ae(a,`Толщина обводки (%) + `),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l[0]&1&&(n=!0,u.value=a[0].strokeWidth,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function Zm(i){let e,t,n,r;const s=[Wm,Vm],o=[];function a(l,u){return l[34].label==="Заливка"?0:l[34].label==="Обводка"?1:-1}return~(t=a(i))&&(n=o[t]=s[t](i)),{c(){e=K("div"),n&&n.c(),this.h()},l(l){e=J(l,"DIV",{slot:!0});var u=te(e);n&&n.l(u),u.forEach(k),this.h()},h(){D(e,"slot","content")},m(l,u){x(l,e,u),~t&&o[t].m(e,null),r=!0},p(l,u){let f=t;t=a(l),t===f?~t&&o[t].p(l,u):(n&&(Oe(),w(o[f],1,1,()=>{o[f]=null}),xe()),~t?(n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),v(n,1),n.m(e,null)):n=null)},i(l){r||(v(n),r=!0)},o(l){w(n),r=!1},d(l){l&&k(e),~t&&o[t].d()}}}function Xm(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b,S;function y(V){i[12](V)}let A={placeholder:i[8],items:[i[8],...i[6].map(ws)],$$slots:{default:[zm,({item:V})=>({35:V}),({item:V})=>[0,V?16:0]]},$$scope:{ctx:i}};i[4]!==void 0&&(A.value=i[4]),t=new Et({props:A}),ge.push(()=>be(t,"value",y)),t.$on("change",i[9]),t.$on("change",i[13]);function I(V){i[14](V)}function C(V){i[15](V)}function H(V){i[16](V)}function G(V){i[17](V)}function ne(V){i[18](V)}let Q={};i[0].font!==void 0&&(Q.font=i[0].font),i[0].case!==void 0&&(Q.textCase=i[0].case),i[0].align!==void 0&&(Q.align=i[0].align),i[0].baseline!==void 0&&(Q.baseline=i[0].baseline),i[5]!==void 0&&(Q.moreSettings=i[5]),s=new gm({props:Q}),ge.push(()=>be(s,"font",I)),ge.push(()=>be(s,"textCase",C)),ge.push(()=>be(s,"align",H)),ge.push(()=>be(s,"baseline",G)),ge.push(()=>be(s,"moreSettings",ne)),s.$on("change",i[19]);let R=i[5]&&vs(i);function X(V){i[31](V)}let E={tabs:i[7],$$slots:{content:[Zm,({tab:V})=>({34:V}),({tab:V})=>[0,V?8:0]],default:[Hm,({tab:V})=>({34:V}),({tab:V})=>[0,V?8:0]]},$$scope:{ctx:i}};return i[3]!==void 0&&(E.activeTab=i[3]),m=new co({props:E}),ge.push(()=>be(m,"activeTab",X)),{c(){e=K("article"),F(t.$$.fragment),r=re(),F(s.$$.fragment),c=re(),R&&R.c(),h=re(),d=K("textarea"),p=re(),F(m.$$.fragment),this.h()},l(V){e=J(V,"ARTICLE",{});var W=te(e);N(t.$$.fragment,W),r=ie(W),N(s.$$.fragment,W),c=ie(W),R&&R.l(W),h=ie(W),d=J(W,"TEXTAREA",{style:!0,rows:!0,class:!0}),te(d).forEach(k),p=ie(W),N(m.$$.fragment,W),W.forEach(k),this.h()},h(){et(d,"width","100%"),et(d,"max-width","100%"),et(d,"min-width","100%"),D(d,"rows","6"),D(d,"class","svelte-s55el5")},m(V,W){x(V,e,W),M(t,e,null),O(e,r),M(s,e,null),O(e,c),R&&R.m(e,null),O(e,h),O(e,d),Rt(d,i[1]),O(e,p),M(m,e,null),g=!0,b||(S=[Re(d,"input",i[23]),Re(d,"change",i[11])],b=!0)},p(V,W){const j={};W[0]&64&&(j.items=[V[8],...V[6].map(ws)]),W[1]&48&&(j.$$scope={dirty:W,ctx:V}),!n&&W[0]&16&&(n=!0,j.value=V[4],ve(()=>n=!1)),t.$set(j);const q={};!o&&W[0]&1&&(o=!0,q.font=V[0].font,ve(()=>o=!1)),!a&&W[0]&1&&(a=!0,q.textCase=V[0].case,ve(()=>a=!1)),!l&&W[0]&1&&(l=!0,q.align=V[0].align,ve(()=>l=!1)),!u&&W[0]&1&&(u=!0,q.baseline=V[0].baseline,ve(()=>u=!1)),!f&&W[0]&32&&(f=!0,q.moreSettings=V[5],ve(()=>f=!1)),s.$set(q),V[5]?R?(R.p(V,W),W[0]&32&&v(R,1)):(R=vs(V),R.c(),v(R,1),R.m(e,h)):R&&(Oe(),w(R,1,1,()=>{R=null}),xe()),W[0]&2&&Rt(d,V[1]);const ee={};W[0]&1|W[1]&40&&(ee.$$scope={dirty:W,ctx:V}),!_&&W[0]&8&&(_=!0,ee.activeTab=V[3],ve(()=>_=!1)),m.$set(ee)},i(V){g||(v(t.$$.fragment,V),v(s.$$.fragment,V),v(R),v(m.$$.fragment,V),g=!0)},o(V){w(t.$$.fragment,V),w(s.$$.fragment,V),w(R),w(m.$$.fragment,V),g=!1},d(V){V&&k(e),P(t),P(s),R&&R.d(),P(m),b=!1,gt(S)}}}const Ym="M6.192 2.78c-.458-.677-.927-1.248-1.35-1.643a2.972 2.972 0 0 0-.71-.515c-.217-.104-.56-.205-.882-.02-.367.213-.427.63-.43.896-.003.304.064.664.173 1.044.196.687.556 1.528 1.035 2.402L.752 8.22c-.277.277-.269.656-.218.918.055.283.187.593.36.903.348.627.92 1.361 1.626 2.068.707.707 1.441 1.278 2.068 1.626.31.173.62.305.903.36.262.05.64.059.918-.218l5.615-5.615c.118.257.092.512.05.939-.03.292-.068.665-.073 1.176v.123h.003a1 1 0 0 0 1.993 0H14v-.057a1.01 1.01 0 0 0-.004-.117c-.055-1.25-.7-2.738-1.86-3.494a4.322 4.322 0 0 0-.211-.434c-.349-.626-.92-1.36-1.627-2.067-.707-.707-1.441-1.279-2.068-1.627-.31-.172-.62-.304-.903-.36-.262-.05-.64-.058-.918.219l-.217.216zM4.16 1.867c.381.356.844.922 1.311 1.632l-.704.705c-.382-.727-.66-1.402-.813-1.938a3.283 3.283 0 0 1-.131-.673c.091.061.204.15.337.274zm.394 3.965c.54.852 1.107 1.567 1.607 2.033a.5.5 0 1 0 .682-.732c-.453-.422-1.017-1.136-1.564-2.027l1.088-1.088c.054.12.115.243.183.365.349.627.92 1.361 1.627 2.068.706.707 1.44 1.278 2.068 1.626.122.068.244.13.365.183l-4.861 4.862a.571.571 0 0 1-.068-.01c-.137-.027-.342-.104-.608-.252-.524-.292-1.186-.8-1.846-1.46-.66-.66-1.168-1.32-1.46-1.846-.147-.265-.225-.47-.251-.607a.573.573 0 0 1-.01-.068l3.048-3.047zm2.87-1.935a2.44 2.44 0 0 1-.241-.561c.135.033.324.11.562.241.524.292 1.186.8 1.846 1.46.45.45.83.901 1.118 1.31a3.497 3.497 0 0 0-1.066.091 11.27 11.27 0 0 1-.76-.694c-.66-.66-1.167-1.322-1.458-1.847z",ws=i=>({name:i.name,preset:i});function Km(i,e,t){let n;yt(i,bo,L=>t(6,n=L));let{style:r}=e,{text:s}=e,{container:o}=e,a=[{icon:"fill",label:"Заливка"},{icon:"stroke",label:"Обводка"}],l=a[0];const u={name:"Выбрать пресет...",preset:null};let f=u;function c(L){const Z=L.detail.value.preset;Z&&(t(0,r=go(Z,r)),t(4,f=u))}const h={"#ffffff":"белая","#000000":"чёрная"};function d(L){const Z=[];switch(L.settings.type){case"disabled":return"отсутствует";case"color":Z.push(h[L.settings.value]||`цвет: ${L.settings.value}`);break;case"pattern":Z.push(`паттерн (${L.settings.name})`);break;case"gradient4":Z.push("градиент");break}return L.shadow&&Z.push("с тенью"),Z.join(" ")}function p(L){return`Шрифт: ${Er(L.font," ")} +Заливка: ${d(L.fill)} +Обводка: ${d(L.stroke)}`}let m=!1;function _(L){Ie.call(this,i,L)}function g(L){f=L,t(4,f)}function b(L){Ie.call(this,i,L)}function S(L){i.$$.not_equal(r.font,L)&&(r.font=L,t(0,r))}function y(L){i.$$.not_equal(r.case,L)&&(r.case=L,t(0,r))}function A(L){i.$$.not_equal(r.align,L)&&(r.align=L,t(0,r))}function I(L){i.$$.not_equal(r.baseline,L)&&(r.baseline=L,t(0,r))}function C(L){m=L,t(5,m)}function H(L){Ie.call(this,i,L)}function G(L){i.$$.not_equal(r.fontSizeStrategy,L)&&(r.fontSizeStrategy=L,t(0,r))}function ne(L){i.$$.not_equal(r.lineSpacing,L)&&(r.lineSpacing=L,t(0,r))}const Q=L=>{t(0,r.padding=L.detail/100,r)};function R(){s=this.value,t(1,s)}function X(L){i.$$.not_equal(r.fill,L)&&(r.fill=L,t(0,r))}function E(L){Ie.call(this,i,L)}function V(L){Ie.call(this,i,L)}function W(L){i.$$.not_equal(r.strokeWidth,L)&&(r.strokeWidth=L,t(0,r))}function j(L){i.$$.not_equal(r.stroke,L)&&(r.stroke=L,t(0,r))}function q(L){Ie.call(this,i,L)}function ee(L){Ie.call(this,i,L)}function we(L){l=L,t(3,l)}return i.$$set=L=>{"style"in L&&t(0,r=L.style),"text"in L&&t(1,s=L.text),"container"in L&&t(2,o=L.container)},[r,s,o,l,f,m,n,a,u,c,p,_,g,b,S,y,A,I,C,H,G,ne,Q,R,X,E,V,W,j,q,ee,we]}class Jm extends ye{constructor(e){super(),Ee(this,e,Km,Xm,$e,{style:0,text:1,container:2},null,[-1,-1])}}function Qm(i){let e,t,n,r;function s(l){i[2](l)}function o(l){i[3](l)}let a={container:i[1]};return i[0].text!==void 0&&(a.text=i[0].text),i[0].style!==void 0&&(a.style=i[0].style),e=new Jm({props:a}),ge.push(()=>be(e,"text",s)),ge.push(()=>be(e,"style",o)),e.$on("change",i[4]),e.$on("addPattern",i[5]),{c(){F(e.$$.fragment)},l(l){N(e.$$.fragment,l)},m(l,u){M(e,l,u),r=!0},p(l,[u]){const f={};u&2&&(f.container=l[1]),!t&&u&1&&(t=!0,f.text=l[0].text,ve(()=>t=!1)),!n&&u&1&&(n=!0,f.style=l[0].style,ve(()=>n=!1)),e.$set(f)},i(l){r||(v(e.$$.fragment,l),r=!0)},o(l){w(e.$$.fragment,l),r=!1},d(l){P(e,l)}}}function ed(i,e,t){let{content:n}=e,{container:r}=e;function s(u){i.$$.not_equal(n.text,u)&&(n.text=u,t(0,n))}function o(u){i.$$.not_equal(n.style,u)&&(n.style=u,t(0,n))}function a(u){Ie.call(this,i,u)}function l(u){Ie.call(this,i,u)}return i.$$set=u=>{"content"in u&&t(0,n=u.content),"container"in u&&t(1,r=u.container)},[n,r,s,o,a,l]}class wo extends ye{constructor(e){super(),Ee(this,e,ed,Qm,$e,{content:0,container:1})}}function ys(i){let e,t;return e=new Ye({props:{title:"Создать копию",$$slots:{default:[td]},$$scope:{ctx:i}}}),e.$on("click",i[5]("copy")),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&272&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function td(i){let e,t;return e=new lo({props:{size:i[4]}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&16&&(s.size=n[4]),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Es(i){let e,t;return e=new Ye({props:{title:"Поменять местами с верхним",$$slots:{default:[nd]},$$scope:{ctx:i}}}),e.$on("click",i[5]("up")),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&272&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function nd(i){let e,t;return e=new Nl({props:{size:i[4]}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&16&&(s.size=n[4]),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function ks(i){let e,t;return e=new Ye({props:{title:"Поменять местами с нижним",$$slots:{default:[rd]},$$scope:{ctx:i}}}),e.$on("click",i[5]("down")),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&272&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function rd(i){let e,t;return e=new Il({props:{size:i[4]}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&16&&(s.size=n[4]),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Ss(i){let e,t;return e=new Ye({props:{title:"Удалить",type:"danger",$$slots:{default:[id]},$$scope:{ctx:i}}}),e.$on("click",i[5]("remove")),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&272&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function id(i){let e,t;return e=new hc({props:{size:i[4]}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&16&&(s.size=n[4]),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function sd(i){let e,t,n,r,s,o,a,l=i[2]&&ys(i),u=i[0]&&Es(i),f=i[1]&&ks(i);const c=i[7].default,h=Fe(c,i,i[8],null);let d=i[3]&&Ss(i);return{c(){e=K("footer"),l&&l.c(),t=re(),u&&u.c(),n=re(),f&&f.c(),r=re(),h&&h.c(),s=re(),d&&d.c(),this.h()},l(p){e=J(p,"FOOTER",{style:!0,class:!0});var m=te(e);l&&l.l(m),t=ie(m),u&&u.l(m),n=ie(m),f&&f.l(m),r=ie(m),h&&h.l(m),s=ie(m),d&&d.l(m),m.forEach(k),this.h()},h(){D(e,"style",o=`--buttons-height: ${i[4]+16}px`),D(e,"class","svelte-zcq5oe")},m(p,m){x(p,e,m),l&&l.m(e,null),O(e,t),u&&u.m(e,null),O(e,n),f&&f.m(e,null),O(e,r),h&&h.m(e,null),O(e,s),d&&d.m(e,null),a=!0},p(p,[m]){p[2]?l?(l.p(p,m),m&4&&v(l,1)):(l=ys(p),l.c(),v(l,1),l.m(e,t)):l&&(Oe(),w(l,1,1,()=>{l=null}),xe()),p[0]?u?(u.p(p,m),m&1&&v(u,1)):(u=Es(p),u.c(),v(u,1),u.m(e,n)):u&&(Oe(),w(u,1,1,()=>{u=null}),xe()),p[1]?f?(f.p(p,m),m&2&&v(f,1)):(f=ks(p),f.c(),v(f,1),f.m(e,r)):f&&(Oe(),w(f,1,1,()=>{f=null}),xe()),h&&h.p&&(!a||m&256)&&Ne(h,c,p,p[8],a?Pe(c,p[8],m,null):Me(p[8]),null),p[3]?d?(d.p(p,m),m&8&&v(d,1)):(d=Ss(p),d.c(),v(d,1),d.m(e,null)):d&&(Oe(),w(d,1,1,()=>{d=null}),xe()),(!a||m&16&&o!==(o=`--buttons-height: ${p[4]+16}px`))&&D(e,"style",o)},i(p){a||(v(l),v(u),v(f),v(h,p),v(d),a=!0)},o(p){w(l),w(u),w(f),w(h,p),w(d),a=!1},d(p){p&&k(e),l&&l.d(),u&&u.d(),f&&f.d(),h&&h.d(p),d&&d.d()}}}function od(i,e,t){let{$$slots:n={},$$scope:r}=e,{value:s}=e,{up:o=!1}=e,{down:a=!1}=e,{copy:l=!1}=e,{remove:u=!1}=e,{iconSize:f=16}=e;const c=St();function h(d){return p=>{p.preventDefault(),p.stopPropagation(),c(d,s)}}return i.$$set=d=>{"value"in d&&t(6,s=d.value),"up"in d&&t(0,o=d.up),"down"in d&&t(1,a=d.down),"copy"in d&&t(2,l=d.copy),"remove"in d&&t(3,u=d.remove),"iconSize"in d&&t(4,f=d.iconSize),"$$scope"in d&&t(8,r=d.$$scope)},[o,a,l,u,f,h,s,n,r]}class ui extends ye{constructor(e){super(),Ee(this,e,od,sd,$e,{value:6,up:0,down:1,copy:2,remove:3,iconSize:4})}}function ad(i){let e,t,n=i[0]+1+"",r,s,o,a,l;const u=i[4].default,f=Fe(u,i,i[3],null);return{c(){e=K("article"),t=K("header"),r=oe(n),s=re(),o=K("canvas"),a=re(),f&&f.c(),this.h()},l(c){e=J(c,"ARTICLE",{class:!0});var h=te(e);t=J(h,"HEADER",{class:!0});var d=te(t);r=ae(d,n),d.forEach(k),s=ie(h),o=J(h,"CANVAS",{class:!0}),te(o).forEach(k),a=ie(h),f&&f.l(h),h.forEach(k),this.h()},h(){D(t,"class","svelte-awjzj9"),D(o,"class","svelte-awjzj9"),D(e,"class","svelte-awjzj9")},m(c,h){x(c,e,h),O(e,t),O(t,r),O(e,s),O(e,o),i[5](o),O(e,a),f&&f.m(e,null),l=!0},p(c,[h]){(!l||h&1)&&n!==(n=c[0]+1+"")&&tt(r,n),f&&f.p&&(!l||h&8)&&Ne(f,u,c,c[3],l?Pe(u,c[3],h,null):Me(c[3]),null)},i(c){l||(v(f,c),l=!0)},o(c){w(f,c),l=!1},d(c){c&&k(e),i[5](null),f&&f.d(c)}}}function ld(i,e,t){let{$$slots:n={},$$scope:r}=e,s,o,{index:a}=e;const l=f=>{const c=s.clientWidth,d=c/f.width*f.height|0;s.width!=c&&t(1,s.width=c,s),s.height!=d&&t(1,s.height=d,s),o.clearRect(0,0,c,d),o.drawImage(f,0,0,c,d)};An(()=>{o=s.getContext("2d")});function u(f){ge[f?"unshift":"push"](()=>{s=f,t(1,s)})}return i.$$set=f=>{"index"in f&&t(0,a=f.index),"$$scope"in f&&t(3,r=f.$$scope)},[a,s,l,r,n,u]}class ud extends ye{constructor(e){super(),Ee(this,e,ld,ad,$e,{index:0,updatePreview:2})}get updatePreview(){return this.$$.ctx[2]}}class yo{constructor(e){Ce(this,"i",0);this.prefix=e}generate(){return`${this.prefix}-${this.i++}`}}function zn(i,e){const t=URL.createObjectURL(i);return e(t).finally(()=>URL.revokeObjectURL(t))}function Eo(i){return new Promise((e,t)=>{const n=new Image;n.crossOrigin="anonymous",n.onload=function(){return e(n)},n.onerror=function(){return t(new Error(`Can't load image ${i}`))},n.src=i})}function qr(i){return e=>{const t=document.createElement("a");t.download=i,t.href=URL.createObjectURL(e),document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(t.href)}}/* @license twgl.js 5.3.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved. +Available via the MIT license. +see: http://github.com/greggman/twgl.js for details */let dt=Float32Array;function fd(i){const e=dt;return dt=i,e}function Vt(i,e,t){const n=new dt(3);return i&&(n[0]=i),e&&(n[1]=e),t&&(n[2]=t),n}function cd(i,e,t){return t=t||new dt(3),t[0]=i[0]+e[0],t[1]=i[1]+e[1],t[2]=i[2]+e[2],t}function ko(i,e,t){return t=t||new dt(3),t[0]=i[0]-e[0],t[1]=i[1]-e[1],t[2]=i[2]-e[2],t}function hd(i,e,t,n){return n=n||new dt(3),n[0]=i[0]+t*(e[0]-i[0]),n[1]=i[1]+t*(e[1]-i[1]),n[2]=i[2]+t*(e[2]-i[2]),n}function md(i,e,t,n){return n=n||new dt(3),n[0]=i[0]+t[0]*(e[0]-i[0]),n[1]=i[1]+t[1]*(e[1]-i[1]),n[2]=i[2]+t[2]*(e[2]-i[2]),n}function dd(i,e,t){return t=t||new dt(3),t[0]=Math.max(i[0],e[0]),t[1]=Math.max(i[1],e[1]),t[2]=Math.max(i[2],e[2]),t}function pd(i,e,t){return t=t||new dt(3),t[0]=Math.min(i[0],e[0]),t[1]=Math.min(i[1],e[1]),t[2]=Math.min(i[2],e[2]),t}function _d(i,e,t){return t=t||new dt(3),t[0]=i[0]*e,t[1]=i[1]*e,t[2]=i[2]*e,t}function gd(i,e,t){return t=t||new dt(3),t[0]=i[0]/e,t[1]=i[1]/e,t[2]=i[2]/e,t}function Zr(i,e,t){t=t||new dt(3);const n=i[2]*e[0]-i[0]*e[2],r=i[0]*e[1]-i[1]*e[0];return t[0]=i[1]*e[2]-i[2]*e[1],t[1]=n,t[2]=r,t}function bd(i,e){return i[0]*e[0]+i[1]*e[1]+i[2]*e[2]}function vd(i){return Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2])}function $d(i){return i[0]*i[0]+i[1]*i[1]+i[2]*i[2]}function wd(i,e){const t=i[0]-e[0],n=i[1]-e[1],r=i[2]-e[2];return Math.sqrt(t*t+n*n+r*r)}function yd(i,e){const t=i[0]-e[0],n=i[1]-e[1],r=i[2]-e[2];return t*t+n*n+r*r}function fr(i,e){e=e||new dt(3);const t=i[0]*i[0]+i[1]*i[1]+i[2]*i[2],n=Math.sqrt(t);return n>1e-5?(e[0]=i[0]/n,e[1]=i[1]/n,e[2]=i[2]/n):(e[0]=0,e[1]=0,e[2]=0),e}function Ed(i,e){return e=e||new dt(3),e[0]=-i[0],e[1]=-i[1],e[2]=-i[2],e}function kd(i,e){return e=e||new dt(3),e[0]=i[0],e[1]=i[1],e[2]=i[2],e}function Sd(i,e,t){return t=t||new dt(3),t[0]=i[0]*e[0],t[1]=i[1]*e[1],t[2]=i[2]*e[2],t}function Ad(i,e,t){return t=t||new dt(3),t[0]=i[0]/e[0],t[1]=i[1]/e[1],t[2]=i[2]/e[2],t}var er=Object.freeze({__proto__:null,add:cd,copy:kd,create:Vt,cross:Zr,distance:wd,distanceSq:yd,divide:Ad,divScalar:gd,dot:bd,lerp:hd,lerpV:md,length:vd,lengthSq:$d,max:dd,min:pd,mulScalar:_d,multiply:Sd,negate:Ed,normalize:fr,setDefaultType:fd,subtract:ko});let rt=Float32Array;function Id(i){const e=rt;return rt=i,e}function Td(i,e){return e=e||new rt(16),e[0]=-i[0],e[1]=-i[1],e[2]=-i[2],e[3]=-i[3],e[4]=-i[4],e[5]=-i[5],e[6]=-i[6],e[7]=-i[7],e[8]=-i[8],e[9]=-i[9],e[10]=-i[10],e[11]=-i[11],e[12]=-i[12],e[13]=-i[13],e[14]=-i[14],e[15]=-i[15],e}function Cd(){return new rt(16).fill(0)}function So(i,e){return e=e||new rt(16),e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],e}function Ao(i){return i=i||new rt(16),i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function Rd(i,e){if(e=e||new rt(16),e===i){let b;return b=i[1],i[1]=i[4],i[4]=b,b=i[2],i[2]=i[8],i[8]=b,b=i[3],i[3]=i[12],i[12]=b,b=i[6],i[6]=i[9],i[9]=b,b=i[7],i[7]=i[13],i[13]=b,b=i[11],i[11]=i[14],i[14]=b,e}const t=i[0*4+0],n=i[0*4+1],r=i[0*4+2],s=i[0*4+3],o=i[1*4+0],a=i[1*4+1],l=i[1*4+2],u=i[1*4+3],f=i[2*4+0],c=i[2*4+1],h=i[2*4+2],d=i[2*4+3],p=i[3*4+0],m=i[3*4+1],_=i[3*4+2],g=i[3*4+3];return e[0]=t,e[1]=o,e[2]=f,e[3]=p,e[4]=n,e[5]=a,e[6]=c,e[7]=m,e[8]=r,e[9]=l,e[10]=h,e[11]=_,e[12]=s,e[13]=u,e[14]=d,e[15]=g,e}function Io(i,e){e=e||new rt(16);const t=i[0*4+0],n=i[0*4+1],r=i[0*4+2],s=i[0*4+3],o=i[1*4+0],a=i[1*4+1],l=i[1*4+2],u=i[1*4+3],f=i[2*4+0],c=i[2*4+1],h=i[2*4+2],d=i[2*4+3],p=i[3*4+0],m=i[3*4+1],_=i[3*4+2],g=i[3*4+3],b=h*g,S=_*d,y=l*g,A=_*u,I=l*d,C=h*u,H=r*g,G=_*s,ne=r*d,Q=h*s,R=r*u,X=l*s,E=f*m,V=p*c,W=o*m,j=p*a,q=o*c,ee=f*a,we=t*m,L=p*n,Z=t*c,Se=f*n,me=t*a,_e=o*n,ce=b*a+A*c+I*m-(S*a+y*c+C*m),Ae=S*n+H*c+Q*m-(b*n+G*c+ne*m),ze=y*n+G*a+R*m-(A*n+H*a+X*m),De=C*n+ne*a+X*c-(I*n+Q*a+R*c),Le=1/(t*ce+o*Ae+f*ze+p*De);return e[0]=Le*ce,e[1]=Le*Ae,e[2]=Le*ze,e[3]=Le*De,e[4]=Le*(S*o+y*f+C*p-(b*o+A*f+I*p)),e[5]=Le*(b*t+G*f+ne*p-(S*t+H*f+Q*p)),e[6]=Le*(A*t+H*o+X*p-(y*t+G*o+R*p)),e[7]=Le*(I*t+Q*o+R*f-(C*t+ne*o+X*f)),e[8]=Le*(E*u+j*d+q*g-(V*u+W*d+ee*g)),e[9]=Le*(V*s+we*d+Se*g-(E*s+L*d+Z*g)),e[10]=Le*(W*s+L*u+me*g-(j*s+we*u+_e*g)),e[11]=Le*(ee*s+Z*u+_e*d-(q*s+Se*u+me*d)),e[12]=Le*(W*h+ee*_+V*l-(q*_+E*l+j*h)),e[13]=Le*(Z*_+E*r+L*h-(we*h+Se*_+V*r)),e[14]=Le*(we*l+_e*_+j*r-(me*_+W*r+L*l)),e[15]=Le*(me*h+q*r+Se*l-(Z*l+_e*h+ee*r)),e}function Fd(i,e,t){t=t||new rt(16);const n=i[0],r=i[1],s=i[2],o=i[3],a=i[4+0],l=i[4+1],u=i[4+2],f=i[4+3],c=i[8+0],h=i[8+1],d=i[8+2],p=i[8+3],m=i[12+0],_=i[12+1],g=i[12+2],b=i[12+3],S=e[0],y=e[1],A=e[2],I=e[3],C=e[4+0],H=e[4+1],G=e[4+2],ne=e[4+3],Q=e[8+0],R=e[8+1],X=e[8+2],E=e[8+3],V=e[12+0],W=e[12+1],j=e[12+2],q=e[12+3];return t[0]=n*S+a*y+c*A+m*I,t[1]=r*S+l*y+h*A+_*I,t[2]=s*S+u*y+d*A+g*I,t[3]=o*S+f*y+p*A+b*I,t[4]=n*C+a*H+c*G+m*ne,t[5]=r*C+l*H+h*G+_*ne,t[6]=s*C+u*H+d*G+g*ne,t[7]=o*C+f*H+p*G+b*ne,t[8]=n*Q+a*R+c*X+m*E,t[9]=r*Q+l*R+h*X+_*E,t[10]=s*Q+u*R+d*X+g*E,t[11]=o*Q+f*R+p*X+b*E,t[12]=n*V+a*W+c*j+m*q,t[13]=r*V+l*W+h*j+_*q,t[14]=s*V+u*W+d*j+g*q,t[15]=o*V+f*W+p*j+b*q,t}function Nd(i,e,t){return t=t||Ao(),i!==t&&(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11]),t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function Md(i,e){return e=e||Vt(),e[0]=i[12],e[1]=i[13],e[2]=i[14],e}function Pd(i,e,t){t=t||Vt();const n=e*4;return t[0]=i[n+0],t[1]=i[n+1],t[2]=i[n+2],t}function Bd(i,e,t,n){n!==i&&(n=So(i,n));const r=t*4;return n[r+0]=e[0],n[r+1]=e[1],n[r+2]=e[2],n}function Dd(i,e,t,n,r){r=r||new rt(16);const s=Math.tan(Math.PI*.5-.5*i),o=1/(t-n);return r[0]=s/e,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=(t+n)*o,r[11]=-1,r[12]=0,r[13]=0,r[14]=t*n*o*2,r[15]=0,r}function zd(i,e,t,n,r,s,o){return o=o||new rt(16),o[0]=2/(e-i),o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2/(n-t),o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=2/(r-s),o[11]=0,o[12]=(e+i)/(i-e),o[13]=(n+t)/(t-n),o[14]=(s+r)/(r-s),o[15]=1,o}function Ld(i,e,t,n,r,s,o){o=o||new rt(16);const a=e-i,l=n-t,u=r-s;return o[0]=2*r/a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*r/l,o[6]=0,o[7]=0,o[8]=(i+e)/a,o[9]=(n+t)/l,o[10]=s/u,o[11]=-1,o[12]=0,o[13]=0,o[14]=r*s/u,o[15]=0,o}let Kt,an,xt;function Ud(i,e,t,n){return n=n||new rt(16),Kt=Kt||Vt(),an=an||Vt(),xt=xt||Vt(),fr(ko(i,e,xt),xt),fr(Zr(t,xt,Kt),Kt),fr(Zr(xt,Kt,an),an),n[0]=Kt[0],n[1]=Kt[1],n[2]=Kt[2],n[3]=0,n[4]=an[0],n[5]=an[1],n[6]=an[2],n[7]=0,n[8]=xt[0],n[9]=xt[1],n[10]=xt[2],n[11]=0,n[12]=i[0],n[13]=i[1],n[14]=i[2],n[15]=1,n}function Od(i,e){return e=e||new rt(16),e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function xd(i,e,t){t=t||new rt(16);const n=e[0],r=e[1],s=e[2],o=i[0],a=i[1],l=i[2],u=i[3],f=i[1*4+0],c=i[1*4+1],h=i[1*4+2],d=i[1*4+3],p=i[2*4+0],m=i[2*4+1],_=i[2*4+2],g=i[2*4+3],b=i[3*4+0],S=i[3*4+1],y=i[3*4+2],A=i[3*4+3];return i!==t&&(t[0]=o,t[1]=a,t[2]=l,t[3]=u,t[4]=f,t[5]=c,t[6]=h,t[7]=d,t[8]=p,t[9]=m,t[10]=_,t[11]=g),t[12]=o*n+f*r+p*s+b,t[13]=a*n+c*r+m*s+S,t[14]=l*n+h*r+_*s+y,t[15]=u*n+d*r+g*s+A,t}function Gd(i,e){e=e||new rt(16);const t=Math.cos(i),n=Math.sin(i);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function jd(i,e,t){t=t||new rt(16);const n=i[4],r=i[5],s=i[6],o=i[7],a=i[8],l=i[9],u=i[10],f=i[11],c=Math.cos(e),h=Math.sin(e);return t[4]=c*n+h*a,t[5]=c*r+h*l,t[6]=c*s+h*u,t[7]=c*o+h*f,t[8]=c*a-h*n,t[9]=c*l-h*r,t[10]=c*u-h*s,t[11]=c*f-h*o,i!==t&&(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15]),t}function Hd(i,e){e=e||new rt(16);const t=Math.cos(i),n=Math.sin(i);return e[0]=t,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Vd(i,e,t){t=t||new rt(16);const n=i[0*4+0],r=i[0*4+1],s=i[0*4+2],o=i[0*4+3],a=i[2*4+0],l=i[2*4+1],u=i[2*4+2],f=i[2*4+3],c=Math.cos(e),h=Math.sin(e);return t[0]=c*n-h*a,t[1]=c*r-h*l,t[2]=c*s-h*u,t[3]=c*o-h*f,t[8]=c*a+h*n,t[9]=c*l+h*r,t[10]=c*u+h*s,t[11]=c*f+h*o,i!==t&&(t[4]=i[4],t[5]=i[5],t[6]=i[6],t[7]=i[7],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15]),t}function Wd(i,e){e=e||new rt(16);const t=Math.cos(i),n=Math.sin(i);return e[0]=t,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=t,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function qd(i,e,t){t=t||new rt(16);const n=i[0*4+0],r=i[0*4+1],s=i[0*4+2],o=i[0*4+3],a=i[1*4+0],l=i[1*4+1],u=i[1*4+2],f=i[1*4+3],c=Math.cos(e),h=Math.sin(e);return t[0]=c*n+h*a,t[1]=c*r+h*l,t[2]=c*s+h*u,t[3]=c*o+h*f,t[4]=c*a-h*n,t[5]=c*l-h*r,t[6]=c*u-h*s,t[7]=c*f-h*o,i!==t&&(t[8]=i[8],t[9]=i[9],t[10]=i[10],t[11]=i[11],t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15]),t}function Zd(i,e,t){t=t||new rt(16);let n=i[0],r=i[1],s=i[2];const o=Math.sqrt(n*n+r*r+s*s);n/=o,r/=o,s/=o;const a=n*n,l=r*r,u=s*s,f=Math.cos(e),c=Math.sin(e),h=1-f;return t[0]=a+(1-a)*f,t[1]=n*r*h+s*c,t[2]=n*s*h-r*c,t[3]=0,t[4]=n*r*h-s*c,t[5]=l+(1-l)*f,t[6]=r*s*h+n*c,t[7]=0,t[8]=n*s*h+r*c,t[9]=r*s*h-n*c,t[10]=u+(1-u)*f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Xd(i,e,t,n){n=n||new rt(16);let r=e[0],s=e[1],o=e[2];const a=Math.sqrt(r*r+s*s+o*o);r/=a,s/=a,o/=a;const l=r*r,u=s*s,f=o*o,c=Math.cos(t),h=Math.sin(t),d=1-c,p=l+(1-l)*c,m=r*s*d+o*h,_=r*o*d-s*h,g=r*s*d-o*h,b=u+(1-u)*c,S=s*o*d+r*h,y=r*o*d+s*h,A=s*o*d-r*h,I=f+(1-f)*c,C=i[0],H=i[1],G=i[2],ne=i[3],Q=i[4],R=i[5],X=i[6],E=i[7],V=i[8],W=i[9],j=i[10],q=i[11];return n[0]=p*C+m*Q+_*V,n[1]=p*H+m*R+_*W,n[2]=p*G+m*X+_*j,n[3]=p*ne+m*E+_*q,n[4]=g*C+b*Q+S*V,n[5]=g*H+b*R+S*W,n[6]=g*G+b*X+S*j,n[7]=g*ne+b*E+S*q,n[8]=y*C+A*Q+I*V,n[9]=y*H+A*R+I*W,n[10]=y*G+A*X+I*j,n[11]=y*ne+A*E+I*q,i!==n&&(n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15]),n}function Yd(i,e){return e=e||new rt(16),e[0]=i[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=i[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Kd(i,e,t){t=t||new rt(16);const n=e[0],r=e[1],s=e[2];return t[0]=n*i[0*4+0],t[1]=n*i[0*4+1],t[2]=n*i[0*4+2],t[3]=n*i[0*4+3],t[4]=r*i[1*4+0],t[5]=r*i[1*4+1],t[6]=r*i[1*4+2],t[7]=r*i[1*4+3],t[8]=s*i[2*4+0],t[9]=s*i[2*4+1],t[10]=s*i[2*4+2],t[11]=s*i[2*4+3],i!==t&&(t[12]=i[12],t[13]=i[13],t[14]=i[14],t[15]=i[15]),t}function Jd(i,e,t){t=t||Vt();const n=e[0],r=e[1],s=e[2],o=n*i[0*4+3]+r*i[1*4+3]+s*i[2*4+3]+i[3*4+3];return t[0]=(n*i[0*4+0]+r*i[1*4+0]+s*i[2*4+0]+i[3*4+0])/o,t[1]=(n*i[0*4+1]+r*i[1*4+1]+s*i[2*4+1]+i[3*4+1])/o,t[2]=(n*i[0*4+2]+r*i[1*4+2]+s*i[2*4+2]+i[3*4+2])/o,t}function Qd(i,e,t){t=t||Vt();const n=e[0],r=e[1],s=e[2];return t[0]=n*i[0*4+0]+r*i[1*4+0]+s*i[2*4+0],t[1]=n*i[0*4+1]+r*i[1*4+1]+s*i[2*4+1],t[2]=n*i[0*4+2]+r*i[1*4+2]+s*i[2*4+2],t}function ep(i,e,t){t=t||Vt();const n=Io(i),r=e[0],s=e[1],o=e[2];return t[0]=r*n[0*4+0]+s*n[0*4+1]+o*n[0*4+2],t[1]=r*n[1*4+0]+s*n[1*4+1]+o*n[1*4+2],t[2]=r*n[2*4+0]+s*n[2*4+1]+o*n[2*4+2],t}var ht=Object.freeze({__proto__:null,axisRotate:Xd,axisRotation:Zd,copy:So,create:Cd,frustum:Ld,getAxis:Pd,getTranslation:Md,identity:Ao,inverse:Io,lookAt:Ud,multiply:Fd,negate:Td,ortho:zd,perspective:Dd,rotateX:jd,rotateY:Vd,rotateZ:qd,rotationX:Gd,rotationY:Hd,rotationZ:Wd,scale:Kd,scaling:Yd,setAxis:Bd,setDefaultType:Id,setTranslation:Nd,transformDirection:Qd,transformNormal:ep,transformPoint:Jd,translate:xd,translation:Od,transpose:Rd});const fi=5120,jn=5121,ci=5122,hi=5123,mi=5124,di=5125,pi=5126,tp=32819,np=32820,rp=33635,ip=5131,sp=33640,op=35899,ap=35902,lp=36269,up=34042,To={};{const i=To;i[fi]=Int8Array,i[jn]=Uint8Array,i[ci]=Int16Array,i[hi]=Uint16Array,i[mi]=Int32Array,i[di]=Uint32Array,i[pi]=Float32Array,i[tp]=Uint16Array,i[np]=Uint16Array,i[rp]=Uint16Array,i[ip]=Uint16Array,i[sp]=Uint32Array,i[op]=Uint32Array,i[ap]=Uint32Array,i[lp]=Uint32Array,i[up]=Uint32Array}function _i(i){if(i instanceof Int8Array)return fi;if(i instanceof Uint8Array||i instanceof Uint8ClampedArray)return jn;if(i instanceof Int16Array)return ci;if(i instanceof Uint16Array)return hi;if(i instanceof Int32Array)return mi;if(i instanceof Uint32Array)return di;if(i instanceof Float32Array)return pi;throw new Error("unsupported typed array type")}function Co(i){if(i===Int8Array)return fi;if(i===Uint8Array||i===Uint8ClampedArray)return jn;if(i===Int16Array)return ci;if(i===Uint16Array)return hi;if(i===Int32Array)return mi;if(i===Uint32Array)return di;if(i===Float32Array)return pi;throw new Error("unsupported typed array type")}function Ro(i){const e=To[i];if(!e)throw new Error("unknown gl type");return e}const dr=typeof SharedArrayBuffer<"u"?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};function Fo(...i){console.error(...i)}const As=new Map;function kr(i,e){if(!i||typeof i!="object")return!1;let t=As.get(e);t||(t=new WeakMap,As.set(e,t));let n=t.get(i);if(n===void 0){const r=Object.prototype.toString.call(i);n=r.substring(8,r.length-1)===e,t.set(i,n)}return n}function fp(i,e){return typeof WebGLBuffer<"u"&&kr(e,"WebGLBuffer")}function No(i,e){return typeof WebGLRenderbuffer<"u"&&kr(e,"WebGLRenderbuffer")}function Sr(i,e){return typeof WebGLTexture<"u"&&kr(e,"WebGLTexture")}function cp(i,e){return typeof WebGLSampler<"u"&&kr(e,"WebGLSampler")}const Mo=35044,dn=34962,hp=34963,mp=34660,dp=5120,pp=5121,_p=5122,gp=5123,bp=5124,vp=5125,Po=5126,Bo={attribPrefix:""};function $p(i,e,t,n,r){i.bindBuffer(e,t),i.bufferData(e,n,r||Mo)}function Do(i,e,t,n){if(fp(i,e))return e;t=t||dn;const r=i.createBuffer();return $p(i,t,r,e,n),r}function zo(i){return i==="indices"}function wp(i){return i===Int8Array||i===Uint8Array}function yp(i){return i.length?i:i.data}const Ep=/coord|texture/i,kp=/color|colour/i;function Sp(i,e){let t;if(Ep.test(i)?t=2:kp.test(i)?t=4:t=3,e%t>0)throw new Error(`Can not guess numComponents for attribute '${i}'. Tried ${t} but ${e} values is not evenly divisible by ${t}. You should specify it.`);return t}function Ap(i,e,t){return i.numComponents||i.size||Sp(e,t||yp(i).length)}function Lo(i,e){if(dr(i))return i;if(dr(i.data))return i.data;Array.isArray(i)&&(i={data:i});let t=i.type?gi(i.type):void 0;return t||(zo(e)?t=Uint16Array:t=Float32Array),new t(i.data)}function Ip(i){return typeof i=="number"?i:i?Co(i):Po}function gi(i){return typeof i=="number"?Ro(i):i||Float32Array}function Tp(i,e){return{buffer:e.buffer,numValues:2*3*4,type:Ip(e.type),arrayType:gi(e.type)}}function Cp(i,e){const t=e.data||e,n=gi(e.type),r=t*n.BYTES_PER_ELEMENT,s=i.createBuffer();return i.bindBuffer(dn,s),i.bufferData(dn,r,e.drawType||Mo),{buffer:s,numValues:t,type:Co(n),arrayType:n}}function Rp(i,e,t){const n=Lo(e,t);return{arrayType:n.constructor,buffer:Do(i,n,void 0,e.drawType),type:_i(n),numValues:0}}function Fp(i,e){const t={};return Object.keys(e).forEach(function(n){if(!zo(n)){const r=e[n],s=r.attrib||r.name||r.attribName||Bo.attribPrefix+n;if(r.value){if(!Array.isArray(r.value)&&!dr(r.value))throw new Error("array.value is not array or typedarray");t[s]={value:r.value}}else{let o;r.buffer&&r.buffer instanceof WebGLBuffer?o=Tp:typeof r=="number"||typeof r.data=="number"?o=Cp:o=Rp;const{buffer:a,type:l,numValues:u,arrayType:f}=o(i,r,n),c=r.normalize!==void 0?r.normalize:wp(f),h=Ap(r,n,u);t[s]={buffer:a,numComponents:h,type:l,normalize:c,stride:r.stride||0,offset:r.offset||0,divisor:r.divisor===void 0?void 0:r.divisor,drawType:r.drawType}}}}),i.bindBuffer(dn,null),t}function Np(i,e){return e===dp||e===pp?1:e===_p||e===gp?2:e===bp||e===vp||e===Po?4:0}const zr=["position","positions","a_position"];function Mp(i,e){let t,n;for(n=0;n{const S=g*b.ndx,y=t.subarray(S,S+g);i.texImage2D(b.face,l,u,s,o,0,c,h,y)})}else r===en||r===tn?i.texImage3D(r,l,u,s,o,a,0,c,h,t):i.texImage2D(r,l,u,s,o,0,c,h,t);return{width:s,height:o,depth:a,type:h}}function u_(i,e,t){const n=t.target||Zt;i.bindTexture(n,e);const r=t.level||0,s=t.internalFormat||t.format||ot,o=Tn(s),a=t.format||o.format,l=t.type||o.type;if(kn(i,t),n===Wt)for(let u=0;u<6;++u)i.texImage2D(Ar+u,r,s,t.width,t.height,0,a,l,null);else n===en||n===tn?i.texImage3D(n,r,s,t.width,t.height,t.depth,0,a,l,null):i.texImage2D(n,r,s,t.width,t.height,0,a,l,null)}function yi(i,e,t){t=t||qn,e=e||nn.textureOptions;const n=i.createTexture(),r=e.target||Zt;let s=e.width||1,o=e.height||1;const a=e.internalFormat||ot;i.bindTexture(r,n),r===Wt&&(i.texParameteri(r,_r,pr),i.texParameteri(r,gr,pr));let l=e.src;if(l)if(typeof l=="function"&&(l=l(i,e)),typeof l=="string")o_(i,n,e,t);else if(En(l)||Array.isArray(l)&&(typeof l[0]=="number"||Array.isArray(l[0])||En(l[0]))){const u=Yo(i,n,l,e);s=u.width,o=u.height}else Array.isArray(l)&&(typeof l[0]=="string"||Xo(l[0]))?r===Wt?a_(i,n,e,t):l_(i,n,e,t):(vi(i,n,l,e),s=l.width,o=l.height);else u_(i,n,e);return Hn(e)&&Kr(i,n,e,s,o,a),Zo(i,n,e),n}function f_(i,e,t,n,r,s){n=n||t.width,r=r||t.height,s=s||t.depth;const o=t.target||Zt;i.bindTexture(o,e);const a=t.level||0,l=t.internalFormat||t.format||ot,u=Tn(l),f=t.format||u.format;let c;const h=t.src;if(h&&(En(h)||Array.isArray(h)&&typeof h[0]=="number")?c=t.type||Wo(i,h,u.type):c=t.type||u.type,o===Wt)for(let d=0;d<6;++d)i.texImage2D(Ar+d,a,l,n,r,0,f,c,null);else o===en||o===tn?i.texImage3D(o,a,l,n,r,s,0,f,c,null):i.texImage2D(o,a,l,n,r,0,f,c,null)}const Ei=Fo;function c_(i){return typeof document<"u"&&document.getElementById?document.getElementById(i):null}const br=33984,Tr=34962,h_=34963,m_=35713,d_=35714,p_=35632,__=35633,g_=35981,Ko=35718,b_=35721,v_=35971,$_=35382,w_=35396,y_=35398,E_=35392,k_=35395,Cr=5126,Jo=35664,Qo=35665,ea=35666,ki=5124,ta=35667,na=35668,ra=35669,ia=35670,sa=35671,oa=35672,aa=35673,la=35674,ua=35675,fa=35676,S_=35678,A_=35680,I_=35679,T_=35682,C_=35685,R_=35686,F_=35687,N_=35688,M_=35689,P_=35690,B_=36289,D_=36292,z_=36293,Si=5125,ca=36294,ha=36295,ma=36296,L_=36298,U_=36299,O_=36300,x_=36303,G_=36306,j_=36307,H_=36308,V_=36311,Rr=3553,Fr=34067,Ai=32879,Nr=35866,je={};function da(i,e){return je[e].bindPoint}function W_(i,e){return function(t){i.uniform1f(e,t)}}function q_(i,e){return function(t){i.uniform1fv(e,t)}}function Z_(i,e){return function(t){i.uniform2fv(e,t)}}function X_(i,e){return function(t){i.uniform3fv(e,t)}}function Y_(i,e){return function(t){i.uniform4fv(e,t)}}function pa(i,e){return function(t){i.uniform1i(e,t)}}function _a(i,e){return function(t){i.uniform1iv(e,t)}}function ga(i,e){return function(t){i.uniform2iv(e,t)}}function ba(i,e){return function(t){i.uniform3iv(e,t)}}function va(i,e){return function(t){i.uniform4iv(e,t)}}function K_(i,e){return function(t){i.uniform1ui(e,t)}}function J_(i,e){return function(t){i.uniform1uiv(e,t)}}function Q_(i,e){return function(t){i.uniform2uiv(e,t)}}function eg(i,e){return function(t){i.uniform3uiv(e,t)}}function tg(i,e){return function(t){i.uniform4uiv(e,t)}}function ng(i,e){return function(t){i.uniformMatrix2fv(e,!1,t)}}function rg(i,e){return function(t){i.uniformMatrix3fv(e,!1,t)}}function ig(i,e){return function(t){i.uniformMatrix4fv(e,!1,t)}}function sg(i,e){return function(t){i.uniformMatrix2x3fv(e,!1,t)}}function og(i,e){return function(t){i.uniformMatrix3x2fv(e,!1,t)}}function ag(i,e){return function(t){i.uniformMatrix2x4fv(e,!1,t)}}function lg(i,e){return function(t){i.uniformMatrix4x2fv(e,!1,t)}}function ug(i,e){return function(t){i.uniformMatrix3x4fv(e,!1,t)}}function fg(i,e){return function(t){i.uniformMatrix4x3fv(e,!1,t)}}function bt(i,e,t,n){const r=da(i,e);return Wn(i)?function(s){let o,a;!s||Sr(i,s)?(o=s,a=null):(o=s.texture,a=s.sampler),i.uniform1i(n,t),i.activeTexture(br+t),i.bindTexture(r,o),i.bindSampler(t,a)}:function(s){i.uniform1i(n,t),i.activeTexture(br+t),i.bindTexture(r,s)}}function vt(i,e,t,n,r){const s=da(i,e),o=new Int32Array(r);for(let a=0;a{const a=parseInt(s[1]),l=n[o+1],u=l?l.index:e.length,f=e.substring(s.index,u);return[a-1,f]}));return i.split(` +`).map((s,o)=>{const a=r.get(o);return`${o+1+t}: ${s}${a?` + +^^^ ${a}`:""}`}).join(` +`)}const zs=/^[ \t]*\n/;function $a(i){let e=0;return zs.test(i)&&(e=1,i=i.replace(zs,"")),{lineOffset:e,shaderSource:i}}function mg(i,e,t,n){if(n=n||Ei,!i.getShaderParameter(t,m_)){const s=i.getShaderInfoLog(t),{lineOffset:o,shaderSource:a}=$a(i.getShaderSource(t)),l=`${hg(a,s,o)} +Error compiling ${Uo(i,e)}: ${s}`;return n(l),l}return""}function wa(i,e,t){let n,r,s;if(typeof e=="function"&&(t=e,e=void 0),typeof i=="function")t=i,i=void 0;else if(i&&!Array.isArray(i)){const u=i;t=u.errorCallback,i=u.attribLocations,n=u.transformFeedbackVaryings,r=u.transformFeedbackMode,s=u.callback}const o=t||Ei,a=[],l={errorCallback(u,...f){a.push(u),o(u,...f)},transformFeedbackVaryings:n,transformFeedbackMode:r,callback:s,errors:a};{let u={};Array.isArray(i)?i.forEach(function(f,c){u[f]=e?e[c]:c}):u=i||{},l.attribLocations=u}return l}const dg=["VERTEX_SHADER","FRAGMENT_SHADER"];function pg(i,e){if(e.indexOf("frag")>=0)return p_;if(e.indexOf("vert")>=0)return __}const _g=(i=0)=>new Promise(e=>setTimeout(e,i));function gg(i,e,t){const n=i.createProgram(),{attribLocations:r,transformFeedbackVaryings:s,transformFeedbackMode:o}=wa(t);for(let a=0;ai.bindAttribLocation(n,l,a));{let a=s;a&&(a.attribs&&(a=a.attribs),Array.isArray(a)||(a=Object.keys(a)),i.transformFeedbackVaryings(n,a,o||g_))}return i.linkProgram(n),n}async function bg(i,e){const t=i.getExtension("KHR_parallel_shader_compile"),n=t?(s,o)=>s.getProgramParameter(o,t.COMPLETION_STATUS_KHR):()=>!0;let r=0;do await _g(r),r=1e3/60;while(!n(i,e))}async function vg(i,e){for(const t of Object.values(e))await bg(i,t)}function $g(i,e,t){if(t=t||Ei,!i.getProgramParameter(e,d_)){const r=i.getProgramInfoLog(e);t(`Error in program linking: ${r}`);const o=i.getAttachedShaders(e).map(a=>mg(i,i.getShaderParameter(a,i.SHADER_TYPE),a,t));return`${r} +${o.filter(a=>a).join(` +`)}`}}function ya(i){const e=i.name;return e.startsWith("gl_")||e.startsWith("webgl_")}const wg=/(\.|\[|]|\w+)/g,yg=i=>i>="0"&&i<="9";function Eg(i,e,t,n){const r=i.split(wg).filter(a=>a!=="");let s=0,o="";for(;;){const a=r[s++];o+=a;const l=yg(a[0]),u=l?parseInt(a):a;if(l&&(o+=r[s++]),s===r.length){t[u]=e;break}else{const c=r[s++],h=c==="[",d=t[u]||(h?[]:{});t[u]=d,t=d,n[o]=n[o]||function(p){return function(m){Ea(p,m)}}(d),o+=c}}}function kg(i,e){let t=0;function n(a,l,u){const f=l.name.endsWith("[0]"),c=l.type,h=je[c];if(!h)throw new Error(`unknown type: 0x${c.toString(16)}`);let d;if(h.bindPoint){const p=t;t+=l.size,f?d=h.arraySetter(i,c,p,u,l.size):d=h.setter(i,c,p,u,l.size)}else h.arraySetter&&f?d=h.arraySetter(i,u):d=h.setter(i,u);return d.location=u,d}const r={},s={},o=i.getProgramParameter(e,Ko);for(let a=0;a{const l={...t},u=Array.isArray(a)?a:a.shaders;return Array.isArray(a)||Object.assign(l,a),u.forEach(n.add,n),[o,gg(i,u,l)]}));if(t.callback){vg(i,r).then(()=>{const o=Ls(i,r,e,n,t);t.callback(o,o?void 0:r)});return}return Ls(i,r,e,n,t)?void 0:r}function Fg(i,e,t){t=wa(t);function n(o,a){return Object.fromEntries(Object.entries(a).map(([l,u])=>[l,Cg(o,u)]))}const r=t.callback;r&&(t.callback=(o,a)=>{r(o,o?void 0:n(i,a))});const s=Rg(i,e,t);if(!(r||!s))return n(i,s)}const Ng=36160,cn=36161,Mg=3553,Pg=5121,Bg=6402,Dg=6408,zg=33190,Lg=36012,Ug=35056,Og=36013,xg=32854,Gg=32855,jg=36194,ka=33189,Sa=6401,Aa=36168,Ti=34041,ei=36064,Br=36096,Ia=36128,Ci=33306,ti=33071,ni=9729,Ta=[{format:Dg,type:Pg,min:ni,wrap:ti},{format:Ti}],Dt={};Dt[Ti]=Ci;Dt[Sa]=Ia;Dt[Aa]=Ia;Dt[Bg]=Br;Dt[ka]=Br;Dt[zg]=Br;Dt[Lg]=Br;Dt[Ug]=Ci;Dt[Og]=Ci;function Hg(i,e){return Dt[i]||Dt[e]}const sn={};sn[xg]=!0;sn[Gg]=!0;sn[jg]=!0;sn[Ti]=!0;sn[ka]=!0;sn[Sa]=!0;sn[Aa]=!0;function Vg(i){return sn[i]}const Wg=32;function qg(i){return i>=ei&&i1?i.renderbufferStorageMultisample(cn,c,h,t,n):i.renderbufferStorage(cn,h,t,n);else{const p=Object.assign({},l);p.width=t,p.height=n,p.auto===void 0&&(p.auto=!1,p.min=p.min||p.minMag||ni,p.mag=p.mag||p.minMag||ni,p.wrapS=p.wrapS||p.wrap||ti,p.wrapT=p.wrapT||p.wrap||ti),f=yi(i,p)}if(No(i,f))i.framebufferRenderbuffer(r,d,cn,f);else if(Sr(i,f))l.layer!==void 0?i.framebufferTextureLayer(r,d,f,l.level||0,l.layer):i.framebufferTexture2D(r,d,l.target||Mg,f,l.level||0);else throw new Error("unknown attachment type");a.attachments.push(f)}),i.drawBuffers&&i.drawBuffers(o),a}function Xg(i,e,t,n,r){n=n||i.drawingBufferWidth,r=r||i.drawingBufferHeight,e.width=n,e.height=r,t=t||Ta,t.forEach(function(s,o){const a=e.attachments[o],l=s.format,u=s.samples;if(u!==void 0||No(i,a))i.bindRenderbuffer(cn,a),u>1?i.renderbufferStorageMultisample(cn,u,l,n,r):i.renderbufferStorage(cn,l,n,r);else if(Sr(i,a))f_(i,a,s,n,r);else throw new Error("unknown attachment type")})}class Yg{constructor(e,t,n,r){this.id=e,this.original=t,this.texture=n,this.meta=r}get width(){return this.original.width}get height(){return this.original.height}}class Kg{constructor(e,t=new yo("textures")){Ce(this,"textures",new Map);this.gl=e,this.idGenerator=t}addImage(e,t){let n=t==null?void 0:t.id;if(n&&this.textures.has(n))throw new Error(`Texture with id ${n} already exists`);if(!n){for(let o=0;othis.addImage(n,t))}delete(e){const t=this.textures.get(e);if(!t)throw new Error(`Texture with id ${e} already deleted`);return this.gl.deleteTexture(t.texture),this.textures.delete(e),t.original}get(e){const t=this.textures.get(e);if(!t)throw new Error(`Texture with id ${e} not found`);return t}has(e){return this.textures.has(e)}clear(){this.textures.forEach(e=>this.gl.deleteTexture(e.texture)),this.textures.clear()}}function Jg(i){let e;return{c(){e=oe("Что-то пошло не так...")},l(t){e=ae(t,"Что-то пошло не так...")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function Qg(i){let e;return{c(){e=oe("Свободный")},l(t){e=ae(t,"Свободный")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function e2(i){let e;return{c(){e=oe("Фиксированный")},l(t){e=ae(t,"Фиксированный")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function t2(i){let e;function t(s,o){return s[15]=="global"?e2:s[15]=="rectangle"?Qg:Jg}let n=t(i),r=n(i);return{c(){r.c(),e=Ge()},l(s){r.l(s),e=Ge()},m(s,o){r.m(s,o),x(s,e,o)},p(s,o){n!==(n=t(s))&&(r.d(1),r=n(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){r.d(s),s&&k(e)}}}function n2(i){let e,t;return e=new qt({props:{$$slots:{default:[a2]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&65537&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function r2(i){let e,t;return e=new qt({props:{$$slots:{default:[h2]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&65537&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function i2(i){let e,t,n;return t=new Ke({props:{min:0,max:100,step:.5,withRange:!0,value:i[0].value.maxWidth*100}}),t.$on("input",i[12]),{c(){e=oe("Максимальная ширина (%): "),F(t.$$.fragment)},l(r){e=ae(r,"Максимальная ширина (%): "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=r[0].value.maxWidth*100),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function s2(i){let e,t,n;return t=new Ke({props:{min:0,max:100,step:.5,withRange:!0,value:i[0].value.maxHeight*100}}),t.$on("input",i[13]),{c(){e=oe("Максимальная высота (%): "),F(t.$$.fragment)},l(r){e=ae(r,"Максимальная высота (%): "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=r[0].value.maxHeight*100),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function o2(i){let e,t,n;return t=new Ke({props:{min:0,max:100,step:.5,withRange:!0,value:i[0].value.minHeight*100}}),t.$on("input",i[14]),{c(){e=oe("Минимальная высота (%): "),F(t.$$.fragment)},l(r){e=ae(r,"Минимальная высота (%): "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=r[0].value.minHeight*100),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function a2(i){let e,t,n,r,s,o;return e=new Ze({props:{$$slots:{default:[i2]},$$scope:{ctx:i}}}),n=new Ze({props:{$$slots:{default:[s2]},$$scope:{ctx:i}}}),s=new Ze({props:{$$slots:{default:[o2]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment),r=re(),F(s.$$.fragment)},l(a){N(e.$$.fragment,a),t=ie(a),N(n.$$.fragment,a),r=ie(a),N(s.$$.fragment,a)},m(a,l){M(e,a,l),x(a,t,l),M(n,a,l),x(a,r,l),M(s,a,l),o=!0},p(a,l){const u={};l&65537&&(u.$$scope={dirty:l,ctx:a}),e.$set(u);const f={};l&65537&&(f.$$scope={dirty:l,ctx:a}),n.$set(f);const c={};l&65537&&(c.$$scope={dirty:l,ctx:a}),s.$set(c)},i(a){o||(v(e.$$.fragment,a),v(n.$$.fragment,a),v(s.$$.fragment,a),o=!0)},o(a){w(e.$$.fragment,a),w(n.$$.fragment,a),w(s.$$.fragment,a),o=!1},d(a){P(e,a),a&&k(t),P(n,a),a&&k(r),P(s,a)}}}function l2(i){let e,t,n,r;function s(a){i[8](a)}let o={};return i[0].value.position!==void 0&&(o.value=i[0].value.position),t=new In({props:o}),ge.push(()=>be(t,"value",s)),{c(){e=oe("Позиция "),F(t.$$.fragment)},l(a){e=ae(a,"Позиция "),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].value.position,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function u2(i){let e,t,n,r;function s(a){i[9](a)}let o={};return i[0].value.width!==void 0&&(o.value=i[0].value.width),t=new Ke({props:o}),ge.push(()=>be(t,"value",s)),{c(){e=oe("Ширина "),F(t.$$.fragment)},l(a){e=ae(a,"Ширина "),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].value.width,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function f2(i){let e,t,n,r;function s(a){i[10](a)}let o={};return i[0].value.height!==void 0&&(o.value=i[0].value.height),t=new Ke({props:o}),ge.push(()=>be(t,"value",s)),{c(){e=oe("Высота "),F(t.$$.fragment)},l(a){e=ae(a,"Высота "),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].value.height,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function c2(i){let e,t,n;return t=new Ke({props:{withRange:!0,rangeMin:-359,rangeMax:359,step:1,value:Math.round(i[0].value.rotation/Math.PI*180)}}),t.$on("input",i[11]),{c(){e=oe("Поворот "),F(t.$$.fragment)},l(r){e=ae(r,"Поворот "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=Math.round(r[0].value.rotation/Math.PI*180)),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function h2(i){let e,t,n,r,s,o,a,l;return e=new Ze({props:{$$slots:{default:[l2]},$$scope:{ctx:i}}}),n=new Ze({props:{$$slots:{default:[u2]},$$scope:{ctx:i}}}),s=new Ze({props:{$$slots:{default:[f2]},$$scope:{ctx:i}}}),a=new Ze({props:{$$slots:{default:[c2]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment),r=re(),F(s.$$.fragment),o=re(),F(a.$$.fragment)},l(u){N(e.$$.fragment,u),t=ie(u),N(n.$$.fragment,u),r=ie(u),N(s.$$.fragment,u),o=ie(u),N(a.$$.fragment,u)},m(u,f){M(e,u,f),x(u,t,f),M(n,u,f),x(u,r,f),M(s,u,f),x(u,o,f),M(a,u,f),l=!0},p(u,f){const c={};f&65537&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const h={};f&65537&&(h.$$scope={dirty:f,ctx:u}),n.$set(h);const d={};f&65537&&(d.$$scope={dirty:f,ctx:u}),s.$set(d);const p={};f&65537&&(p.$$scope={dirty:f,ctx:u}),a.$set(p)},i(u){l||(v(e.$$.fragment,u),v(n.$$.fragment,u),v(s.$$.fragment,u),v(a.$$.fragment,u),l=!0)},o(u){w(e.$$.fragment,u),w(n.$$.fragment,u),w(s.$$.fragment,u),w(a.$$.fragment,u),l=!1},d(u){P(e,u),u&&k(t),P(n,u),u&&k(r),P(s,u),u&&k(o),P(a,u)}}}function m2(i){let e,t,n,r,s,o;t=new Et({props:{value:i[0].type,items:i[2],$$slots:{default:[t2,({item:f})=>({15:f}),({item:f})=>f?32768:0]},$$scope:{ctx:i}}}),t.$on("change",i[7]);const a=[r2,n2],l=[];function u(f,c){return f[0].type=="rectangle"?0:f[0].type=="global"?1:-1}return~(r=u(i))&&(s=l[r]=a[r](i)),{c(){e=K("article"),F(t.$$.fragment),n=re(),s&&s.c()},l(f){e=J(f,"ARTICLE",{});var c=te(e);N(t.$$.fragment,c),n=ie(c),s&&s.l(c),c.forEach(k)},m(f,c){x(f,e,c),M(t,e,null),O(e,n),~r&&l[r].m(e,null),o=!0},p(f,[c]){const h={};c&1&&(h.value=f[0].type),c&98304&&(h.$$scope={dirty:c,ctx:f}),t.$set(h);let d=r;r=u(f),r===d?~r&&l[r].p(f,c):(s&&(Oe(),w(l[d],1,1,()=>{l[d]=null}),xe()),~r?(s=l[r],s?s.p(f,c):(s=l[r]=a[r](f),s.c()),v(s,1),s.m(e,null)):s=null)},i(f){o||(v(t.$$.fragment,f),v(s),o=!0)},o(f){w(t.$$.fragment,f),w(s),o=!1},d(f){f&&k(e),P(t),~r&&l[r].d()}}}function d2(i,e,t){let{container:n}=e,{content:r}=e,{textureManager:s}=e,{frameWidth:o}=e,{frameHeight:a}=e;function l(b){switch(r.type){case"text":switch(b){case"global":t(0,n.value={maxWidth:.9,maxHeight:.4,minHeight:.1},n),t(0,n.type="global",n);return;case"rectangle":t(0,n.value={width:o/2,height:a/2,position:{x:o/2,y:a/2},rotation:0},n),t(0,n.type="rectangle",n);return}break;case"image":{const S=r.value.crop,y=s.get(r.value.id);let A=S.width*y.width,I=S.height*y.height;const C=A/I;switch(C>1&&A>o&&(A=o,I=A/C),C<1&&I>a&&(I=a,A=I*C),b){case"global":t(0,n.value={maxWidth:1,maxHeight:1,minHeight:0},n),t(0,n.type="global",n);return;case"rectangle":t(0,n.value={width:A,height:I,position:{x:A/2,y:I/2},rotation:0},n),t(0,n.type="rectangle",n);return}}break}}const u=["global","rectangle"],f=b=>l(b.detail.value);function c(b){i.$$.not_equal(n.value.position,b)&&(n.value.position=b,t(0,n))}function h(b){i.$$.not_equal(n.value.width,b)&&(n.value.width=b,t(0,n))}function d(b){i.$$.not_equal(n.value.height,b)&&(n.value.height=b,t(0,n))}const p=b=>{n.type==="rectangle"&&t(0,n.value.rotation=b.detail%360/180*Math.PI,n)},m=b=>{n.type==="global"&&t(0,n.value.maxWidth=b.detail/100,n)},_=b=>{n.type==="global"&&t(0,n.value.maxHeight=b.detail/100,n)},g=b=>{n.type==="global"&&t(0,n.value.minHeight=b.detail/100,n)};return i.$$set=b=>{"container"in b&&t(0,n=b.container),"content"in b&&t(3,r=b.content),"textureManager"in b&&t(4,s=b.textureManager),"frameWidth"in b&&t(5,o=b.frameWidth),"frameHeight"in b&&t(6,a=b.frameHeight)},[n,l,u,r,s,o,a,f,c,h,d,p,m,_,g]}class p2 extends ye{constructor(e){super(),Ee(this,e,d2,m2,$e,{container:0,content:3,textureManager:4,frameWidth:5,frameHeight:6})}}function _2(i){let e=i[6]+"",t;return{c(){t=oe(e)},l(n){t=ae(n,e)},m(n,r){x(n,t,r)},p(n,r){r&64&&e!==(e=n[6]+"")&&tt(t,e)},i:Be,o:Be,d(n){n&&k(t)}}}function g2(i){let e,t;return e=new ac({props:{size:i[2]}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r&4&&(s.size=n[2]),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function b2(i){let e,t,n;return t=new ru({props:{size:i[2]}}),{c(){e=K("div"),F(t.$$.fragment),this.h()},l(r){e=J(r,"DIV",{title:!0});var s=te(e);N(t.$$.fragment,s),s.forEach(k),this.h()},h(){D(e,"title","Свободный блок со сбросом размеров")},m(r,s){x(r,e,s),M(t,e,null),n=!0},p(r,s){const o={};s&4&&(o.size=r[2]),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t)}}}function v2(i){let e,t,n;return t=new nc({props:{size:i[2]}}),{c(){e=K("div"),F(t.$$.fragment),this.h()},l(r){e=J(r,"DIV",{title:!0});var s=te(e);N(t.$$.fragment,s),s.forEach(k),this.h()},h(){D(e,"title","Свободный блок")},m(r,s){x(r,e,s),M(t,e,null),n=!0},p(r,s){const o={};s&4&&(o.size=r[2]),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t)}}}function $2(i){let e,t,n;return t=new ql({props:{size:i[2]}}),{c(){e=K("div"),F(t.$$.fragment),this.h()},l(r){e=J(r,"DIV",{title:!0});var s=te(e);N(t.$$.fragment,s),s.forEach(k),this.h()},h(){D(e,"title","Снизу")},m(r,s){x(r,e,s),M(t,e,null),n=!0},p(r,s){const o={};s&4&&(o.size=r[2]),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t)}}}function w2(i){let e,t,n;return t=new Jl({props:{size:i[2]}}),{c(){e=K("div"),F(t.$$.fragment),this.h()},l(r){e=J(r,"DIV",{title:!0});var s=te(e);N(t.$$.fragment,s),s.forEach(k),this.h()},h(){D(e,"title","Сверху")},m(r,s){x(r,e,s),M(t,e,null),n=!0},p(r,s){const o={};s&4&&(o.size=r[2]),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t)}}}function y2(i){let e,t,n,r;const s=[w2,$2,v2,b2,g2,_2],o=[];function a(l,u){return l[6]=="Top"?0:l[6]=="Bottom"?1:l[6]=="Free"?2:l[6]=="Reset"?3:l[6]=="Custom"?4:5}return e=a(i),t=o[e]=s[e](i),{c(){t.c(),n=Ge()},l(l){t.l(l),n=Ge()},m(l,u){o[e].m(l,u),x(l,n,u),r=!0},p(l,u){let f=e;e=a(l),e===f?o[e].p(l,u):(Oe(),w(o[f],1,1,()=>{o[f]=null}),xe(),t=o[e],t?t.p(l,u):(t=o[e]=s[e](l),t.c()),v(t,1),t.m(n.parentNode,n))},i(l){r||(v(t),r=!0)},o(l){w(t),r=!1},d(l){o[e].d(l),l&&k(n)}}}function E2(i){let e,t;return e=new Et({props:{css:{height:`${i[2]+16}px`,width:"100%",main:"flex:1;"},items:["Top","Bottom","Free","Reset","Custom"],placeholder:"Custom",value:i[1].container.type=="rectangle"&&i[0].baseline=="middle"?"Reset":i[1].container.type=="rectangle"?"Free":i[1].container.type=="global"&&i[0].baseline=="top"?"Top":i[1].container.type=="global"&&i[0].baseline=="bottom"?"Bottom":"Custom",$$slots:{default:[y2,({item:n})=>({6:n}),({item:n})=>n?64:0]},$$scope:{ctx:i}}}),e.$on("change",i[3]),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&4&&(s.css={height:`${n[2]+16}px`,width:"100%",main:"flex:1;"}),r&3&&(s.value=n[1].container.type=="rectangle"&&n[0].baseline=="middle"?"Reset":n[1].container.type=="rectangle"?"Free":n[1].container.type=="global"&&n[0].baseline=="top"?"Top":n[1].container.type=="global"&&n[0].baseline=="bottom"?"Bottom":"Custom"),r&196&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function k2(i,e,t){let{style:n}=e,{block:r}=e,{frame:s}=e,{iconSize:o=16}=e,{frameDrawer:a}=e;function l(u){switch(u.detail.value){case"Top":{r.container.type!=="global"&&t(1,r.container.value={maxWidth:.9,maxHeight:.4,minHeight:.1},r),t(1,r.container.type="global",r),t(0,n.baseline="top",n);break}case"Bottom":{r.container.type!=="global"&&t(1,r.container.value={maxWidth:.9,maxHeight:.4,minHeight:.1},r),t(1,r.container.type="global",r),t(0,n.baseline="bottom",n);break}case"Free":{t(1,r.container.value=a.measureBlock(s,r),r),t(1,r.container.type="rectangle",r);break}case"Reset":{t(1,r.container.value={width:s.width/2,height:s.height/2,position:{x:s.width/2,y:s.height/2},rotation:0},r),t(1,r.container.type="rectangle",r),t(0,n.baseline="middle",n);break}}}return i.$$set=u=>{"style"in u&&t(0,n=u.style),"block"in u&&t(1,r=u.block),"frame"in u&&t(4,s=u.frame),"iconSize"in u&&t(2,o=u.iconSize),"frameDrawer"in u&&t(5,a=u.frameDrawer)},[n,r,o,l,s,a]}class S2 extends ye{constructor(e){super(),Ee(this,e,k2,E2,$e,{style:0,block:1,frame:4,iconSize:2,frameDrawer:5})}}function A2(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b,S,y,A;return{c(){e=K("p"),t=oe(`Мемейкер – редактор мемов прямо в браузере. В первую очередь он разрабатывался как простое + средство наложения текста с обводкой на картинку. С его помощью можно быстро создать типичный + мем с импактом и обводкой, обыграть постиронию лобстером с тенью или набросать + многокартиночный мем, не мучаясь со слоями или кучей разных файлов в графическом редакторе.`),n=re(),r=K("p"),s=oe("Стабильная версия доступна по адресу "),o=K("a"),a=oe("https://robolabgs2.github.io/memaker/"),l=oe(` + Самая же свежая версия доступна здесь: + `),u=K("a"),f=oe("https://robolabgs2.github.io/memaker-prerelease/"),c=oe(`. Нулевая версия редактора увидела свет 24 августа 2022 года, с тех пор редактор + разрабатывается одним человеком в свободное время. Пожаловаться на баги или запросить фичу + можно в обсуждениях + `),h=K("a"),d=oe("в группе ВК"),p=oe(` + или через issue + `),m=K("a"),_=oe("на гитхабе"),g=oe("."),b=re(),S=K("p"),y=oe("Версия: "),A=oe(i[0]),this.h()},l(I){e=J(I,"P",{class:!0});var C=te(e);t=ae(C,`Мемейкер – редактор мемов прямо в браузере. В первую очередь он разрабатывался как простое + средство наложения текста с обводкой на картинку. С его помощью можно быстро создать типичный + мем с импактом и обводкой, обыграть постиронию лобстером с тенью или набросать + многокартиночный мем, не мучаясь со слоями или кучей разных файлов в графическом редакторе.`),C.forEach(k),n=ie(I),r=J(I,"P",{class:!0});var H=te(r);s=ae(H,"Стабильная версия доступна по адресу "),o=J(H,"A",{href:!0,target:!0,rel:!0,title:!0,class:!0});var G=te(o);a=ae(G,"https://robolabgs2.github.io/memaker/"),G.forEach(k),l=ae(H,` + Самая же свежая версия доступна здесь: + `),u=J(H,"A",{href:!0,target:!0,rel:!0,title:!0,class:!0});var ne=te(u);f=ae(ne,"https://robolabgs2.github.io/memaker-prerelease/"),ne.forEach(k),c=ae(H,`. Нулевая версия редактора увидела свет 24 августа 2022 года, с тех пор редактор + разрабатывается одним человеком в свободное время. Пожаловаться на баги или запросить фичу + можно в обсуждениях + `),h=J(H,"A",{target:!0,rel:!0,title:!0,href:!0,class:!0});var Q=te(h);d=ae(Q,"в группе ВК"),Q.forEach(k),p=ae(H,` + или через issue + `),m=J(H,"A",{target:!0,rel:!0,title:!0,href:!0,class:!0});var R=te(m);_=ae(R,"на гитхабе"),R.forEach(k),g=ae(H,"."),H.forEach(k),b=ie(I),S=J(I,"P",{class:!0});var X=te(S);y=ae(X,"Версия: "),A=ae(X,i[0]),X.forEach(k),this.h()},h(){D(e,"class","svelte-m4jmhf"),D(o,"href","https://robolabgs2.github.io/memaker/"),D(o,"target","_blank"),D(o,"rel","noreferrer"),D(o,"title","Стабильная версия"),D(o,"class","svelte-m4jmhf"),D(u,"href","https://robolabgs2.github.io/memaker-prerelease/"),D(u,"target","_blank"),D(u,"rel","noreferrer"),D(u,"title","Последняя версия"),D(u,"class","svelte-m4jmhf"),D(h,"target","_blank"),D(h,"rel","noreferrer"),D(h,"title","Группа ВК"),D(h,"href","https://vk.com/memaker_app"),D(h,"class","svelte-m4jmhf"),D(m,"target","_blank"),D(m,"rel","noreferrer"),D(m,"title","GitHub репозиторий"),D(m,"href","https://github.com/RobolabGs2/memaker"),D(m,"class","svelte-m4jmhf"),D(r,"class","svelte-m4jmhf"),D(S,"class","svelte-m4jmhf")},m(I,C){x(I,e,C),O(e,t),x(I,n,C),x(I,r,C),O(r,s),O(r,o),O(o,a),O(r,l),O(r,u),O(u,f),O(r,c),O(r,h),O(h,d),O(r,p),O(r,m),O(m,_),O(r,g),x(I,b,C),x(I,S,C),O(S,y),O(S,A)},p(I,C){C&1&&tt(A,I[0])},d(I){I&&k(e),I&&k(n),I&&k(r),I&&k(b),I&&k(S)}}}function I2(i){let e;return{c(){e=oe("О проекте")},l(t){e=ae(t,"О проекте")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function T2(i){let e,t,n,r,s;return{c(){e=K("p"),t=oe("Скоро changelog будет доступен здесь, но пока его можно посмотреть на "),n=K("a"),r=oe("GitHub"),s=oe("."),this.h()},l(o){e=J(o,"P",{class:!0});var a=te(e);t=ae(a,"Скоро changelog будет доступен здесь, но пока его можно посмотреть на "),n=J(a,"A",{target:!0,rel:!0,title:!0,href:!0,class:!0});var l=te(n);r=ae(l,"GitHub"),l.forEach(k),s=ae(a,"."),a.forEach(k),this.h()},h(){D(n,"target","_blank"),D(n,"rel","noreferrer"),D(n,"title","Changelog"),D(n,"href","https://github.com/RobolabGs2/memaker/blob/main/CHANGELOG.md"),D(n,"class","svelte-m4jmhf"),D(e,"class","svelte-m4jmhf")},m(o,a){x(o,e,a),O(e,t),O(e,n),O(n,r),O(e,s)},p:Be,d(o){o&&k(e)}}}function C2(i){let e;return{c(){e=oe("История версий")},l(t){e=ae(t,"История версий")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function R2(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b,S,y,A,I,C,H,G,ne,Q,R,X;function E(q){i[4](q)}let V={$$slots:{title:[I2],default:[A2]},$$scope:{ctx:i}};i[1]!==void 0&&(V.open=i[1]),t=new mn({props:V}),ge.push(()=>be(t,"open",E));function W(q){i[5](q)}let j={$$slots:{title:[C2],default:[T2]},$$scope:{ctx:i}};return i[2]!==void 0&&(j.open=i[2]),s=new mn({props:j}),ge.push(()=>be(s,"open",W)),p=new qu({props:{size:Bn}}),g=new Ju({props:{size:Bn}}),y=new rf({props:{size:Bn}}),C=new lu({props:{size:Bn}}),ne=new bu({props:{size:Bn}}),{c(){e=K("article"),F(t.$$.fragment),r=re(),F(s.$$.fragment),a=re(),l=K("header"),u=oe("Memaker "),f=oe(i[0]),c=re(),h=K("section"),d=K("div"),F(p.$$.fragment),m=re(),_=K("div"),F(g.$$.fragment),b=re(),S=K("div"),F(y.$$.fragment),A=re(),I=K("a"),F(C.$$.fragment),H=re(),G=K("a"),F(ne.$$.fragment),this.h()},l(q){e=J(q,"ARTICLE",{class:!0});var ee=te(e);N(t.$$.fragment,ee),r=ie(ee),N(s.$$.fragment,ee),a=ie(ee),l=J(ee,"HEADER",{class:!0});var we=te(l);u=ae(we,"Memaker "),f=ae(we,i[0]),we.forEach(k),c=ie(ee),h=J(ee,"SECTION",{class:!0});var L=te(h);d=J(L,"DIV",{title:!0,class:!0});var Z=te(d);N(p.$$.fragment,Z),Z.forEach(k),m=ie(L),_=J(L,"DIV",{title:!0,class:!0});var Se=te(_);N(g.$$.fragment,Se),Se.forEach(k),b=ie(L),S=J(L,"DIV",{title:!0,class:!0});var me=te(S);N(y.$$.fragment,me),me.forEach(k),A=ie(L),I=J(L,"A",{target:!0,rel:!0,title:!0,href:!0,class:!0});var _e=te(I);N(C.$$.fragment,_e),_e.forEach(k),H=ie(L),G=J(L,"A",{target:!0,rel:!0,title:!0,href:!0,class:!0});var ce=te(G);N(ne.$$.fragment,ce),ce.forEach(k),L.forEach(k),ee.forEach(k),this.h()},h(){D(l,"class","svelte-m4jmhf"),D(d,"title","Открыть пример"),D(d,"class","svelte-m4jmhf"),D(_,"title","История версий приложения"),D(_,"class","svelte-m4jmhf"),D(S,"title","О проекте"),D(S,"class","svelte-m4jmhf"),D(I,"target","_blank"),D(I,"rel","noreferrer"),D(I,"title","GitHub репозиторий"),D(I,"href","https://github.com/RobolabGs2/memaker"),D(I,"class","svelte-m4jmhf"),D(G,"target","_blank"),D(G,"rel","noreferrer"),D(G,"title","Группа ВК"),D(G,"href","https://vk.com/memaker_app"),D(G,"class","svelte-m4jmhf"),D(h,"class","svelte-m4jmhf"),D(e,"class","svelte-m4jmhf")},m(q,ee){x(q,e,ee),M(t,e,null),O(e,r),M(s,e,null),O(e,a),O(e,l),O(l,u),O(l,f),O(e,c),O(e,h),O(h,d),M(p,d,null),O(h,m),O(h,_),M(g,_,null),O(h,b),O(h,S),M(y,S,null),O(h,A),O(h,I),M(C,I,null),O(h,H),O(h,G),M(ne,G,null),Q=!0,R||(X=[Re(d,"click",i[6]),Re(_,"click",i[7]),Re(S,"click",i[8])],R=!0)},p(q,[ee]){const we={};ee&513&&(we.$$scope={dirty:ee,ctx:q}),!n&&ee&2&&(n=!0,we.open=q[1],ve(()=>n=!1)),t.$set(we);const L={};ee&512&&(L.$$scope={dirty:ee,ctx:q}),!o&&ee&4&&(o=!0,L.open=q[2],ve(()=>o=!1)),s.$set(L),(!Q||ee&1)&&tt(f,q[0])},i(q){Q||(v(t.$$.fragment,q),v(s.$$.fragment,q),v(p.$$.fragment,q),v(g.$$.fragment,q),v(y.$$.fragment,q),v(C.$$.fragment,q),v(ne.$$.fragment,q),Q=!0)},o(q){w(t.$$.fragment,q),w(s.$$.fragment,q),w(p.$$.fragment,q),w(g.$$.fragment,q),w(y.$$.fragment,q),w(C.$$.fragment,q),w(ne.$$.fragment,q),Q=!1},d(q){q&&k(e),P(t),P(s),P(p),P(g),P(y),P(C),P(ne),R=!1,gt(X)}}}let Bn=24;function F2(i,e,t){let{version:n}=e;const r=St();let s=!1,o=!1;function a(h){s=h,t(1,s)}function l(h){o=h,t(2,o)}const u=()=>r("openExample"),f=()=>t(2,o=!0),c=()=>t(1,s=!0);return i.$$set=h=>{"version"in h&&t(0,n=h.version)},[n,s,o,r,a,l,u,f,c]}class N2 extends ye{constructor(e){super(),Ee(this,e,F2,R2,$e,{version:0})}}var Ri=(i=>(i[i.RADIAN=0]="RADIAN",i[i.DEGREE=1]="DEGREE",i))(Ri||{}),kt=(i=>(i[i.NUMBER=0]="NUMBER",i[i.RANGE=1]="RANGE",i))(kt||{});function Ca(i,e,t){if(i==="point"){const n=e,{x:r,y:s}=n.value;switch(n.type){case"absolute":return{x:r,y:s};case"frame":return{x:Math.round(t.frame.width*r),y:Math.round(t.frame.height*s)};default:throw new Error(`Unexpected type of default point for uniform input: ${n.type}`)}}return structuredClone(e)}function Us(i){let e,t;return{c(){e=K("div"),this.h()},l(n){e=J(n,"DIV",{style:!0,class:!0}),te(e).forEach(k),this.h()},h(){D(e,"style",t=`width:10px;height:10px;background-color:${i[1].input.color};`),D(e,"class","svelte-1712msg")},m(n,r){x(n,e,r)},p(n,r){r&2&&t!==(t=`width:10px;height:10px;background-color:${n[1].input.color};`)&&D(e,"style",t)},d(n){n&&k(e)}}}function M2(i){let e,t,n;function r(o){i[8](o)}let s={};return i[0][i[2]]!==void 0&&(s.value=i[0][i[2]]),e=new In({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};!t&&a&5&&(t=!0,l.value=o[0][o[2]],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function P2(i){let e,t,n;function r(o){i[7](o)}let s={};return i[0][i[2]]!==void 0&&(s.value=i[0][i[2]]),e=new pn({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};!t&&a&5&&(t=!0,l.value=o[0][o[2]],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function B2(i){let e,t,n;function r(o){i[6](o)}let s={min:i[1].input.min??-1/0,max:i[1].input.max??1/0,step:i[1].input.step??.5};return i[0][i[2]]!==void 0&&(s.value=i[0][i[2]]),e=new Ke({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a&2&&(l.min=o[1].input.min??-1/0),a&2&&(l.max=o[1].input.max??1/0),a&2&&(l.step=o[1].input.step??.5),!t&&a&5&&(t=!0,l.value=o[0][o[2]],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function D2(i){let e,t,n;function r(o){i[5](o)}let s={min:i[1].input.min??Number.MIN_SAFE_INTEGER,max:i[1].input.max??Number.MAX_SAFE_INTEGER,step:i[1].input.step??1,withRange:i[1].input.layout==kt.RANGE};return i[0][i[2]]!==void 0&&(s.value=i[0][i[2]]),e=new Ke({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a&2&&(l.min=o[1].input.min??Number.MIN_SAFE_INTEGER),a&2&&(l.max=o[1].input.max??Number.MAX_SAFE_INTEGER),a&2&&(l.step=o[1].input.step??1),a&2&&(l.withRange=o[1].input.layout==kt.RANGE),!t&&a&5&&(t=!0,l.value=o[0][o[2]],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function z2(i){let e,t,n;function r(o){i[4](o)}let s={min:i[1].input.min??-1/0,max:i[1].input.max??1/0,step:i[1].input.step??.1,withRange:i[1].input.layout==kt.RANGE};return i[0][i[2]]!==void 0&&(s.value=i[0][i[2]]),e=new Ke({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a&2&&(l.min=o[1].input.min??-1/0),a&2&&(l.max=o[1].input.max??1/0),a&2&&(l.step=o[1].input.step??.1),a&2&&(l.withRange=o[1].input.layout==kt.RANGE),!t&&a&5&&(t=!0,l.value=o[0][o[2]],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function L2(i){let e,t,n=i[1].title+"",r,s,o,a,l,u,f,c=i[1].input.type=="point"&&Us(i);const h=[z2,D2,B2,P2,M2],d=[];function p(m,_){return m[1].input.type=="float"?0:m[1].input.type=="int"?1:m[1].input.type=="angle"?2:m[1].input.type=="color"?3:m[1].input.type=="point"?4:-1}return~(a=p(i))&&(l=d[a]=h[a](i)),{c(){e=K("span"),c&&c.c(),t=re(),r=oe(n),o=re(),l&&l.c(),u=Ge(),this.h()},l(m){e=J(m,"SPAN",{title:!0,class:!0});var _=te(e);c&&c.l(_),t=ie(_),r=ae(_,n),_.forEach(k),o=ie(m),l&&l.l(m),u=Ge(),this.h()},h(){D(e,"title",s=i[1].description),D(e,"class","svelte-1712msg")},m(m,_){x(m,e,_),c&&c.m(e,null),O(e,t),O(e,r),x(m,o,_),~a&&d[a].m(m,_),x(m,u,_),f=!0},p(m,_){m[1].input.type=="point"?c?c.p(m,_):(c=Us(m),c.c(),c.m(e,t)):c&&(c.d(1),c=null),(!f||_&2)&&n!==(n=m[1].title+"")&&tt(r,n),(!f||_&2&&s!==(s=m[1].description))&&D(e,"title",s);let g=a;a=p(m),a===g?~a&&d[a].p(m,_):(l&&(Oe(),w(d[g],1,1,()=>{d[g]=null}),xe()),~a?(l=d[a],l?l.p(m,_):(l=d[a]=h[a](m),l.c()),v(l,1),l.m(u.parentNode,u)):l=null)},i(m){f||(v(l),f=!0)},o(m){w(l),f=!1},d(m){m&&k(e),c&&c.d(),m&&k(o),~a&&d[a].d(m),m&&k(u)}}}function U2(i){let e,t;return e=new Ze({props:{$$slots:{default:[L2]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&519&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function O2(i,e,t){let{desc:n}=e,{value:r}=e,{name:s}=e,{context:o}=e;function a(h){i.$$.not_equal(r[s],h)&&(r[s]=h,t(0,r),t(2,s),t(1,n),t(3,o))}function l(h){i.$$.not_equal(r[s],h)&&(r[s]=h,t(0,r),t(2,s),t(1,n),t(3,o))}function u(h){i.$$.not_equal(r[s],h)&&(r[s]=h,t(0,r),t(2,s),t(1,n),t(3,o))}function f(h){i.$$.not_equal(r[s],h)&&(r[s]=h,t(0,r),t(2,s),t(1,n),t(3,o))}function c(h){i.$$.not_equal(r[s],h)&&(r[s]=h,t(0,r),t(2,s),t(1,n),t(3,o))}return i.$$set=h=>{"desc"in h&&t(1,n=h.desc),"value"in h&&t(0,r=h.value),"name"in h&&t(2,s=h.name),"context"in h&&t(3,o=h.context)},i.$$.update=()=>{i.$$.dirty&15&&r[s]===void 0&&t(0,r[s]=Ca(n.input.type,n.default,o),r)},[r,n,s,o,a,l,u,f,c]}class x2 extends ye{constructor(e){super(),Ee(this,e,O2,U2,$e,{desc:1,value:0,name:2,context:3})}}function Os(i,e,t){const n=i.slice();return n[18]=e[t],n}function xr(i){const e=i.slice(),t=e[3].value.type;e[16]=t;const n=e[1][e[16]];return e[17]=n,e}function G2(i){var n;let e=(((n=i[1][i[15]])==null?void 0:n.title)||"Добавить эффект")+"",t;return{c(){t=oe(e)},l(r){t=ae(r,e)},m(r,s){x(r,t,s)},p(r,s){var o;s&32770&&e!==(e=(((o=r[1][r[15]])==null?void 0:o.title)||"Добавить эффект")+"")&&tt(t,e)},d(r){r&&k(t)}}}function xs(i){let e,t,n;function r(o){i[13](o)}let s={reverse:!0,items:i[0].map(Vs),$$slots:{default:[H2,({item:o})=>({15:o}),({item:o})=>o?32768:0]},$$scope:{ctx:i}};return i[3]!==void 0&&(s.active=i[3]),e=new Wr({props:s}),ge.push(()=>be(e,"active",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a&1&&(l.items=o[0].map(Vs)),a&2129934&&(l.$$scope={dirty:a,ctx:o}),!t&&a&8&&(t=!0,l.active=o[3],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function Gs(i){let e,t,n=i[17].inputs&&js(i);return{c(){n&&n.c(),e=Ge()},l(r){n&&n.l(r),e=Ge()},m(r,s){n&&n.m(r,s),x(r,e,s),t=!0},p(r,s){r[17].inputs?n?(n.p(r,s),s&10&&v(n,1)):(n=js(r),n.c(),v(n,1),n.m(e.parentNode,e)):n&&(Oe(),w(n,1,1,()=>{n=null}),xe())},i(r){t||(v(n),t=!0)},o(r){w(n),t=!1},d(r){n&&n.d(r),r&&k(e)}}}function js(i){let e,t,n,r;return t=new qt({props:{$$slots:{default:[j2]},$$scope:{ctx:i}}}),{c(){e=K("div"),F(t.$$.fragment),this.h()},l(s){e=J(s,"DIV",{class:!0});var o=te(e);N(t.$$.fragment,o),o.forEach(k),this.h()},h(){D(e,"class","svelte-19bln0u")},m(s,o){x(s,e,o),M(t,e,null),r=!0},p(s,o){const a={};o&2097166&&(a.$$scope={dirty:o,ctx:s}),t.$set(a)},i(s){r||(v(t.$$.fragment,s),Ot(()=>{r&&(n||(n=ut(e,ft,{},!0)),n.run(1))}),r=!0)},o(s){w(t.$$.fragment,s),n||(n=ut(e,ft,{},!1)),n.run(0),r=!1},d(s){s&&k(e),P(t),s&&n&&n.end()}}}function Hs(i,e){let t,n,r,s;function o(l){e[12](l)}let a={desc:e[18],name:e[18].name,context:e[2]};return e[3].value.settings!==void 0&&(a.value=e[3].value.settings),n=new x2({props:a}),ge.push(()=>be(n,"value",o)),{key:i,first:null,c(){t=Ge(),F(n.$$.fragment),this.h()},l(l){t=Ge(),N(n.$$.fragment,l),this.h()},h(){this.first=t},m(l,u){x(l,t,u),M(n,l,u),s=!0},p(l,u){e=l;const f={};u&10&&(f.desc=e[18]),u&10&&(f.name=e[18].name),u&4&&(f.context=e[2]),!r&&u&8&&(r=!0,f.value=e[3].value.settings,ve(()=>r=!1)),n.$set(f)},i(l){s||(v(n.$$.fragment,l),s=!0)},o(l){w(n.$$.fragment,l),s=!1},d(l){l&&k(t),P(n,l)}}}function j2(i){let e=[],t=new Map,n,r,s=i[17].inputs;const o=a=>a[18];for(let a=0;a{f=null}),xe())},i(c){u||(v(s.$$.fragment,c),c&&Ot(()=>{u&&(o||(o=ut(e,ft,{},!0)),o.run(1))}),v(f),u=!0)},o(c){w(s.$$.fragment,c),c&&(o||(o=ut(e,ft,{},!1)),o.run(0)),w(f),u=!1},d(c){c&&k(e),P(s),c&&o&&o.end(),c&&k(a),f&&f.d(c),c&&k(l)}}}function V2(i){let e,t,n,r,s,o;function a(f){i[10](f)}let l={type:"primary",hideOnClick:!0,items:i[9],placeholder:Ln,$$slots:{default:[G2,({item:f})=>({15:f}),({item:f})=>f?32768:0]},$$scope:{ctx:i}};i[4]!==void 0&&(l.value=i[4]),n=new Et({props:l}),ge.push(()=>be(n,"value",a)),n.$on("change",i[5]),n.$on("change",i[11]);let u=i[0].length&&xs(i);return{c(){e=K("article"),t=K("header"),F(n.$$.fragment),s=re(),u&&u.c(),this.h()},l(f){e=J(f,"ARTICLE",{class:!0});var c=te(e);t=J(c,"HEADER",{});var h=te(t);N(n.$$.fragment,h),h.forEach(k),s=ie(c),u&&u.l(c),c.forEach(k),this.h()},h(){D(e,"class","svelte-19bln0u")},m(f,c){x(f,e,c),O(e,t),M(n,t,null),O(e,s),u&&u.m(e,null),o=!0},p(f,[c]){const h={};c&2129922&&(h.$$scope={dirty:c,ctx:f}),!r&&c&16&&(r=!0,h.value=f[4],ve(()=>r=!1)),n.$set(h),f[0].length?u?(u.p(f,c),c&1&&v(u,1)):(u=xs(f),u.c(),v(u,1),u.m(e,null)):u&&(Oe(),w(u,1,1,()=>{u=null}),xe())},i(f){o||(v(n.$$.fragment,f),v(u),o=!0)},o(f){w(n.$$.fragment,f),w(u),o=!1},d(f){f&&k(e),P(n),u&&u.d()}}}const Ln="__add__",Vs=i=>({id:i,value:i});function W2(i,e,t){let{value:n}=e,{shaders:r}=e,{context:s}=e;function o(b){if(t(4,d=Ln),b.detail.value===Ln)return;const S=r[b.detail.value];if(!S)return;const y={};for(const I of S.inputs||[])y[I.name]=Ca(I.input.type,I.default,s);const A=n.push({type:b.detail.value,settings:y})-1;t(0,n),t(3,h={id:n[A],value:n[A]})}function a(b){return S=>{const y=S.detail,A=n.indexOf(y);if(A===-1){console.warn(`Not found effect in list ${y.settings.type}`);return}const I=A+b;I<0||n.length<=I||(t(0,n[A]=n[I],n),t(0,n[I]=y,n))}}function l(b){const S=b.detail,y=n.indexOf(S);if(y===-1){console.warn(`Not found effect in list ${S.settings.type}`);return}if(n.splice(y,1),t(0,n),h.id===S&&n.length){const A=Math.max(0,y-1);t(3,h={id:n[A],value:n[A]})}}const u=a(1),f=a(-1),c=[...Object.keys(r),Ln];let h={id:n[0],value:n[0]},d=Ln;function p(b){d=b,t(4,d)}function m(b){Ie.call(this,i,b)}function _(b){i.$$.not_equal(h.value.settings,b)&&(h.value.settings=b,t(3,h),t(0,n))}function g(b){h=b,t(3,h),t(0,n)}return i.$$set=b=>{"value"in b&&t(0,n=b.value),"shaders"in b&&t(1,r=b.shaders),"context"in b&&t(2,s=b.context)},i.$$.update=()=>{i.$$.dirty&9&&!h.value&&n.length&&(t(3,h.value=n[n.length-1],h),t(3,h.id=h.value,h))},[n,r,s,h,d,o,l,u,f,c,p,m,_,g]}class q2 extends ye{constructor(e){super(),Ee(this,e,W2,V2,$e,{value:0,shaders:1,context:2})}}function Z2(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_;function g(C){i[1](C)}let b={};i[0].width!==void 0&&(b.value=i[0].width),r=new Ke({props:b}),ge.push(()=>be(r,"value",g));function S(C){i[2](C)}let y={};i[0].height!==void 0&&(y.value=i[0].height),u=new Ke({props:y}),ge.push(()=>be(u,"value",S));function A(C){i[3](C)}let I={};return i[0].backgroundColor!==void 0&&(I.value=i[0].backgroundColor),p=new pn({props:I}),ge.push(()=>be(p,"value",A)),{c(){e=K("article"),t=K("section"),n=oe("Ширина"),F(r.$$.fragment),o=re(),a=K("section"),l=oe("Высота"),F(u.$$.fragment),c=re(),h=K("section"),d=oe("Фон"),F(p.$$.fragment),this.h()},l(C){e=J(C,"ARTICLE",{class:!0});var H=te(e);t=J(H,"SECTION",{class:!0});var G=te(t);n=ae(G,"Ширина"),N(r.$$.fragment,G),G.forEach(k),o=ie(H),a=J(H,"SECTION",{class:!0});var ne=te(a);l=ae(ne,"Высота"),N(u.$$.fragment,ne),ne.forEach(k),c=ie(H),h=J(H,"SECTION",{class:!0});var Q=te(h);d=ae(Q,"Фон"),N(p.$$.fragment,Q),Q.forEach(k),H.forEach(k),this.h()},h(){D(t,"class","svelte-yg88id"),D(a,"class","svelte-yg88id"),D(h,"class","svelte-yg88id"),D(e,"class","svelte-yg88id")},m(C,H){x(C,e,H),O(e,t),O(t,n),M(r,t,null),O(e,o),O(e,a),O(a,l),M(u,a,null),O(e,c),O(e,h),O(h,d),M(p,h,null),_=!0},p(C,[H]){const G={};!s&&H&1&&(s=!0,G.value=C[0].width,ve(()=>s=!1)),r.$set(G);const ne={};!f&&H&1&&(f=!0,ne.value=C[0].height,ve(()=>f=!1)),u.$set(ne);const Q={};!m&&H&1&&(m=!0,Q.value=C[0].backgroundColor,ve(()=>m=!1)),p.$set(Q)},i(C){_||(v(r.$$.fragment,C),v(u.$$.fragment,C),v(p.$$.fragment,C),_=!0)},o(C){w(r.$$.fragment,C),w(u.$$.fragment,C),w(p.$$.fragment,C),_=!1},d(C){C&&k(e),P(r),P(u),P(p)}}}function X2(i,e,t){let{value:n}=e;function r(a){i.$$.not_equal(n.width,a)&&(n.width=a,t(0,n))}function s(a){i.$$.not_equal(n.height,a)&&(n.height=a,t(0,n))}function o(a){i.$$.not_equal(n.backgroundColor,a)&&(n.backgroundColor=a,t(0,n))}return i.$$set=a=>{"value"in a&&t(0,n=a.value)},[n,r,s,o]}class Ra extends ye{constructor(e){super(),Ee(this,e,X2,Z2,$e,{value:0})}}class Y2{constructor(e,t,n,r){Ce(this,"position",{x:0,y:0});Ce(this,"moveStart");Ce(this,"ctrl",!1);Ce(this,"shift",!1);this.canvas=e,e.addEventListener("touchmove",s=>{const o=this.scale,{x:a,y:l}=this.posFromTouchEvent(s);this.position.x=a*o,this.position.y=l*o,this.ctrl=s.ctrlKey,this.shift=s.shiftKey,this.moveStart&&s.preventDefault(),r()}),e.addEventListener("mousemove",s=>{const o=this.scale;this.position.x=s.offsetX*o,this.position.y=s.offsetY*o,this.ctrl=s.ctrlKey,this.shift=s.shiftKey,r()}),e.addEventListener("touchstart",s=>{const o=this.scale,{x:a,y:l}=this.posFromTouchEvent(s);this.position.x=a*o,this.position.y=l*o,this.pressed||(this.moveStart={...this.position},t(this.moveStart,this)?s.preventDefault():this.moveStart=void 0),this.ctrl=s.ctrlKey,this.shift=s.shiftKey,r()},{passive:!0}),e.addEventListener("mousedown",s=>{if(s.button!==0)return;const o=this.scale;this.position.x=s.offsetX*o,this.position.y=s.offsetY*o,this.pressed||(this.moveStart={...this.position},t(this.moveStart,this)),this.ctrl=s.ctrlKey,this.shift=s.shiftKey,r()}),e.addEventListener("touchend",s=>{const o=this.scale,{x:a,y:l}=this.posFromTouchEvent(s);this.position.x=a*o,this.position.y=l*o,this.ctrl=s.ctrlKey,this.shift=s.shiftKey,this.moveStart&&(n(this.moveStart,this.position,this)&&s.preventDefault(),this.moveStart=void 0),s.preventDefault(),r()}),e.addEventListener("mouseup",s=>{if(s.button!==0)return;const o=this.scale;this.position.x=s.offsetX*o,this.position.y=s.offsetY*o,this.ctrl=s.ctrlKey,this.shift=s.shiftKey,this.moveStart&&(n(this.moveStart,this.position,this),this.moveStart=void 0),r()})}get pressed(){return this.moveStart!==void 0}get scale(){const e=this.canvas;return e.width/e.clientWidth}get realSize(){return{width:this.canvas.clientWidth,height:this.canvas.clientHeight}}posFromTouchEvent(e){return this.posFromTouch(e.changedTouches[0])}posFromTouch(e){const t=this.canvas.getBoundingClientRect(),n=e.pageX-t.x,r=e.pageY-t.y;return{x:n,y:r}}}function vr(i,e){return{x:e.x-i.x,y:e.y-i.y}}function K2(i,e,t=0){return Math.abs(i.x-e.x)<=t&&Math.abs(i.y-e.y)<=t}class J2{constructor(e,t,n){Ce(this,"sprites",new Array);Ce(this,"cursor");Ce(this,"dragAndDrop");Ce(this,"hoveredSprite");this.dragDropSystemSource=t,this.onupdate=n,this.cursor=new Y2(e,()=>{if(this.dragAndDrop)return!0;if(!this.hoveredSprite)return!1;const r=this.dragDropSystemSource(this.hoveredSprite);return r?(this.dragAndDrop={sprite:this.hoveredSprite,system:r,lastPosition:{x:NaN,y:NaN}},!0):!1},(r,s)=>{if(!this.dragAndDrop)return!1;const o=this.dragAndDrop.system;return this.dragAndDrop=void 0,o.drop(r,s,this.cursor),!0},()=>this.update())}add(e){return this.sprites.push(e),e}delete(e){const t=this.sprites.indexOf(e);t!==-1&&this.sprites.splice(t,1)}clear(){var e;(e=this.dragAndDrop)==null||e.system.drop(this.cursor.moveStart,this.cursor.position,this.cursor),this.dragAndDrop=void 0,this.hoveredSprite=void 0,this.sprites.length=0}update(){var t,n;if(this.dragAndDrop){K2(this.cursor.position,this.dragAndDrop.lastPosition,.001)||(this.dragAndDrop.system.move(this.cursor.moveStart,this.cursor.position,this.cursor),this.dragAndDrop.lastPosition.x=this.cursor.position.x,this.dragAndDrop.lastPosition.y=this.cursor.position.y,(t=this.onupdate)==null||t.call(this));return}const e=this.hoveredSprite;this.hoveredSprite=void 0;for(let r=this.sprites.length-1;r>=0;r--){const s=this.sprites[r];if(s.interactive&&s.contains(this.cursor.position)){this.hoveredSprite=s;break}}e!==this.hoveredSprite&&((n=this.onupdate)==null||n.call(this))}draw(e){this.sprites.forEach(t=>{e.save(),t.draw(e,this.spriteState(t)),e.restore()})}spriteState(e){var t;return((t=this.dragAndDrop)==null?void 0:t.sprite)===e?"active":this.hoveredSprite===e?"hover":"default"}}class Qe{constructor(){Ce(this,"data",[[0,0,0],[0,0,0],[0,0,0]])}static Zero(){return new Qe}static Ident(){const e=new Qe;return e.data[0][0]=1,e.data[1][1]=1,e.data[2][2]=1,e}static RotationAround(e,t){return Qe.Translate({x:-e.x,y:-e.y}).Multiply(this.Rotation(t)).Multiply(Qe.Translate(e))}static Rotation(e){const t=Math.sin(e),n=Math.cos(e);return this.RotationCosSin(n,t)}static RotationCosSin(e,t){const n=Qe.Ident();return n.data[0][0]=e,n.data[0][1]=t,n.data[1][0]=-t,n.data[1][1]=e,n}static Translate(e,t){const n=Qe.Ident();if(typeof e=="number"&&typeof t=="number")n.data[2][0]=e,n.data[2][1]=t;else if(typeof e!="number"){const r=e;n.data[2][0]=r.x,n.data[2][1]=r.y}else throw new Error(`Unexpected type combination in Matrix.Translate: x: ${typeof e}, y: ${typeof t}`);return n}Get(e,t){return this.data[e][t]}Set(e,t,n){this.data[e][t]=n}Multiply(e){const t=Qe.Zero();for(let n=0;n<3;++n)for(let r=0;r<3;++r)for(let s=0;s<3;++s)t.data[n][r]+=this.data[n][s]*e.data[s][r];return t}Transform(e,t={x:0,y:0}){const n=this.Get(0,0)*e.x+this.Get(1,0)*e.y+this.Get(2,0),r=this.Get(0,1)*e.x+this.Get(1,1)*e.y+this.Get(2,1),s=this.Get(0,2)*e.x+this.Get(1,2)*e.y+this.Get(2,2);return t.x=n/s,t.y=r/s,t}}class Fi{constructor(e,t,n){Ce(this,"normal");Ce(this,"normalization");this.a=e,this.b=t,this.c=n;const r=Math.sqrt(e*e+t*t);this.normal={x:e/r,y:t/r},this.normalization=r}static byTwoPoints({x:e,y:t},{x:n,y:r}){return new Fi(t-r,n-e,e*r-n*t)}onLine(e){return Math.abs(this.rawDistance(e))<1e-15}sign(e){return Math.sign(this.rawDistance(e))}rawDistance({x:e,y:t}){return this.a*e+this.b*t+this.c}distance(e){const t=this.rawDistance(e);return Math.abs(t)/this.normalization}projection(e){const t=this.rawDistance(e)/this.normalization;return{x:e.x-this.normal.x*t,y:e.y-this.normal.y*t}}}class Ws{constructor(e,t){Ce(this,"line");this.p1=e,this.p2=t,this.line=Fi.byTwoPoints(e,t)}get left(){return Math.min(this.p1.x,this.p2.x)}get right(){return Math.max(this.p1.x,this.p2.x)}}class Zn{constructor(e){Ce(this,"edges");this.points=e,this.edges=new Array(e.length),this.updateEdges()}updateEdges(){const e=this.points;for(let t=0;te.Transform(t)))}contains(e){let t=0;const n=this.edges.length;for(let r=0;rs.right||(t+=s.line.sign(e))}return t!=0}center(){const e=this.points,t=e.length;let n=0,r=0;for(let s=0;s0,t=()=>0,n=()=>0,r){this.xSource=e,this.ySource=t,this.rotateSource=n,this.parent=r}get rotate(){return this.rotateSource()}get x(){return this.xSource()}get y(){return this.ySource()}matrix(){const e=Qe.Rotation(this.rotate).Multiply(Qe.Translate(this));return this.parent?e.Multiply(this.parent.matrix()):e}rotation(){const e=this.rotate;return this.parent?e+this.parent.rotation():e}}function qs(i,e){const t=e/3,n=t/2,r=[{x:i-n-2*t,y:n},{x:-n,y:n},{x:-n,y:-n},{x:i-n-2*t,y:-n},{x:i-n-3*t,y:-n-t},{x:i-n,y:0},{x:i-n-3*t,y:+n+t}];return new Zn(r)}function Zs(i,e,t){const n=t/3,r=n/2,s=e/(Math.PI/45)|0,o=e/s,a=[],l=[],u=i-r,f=i+r;for(let d=0;dh.Transform(d,d)),...l.reverse()])}function Q2(i,e){i.beginPath(),i.moveTo(e.points[0].x,e.points[0].y),e.points.forEach(t=>i.lineTo(t.x,t.y)),i.closePath()}class eb extends Fa{constructor(e,t,n=!1,r){super(n,r),this.circle=e,this.width=t}makePath(e,t){const n=t=="hover"?this.width:this.width/2,r=this.circle.radius-n/2,s=r+n,{x:o,y:a}=this.circle.center;r<=0||(e.beginPath(),e.arc(o,a,r,0,2*Math.PI,!1),e.moveTo(o+s,a),e.arc(o,a,s,0,2*Math.PI,!0),e.closePath())}contains(e){const t=e.x-this.circle.center.x,n=e.y-this.circle.center.y,r=Math.sqrt(t*t+n*n);return Math.abs(this.circle.radius-r)(i[i.Cursor=0]="Cursor",i[i.Move=1]="Move",i[i.Crop=2]="Crop",i))(Qt||{});class tb{constructor(e,t,n,r,s,o,a){Ce(this,"ctx");Ce(this,"sprites");Ce(this,"handlers",new Map);Ce(this,"effectToSprite",new Map);Ce(this,"activeBlockId","");Ce(this,"activeContainerType","");Ce(this,"draw",ar(()=>{const e=this.ctx.canvas,t=this.cursor.realSize;e.width!==t.width&&(e.width=t.width),e.height!==t.height&&(e.height=t.height),this.ctx.clearRect(0,0,e.width,e.height),this.ctx.save(),this.ctx.scale(1/this.cursor.scale,1/this.cursor.scale),this.sprites.draw(this.ctx),this.ctx.restore()}));this.state=o,this.effectsShaders=a,this.ctx=e.getContext("2d");let l=!1;this.sprites=new J2(t,c=>{const h=this.handlers.get(c);if(h){if(h.type==="select"){const d=h.blockId;return{move(){},drop(){s.set(r.value.blocks.find(({id:p})=>d===p))}}}if(h.type==="effect"){const d=h.handler(),p=(m,_,g)=>{d(m,_,g),l=!0,s.set(s.value),l=!1};return{move:ar(p),drop:p}}if(h.type==="move"){const d=s.value.container;if(!this.activeBlockId||d.type!=="rectangle")return;const p=d.value,m=h.handler(p),_=(g,b,S)=>{d.value=m(g,b,S),l=!0,s.set(s.value),l=!1};return{move:ar(_),drop:_}}if(this.activeBlockId&&h.type==="crop"){const d=s.value.container,p=s.value.content;if(!this.activeBlockId||d.type!=="rectangle"||p.type!=="image")return;const m=d.value,_=p.value.crop,g=h.handler(_,m),b=(S,y,A)=>{const I=g(S,y,A);d.value=I.pos,p.value.crop=I.tex,l=!0,s.set(s.value),l=!1};return{move:ar(b),drop:b}}}},()=>this.draw()),n.subscribe(()=>{this.activeBlockId=""}),r.subscribe(()=>{l||this.draw()});const u={global:{text:{available:[0],default:0},image:{available:[0],default:0}},rectangle:{text:{available:[0,1],default:1},image:{available:[0,1,2],default:1}}};let f=!1;s.subscribe(c=>{if(!c){console.warn("Undefined active block");return}const h=u[c.container.type][c.content.type];if(this.state.value.available!==h.available&&(f=!0,this.state.set({available:h.available,mode:h.default}),f=!1),l||this.draw(),c.id==this.activeBlockId&&c.container.type==this.activeContainerType){const d=new Map(this.effectToSprite);c.effects.forEach(p=>{if(d.has(p)){d.delete(p);return}this.setupEffect(p)});for(const[p,m]of d)m.forEach(_=>this.handlers.delete(_)),m.forEach(_=>this.sprites.delete(_)),this.effectToSprite.delete(p);return}this.activeBlockId=c.id,this.activeContainerType=c.container.type,this.setup(r.value.blocks,c)}),o.subscribe(()=>{f||(this.setup(r.value.blocks,s.value),this.draw())})}get cursor(){return this.sprites.cursor}setupEffect(e){const t=8*this.cursor.scale,n=this.effectsShaders[e.type];if(!n||!n.inputs)return;let r;const s=[];let o;for(const l of n.inputs)l.input.type=="point"?(s.push(l),l.name=="center"&&(r=l)):l.name=="radius"&&l.input.type=="float"&&(o=l);const a=e.settings;for(const l of s)this.addEffectModifier(new It(Tt(t*2,t*2),new Lt(()=>e.settings[l.name].x,()=>e.settings[l.name].y,()=>Math.PI/4),!0,$t(l.input.type=="point"?l.input.color:"#000000")),e,()=>(u,f)=>(e.settings[l.name].x=f.x|0,e.settings[l.name].y=f.y|0,!0));r&&o&&this.addEffectModifier(new eb(a,t,!0,$t(r.input.type=="point"?r.input.color:"#000000")),e,()=>(l,u)=>{const f=u.x-e.settings.center.x,c=u.y-e.settings.center.y,h=Math.sqrt(f*f+c*c);return e.settings.radius=h|0,!0})}clear(){this.handlers.clear(),this.sprites.clear()}setupBlock(e){if(this.state.value.mode===1){e.container.type==="rectangle"&&this.setupMoveRectangle(e);return}if(this.state.value.mode===2){e.container.type==="rectangle"&&this.setupCropRectangle(e);return}}setup(e,t){const n=this.ctx.canvas,r=this.cursor.realSize;n.width!==r.width&&(n.width=r.width),n.height!==r.height&&(n.height=r.height),this.clear(),e.forEach(s=>{s===t||s.container.type!=="rectangle"||this.addSelector(s.id,s.container.value)}),this.setupBlock(t),t.effects.forEach(s=>this.setupEffect(s))}setupCropRectangle(e){const t=8*this.cursor.scale,n=new or(()=>Tt(e.container.value.width,e.container.value.height),new Lt(()=>e.container.value.position.x,()=>e.container.value.position.y,()=>e.container.value.rotation),!0,{fill:{},stroke:{default:"#aaaaaa "}}),r=this.sprites.add(n),s=qs(t*7,t*2),o=new It(Tt(t*2.5,t*2.5),new Lt(()=>0,()=>0,()=>-e.content.value.crop.rotation,r.transform),!0,$t("#a4b4c4")),a=new Lt(()=>0,()=>0,()=>this.cursor.ctrl?-o.transform.rotation():0,o.transform),l=new It(s,new Mt(0,0,0,a),!0,$t("#4444aa")),u=new It(s,new Mt(0,0,-Math.PI/2,a),!0,$t("#aa4444"));this.addCrop(l,Ys(l)),this.addCrop(u,Ys(u)),this.addCrop(o,ab);const f=new It(Zs(4*t,Math.PI*1.5,t*1.5),new Mt(0,0,-Math.PI/4,o.transform),!0,$t("#88ee88"));this.addCrop(f,lb(o.transform)),[{dim:"width",dir:{x:1,y:0}},{dim:"width",dir:{x:-1,y:0}},{dim:"height",dir:{x:0,y:1}},{dim:"height",dir:{x:0,y:-1}}].forEach(({dim:c,dir:h})=>{const d=c==="height"?()=>Tt(e.container.value.width-t,t):()=>Tt(t,e.container.value.height-t);this.addCrop(new or(d,new Lt(()=>h.x*e.container.value.width/2,()=>h.y*e.container.value.height/2,()=>0,r.transform),!0,$t("#333333")),sb(c,h))}),[{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:1,y:-1}].forEach(c=>{this.addCrop(new It(Tt(t,t),new Lt(()=>c.x*e.container.value.width/2,()=>c.y*e.container.value.height/2,()=>0,r.transform),!0,$t("#444444")),ob(c))})}setupMoveRectangle(e){const t=new or(()=>Tt(e.container.value.width,e.container.value.height),new Lt(()=>e.container.value.position.x,()=>e.container.value.position.y,()=>e.container.value.rotation),!0,{fill:{},stroke:{default:"#aaaa00 "}}),n=this.sprites.add(t),r=16*this.cursor.scale,s=qs(r*7,r*1.4),o=new Lt(()=>0,()=>0,()=>this.cursor.ctrl?-n.transform.rotation():0,n.transform),a=new It(s,new Mt(0,0,0,o),!0,$t("#0000ff")),l=new It(s,new Mt(0,0,-Math.PI/2,o),!0,$t("#ff0000"));this.addModifier(a,Xs(a)),this.addModifier(l,Xs(l)),this.addModifier(new It(Tt(r*2,r*2),new Mt(0,0,0,n.transform),!0,$t("#ff00ff")),f=>(c,h)=>{const d=h.x-c.x,p=h.y-c.y,{x:m,y:_}=f.position;return{...f,position:{x:m+d|0,y:_+p|0}}});const u=new It(Zs(4*r,Math.PI*1.5,r*1.5),new Mt(0,0,-Math.PI/4,n.transform),!0,$t("#00ff00"));this.addModifier(u,nb),[{dim:"width",dir:{x:1,y:0}},{dim:"width",dir:{x:-1,y:0}},{dim:"height",dir:{x:0,y:1}},{dim:"height",dir:{x:0,y:-1}}].forEach(({dim:f,dir:c})=>{const h=f==="height"?()=>Tt(e.container.value.width-r,r):()=>Tt(r,e.container.value.height-r);this.addModifier(new or(h,new Lt(()=>c.x*e.container.value.width/2,()=>c.y*e.container.value.height/2,()=>0,n.transform),!0,$t("#ff9900")),rb(f,c))}),[{x:1,y:1},{x:-1,y:1},{x:-1,y:-1},{x:1,y:-1}].forEach(f=>{this.addModifier(new It(Tt(r,r),new Lt(()=>f.x*e.container.value.width/2,()=>f.y*e.container.value.height/2,()=>0,n.transform),!0,$t("#ff99ff")),ib(f))})}addSelector(e,t){const n=this.sprites.add(new It(Tt(t.width,t.height),new Mt(t.position.x,t.position.y,t.rotation),!0,{fill:{hover:"#aaaaaa22",active:"#aaaaaa44"},stroke:{hover:"#aaaaaa99",active:"#aaaaaa"}}));this.handlers.set(n,{type:"select",blockId:e})}addModifier(e,t){this.handlers.set(this.sprites.add(e),{type:"move",handler:t})}addCrop(e,t){this.handlers.set(this.sprites.add(e),{type:"crop",handler:t})}addEffectModifier(e,t,n){this.handlers.set(this.sprites.add(e),{type:"effect",handler:n}),this.effectToSprite.has(t)?this.effectToSprite.get(t).push(e):this.effectToSprite.set(t,[e])}}function nb(i){const{rotation:e}=i,t=i.position;return(n,r,s)=>{const o=vr(t,n),a=vr(t,r),l=Math.atan2(o.y,o.x),u=Math.atan2(a.y,a.x),f=Math.PI/180*1;let c=Math.round((u-l)/f)*f;const h=Math.PI/4;return s.shift&&(c=(c/h|0)*h),{...i,rotation:s.ctrl?c:e+c}}}function $t(i){return{fill:{default:`${i}44`,hover:`${i}99`,active:`${i}`},stroke:{default:`${i}44`,hover:`${i}99`,active:`${i}`}}}function rb(i,e){return t=>(n,r,s)=>{const o=r.x-n.x,a=r.y-n.y,l=Qe.Rotation(t.rotation).Transform(e);let u=o*l.x+a*l.y|0;return s.shift&&(u=(u/10|0)*10),s.ctrl?{...t,position:{x:t.position.x+l.x*u/2,y:t.position.y+l.y*u/2},[i]:t[i]+u}:{...t,[i]:t[i]+2*u}}}function ib(i){return e=>(t,n,r)=>{const s=n.x-t.x,o=n.y-t.y,a=Qe.Rotation(e.rotation).Transform({x:0,y:i.y}),l=Qe.Rotation(e.rotation).Transform({x:i.x,y:0});let u=s*a.x+o*a.y|0,f=s*l.x+o*l.y|0;const c=e.width/e.height;return r.shift&&(f=Math.max(u*c,f),u=f/c),r.ctrl?{...e,position:{x:e.position.x+a.x*u/2+l.x*f/2,y:e.position.y+a.y*u/2+l.y*f/2},height:e.height+u,width:e.width+f}:{...e,height:e.height+2*u,width:e.width+2*f}}}function Xs(i){return e=>(t,n,r)=>{const s=n.x-t.x,o=n.y-t.y,{x:a,y:l}=e.position,u=Qe.Rotation(i.transform.rotation()).Transform({x:1,y:0});let f=s*u.x+o*u.y;return r.shift&&(f=(f/10|0)*10),{...e,position:{x:a+u.x*f,y:l+u.y*f}}}}function ar(i){let e=0;return(...t)=>{e||(e=requestAnimationFrame(()=>{e=0,i.apply(void 0,t)}))}}function sb(i,e){return(t,n)=>(r,s,o)=>{const a=s.x-r.x,l=s.y-r.y,u=Qe.Rotation(n.rotation).Transform(e);let f=a*u.x+l*u.y;o.shift&&(f=(f/10|0)*10);const c=t.width/n.width,h=t.height/n.height,d={x:e.x*f,y:e.y*f},p=Math.sign(t[i])*Math.sign(n[i])*Math.sign(f)*Math.sqrt(d.x*d.x*c*c+d.y*d.y*h*h);if(!o.ctrl)return{tex:{...t,[i]:t[i]+2*p},pos:{...n,[i]:n[i]+2*f}};const m=Qe.Rotation(t.rotation).Transform(d);return{tex:{...t,position:{x:t.position.x+m.x/2*c,y:t.position.y+m.y/2*h},[i]:t[i]+p},pos:{...n,position:{x:n.position.x+u.x*f/2,y:n.position.y+u.y*f/2},[i]:n[i]+f}}}}function ob(i){return(e,t)=>(n,r,s)=>{const o=r.x-n.x,a=r.y-n.y,l=Qe.Rotation(t.rotation),u=l.Transform({x:0,y:i.y}),f=l.Transform({x:i.x,y:0});let c=o*u.x+a*u.y|0,h=o*f.x+a*f.y|0;const d=t.height/t.width;s.shift&&(c=Math.max(h*d,c),h=c/d);const p=e.width/t.width,m=e.height/t.height,_=c*m,g=h*p;if(!s.ctrl)return{tex:{...e,width:e.width+2*g,height:e.height+2*_},pos:{...t,height:t.height+2*c,width:t.width+2*h}};const S=Qe.Rotation(e.rotation).Transform({x:Math.sign(i.x)*h,y:Math.sign(i.y)*c});return{tex:{...e,position:{x:e.position.x+S.x/2*p,y:e.position.y+S.y/2*m},width:e.width+g,height:e.height+_},pos:{...t,position:{x:t.position.x+u.x*c/2+f.x*h/2,y:t.position.y+u.y*c/2+f.y*h/2},width:t.width+h,height:t.height+c}}}}function ab(i,e){return(t,n)=>{const r=n.x-t.x,s=n.y-t.y,o=i.width/e.width,a=i.height/e.height,l=Qe.Rotation(i.rotation-e.rotation).Transform({x:r,y:s});return{tex:{...i,position:{x:i.position.x-l.x*o,y:i.position.y-l.y*a}},pos:e}}}function Ys(i){return(e,t)=>(n,r,s)=>{const o=r.x-n.x,a=r.y-n.y,l=Qe.Rotation(i.transform.rotation()).Transform({x:1,y:0});let u=o*l.x+a*l.y;s.shift&&(u=(u/10|0)*10);const f=e.width/t.width,c=e.height/t.height,h=Qe.Rotation(e.rotation-t.rotation).Transform({x:l.x*u,y:l.y*u}),{x:d,y:p}=e.position;return{tex:{...e,position:{x:d-h.x*f,y:p-h.y*c}},pos:t}}}function lb(i){return(e,t)=>{const{rotation:n}=e,r=i.matrix().Transform({x:0,y:0});return(s,o,a)=>{const l=vr(r,s),u=vr(r,o),f=Math.atan2(l.y,l.x),c=Math.atan2(u.y,u.x),h=Math.PI/180*1;let d=-Math.round((c-f)/h)*h;const p=Math.PI/4;return a.shift&&(d=(d/p|0)*p),{tex:{...e,rotation:a.ctrl?d:n+d},pos:t}}}}function Ks(i,e,t){const n=i.slice();return n[5]=e[t],n}function ub(i){let e,t,n;return e=new Vn({props:{type:"bootstrap",path:i[5].icon}}),{c(){F(e.$$.fragment),t=re()},l(r){N(e.$$.fragment,r),t=ie(r)},m(r,s){M(e,r,s),x(r,t,s),n=!0},p:Be,i(r){n||(v(e.$$.fragment,r),n=!0)},o(r){w(e.$$.fragment,r),n=!1},d(r){P(e,r),r&&k(t)}}}function Js(i){let e,t;function n(...s){return i[3](i[5],...s)}function r(){return i[4](i[5])}return e=new Ye({props:{title:i[5].title,active:i[0]===i[5].value,disabled:!i[1].some(n),$$slots:{default:[ub]},$$scope:{ctx:i}}}),e.$on("click",r),{c(){F(e.$$.fragment)},l(s){N(e.$$.fragment,s)},m(s,o){M(e,s,o),t=!0},p(s,o){i=s;const a={};o&1&&(a.active=i[0]===i[5].value),o&2&&(a.disabled=!i[1].some(n)),o&256&&(a.$$scope={dirty:o,ctx:i}),e.$set(a)},i(s){t||(v(e.$$.fragment,s),t=!0)},o(s){w(e.$$.fragment,s),t=!1},d(s){P(e,s)}}}function fb(i){let e,t,n=i[2],r=[];for(let o=0;ow(r[o],1,1,()=>{r[o]=null});return{c(){e=K("article");for(let o=0;ou===l.value,a=l=>{r.some(u=>u===l.value)&&t(0,n=l.value)};return i.$$set=l=>{"current"in l&&t(0,n=l.current),"available"in l&&t(1,r=l.available)},[n,r,s,o,a]}class pb extends ye{constructor(e){super(),Ee(this,e,db,fb,$e,{current:0,available:1})}}function _b(i){let e,t,n,r;return{c(){e=oe("Имя "),t=K("input")},l(s){e=ae(s,"Имя "),t=J(s,"INPUT",{})},m(s,o){x(s,e,o),x(s,t,o),Rt(t,i[0].name),n||(r=Re(t,"input",i[1]),n=!0)},p(s,o){o&1&&t.value!==s[0].name&&Rt(t,s[0].name)},d(s){s&&k(e),s&&k(t),n=!1,r()}}}function gb(i){let e,t,n,r;function s(a){i[3](a)}let o={step:.01};return i[0].crop.position!==void 0&&(o.value=i[0].crop.position),t=new In({props:o}),ge.push(()=>be(t,"value",s)),{c(){e=oe("Центр"),F(t.$$.fragment)},l(a){e=ae(a,"Центр"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].crop.position,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function bb(i){let e,t,n;return t=new Ke({props:{withRange:!0,rangeMin:0,rangeMax:360,step:1,value:Math.round(i[0].crop.rotation/Math.PI*180)}}),t.$on("input",i[4]),{c(){e=oe("Поворот"),F(t.$$.fragment)},l(r){e=ae(r,"Поворот"),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=Math.round(r[0].crop.rotation/Math.PI*180)),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function vb(i){let e,t,n,r;function s(a){i[5](a)}let o={step:.01};return i[0].crop.width!==void 0&&(o.value=i[0].crop.width),t=new Ke({props:o}),ge.push(()=>be(t,"value",s)),{c(){e=oe("Ширина"),F(t.$$.fragment)},l(a){e=ae(a,"Ширина"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].crop.width,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function $b(i){let e,t,n,r;function s(a){i[6](a)}let o={step:.01};return i[0].crop.height!==void 0&&(o.value=i[0].crop.height),t=new Ke({props:o}),ge.push(()=>be(t,"value",s)),{c(){e=oe("Высота"),F(t.$$.fragment)},l(a){e=ae(a,"Высота"),N(t.$$.fragment,a)},m(a,l){x(a,e,l),M(t,a,l),r=!0},p(a,l){const u={};!n&&l&1&&(n=!0,u.value=a[0].crop.height,ve(()=>n=!1)),t.$set(u)},i(a){r||(v(t.$$.fragment,a),r=!0)},o(a){w(t.$$.fragment,a),r=!1},d(a){a&&k(e),P(t,a)}}}function wb(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p;return e=new Ze({props:{$$slots:{default:[_b]},$$scope:{ctx:i}}}),n=new ho({props:{accept:"image/*",typeFilter:/^image\//}}),n.$on("change",i[2]),a=new Ze({props:{$$slots:{default:[gb]},$$scope:{ctx:i}}}),u=new Ze({props:{$$slots:{default:[bb]},$$scope:{ctx:i}}}),c=new Ze({props:{$$slots:{default:[vb]},$$scope:{ctx:i}}}),d=new Ze({props:{$$slots:{default:[$b]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment),r=re(),s=K("br"),o=oe(` + Настройки текстурных координат (не стабильно) + `),F(a.$$.fragment),l=re(),F(u.$$.fragment),f=re(),F(c.$$.fragment),h=re(),F(d.$$.fragment)},l(m){N(e.$$.fragment,m),t=ie(m),N(n.$$.fragment,m),r=ie(m),s=J(m,"BR",{}),o=ae(m,` + Настройки текстурных координат (не стабильно) + `),N(a.$$.fragment,m),l=ie(m),N(u.$$.fragment,m),f=ie(m),N(c.$$.fragment,m),h=ie(m),N(d.$$.fragment,m)},m(m,_){M(e,m,_),x(m,t,_),M(n,m,_),x(m,r,_),x(m,s,_),x(m,o,_),M(a,m,_),x(m,l,_),M(u,m,_),x(m,f,_),M(c,m,_),x(m,h,_),M(d,m,_),p=!0},p(m,_){const g={};_&129&&(g.$$scope={dirty:_,ctx:m}),e.$set(g);const b={};_&129&&(b.$$scope={dirty:_,ctx:m}),a.$set(b);const S={};_&129&&(S.$$scope={dirty:_,ctx:m}),u.$set(S);const y={};_&129&&(y.$$scope={dirty:_,ctx:m}),c.$set(y);const A={};_&129&&(A.$$scope={dirty:_,ctx:m}),d.$set(A)},i(m){p||(v(e.$$.fragment,m),v(n.$$.fragment,m),v(a.$$.fragment,m),v(u.$$.fragment,m),v(c.$$.fragment,m),v(d.$$.fragment,m),p=!0)},o(m){w(e.$$.fragment,m),w(n.$$.fragment,m),w(a.$$.fragment,m),w(u.$$.fragment,m),w(c.$$.fragment,m),w(d.$$.fragment,m),p=!1},d(m){P(e,m),m&&k(t),P(n,m),m&&k(r),m&&k(s),m&&k(o),P(a,m),m&&k(l),P(u,m),m&&k(f),P(c,m),m&&k(h),P(d,m)}}}function yb(i){let e,t;return e=new qt({props:{$$slots:{default:[wb]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,[r]){const s={};r&129&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Eb(i,e,t){let{content:n}=e;function r(){n.name=this.value,t(0,n)}function s(f){Ie.call(this,i,f)}function o(f){i.$$.not_equal(n.crop.position,f)&&(n.crop.position=f,t(0,n))}const a=f=>{t(0,n.crop.rotation=f.detail%360/180*Math.PI,n)};function l(f){i.$$.not_equal(n.crop.width,f)&&(n.crop.width=f,t(0,n))}function u(f){i.$$.not_equal(n.crop.height,f)&&(n.crop.height=f,t(0,n))}return i.$$set=f=>{"content"in f&&t(0,n=f.content)},[n,r,s,o,a,l,u]}class kb extends ye{constructor(e){super(),Ee(this,e,Eb,yb,$e,{content:0})}}function Sb(i){let e,t,n;return t=new Ke({props:{withRange:!0,min:0,max:100,step:1,value:100-i[0].alpha*100}}),t.$on("change",i[8]),t.$on("input",i[9]),{c(){e=oe("Прозрачность (%) "),F(t.$$.fragment)},l(r){e=ae(r,"Прозрачность (%) "),N(t.$$.fragment,r)},m(r,s){x(r,e,s),M(t,r,s),n=!0},p(r,s){const o={};s&1&&(o.value=100-r[0].alpha*100),t.$set(o)},i(r){n||(v(t.$$.fragment,r),n=!0)},o(r){w(t.$$.fragment,r),n=!1},d(r){r&&k(e),P(t,r)}}}function Ab(i){var n;let e=(((n=i[15])==null?void 0:n.name)||"Иное")+"",t;return{c(){t=oe(e)},l(r){t=ae(r,e)},m(r,s){x(r,t,s)},p(r,s){var o;s&32768&&e!==(e=(((o=r[15])==null?void 0:o.name)||"Иное")+"")&&tt(t,e)},d(r){r&&k(t)}}}function Ib(i){let e,t,n,r,s,o;function a(u){i[12](u)}let l={};return i[1]!==void 0&&(l.value=i[1]),r=new po({props:l}),ge.push(()=>be(r,"value",a)),{c(){e=K("span"),t=oe("Показать все настройки"),n=re(),F(r.$$.fragment)},l(u){e=J(u,"SPAN",{});var f=te(e);t=ae(f,"Показать все настройки"),f.forEach(k),n=ie(u),N(r.$$.fragment,u)},m(u,f){x(u,e,f),O(e,t),x(u,n,f),M(r,u,f),o=!0},p(u,f){const c={};!s&&f&2&&(s=!0,c.value=u[1],ve(()=>s=!1)),r.$set(c)},i(u){o||(v(r.$$.fragment,u),o=!0)},o(u){w(r.$$.fragment,u),o=!1},d(u){u&&k(e),u&&k(n),P(r,u)}}}function Qs(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b;function S(C){i[13](C)}let y={css:i[7],items:i[3],$$slots:{default:[Tb,({item:C})=>({15:C}),({item:C})=>C?32768:0]},$$scope:{ctx:i}};i[0].blendMode!==void 0&&(y.value=i[0].blendMode),a=new Et({props:y}),ge.push(()=>be(a,"value",S));function A(C){i[14](C)}let I={css:i[7],items:i[5],$$slots:{default:[Cb,({item:C})=>({15:C}),({item:C})=>C?32768:0]},$$scope:{ctx:i}};return i[0].composeMode!==void 0&&(I.value=i[0].composeMode),m=new Et({props:I}),ge.push(()=>be(m,"value",A)),{c(){e=K("div"),t=K("article"),n=K("section"),r=oe("Режим смешивания:"),s=re(),o=K("section"),F(a.$$.fragment),u=re(),f=K("article"),c=K("section"),h=oe("Режим наложения:"),d=re(),p=K("section"),F(m.$$.fragment),this.h()},l(C){e=J(C,"DIV",{});var H=te(e);t=J(H,"ARTICLE",{class:!0});var G=te(t);n=J(G,"SECTION",{class:!0});var ne=te(n);r=ae(ne,"Режим смешивания:"),ne.forEach(k),s=ie(G),o=J(G,"SECTION",{class:!0});var Q=te(o);N(a.$$.fragment,Q),Q.forEach(k),G.forEach(k),u=ie(H),f=J(H,"ARTICLE",{class:!0});var R=te(f);c=J(R,"SECTION",{class:!0});var X=te(c);h=ae(X,"Режим наложения:"),X.forEach(k),d=ie(R),p=J(R,"SECTION",{class:!0});var E=te(p);N(m.$$.fragment,E),E.forEach(k),R.forEach(k),H.forEach(k),this.h()},h(){D(n,"class","svelte-1xgraxo"),D(o,"class","svelte-1xgraxo"),D(t,"class","block svelte-1xgraxo"),D(c,"class","svelte-1xgraxo"),D(p,"class","svelte-1xgraxo"),D(f,"class","block svelte-1xgraxo")},m(C,H){x(C,e,H),O(e,t),O(t,n),O(n,r),O(t,s),O(t,o),M(a,o,null),O(e,u),O(e,f),O(f,c),O(c,h),O(f,d),O(f,p),M(m,p,null),b=!0},p(C,H){const G={};H&98304&&(G.$$scope={dirty:H,ctx:C}),!l&&H&1&&(l=!0,G.value=C[0].blendMode,ve(()=>l=!1)),a.$set(G);const ne={};H&98304&&(ne.$$scope={dirty:H,ctx:C}),!_&&H&1&&(_=!0,ne.value=C[0].composeMode,ve(()=>_=!1)),m.$set(ne)},i(C){b||(v(a.$$.fragment,C),v(m.$$.fragment,C),C&&Ot(()=>{b&&(g||(g=ut(e,ft,{},!0)),g.run(1))}),b=!0)},o(C){w(a.$$.fragment,C),w(m.$$.fragment,C),C&&(g||(g=ut(e,ft,{},!1)),g.run(0)),b=!1},d(C){C&&k(e),P(a),P(m),C&&g&&g.end()}}}function Tb(i){let e=(i[2][i[15]]||i[15].replace("_"," "))+"",t;return{c(){t=oe(e)},l(n){t=ae(n,e)},m(n,r){x(n,t,r)},p(n,r){r&32768&&e!==(e=(n[2][n[15]]||n[15].replace("_"," "))+"")&&tt(t,e)},d(n){n&&k(t)}}}function Cb(i){let e=(i[4][i[15]]||i[15].replace("_"," "))+"",t;return{c(){t=oe(e)},l(n){t=ae(n,e)},m(n,r){x(n,t,r)},p(n,r){r&32768&&e!==(e=(n[4][n[15]]||n[15].replace("_"," "))+"")&&tt(t,e)},d(n){n&&k(t)}}}function Rb(i){let e,t,n,r,s,o,a,l,u,f,c,h,d;t=new Ze({props:{$$slots:{default:[Sb]},$$scope:{ctx:i}}}),u=new Et({props:{css:i[7],value:i[6].find(i[10]),items:i[6],$$slots:{default:[Ab,({item:m})=>({15:m}),({item:m})=>m?32768:0]},$$scope:{ctx:i}}}),u.$on("change",i[11]),c=new Ze({props:{$$slots:{default:[Ib]},$$scope:{ctx:i}}});let p=i[1]&&Qs(i);return{c(){e=K("article"),F(t.$$.fragment),n=re(),r=K("article"),s=K("section"),o=oe("Режим:"),a=re(),l=K("section"),F(u.$$.fragment),f=re(),F(c.$$.fragment),h=re(),p&&p.c(),this.h()},l(m){e=J(m,"ARTICLE",{class:!0});var _=te(e);N(t.$$.fragment,_),n=ie(_),r=J(_,"ARTICLE",{class:!0});var g=te(r);s=J(g,"SECTION",{class:!0});var b=te(s);o=ae(b,"Режим:"),b.forEach(k),a=ie(g),l=J(g,"SECTION",{class:!0});var S=te(l);N(u.$$.fragment,S),S.forEach(k),g.forEach(k),f=ie(_),N(c.$$.fragment,_),h=ie(_),p&&p.l(_),_.forEach(k),this.h()},h(){D(s,"class","svelte-1xgraxo"),D(l,"class","svelte-1xgraxo"),D(r,"class","block svelte-1xgraxo"),D(e,"class","main svelte-1xgraxo")},m(m,_){x(m,e,_),M(t,e,null),O(e,n),O(e,r),O(r,s),O(s,o),O(r,a),O(r,l),M(u,l,null),O(e,f),M(c,e,null),O(e,h),p&&p.m(e,null),d=!0},p(m,[_]){const g={};_&65537&&(g.$$scope={dirty:_,ctx:m}),t.$set(g);const b={};_&1&&(b.value=m[6].find(m[10])),_&98304&&(b.$$scope={dirty:_,ctx:m}),u.$set(b);const S={};_&65538&&(S.$$scope={dirty:_,ctx:m}),c.$set(S),m[1]?p?(p.p(m,_),_&2&&v(p,1)):(p=Qs(m),p.c(),v(p,1),p.m(e,null)):p&&(Oe(),w(p,1,1,()=>{p=null}),xe())},i(m){d||(v(t.$$.fragment,m),v(u.$$.fragment,m),v(c.$$.fragment,m),v(p),d=!0)},o(m){w(t.$$.fragment,m),w(u.$$.fragment,m),w(c.$$.fragment,m),w(p),d=!1},d(m){m&&k(e),P(t),P(u),P(c),p&&p.d()}}}function Fb(i,e,t){let{value:n}=e;const r={normal:"Нормальный",multiply:"Умножение",screen:"Экранное осветление",overlay:"Перекрытие",darken:"Замена тёмным",lighten:"Замена светлым",color_dodge:"Осветление основы",color_burn:"Затемнение основы",hard_light:"Направленный свет",soft_light:"",difference:"Разница",exclusion:"Исключение",hue:"",saturation:"",color:"",luminosity:"",xor:"Xor"},s=Object.keys(r),o={clear:"",copy:"",destination:"",source_over:"",destination_over:"",source_in:"",destination_in:"",source_out:"",destination_out:"",source_atop:"",destination_atop:"",lighter:"",xor:"Xor"},a=Object.keys(o),l=[{name:"Нормальный",value:{blendMode:"normal",composeMode:"source_over"}},{name:"Умножение",value:{blendMode:"multiply",composeMode:"source_over"}},{name:"Добавление",value:{blendMode:"normal",composeMode:"lighter"}},{name:"Экранное осветление",value:{blendMode:"screen",composeMode:"source_over"}},{name:"Перекрытие",value:{blendMode:"overlay",composeMode:"source_over"}},{name:"Замена тёмным",value:{blendMode:"darken",composeMode:"source_over"}},{name:"Замена светлым",value:{blendMode:"lighten",composeMode:"source_over"}},{name:"Осветление основы",value:{blendMode:"color_dodge",composeMode:"source_over"}},{name:"Затемнение основы",value:{blendMode:"color_burn",composeMode:"source_over"}},{name:"Направленный свет",value:{blendMode:"hard_light",composeMode:"source_over"}},{name:"Разница",value:{blendMode:"difference",composeMode:"source_over"}},{name:"Исключение",value:{blendMode:"exclusion",composeMode:"source_over"}},{name:"Xor",value:{blendMode:"xor",composeMode:"source_over"}}];let u=!1;const f={height:"32px",width:"100%",main:""};function c(b){Ie.call(this,i,b)}const h=b=>{t(0,n.alpha=(100-b.detail)/100,n)},d=({value:{blendMode:b,composeMode:S}})=>n.blendMode==b&&n.composeMode==S,p=b=>{const S=b.detail.value;S&&(t(0,n.blendMode=S.value.blendMode,n),t(0,n.composeMode=S.value.composeMode,n))};function m(b){u=b,t(1,u)}function _(b){i.$$.not_equal(n.blendMode,b)&&(n.blendMode=b,t(0,n))}function g(b){i.$$.not_equal(n.composeMode,b)&&(n.composeMode=b,t(0,n))}return i.$$set=b=>{"value"in b&&t(0,n=b.value)},[n,u,r,s,o,a,l,f,c,h,d,p,m,_,g]}class Nb extends ye{constructor(e){super(),Ee(this,e,Fb,Rb,$e,{value:0})}}function Mb(i){let e,t,n,r,s,o,a,l;return{c(){e=Pt("svg"),t=Pt("path"),n=Pt("path"),r=Pt("path"),s=Pt("path"),o=Pt("path"),a=Pt("path"),this.h()},l(u){e=Bt(u,"svg",{class:!0,fill:!0,stroke:!0,"stroke-linecap":!0,"stroke-linejoin":!0,"stroke-width":!0,version:!0,width:!0,height:!0,viewBox:!0,xmlns:!0,style:!0});var f=te(e);t=Bt(f,"path",{d:!0,fill:!0,stroke:!0}),te(t).forEach(k),n=Bt(f,"path",{d:!0}),te(n).forEach(k),r=Bt(f,"path",{d:!0}),te(r).forEach(k),s=Bt(f,"path",{d:!0}),te(s).forEach(k),o=Bt(f,"path",{d:!0}),te(o).forEach(k),a=Bt(f,"path",{d:!0}),te(a).forEach(k),f.forEach(k),this.h()},h(){D(t,"d","M0 0h24v24H0z"),D(t,"fill","none"),D(t,"stroke","none"),D(n,"d","m4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"),D(r,"d","m7 9 5-5 5 5"),D(s,"d","m12 4v12"),D(o,"d","m17 4h6"),D(a,"d","m20 1v6"),D(e,"class","icon icon-tabler icon-tabler-upload"),D(e,"fill","none"),D(e,"stroke","currentColor"),D(e,"stroke-linecap","round"),D(e,"stroke-linejoin","round"),D(e,"stroke-width","2"),D(e,"version","1.1"),D(e,"width",i[0]),D(e,"height",i[0]),D(e,"viewBox","0 0 24 24"),D(e,"xmlns","http://www.w3.org/2000/svg"),D(e,"style",l=`min-width:${i[0]}px`)},m(u,f){x(u,e,f),O(e,t),O(e,n),O(e,r),O(e,s),O(e,o),O(e,a)},p(u,[f]){f&1&&D(e,"width",u[0]),f&1&&D(e,"height",u[0]),f&1&&l!==(l=`min-width:${u[0]}px`)&&D(e,"style",l)},i:Be,o:Be,d(u){u&&k(e)}}}function Pb(i,e,t){let{size:n=24}=e;return i.$$set=r=>{"size"in r&&t(0,n=r.size)},[n]}class Bb extends ye{constructor(e){super(),Ee(this,e,Pb,Mb,$e,{size:0})}}function Db(i){let e,t,n;return{c(){e=K("span"),t=oe("Тт"),this.h()},l(r){e=J(r,"SPAN",{class:!0,style:!0});var s=te(e);t=ae(s,"Тт"),s.forEach(k),this.h()},h(){D(e,"class","icon svelte-1xqd1d5"),D(e,"style",n=` +width: ${i[0]-4}px; +min-width: ${i[0]-4}px; +height: ${i[0]-4}px; +min-height: ${i[0]-4}px; +font-size: ${i[0]-12}px; +`)},m(r,s){x(r,e,s),O(e,t)},p(r,[s]){s&1&&n!==(n=` +width: ${r[0]-4}px; +min-width: ${r[0]-4}px; +height: ${r[0]-4}px; +min-height: ${r[0]-4}px; +font-size: ${r[0]-12}px; +`)&&D(e,"style",n)},i:Be,o:Be,d(r){r&&k(e)}}}function zb(i,e,t){let{size:n=24}=e;return i.$$set=r=>{"size"in r&&t(0,n=r.size)},[n]}class Ma extends ye{constructor(e){super(),Ee(this,e,zb,Db,$e,{size:0})}}function Lb(i){let e=i[0].content.type+"",t;return{c(){t=oe(e)},l(n){t=ae(n,e)},m(n,r){x(n,t,r)},p(n,r){r&1&&e!==(e=n[0].content.type+"")&&tt(t,e)},i:Be,o:Be,d(n){n&&k(t)}}}function Ub(i){let e,t,n,r=i[1].value.name+"",s,o;return e=new ai({}),{c(){F(e.$$.fragment),t=re(),n=K("span"),s=oe(r),this.h()},l(a){N(e.$$.fragment,a),t=ie(a),n=J(a,"SPAN",{class:!0});var l=te(n);s=ae(l,r),l.forEach(k),this.h()},h(){D(n,"class","svelte-bube6y")},m(a,l){M(e,a,l),x(a,t,l),x(a,n,l),O(n,s),o=!0},p(a,l){(!o||l&2)&&r!==(r=a[1].value.name+"")&&tt(s,r)},i(a){o||(v(e.$$.fragment,a),o=!0)},o(a){w(e.$$.fragment,a),o=!1},d(a){P(e,a),a&&k(t),a&&k(n)}}}function Ob(i){let e,t,n,r=i[1].value.text+"",s,o,a;return e=new Ma({}),{c(){F(e.$$.fragment),t=re(),n=K("span"),s=oe(r),this.h()},l(l){N(e.$$.fragment,l),t=ie(l),n=J(l,"SPAN",{style:!0,class:!0});var u=te(n);s=ae(u,r),u.forEach(k),this.h()},h(){D(n,"style",o=`font:${Ht(i[1].value.style.font,16)};`),D(n,"class","svelte-bube6y")},m(l,u){M(e,l,u),x(l,t,u),x(l,n,u),O(n,s),a=!0},p(l,u){(!a||u&2)&&r!==(r=l[1].value.text+"")&&tt(s,r),(!a||u&2&&o!==(o=`font:${Ht(l[1].value.style.font,16)};`))&&D(n,"style",o)},i(l){a||(v(e.$$.fragment,l),a=!0)},o(l){w(e.$$.fragment,l),a=!1},d(l){P(e,l),l&&k(t),l&&k(n)}}}function xb(i){let e,t,n,r,s,o;const a=[Ob,Ub,Lb],l=[];function u(h,d){return h[1].type==="text"?0:h[1].type==="image"?1:2}n=u(i),r=l[n]=a[n](i);const f=i[3].default,c=Fe(f,i,i[2],null);return{c(){e=K("article"),t=K("section"),r.c(),s=re(),c&&c.c(),this.h()},l(h){e=J(h,"ARTICLE",{class:!0});var d=te(e);t=J(d,"SECTION",{class:!0});var p=te(t);r.l(p),p.forEach(k),s=ie(d),c&&c.l(d),d.forEach(k),this.h()},h(){D(t,"class","svelte-bube6y"),D(e,"class","svelte-bube6y")},m(h,d){x(h,e,d),O(e,t),l[n].m(t,null),O(e,s),c&&c.m(e,null),o=!0},p(h,[d]){let p=n;n=u(h),n===p?l[n].p(h,d):(Oe(),w(l[p],1,1,()=>{l[p]=null}),xe(),r=l[n],r?r.p(h,d):(r=l[n]=a[n](h),r.c()),v(r,1),r.m(t,null)),c&&c.p&&(!o||d&4)&&Ne(c,f,h,h[2],o?Pe(f,h[2],d,null):Me(h[2]),null)},i(h){o||(v(r),v(c,h),o=!0)},o(h){w(r),w(c,h),o=!1},d(h){h&&k(e),l[n].d(),c&&c.d(h)}}}function Gb(i,e,t){let{$$slots:n={},$$scope:r}=e,{value:s}=e,o;return i.$$set=a=>{"value"in a&&t(0,s=a.value),"$$scope"in a&&t(2,r=a.$$scope)},i.$$.update=()=>{i.$$.dirty&1&&t(1,o=s.content)},[s,o,r,n]}class Pa extends ye{constructor(e){super(),Ee(this,e,Gb,xb,$e,{value:0})}}function jb(i){let e,t,n,r,s;return e=new uo({}),{c(){F(e.$$.fragment),t=re(),n=K("span"),r=oe("Новый фрейм"),this.h()},l(o){N(e.$$.fragment,o),t=ie(o),n=J(o,"SPAN",{class:!0});var a=te(n);r=ae(a,"Новый фрейм"),a.forEach(k),this.h()},h(){D(n,"class","svelte-1y8uz14")},m(o,a){M(e,o,a),x(o,t,a),x(o,n,a),O(n,r),s=!0},p:Be,i(o){s||(v(e.$$.fragment,o),s=!0)},o(o){w(e.$$.fragment,o),s=!1},d(o){P(e,o),o&&k(t),o&&k(n)}}}function Hb(i){let e,t;function n(){return i[16](i[57])}function r(){return i[17](i[57])}function s(){return i[18](i[57])}function o(){return i[19](i[57])}return e=new ui({props:{up:!0,down:!0,remove:!0,copy:!0,value:i[57]}}),e.$on("up",n),e.$on("down",r),e.$on("remove",s),e.$on("copy",o),{c(){F(e.$$.fragment)},l(a){N(e.$$.fragment,a)},m(a,l){M(e,a,l),t=!0},p(a,l){i=a;const u={};l[1]&67108864&&(u.value=i[57]),e.$set(u)},i(a){t||(v(e.$$.fragment,a),t=!0)},o(a){w(e.$$.fragment,a),t=!1},d(a){P(e,a)}}}function Vb(i){let e,t,n;function r(o){i[20](o,i[57])}let s={index:i[58],$$slots:{default:[Hb]},$$scope:{ctx:i}};return i[2][i[57].id]!==void 0&&(s.updatePreview=i[2][i[57].id]),e=new ud({props:s}),ge.push(()=>be(e,"updatePreview",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){i=o;const l={};a[1]&134217728&&(l.index=i[58]),a[1]&335544320&&(l.$$scope={dirty:a,ctx:i}),!t&&a[0]&4|a[1]&67108864&&(t=!0,l.updatePreview=i[2][i[57].id],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function Wb(i){let e,t,n,r,s;return e=new Lf({props:{size:24}}),{c(){F(e.$$.fragment),t=re(),n=K("span"),r=oe("Скачать мем"),this.h()},l(o){N(e.$$.fragment,o),t=ie(o),n=J(o,"SPAN",{class:!0});var a=te(n);r=ae(a,"Скачать мем"),a.forEach(k),this.h()},h(){D(n,"class","svelte-1y8uz14")},m(o,a){M(e,o,a),x(o,t,a),x(o,n,a),O(n,r),s=!0},p:Be,i(o){s||(v(e.$$.fragment,o),s=!0)},o(o){w(e.$$.fragment,o),s=!1},d(o){P(e,o),o&&k(t),o&&k(n)}}}function qb(i){let e,t,n,r,s;return e=new zu({props:{size:24}}),{c(){F(e.$$.fragment),t=re(),n=K("span"),r=oe("Сохранить проект мема"),this.h()},l(o){N(e.$$.fragment,o),t=ie(o),n=J(o,"SPAN",{class:!0});var a=te(n);r=ae(a,"Сохранить проект мема"),a.forEach(k),this.h()},h(){D(n,"class","svelte-1y8uz14")},m(o,a){M(e,o,a),x(o,t,a),x(o,n,a),O(n,r),s=!0},p:Be,i(o){s||(v(e.$$.fragment,o),s=!0)},o(o){w(e.$$.fragment,o),s=!1},d(o){P(e,o),o&&k(t),o&&k(n)}}}function Zb(i){let e,t,n,r;return e=new gc({props:{size:24}}),{c(){F(e.$$.fragment),t=K("span"),n=oe("Открыть мем"),this.h()},l(s){N(e.$$.fragment,s),t=J(s,"SPAN",{class:!0});var o=te(t);n=ae(o,"Открыть мем"),o.forEach(k),this.h()},h(){D(t,"class","svelte-1y8uz14")},m(s,o){M(e,s,o),x(s,t,o),O(t,n),r=!0},p:Be,i(s){r||(v(e.$$.fragment,s),r=!0)},o(s){w(e.$$.fragment,s),r=!1},d(s){P(e,s),s&&k(t)}}}function Xb(i){let e,t;return e=new Ye({props:{type:"primary",justifyContent:"flex-start",$$slots:{default:[Zb]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[1]&268435456&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Yb(i){let e,t,n,r;return e=new Bb({}),{c(){F(e.$$.fragment),t=K("span"),n=oe("Добавить фреймы из мема"),this.h()},l(s){N(e.$$.fragment,s),t=J(s,"SPAN",{class:!0});var o=te(t);n=ae(o,"Добавить фреймы из мема"),o.forEach(k),this.h()},h(){D(t,"class","svelte-1y8uz14")},m(s,o){M(e,s,o),x(s,t,o),O(t,n),r=!0},p:Be,i(s){r||(v(e.$$.fragment,s),r=!0)},o(s){w(e.$$.fragment,s),r=!1},d(s){P(e,s),s&&k(t)}}}function Kb(i){let e,t;return e=new Ye({props:{type:"primary",justifyContent:"flex-start",$$slots:{default:[Yb]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[1]&268435456&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function Jb(i){let e,t,n,r;return e=new jf({props:{size:24}}),{c(){F(e.$$.fragment),t=K("span"),n=oe("Сменить фон"),this.h()},l(s){N(e.$$.fragment,s),t=J(s,"SPAN",{class:!0});var o=te(t);n=ae(o,"Сменить фон"),o.forEach(k),this.h()},h(){D(t,"class","svelte-1y8uz14")},m(s,o){M(e,s,o),x(s,t,o),O(t,n),r=!0},p:Be,i(s){r||(v(e.$$.fragment,s),r=!0)},o(s){w(e.$$.fragment,s),r=!1},d(s){P(e,s),s&&k(t)}}}function Qb(i){let e,t;return e=new Ye({props:{type:"primary",justifyContent:"flex-start",$$slots:{default:[Jb]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[1]&268435456&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function ev(i){let e,t,n,r;return e=new lo({}),{c(){F(e.$$.fragment),t=K("span"),n=oe("Копировать"),this.h()},l(s){N(e.$$.fragment,s),t=J(s,"SPAN",{class:!0});var o=te(t);n=ae(o,"Копировать"),o.forEach(k),this.h()},h(){D(t,"class","svelte-1y8uz14")},m(s,o){M(e,s,o),x(s,t,o),O(t,n),r=!0},p:Be,i(s){r||(v(e.$$.fragment,s),r=!0)},o(s){w(e.$$.fragment,s),r=!1},d(s){P(e,s),s&&k(t)}}}function tv(i){let e,t,n,r,s;return e=new uo({}),{c(){F(e.$$.fragment),t=re(),n=K("span"),r=oe("Новый блок"),this.h()},l(o){N(e.$$.fragment,o),t=ie(o),n=J(o,"SPAN",{class:!0});var a=te(n);r=ae(a,"Новый блок"),a.forEach(k),this.h()},h(){D(n,"class","svelte-1y8uz14")},m(o,a){M(e,o,a),x(o,t,a),x(o,n,a),O(n,r),s=!0},p:Be,i(o){s||(v(e.$$.fragment,o),s=!0)},o(o){w(e.$$.fragment,o),s=!1},d(o){P(e,o),o&&k(t),o&&k(n)}}}function nv(i){let e,t,n,r,s;return e=new ai({}),{c(){F(e.$$.fragment),t=re(),n=K("span"),r=oe("С картинкой"),this.h()},l(o){N(e.$$.fragment,o),t=ie(o),n=J(o,"SPAN",{class:!0});var a=te(n);r=ae(a,"С картинкой"),a.forEach(k),this.h()},h(){D(n,"class","svelte-1y8uz14")},m(o,a){M(e,o,a),x(o,t,a),x(o,n,a),O(n,r),s=!0},p:Be,i(o){s||(v(e.$$.fragment,o),s=!0)},o(o){w(e.$$.fragment,o),s=!1},d(o){P(e,o),o&&k(t),o&&k(n)}}}function rv(i){let e,t;return e=new Pa({props:{value:i[57]}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[1]&67108864&&(s.value=n[57]),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function iv(i){let e,t;return e=new Pa({props:{value:i[1],$$slots:{default:[ov]},$$scope:{ctx:i}}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[0]&2&&(s.value=n[1]),r[0]&1027|r[1]&268435456&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function eo(i){let e,t,n,r;function s(l){i[38](l)}function o(l){i[39](l)}let a={frame:i[0],frameDrawer:i[10],iconSize:20};return i[1].content.value.style!==void 0&&(a.style=i[1].content.value.style),i[1]!==void 0&&(a.block=i[1]),e=new S2({props:a}),ge.push(()=>be(e,"style",s)),ge.push(()=>be(e,"block",o)),{c(){F(e.$$.fragment)},l(l){N(e.$$.fragment,l)},m(l,u){M(e,l,u),r=!0},p(l,u){const f={};u[0]&1&&(f.frame=l[0]),u[0]&1024&&(f.frameDrawer=l[10]),!t&&u[0]&2&&(t=!0,f.style=l[1].content.value.style,ve(()=>t=!1)),!n&&u[0]&2&&(n=!0,f.block=l[1],ve(()=>n=!1)),e.$set(f)},i(l){r||(v(e.$$.fragment,l),r=!0)},o(l){w(e.$$.fragment,l),r=!1},d(l){P(e,l)}}}function sv(i){let e,t,n=i[1].content.type=="text"&&eo(i);return{c(){n&&n.c(),e=Ge()},l(r){n&&n.l(r),e=Ge()},m(r,s){n&&n.m(r,s),x(r,e,s),t=!0},p(r,s){r[1].content.type=="text"?n?(n.p(r,s),s[0]&2&&v(n,1)):(n=eo(r),n.c(),v(n,1),n.m(e.parentNode,e)):n&&(Oe(),w(n,1,1,()=>{n=null}),xe())},i(r){t||(v(n),t=!0)},o(r){w(n),t=!1},d(r){n&&n.d(r),r&&k(e)}}}function ov(i){let e,t;return e=new ui({props:{up:!0,down:!0,remove:!0,copy:!0,value:i[1],iconSize:20,$$slots:{default:[sv]},$$scope:{ctx:i}}}),e.$on("up",i[40]),e.$on("down",i[41]),e.$on("remove",i[42]),e.$on("copy",i[43]),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[0]&2&&(s.value=n[1]),r[0]&1027|r[1]&268435456&&(s.$$scope={dirty:r,ctx:n}),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function av(i){let e,t,n,r;const s=[iv,rv],o=[];function a(l,u){return l[57].id==l[1].id?0:1}return e=a(i),t=o[e]=s[e](i),{c(){t.c(),n=Ge()},l(l){t.l(l),n=Ge()},m(l,u){o[e].m(l,u),x(l,n,u),r=!0},p(l,u){let f=e;e=a(l),e===f?o[e].p(l,u):(Oe(),w(o[f],1,1,()=>{o[f]=null}),xe(),t=o[e],t?t.p(l,u):(t=o[e]=s[e](l),t.c()),v(t,1),t.m(n.parentNode,n))},i(l){r||(v(t),r=!0)},o(l){w(t),r=!1},d(l){o[e].d(l),l&&k(n)}}}function lv(i){let e,t;return e=new Eu({}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function uv(i){let e,t;return e=new Vn({props:{size:20,type:"bootstrap",path:"M8.235 1.559a.5.5 0 0 0-.47 0l-7.5 4a.5.5 0 0 0 0 .882L3.188 8 .264 9.559a.5.5 0 0 0 0 .882l7.5 4a.5.5 0 0 0 .47 0l7.5-4a.5.5 0 0 0 0-.882L12.813 8l2.922-1.559a.5.5 0 0 0 0-.882zm3.515 7.008L14.438 10 8 13.433 1.562 10 4.25 8.567l3.515 1.874a.5.5 0 0 0 .47 0zM8 9.433 1.562 6 8 2.567 14.438 6z"}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function fv(i){let e,t;return e=new Vn({props:{size:20,type:"bootstrap",path:"M9.5 2.672a.5.5 0 1 0 1 0V.843a.5.5 0 0 0-1 0zm4.5.035A.5.5 0 0 0 13.293 2L12 3.293a.5.5 0 1 0 .707.707zM7.293 4A.5.5 0 1 0 8 3.293L6.707 2A.5.5 0 0 0 6 2.707zm-.621 2.5a.5.5 0 1 0 0-1H4.843a.5.5 0 1 0 0 1zm8.485 0a.5.5 0 1 0 0-1h-1.829a.5.5 0 0 0 0 1zM13.293 10A.5.5 0 1 0 14 9.293L12.707 8a.5.5 0 1 0-.707.707zM9.5 11.157a.5.5 0 0 0 1 0V9.328a.5.5 0 0 0-1 0zm1.854-5.097a.5.5 0 0 0 0-.706l-.708-.708a.5.5 0 0 0-.707 0L8.646 5.94a.5.5 0 0 0 0 .707l.708.708a.5.5 0 0 0 .707 0l1.293-1.293Zm-3 3a.5.5 0 0 0 0-.706l-.708-.708a.5.5 0 0 0-.707 0L.646 13.94a.5.5 0 0 0 0 .707l.708.708a.5.5 0 0 0 .707 0z"}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function cv(i){let e,t;return e=new Gl({props:{size:24}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function hv(i){let e,t;return e=new ai({props:{size:24}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function mv(i){let e,t;return e=new Ma({props:{size:24}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function dv(i){let e,t,n,r,s;const o=[mv,hv,cv,fv,uv,lv],a=[];function l(u,f){return u[56]=="Текст"?0:u[56]=="Изображение"?1:u[56]=="Контейнер"?2:u[56]=="Эффекты"?3:u[56]=="Наложение"?4:5}return t=l(i),n=a[t]=o[t](i),{c(){e=K("div"),n.c(),this.h()},l(u){e=J(u,"DIV",{class:!0,title:!0});var f=te(e);n.l(f),f.forEach(k),this.h()},h(){D(e,"class","center svelte-1y8uz14"),D(e,"title",r=i[56])},m(u,f){x(u,e,f),a[t].m(e,null),s=!0},p(u,f){let c=t;t=l(u),t!==c&&(Oe(),w(a[c],1,1,()=>{a[c]=null}),xe(),n=a[t],n||(n=a[t]=o[t](u),n.c()),v(n,1),n.m(e,null)),(!s||f[1]&33554432&&r!==(r=u[56]))&&D(e,"title",r)},i(u){s||(v(n),s=!0)},o(u){w(n),s=!1},d(u){u&&k(e),a[t].d()}}}function pv(i){let e,t,n;function r(o){i[54](o)}let s={};return i[1]!==void 0&&(s.value=i[1]),e=new mo({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};!t&&a[0]&2&&(t=!0,l.value=o[1],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function _v(i){let e,t,n;function r(o){i[53](o)}let s={};return i[1].layer!==void 0&&(s.value=i[1].layer),e=new Nb({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};!t&&a[0]&2&&(t=!0,l.value=o[1].layer,ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function gv(i){let e,t,n;function r(o){i[52](o)}let s={shaders:i[9],context:{frame:i[0]}};return i[1].effects!==void 0&&(s.value=i[1].effects),e=new q2({props:s}),ge.push(()=>be(e,"value",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a[0]&512&&(l.shaders=o[9]),a[0]&1&&(l.context={frame:o[0]}),!t&&a[0]&2&&(t=!0,l.value=o[1].effects,ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function bv(i){let e,t,n;function r(o){i[51](o)}let s={textureManager:i[12],content:i[1].content,frameHeight:i[0].height,frameWidth:i[0].width};return i[1].container!==void 0&&(s.container=i[1].container),e=new p2({props:s}),ge.push(()=>be(e,"container",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a[0]&4096&&(l.textureManager=o[12]),a[0]&2&&(l.content=o[1].content),a[0]&1&&(l.frameHeight=o[0].height),a[0]&1&&(l.frameWidth=o[0].width),!t&&a[0]&2&&(t=!0,l.container=o[1].container,ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function vv(i){let e,t,n;function r(o){i[49](o)}let s={};return i[1].content.value!==void 0&&(s.content=i[1].content.value),e=new kb({props:s}),ge.push(()=>be(e,"content",r)),e.$on("change",i[50]),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};!t&&a[0]&2&&(t=!0,l.content=o[1].content.value,ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function $v(i){let e,t,n;function r(o){i[46](o)}let s={container:i[1].container};return i[1].content.value!==void 0&&(s.content=i[1].content.value),e=new wo({props:s}),ge.push(()=>be(e,"content",r)),e.$on("change",i[47]),e.$on("addPattern",i[48]),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a[0]&2&&(l.container=o[1].container),!t&&a[0]&2&&(t=!0,l.content=o[1].content.value,ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function wv(i){let e,t,n,r;const s=[$v,vv,bv,gv,_v,pv],o=[];function a(l,u){return l[56]==="Текст"&&l[1].content.type=="text"?0:l[56]==="Изображение"&&l[1].content.type=="image"?1:l[56]==="Контейнер"?2:l[56]==="Эффекты"?3:l[56]==="Наложение"?4:5}return t=a(i),n=o[t]=s[t](i),{c(){e=K("div"),n.c(),this.h()},l(l){e=J(l,"DIV",{slot:!0});var u=te(e);n.l(u),u.forEach(k),this.h()},h(){D(e,"slot","content")},m(l,u){x(l,e,u),o[t].m(e,null),r=!0},p(l,u){let f=t;t=a(l),t===f?o[t].p(l,u):(Oe(),w(o[f],1,1,()=>{o[f]=null}),xe(),n=o[t],n?n.p(l,u):(n=o[t]=s[t](l),n.c()),v(n,1),n.m(e,null))},i(l){r||(v(n),r=!0)},o(l){w(n),r=!1},d(l){l&&k(e),o[t].d()}}}function yv(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b,S,y,A,I,C,H,G,ne,Q,R,X,E,V,W,j,q,ee,we,L,Z,Se,me,_e,ce,Ae,ze,De,Le;n=new Ye({props:{type:"primary",justifyContent:"flex-start",$$slots:{default:[jb]},$$scope:{ctx:i}}}),n.$on("click",i[15]);function Xe(T){i[21](T)}let lt={height:"50%",items:i[6].frames,$$slots:{default:[Vb,({item:T,index:le})=>({57:T,58:le}),({item:T,index:le})=>[0,(T?67108864:0)|(le?134217728:0)]]},$$scope:{ctx:i}};i[0]!==void 0&&(lt.active=i[0]),s=new Wr({props:lt}),ge.push(()=>be(s,"active",Xe)),s.$on("drop",Gr(i[22])),l=new Ye({props:{type:"primary",justifyContent:"flex-start",$$slots:{default:[Wb]},$$scope:{ctx:i}}}),l.$on("click",i[23]),f=new Ye({props:{type:"primary",justifyContent:"flex-start",$$slots:{default:[qb]},$$scope:{ctx:i}}}),f.$on("click",i[24]),h=new ur({props:{accept:".meme",$$slots:{default:[Xb]},$$scope:{ctx:i}}}),h.$on("change",i[25]),p=new ur({props:{accept:".meme",$$slots:{default:[Kb]},$$scope:{ctx:i}}}),p.$on("change",i[26]),_=new N2({props:{version:i[7]}}),_.$on("openExample",i[27]),y=new ur({props:{accept:"image/*",typeFilter:/^image\//,$$slots:{default:[Qb]},$$scope:{ctx:i}}}),y.$on("change",i[28]),I=new Ye({props:{type:"primary",justifyContent:"flex-start",$$slots:{default:[ev]},$$scope:{ctx:i}}}),I.$on("click",i[29]);function at(T){i[30](T)}function $(T){i[31](T)}let ue={};i[5].available!==void 0&&(ue.available=i[5].available),i[5].mode!==void 0&&(ue.current=i[5].mode),H=new pb({props:ue}),ge.push(()=>be(H,"available",at)),ge.push(()=>be(H,"current",$));function se(T){i[32](T)}function U(T){i[33](T)}let B={};i[3]!==void 0&&(B.webgl=i[3]),i[4]!==void 0&&(B.ui=i[4]),X=new Wc({props:B}),ge.push(()=>be(X,"webgl",se)),ge.push(()=>be(X,"ui",U)),X.$on("drop",Gr(i[34]));function Y(T){i[35](T)}let he={};i[0]!==void 0&&(he.value=i[0]),j=new Ra({props:he}),ge.push(()=>be(j,"value",Y)),Z=new Ye({props:{type:"primary",justifyContent:"flex-start",$$slots:{default:[tv]},$$scope:{ctx:i}}}),Z.$on("click",i[36]),me=new Ye({props:{type:"primary",width:"148px",disablePadding:!0,$$slots:{default:[nv]},$$scope:{ctx:i}}}),me.$on("click",i[37]);function pe(T){i[44](T)}let z={height:"25%",reverse:!0,items:i[0].blocks,$$slots:{default:[av,({item:T})=>({57:T}),({item:T})=>[0,T?67108864:0]]},$$scope:{ctx:i}};return i[1]!==void 0&&(z.active=i[1]),ce=new Wr({props:z}),ge.push(()=>be(ce,"active",pe)),ce.$on("drop",Gr(i[45])),De=new co({props:{layout:"horizontal",tabs:[i[1].content.type==="text"?"Текст":"Изображение","Контейнер","Эффекты","Наложение"].concat(i[11]?["Отладка"]:[]),$$slots:{content:[wv,({tab:T})=>({56:T}),({tab:T})=>[0,T?33554432:0]],default:[dv,({tab:T})=>({56:T}),({tab:T})=>[0,T?33554432:0]]},$$scope:{ctx:i}}}),{c(){e=K("article"),t=K("section"),F(n.$$.fragment),r=re(),F(s.$$.fragment),a=re(),F(l.$$.fragment),u=re(),F(f.$$.fragment),c=re(),F(h.$$.fragment),d=re(),F(p.$$.fragment),m=re(),F(_.$$.fragment),g=re(),b=K("section"),S=K("header"),F(y.$$.fragment),A=re(),F(I.$$.fragment),C=re(),F(H.$$.fragment),Q=re(),R=K("header"),F(X.$$.fragment),W=re(),F(j.$$.fragment),ee=re(),we=K("section"),L=K("header"),F(Z.$$.fragment),Se=re(),F(me.$$.fragment),_e=re(),F(ce.$$.fragment),ze=re(),F(De.$$.fragment),this.h()},l(T){e=J(T,"ARTICLE",{class:!0});var le=te(e);t=J(le,"SECTION",{class:!0});var de=te(t);N(n.$$.fragment,de),r=ie(de),N(s.$$.fragment,de),a=ie(de),N(l.$$.fragment,de),u=ie(de),N(f.$$.fragment,de),c=ie(de),N(h.$$.fragment,de),d=ie(de),N(p.$$.fragment,de),m=ie(de),N(_.$$.fragment,de),de.forEach(k),g=ie(le),b=J(le,"SECTION",{class:!0});var Te=te(b);S=J(Te,"HEADER",{class:!0});var Ve=te(S);N(y.$$.fragment,Ve),A=ie(Ve),N(I.$$.fragment,Ve),C=ie(Ve),N(H.$$.fragment,Ve),Ve.forEach(k),Q=ie(Te),R=J(Te,"HEADER",{class:!0});var Ue=te(R);N(X.$$.fragment,Ue),Ue.forEach(k),W=ie(Te),N(j.$$.fragment,Te),Te.forEach(k),ee=ie(le),we=J(le,"SECTION",{class:!0});var nt=te(we);L=J(nt,"HEADER",{style:!0});var pt=te(L);N(Z.$$.fragment,pt),Se=ie(pt),N(me.$$.fragment,pt),pt.forEach(k),_e=ie(nt),N(ce.$$.fragment,nt),ze=ie(nt),N(De.$$.fragment,nt),nt.forEach(k),le.forEach(k),this.h()},h(){D(t,"class","svelte-1y8uz14"),D(S,"class","controls svelte-1y8uz14"),D(R,"class","canvas svelte-1y8uz14"),D(b,"class","svelte-1y8uz14"),et(L,"display","flex"),D(we,"class","svelte-1y8uz14"),D(e,"class","svelte-1y8uz14")},m(T,le){x(T,e,le),O(e,t),M(n,t,null),O(t,r),M(s,t,null),O(t,a),M(l,t,null),O(t,u),M(f,t,null),O(t,c),M(h,t,null),O(t,d),M(p,t,null),O(t,m),M(_,t,null),O(e,g),O(e,b),O(b,S),M(y,S,null),O(S,A),M(I,S,null),O(S,C),M(H,S,null),O(b,Q),O(b,R),M(X,R,null),O(b,W),M(j,b,null),O(e,ee),O(e,we),O(we,L),M(Z,L,null),O(L,Se),M(me,L,null),O(we,_e),M(ce,we,null),O(we,ze),M(De,we,null),Le=!0},p(T,le){const de={};le[1]&268435456&&(de.$$scope={dirty:le,ctx:T}),n.$set(de);const Te={};le[0]&64&&(Te.items=T[6].frames),le[0]&4|le[1]&469762048&&(Te.$$scope={dirty:le,ctx:T}),!o&&le[0]&1&&(o=!0,Te.active=T[0],ve(()=>o=!1)),s.$set(Te);const Ve={};le[1]&268435456&&(Ve.$$scope={dirty:le,ctx:T}),l.$set(Ve);const Ue={};le[1]&268435456&&(Ue.$$scope={dirty:le,ctx:T}),f.$set(Ue);const nt={};le[1]&268435456&&(nt.$$scope={dirty:le,ctx:T}),h.$set(nt);const pt={};le[1]&268435456&&(pt.$$scope={dirty:le,ctx:T}),p.$set(pt);const wt={};le[0]&128&&(wt.version=T[7]),_.$set(wt);const Xt={};le[1]&268435456&&(Xt.$$scope={dirty:le,ctx:T}),y.$set(Xt);const it={};le[1]&268435456&&(it.$$scope={dirty:le,ctx:T}),I.$set(it);const Yt={};!G&&le[0]&32&&(G=!0,Yt.available=T[5].available,ve(()=>G=!1)),!ne&&le[0]&32&&(ne=!0,Yt.current=T[5].mode,ve(()=>ne=!1)),H.$set(Yt);const on={};!E&&le[0]&8&&(E=!0,on.webgl=T[3],ve(()=>E=!1)),!V&&le[0]&16&&(V=!0,on.ui=T[4],ve(()=>V=!1)),X.$set(on);const At={};!q&&le[0]&1&&(q=!0,At.value=T[0],ve(()=>q=!1)),j.$set(At);const Cn={};le[1]&268435456&&(Cn.$$scope={dirty:le,ctx:T}),Z.$set(Cn);const Xn={};le[1]&268435456&&(Xn.$$scope={dirty:le,ctx:T}),me.$set(Xn);const _n={};le[0]&1&&(_n.items=T[0].blocks),le[0]&1027|le[1]&335544320&&(_n.$$scope={dirty:le,ctx:T}),!Ae&&le[0]&2&&(Ae=!0,_n.active=T[1],ve(()=>Ae=!1)),ce.$set(_n);const Rn={};le[0]&2050&&(Rn.tabs=[T[1].content.type==="text"?"Текст":"Изображение","Контейнер","Эффекты","Наложение"].concat(T[11]?["Отладка"]:[])),le[0]&4611|le[1]&301989888&&(Rn.$$scope={dirty:le,ctx:T}),De.$set(Rn)},i(T){Le||(v(n.$$.fragment,T),v(s.$$.fragment,T),v(l.$$.fragment,T),v(f.$$.fragment,T),v(h.$$.fragment,T),v(p.$$.fragment,T),v(_.$$.fragment,T),v(y.$$.fragment,T),v(I.$$.fragment,T),v(H.$$.fragment,T),v(X.$$.fragment,T),v(j.$$.fragment,T),v(Z.$$.fragment,T),v(me.$$.fragment,T),v(ce.$$.fragment,T),v(De.$$.fragment,T),Le=!0)},o(T){w(n.$$.fragment,T),w(s.$$.fragment,T),w(l.$$.fragment,T),w(f.$$.fragment,T),w(h.$$.fragment,T),w(p.$$.fragment,T),w(_.$$.fragment,T),w(y.$$.fragment,T),w(I.$$.fragment,T),w(H.$$.fragment,T),w(X.$$.fragment,T),w(j.$$.fragment,T),w(Z.$$.fragment,T),w(me.$$.fragment,T),w(ce.$$.fragment,T),w(De.$$.fragment,T),Le=!1},d(T){T&&k(e),P(n),P(s),P(l),P(f),P(h),P(p),P(_),P(y),P(I),P(H),P(X),P(j),P(Z),P(me),P(ce),P(De)}}}function lr(i){i.preventDefault()}function Gr(i){return e=>{var r;e.preventDefault();const t=(r=e.dataTransfer)==null?void 0:r.files;if(!t)return;const n=Array.from(t).filter(s=>{var o;return(o=s.type)==null?void 0:o.match(/^image/)});n.length&&i(n,e)}}function Ev(i,e,t){let{meme:n}=e,{frame:r}=e,{block:s}=e,{previews:o={}}=e,{canvasWebgl:a}=e,{canvasUI:l}=e,{version:u}=e,{memeExampleURL:f}=e,{effectsShaders:c}=e,{editorState:h}=e,{frameDrawer:d}=e,{devMode:p}=e,{textureManager:m}=e;const _=St();function g(T){_("changeBackground",{file:T})}function b(T){var Te,Ve;const le=document.activeElement;if(le instanceof HTMLInputElement||le instanceof HTMLTextAreaElement)return;const de=(Te=T.clipboardData)==null?void 0:Te.items;if(de)for(let Ue=0;Ue(document.addEventListener("paste",b),document.addEventListener("dragover",lr),document.addEventListener("drop",lr),()=>{document.removeEventListener("paste",b),document.removeEventListener("dragover",lr),document.removeEventListener("drop",lr)}));const S=()=>_("createFrame"),y=T=>_("shiftFrame",{frame:T,shift:-1}),A=T=>_("shiftFrame",{frame:T,shift:1}),I=T=>_("deleteFrame",{frame:T}),C=T=>_("createFrame",{origin:T});function H(T,le){i.$$.not_equal(o[le.id],T)&&(o[le.id]=T,t(2,o))}function G(T){r=T,t(0,r)}const ne=T=>_("framesFromImages",{files:T}),Q=()=>_("renderMeme",{meme:n}),R=()=>_("saveMeme",{meme:n}),X=T=>_("openMeme",{file:T.detail[0]}),E=T=>_("importMeme",{file:T.detail[0]}),V=()=>fetch(f).then(T=>T.blob()).then(T=>_("openMeme",{file:T})),W=T=>g(T.detail[0]),j=()=>_("frameToClipboard",{frame:r});function q(T){i.$$.not_equal(h.available,T)&&(h.available=T,t(5,h))}function ee(T){i.$$.not_equal(h.mode,T)&&(h.mode=T,t(5,h))}function we(T){a=T,t(3,a)}function L(T){l=T,t(4,l)}const Z=(T,le)=>_(le.ctrlKey?"createImageBlock":"changeBackground",{file:T[0]});function Se(T){r=T,t(0,r)}const me=()=>_("createTextBlock"),_e=()=>_("createImageBlock",{});function ce(T){i.$$.not_equal(s.content.value.style,T)&&(s.content.value.style=T,t(1,s))}function Ae(T){s=T,t(1,s)}const ze=()=>_("shiftBlock",{block:s,shift:1}),De=()=>_("shiftBlock",{block:s,shift:-1}),Le=()=>_("deleteBlock",{block:s}),Xe=()=>_("cloneBlock",{block:s});function lt(T){s=T,t(1,s)}const at=T=>T.forEach(le=>_("createImageBlock",{file:le}));function $(T){i.$$.not_equal(s.content.value,T)&&(s.content.value=T,t(1,s))}function ue(T){Ie.call(this,i,T)}function se(T){Ie.call(this,i,T)}function U(T){i.$$.not_equal(s.content.value,T)&&(s.content.value=T,t(1,s))}const B=T=>_("modifyImageBlock",{file:T.detail[0],block:s});function Y(T){i.$$.not_equal(s.container,T)&&(s.container=T,t(1,s))}function he(T){i.$$.not_equal(s.effects,T)&&(s.effects=T,t(1,s))}function pe(T){i.$$.not_equal(s.layer,T)&&(s.layer=T,t(1,s))}function z(T){s=T,t(1,s)}return i.$$set=T=>{"meme"in T&&t(6,n=T.meme),"frame"in T&&t(0,r=T.frame),"block"in T&&t(1,s=T.block),"previews"in T&&t(2,o=T.previews),"canvasWebgl"in T&&t(3,a=T.canvasWebgl),"canvasUI"in T&&t(4,l=T.canvasUI),"version"in T&&t(7,u=T.version),"memeExampleURL"in T&&t(8,f=T.memeExampleURL),"effectsShaders"in T&&t(9,c=T.effectsShaders),"editorState"in T&&t(5,h=T.editorState),"frameDrawer"in T&&t(10,d=T.frameDrawer),"devMode"in T&&t(11,p=T.devMode),"textureManager"in T&&t(12,m=T.textureManager)},[r,s,o,a,l,h,n,u,f,c,d,p,m,_,g,S,y,A,I,C,H,G,ne,Q,R,X,E,V,W,j,q,ee,we,L,Z,Se,me,_e,ce,Ae,ze,De,Le,Xe,lt,at,$,ue,se,U,B,Y,he,pe,z]}class kv extends ye{constructor(e){super(),Ee(this,e,Ev,yv,$e,{meme:6,frame:0,block:1,previews:2,canvasWebgl:3,canvasUI:4,version:7,memeExampleURL:8,effectsShaders:9,editorState:5,frameDrawer:10,devMode:11,textureManager:12},null,[-1,-1])}}function hn(i){const e=parseInt(i.slice(1),16);return[(e>>2*8)/255,(e>>8&255)/255,(e&255)/255]}function Sv(i){const e=parseInt(i.slice(1),16);return[e>>2*8,e>>8&255,e&255]}function Av(i,e,t){const n=i.name;let r=e[i.name];r===void 0&&(r=e[i.name]=structuredClone(i.default));const s=i.input;switch(s.type){case"float":t[n]=r;break;case"int":t[n]=r|0;break;case"color":t[n]=hn(r);break;case"angle":t[n]=s.mode==Ri.DEGREE?r:r/180*Math.PI;break;case"point":{const{x:o,y:a}=r;t[n]=[o,a];break}}}class Iv{constructor(e,t,n={drawBaseline:!1,drawLineBorder:!1,drawStencilBorder:!1},r=document.createElement("canvas").getContext("2d")){Ce(this,"cache",new Cv);Ce(this,"ctx");if(this.gl=e,this.textManager=t,this.debugSettings=n,!r)throw new Error("TextStencilService require not null ctx: CanvasRenderingContext2D.");this.ctx=r}tick(){this.cache.tick()}clear(){this.cache.clear(this.gl)}getTextStencil(e,t,n,r,s){const o={text:e,style:t,width:n,height:r,ctx:s},a=this.cache.get(o);if(a)return a;const l=Math.ceil(Math.abs(n)),u=Math.ceil(Math.abs(r)),f=this.textManager.drawTextInfo(e,t,l,u,s),c=this.ctx.canvas;c.height!=u&&(c.height=u),c.width!=l&&(c.width=l),this.ctx.clearRect(0,0,l,u),this.draw(this.ctx,f);const h=this.gl,d=this.cache.expiredTextures.pop()||h.createTexture();if(!d)throw new Error("Failed to create WebGL texture in TextStencilService.");return vi(h,d,c,{wrap:h.CLAMP_TO_EDGE,min:h.LINEAR}),this.cache.set(o,d,f),{stencil:d,info:f}}draw(e,t){e.lineJoin="round",e.miterLimit=2,e.textAlign=t.align,e.textBaseline=t.baseline,e.strokeStyle="#ff0000",e.fillStyle="#00ff00";const n=t.lines;for(let r=0;rr.cacheEquals(e));if(n!==void 0)return n.lastUsage=this.time,n}set(e,t,n){let r=this.table[e.text];r===void 0&&(r=[],this.table[e.text]=r);const s=new Tv(mt(e),t,n);s.lastUsage=this.time,r.push(s)}tick(){for(const e in this.table){const t=this.table[e];for(let n=0;nf);Yo(t,this.backgroundTexture,[...r,n*255]);let s=this.graphics.buffersPull.get(e.width,e.height);const o=this.graphics.buffersPull.get(e.width,e.height);let a=this.graphics.buffersPull.get(e.width,e.height);const l=e.blocks.length,u=l-1;for(let f=0;f(f,c)=>u(c):u=>(f,c)=>{this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,f.framebuffer),this.gl.clear(this.gl.COLOR_BUFFER_BIT),u(f),n.drawModifications(t.effects,l,f,c,!0)})}measureBlock(e,t){const{container:n,content:r}=t,s=this.contentRenderers[r.type];return n.type==="global"?s.measureGlobalRectangle(r.value,e,n.value):n.value}}class Fv{constructor(e){this.textService=e}prepareRectangle(e,t,n){const{text:r,style:s}=e,o=r.split(` +`),a=o.length,l=Math.max(...o.map(_=>_.length)),u=t.width*n.maxWidth,f=t.height*Math.max(n.minHeight,Math.min(n.maxHeight,a*(.175+Math.max(-.05,.03*(2.5-l/10))))),c=this.textService.getTextStencil(r,s,u,f,{frame:t}),h=s.padding,d=f/2+c.info.fontSize*h,p=s.baseline,m=p=="top"?d:p=="middle"?t.height/2:t.height-d;return{textStencil:c,rect:{width:u,height:f,rotation:0,position:{x:t.width/2,y:m}}}}measureGlobalRectangle(e,t,n){return this.prepareRectangle(e,t,n).rect}drawInRectangle(e,t,n,r){const{text:s,style:o}=t,a=this.textService.getTextStencil(s,o,r.width,r.height,{frame:n});return{drawers:this.draw(e,a,r,o),rectangle:r}}drawGlobal(e,t,n,r){const{style:s}=t,{textStencil:o,rect:a}=this.prepareRectangle(t,n,r);return{drawers:this.draw(e,o,a,s),rectangle:a}}draw(e,t,n,r){const s=r.stroke.settings.type!=="disabled",o=r.fill.settings.type!=="disabled",a=+s*1|+o*2,l=new Array;if(s){const u=r.stroke.shadow;u&&l.push(f=>e.drawShadow(t.stencil,1,a,n,r.stroke,u,f)),l.push(f=>e.drawStencilLayer(t.stencil,1,a,n,r.stroke,f))}if(o){const u=r.fill.shadow;u&&l.push(f=>e.drawShadow(t.stencil,2,a,n,r.fill,u,f)),l.push(f=>e.drawStencilLayer(t.stencil,2,a,n,r.fill,f))}return l}}class Nv{constructor(e){this.textures=e}measureGlobalRectangle(e,t,n){return{width:t.width*n.maxWidth,height:t.height*n.maxHeight,position:{x:t.width/2,y:t.height/2},rotation:0}}drawInRectangle(e,t,n,r){const s=this.textures.get(t.id),o=this.cropImage(s,r,t.crop);return{drawers:[a=>e.drawRectImage(s.texture,o.rectangle,o.texCoords,a)],rectangle:r}}drawGlobal(e,t,n,r){const s=this.measureGlobalRectangle(t,n,r);return this.drawInRectangle(e,t,n,s)}cropImage(e,t,n){const r=ht.scale(ht.rotateZ(ht.scale(ht.translation([n.position.x,n.position.y,0]),[1/e.width,1/e.height,1]),n.rotation),[n.width*e.width,n.height*e.height,1]),s=[er.create(0-.5,0-.5),er.create(1-.5,0-.5),er.create(1-.5,1-.5),er.create(0-.5,1-.5)].map(o=>{const a=ht.transformPoint(r,o,o);return{x:a[0],y:a[1]}});return{rectangle:t,texCoords:s}}}function Ba(i,e){if(!e)return 1;if(i===e)return 0;const[t,n,r]=i.split(".").map(l=>Number(l)),[s,o,a]=e.split(".").map(l=>Number(l));return ts?1:no?1:ra?1:0}function Mv(i,e,t){return Ba(i.formatVersion,t)===-1}function wn(i,e,t){return n=>Mv(i,n,e)?t(n):n}function to(i,e){return t=>{if(i!==e)throw new On(`logic error: not enough migrations from '${i}' to '${e}'`);return t}}const Nt=class Nt{static fromFile(e){return new Gn().loadAsync(e).then(n=>{const r=n.file("index.json");return r?r.async("string").then(s=>{const o=JSON.parse(s,(a,l)=>(a==="container"&&l.type==="global"&&(l.value.minHeight=.1),l));if(Ba(this.FormatVersion,o.formatVersion)==-1)throw new On(`application version ${this.FormatVersion} lower than file version ${o.formatVersion}`);return Promise.all([Promise.all(o.resources.images.map(a=>{const l=n.file(this.imageFilepath(a));if(!l)throw new Error(`Not found image with id ${a}`);return l.async("blob").then(u=>({id:a,blob:u}))})),Promise.all((o.resources.patterns||[]).map(a=>{const l=n.file(this.patternFilepath(a));if(!l)throw new Error(`Not found pattern with id ${a}`);return l.async("blob").then(u=>({name:a,blob:u}))}))]).then(([a,l])=>({meme:o.meme,resources:{images:a,patterns:l}})).then(wn(o,"0.2.1",this.fromV0_2_0ToV0_2_1)).then(wn(o,"0.2.2",this.fromV0_2_1ToV0_2_2)).then(wn(o,"0.2.3",this.fromV0_2_2ToV0_2_3)).then(wn(o,"0.2.4",this.fromV0_2_3ToV0_2_4)).then(wn(o,"0.2.5",this.fromV0_2_4ToV0_2_5)).then(wn(o,"0.2.6",this.fromV0_2_5ToV0_2_6)).then(to("0.2.6",this.FormatVersion))}):Nt.zeroVersion(n).then(Nt.fromV0_2_0ToV0_2_1).then(Nt.fromV0_2_1ToV0_2_2).then(Nt.fromV0_2_2ToV0_2_3).then(Nt.fromV0_2_3ToV0_2_4).then(Nt.fromV0_2_4ToV0_2_5).then(Nt.fromV0_2_5ToV0_2_6).then(to("0.2.6",this.FormatVersion))})}static fromV0_2_0ToV0_2_1(e){return{...e,version:"0.2.1",resources:{...e.resources,patterns:[]}}}static fromV0_2_1ToV0_2_2(e){return{...e,version:"0.2.2",meme:{frames:e.meme.frames.map(t=>({...t,blocks:t.blocks.map(n=>({...n,effects:[]}))}))}}}static fromV0_2_2ToV0_2_3(e){return{...e,version:"0.2.3",meme:{frames:e.meme.frames.map(t=>({...t,backgroundColor:"#ffffff",backgroundAlpha:1,blocks:t.blocks.map(n=>({...n,content:n.content.type=="image"?{type:"image",value:{name:"Фон",id:n.content.value.id,crop:{position:{x:.5,y:.5},width:1,height:1,rotation:0}}}:n.content,effects:n.effects.map(r=>{const s=r.settings,o=s.type;return delete s.type,{type:o,settings:s}})}))}))}}}static fromV0_2_3ToV0_2_4(e){return{...e,version:"0.2.4",meme:{frames:e.meme.frames.map(t=>({...t,blocks:t.blocks.map(n=>{if(n.content.type=="text"){const r=n.content.value.style.fill,s=n.content.value.style.stroke;r.shadow&&(r.shadow.saturation=0),s.shadow&&(s.shadow.saturation=0)}return{...n,layer:{blendMode:"normal",composeMode:"source_over",alpha:1}}})}))}}}static fromV0_2_4ToV0_2_5(e){return{...e,version:"0.2.5",meme:{frames:e.meme.frames.map(t=>({...t,blocks:t.blocks.map(n=>n.content.type=="text"?{...n,content:{...n.content,value:{...n.content.value,style:{...n.content.value.style,fontSizeStrategy:"same-height"}}}}:n)}))}}}static fromV0_2_5ToV0_2_6(e){function t(n){if(n.type=="text"){const r=n.value.style.fontSizeStrategy;return{...n,value:{...n.value,style:{...n.value.style,padding:2/9,fontSizeStrategy:{type:r}}}}}return n}return{...e,version:"0.2.6",meme:{frames:e.meme.frames.map(n=>({...n,blocks:n.blocks.map(r=>({...r,content:t(r.content)}))}))}}}static toFile(e){const t=new Gn;e.resources.images.forEach(({id:r,blob:s})=>{t.file(this.imageFilepath(r),s,{binary:!0})}),e.resources.patterns.forEach(({name:r,blob:s})=>{t.file(this.patternFilepath(r),s,{binary:!0})});const n={meme:e.meme,formatVersion:this.FormatVersion,editorVersion:this.EditorVersion,resources:{images:e.resources.images.map(r=>r.id),patterns:e.resources.patterns.map(r=>r.name)}};return t.file("index.json",JSON.stringify(n)),t.generateAsync({type:"blob",compression:"DEFLATE"})}static imageFilepath(e){return`resources/images/${e}.png`}static patternFilepath(e){return`resources/patterns/${e}.png`}static zeroVersion(e){const t=e.file("text.json");if(!t)throw new On("Unknown format");const n=t.comment;return t.async("string").then(r=>{const s=JSON.parse(r),o=e.file(/.*\.png/),a=new Array(o.length);return Promise.all(o.map(l=>l.async("blob").then(u=>{const f=+l.name.substring(0,l.name.length-4);return this.imageSizes(u).then(({width:c,height:h})=>{const d={id:`old-frame-${f}`,blocks:[{id:`old-frame-${f}-background`,container:{type:"global",value:{maxHeight:1,maxWidth:1,minHeight:1}},content:{type:"image",value:{id:l.name}}}],height:h,width:c};a[f]=d}).then(()=>({id:l.name,blob:u}))}))).then(l=>{for(let u=0;u{const p=h.box,m=Gt.mergePartials(Gt.DefaultStyle(),h.style);return{id:`old-frame-${u}-block-${d}`,container:h.main?{type:"global",value:{maxHeight:.4,maxWidth:.9,minHeight:.1}}:{type:"rectangle",value:{height:p.height,width:p.width,position:{x:p.x,y:p.y},rotation:0}},content:{type:"text",value:{text:h.text,style:jr(m,h.main)}}}}));break;case"v0.0.4":c.blocks.push(...f.textContent.map((h,d)=>{const p=h.box,m=Gt.mergePartials(Gt.DefaultStyle(),h.style);return{id:`old-frame-${u}-block-${d}`,container:h.main?{type:"global",value:{maxHeight:.4,minHeight:.1,maxWidth:.9}}:{type:"rectangle",value:{height:p._height,width:p._width,position:{x:p.transform.x,y:p.transform.y},rotation:p.transform.rotate}},content:{type:"text",value:{text:h.text,style:jr(m,h.main)}}}}));break;default:throw new On(`Unexpected legacy version ${n}`)}else{const h=typeof f=="string"?f:f.text,d=typeof f=="string"?Gt.DefaultStyle():f.textContent.style,p={text:h,style:jr(Gt.mergePartials(Gt.DefaultStyle(),d),!0)};c.blocks.push({id:`old-frame-${u}-block-0`,container:{type:"global",value:{maxHeight:.4,maxWidth:.96,minHeight:.1}},content:{type:"text",value:p}})}}return{meme:{frames:a},resources:{images:l}}})})}static imageSizes(e){return zn(e,Eo)}};Ce(Nt,"FormatVersion","0.2.6"),Ce(Nt,"EditorVersion","v0.2.12");let $r=Nt;class On extends Error{constructor(e,t){super(`Unsupported version: ${e}`,{cause:t})}}function jr(i,e){var n;const t=(n=i.shadow)!=null&&n.enabled?{blur:i.shadow.blur,color:i.shadow.color,offset:i.shadow.offset,saturation:0}:void 0;return{align:"center",baseline:e?"bottom":"middle",case:i.case,experimental:{},fill:{alpha:1,shadow:t,settings:no(i.fill)},stroke:{alpha:1,shadow:t,settings:no(i.stroke)},lineSpacing:i.experimental.lineWidthCoefficient*(i.experimental.lineSpacingCoefficient-.5),strokeWidth:i.experimental.lineWidthCoefficient*100,font:i.font}}function no(i){switch(i.type){case"color":return{type:"color",value:i.name};case"pattern":return{type:"pattern",name:i.name,rotate:i.patternSettings.rotate,scale:i.patternSettings.scale,shift:i.patternSettings.shift};case"none":return{type:"disabled"};default:throw new On(`Failed convert old brush ${JSON.stringify(i)} to material settings`)}}var Gt;(i=>{function e(){return{case:"UPPER",fill:{name:"#ffffff",type:"color",patternSettings:{rotate:0,scale:{x:1,y:1},shift:{x:0,y:0}}},stroke:{name:"#000000",type:"color",patternSettings:{rotate:0,scale:{x:1,y:1},shift:{x:0,y:0}}},name:"custom",font:{bold:!1,family:"Impact",italic:!1,smallCaps:!1},shadow:{enabled:!1,color:"#000000",blur:10,offset:{x:0,y:0}},experimental:{lineSpacingCoefficient:.5,lineWidthCoefficient:.1385,interpolationPoint:100}}}i.DefaultStyle=e;function t(r){return r!==null&&typeof r=="object"}function n(r,s){for(const o in r){const a=s[o],l=r[o];t(l)&&(!a||t(a))?s[o]=n(l,a||{}):a===void 0&&(s[o]=l)}return s}i.mergePartials=n})(Gt||(Gt={}));function Pv(i,e){switch(e){case"As is":return i;case"UPPER":return i.toUpperCase();case"lower":return i.toLowerCase()}throw new Error(`Unsupported text case type: ${e}`)}class Da{constructor(e=document.createElement("canvas").getContext("2d")){this.ctx=e}set baseline(e){this.ctx.textBaseline=e}get baseline(){return this.ctx.textBaseline}set align(e){this.ctx.textAlign=e}get align(){return this.ctx.textAlign}measureText(e,t,n){this.ctx.font=Ht(t,n);const r=this.ctx.measureText(e);return{advancedWidth:r.width,width:r.actualBoundingBoxLeft+r.actualBoundingBoxRight,height:r.actualBoundingBoxAscent+r.actualBoundingBoxDescent,boundingBox:{top:r.actualBoundingBoxAscent,bottom:r.actualBoundingBoxDescent,left:r.actualBoundingBoxLeft,right:r.actualBoundingBoxRight}}}}const yr=class yr{constructor(e,t=new Da){Ce(this,"heightMeasuresCache",new Map);this.statistics=e,this.measurer=t,t.baseline="bottom"}drawTextInfo(e,t,n,r,s){const o=Pv(e,t.case).split(` +`),a=t.fontSizeStrategy;switch(a.type){case"same-height":return this.drawLinesSameHeight(o,t.font,t.stroke.settings.type=="disabled"?0:t.strokeWidth/100,t.align,t.baseline,t.lineSpacing,n,r);case"same-width":return this.drawLinesSameWidth(o,t.font,t.stroke.settings.type=="disabled"?0:t.strokeWidth/100,t.align,t.baseline,t.lineSpacing,n,r);case"fixed":return this.drawLinesFixedSize(o,a.unit=="pt"?a.value/72*96:a.value,t.font,t.stroke.settings.type=="disabled"?0:t.strokeWidth/100,t.align,t.baseline,t.lineSpacing,n,r);case"relative":return this.drawLinesFixedSize(o,a.value/100*(a.unit=="vh"?s.frame.height:s.frame.width),t.font,t.stroke.settings.type=="disabled"?0:t.strokeWidth/100,t.align,t.baseline,t.lineSpacing,n,r)}throw new Error(`Unknown font size strategy ${t.fontSizeStrategy}: ${JSON.stringify(t,void 0,2)}`)}fontSize(e,t,n,r,s,o,a=100){if(e<2||t<2)return Math.min(e,t);const l=n.map(d=>{const p=this.measurer.measureText(d,r,a);return{line:d,width:p.width}}).reduce((d,p)=>p.width>d.width?p:d).line,u=this.fillWidthFontSize(e,l,r,s,a),f=n.length,c=t/(f+o*(f-1))/(1+s),h=G0(c,this.statistics.get(r));return Math.min(h,u)}fillWidthFontSize(e,t,n,r,s){const o=r*s,u=(this.measurer.measureText(t,n,s).width+o)/s;return e/u}measureReference(e,t){const n=Ht(e,t),r=this.heightMeasuresCache.get(n);if(r)return r;const s=this.measurer.measureText(yr.MAX_HEIGHT_TEXT_EXAMPLE,e,t);return this.heightMeasuresCache.set(n,s),s}linesHeight(e,t,n){return e*(t+n*(t-1))}drawLinesSameWidth(e,t,n,r,s,o,a,l){let u=a;const f=new Array;this.measurer.align="center";let c=l;do{f.length=0,u=u/c*l,c=0;let p=0;for(let m=0;ml&&l>8&&u>8);const h=s=="top"?0:s=="middle"?(l-c)/2|0:l-c;let d=0;for(let p=0;p 0.f) { + srcA = min(1.0f, srcA / max(0.0001f, 1.f - alpha)); + } else { + srcA *= 1.f + alpha; + } + FragColor = vec4(color, srcA); +}`,Dv=`#version 300 es +precision highp float; +precision highp int; + +uniform sampler2D textureSampler; + +in vec2 texCoord; +out vec4 FragColor; + +void main() { + FragColor = texture(textureSampler, texCoord); +}`,wr=`float channelAlpha(int currentChannel, int channels, vec4 o); + +float fillAlpha(vec4 o) { + return o.g * o.a; +} + +float strokeFullAlpha(vec4 o) { + float a = (1. - fillAlpha(o)); + if(a == 0.0) + return o.a * o.r; + return o.a * o.r / a; +} + +float strokeSimpleAlpha(vec4 o) { + return o.r * o.a; +} + +#define STENCIL_CHANNEL_STROKE 1 +#define STENCIL_CHANNEL_FILL 2 + +float channelAlpha(int currentChannel, int channels, vec4 o) { + if(currentChannel == STENCIL_CHANNEL_FILL) + return fillAlpha(o); + if((channels & STENCIL_CHANNEL_FILL) != 0) + return strokeFullAlpha(o); + return strokeSimpleAlpha(o); +} + +void main();`,za=`#version 300 es +precision highp float; +precision highp int; + +in vec3 position; +in vec2 textureCoordinate; + +uniform mat4 transform; +uniform mat4 camera; + +out vec2 texCoord; +void main() { + gl_Position = camera * transform * vec4(position, 1); + + texCoord = textureCoordinate; +}`,La=`#version 300 es +precision highp float; +precision highp int; + +uniform sampler2D stencilSampler; +uniform float alpha; +uniform int channel; + +in vec2 texCoord; +out vec4 FragColor; + +float channelAlpha(int channel, vec4 o); + +void main() { + vec4 origin = texture(stencilSampler, texCoord); + FragColor = vec4(texCoord, 0, channelAlpha(channel, origin) * alpha); +} +`,zv=`#version 300 es +precision highp float; +precision highp int; + +uniform sampler2D srcSampler; +uniform sampler2D dstSampler; +uniform uint blendMode; +uniform uint composeMode; +uniform float srcAlpha; + +in vec2 texCoord; +out vec4 FragColor; + +// Compositing and Blending Level 2 https://drafts.fxtf.org/compositing/ +const uint BLEND_NORMAL = 0u; +const uint BLEND_MULTIPLY = 1u; +const uint BLEND_SCREEN = 2u; +const uint BLEND_OVERLAY = 3u; +const uint BLEND_DARKEN = 4u; +const uint BLEND_LIGHTEN = 5u; +const uint BLEND_COLOR_DODGE = 6u; +const uint BLEND_COLOR_BURN = 7u; +const uint BLEND_HARD_LIGHT = 8u; +const uint BLEND_SOFT_LIGHT = 9u; +const uint BLEND_DIFFERENCE = 10u; +const uint BLEND_EXCLUSION = 11u; +const uint BLEND_HUE = 12u; +const uint BLEND_SATURATION = 13u; +const uint BLEND_COLOR = 14u; +const uint BLEND_LUMINOSITY = 15u; +// custom +const uint BLEND_XOR = 17u; + +const uint COMPOSE_CLEAR = 0u; +const uint COMPOSE_COPY = 1u; +const uint COMPOSE_DESTINATION = 2u; +const uint COMPOSE_SOURCE_OVER = 3u; +const uint COMPOSE_DESTINATION_OVER = 4u; +const uint COMPOSE_SOURCE_IN = 5u; +const uint COMPOSE_DESTINATION_IN = 6u; +const uint COMPOSE_SOURCE_OUT = 7u; +const uint COMPOSE_DESTINATION_OUT = 8u; +const uint COMPOSE_SOURCE_ATOP = 9u; +const uint COMPOSE_DESTINATION_ATOP = 10u; +const uint COMPOSE_XOR = 11u; +const uint COMPOSE_LIGHTER = 12u; + +vec3 multiply(vec3 src, vec3 dst) { + return src * dst; +} + +vec3 screen(vec3 src, vec3 dst) { + return src + dst - (src * dst); +} + +vec3 hardLight(vec3 src, vec3 dst) { + vec3 m = multiply(2.f * src, dst); + vec3 s = screen(2.f * src - 1.f, dst); + if(src.r > 0.5f) + m.r = s.r; + if(src.g > 0.5f) + m.g = s.g; + if(src.b > 0.5f) + m.b = s.b; + return m; +} + +float channelSoftLight(float s, float b) { + float s2 = 2.f * s; + if(s <= 0.5f) { + return b - (1.f - s2) * b * (1.f - b); + } + float d = 0.f; + if(b <= 0.25f) + d = ((16.f * b - 12.f) * b + 4.f) * b; + else + d = sqrt(b); + + return b + (s2 - 1.f) * (d - b); +} + +bool isEqualColor(float a, float b) { + const float eps = 0.9f / 255.f; + return abs(a - b) <= eps; +} + +float channelColorDodge(float s, float d) { + if(isEqualColor(s, 1.f)) + return 1.f; + return min(1.f, d / (1.f - s)); +} +float channelColorBurn(float s, float d) { + if(isEqualColor(s, 0.f)) + return 0.f; + return 1.f - min(1.f, (1.f - d) / s); +} + +float lum(vec3 c) { + return 0.3f * c.r + 0.59f * c.g + 0.11f * c.b; +} + +vec3 clipColor(vec3 c) { + float l = lum(c); + float n = min(c.r, min(c.g, c.b)); + float x = max(c.r, max(c.g, c.b)); + if(n < 0.f) + c = l + (((c - l) * l) / (l - n)); + if(x > 1.f) + c = l + (((c - l) * (1.f - l)) / (x - l)); + return c; +} + +vec3 setLum(vec3 c, float l) { + float d = l - lum(c); + return clipColor(c + d); +} + +float saturation(vec3 c) { + return max(c.r, max(c.g, c.b)) - min(c.r, min(c.g, c.b)); +} + +vec3 setSat(vec3 c, float s) { + int minI = 0; + int midI = 1; + int maxI = 2; + int tmp = 0; + if(c[minI] > c[midI]) { + tmp = minI; + minI = midI; + midI = tmp; + } + if(c[midI] > c[maxI]) { + tmp = maxI; + maxI = midI; + midI = tmp; + } + if(c[minI] > c[midI]) { + tmp = minI; + minI = midI; + midI = tmp; + } + if(c[maxI] > c[minI]) { + c[midI] = (((c[midI] - c[minI]) * s) / (c[maxI] - c[minI])); + c[maxI] = s; + } else { + c[midI] = c[maxI] = 0.f; + } + c[minI] = 0.f; + return c; +} + +vec3 blend(uint mode, vec3 src, vec3 dst) { + switch(mode) { + case BLEND_XOR: + uint sr = uint(src.r * 255.f); + uint sg = uint(src.g * 255.f); + uint sb = uint(src.b * 255.f); + uint dr = uint(dst.r * 255.f); + uint dg = uint(dst.g * 255.f); + uint db = uint(dst.b * 255.f); + float r = float((sr ^ dr) & 255u) / 255.f; + float g = float((sg ^ dg) & 255u) / 255.f; + float b = float((sb ^ db) & 255u) / 255.f; + return vec3(r, g, b); + case BLEND_MULTIPLY: + return multiply(src.rgb, dst.rgb); + case BLEND_SCREEN: + return screen(src, dst); + case BLEND_OVERLAY: + return hardLight(dst, src); + case BLEND_DARKEN: + return min(src, dst); + case BLEND_LIGHTEN: + return max(src, dst); + case BLEND_COLOR_DODGE: + return vec3(channelColorDodge(src.r, dst.r), channelColorDodge(src.g, dst.g), channelColorDodge(src.b, dst.b)); + case BLEND_COLOR_BURN: + return vec3(channelColorBurn(src.r, dst.r), channelColorBurn(src.g, dst.g), channelColorBurn(src.b, dst.b)); + case BLEND_HARD_LIGHT: + return hardLight(src, dst); + case BLEND_SOFT_LIGHT: + return vec3(channelSoftLight(src.r, dst.r), channelSoftLight(src.g, dst.g), channelSoftLight(src.b, dst.b)); + case BLEND_DIFFERENCE: + return abs(dst - src); + case BLEND_EXCLUSION: + return dst + src - 2.f * dst * src; + case BLEND_HUE: + return setLum(setSat(src, saturation(dst)), lum(dst)); + case BLEND_SATURATION: + return setLum(setSat(dst, saturation(src)), lum(dst)); + case BLEND_COLOR: + return setLum(src, lum(dst)); + case BLEND_LUMINOSITY: + return setLum(dst, lum(src)); + case BLEND_NORMAL: + return src; + default: + return src; + } +} + +vec2 basicPorterDuffCoeffs(uint mode, float as, float ab) { + switch(mode) { + case COMPOSE_CLEAR: + return vec2(0, 0); + case COMPOSE_COPY: + return vec2(1, 0); + case COMPOSE_DESTINATION: + return vec2(0, 1); + case COMPOSE_SOURCE_OVER: + return vec2(1, 1.f - as); + case COMPOSE_DESTINATION_OVER: + return vec2(1.f - ab, 1); + case COMPOSE_SOURCE_IN: + return vec2(ab, 0); + case COMPOSE_DESTINATION_IN: + return vec2(0, as); + case COMPOSE_SOURCE_OUT: + return vec2(1.f - ab, 0); + case COMPOSE_DESTINATION_OUT: + return vec2(0, 1.f - as); + case COMPOSE_SOURCE_ATOP: + return vec2(ab, 1.f - as); + case COMPOSE_DESTINATION_ATOP: + return vec2(1.f - ab, as); + case COMPOSE_XOR: + return vec2(1.f - ab, 1.f - as); + case COMPOSE_LIGHTER: + return vec2(1, 1); + } + return vec2(-1, -1); +} + +vec4 compose(uint mode, vec3 cs, float as, vec3 cb, float ab) { + vec2 fafb = basicPorterDuffCoeffs(mode, as, ab); + float Fa = fafb.x; + float Fb = fafb.y; + float ao = as * Fa + ab * Fb; + return vec4(as * Fa * cs + ab * Fb * cb, ao); +} + +void main() { + vec4 srcColor = texture(srcSampler, texCoord); + srcColor.a *= srcAlpha; + vec4 dstColor = texture(dstSampler, texCoord); + vec3 B = blend(blendMode, srcColor.rgb, dstColor.rgb); + vec3 Cs = (1.f - dstColor.a) * srcColor.rgb + dstColor.a * B; + FragColor = compose(composeMode, Cs, srcColor.a, dstColor.rgb, dstColor.a); +}`;class Lv{constructor(e,t=[{format:e.RGBA}]){Ce(this,"freeBuffers",[]);Ce(this,"usedBuffers",new Set);this.gl=e,this.options=t}get(e,t){const n=this.freeBuffers.pop();if(n)return(n.height!==t||n.width!==e)&&Xg(this.gl,n,this.options,e,t),this.usedBuffers.add(n),this.gl.bindFramebuffer(this.gl.FRAMEBUFFER,n.framebuffer),this.gl.clear(this.gl.COLOR_BUFFER_BIT),n;const r=Zg(this.gl,this.options,e,t);return this.gl.clear(this.gl.COLOR_BUFFER_BIT),this.usedBuffers.add(r),console.log(`Создан новый буфер, всего: ${this.usedBuffers.size}`),r}free(e){if(!this.usedBuffers.delete(e)){console.trace("FrameBuffersPull: free not used buffer!");return}this.freeBuffers.push(e)}clear(){this.freeBuffers.forEach(e=>{this.gl.deleteFramebuffer(e.framebuffer),e.attachments.forEach(t=>{this.gl.isTexture(t)?this.gl.deleteTexture(t):this.gl.deleteRenderbuffer(t)})}),this.freeBuffers=[],this.usedBuffers.size&&console.trace(`FrameBuffersPull: call clear with ${this.usedBuffers.size} buffers in use!`)}}function Uv({vertex:i,fragment:e}){return[i||za,(e||La)+wr]}function Ov({vertex:i,fragment:e}){return[i||ii,(e||La)+wr]}class xv{constructor(e,t,n,r){Ce(this,"shaders");Ce(this,"buffersPull");Ce(this,"shadowProgram");Ce(this,"blendProgram");Ce(this,"imageProgram");Ce(this,"rectangleBuffer");Ce(this,"_canvasRenderBuffer",{framebuffer:null,width:0,height:0});this.gl=e,this.textures=t,e.clearColor(0,0,0,0),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.blendFuncSeparate(e.ONE,e.ONE_MINUS_DST_ALPHA,e.ONE,e.ONE_MINUS_DST_ALPHA);const s=Object.entries(n).map(([a,l])=>[a,Uv(l)]).concat(Object.entries(r).map(([a,l])=>[a,Ov(l)]),[["__shadow__",[ii,Bv+wr]],["__image__",[za,Dv+wr]],["__blend__",[ii,zv]]]),o=Fg(e,Object.fromEntries(s));this.shaders=Object.fromEntries(Object.entries({...n,...r}).map(([a,l])=>[a,{uniforms:(u,f,c)=>{if(l.uniforms)return l.uniforms(u,f,c);if(l.inputs){const h={};for(const d of l.inputs)Av(d,u,h);return h}return{}},info:o[a]}])),this.shadowProgram=o.__shadow__,this.imageProgram=o.__image__,this.blendProgram=o.__blend__,this.rectangleBuffer=Is(e,{position:[[-.5,-.5,0],[.5,-.5,0],[.5,.5,0],[.5,.5,0],[-.5,.5,0],[-.5,-.5,0]].flat(),textureCoordinate:[[0,0],[1,0],[1,1],[1,1],[0,1],[0,0]].flat()}),this.buffersPull=new Lv(this.gl)}get canvasRenderBuffer(){return this._canvasRenderBuffer}get size(){return{width:this.gl.canvas.width,height:this.gl.canvas.height}}clear(){this.buffersPull.clear()}resize(e,t){this.canvasRenderBuffer.width==e&&this.canvasRenderBuffer.height==t||(this.gl.canvas.width=this._canvasRenderBuffer.width=e,this.gl.canvas.height=this._canvasRenderBuffer.height=t,this.gl.viewport(0,0,e,t))}drawImage(e){this.gl.useProgram(this.imageProgram.program),this.imageProgram.uniformSetters.textureSampler(e),this.gl.drawArrays(this.gl.TRIANGLES,0,6)}drawShadow(e,t,n,r,s,o,a){const l=this.gl,u=this.buffersPull.get(a.width,a.height);this.drawStencilLayer(e,t,n,{...r,position:{x:r.position.x+o.offset.x,y:r.position.y+o.offset.y}},s,u);const f={color:hn(o.color),alpha:o.saturation,resolution:[this.size.width,this.size.height],blur:Math.min(o.blur,3600)};l.useProgram(this.shadowProgram.program);const c=this.buffersPull.get(a.width,a.height);l.bindFramebuffer(l.FRAMEBUFFER,c.framebuffer),l.clear(l.COLOR_BUFFER_BIT),fn(this.shadowProgram,{...f,sourceSampler:u.attachments[0],dim:0}),l.drawArrays(l.TRIANGLES,0,6),l.bindFramebuffer(l.FRAMEBUFFER,a.framebuffer),fn(this.shadowProgram,{...f,sourceSampler:c.attachments[0],dim:1}),l.drawArrays(l.TRIANGLES,0,6),this.buffersPull.free(u),this.buffersPull.free(c)}drawStencilLayer(e,t,n,r,s,o){const a=this.gl,l=this.shaders[s.settings.type],u={camera:ht.ortho(0,this.size.width,this.size.height,0,-100,100),transform:ht.scale(ht.rotateZ(ht.translation([r.position.x,r.position.y,0]),r.rotation),[r.width,r.height,1]),stencilSampler:e,channel:t,channels:n,alpha:s.alpha,...l.uniforms(s.settings,r,this)};a.bindFramebuffer(a.FRAMEBUFFER,o.framebuffer),a.useProgram(l.info.program),fn(l.info,u),Or(a,l.info,this.rectangleBuffer),a.drawArrays(a.TRIANGLES,0,6)}drawModifications(e,t,n,r,s){const o=this.gl,a=this.buffersPull.get(r.width,r.height),l=s?n:this.buffersPull.get(r.width,r.height);let u=n,f=a;for(let c=0;ce.has(t))}function Wv(i){return Object.values(i).every(Vv)}function jt(){return{effects:[],layer:{blendMode:"normal",composeMode:"source_over",alpha:1}}}class qv{constructor(e,t,n,r,s,o){Ce(this,"textures");Ce(this,"drawer");Ce(this,"meme",{frames:[]});Ce(this,"activeFrame");Ce(this,"activeBlock");Ce(this,"inUpdate",{meme:!1,frame:!1,block:!1});Ce(this,"gl");Ce(this,"backgroundTasks",new Map);Ce(this,"placeholdersTextures",new Array);Ce(this,"usedImages",new Map);Ce(this,"blockIdGenerator",new yo("v.0.2.0-"+Date.now().toString()+"-"));Ce(this,"setBackground",e=>{const t=new FileReader,n=new Promise((r,s)=>{t.addEventListener("load",()=>r(t.result)),t.addEventListener("error",()=>s(t.error))});t.readAsDataURL(e),this.runTask("Меняем фон",n.then(r=>this.textures.downloadImage(r,{meta:{source:"user",type:"image"}}).then(s=>{let o=this.activeFrame.blocks[0].content.type==="image"&&this.activeFrame.blocks[0].container.type==="global"?this.activeFrame.blocks[0]:null;if(o){const a=this.activeFrame.blocks[0].content.value;this.removeImageUsage(this.activeFrame.blocks[0]),o.content={type:"image",value:{name:a.name,id:s.id,crop:{position:{x:.5,y:.5},height:1,rotation:0,width:1}}}}else o={...jt(),id:this.blockIdGenerator.generate(),container:{type:"global",value:{maxHeight:1,maxWidth:1,minHeight:1}},content:{type:"image",value:{name:"Фон",id:s.id,crop:{position:{x:.5,y:.5},height:1,rotation:0,width:1}}}},this.activeFrame.blocks.unshift(o);this.activeFrame.width=s.width,this.activeFrame.height=s.height,this.addImageUsage(o),this.frameUpdated()})))});Ce(this,"drawPreviewAsync",Xv(e=>{this.drawer.drawFrame(e),this.drawPreview(e)},250));Ce(this,"zipCanvas",document.createElement("canvas"));Ce(this,"zipCtx",this.zipCanvas.getContext("2d"));this.stores=e;const a=t.getContext("webgl2",{premultipliedAlpha:!1});if(!a)throw new Error("Failed to create WebGL2 context!");this.gl=a,this.textures=new Kg(a);const l=q0(),u=new xv(a,this.textures,o.materials,o.effects);this.drawer=new Rv(a,this.textures,new ri(l.store),u),this.runTask("Загрузка ресурсов",Promise.all(n.map(({name:c,url:h})=>this.textures.downloadImage(h,{id:c,wrap:a.REPEAT,meta:{source:"default",type:"pattern"}}).then(d=>[c,d]))).then(c=>c.map(([h,d])=>({name:h,textureId:d.id}))).then(c=>Ct.addPattern(...c))),this.runTask("Загрузка шрифтов",X0()),this.runTask("Загрузка метрик шрифтов",l.then),this.runTask("Загрузка плейсхолдеров",Promise.all(Object.entries(r).map(([c,{empty:h}])=>Promise.all(h.map(({name:d,url:p})=>this.textures.downloadImage(p,{id:`placeholder-${c}-${d}`,meta:{source:"default",type:"image"}}))).then(d=>[c,d]))).then(Object.fromEntries).then(c=>this.placeholdersTextures=c[s]??c.default).then(()=>this.deleteFrame(this.activeFrame)).then(()=>this.draw(this.activeFrame,!0)));const f=Zv(()=>this.draw());e.meme.subscribe(c=>{this.inUpdate.meme||(this.meme=c)}),e.frame.subscribe(c=>{f(),!this.inUpdate.frame&&(this.activeFrame=c)}),e.block.subscribe(c=>{f(),!this.inUpdate.block&&(this.activeBlock=c)})}get busy(){return this.backgroundTasks.size!=0}get currentTask(){return this.busy?this.backgroundTasks.values().next().value:""}runTask(e,t){return this.backgroundTasks.set(t,e),this.stores.busy.set(this.currentTask),t.catch(n=>{throw this.stores.error.set(n),n}),t.finally(()=>{this.backgroundTasks.delete(t),this.stores.busy.set(this.currentTask)}),t}addImageUsage(e){if(e.content.type!="image")return;const t=e.content.value.id;if(this.textures.get(t).meta.source=="default")return;let r=this.usedImages.get(t);r||this.usedImages.set(t,r=new Set),r.add(e)}removeImageUsage(e){if(e.content.type!="image")return;const t=e.content.value.id;if(this.textures.get(t).meta.source=="default")return;const r=this.usedImages.get(t);r&&(r.delete(e),r.size==0&&this.textures.delete(t))}memeUpdated(){this.inUpdate.meme=!0,this.stores.meme.set(this.meme),this.inUpdate.meme=!1}frameUpdated(){this.inUpdate.frame=!0,this.stores.frame.set(this.activeFrame),this.inUpdate.frame=!1}blockUpdated(){this.inUpdate.block=!0,this.stores.block.set(this.activeBlock),this.inUpdate.block=!1}shiftBlock(e,t){const n=this.activeFrame.blocks,r=n.indexOf(e),s=r+t;s<0||n.length<=s||(n[r]=n[s],n[s]=e,this.frameUpdated())}shiftFrame(e,t){const n=this.meme.frames,r=n.indexOf(e),s=r+t;s<0||n.length<=s||(n[r]=n[s],n[s]=e,this.memeUpdated())}cloneBlock(e){const t=mt(e);t.id=this.blockIdGenerator.generate(),this.addBlock(t)}addBlock(e){this.addImageUsage(e),this.activeFrame.blocks.push(e),this.frameUpdated(),this.activeBlock=e,this.blockUpdated()}addTextBlock(e=this.activeBlock){e.content.type!=="text"&&(e=this.activeFrame.blocks.find(n=>n.content.type==="text")||{...jt(),id:this.blockIdGenerator.generate(),container:{type:"global",value:{maxWidth:.9,maxHeight:.4,minHeight:0}},content:{type:"text",value:{text:"",style:mr}}}),e=mt(e),e.id=this.blockIdGenerator.generate(),e.content.type==="text"&&(e.content.value.text="Текст",e.container.type==="global"&&(e.content.value.style.baseline="middle",e.content.value.style.align="center"));const t=this.activeFrame;e.container={type:"rectangle",value:{width:t.width*.5|0,height:t.height*.5|0,position:{x:t.width*.5|0,y:t.height*.5|0},rotation:0}},this.addBlock(e)}newImageBlock(e,t){const n=this.activeFrame;let r=t.width,s=t.height;const o=r/s;r>n.width*.6&&(r=n.width*.6,s=r/o),s>n.height*.6&&(s=n.height*.6,r=s*o);const a={...jt(),id:this.blockIdGenerator.generate(),container:{type:"rectangle",value:{height:s,width:r,position:{x:n.width/2,y:n.height/2},rotation:0}},content:{type:"image",value:{name:e,id:t.id,crop:{position:{x:.5,y:.5},height:1,rotation:0,width:1}}}};this.addBlock(a)}addImageBlock(e){if(!e){this.newImageBlock("Картинка",this.placeholdersTextures[Math.floor(Math.random()*this.placeholdersTextures.length)]);return}const t=new FileReader,n=new Promise((r,s)=>{t.addEventListener("load",()=>r(t.result)),t.addEventListener("error",()=>s(t.error))});t.readAsDataURL(e),this.runTask("Создаём блок с картинкой",n.then(r=>this.textures.downloadImage(r,{meta:{source:"user",type:"image"}}).then(s=>{const o=this.activeFrame;let a=s.width,l=s.height;const u=a/l;a>o.width*.6&&(a=o.width*.6,l=a/u),l>o.height*.6&&(l=o.height*.6,a=l*u);const f={...jt(),id:this.blockIdGenerator.generate(),container:{type:"rectangle",value:{height:l,width:a,position:{x:o.width/2,y:o.height/2},rotation:0}},content:{type:"image",value:{name:e.name,id:s.id,crop:{position:{x:.5,y:.5},height:1,rotation:0,width:1}}}};this.addImageUsage(f),this.activeFrame.blocks.push(f),this.frameUpdated(),this.activeBlock=f,this.blockUpdated()})))}modifyImageBlock(e,t){const n=e.content;if(n.type==="text"||e===this.activeFrame.blocks[0]){this.setBackground(t);return}const r=new FileReader,s=new Promise((o,a)=>{r.addEventListener("load",()=>o(r.result)),r.addEventListener("error",()=>a(r.error))});r.readAsDataURL(t),this.runTask("Меняем картинку",s.then(o=>{this.textures.downloadImage(o,{meta:{source:"user",type:"image"}}).then(a=>{const l=n.value;this.removeImageUsage(e),l.id=a.id,this.addImageUsage(e);const u=e.container;if(u.type==="rectangle"){const f=this.activeFrame;let c=a.width,h=a.height;const d=c/h;c>f.width&&(c=f.width,h=c/d),h>f.height&&(h=f.height,c=h*d),u.value.height=h,u.value.width=c}this.frameUpdated()})}))}newFrame(e){var n,r;const t={...mt(((r=(n=this.activeBlock)==null?void 0:n.content)==null?void 0:r.type)==="text"?this.activeBlock.content.value.style:mr),baseline:"bottom"};return{id:this.blockIdGenerator.generate(),blocks:[{...jt(),id:this.blockIdGenerator.generate(),container:{type:"global",value:{maxHeight:1,maxWidth:1,minHeight:1}},content:{type:"image",value:{name:"Фон",id:e.id,crop:{position:{x:.5,y:.5},height:1,rotation:0,width:1}}}},{...jt(),id:this.blockIdGenerator.generate(),container:{type:"global",value:{maxWidth:.9,maxHeight:.4,minHeight:0}},content:{type:"text",value:{text:"",style:t}}}],height:e.height,width:e.width,backgroundAlpha:1,backgroundColor:"#ffffff"}}copyFrame(e){const t=mt(e);return t.id=this.blockIdGenerator.generate(),e.blocks.forEach(n=>n.id=this.blockIdGenerator.generate()),t}addFrame(e){const t=e?this.copyFrame(e):this.newFrame(this.placeholdersTextures[Math.floor(Math.random()*this.placeholdersTextures.length)]);let n=this.meme.frames.length;if(n){const r=this.meme.frames.findIndex(s=>s===this.activeFrame);r!=-1&&(n=r+1)}return this.meme.frames.splice(n,0,t),this.activeFrame=t,t.blocks.forEach(r=>this.addImageUsage(r)),this.memeUpdated(),this.frameUpdated(),t}deleteBlock(e){const t=this.activeFrame.blocks.indexOf(e);if(e.id==this.activeBlock.id){const n=t==this.activeFrame.blocks.length-1?t-1:t+1,r=this.activeFrame.blocks[n];this.activeFrame.blocks.splice(t,1),r?(this.activeBlock=r,this.blockUpdated()):this.addTextBlock()}else this.activeFrame.blocks.splice(t,1);this.removeImageUsage(e),this.frameUpdated()}deleteFrame(e){const t=this.meme.frames.indexOf(e);if(e.id==this.activeFrame.id){const n=t==this.meme.frames.length-1?t-1:t+1;n>=0?(this.activeFrame=this.meme.frames[n],this.frameUpdated()):this.addFrame()}this.meme.frames.splice(t,1),e.blocks.forEach(n=>this.removeImageUsage(n)),this.memeUpdated()}copyFrameToClipboard(){return this.runTask("Копируем",this.frameBlob(this.activeFrame).then(e=>Yv(e)))}frameBlob(e){return this.drawer.drawFrame(e),Hr(this.gl.canvas)}drawPreview(e){var t,n;(n=(t=this.stores.previews.value)[e.id])==null||n.call(t,this.gl.canvas)}draw(e=this.activeFrame,t=!1){this.busy&&!t||(this.drawer.drawFrame(e),t?this.drawPreview(e):this.drawPreviewAsync(e))}renderMeme(){return this.runTask("Пакуем мем",Promise.all(this.meme.frames.map(e=>this.frameBlob(e))).then(e=>{if(this.drawer.drawFrame(this.activeFrame),e.length==1)return{ext:"png",blob:e[0]};const t=new Gn,n=e.length.toString().length;return e.forEach((r,s)=>{t.file(`${(s+1).toString().padStart(n,"0")}.png`,r,{binary:!0})}),t.generateAsync({type:"blob"}).then(r=>({ext:"zip",blob:r}))}))}getImagesList(e=this.meme){return Array.from(new Set(e.frames.flatMap(t=>t.blocks.map(n=>n.content).map(n=>n.type=="image"?this.textures.get(n.value.id):"").filter(n=>n&&n.meta.source=="user"&&n.meta.type=="image"))))}getPatternsList(e=this.meme){return Array.from(new Set(e.frames.flatMap(t=>t.blocks.map(n=>n.content).flatMap(n=>{if(n.type!="text")return[];const r=[],s=n.value.style;return s.fill.settings.type=="pattern"&&r.push(s.fill.settings.name),s.stroke.settings.type=="pattern"&&r.push(s.stroke.settings.name),r}).filter(n=>n)))).map(t=>({name:t,texture:this.textures.get(Ct.getTexture(t))})).filter(({texture:t})=>t.meta.source=="user")}exportMeme(){const e=this.getImagesList(),t=this.getPatternsList();return this.runTask("Пакуем мем",Promise.all([Promise.all(e.map(n=>(this.zipCanvas.width=n.width,this.zipCanvas.height=n.height,this.zipCtx.drawImage(n.original,0,0),Hr(this.zipCanvas).then(r=>({id:n.id,blob:r}))))),Promise.all(t.map(({name:n,texture:r})=>(this.zipCanvas.width=r.width,this.zipCanvas.height=r.height,this.zipCtx.drawImage(r.original,0,0),Hr(this.zipCanvas).then(s=>({name:n,blob:s})))))]).then(([n,r])=>$r.toFile({meme:this.meme,resources:{images:n,patterns:r}})))}openMeme(e){return this.importMeme(e,"replace","replace")}importMeme(e,t,n){const r=new Map,s=new Map;return this.runTask("Распаковываем мем",$r.fromFile(e).then(o=>(n=="replace"&&(this.getImagesList().forEach(a=>this.textures.delete(a.id)),this.usedImages.clear()),Promise.all(o.resources.images.map(({id:a,blob:l})=>zn(l,u=>this.textures.downloadImage(u,{meta:{source:"user",type:"image"}}).then(f=>{r.set(a,f.id)}))).concat(o.resources.patterns.map(({name:a,blob:l})=>zn(l,u=>{if(Ct.has(a))switch(t){case"replace":{this.textures.delete(Ct.getTexture(a)),Ct.delete(a);break}case"add":{let f=0,c=a,h=a;const d=/\((\d+)\)$/.exec(a);d&&(f=+d[1],h=a.substring(0,d.index));do c=`${h}(${++f})`;while(Ct.has(c));s.set(a,c),a=c;break}}return this.textures.downloadImage(u,{meta:{source:"user",type:"pattern"}}).then(f=>Ct.addPattern({name:a,textureId:f.id}))})))).then(()=>{o.meme.frames.forEach(l=>{l.id=this.blockIdGenerator.generate(),l.blocks.forEach(u=>{u.id=this.blockIdGenerator.generate();const f=u.content;switch(f.type){case"image":{const c=r.get(f.value.id);c&&(f.value.id=c),this.addImageUsage(u);break}case"text":{const c=[f.value.style.stroke.settings,f.value.style.fill.settings];for(const h of c){if(h.type!=="pattern")continue;const d=s.get(h.name);d&&(h.name=d)}}}})});let a=this.meme.frames.length;switch(n){case"replace":this.meme.frames=[],a=0;case"append":this.meme.frames.push(...o.meme.frames);break}return this.activeFrame=this.meme.frames[a],this.memeUpdated(),this.frameUpdated(),Vr()}).then(()=>{this.meme.frames.forEach(a=>this.draw(a,!0)),this.draw()}))))}framesFromImages(e){return this.runTask("Загружаем картинки",Promise.all(e.map(t=>zn(t,n=>this.textures.downloadImage(n,{meta:{source:"user",type:"image"}})))).then(t=>t.map(n=>this.addFrame(this.newFrame(n)))).then(t=>Vr().then(()=>t)).then(t=>{t.forEach(n=>this.draw(n,!0))}))}addPattern(e,t){return this.runTask("Добавляем паттерн",zn(t,n=>this.textures.downloadImage(n,{meta:{source:"user",type:"pattern"}})).then(n=>{const r={name:e,textureId:n.id};return Ct.addPattern(r),r})).then(()=>this.draw(this.activeFrame))}clear(){Ct.clear(),this.textures.clear(),this.usedImages.clear(),this.drawer.clear()}}function Zv(i){let e=0;return(...t)=>{e||(e=requestAnimationFrame(()=>{e=0,i.apply(void 0,t)}))}}function Xv(i,e){let t=0;return(...n)=>{t&&clearTimeout(t),t=setTimeout(()=>{t=0,i.apply(void 0,n)},e)}}function Hr(i){return new Promise((e,t)=>i.toBlob(n=>{if(!n){t(new Error("Failed to get blob from canvas"));return}e(n)}))}class Ua extends Error{constructor(e,t){super(e),this.blob=t}}function Yv(i){return window.ClipboardItem?window.navigator.clipboard.write([new ClipboardItem({[i.type]:i})]):Promise.reject(new Ua("Ваш браузер не поддерживает копирование изображений из скриптов.",i))}function Kv(i){let e;return{c(){e=oe("Фрейм с вариациями шрифта")},l(t){e=ae(t,"Фрейм с вариациями шрифта")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function Jv(i){let e;return{c(){e=oe("Фреймы для всех шрифтов")},l(t){e=ae(t,"Фреймы для всех шрифтов")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function Qv(i){let e;return{c(){e=oe("Фрейм со шрифтами")},l(t){e=ae(t,"Фрейм со шрифтами")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function e$(i){let e;return{c(){e=oe("Фрейм с пресетами")},l(t){e=ae(t,"Фрейм с пресетами")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function t$(i){let e;return{c(){e=oe("Сгенерировать данные для шрифта")},l(t){e=ae(t,"Сгенерировать данные для шрифта")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function n$(i){let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b,S,y,A,I,C,H,G;n=new Ye({props:{type:"primary",$$slots:{default:[Kv]},$$scope:{ctx:i}}}),n.$on("click",i[10]),s=new Ye({props:{type:"primary",$$slots:{default:[Jv]},$$scope:{ctx:i}}}),s.$on("click",i[11]),l=new Ye({props:{type:"primary",$$slots:{default:[Qv]},$$scope:{ctx:i}}}),l.$on("click",i[6]),f=new Ye({props:{type:"primary",$$slots:{default:[e$]},$$scope:{ctx:i}}}),f.$on("click",i[7]);function ne(W){i[12](W)}let Q={};i[2]!==void 0&&(Q.value=i[2]),m=new Ke({props:Q}),ge.push(()=>be(m,"value",ne));function R(W){i[13](W)}let X={};i[1]!==void 0&&(X.value=i[1]),b=new Ra({props:X}),ge.push(()=>be(b,"value",R));function E(W){i[14](W)}let V={container:i[8]};return i[0]!==void 0&&(V.content=i[0]),A=new wo({props:V}),ge.push(()=>be(A,"content",E)),H=new Ye({props:{type:"danger",$$slots:{default:[t$]},$$scope:{ctx:i}}}),H.$on("click",i[4]),{c(){e=K("article"),t=K("section"),F(n.$$.fragment),r=re(),F(s.$$.fragment),o=re(),a=K("section"),F(l.$$.fragment),u=re(),F(f.$$.fragment),c=re(),h=K("section"),d=K("section"),p=oe("Колонки: "),F(m.$$.fragment),g=re(),F(b.$$.fragment),y=re(),F(A.$$.fragment),C=re(),F(H.$$.fragment),this.h()},l(W){e=J(W,"ARTICLE",{});var j=te(e);t=J(j,"SECTION",{class:!0});var q=te(t);N(n.$$.fragment,q),r=ie(q),N(s.$$.fragment,q),q.forEach(k),o=ie(j),a=J(j,"SECTION",{class:!0});var ee=te(a);N(l.$$.fragment,ee),u=ie(ee),N(f.$$.fragment,ee),ee.forEach(k),c=ie(j),h=J(j,"SECTION",{class:!0});var we=te(h);d=J(we,"SECTION",{class:!0});var L=te(d);p=ae(L,"Колонки: "),N(m.$$.fragment,L),L.forEach(k),g=ie(we),N(b.$$.fragment,we),we.forEach(k),y=ie(j),N(A.$$.fragment,j),C=ie(j),N(H.$$.fragment,j),j.forEach(k),this.h()},h(){D(t,"class","svelte-jgdons"),D(a,"class","svelte-jgdons"),D(d,"class","svelte-jgdons"),D(h,"class","svelte-jgdons")},m(W,j){x(W,e,j),O(e,t),M(n,t,null),O(t,r),M(s,t,null),O(e,o),O(e,a),M(l,a,null),O(a,u),M(f,a,null),O(e,c),O(e,h),O(h,d),O(d,p),M(m,d,null),O(h,g),M(b,h,null),O(e,y),M(A,e,null),O(e,C),M(H,e,null),G=!0},p(W,[j]){const q={};j&262144&&(q.$$scope={dirty:j,ctx:W}),n.$set(q);const ee={};j&262144&&(ee.$$scope={dirty:j,ctx:W}),s.$set(ee);const we={};j&262144&&(we.$$scope={dirty:j,ctx:W}),l.$set(we);const L={};j&262144&&(L.$$scope={dirty:j,ctx:W}),f.$set(L);const Z={};!_&&j&4&&(_=!0,Z.value=W[2],ve(()=>_=!1)),m.$set(Z);const Se={};!S&&j&2&&(S=!0,Se.value=W[1],ve(()=>S=!1)),b.$set(Se);const me={};!I&&j&1&&(I=!0,me.content=W[0],ve(()=>I=!1)),A.$set(me);const _e={};j&262144&&(_e.$$scope={dirty:j,ctx:W}),H.$set(_e)},i(W){G||(v(n.$$.fragment,W),v(s.$$.fragment,W),v(l.$$.fragment,W),v(f.$$.fragment,W),v(m.$$.fragment,W),v(b.$$.fragment,W),v(A.$$.fragment,W),v(H.$$.fragment,W),G=!0)},o(W){w(n.$$.fragment,W),w(s.$$.fragment,W),w(l.$$.fragment,W),w(f.$$.fragment,W),w(m.$$.fragment,W),w(b.$$.fragment,W),w(A.$$.fragment,W),w(H.$$.fragment,W),G=!1},d(W){W&&k(e),P(n),P(s),P(l),P(f),P(m),P(b),P(A),P(H)}}}function r$(i,e,t){let n,r;yt(i,bo,A=>t(16,n=A)),yt(i,$o,A=>t(3,r=A));let{memaker:s}=e,o={text:`Широкая электрификация южных губерний +даст мощный толчок подъёму сельского хозяйства.`,style:mt(mr)},a={id:"placeholer",backgroundAlpha:1,backgroundColor:"#ffffff",height:1080,width:1920,blocks:[]},l,u=2;function f(){l||(l=new Da);const A=o.style.font.family;Y0(l,A).then(qr(`${A}.zip`))}function c(A,I,C,H,G=I*C){s.addFrame(A);const ne=A.width,R=A.height/I,X=ne/C;for(let E=0;E{const ne=I[G],Q=`${Er(ne).replaceAll("_"," ")} +${o.text}`;return{...jt(),id:"placeholder",container:H,content:{type:"text",value:{text:Q,style:{...mt(o.style),font:ne}}}}},I.length)}function d(){const A=r.length,I=Math.ceil(A/u);c(mt(a),I,u,(C,H)=>{const G=r[H],ne=`${G} +${o.text}`;return{...jt(),id:"placeholder",container:C,content:{type:"text",value:{text:ne,style:{...mt(o.style),font:{...mt(o.style.font),family:G}}}}}},A)}function p(){const A=n.length,I=Math.ceil(A/u);c(mt(a),I,u,(C,H)=>{const G=n[H],ne=`${G.name} +${o.text}`;return{...jt(),id:"placeholder",container:C,content:{type:"text",value:{text:ne,style:go(G,mt(o.style))}}}},A)}const m={type:"rectangle",value:{height:64,width:64,position:{x:32,y:32},rotation:0}},_=()=>h(),g=()=>r.forEach(A=>h(A));function b(A){u=A,t(2,u)}function S(A){a=A,t(1,a)}function y(A){o=A,t(0,o)}return i.$$set=A=>{"memaker"in A&&t(9,s=A.memaker)},[o,a,u,r,f,h,d,p,m,s,_,g,b,S,y]}class i$ extends ye{constructor(e){super(),Ee(this,e,r$,n$,$e,{memaker:9})}}function s$(i){let e,t,n;const r=i[2].default,s=Fe(r,i,i[1],null);return{c(){e=K("div"),s&&s.c(),this.h()},l(o){e=J(o,"DIV",{style:!0,class:!0});var a=te(e);s&&s.l(a),a.forEach(k),this.h()},h(){D(e,"style",t=ro(i[0])),D(e,"class","svelte-18sulqr")},m(o,a){x(o,e,a),s&&s.m(e,null),n=!0},p(o,[a]){s&&s.p&&(!n||a&2)&&Ne(s,r,o,o[1],n?Pe(r,o[1],a,null):Me(o[1]),null),(!n||a&1&&t!==(t=ro(o[0])))&&D(e,"style",t)},i(o){n||(v(s,o),n=!0)},o(o){w(s,o),n=!1},d(o){o&&k(e),s&&s.d(o)}}}function ro(i){return Object.entries(i).map(([e,t])=>`--${e.split(new RegExp("(?<=[a-z])(?=[A-Z])")).map(r=>r.toLowerCase()).join("-")}: ${t};`).join("")}function o$(i,e,t){let{$$slots:n={},$$scope:r}=e,{theme:s}=e;return i.$$set=o=>{"theme"in o&&t(0,s=o.theme),"$$scope"in o&&t(1,r=o.$$scope)},[s,r,n]}class a$ extends ye{constructor(e){super(),Ee(this,e,o$,s$,$e,{theme:0})}}const l$={textSecondary:"white",secondary:"#34352F",secondaryHover:"#3E3D32",secondaryActive:"#272822",borderSecondary:"1px solid #111111",borderSecondaryHover:"1px solid #222222",borderSecondaryActive:"1px solid #aaaaaa",border:"none",textError:"#ff0000"},io=xn(l$),u$=`#version 300 es +precision mediump float; +precision mediump int; + +uniform sampler2D layer; +uniform float brightness; +uniform float contrast; + +in vec2 texCoord; +out vec4 FragColor; + +#define PI 3.1415926 + +void main() { + vec4 color = texture(layer, texCoord); + color.rgb += brightness - 0.5; + if(contrast > 0.0) + color.rgb /= (1.0 - contrast); + else + color.rgb *= (1.0 + contrast); + color.rgb += 0.5; + + FragColor = color; +} +`,f$={title:"Яркость и контраст",fragment:u$,inputs:[{name:"brightness",title:"Яркость",default:0,input:{type:"float",min:-1,max:1,step:.05,layout:kt.RANGE}},{name:"contrast",title:"Контраст",default:0,input:{type:"float",min:-1,max:1,step:.05,layout:kt.RANGE}}]},c$=`#version 300 es +precision mediump float; +precision mediump int; + +uniform sampler2D layer; +uniform vec2 resolution; +uniform float radius; +uniform float strength; +uniform vec2 center; + +in vec2 texCoord; +out vec4 FragColor; + +#define PI 3.1415926 + +void main() { + vec2 coord = gl_FragCoord.xy; + vec2 center = vec2(center.x, resolution.y - center.y); + coord -= center; + float distance = length(coord); + float percent = distance / radius; + coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75); + coord += center; + FragColor = texture(layer, coord / resolution); +} +`,h$={title:"Выпуклость",fragment:c$,inputs:[{name:"strength",default:.5,title:"Сила",input:{type:"float",min:0,max:1.5,step:.05,layout:kt.RANGE}},{name:"radius",default:50,title:"Радиус",input:{type:"float",min:0,step:1}},{name:"center",default:{type:"frame",value:{x:.5,y:.5}},title:"Центр",input:{type:"point",color:"#0fff00"}}]},m$=`#version 300 es +precision mediump float; +precision mediump int; + +uniform sampler2D layer; +in vec2 texCoord; +out vec4 FragColor; + +#define PI 3.1415926 + +void main() { + vec4 color = texture(layer, texCoord); + float value = 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b; + FragColor = vec4(value, value, value, color.a); +} +`,d$=`#version 300 es +precision mediump float; +precision mediump int; + +uniform sampler2D layer; +uniform vec2 resolution; +uniform float radius; +uniform float minAlpha; +uniform float maxAlpha; + +in vec2 texCoord; +out vec4 FragColor; + +#define PI 3.1415926 + +float rand(vec2 co, float step) { + return fract(cos(dot(co * step, vec2(15.2851, 18.435))) * 74687.84583); +} + +void main() { + // texCoord 0..1 + float sx = (rand(texCoord, 1.)); + float sy = (rand(texCoord, 2.)); + vec2 shift = vec2(sx, sy) * 2. - vec2(1); + shift *= vec2(radius / resolution); + vec4 origin = texture(layer, texCoord); + origin += texture(layer, texCoord + shift); + origin /= 2.; + float rnd = rand(texCoord, 3.); + FragColor = vec4(origin.rgb, origin.a * clamp(rnd, minAlpha, maxAlpha)); +} +`,p$=[{name:"radius",title:"Радиус",description:"Радиус разброса пикселей",default:10,input:{type:"float",min:0,step:1}},{name:"minAlpha",title:"Минимальный альфа-канал",default:.5,input:{type:"float",min:0,max:1,step:.05,layout:kt.RANGE}},{name:"maxAlpha",title:"Максимальный альфа-канал",default:1,input:{type:"float",min:0,max:1,step:.05,layout:kt.RANGE}}],_$={title:"Шум",fragment:d$,inputs:p$},g$=`#version 300 es +precision mediump float; +precision mediump int; + +uniform sampler2D layer; +uniform vec2 resolution; +uniform float radius; +uniform float strength; +uniform vec2 center; + +in vec2 texCoord; +out vec4 FragColor; + +#define PI 3.1415926 + +void main() { + vec2 coord = gl_FragCoord.xy; + vec2 center = vec2(center.x, resolution.y - center.y); + coord -= center; + float distance = length(coord); + float percent = distance / radius; + if(percent <= 1.0) + coord *= mix(1.0, pow(percent, 1.0 - strength * 0.75) * radius / distance, 1.0 - percent); + coord += center; + FragColor = texture(layer, coord / resolution); +} +`,b$=[{name:"strength",default:.5,title:"Сила",input:{type:"float",min:0,max:1.5,step:.05,layout:kt.RANGE}},{name:"radius",default:50,title:"Радиус",input:{type:"float",min:0,step:1}},{name:"center",default:{type:"frame",value:{x:.5,y:.5}},title:"Центр",input:{type:"point",color:"#ff00ff"}}],v$={title:"Вогнутость",fragment:g$,inputs:b$},$$=`#version 300 es +precision mediump float; +precision mediump int; + +uniform sampler2D layer; +uniform vec2 resolution; +uniform float radius; +uniform float angle; +uniform vec2 center; + +in vec2 texCoord; +out vec4 FragColor; + +#define PI 3.1415926 + +void main() { + vec2 coord = gl_FragCoord.xy; + vec2 center = vec2(center.x, resolution.y - center.y); + coord -= center; + float distance = length(coord); + if(distance < radius) { + float percent = (radius - distance) / radius; + float theta = percent * percent * angle; + float s = sin(theta); + float c = cos(theta); + coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c); + } + coord += center; + FragColor = texture(layer, coord / resolution); +} +`,w$={title:"Закрученность",fragment:$$,inputs:[{name:"angle",title:"Угол",default:180,input:{type:"angle",mode:Ri.RADIAN,step:.5}},{name:"radius",title:"Радиус",default:50,input:{type:"float",min:0,step:1}},{name:"center",title:"Центр",default:{type:"frame",value:{x:.5,y:.5}},input:{type:"point",color:"#0aaaa0"}}]},y$=`#version 300 es + +precision mediump float; +precision mediump int; + +uniform sampler2D layer; +uniform float temperature; +uniform float strength; + +in vec2 texCoord; +out vec4 FragColor; + +const float LuminancePreservationFactor = 1.0; + +// Source: https://www.shadertoy.com/view/4sc3D7 +// Copyright (C) 2014 by Benjamin 'BeRo' Rosseaux +// http://creativecommons.org/publicdomain/zero/1.0/ +// Valid from 1000 to 40000 K (and additionally 0 for pure full white) +vec3 colorTemperatureToRGB(const in float temperature) { + // Values from: http://blenderartists.org/forum/showthread.php?270332-OSL-Goodness&p=2268693&viewfull=1#post2268693 + mat3 m = (temperature <= 6500.0) ? mat3(vec3(0.0, -2902.1955373783176, -8257.7997278925690), vec3(0.0, 1669.5803561666639, 2575.2827530017594), vec3(1.0, 1.3302673723350029, 1.8993753891711275)) : mat3(vec3(1745.0425298314172, 1216.6168361476490, -8257.7997278925690), vec3(-2666.3474220535695, -2173.1012343082230, 2575.2827530017594), vec3(0.55995389139931482, 0.70381203140554553, 1.8993753891711275)); + return mix(clamp(vec3(m[0] / (vec3(clamp(temperature, 1000.0, 40000.0)) + m[1]) + m[2]), vec3(0.0), vec3(1.0)), vec3(1.0), smoothstep(1000.0, 0.0, temperature)); +} + +void main() { + vec4 inColor = texture(layer, texCoord); + vec3 outColor = mix(inColor.rgb, inColor.rgb * colorTemperatureToRGB(temperature), strength); + outColor *= mix(1.0, dot(inColor.rgb, vec3(0.2126, 0.7152, 0.0722)) / max(dot(outColor, vec3(0.2126, 0.7152, 0.0722)), 1e-5), LuminancePreservationFactor); + FragColor = vec4(outColor, inColor.a); +}`,E$={title:"Температура",fragment:y$,inputs:[{name:"temperature",title:"Температура",default:6550,input:{type:"float",min:1e3,max:2e4,step:100,layout:kt.RANGE}},{name:"strength",default:1,title:"Сила",input:{type:"float",min:-1,max:1,step:.05,layout:kt.RANGE}}]},k$=`#version 300 es +precision mediump float; +precision mediump int; + +uniform sampler2D layer; +uniform vec2 resolution; +uniform float radius; + +in vec2 texCoord; +out vec4 FragColor; + +void main() { + vec2 center = round(texCoord * resolution / radius); + vec2 coords = center * vec2(radius) / resolution; + vec4 origin = texture(layer, coords); + FragColor = origin; +} +`,S$=[{name:"radius",title:"Радиус",description:"Размер пикселя",default:10,input:{type:"float",min:1,step:1}}],A$={title:"Пиксели",fragment:k$,inputs:S$};function I$(){return{noise:_$,bugle:h$,pinch:v$,swirl:w$,grayscale:{title:"Оттенки серого",fragment:m$},brightness_contrast:f$,temperature:E$,pixelation:A$}}const T$=`#version 300 es +precision highp float; +precision highp int; + +uniform sampler2D stencilSampler; +uniform vec3 color; +uniform float alpha; +uniform int channel; +uniform int channels; + +in vec2 texCoord; +out vec4 FragColor; + +float channelAlpha(int currentChannel, int channels, vec4 o); + +void main() { + vec2 tcoords = texCoord; + vec4 origin = texture(stencilSampler, tcoords); + float originAlpha = channelAlpha(channel, channels, origin); + FragColor = vec4(color, originAlpha * alpha); +} +`,C$={fragment:T$,uniforms(i){return{color:hn(i.value)}}},R$=`#version 300 es +precision mediump float; +precision mediump int; + +uniform sampler2D stencilSampler; +uniform vec3 colors[4]; +uniform float alpha; +uniform int channel; +uniform int channels; + +in vec2 texCoord; +out vec4 FragColor; + +float channelAlpha(int currentChannel, int channels, vec4 o); + +void main() { + vec4 origin = texture(stencilSampler, texCoord); + vec3 color = (1.0 - texCoord.x) * colors[0]; + color += (texCoord.x) * colors[1]; + color += (1.0 - texCoord.y) * colors[2]; + color += (texCoord.y) * colors[3]; + FragColor = vec4(color, channelAlpha(channel, channels, origin) * alpha); +} +`,F$={fragment:R$,uniforms(i){return{colors:[hn(i.color1),hn(i.color2),hn(i.color3),hn(i.color4)].flat()}}},N$=`#version 300 es +precision highp float; +precision highp int; + +uniform sampler2D stencilSampler; +uniform sampler2D patternSampler; +uniform float alpha; +uniform int channel; +uniform int channels; +uniform mat4 patternTransform; + +in vec2 texCoord; +out vec4 FragColor; + +float channelAlpha(int currentChannel, int channels, vec4 o); + +void main() { + vec4 origin = texture(stencilSampler, texCoord); + vec4 patternCoord = patternTransform * vec4(texCoord, 0, 1); + FragColor = texture(patternSampler, patternCoord.xy / patternCoord.w); + FragColor.a *= channelAlpha(channel, channels, origin) * alpha; +} +`;function M$(i){return{fragment:N$,uniforms(e,t,n){const r=n.textures.get(i.getTexture(e.name)),s=e.scale=="font"?ht.identity():ht.scaling([t.width/(r.width*e.scale.x),t.height/(r.height*e.scale.y),1]);return{patternSampler:r.texture,patternTransform:ht.multiply(ht.rotateZ(ht.translation([e.shift.x/r.width,e.shift.y/r.height,0]),e.rotate/180*Math.PI),s)}}}}function P$(i){return{color:C$,pattern:M$(i),gradient4:F$}}function B$(i){let e,t;return{c(){e=K("article"),t=oe(i[9]),this.h()},l(n){e=J(n,"ARTICLE",{class:!0});var r=te(e);t=ae(r,i[9]),r.forEach(k),this.h()},h(){D(e,"class","svelte-1ow4yee")},m(n,r){x(n,e,r),O(e,t)},p(n,r){r[0]&512&&tt(t,n[9])},d(n){n&&k(e)}}}function D$(i){let e,t,n,r;return{c(){e=K("article"),t=oe("Произошла ошибка: "),n=oe(i[7]),r=oe("."),this.h()},l(s){e=J(s,"ARTICLE",{class:!0});var o=te(e);t=ae(o,"Произошла ошибка: "),n=ae(o,i[7]),r=ae(o,"."),o.forEach(k),this.h()},h(){D(e,"class","svelte-1ow4yee")},m(s,o){x(s,e,o),O(e,t),O(e,n),O(e,r)},p(s,o){o[0]&128&&tt(n,s[7])},d(s){s&&k(e)}}}function z$(i){let e;return{c(){e=oe("У нас проблемы")},l(t){e=ae(t,"У нас проблемы")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function L$(i){let e,t;return e=new i$({props:{memaker:i[1]}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p(n,r){const s={};r[0]&2&&(s.memaker=n[1]),e.$set(s)},i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}function U$(i){let e;return{c(){e=oe("Инструменты разработчика")},l(t){e=ae(t,"Инструменты разработчика")},m(t,n){x(t,e,n)},d(t){t&&k(e)}}}function O$(i){var W,j;let e,t,n,r,s,o,a,l,u,f,c,h,d,p,m,_,g,b,S;e=new mn({props:{open:i[9]!=="",closable:!1,$$slots:{default:[B$]},$$scope:{ctx:i}}}),n=new mn({props:{open:i[7]!==void 0,$$slots:{title:[z$],default:[D$]},$$scope:{ctx:i}}});function y(q){i[27](q)}let A={$$slots:{title:[U$],default:[L$]},$$scope:{ctx:i}};i[6]!==void 0&&(A.open=i[6]),s=new mn({props:A}),ge.push(()=>be(s,"open",y));function I(q){i[28](q)}let C={};i[4]!==void 0&&(C.fallbackBlob=i[4]),l=new Bc({props:C}),ge.push(()=>be(l,"fallbackBlob",I));function H(q){i[29](q)}function G(q){i[30](q)}function ne(q){i[31](q)}function Q(q){i[32](q)}function R(q){i[33](q)}function X(q){i[34](q)}function E(q){i[35](q)}let V={textureManager:(W=i[1])==null?void 0:W.textures,devMode:i[5],effectsShaders:i[22].effects,version:"v0.2.12",memeExampleURL:i[0],frameDrawer:(j=i[1])==null?void 0:j.drawer};return i[10]!==void 0&&(V.meme=i[10]),i[11]!==void 0&&(V.frame=i[11]),i[12]!==void 0&&(V.block=i[12]),i[13]!==void 0&&(V.editorState=i[13]),i[3]!==void 0&&(V.canvasUI=i[3]),i[2]!==void 0&&(V.canvasWebgl=i[2]),i[14]!==void 0&&(V.previews=i[14]),c=new kv({props:V}),ge.push(()=>be(c,"meme",H)),ge.push(()=>be(c,"frame",G)),ge.push(()=>be(c,"block",ne)),ge.push(()=>be(c,"editorState",Q)),ge.push(()=>be(c,"canvasUI",R)),ge.push(()=>be(c,"canvasWebgl",X)),ge.push(()=>be(c,"previews",E)),c.$on("openMeme",i[36]),c.$on("importMeme",i[37]),c.$on("saveMeme",i[38]),c.$on("renderMeme",i[39]),c.$on("changeBackground",i[40]),c.$on("frameToClipboard",i[23]),c.$on("cloneBlock",i[41]),c.$on("createTextBlock",i[42]),c.$on("createImageBlock",i[43]),c.$on("modifyImageBlock",i[44]),c.$on("shiftBlock",i[45]),c.$on("deleteBlock",i[46]),c.$on("createFrame",i[47]),c.$on("shiftFrame",i[48]),c.$on("deleteFrame",i[49]),c.$on("framesFromImages",i[50]),c.$on("addPattern",i[51]),{c(){F(e.$$.fragment),t=re(),F(n.$$.fragment),r=re(),F(s.$$.fragment),a=re(),F(l.$$.fragment),f=re(),F(c.$$.fragment)},l(q){N(e.$$.fragment,q),t=ie(q),N(n.$$.fragment,q),r=ie(q),N(s.$$.fragment,q),a=ie(q),N(l.$$.fragment,q),f=ie(q),N(c.$$.fragment,q)},m(q,ee){M(e,q,ee),x(q,t,ee),M(n,q,ee),x(q,r,ee),M(s,q,ee),x(q,a,ee),M(l,q,ee),x(q,f,ee),M(c,q,ee),S=!0},p(q,ee){var _e,ce;const we={};ee[0]&512&&(we.open=q[9]!==""),ee[0]&512|ee[1]&16777216&&(we.$$scope={dirty:ee,ctx:q}),e.$set(we);const L={};ee[0]&128&&(L.open=q[7]!==void 0),ee[0]&128|ee[1]&16777216&&(L.$$scope={dirty:ee,ctx:q}),n.$set(L);const Z={};ee[0]&2|ee[1]&16777216&&(Z.$$scope={dirty:ee,ctx:q}),!o&&ee[0]&64&&(o=!0,Z.open=q[6],ve(()=>o=!1)),s.$set(Z);const Se={};!u&&ee[0]&16&&(u=!0,Se.fallbackBlob=q[4],ve(()=>u=!1)),l.$set(Se);const me={};ee[0]&2&&(me.textureManager=(_e=q[1])==null?void 0:_e.textures),ee[0]&32&&(me.devMode=q[5]),ee[0]&1&&(me.memeExampleURL=q[0]),ee[0]&2&&(me.frameDrawer=(ce=q[1])==null?void 0:ce.drawer),!h&&ee[0]&1024&&(h=!0,me.meme=q[10],ve(()=>h=!1)),!d&&ee[0]&2048&&(d=!0,me.frame=q[11],ve(()=>d=!1)),!p&&ee[0]&4096&&(p=!0,me.block=q[12],ve(()=>p=!1)),!m&&ee[0]&8192&&(m=!0,me.editorState=q[13],ve(()=>m=!1)),!_&&ee[0]&8&&(_=!0,me.canvasUI=q[3],ve(()=>_=!1)),!g&&ee[0]&4&&(g=!0,me.canvasWebgl=q[2],ve(()=>g=!1)),!b&&ee[0]&16384&&(b=!0,me.previews=q[14],ve(()=>b=!1)),c.$set(me)},i(q){S||(v(e.$$.fragment,q),v(n.$$.fragment,q),v(s.$$.fragment,q),v(l.$$.fragment,q),v(c.$$.fragment,q),S=!0)},o(q){w(e.$$.fragment,q),w(n.$$.fragment,q),w(s.$$.fragment,q),w(l.$$.fragment,q),w(c.$$.fragment,q),S=!1},d(q){P(e,q),q&&k(t),P(n,q),q&&k(r),P(s,q),q&&k(a),P(l,q),q&&k(f),P(c,q)}}}function x$(i){let e,t,n;function r(o){i[52](o)}let s={$$slots:{default:[O$]},$$scope:{ctx:i}};return i[8]!==void 0&&(s.theme=i[8]),e=new a$({props:s}),ge.push(()=>be(e,"theme",r)),{c(){F(e.$$.fragment)},l(o){N(e.$$.fragment,o)},m(o,a){M(e,o,a),n=!0},p(o,a){const l={};a[0]&32511|a[1]&16777216&&(l.$$scope={dirty:a,ctx:o}),!t&&a[0]&256&&(t=!0,l.theme=o[8],ve(()=>t=!1)),e.$set(l)},i(o){n||(v(e.$$.fragment,o),n=!0)},o(o){w(e.$$.fragment,o),n=!1},d(o){P(e,o)}}}function G$(i,e,t){let n,r,s,o,a,l,u,f;yt(i,io,z=>t(8,r=z));let{patternUrls:c}=e,{placeholdersUrls:h}=e,{memeURL:d=null}=e,{memeExampleURL:p}=e;const m=new Nn({frames:[{height:300,width:600,backgroundColor:"#ffffff",backgroundAlpha:1,id:"loading-placeholder",blocks:[{id:"loading-block-placeholder",container:{type:"global",value:{maxHeight:.9,maxWidth:.9,minHeight:0}},content:{type:"text",value:{text:"Loading...",style:mr}},effects:[],layer:{blendMode:"normal",composeMode:"source_over",alpha:1}}]}]});yt(i,m,z=>t(10,o=z));const _=new Nn(m.value.frames[0]);yt(i,_,z=>t(11,a=z));const g=new Nn(_.value.blocks.find(z=>z.content.type=="text"));yt(i,g,z=>t(12,l=z));let b=_.value.id;m.subscribe(()=>{b=""}),_.subscribe(z=>{b!=z.id&&(b=z.id,g.set(z.blocks.find(T=>T.content.type=="text")||z.blocks[z.blocks.length-1]))});const S=new Nn({available:[Qt.Cursor],mode:Qt.Cursor});yt(i,S,z=>t(13,u=z));let y,A,I,C=new Nn({});yt(i,C,z=>t(14,f=z));let H=xn("Собираем интерфейс...");yt(i,H,z=>t(9,s=z));let G=xn(void 0);yt(i,G,z=>t(7,n=z));let ne="default";const Q={materials:P$(Ct),effects:I$()};An(()=>{try{ne=new URL(location.href).searchParams.get("skin")??ne,t(1,y=new qv({block:g,frame:_,meme:m,busy:H,previews:C,error:G},A,c,h,ne,Q)),new tb(I,A,m,_,g,S,Q.effects),d&&Vr().then(()=>fetch(d)).then(z=>z.blob()).then(z=>y.openMeme(z))}catch(z){Za(G,n=z,n)}return window.addEventListener("keydown",z=>{z.key=="F12"&&(z.ctrlKey?t(5,E=!E):z.shiftKey&&t(6,V=!0))}),()=>y.clear()});let R=null;function X(){y&&y.copyFrameToClipboard().catch(z=>{if(z instanceof Ua)t(4,R=z.blob);else throw z})}let E=!1,V=!1;function W(z){V=z,t(6,V)}function j(z){R=z,t(4,R)}function q(z){o=z,m.set(o)}function ee(z){a=z,_.set(a)}function we(z){l=z,g.set(l)}function L(z){u=z,S.set(u)}function Z(z){I=z,t(3,I)}function Se(z){A=z,t(2,A)}function me(z){f=z,C.set(f)}const _e=z=>y==null?void 0:y.openMeme(z.detail.file),ce=z=>y==null?void 0:y.importMeme(z.detail.file,"add","append"),Ae=()=>{var z;return(z=y==null?void 0:y.exportMeme())==null?void 0:z.then(qr("meme.meme"))},ze=()=>{var z;return(z=y==null?void 0:y.renderMeme())==null?void 0:z.then(({ext:T,blob:le})=>qr(`meme.${T}`)(le))},De=z=>y==null?void 0:y.setBackground(z.detail.file),Le=z=>y==null?void 0:y.cloneBlock(z.detail.block),Xe=z=>{var T;return y==null?void 0:y.addTextBlock((T=z.detail)==null?void 0:T.origin)},lt=z=>y==null?void 0:y.addImageBlock(z.detail.file),at=z=>y==null?void 0:y.modifyImageBlock(z.detail.block,z.detail.file),$=z=>y==null?void 0:y.shiftBlock(z.detail.block,z.detail.shift),ue=z=>y==null?void 0:y.deleteBlock(z.detail.block),se=z=>{var T;return y==null?void 0:y.addFrame((T=z.detail)==null?void 0:T.origin)},U=z=>y==null?void 0:y.shiftFrame(z.detail.frame,z.detail.shift),B=z=>y==null?void 0:y.deleteFrame(z.detail.frame),Y=z=>y==null?void 0:y.framesFromImages(z.detail.files),he=z=>y==null?void 0:y.addPattern(z.detail.name,z.detail.image);function pe(z){r=z,io.set(r)}return i.$$set=z=>{"patternUrls"in z&&t(24,c=z.patternUrls),"placeholdersUrls"in z&&t(25,h=z.placeholdersUrls),"memeURL"in z&&t(26,d=z.memeURL),"memeExampleURL"in z&&t(0,p=z.memeExampleURL)},[p,y,A,I,R,E,V,n,r,s,o,a,l,u,f,m,_,g,S,C,H,G,Q,X,c,h,d,W,j,q,ee,we,L,Z,Se,me,_e,ce,Ae,ze,De,Le,Xe,lt,at,$,ue,se,U,B,Y,he,pe]}class j$ extends ye{constructor(e){super(),Ee(this,e,G$,x$,$e,{patternUrls:24,placeholdersUrls:25,memeURL:26,memeExampleURL:0},null,[-1,-1])}}const H$=""+new URL("../assets/docs.9693a9f2.meme",import.meta.url).href,V$=""+new URL("../assets/checkered.07b41575.webp",import.meta.url).href,W$=""+new URL("../assets/debug.ca573084.webp",import.meta.url).href,q$=""+new URL("../assets/fire.f2d0e917.webp",import.meta.url).href,Z$=""+new URL("../assets/glitter-gold.b5c4520e.webp",import.meta.url).href,X$=""+new URL("../assets/rainbow.3197970b.webp",import.meta.url).href,Y$=""+new URL("../assets/stars.049cd9a5.webp",import.meta.url).href,K$=""+new URL("../assets/1.fc1781c3.webp",import.meta.url).href,J$=""+new URL("../assets/1.a7f10b8b.webp",import.meta.url).href,Q$=""+new URL("../assets/2.cbbf6e10.webp",import.meta.url).href,e3=""+new URL("../assets/3.6dd733d9.webp",import.meta.url).href,t3=""+new URL("../assets/4.a8316ddd.webp",import.meta.url).href,n3=""+new URL("../assets/5.8bf8e6a8.webp",import.meta.url).href,r3=""+new URL("../assets/6.3c784f8d.webp",import.meta.url).href,i3=""+new URL("../assets/7.b845cd6d.webp",import.meta.url).href,s3=""+new URL("../assets/1.949784d4.webp",import.meta.url).href,o3=""+new URL("../assets/1.11d6ce27.webp",import.meta.url).href,a3=""+new URL("../assets/2.97d5dc7d.webp",import.meta.url).href,l3=""+new URL("../assets/3.e8249041.webp",import.meta.url).href,u3=""+new URL("../assets/4.94ed153e.webp",import.meta.url).href,f3=""+new URL("../assets/5.843b6f84.webp",import.meta.url).href,c3=""+new URL("../assets/6.056d0cf4.webp",import.meta.url).href,h3=""+new URL("../assets/7.6fc2d0f6.webp",import.meta.url).href;function m3([i,e]){const t=i.split("/");let n=t[t.length-1];return n=n.slice(0,n.lastIndexOf(".")),{name:n,url:e}}function d3(i){return Object.entries(i).map(m3)}const p3=d3(Object.assign({"/src/lib/resources/patterns/checkered.png":V$,"/src/lib/resources/patterns/debug.png":W$,"/src/lib/resources/patterns/fire.png":q$,"/src/lib/resources/patterns/glitter-gold.jpg":Z$,"/src/lib/resources/patterns/rainbow.png":X$,"/src/lib/resources/patterns/stars.png":Y$})),si=Object.entries(Object.assign({"/src/lib/resources/placeholders/default/await/1.png":K$,"/src/lib/resources/placeholders/default/empty/1.png":J$,"/src/lib/resources/placeholders/default/empty/2.png":Q$,"/src/lib/resources/placeholders/default/empty/3.png":e3,"/src/lib/resources/placeholders/default/empty/4.png":t3,"/src/lib/resources/placeholders/default/empty/5.png":n3,"/src/lib/resources/placeholders/default/empty/6.png":r3,"/src/lib/resources/placeholders/default/empty/7.png":i3,"/src/lib/resources/placeholders/inside/await/1.png":s3,"/src/lib/resources/placeholders/inside/empty/1.png":o3,"/src/lib/resources/placeholders/inside/empty/2.png":a3,"/src/lib/resources/placeholders/inside/empty/3.png":l3,"/src/lib/resources/placeholders/inside/empty/4.png":u3,"/src/lib/resources/placeholders/inside/empty/5.png":f3,"/src/lib/resources/placeholders/inside/empty/6.png":c3,"/src/lib/resources/placeholders/inside/empty/7.png":h3})).map(([i,e])=>{const t=/placeholders\//.exec(i);if(!t)throw Error(`Not found prefix 'placeholder' in '${i}''`);const n=t.index+t[0].length,r=i.substring(n),[s,o,a]=r.split("/"),l=a.slice(0,a.lastIndexOf("."));return{skin:s,category:o,name:l,url:e}}).reduce((i,e)=>(i[e.skin]=i[e.skin]??{},i[e.skin][e.category]=i[e.skin][e.category]??[],i[e.skin][e.category].push(e),i),{});if(!Wv(si))throw Error(`Incorrect configuration: this is not skins map: ${JSON.stringify(si)}`);const so={patternUrls:p3,placeholdersUrls:si};function _3(i){let e,t;return e=new j$({props:{patternUrls:so.patternUrls,placeholdersUrls:so.placeholdersUrls,memeExampleURL:H$}}),{c(){F(e.$$.fragment)},l(n){N(e.$$.fragment,n)},m(n,r){M(e,n,r),t=!0},p:Be,i(n){t||(v(e.$$.fragment,n),t=!0)},o(n){w(e.$$.fragment,n),t=!1},d(n){P(e,n)}}}class $3 extends ye{constructor(e){super(),Ee(this,e,null,_3,$e,{})}}export{$3 as component}; diff --git a/_app/version.json b/_app/version.json index 56aa9b0..118b571 100644 --- a/_app/version.json +++ b/_app/version.json @@ -1 +1 @@ -{"version":"1727784527316"} \ No newline at end of file +{"version":"1729939838616"} \ No newline at end of file diff --git a/index.html b/index.html index 2cea186..61a63f2 100644 --- a/index.html +++ b/index.html @@ -7,13 +7,13 @@ Memaker - + - + - + - +