@simai-studio/ui 5.20261020.1056 → 5.20261020.1647
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/distr/component/buttons/js/buttons.min.js +1 -1
- package/distr/component/icon-buttons/js/icon-buttons.min.js +1 -1
- package/distr/component/modal/css/modal.min.css +1 -1
- package/distr/component/modal/js/modal.min.js +1 -1
- package/distr/component/spinner/css/spinner.min.css +1 -1
- package/distr/component/spinner/js/spinner.min.js +1 -1
- package/distr/core/js/core-loader.js +1 -1
- package/distr/core/js/core-loader.min.js +1 -1
- package/distr/core/js/core-rules.js +9 -0
- package/distr/core/js/core-rules.min.js +1 -1
- package/distr/core/js/core.js +9 -0
- package/distr/core/js/core.min.js +1 -1
- package/distr/core/js/template-utilities.generated.json +0 -2
- package/distr/rule/js/rule.min.js +1 -1
- package/distr/rule/rule.json +8 -0
- package/distr/smart/button-group/js/button-group.min.js +1 -1
- package/distr/smart/buttons/js/buttons.min.js +11 -11
- package/distr/smart/buttons/smart.manifest.json +1 -1
- package/distr/smart/icon-buttons/js/icon-buttons.min.js +9 -9
- package/distr/smart/icon-buttons/smart.manifest.json +1 -1
- package/distr/smart/modal/js/modal.min.js +3 -5
- package/distr/smart/modal/smart.manifest.json +4 -2
- package/distr/smart/spinner/js/spinner.min.js +1 -1
- package/distr/smart/spinner/smart.manifest.json +16 -9
- package/package-manifest.json +27 -27
- package/package.json +4 -4
package/distr/core/js/core.js
CHANGED
|
@@ -2109,6 +2109,15 @@ if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
|
2109
2109
|
wrap: null,
|
|
2110
2110
|
preloaderActive: false
|
|
2111
2111
|
};
|
|
2112
|
+
} // The page's spinner look (simai/ui-source#11): SF_BOOT_CONFIG.spinner names
|
|
2113
|
+
// it as data-sf-spinner on html would, and is written there unless the page
|
|
2114
|
+
// has written its own. The spinner sheet does the rest.
|
|
2115
|
+
|
|
2116
|
+
|
|
2117
|
+
const spinnerLook = window.SF_BOOT_CONFIG.spinner;
|
|
2118
|
+
|
|
2119
|
+
if (typeof spinnerLook === 'string' && spinnerLook.trim() && document.documentElement && !document.documentElement.hasAttribute('data-sf-spinner')) {
|
|
2120
|
+
document.documentElement.setAttribute('data-sf-spinner', spinnerLook.trim().toLowerCase());
|
|
2112
2121
|
}
|
|
2113
2122
|
|
|
2114
2123
|
const applyInitialTheme = () => {
|
|
@@ -61,4 +61,4 @@
|
|
|
61
61
|
if (run) queue = queue.then(() => run(data)).catch((error) => fail(data.type, error));
|
|
62
62
|
};
|
|
63
63
|
});
|
|
64
|
-
})();`,At="VOLJzSJh85fxDvhl9WytjdmjtDAUN8JT5veHYwFCVPA=";function Lt(){return`<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="${["default-src 'none'",`script-src 'sha256-${At}' blob:`,"style-src 'unsafe-inline'","img-src data: blob:","media-src data: blob:","font-src data:","connect-src 'none'","worker-src 'none'","frame-src 'none'","child-src 'none'","object-src 'none'","manifest-src 'none'","form-action 'none'","base-uri 'none'"].join("; ")}"><style>html,body{margin:0;block-size:100%;overflow:hidden;background:transparent}#host{position:absolute;inset:0;overflow:hidden}</style></head><body><div id="host"></div><script>${jt}<\/script></body></html>`}const Pt=["primary","secondary","tertiary","neutral","neutral-variant","error","warning","success","info"];function zt(e){const t=globalThis.getComputedStyle(e),n={};for(const e of Pt)for(let o=0;o<=100;o+=1){const i=`--sf-${e}-${o}`,s=t.getPropertyValue(i).trim();s&&s.length<=200&&(n[i]=s)}return n}const Rt=e=>Boolean(e)&&Et.has(e);function Ct(e,{manifest:t,module:n,stored:o={},locale:i,scheme:s}={}){if(!(e instanceof globalThis.Element))throw new TypeError("An effect mounts into an element");const r=yt(t);if(r.length)throw new TypeError(`Effect manifest is invalid: ${r.join("; ")}`);const a="function"==typeof n?n:n?.mount;if("function"!=typeof a)throw new TypeError("An effect module exports mount(host, settings, context)");e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none";const l=!e.hasAttribute("data-sf-effect");l&&e.setAttribute("data-sf-effect",t.id);const c=!e.hasAttribute($t);c&&e.setAttribute($t,"running");const u=e.ownerDocument;let{settings:d}=wt(t,o);const f=vt(t),p=e=>f.includes(e)?e:f[0];let m=p(s);const h=()=>Object.freeze({reducedMotion:Boolean(globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches),locale:i??(u.documentElement.getAttribute("lang")||"en"),scheme:m});let g=a(e,d,h())??{},y=!0,b=!1,w=!1,v=!1;const _=(n,...o)=>{try{g?.[n]?.(...o)}catch(o){e.dispatchEvent(new globalThis.CustomEvent("sf-effect-error",{bubbles:!0,detail:{effect:t.id,phase:n,message:String(o?.message??o)}}))}},x=()=>{if(v)return;const e=!b&&!u.hidden&&!w;e!==y&&(y=e,_(e?"resume":"pause"))};u.addEventListener("visibilitychange",x);const $=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)"),k=()=>{v||(_("destroy"),e.replaceChildren(),g=a(e,d,h())??{},y=!0,x())};$?.addEventListener?.("change",k);const S=globalThis.IntersectionObserver,E=S?new S(e=>{w=!e[e.length-1].isIntersecting,x()}):null;return E?.observe(e),x(),Object.freeze({update(e,{scheme:n}={}){v||(d=wt(t,e).settings,void 0!==n&&(m=p(n)),_("update",d,h()))},get scheme(){return m},get sandboxed(){return Rt(n)},pause(){b=!0,x()},resume(){b=!1,x()},destroy(){v||(v=!0,u.removeEventListener("visibilitychange",x),$?.removeEventListener?.("change",k),E?.disconnect(),_("destroy"),e.replaceChildren(),l&&e.removeAttribute("data-sf-effect"),c&&e.removeAttribute($t))}})}const Ft=["auto","dark","light"],Nt=["theme-dark","theme-light"];function It(e=globalThis.document){const t=e?.documentElement;return t?.classList.contains("theme-dark")?"dark":t?.classList.contains("theme-light")?"light":globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Mt(e,{pageScheme:t,themeMode:n="auto",pair:o,foreign:i}={}){if(!Ft.includes(n))return Object.freeze({hidden:!0,reason:"unknown-theme-mode"});const s="auto"===n?"dark"===(t??It())?"dark":"light":n,r=vt(e);if(r.includes(s))return Object.freeze({effect:"self",scheme:s});if("string"==typeof e?.pair){const t=_t(e);if(t&&"sandbox"!==Tt(i))return Object.freeze({hidden:!0,reason:"foreign-pair-needs-sandbox"});if(!o||vt(o).includes(s))return Object.freeze(t?{effect:"pair",scheme:s,pair:e.pair,sandboxed:!0}:{effect:"pair",scheme:s,pair:e.pair})}return"auto"===n&&"light"===s&&r.includes("dark")?Object.freeze({effect:"self",scheme:"dark"}):Object.freeze({hidden:!0,reason:"auto"===n?"light-only-on-dark":"mode-not-drawable"})}const qt="sf-effect-area";const Dt=new Set;let Bt=null;const Ut=new Set(["foreign-pair-needs-sandbox","pair-refused"]);function Wt(e,t,n,o={}){globalThis.console?.warn?.(`SF.Effects: ${t} is not run (${n})`,o),e.dispatchEvent(new globalThis.CustomEvent("sf-effect-refused",{bubbles:!0,detail:{effect:t,reason:n,...o}}))}function Ht({element:e,host:t,areas:n,manifest:o,module:i,pair:s,pairRefused:r,stored:a={},locale:l,themeMode:c="auto",windows:u=!1,foreign:d}){const f=yt(o);if(f.length)throw new TypeError(`Effect manifest is invalid: ${f.join("; ")}`);const p=_t(o),m=s&&ht(s.manifest)&&!yt(s.manifest).length&&(p?Rt(s.module):s.manifest.id===o.pair)?s:null,h=function(){const e=new Map,t=(e,t)=>{e.classList.remove(...Nt,qt),t.length&&e.classList.add(...t)};return{set(n,o){const i=`theme-${o}`;for(const t of n){e.has(t)||e.set(t,[...Nt,qt].filter(e=>t.classList.contains(e))),t.classList.contains(qt)||t.classList.add(qt);const n=Nt.find(e=>e!==i);t.classList.contains(n)&&t.classList.remove(n),t.classList.contains(i)||t.classList.add(i)}for(const[o,i]of e)n.includes(o)||(t(o,i),e.delete(o))},restore(){for(const[n,o]of e)t(n,o);e.clear()}}}();let g=c,y=a,b=null,w=null,v=!1,_=!1;e.setAttribute($t,"running");const x=()=>{if(_)return!1;const{next:a,drawn:c}=(()=>{const e=It(t.ownerDocument);let n=Mt(o,{pageScheme:e,themeMode:g,pair:m?.manifest,foreign:d});"pair"!==n.effect||m?"pair"===n.effect&&u&&!xt(m.manifest).includes("windows")&&(n={hidden:!0,reason:"pair-without-windows"}):n={hidden:!0,reason:p&&s?"foreign-pair-needs-sandbox":r?"pair-refused":"pair-not-loaded"};const i="dark"===g||"light"===g?g:e;return{next:Object.freeze(n),drawn:n.hidden?i:n.scheme}})();h.set(n(),c);const f=a.hidden?null:a.effect,x=w?w.hidden?null:w.effect:void 0,$=!w||w.hidden!==a.hidden||w.reason!==a.reason||w.scheme!==a.scheme||w.effect!==a.effect;w=a;let k=!1;if(x===f&&b)b.scheme!==c&&(b.update(y,{scheme:c}),k=!0);else if(x!==f&&(b?.destroy(),b=null,f)){const e="self"===f?{manifest:o,module:i}:m;b=Ct(t,{manifest:e.manifest,module:e.module,stored:y,locale:l,scheme:c}),v&&b.pause(),k=!0}return $&&(e.setAttribute($t,a.hidden?"hidden":"running"),a.hidden?e.setAttribute(kt,a.reason):e.removeAttribute(kt),a.hidden&&Ut.has(a.reason)&&Wt(e,o.pair??o.id,a.reason,{pairOf:o.id})),k},$=function(e){Dt.add(e);const t=globalThis.document;if(!Bt&&t?.documentElement){const e=()=>{for(const e of[...Dt])e()},n=new globalThis.MutationObserver(e);n.observe(t.documentElement,{attributes:!0,attributeFilter:["class"]});const o=globalThis.matchMedia?.("(prefers-color-scheme: dark)");o?.addEventListener?.("change",e),globalThis.addEventListener?.("sf-theme-change",e),Bt=()=>{n.disconnect(),o?.removeEventListener?.("change",e),globalThis.removeEventListener?.("sf-theme-change",e)}}return()=>{Dt.delete(e),!Dt.size&&Bt&&(Bt(),Bt=null)}}(()=>{"auto"===g&&x()});try{x()}catch(t){throw $(),h.restore(),e.removeAttribute($t),t}const k=Object.freeze({update(e=y,{themeMode:t}={}){_||(y=e,void 0!==t&&(g=t),x()||b?.update(y,{scheme:b.scheme}))},pause(){v=!0,b?.pause()},resume(){v=!1,b?.resume()},destroy(){_||(_=!0,$(),b?.destroy(),b=null,h.restore(),e.removeAttribute($t),e.removeAttribute(kt))},get scheme(){return b?.scheme??null},get effect(){return w.hidden?null:w.effect},get resolution(){return w},get themeMode(){return g},get sandboxed(){return b?.sandboxed??!1}});return{handle:k,apply:()=>x()}}function Vt(e){const t=e.ownerDocument.createElement("div");t.setAttribute("data-sf-effect-layer",""),t.style.cssText="position:absolute;inset:0;z-index:-1;overflow:hidden;border-radius:inherit;pointer-events:none";const n={position:e.style.position,isolation:e.style.isolation};return"static"===globalThis.getComputedStyle(e).position&&(e.style.position="relative"),e.style.isolation="isolate",e.prepend(t),{host:t,remove(){t.remove(),e.style.position=n.position,e.style.isolation=n.isolation}}}const Zt=e=>Number(e.toFixed(2));function Jt(e,t,n,o,i){const s=Math.min(n,o)/2,[r,a,l,c]=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"].map(e=>Zt(Math.min(((e,t)=>{const n=String(e).trim().split(/\s+/u)[0],o=Number.parseFloat(n);return Number.isFinite(o)?n.endsWith("%")?o/100*t:o:0})(i[e],Math.min(n,o)),s)));return[e,t,n,o]=[e,t,n,o].map(Zt),`M${Zt(e+r)} ${t}H${Zt(e+n-a)}A${a} ${a} 0 0 1 ${Zt(e+n)} ${Zt(t+a)}V${Zt(t+o-l)}A${l} ${l} 0 0 1 ${Zt(e+n-l)} ${Zt(t+o)}H${Zt(e+c)}A${c} ${c} 0 0 1 ${e} ${Zt(t+o-c)}V${Zt(t+r)}A${r} ${r} 0 0 1 ${Zt(e+r)} ${t}Z`}function Gt(e,{windows:t=St,...n}){if(!(e instanceof globalThis.Element))throw new TypeError("A windows group is an element");const o=yt(n.manifest);if(o.length)throw new TypeError(`Effect manifest is invalid: ${o.join("; ")}`);if(!xt(n.manifest).includes("windows"))throw new TypeError("The effect does not declare the windows capability");const i="string"==typeof t&&t?t:St,s=()=>[...e.querySelectorAll(i)],r=Vt(e);let a;try{a=Ht({...n,element:e,host:r.host,areas:s,windows:!0})}catch(e){throw r.remove(),e}let l=0;const c=()=>{l=0;const e=r.host.getBoundingClientRect(),t=s().map(t=>{const n=t.getBoundingClientRect();return n.width&&n.height?Jt(n.left-e.left,n.top-e.top,n.width,n.height,globalThis.getComputedStyle(t)):""}).filter(Boolean);r.host.style.clipPath=t.length?`path('${t.join(" ")}')`:"inset(50%)"},u=()=>{l||(l=globalThis.requestAnimationFrame(c))},d=globalThis.ResizeObserver,f=d?new d(u):null,p=()=>{if(f){f.disconnect(),f.observe(e);for(const e of s())f.observe(e)}},m=new globalThis.MutationObserver(e=>{e.every(e=>r.host.contains(e.target))||(p(),a.apply(),u())});m.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-sf-effect-window"]}),globalThis.addEventListener("scroll",u,{passive:!0,capture:!0}),globalThis.addEventListener("resize",u,{passive:!0}),p(),c();const{handle:h}=a;return Object.freeze({update:h.update,pause:h.pause,resume:h.resume,refresh(){p(),a.apply(),u()},destroy(){l&&globalThis.cancelAnimationFrame(l),l=0,f?.disconnect(),m.disconnect(),globalThis.removeEventListener("scroll",u,{capture:!0}),globalThis.removeEventListener("resize",u),h.destroy(),r.remove()},get scheme(){return h.scheme},get effect(){return h.effect},get resolution(){return h.resolution},get themeMode(){return h.themeMode},get sandboxed(){return h.sandboxed}})}class Xt extends Error{constructor(e,t={}){super(e),this.name="EffectRefused",this.reason=e,this.detail=t}}const Yt=e=>(new globalThis.TextDecoder).decode(e),Kt=()=>globalThis.document?.baseURI??globalThis.location?.href;function Qt(e){const t=e??Ot().catalogue;if("string"!=typeof t||!t)return null;try{const e=new URL(t,Kt());return e.search="",e.hash="",e.pathname.endsWith("/")||(e.pathname+="/"),e.href}catch{return null}}async function en(e){const t=globalThis.crypto?.subtle;if(!t)throw new Xt("no-integrity-check");return[...new Uint8Array(await t.digest("SHA-256",e))].map(e=>e.toString(16).padStart(2,"0")).join("")}async function tn(e){let t;try{t=await globalThis.fetch(e,{credentials:"omit",referrerPolicy:"no-referrer"})}catch{throw new Xt("fetch-failed",{url:e})}if(!t.ok)throw new Xt("fetch-failed",{url:e,status:t.status});return new Uint8Array(await t.arrayBuffer())}const nn=new Map;function on(e){if(!nn.has(e)){const t=(async()=>{const t=Ot(),n=Qt()===e,o=n&&t.index||"catalogue/index.json",i=await tn(new URL(o,e).href);if(n&&t.indexSha256&&await en(i)!==t.indexSha256)throw new Xt("integrity",{file:o});let s;try{s=JSON.parse(Yt(i))}catch{throw new Xt("invalid-index",{file:o})}if("simai.ui-effects.catalogue"!==s?.schema||!Array.isArray(s.effects))throw new Xt("invalid-index",{file:o});return s})();t.catch(()=>nn.delete(e)),nn.set(e,t)}return nn.get(e)}async function sn(e,t){const n=(await on(e)).effects.find(e=>e?.id===t);if(!n)throw new Xt("not-in-catalogue",{id:t});if("string"!=typeof n.path||!/^effects\/[a-z][a-z0-9-]{1,40}\/$/u.test(n.path))throw new Xt("invalid-index",{id:t});const o=new URL(n.path,e).href,i=new Map((Array.isArray(n.files)?n.files:[]).map(e=>[e?.path,e?.sha256])),s=async e=>{const n=i.get(e);if("string"!=typeof n)throw new Xt("file-not-in-index",{id:t,file:e});const s=await tn(new URL(e,o).href);if(await en(s)!==n.toLowerCase())throw new Xt("integrity",{id:t,file:e});return s},r=await s("effect.json");let a;try{a=JSON.parse(Yt(r))}catch{throw new Xt("invalid-manifest",{id:t})}const l=yt(a);if(l.length)throw new Xt("invalid-manifest",{id:t,problems:l});if(a.id!==t)throw new Xt("manifest-mismatch",{id:t});const c=await s(a.entry),u=[];for(const e of a.styles??[])u.push(Yt(await s(e)));const d=await async function(e){const t=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:"text/javascript"}));try{return await import(t)}catch(e){throw new Xt("module-failed",{message:String(e?.message??e)})}finally{globalThis.URL.revokeObjectURL(t)}}(c);if("function"!=typeof d?.mount)throw new Xt("module-failed",{id:t,message:"no mount export"});return Object.freeze({id:t,url:`${o}effect.json`,manifest:a,module:d,styles:Object.freeze(u),sandboxed:!1})}async function rn(e){const t=await tn(e);let n;try{n=JSON.parse(Yt(t))}catch{throw new Xt("invalid-manifest",{url:e})}const o=yt(n);if(o.length)throw new Xt("invalid-manifest",{url:e,problems:o});const i=Yt(await tn(new URL(n.entry,e).href)),s=[];for(const t of n.styles??[])s.push(Yt(await tn(new URL(t,e).href)));const r=function({id:e,source:t,styles:n=[]}){const o=Object.freeze({mount(o,i,s){const r=o.ownerDocument.createElement("iframe");r.setAttribute("sandbox","allow-scripts"),r.setAttribute("referrerpolicy","no-referrer"),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),r.setAttribute("title",""),r.setAttribute("data-sf-effect-sandbox","loading"),r.style.cssText="position:absolute;inset:0;inline-size:100%;block-size:100%;border:0;margin:0;padding:0;display:block;pointer-events:none;background:transparent",r.srcdoc=Lt();const a=new globalThis.MessageChannel,l=a.port1,c=[];let u=!1,d=0,f=!1;const p=()=>{const e=o.getBoundingClientRect();return{width:e.width,height:e.height}},m=e=>{f||(u?l.postMessage(e):c.push(e))},h=(t,n)=>o.dispatchEvent(new globalThis.CustomEvent("sf-effect-error",{bubbles:!0,detail:{effect:e,phase:t,message:n,sandboxed:!0}})),g=globalThis.ResizeObserver?new globalThis.ResizeObserver(()=>m({type:"size",size:p()})):null,y=()=>{f=!0,g?.disconnect(),l.close(),r.remove()};return l.onmessage=({data:e})=>{!f&&ht(e)&&("mounted"===e.type?r.setAttribute("data-sf-effect-sandbox","mounted"):"error"===e.type&&h(String(e.phase).slice(0,40),String(e.message).slice(0,500)))},l.start(),r.addEventListener("load",()=>{if(!f){if(d+=1,d>1)return h("sandbox","the sandbox frame navigated away and was removed"),void y();r.contentWindow?.postMessage("sf-effect-sandbox","*",[a.port2]),u=!0;for(const e of c.splice(0))l.postMessage(e)}}),m({type:"mount",source:t,styles:[...n],settings:{...i},context:{...s},tones:zt(o),size:p()}),o.append(r),g?.observe(o),{update(e,t){m({type:"update",settings:{...e},context:{...t},tones:zt(o)})},pause(){m({type:"pause"})},resume(){m({type:"resume"})},destroy(){f||(m({type:"destroy"}),y())}}}});return Et.add(o),o}({id:n.id,source:i,styles:s});return Object.freeze({id:n.id,url:e,manifest:n,module:r,styles:Object.freeze([]),sandboxed:!0})}async function an(e,t,n){if("string"!=typeof e||!e.trim())throw new Xt("no-effect");const o=e.trim();if(at.test(o)){if(!t)throw new Xt("no-catalogue",{id:o});return{id:o}}const i="sandbox"===Tt(n);let s;try{s=new URL(o,Kt()).href}catch{throw new Xt(i?"invalid-reference":"foreign-effect-needs-sandbox",{url:o})}if(!t||!s.startsWith(t)){if(!i)throw new Xt("foreign-effect-needs-sandbox",{url:s});const e=function(e){const t=new URL(e),n=new URL(Kt()).origin;return"https:"!==t.protocol&&t.origin!==n||!t.pathname.endsWith("/effect.json")||t.username||t.password?null:(t.hash="",t.href)}(s);if(!e)throw new Xt("invalid-reference",{url:s});return{foreign:e}}const r=(await on(t)).effects.find(e=>"string"==typeof e?.path&&new URL(`${e.path}effect.json`,t).href===s);if(!r)throw new Xt("not-in-catalogue",{url:s});return{id:r.id}}const ln=new Map;function cn(e,{catalogue:t,foreign:n}={}){const o=Qt(t);return(async()=>{const t=await an(e,o,n),i=t.foreign?`foreign\n${t.foreign}`:`${o}\n${t.id}`;if(!ln.has(i)){const e=t.foreign?rn(t.foreign):sn(o,t.id);e.catch(()=>ln.delete(i)),ln.set(i,e)}return ln.get(i)})()}const un=new Map;function dn(e,t){if(!e?.styles?.length)return()=>{};let n=un.get(e.url);if(!n){const o=e.styles.map(n=>{const o=t.createElement("style");return o.setAttribute("data-sf-effect-style",e.id),o.textContent=n,t.head.append(o),o});n={nodes:o,count:0},un.set(e.url,n)}n.count+=1;let o=!1;return()=>{if(!o&&(o=!0,n.count-=1,!n.count)){for(const e of n.nodes)e.remove();un.delete(e.url)}}}const fn=new Map;async function pn(e,t={}){if(!(e instanceof globalThis.Element))throw new TypeError("An effect is placed on an element");const{effect:n,settings:o={},themeMode:i="auto",windows:s=!1,catalogue:r,locale:a,foreign:l}=t;fn.get(e)?.destroy(),e.setAttribute($t,"loading"),e.removeAttribute(kt);try{const t=await cn(n,{catalogue:r,foreign:l});if(s&&!xt(t.manifest).includes("windows"))throw new Xt("windows-not-declared",{id:t.id});let c=null,u=null;if("string"==typeof t.manifest.pair){const n=_t(t.manifest);if(!n&&t.sandboxed)u="pair-of-foreign-effect",Wt(e,t.manifest.pair,u,{pairOf:t.id});else if(!n||"sandbox"===Tt(l))try{c=await cn(t.manifest.pair,{catalogue:r,foreign:l})}catch(n){u=n?.reason??"pair-failed",Wt(e,t.manifest.pair,u,{pairOf:t.id,...n?.detail??{}})}}if("loading"!==e.getAttribute($t))return null;if(!e.isConnected)return e.removeAttribute($t),null;const d=[dn(t,e.ownerDocument),dn(c,e.ownerDocument)],f={manifest:t.manifest,module:t.module,pair:c?{manifest:c.manifest,module:c.module}:void 0,pairRefused:u,stored:o,locale:a,themeMode:i,foreign:l};let p,m=null;try{s?p=Gt(e,{...f,windows:s}):(m=Vt(e),p=Ht({...f,element:e,host:m.host,areas:()=>[e]}).handle)}catch(e){m?.remove();for(const e of d)e();throw e}const h=Object.freeze({update:p.update,pause:p.pause,resume:p.resume,destroy(){fn.get(e)===h&&fn.delete(e),p.destroy(),m?.remove();for(const e of d)e()},get scheme(){return p.scheme},get effect(){return p.effect},get resolution(){return p.resolution},get themeMode(){return p.themeMode},get sandboxed(){return p.sandboxed}});return fn.set(e,h),h}catch(t){return t instanceof Xt?(e.setAttribute($t,"refused"),e.setAttribute(kt,t.reason),Wt(e,n,t.reason,t.detail)):(e.setAttribute($t,"failed"),e.removeAttribute(kt),e.dispatchEvent(new globalThis.CustomEvent("sf-effect-error",{bubbles:!0,detail:{effect:n,phase:"mount",message:String(t?.message??t)}}))),null}}const mn=`[data-sf-effect]:not([${$t}]), [data-sf-effect-windows]:not([${$t}])`;function hn(e){const t=e.hasAttribute("data-sf-effect-windows"),n=e.getAttribute(t?"data-sf-effect-windows":"data-sf-effect");let o={};const i=e.getAttribute("data-sf-effect-settings");if(i)try{const e=JSON.parse(i);if(!ht(e))throw new TypeError("not an object");o=e}catch{globalThis.console?.warn?.(`SF.Effects: data-sf-effect-settings of ${n} is not a JSON object; the defaults are used`)}const s=e.getAttribute("data-sf-effect-theme")||"auto";return pn(e,{effect:n,settings:o,themeMode:s,windows:t})}function gn(e){const t=e instanceof globalThis.Element&&e.matches(mn)?[e]:[];t.push(...e.querySelectorAll?.(mn)??[]);for(const e of t)hn(e)}if("undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Effects=Object.freeze({checkEffectManifest:yt,checkSetting:bt,effectSettings:wt,effectSchemes:vt,pairIsForeign:_t,foreignMode:Tt,allowedModes:function(e,{pair:t,foreign:n}={}){const o=new Set(vt(e));if(((e,t)=>"string"==typeof e?.pair&&(!_t(e)||"sandbox"===Tt(t)))(e,n))for(const e of t?vt(t):ft)o.add(e);return["auto",...ft.filter(e=>o.has(e))]},resolveTheme:Mt,pageScheme:It,mountEffect:function(e,t={}){if(void 0===t.themeMode)return Ct(e,t);if(!(e instanceof globalThis.Element))throw new TypeError("An effect mounts into an element");const n=t.area instanceof globalThis.Element?t.area:e,{manifest:o,module:i,pair:s,stored:r,locale:a,themeMode:l,foreign:c}=t;return Ht({element:n,host:e,areas:()=>[n],manifest:o,module:i,pair:s,stored:r,locale:a,themeMode:l,foreign:c}).handle},mountWindows:function(e,t={}){const{manifest:n,module:o,pair:i,stored:s,locale:r,themeMode:a="auto",windows:l,foreign:c}=t;return Gt(e,{manifest:n,module:o,pair:i,stored:s,locale:r,themeMode:a,windows:l,foreign:c})},loadEffect:cn,placeEffect:pn,EFFECT_FORMAT:st,SANDBOX_RUNNER_SHA256:At,get EFFECT_SCHEMA(){return t({kind:"global",from:"SF.Effects.EFFECT_SCHEMA",to:"SF.Effects.EFFECT_FORMAT"}),"simai.effect.v1"}}),"undefined"!=typeof document&&document.documentElement)){const e=()=>function(e){const t=e.querySelector(mn);gn(e),(Ot().catalogue||t)&&new globalThis.MutationObserver(e=>{for(const t of e){for(const e of t.addedNodes)1===e.nodeType&&gn(e);if(t.removedNodes.length)for(const[e,t]of fn)e.isConnected||t.destroy()}}).observe(e.documentElement,{childList:!0,subtree:!0})}(document);"complete"===document.readyState?globalThis.setTimeout(e,0):window.addEventListener("load",e,{once:!0})}const yn=(()=>{const e="undefined"!=typeof globalThis?globalThis:{},t="__sfPageLanguage";return e[t]||(e[t]={listeners:new Set,registered:new Map,chosen:null}),e[t]})(),bn=yn.listeners,wn=yn.registered,vn=e=>String(e??"").trim().toLowerCase().replace("_","-"),_n=()=>{for(const e of[...bn])try{e()}catch{}};function xn(e){let t=e;for(;t;){const e="function"==typeof t.closest?t.closest("[lang]"):null;if(e)return e;const n="function"==typeof t.getRootNode?t.getRootNode():null;t=n&&n!==t&&n.host?n.host:null}return null}function $n(e){if(yn.chosen)return yn.chosen.split("-")[0];const t=xn(e),n=t?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en";return vn(n).split("-")[0]||"en"}function kn(e){if(yn.chosen)return yn.chosen;const t=xn(e);return vn(t?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en")}function Sn(e,t,n,o){const i=o??(e=>{const t=e?.tagName;return"string"==typeof t?t.toLowerCase():null})(n);for(const o of(e=>{const t=vn(e),n=t.split("-")[0],o=[];for(const e of[t,n,"en"])e&&!o.includes(e)&&o.push(e);return o})(kn(n))){const n=i?wn.get(i)?.get(o)?.[t]:void 0;if(void 0!==n)return n;const s=e?.[o]?.[t];if(void 0!==s)return s}return t}const En={current:(e=globalThis.document?.documentElement??null)=>kn(e),use(e){const t=null==e?null:vn(e);return t===yn.chosen||(yn.chosen=t,_n()),yn.chosen},register(e,t,n){const o=String(e??"").toLowerCase(),i=vn(t);if(!o||!i)throw new TypeError("a component and a language are required");wn.has(o)||wn.set(o,new Map);const s=wn.get(o);return null===n?s.delete(i):s.set(i,{...s.get(i)??{},...n}),_n(),this},registerAll(e,t={}){for(const[n,o]of Object.entries(t))this.register(n,e,o);return this},known(e){const t=String(e??"").toLowerCase();return[...wn.get(t)?.keys()??[]]},components:()=>[...wn.keys()],onChange:e=>"function"!=typeof e?()=>{}:(bn.add(e),()=>bn.delete(e)),forget(){return wn.clear(),yn.chosen=null,_n(),this}};"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.language=En,window.SF.pageLanguage=$n,window.SF.pageText=Sn);const On={en:{region:"Notifications"},ru:{region:"Уведомления"}},Tn=new Set(["neutral","info","success","warning","error"]),jn={success:"check_circle",info:"info",warning:"warning",error:"error",neutral:""},An={neutral:5e3,info:5e3,success:5e3,warning:8e3,error:1e4},Ln=new Set(["top-start","top-end","bottom-start","bottom-end"]),Pn={region:null,shown:[],waiting:[],history:[],max:4,placement:"bottom-end",counter:0};function zn(){return globalThis.SF?.Toast?.create?globalThis.SF.Toast:null}function Rn(){if(Pn.region?.isConnected)return Pn.region;const e=document.createElement("section");return e.className="sf-notifications",e.dataset.placement=Pn.placement,e.setAttribute("aria-label",Sn(On,"region",document.documentElement)),"function"==typeof e.showPopover&&e.setAttribute("popover","manual"),e.addEventListener("sf-toast-close",e=>{const t=Pn.shown.find(t=>t.toast===e.target);t&&Fn(t)}),e.addEventListener("sf-toast-action",e=>{const t=Pn.shown.find(t=>t.toast===e.detail?.toast);t&&(t.options.action?.onSelect?.(t.record),globalThis.SF?.Toast?.dismiss?.(t.toast))}),document.body.append(e),Pn.region=e,e}function Cn(){const e=Pn.region;!e||Pn.shown.length||Pn.waiting.length||"function"==typeof e.hidePopover&&e.matches(":popover-open")&&e.hidePopover()}function Fn(e){Pn.shown=Pn.shown.filter(t=>t!==e);const t=Pn.waiting.shift();t?Nn(t):setTimeout(Cn,0)}async function Nn(e){Pn.shown.push(e);const t=await(zn()?Promise.resolve(zn()):(globalThis.SF?.Loader?.ensurePlugin?.("toast"),new Promise(e=>{const t=()=>{globalThis.removeEventListener("Toast:ready",t),e(zn())};globalThis.addEventListener("Toast:ready",t);const n=e=>{if(zn())return t();e>0&&setTimeout(()=>n(e-1),100)};n(50)})));if(!t||!Pn.shown.includes(e))return;const{record:n,options:o}=e,i=t.create({status:n.status,icon:o.icon??jn[n.status],title:n.title,supportingText:n.text,actionText:o.action?.label??"",action:o.action?o.action.id??"action":"",closable:!0,duration:o.duration,role:"error"===n.status?"alert":"status"});i.dataset.sfNotification=n.id,e.count>1&&(i.dataset.count=String(e.count)),e.toast=i,function(){const e=Rn();if("function"==typeof e.showPopover&&!e.matches(":popover-open"))try{e.showPopover()}catch{}}();const s=Rn();Pn.placement.startsWith("top")?s.prepend(i):s.append(i)}function In(e){const t=Pn.waiting.findIndex(t=>t.record.id===e);if(-1!==t)return Pn.waiting.splice(t,1),!0;const n=Pn.shown.find(t=>t.record.id===e);return!!n&&(n.toast?globalThis.SF?.Toast?.dismiss?.(n.toast)??!1:(Fn(n),!0))}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.notify||(window.SF.notify=function(e={}){if("undefined"==typeof document)return null;const{status:t,title:n,text:o,duration:i}=function(e){const t=Tn.has(e.status)?e.status:"neutral";return{status:t,title:String(e.title??"").trim(),text:String(e.text??"").trim(),duration:Number.isFinite(Number(e.duration))?Math.max(0,Number(e.duration)):An[t]}}(e);if(!n&&!o)return null;Pn.counter+=1;const s=Object.freeze({id:`n${Date.now().toString(36)}${Pn.counter}`,status:t,title:n,text:o,source:String(e.source??""),time:(new Date).toISOString()}),r=String(e.key??`${t}|${n}|${o}`),a=document.dispatchEvent(new CustomEvent("sf-notification",{bubbles:!0,cancelable:!0,detail:s}));Pn.history=[s,...Pn.history].slice(0,50);const l={id:s.id,close:()=>In(s.id)};if(!a||e.silent)return l;const c=[...Pn.shown,...Pn.waiting].find(e=>e.key===r);if(c)return c.count=(c.count??1)+1,c.toast&&(c.toast.dataset.count=String(c.count),globalThis.SF?.Toast?.unbind?.(c.toast),globalThis.SF?.Toast?.bind?.(c.toast)),{id:c.record.id,close:()=>In(c.record.id)};const u={record:s,key:r,options:{...e,duration:i},count:1,toast:null};return Pn.shown.length>=Pn.max?Pn.waiting.push(u):Nn(u),l},window.SF.notifications={configure:function({placement:e,max:t}={}){return Ln.has(e)&&(Pn.placement=e,Pn.region&&(Pn.region.dataset.placement=e)),Number.isInteger(t)&&t>0&&(Pn.max=t),{placement:Pn.placement,max:Pn.max}},close:In,history:()=>Pn.history.slice()}));var Mn=n("6c7f357fe960");if("undefined"!=typeof window){window.SF=window.SF||{};const e=window.SF;if(!e.loadRuntime){let t=null;const n=()=>[...document.scripts].find(e=>/\/core\/js\/core(?:\.min)?\.js(?:[?#]|$)/u.test(e.src));e.loadRuntime=()=>t||(e.__internal.runtimeModules?(e.__internal.runtimeSettled=!0,t=Promise.resolve(e.__internal.runtimeModules)):t=new Promise((t,o)=>{e.__internal.runtimeArrived=n=>{e.__internal.runtimeSettled=!0,t(n)};const i=n();if(!i)return;const s=document.createElement("script");s.src=i.src.replace(/core(\.min)?\.js(?=[?#]|$)/u,(e,t)=>`smart-base${t||""}.js`),s.async=!0,s.addEventListener("error",()=>o(new Error(`SF runtime: ${s.src} did not load`))),document.head.append(s)}),e.__internal.runtimeLoading=t,t),e.runtimeModule=t=>e.loadRuntime().then(e=>{if(!e[t])throw new Error(`SF runtime: no shared module "${t}"`);return e[t]})}}if("undefined"!=typeof window&&"undefined"!=typeof document){const e=window.SF_BOOT_CONFIG?.icons?.enabled,t=window.SF_ICON_SUBSET_ENABLED,n="boolean"==typeof e?e:"boolean"!=typeof t||t,o=document.documentElement;if(n&&o&&!o.hasAttribute("data-sf-icons")&&(o.setAttribute("data-sf-icons","subset-pending"),setTimeout(()=>{"subset-pending"===o.getAttribute("data-sf-icons")&&o.removeAttribute("data-sf-icons")},6e3)),n&&document.head)try{const e=new URL(window.SF_BOOT_CONFIG?.icons?.subsetHost||window.SF_ICON_SUBSET_HOST||"https://icons.simai.io",document.baseURI).origin;if(e!==window.location.origin&&!document.head.querySelector(`link[rel="preconnect"][href="${e}"]`)){const t=document.createElement("link");t.rel="preconnect",t.href=e,t.crossOrigin="anonymous",document.head.appendChild(t)}}catch{}}(()=>{window.SF_BOOT_CONFIG||(window.SF_BOOT_CONFIG={}),void 0===window.SF_BOOT_CONFIG.preloader&&(window.SF_BOOT_CONFIG.preloader={wrap:null,preloaderActive:!1});(()=>{if(!1===window.SF_BOOT_CONFIG?.theme)return;const e=["theme-dark","theme-light"],t=document.documentElement;if(!t)return;let n;try{n=document.cookie.split("; ").find(e=>e.startsWith("sf-theme="))}catch{n=void 0}let o="";if(n)try{o=decodeURIComponent(n.split("=")[1])}catch{o=""}const i=["light","dark"].includes(o)?o:"system",s="dark"===i||"system"===i&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?e[0]:e[1];t.classList.remove(...e),t.classList.add(s)})(),window.sfPath||(window.sfPath="https://cdn.jsdelivr.net/gh/simai/ui@main/distr/");(()=>{const e=document.documentElement;if(!e||e.getAttribute("dir"))return;const t=window.getComputedStyle&&e?window.getComputedStyle(e).direction:"";e.setAttribute("dir","rtl"===t?"rtl":"ltr")})();(()=>{if(window.SF_PRELOADED&&Object.keys(window.SF_PRELOADED.modules||{}).length)return;const e=()=>!!document.body&&(document.body.style.opacity="0",!0);if(!e()){new MutationObserver((t,n)=>{e()&&n.disconnect()}).observe(document.documentElement,{childList:!0})}window.addEventListener("sf-loader-ready",()=>{document.body&&(document.body.style.opacity="1")},{once:!0})})();(()=>{const e={enabled:!0,background:(0,Mn.vq)(),modifier:"loader-default",tempStyles:"inset: 0;position: fixed;width: 100%;height: 100vh;opacity: 1;z-index: 1000;background-color: var(--sf-color--surface-highest, var(--sf-surface-0, #fff));text-align: center;",color:(0,Mn.c6)(),width:Mn.Hg.width,height:Mn.Hg.height,content:"",delay:300,...window.SF_BOOT_CONFIG?.preloader||{}};if(!1===e.enabled||document.querySelector(".sf-loader"))return;const t=e.content||(0,Mn.ub)(e);let n=null,o=null,i=!1,s=null;const r=()=>{o&&(0,Mn.$Y)(o)},a=()=>{if(i||document.querySelector(".sf-loader"))return;n=document.createElement("div");const s=document.createElement("div");n.classList.add("sf-loader",e.modifier),n.setAttribute("data-sf-observer","ignore"),n.setAttribute("style",e.tempStyles),e.background&&(n.style.background=e.background),s.classList.add("sf-loader-block","sf-loader-boot"),s.setAttribute("style","display:flex; width: 100%;height: 100%;align-items: center;justify-content: center; transition: .2s all ease-in-out;"),s.innerHTML=t,n.append(s),document.documentElement.append(n),o=s,i=!0,window.SF_BOOT_CONFIG.preloader={wrap:n,preloaderActive:!0},(0,Mn.VE)(o,()=>i,e)};window.addEventListener("sf-loader-init",()=>{o?.classList?.contains("sf-loader-boot")&&(i=!1,r())},{once:!0}),window.addEventListener("sf-loader-ready",()=>{s&&(clearTimeout(s),s=null,o&&o.classList.add("hidden")),i=!1,r(),n&&n.classList.add("hidden")},{once:!0}),e.delay>0?s=setTimeout(a,e.delay):a()})();const e=e=>{if(!e)return;const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n=[];for(;t.nextNode();){const e=t.currentNode;e.nodeValue&&e.nodeValue.includes("[!")&&n.push(e)}n.forEach(e=>{const t=e.nodeValue,n=/\[!([a-zA-Z0-9_-]+)(?:\s+[^\](]+?)?](?:\([^)]*\))?(?:#[a-zA-Z0-9_-]+)?/g;let o=0;const i=document.createDocumentFragment();for(const e of t.matchAll(n)){const n=e.index??t.indexOf(e[0],o),s=n+e[0].length;n>o&&i.appendChild(document.createTextNode(t.slice(o,n)));const r=document.createComment("sf-shortcode "+e[0]);(window.SF_BOOT_SHORTCODES=window.SF_BOOT_SHORTCODES||[]).push(r),i.appendChild(r),o=s}o<t.length&&i.appendChild(document.createTextNode(t.slice(o))),e.replaceWith(i)})},t=new MutationObserver(t=>{t.forEach(t=>t.addedNodes&&t.addedNodes.forEach(t=>{(e=>{const t=e instanceof Element?e:e?.parentElement||null;return Boolean(t?.closest?.('[data-sf-observer="ignore"]'))})(t)||(t.nodeType===Node.TEXT_NODE||t instanceof Text?t.nodeValue?.includes("[!")&&e(t.parentNode):t instanceof HTMLElement&&e(t))}))});t.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("sf-loader-init",()=>t.disconnect(),{once:!0})})();(async()=>{(()=>{const e=[...document.scripts].find(e=>/\/core\/js\/core(?:\.min)?\.js(?:[?#]|$)/u.test(e.src));if(e&&"function"==typeof document.createElement)for(const t of["core-rules","core-system","core-loader"]){const n=e.src.replace(/core(\.min)?\.js(?=[?#]|$)/u,(e,n)=>`${t}${n||""}.js`);if(document.querySelector(`link[rel="preload"][href="${n}"]`))continue;const o=document.createElement("link");o.rel="preload",o.as="script",o.href=n,document.head.append(o)}})(),await n.e(80841737880868).then(n.bind(n,"a216dbc16e89")),await n.e(88616323197113).then(n.bind(n,"d55d5a9f332f")),await n.e(88616323197113).then(n.bind(n,"fedbedd6b87f")),await n.e(66700837013363).then(n.bind(n,"12a68c68589c"))})()})()})();
|
|
64
|
+
})();`,At="VOLJzSJh85fxDvhl9WytjdmjtDAUN8JT5veHYwFCVPA=";function Lt(){return`<!doctype html><html><head><meta charset="utf-8"><meta http-equiv="Content-Security-Policy" content="${["default-src 'none'",`script-src 'sha256-${At}' blob:`,"style-src 'unsafe-inline'","img-src data: blob:","media-src data: blob:","font-src data:","connect-src 'none'","worker-src 'none'","frame-src 'none'","child-src 'none'","object-src 'none'","manifest-src 'none'","form-action 'none'","base-uri 'none'"].join("; ")}"><style>html,body{margin:0;block-size:100%;overflow:hidden;background:transparent}#host{position:absolute;inset:0;overflow:hidden}</style></head><body><div id="host"></div><script>${jt}<\/script></body></html>`}const Pt=["primary","secondary","tertiary","neutral","neutral-variant","error","warning","success","info"];function zt(e){const t=globalThis.getComputedStyle(e),n={};for(const e of Pt)for(let o=0;o<=100;o+=1){const i=`--sf-${e}-${o}`,s=t.getPropertyValue(i).trim();s&&s.length<=200&&(n[i]=s)}return n}const Rt=e=>Boolean(e)&&Et.has(e);function Ct(e,{manifest:t,module:n,stored:o={},locale:i,scheme:s}={}){if(!(e instanceof globalThis.Element))throw new TypeError("An effect mounts into an element");const r=yt(t);if(r.length)throw new TypeError(`Effect manifest is invalid: ${r.join("; ")}`);const a="function"==typeof n?n:n?.mount;if("function"!=typeof a)throw new TypeError("An effect module exports mount(host, settings, context)");e.setAttribute("aria-hidden","true"),e.style.pointerEvents="none";const l=!e.hasAttribute("data-sf-effect");l&&e.setAttribute("data-sf-effect",t.id);const c=!e.hasAttribute($t);c&&e.setAttribute($t,"running");const u=e.ownerDocument;let{settings:d}=wt(t,o);const f=vt(t),p=e=>f.includes(e)?e:f[0];let m=p(s);const h=()=>Object.freeze({reducedMotion:Boolean(globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches),locale:i??(u.documentElement.getAttribute("lang")||"en"),scheme:m});let g=a(e,d,h())??{},y=!0,b=!1,w=!1,v=!1;const _=(n,...o)=>{try{g?.[n]?.(...o)}catch(o){e.dispatchEvent(new globalThis.CustomEvent("sf-effect-error",{bubbles:!0,detail:{effect:t.id,phase:n,message:String(o?.message??o)}}))}},x=()=>{if(v)return;const e=!b&&!u.hidden&&!w;e!==y&&(y=e,_(e?"resume":"pause"))};u.addEventListener("visibilitychange",x);const $=globalThis.matchMedia?.("(prefers-reduced-motion: reduce)"),k=()=>{v||(_("destroy"),e.replaceChildren(),g=a(e,d,h())??{},y=!0,x())};$?.addEventListener?.("change",k);const S=globalThis.IntersectionObserver,E=S?new S(e=>{w=!e[e.length-1].isIntersecting,x()}):null;return E?.observe(e),x(),Object.freeze({update(e,{scheme:n}={}){v||(d=wt(t,e).settings,void 0!==n&&(m=p(n)),_("update",d,h()))},get scheme(){return m},get sandboxed(){return Rt(n)},pause(){b=!0,x()},resume(){b=!1,x()},destroy(){v||(v=!0,u.removeEventListener("visibilitychange",x),$?.removeEventListener?.("change",k),E?.disconnect(),_("destroy"),e.replaceChildren(),l&&e.removeAttribute("data-sf-effect"),c&&e.removeAttribute($t))}})}const Ft=["auto","dark","light"],Nt=["theme-dark","theme-light"];function It(e=globalThis.document){const t=e?.documentElement;return t?.classList.contains("theme-dark")?"dark":t?.classList.contains("theme-light")?"light":globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Mt(e,{pageScheme:t,themeMode:n="auto",pair:o,foreign:i}={}){if(!Ft.includes(n))return Object.freeze({hidden:!0,reason:"unknown-theme-mode"});const s="auto"===n?"dark"===(t??It())?"dark":"light":n,r=vt(e);if(r.includes(s))return Object.freeze({effect:"self",scheme:s});if("string"==typeof e?.pair){const t=_t(e);if(t&&"sandbox"!==Tt(i))return Object.freeze({hidden:!0,reason:"foreign-pair-needs-sandbox"});if(!o||vt(o).includes(s))return Object.freeze(t?{effect:"pair",scheme:s,pair:e.pair,sandboxed:!0}:{effect:"pair",scheme:s,pair:e.pair})}return"auto"===n&&"light"===s&&r.includes("dark")?Object.freeze({effect:"self",scheme:"dark"}):Object.freeze({hidden:!0,reason:"auto"===n?"light-only-on-dark":"mode-not-drawable"})}const qt="sf-effect-area";const Dt=new Set;let Bt=null;const Ut=new Set(["foreign-pair-needs-sandbox","pair-refused"]);function Wt(e,t,n,o={}){globalThis.console?.warn?.(`SF.Effects: ${t} is not run (${n})`,o),e.dispatchEvent(new globalThis.CustomEvent("sf-effect-refused",{bubbles:!0,detail:{effect:t,reason:n,...o}}))}function Ht({element:e,host:t,areas:n,manifest:o,module:i,pair:s,pairRefused:r,stored:a={},locale:l,themeMode:c="auto",windows:u=!1,foreign:d}){const f=yt(o);if(f.length)throw new TypeError(`Effect manifest is invalid: ${f.join("; ")}`);const p=_t(o),m=s&&ht(s.manifest)&&!yt(s.manifest).length&&(p?Rt(s.module):s.manifest.id===o.pair)?s:null,h=function(){const e=new Map,t=(e,t)=>{e.classList.remove(...Nt,qt),t.length&&e.classList.add(...t)};return{set(n,o){const i=`theme-${o}`;for(const t of n){e.has(t)||e.set(t,[...Nt,qt].filter(e=>t.classList.contains(e))),t.classList.contains(qt)||t.classList.add(qt);const n=Nt.find(e=>e!==i);t.classList.contains(n)&&t.classList.remove(n),t.classList.contains(i)||t.classList.add(i)}for(const[o,i]of e)n.includes(o)||(t(o,i),e.delete(o))},restore(){for(const[n,o]of e)t(n,o);e.clear()}}}();let g=c,y=a,b=null,w=null,v=!1,_=!1;e.setAttribute($t,"running");const x=()=>{if(_)return!1;const{next:a,drawn:c}=(()=>{const e=It(t.ownerDocument);let n=Mt(o,{pageScheme:e,themeMode:g,pair:m?.manifest,foreign:d});"pair"!==n.effect||m?"pair"===n.effect&&u&&!xt(m.manifest).includes("windows")&&(n={hidden:!0,reason:"pair-without-windows"}):n={hidden:!0,reason:p&&s?"foreign-pair-needs-sandbox":r?"pair-refused":"pair-not-loaded"};const i="dark"===g||"light"===g?g:e;return{next:Object.freeze(n),drawn:n.hidden?i:n.scheme}})();h.set(n(),c);const f=a.hidden?null:a.effect,x=w?w.hidden?null:w.effect:void 0,$=!w||w.hidden!==a.hidden||w.reason!==a.reason||w.scheme!==a.scheme||w.effect!==a.effect;w=a;let k=!1;if(x===f&&b)b.scheme!==c&&(b.update(y,{scheme:c}),k=!0);else if(x!==f&&(b?.destroy(),b=null,f)){const e="self"===f?{manifest:o,module:i}:m;b=Ct(t,{manifest:e.manifest,module:e.module,stored:y,locale:l,scheme:c}),v&&b.pause(),k=!0}return $&&(e.setAttribute($t,a.hidden?"hidden":"running"),a.hidden?e.setAttribute(kt,a.reason):e.removeAttribute(kt),a.hidden&&Ut.has(a.reason)&&Wt(e,o.pair??o.id,a.reason,{pairOf:o.id})),k},$=function(e){Dt.add(e);const t=globalThis.document;if(!Bt&&t?.documentElement){const e=()=>{for(const e of[...Dt])e()},n=new globalThis.MutationObserver(e);n.observe(t.documentElement,{attributes:!0,attributeFilter:["class"]});const o=globalThis.matchMedia?.("(prefers-color-scheme: dark)");o?.addEventListener?.("change",e),globalThis.addEventListener?.("sf-theme-change",e),Bt=()=>{n.disconnect(),o?.removeEventListener?.("change",e),globalThis.removeEventListener?.("sf-theme-change",e)}}return()=>{Dt.delete(e),!Dt.size&&Bt&&(Bt(),Bt=null)}}(()=>{"auto"===g&&x()});try{x()}catch(t){throw $(),h.restore(),e.removeAttribute($t),t}const k=Object.freeze({update(e=y,{themeMode:t}={}){_||(y=e,void 0!==t&&(g=t),x()||b?.update(y,{scheme:b.scheme}))},pause(){v=!0,b?.pause()},resume(){v=!1,b?.resume()},destroy(){_||(_=!0,$(),b?.destroy(),b=null,h.restore(),e.removeAttribute($t),e.removeAttribute(kt))},get scheme(){return b?.scheme??null},get effect(){return w.hidden?null:w.effect},get resolution(){return w},get themeMode(){return g},get sandboxed(){return b?.sandboxed??!1}});return{handle:k,apply:()=>x()}}function Vt(e){const t=e.ownerDocument.createElement("div");t.setAttribute("data-sf-effect-layer",""),t.style.cssText="position:absolute;inset:0;z-index:-1;overflow:hidden;border-radius:inherit;pointer-events:none";const n={position:e.style.position,isolation:e.style.isolation};return"static"===globalThis.getComputedStyle(e).position&&(e.style.position="relative"),e.style.isolation="isolate",e.prepend(t),{host:t,remove(){t.remove(),e.style.position=n.position,e.style.isolation=n.isolation}}}const Zt=e=>Number(e.toFixed(2));function Jt(e,t,n,o,i){const s=Math.min(n,o)/2,[r,a,l,c]=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"].map(e=>Zt(Math.min(((e,t)=>{const n=String(e).trim().split(/\s+/u)[0],o=Number.parseFloat(n);return Number.isFinite(o)?n.endsWith("%")?o/100*t:o:0})(i[e],Math.min(n,o)),s)));return[e,t,n,o]=[e,t,n,o].map(Zt),`M${Zt(e+r)} ${t}H${Zt(e+n-a)}A${a} ${a} 0 0 1 ${Zt(e+n)} ${Zt(t+a)}V${Zt(t+o-l)}A${l} ${l} 0 0 1 ${Zt(e+n-l)} ${Zt(t+o)}H${Zt(e+c)}A${c} ${c} 0 0 1 ${e} ${Zt(t+o-c)}V${Zt(t+r)}A${r} ${r} 0 0 1 ${Zt(e+r)} ${t}Z`}function Gt(e,{windows:t=St,...n}){if(!(e instanceof globalThis.Element))throw new TypeError("A windows group is an element");const o=yt(n.manifest);if(o.length)throw new TypeError(`Effect manifest is invalid: ${o.join("; ")}`);if(!xt(n.manifest).includes("windows"))throw new TypeError("The effect does not declare the windows capability");const i="string"==typeof t&&t?t:St,s=()=>[...e.querySelectorAll(i)],r=Vt(e);let a;try{a=Ht({...n,element:e,host:r.host,areas:s,windows:!0})}catch(e){throw r.remove(),e}let l=0;const c=()=>{l=0;const e=r.host.getBoundingClientRect(),t=s().map(t=>{const n=t.getBoundingClientRect();return n.width&&n.height?Jt(n.left-e.left,n.top-e.top,n.width,n.height,globalThis.getComputedStyle(t)):""}).filter(Boolean);r.host.style.clipPath=t.length?`path('${t.join(" ")}')`:"inset(50%)"},u=()=>{l||(l=globalThis.requestAnimationFrame(c))},d=globalThis.ResizeObserver,f=d?new d(u):null,p=()=>{if(f){f.disconnect(),f.observe(e);for(const e of s())f.observe(e)}},m=new globalThis.MutationObserver(e=>{e.every(e=>r.host.contains(e.target))||(p(),a.apply(),u())});m.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-sf-effect-window"]}),globalThis.addEventListener("scroll",u,{passive:!0,capture:!0}),globalThis.addEventListener("resize",u,{passive:!0}),p(),c();const{handle:h}=a;return Object.freeze({update:h.update,pause:h.pause,resume:h.resume,refresh(){p(),a.apply(),u()},destroy(){l&&globalThis.cancelAnimationFrame(l),l=0,f?.disconnect(),m.disconnect(),globalThis.removeEventListener("scroll",u,{capture:!0}),globalThis.removeEventListener("resize",u),h.destroy(),r.remove()},get scheme(){return h.scheme},get effect(){return h.effect},get resolution(){return h.resolution},get themeMode(){return h.themeMode},get sandboxed(){return h.sandboxed}})}class Xt extends Error{constructor(e,t={}){super(e),this.name="EffectRefused",this.reason=e,this.detail=t}}const Yt=e=>(new globalThis.TextDecoder).decode(e),Kt=()=>globalThis.document?.baseURI??globalThis.location?.href;function Qt(e){const t=e??Ot().catalogue;if("string"!=typeof t||!t)return null;try{const e=new URL(t,Kt());return e.search="",e.hash="",e.pathname.endsWith("/")||(e.pathname+="/"),e.href}catch{return null}}async function en(e){const t=globalThis.crypto?.subtle;if(!t)throw new Xt("no-integrity-check");return[...new Uint8Array(await t.digest("SHA-256",e))].map(e=>e.toString(16).padStart(2,"0")).join("")}async function tn(e){let t;try{t=await globalThis.fetch(e,{credentials:"omit",referrerPolicy:"no-referrer"})}catch{throw new Xt("fetch-failed",{url:e})}if(!t.ok)throw new Xt("fetch-failed",{url:e,status:t.status});return new Uint8Array(await t.arrayBuffer())}const nn=new Map;function on(e){if(!nn.has(e)){const t=(async()=>{const t=Ot(),n=Qt()===e,o=n&&t.index||"catalogue/index.json",i=await tn(new URL(o,e).href);if(n&&t.indexSha256&&await en(i)!==t.indexSha256)throw new Xt("integrity",{file:o});let s;try{s=JSON.parse(Yt(i))}catch{throw new Xt("invalid-index",{file:o})}if("simai.ui-effects.catalogue"!==s?.schema||!Array.isArray(s.effects))throw new Xt("invalid-index",{file:o});return s})();t.catch(()=>nn.delete(e)),nn.set(e,t)}return nn.get(e)}async function sn(e,t){const n=(await on(e)).effects.find(e=>e?.id===t);if(!n)throw new Xt("not-in-catalogue",{id:t});if("string"!=typeof n.path||!/^effects\/[a-z][a-z0-9-]{1,40}\/$/u.test(n.path))throw new Xt("invalid-index",{id:t});const o=new URL(n.path,e).href,i=new Map((Array.isArray(n.files)?n.files:[]).map(e=>[e?.path,e?.sha256])),s=async e=>{const n=i.get(e);if("string"!=typeof n)throw new Xt("file-not-in-index",{id:t,file:e});const s=await tn(new URL(e,o).href);if(await en(s)!==n.toLowerCase())throw new Xt("integrity",{id:t,file:e});return s},r=await s("effect.json");let a;try{a=JSON.parse(Yt(r))}catch{throw new Xt("invalid-manifest",{id:t})}const l=yt(a);if(l.length)throw new Xt("invalid-manifest",{id:t,problems:l});if(a.id!==t)throw new Xt("manifest-mismatch",{id:t});const c=await s(a.entry),u=[];for(const e of a.styles??[])u.push(Yt(await s(e)));const d=await async function(e){const t=globalThis.URL.createObjectURL(new globalThis.Blob([e],{type:"text/javascript"}));try{return await import(t)}catch(e){throw new Xt("module-failed",{message:String(e?.message??e)})}finally{globalThis.URL.revokeObjectURL(t)}}(c);if("function"!=typeof d?.mount)throw new Xt("module-failed",{id:t,message:"no mount export"});return Object.freeze({id:t,url:`${o}effect.json`,manifest:a,module:d,styles:Object.freeze(u),sandboxed:!1})}async function rn(e){const t=await tn(e);let n;try{n=JSON.parse(Yt(t))}catch{throw new Xt("invalid-manifest",{url:e})}const o=yt(n);if(o.length)throw new Xt("invalid-manifest",{url:e,problems:o});const i=Yt(await tn(new URL(n.entry,e).href)),s=[];for(const t of n.styles??[])s.push(Yt(await tn(new URL(t,e).href)));const r=function({id:e,source:t,styles:n=[]}){const o=Object.freeze({mount(o,i,s){const r=o.ownerDocument.createElement("iframe");r.setAttribute("sandbox","allow-scripts"),r.setAttribute("referrerpolicy","no-referrer"),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),r.setAttribute("title",""),r.setAttribute("data-sf-effect-sandbox","loading"),r.style.cssText="position:absolute;inset:0;inline-size:100%;block-size:100%;border:0;margin:0;padding:0;display:block;pointer-events:none;background:transparent",r.srcdoc=Lt();const a=new globalThis.MessageChannel,l=a.port1,c=[];let u=!1,d=0,f=!1;const p=()=>{const e=o.getBoundingClientRect();return{width:e.width,height:e.height}},m=e=>{f||(u?l.postMessage(e):c.push(e))},h=(t,n)=>o.dispatchEvent(new globalThis.CustomEvent("sf-effect-error",{bubbles:!0,detail:{effect:e,phase:t,message:n,sandboxed:!0}})),g=globalThis.ResizeObserver?new globalThis.ResizeObserver(()=>m({type:"size",size:p()})):null,y=()=>{f=!0,g?.disconnect(),l.close(),r.remove()};return l.onmessage=({data:e})=>{!f&&ht(e)&&("mounted"===e.type?r.setAttribute("data-sf-effect-sandbox","mounted"):"error"===e.type&&h(String(e.phase).slice(0,40),String(e.message).slice(0,500)))},l.start(),r.addEventListener("load",()=>{if(!f){if(d+=1,d>1)return h("sandbox","the sandbox frame navigated away and was removed"),void y();r.contentWindow?.postMessage("sf-effect-sandbox","*",[a.port2]),u=!0;for(const e of c.splice(0))l.postMessage(e)}}),m({type:"mount",source:t,styles:[...n],settings:{...i},context:{...s},tones:zt(o),size:p()}),o.append(r),g?.observe(o),{update(e,t){m({type:"update",settings:{...e},context:{...t},tones:zt(o)})},pause(){m({type:"pause"})},resume(){m({type:"resume"})},destroy(){f||(m({type:"destroy"}),y())}}}});return Et.add(o),o}({id:n.id,source:i,styles:s});return Object.freeze({id:n.id,url:e,manifest:n,module:r,styles:Object.freeze([]),sandboxed:!0})}async function an(e,t,n){if("string"!=typeof e||!e.trim())throw new Xt("no-effect");const o=e.trim();if(at.test(o)){if(!t)throw new Xt("no-catalogue",{id:o});return{id:o}}const i="sandbox"===Tt(n);let s;try{s=new URL(o,Kt()).href}catch{throw new Xt(i?"invalid-reference":"foreign-effect-needs-sandbox",{url:o})}if(!t||!s.startsWith(t)){if(!i)throw new Xt("foreign-effect-needs-sandbox",{url:s});const e=function(e){const t=new URL(e),n=new URL(Kt()).origin;return"https:"!==t.protocol&&t.origin!==n||!t.pathname.endsWith("/effect.json")||t.username||t.password?null:(t.hash="",t.href)}(s);if(!e)throw new Xt("invalid-reference",{url:s});return{foreign:e}}const r=(await on(t)).effects.find(e=>"string"==typeof e?.path&&new URL(`${e.path}effect.json`,t).href===s);if(!r)throw new Xt("not-in-catalogue",{url:s});return{id:r.id}}const ln=new Map;function cn(e,{catalogue:t,foreign:n}={}){const o=Qt(t);return(async()=>{const t=await an(e,o,n),i=t.foreign?`foreign\n${t.foreign}`:`${o}\n${t.id}`;if(!ln.has(i)){const e=t.foreign?rn(t.foreign):sn(o,t.id);e.catch(()=>ln.delete(i)),ln.set(i,e)}return ln.get(i)})()}const un=new Map;function dn(e,t){if(!e?.styles?.length)return()=>{};let n=un.get(e.url);if(!n){const o=e.styles.map(n=>{const o=t.createElement("style");return o.setAttribute("data-sf-effect-style",e.id),o.textContent=n,t.head.append(o),o});n={nodes:o,count:0},un.set(e.url,n)}n.count+=1;let o=!1;return()=>{if(!o&&(o=!0,n.count-=1,!n.count)){for(const e of n.nodes)e.remove();un.delete(e.url)}}}const fn=new Map;async function pn(e,t={}){if(!(e instanceof globalThis.Element))throw new TypeError("An effect is placed on an element");const{effect:n,settings:o={},themeMode:i="auto",windows:s=!1,catalogue:r,locale:a,foreign:l}=t;fn.get(e)?.destroy(),e.setAttribute($t,"loading"),e.removeAttribute(kt);try{const t=await cn(n,{catalogue:r,foreign:l});if(s&&!xt(t.manifest).includes("windows"))throw new Xt("windows-not-declared",{id:t.id});let c=null,u=null;if("string"==typeof t.manifest.pair){const n=_t(t.manifest);if(!n&&t.sandboxed)u="pair-of-foreign-effect",Wt(e,t.manifest.pair,u,{pairOf:t.id});else if(!n||"sandbox"===Tt(l))try{c=await cn(t.manifest.pair,{catalogue:r,foreign:l})}catch(n){u=n?.reason??"pair-failed",Wt(e,t.manifest.pair,u,{pairOf:t.id,...n?.detail??{}})}}if("loading"!==e.getAttribute($t))return null;if(!e.isConnected)return e.removeAttribute($t),null;const d=[dn(t,e.ownerDocument),dn(c,e.ownerDocument)],f={manifest:t.manifest,module:t.module,pair:c?{manifest:c.manifest,module:c.module}:void 0,pairRefused:u,stored:o,locale:a,themeMode:i,foreign:l};let p,m=null;try{s?p=Gt(e,{...f,windows:s}):(m=Vt(e),p=Ht({...f,element:e,host:m.host,areas:()=>[e]}).handle)}catch(e){m?.remove();for(const e of d)e();throw e}const h=Object.freeze({update:p.update,pause:p.pause,resume:p.resume,destroy(){fn.get(e)===h&&fn.delete(e),p.destroy(),m?.remove();for(const e of d)e()},get scheme(){return p.scheme},get effect(){return p.effect},get resolution(){return p.resolution},get themeMode(){return p.themeMode},get sandboxed(){return p.sandboxed}});return fn.set(e,h),h}catch(t){return t instanceof Xt?(e.setAttribute($t,"refused"),e.setAttribute(kt,t.reason),Wt(e,n,t.reason,t.detail)):(e.setAttribute($t,"failed"),e.removeAttribute(kt),e.dispatchEvent(new globalThis.CustomEvent("sf-effect-error",{bubbles:!0,detail:{effect:n,phase:"mount",message:String(t?.message??t)}}))),null}}const mn=`[data-sf-effect]:not([${$t}]), [data-sf-effect-windows]:not([${$t}])`;function hn(e){const t=e.hasAttribute("data-sf-effect-windows"),n=e.getAttribute(t?"data-sf-effect-windows":"data-sf-effect");let o={};const i=e.getAttribute("data-sf-effect-settings");if(i)try{const e=JSON.parse(i);if(!ht(e))throw new TypeError("not an object");o=e}catch{globalThis.console?.warn?.(`SF.Effects: data-sf-effect-settings of ${n} is not a JSON object; the defaults are used`)}const s=e.getAttribute("data-sf-effect-theme")||"auto";return pn(e,{effect:n,settings:o,themeMode:s,windows:t})}function gn(e){const t=e instanceof globalThis.Element&&e.matches(mn)?[e]:[];t.push(...e.querySelectorAll?.(mn)??[]);for(const e of t)hn(e)}if("undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.Effects=Object.freeze({checkEffectManifest:yt,checkSetting:bt,effectSettings:wt,effectSchemes:vt,pairIsForeign:_t,foreignMode:Tt,allowedModes:function(e,{pair:t,foreign:n}={}){const o=new Set(vt(e));if(((e,t)=>"string"==typeof e?.pair&&(!_t(e)||"sandbox"===Tt(t)))(e,n))for(const e of t?vt(t):ft)o.add(e);return["auto",...ft.filter(e=>o.has(e))]},resolveTheme:Mt,pageScheme:It,mountEffect:function(e,t={}){if(void 0===t.themeMode)return Ct(e,t);if(!(e instanceof globalThis.Element))throw new TypeError("An effect mounts into an element");const n=t.area instanceof globalThis.Element?t.area:e,{manifest:o,module:i,pair:s,stored:r,locale:a,themeMode:l,foreign:c}=t;return Ht({element:n,host:e,areas:()=>[n],manifest:o,module:i,pair:s,stored:r,locale:a,themeMode:l,foreign:c}).handle},mountWindows:function(e,t={}){const{manifest:n,module:o,pair:i,stored:s,locale:r,themeMode:a="auto",windows:l,foreign:c}=t;return Gt(e,{manifest:n,module:o,pair:i,stored:s,locale:r,themeMode:a,windows:l,foreign:c})},loadEffect:cn,placeEffect:pn,EFFECT_FORMAT:st,SANDBOX_RUNNER_SHA256:At,get EFFECT_SCHEMA(){return t({kind:"global",from:"SF.Effects.EFFECT_SCHEMA",to:"SF.Effects.EFFECT_FORMAT"}),"simai.effect.v1"}}),"undefined"!=typeof document&&document.documentElement)){const e=()=>function(e){const t=e.querySelector(mn);gn(e),(Ot().catalogue||t)&&new globalThis.MutationObserver(e=>{for(const t of e){for(const e of t.addedNodes)1===e.nodeType&&gn(e);if(t.removedNodes.length)for(const[e,t]of fn)e.isConnected||t.destroy()}}).observe(e.documentElement,{childList:!0,subtree:!0})}(document);"complete"===document.readyState?globalThis.setTimeout(e,0):window.addEventListener("load",e,{once:!0})}const yn=(()=>{const e="undefined"!=typeof globalThis?globalThis:{},t="__sfPageLanguage";return e[t]||(e[t]={listeners:new Set,registered:new Map,chosen:null}),e[t]})(),bn=yn.listeners,wn=yn.registered,vn=e=>String(e??"").trim().toLowerCase().replace("_","-"),_n=()=>{for(const e of[...bn])try{e()}catch{}};function xn(e){let t=e;for(;t;){const e="function"==typeof t.closest?t.closest("[lang]"):null;if(e)return e;const n="function"==typeof t.getRootNode?t.getRootNode():null;t=n&&n!==t&&n.host?n.host:null}return null}function $n(e){if(yn.chosen)return yn.chosen.split("-")[0];const t=xn(e),n=t?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en";return vn(n).split("-")[0]||"en"}function kn(e){if(yn.chosen)return yn.chosen;const t=xn(e);return vn(t?.getAttribute("lang")||globalThis.document?.documentElement?.lang||"en")}function Sn(e,t,n,o){const i=o??(e=>{const t=e?.tagName;return"string"==typeof t?t.toLowerCase():null})(n);for(const o of(e=>{const t=vn(e),n=t.split("-")[0],o=[];for(const e of[t,n,"en"])e&&!o.includes(e)&&o.push(e);return o})(kn(n))){const n=i?wn.get(i)?.get(o)?.[t]:void 0;if(void 0!==n)return n;const s=e?.[o]?.[t];if(void 0!==s)return s}return t}const En={current:(e=globalThis.document?.documentElement??null)=>kn(e),use(e){const t=null==e?null:vn(e);return t===yn.chosen||(yn.chosen=t,_n()),yn.chosen},register(e,t,n){const o=String(e??"").toLowerCase(),i=vn(t);if(!o||!i)throw new TypeError("a component and a language are required");wn.has(o)||wn.set(o,new Map);const s=wn.get(o);return null===n?s.delete(i):s.set(i,{...s.get(i)??{},...n}),_n(),this},registerAll(e,t={}){for(const[n,o]of Object.entries(t))this.register(n,e,o);return this},known(e){const t=String(e??"").toLowerCase();return[...wn.get(t)?.keys()??[]]},components:()=>[...wn.keys()],onChange:e=>"function"!=typeof e?()=>{}:(bn.add(e),()=>bn.delete(e)),forget(){return wn.clear(),yn.chosen=null,_n(),this}};"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.language=En,window.SF.pageLanguage=$n,window.SF.pageText=Sn);const On={en:{region:"Notifications"},ru:{region:"Уведомления"}},Tn=new Set(["neutral","info","success","warning","error"]),jn={success:"check_circle",info:"info",warning:"warning",error:"error",neutral:""},An={neutral:5e3,info:5e3,success:5e3,warning:8e3,error:1e4},Ln=new Set(["top-start","top-end","bottom-start","bottom-end"]),Pn={region:null,shown:[],waiting:[],history:[],max:4,placement:"bottom-end",counter:0};function zn(){return globalThis.SF?.Toast?.create?globalThis.SF.Toast:null}function Rn(){if(Pn.region?.isConnected)return Pn.region;const e=document.createElement("section");return e.className="sf-notifications",e.dataset.placement=Pn.placement,e.setAttribute("aria-label",Sn(On,"region",document.documentElement)),"function"==typeof e.showPopover&&e.setAttribute("popover","manual"),e.addEventListener("sf-toast-close",e=>{const t=Pn.shown.find(t=>t.toast===e.target);t&&Fn(t)}),e.addEventListener("sf-toast-action",e=>{const t=Pn.shown.find(t=>t.toast===e.detail?.toast);t&&(t.options.action?.onSelect?.(t.record),globalThis.SF?.Toast?.dismiss?.(t.toast))}),document.body.append(e),Pn.region=e,e}function Cn(){const e=Pn.region;!e||Pn.shown.length||Pn.waiting.length||"function"==typeof e.hidePopover&&e.matches(":popover-open")&&e.hidePopover()}function Fn(e){Pn.shown=Pn.shown.filter(t=>t!==e);const t=Pn.waiting.shift();t?Nn(t):setTimeout(Cn,0)}async function Nn(e){Pn.shown.push(e);const t=await(zn()?Promise.resolve(zn()):(globalThis.SF?.Loader?.ensurePlugin?.("toast"),new Promise(e=>{const t=()=>{globalThis.removeEventListener("Toast:ready",t),e(zn())};globalThis.addEventListener("Toast:ready",t);const n=e=>{if(zn())return t();e>0&&setTimeout(()=>n(e-1),100)};n(50)})));if(!t||!Pn.shown.includes(e))return;const{record:n,options:o}=e,i=t.create({status:n.status,icon:o.icon??jn[n.status],title:n.title,supportingText:n.text,actionText:o.action?.label??"",action:o.action?o.action.id??"action":"",closable:!0,duration:o.duration,role:"error"===n.status?"alert":"status"});i.dataset.sfNotification=n.id,e.count>1&&(i.dataset.count=String(e.count)),e.toast=i,function(){const e=Rn();if("function"==typeof e.showPopover&&!e.matches(":popover-open"))try{e.showPopover()}catch{}}();const s=Rn();Pn.placement.startsWith("top")?s.prepend(i):s.append(i)}function In(e){const t=Pn.waiting.findIndex(t=>t.record.id===e);if(-1!==t)return Pn.waiting.splice(t,1),!0;const n=Pn.shown.find(t=>t.record.id===e);return!!n&&(n.toast?globalThis.SF?.Toast?.dismiss?.(n.toast)??!1:(Fn(n),!0))}"undefined"!=typeof window&&(window.SF=window.SF||{},window.SF.notify||(window.SF.notify=function(e={}){if("undefined"==typeof document)return null;const{status:t,title:n,text:o,duration:i}=function(e){const t=Tn.has(e.status)?e.status:"neutral";return{status:t,title:String(e.title??"").trim(),text:String(e.text??"").trim(),duration:Number.isFinite(Number(e.duration))?Math.max(0,Number(e.duration)):An[t]}}(e);if(!n&&!o)return null;Pn.counter+=1;const s=Object.freeze({id:`n${Date.now().toString(36)}${Pn.counter}`,status:t,title:n,text:o,source:String(e.source??""),time:(new Date).toISOString()}),r=String(e.key??`${t}|${n}|${o}`),a=document.dispatchEvent(new CustomEvent("sf-notification",{bubbles:!0,cancelable:!0,detail:s}));Pn.history=[s,...Pn.history].slice(0,50);const l={id:s.id,close:()=>In(s.id)};if(!a||e.silent)return l;const c=[...Pn.shown,...Pn.waiting].find(e=>e.key===r);if(c)return c.count=(c.count??1)+1,c.toast&&(c.toast.dataset.count=String(c.count),globalThis.SF?.Toast?.unbind?.(c.toast),globalThis.SF?.Toast?.bind?.(c.toast)),{id:c.record.id,close:()=>In(c.record.id)};const u={record:s,key:r,options:{...e,duration:i},count:1,toast:null};return Pn.shown.length>=Pn.max?Pn.waiting.push(u):Nn(u),l},window.SF.notifications={configure:function({placement:e,max:t}={}){return Ln.has(e)&&(Pn.placement=e,Pn.region&&(Pn.region.dataset.placement=e)),Number.isInteger(t)&&t>0&&(Pn.max=t),{placement:Pn.placement,max:Pn.max}},close:In,history:()=>Pn.history.slice()}));var Mn=n("6c7f357fe960");if("undefined"!=typeof window){window.SF=window.SF||{};const e=window.SF;if(!e.loadRuntime){let t=null;const n=()=>[...document.scripts].find(e=>/\/core\/js\/core(?:\.min)?\.js(?:[?#]|$)/u.test(e.src));e.loadRuntime=()=>t||(e.__internal.runtimeModules?(e.__internal.runtimeSettled=!0,t=Promise.resolve(e.__internal.runtimeModules)):t=new Promise((t,o)=>{e.__internal.runtimeArrived=n=>{e.__internal.runtimeSettled=!0,t(n)};const i=n();if(!i)return;const s=document.createElement("script");s.src=i.src.replace(/core(\.min)?\.js(?=[?#]|$)/u,(e,t)=>`smart-base${t||""}.js`),s.async=!0,s.addEventListener("error",()=>o(new Error(`SF runtime: ${s.src} did not load`))),document.head.append(s)}),e.__internal.runtimeLoading=t,t),e.runtimeModule=t=>e.loadRuntime().then(e=>{if(!e[t])throw new Error(`SF runtime: no shared module "${t}"`);return e[t]})}}if("undefined"!=typeof window&&"undefined"!=typeof document){const e=window.SF_BOOT_CONFIG?.icons?.enabled,t=window.SF_ICON_SUBSET_ENABLED,n="boolean"==typeof e?e:"boolean"!=typeof t||t,o=document.documentElement;if(n&&o&&!o.hasAttribute("data-sf-icons")&&(o.setAttribute("data-sf-icons","subset-pending"),setTimeout(()=>{"subset-pending"===o.getAttribute("data-sf-icons")&&o.removeAttribute("data-sf-icons")},6e3)),n&&document.head)try{const e=new URL(window.SF_BOOT_CONFIG?.icons?.subsetHost||window.SF_ICON_SUBSET_HOST||"https://icons.simai.io",document.baseURI).origin;if(e!==window.location.origin&&!document.head.querySelector(`link[rel="preconnect"][href="${e}"]`)){const t=document.createElement("link");t.rel="preconnect",t.href=e,t.crossOrigin="anonymous",document.head.appendChild(t)}}catch{}}(()=>{window.SF_BOOT_CONFIG||(window.SF_BOOT_CONFIG={}),void 0===window.SF_BOOT_CONFIG.preloader&&(window.SF_BOOT_CONFIG.preloader={wrap:null,preloaderActive:!1});const e=window.SF_BOOT_CONFIG.spinner;"string"==typeof e&&e.trim()&&document.documentElement&&!document.documentElement.hasAttribute("data-sf-spinner")&&document.documentElement.setAttribute("data-sf-spinner",e.trim().toLowerCase());(()=>{if(!1===window.SF_BOOT_CONFIG?.theme)return;const e=["theme-dark","theme-light"],t=document.documentElement;if(!t)return;let n;try{n=document.cookie.split("; ").find(e=>e.startsWith("sf-theme="))}catch{n=void 0}let o="";if(n)try{o=decodeURIComponent(n.split("=")[1])}catch{o=""}const i=["light","dark"].includes(o)?o:"system",s="dark"===i||"system"===i&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?e[0]:e[1];t.classList.remove(...e),t.classList.add(s)})(),window.sfPath||(window.sfPath="https://cdn.jsdelivr.net/gh/simai/ui@main/distr/");(()=>{const e=document.documentElement;if(!e||e.getAttribute("dir"))return;const t=window.getComputedStyle&&e?window.getComputedStyle(e).direction:"";e.setAttribute("dir","rtl"===t?"rtl":"ltr")})();(()=>{if(window.SF_PRELOADED&&Object.keys(window.SF_PRELOADED.modules||{}).length)return;const e=()=>!!document.body&&(document.body.style.opacity="0",!0);if(!e()){new MutationObserver((t,n)=>{e()&&n.disconnect()}).observe(document.documentElement,{childList:!0})}window.addEventListener("sf-loader-ready",()=>{document.body&&(document.body.style.opacity="1")},{once:!0})})();(()=>{const e={enabled:!0,background:(0,Mn.vq)(),modifier:"loader-default",tempStyles:"inset: 0;position: fixed;width: 100%;height: 100vh;opacity: 1;z-index: 1000;background-color: var(--sf-color--surface-highest, var(--sf-surface-0, #fff));text-align: center;",color:(0,Mn.c6)(),width:Mn.Hg.width,height:Mn.Hg.height,content:"",delay:300,...window.SF_BOOT_CONFIG?.preloader||{}};if(!1===e.enabled||document.querySelector(".sf-loader"))return;const t=e.content||(0,Mn.ub)(e);let n=null,o=null,i=!1,s=null;const r=()=>{o&&(0,Mn.$Y)(o)},a=()=>{if(i||document.querySelector(".sf-loader"))return;n=document.createElement("div");const s=document.createElement("div");n.classList.add("sf-loader",e.modifier),n.setAttribute("data-sf-observer","ignore"),n.setAttribute("style",e.tempStyles),e.background&&(n.style.background=e.background),s.classList.add("sf-loader-block","sf-loader-boot"),s.setAttribute("style","display:flex; width: 100%;height: 100%;align-items: center;justify-content: center; transition: .2s all ease-in-out;"),s.innerHTML=t,n.append(s),document.documentElement.append(n),o=s,i=!0,window.SF_BOOT_CONFIG.preloader={wrap:n,preloaderActive:!0},(0,Mn.VE)(o,()=>i,e)};window.addEventListener("sf-loader-init",()=>{o?.classList?.contains("sf-loader-boot")&&(i=!1,r())},{once:!0}),window.addEventListener("sf-loader-ready",()=>{s&&(clearTimeout(s),s=null,o&&o.classList.add("hidden")),i=!1,r(),n&&n.classList.add("hidden")},{once:!0}),e.delay>0?s=setTimeout(a,e.delay):a()})();const t=e=>{if(!e)return;const t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n=[];for(;t.nextNode();){const e=t.currentNode;e.nodeValue&&e.nodeValue.includes("[!")&&n.push(e)}n.forEach(e=>{const t=e.nodeValue,n=/\[!([a-zA-Z0-9_-]+)(?:\s+[^\](]+?)?](?:\([^)]*\))?(?:#[a-zA-Z0-9_-]+)?/g;let o=0;const i=document.createDocumentFragment();for(const e of t.matchAll(n)){const n=e.index??t.indexOf(e[0],o),s=n+e[0].length;n>o&&i.appendChild(document.createTextNode(t.slice(o,n)));const r=document.createComment("sf-shortcode "+e[0]);(window.SF_BOOT_SHORTCODES=window.SF_BOOT_SHORTCODES||[]).push(r),i.appendChild(r),o=s}o<t.length&&i.appendChild(document.createTextNode(t.slice(o))),e.replaceWith(i)})},n=new MutationObserver(e=>{e.forEach(e=>e.addedNodes&&e.addedNodes.forEach(e=>{(e=>{const t=e instanceof Element?e:e?.parentElement||null;return Boolean(t?.closest?.('[data-sf-observer="ignore"]'))})(e)||(e.nodeType===Node.TEXT_NODE||e instanceof Text?e.nodeValue?.includes("[!")&&t(e.parentNode):e instanceof HTMLElement&&t(e))}))});n.observe(document.documentElement,{childList:!0,subtree:!0}),window.addEventListener("sf-loader-init",()=>n.disconnect(),{once:!0})})();(async()=>{(()=>{const e=[...document.scripts].find(e=>/\/core\/js\/core(?:\.min)?\.js(?:[?#]|$)/u.test(e.src));if(e&&"function"==typeof document.createElement)for(const t of["core-rules","core-system","core-loader"]){const n=e.src.replace(/core(\.min)?\.js(?=[?#]|$)/u,(e,n)=>`${t}${n||""}.js`);if(document.querySelector(`link[rel="preload"][href="${n}"]`))continue;const o=document.createElement("link");o.rel="preload",o.as="script",o.href=n,document.head.append(o)}})(),await n.e(80841737880868).then(n.bind(n,"a216dbc16e89")),await n.e(88616323197113).then(n.bind(n,"d55d5a9f332f")),await n.e(88616323197113).then(n.bind(n,"fedbedd6b87f")),await n.e(66700837013363).then(n.bind(n,"12a68c68589c"))})()})()})();
|
|
@@ -223,7 +223,6 @@
|
|
|
223
223
|
"cl-modal": [
|
|
224
224
|
"align-items/default",
|
|
225
225
|
"backdrop-filter-blur/default",
|
|
226
|
-
"border-color/default",
|
|
227
226
|
"border-radius/default",
|
|
228
227
|
"border-width/default",
|
|
229
228
|
"display/default",
|
|
@@ -243,7 +242,6 @@
|
|
|
243
242
|
"position/default",
|
|
244
243
|
"text-color/default",
|
|
245
244
|
"title/default",
|
|
246
|
-
"width-ext/default",
|
|
247
245
|
"width/default",
|
|
248
246
|
"z-index/default"
|
|
249
247
|
],
|