@oim-media/player-oim 1.27.10 → 1.27.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1741,7 +1741,7 @@ function nextWheelZoom(zoom, deltaY, deltaMode, pinch) {
1741
1741
  * the format can change without the player being touched. Tying both numbers
1742
1742
  * together would make an internal fix look like a format break.
1743
1743
  */
1744
- var CONTRACT_VERSION = "1.27.10";
1744
+ var CONTRACT_VERSION = "1.27.11";
1745
1745
  /**
1746
1746
  * What the player implements TODAY, measured and not assumed.
1747
1747
  *
@@ -3235,7 +3235,7 @@ function colorOf(ctx, owner, key, roleKey) {
3235
3235
  }
3236
3236
  var numbers = (value) => Array.isArray(value) && value.length > 0 && value.every((n) => typeof n === "number") ? value : void 0;
3237
3237
  /** The pattern fields that share a prefix: `fillPattern*` on a layer, `backgroundPattern*` on a layer or the canvas. */
3238
- function patternOf(ctx, owner, prefix, cssAnimation) {
3238
+ function patternOf(ctx, owner, prefix, cssAnimation, canvasBackground = false) {
3239
3239
  const preset = ctx.take(owner, `${prefix}Type`);
3240
3240
  const single = colorOf(ctx, owner, `${prefix}Color`, `${prefix}ColorRole`);
3241
3241
  const bg = colorOf(ctx, owner, `${prefix}BgColor`, `${prefix}BgColorRole`);
@@ -3248,7 +3248,7 @@ function patternOf(ctx, owner, prefix, cssAnimation) {
3248
3248
  const counts = numbers(ctx.take(owner, `${prefix}Counts`)) ?? numbers(ctx.take(owner, `${prefix}Count`));
3249
3249
  const dispersions = numbers(ctx.take(owner, `${prefix}Dispersions`)) ?? numbers(ctx.take(owner, `${prefix}Dispersion`));
3250
3250
  const colors = Array.isArray(list) ? list.filter(isColor) : [];
3251
- const tile = prefix === "backgroundPattern" && typeof owner.svgRawXml === "string" && owner.svgRawXml !== "";
3251
+ const tile = canvasBackground && prefix === "backgroundPattern" && typeof owner.svgRawXml === "string" && owner.svgRawXml !== "";
3252
3252
  if ((typeof preset !== "string" || !preset) && !tile && single === void 0 && bg === void 0 && colors.length === 0) return void 0;
3253
3253
  const pattern = typeof preset === "string" && preset ? { preset } : {};
3254
3254
  if (colors.length > 0 && single !== void 0 && typeof single === "object") colors[0] = single;
@@ -3327,7 +3327,7 @@ function fillOf(ctx, slot) {
3327
3327
  const image = imageOf(ctx, style);
3328
3328
  const cssAnimation = style.cssAnimation;
3329
3329
  const fillPattern = patternOf(ctx, style, "fillPattern", cssAnimation);
3330
- const backgroundPattern = patternOf(ctx, style, "backgroundPattern", cssAnimation);
3330
+ const backgroundPattern = patternOf(ctx, style, "backgroundPattern", cssAnimation, slot.raw.is_background_pattern === true || slot.raw.id === "background-pattern-slot");
3331
3331
  const generative = asObject(ctx.take(style, "fillGenerative")) ?? asObject(ctx.take(style, "backgroundGenerative"));
3332
3332
  const backgroundFit = ctx.take(style, "backgroundFit");
3333
3333
  const textGradient = ctx.take(style, "textGradientType");
@@ -3386,12 +3386,17 @@ function textStrokeOf(ctx, style) {
3386
3386
  }
3387
3387
  function convertPaints(ctx, slot, layer) {
3388
3388
  const { style } = slot;
3389
+ const hollowText = layer.type === "text" && style.fillColor === "transparent" && (style.fillType === void 0 || style.fillType === "solid" || style.fillType === "color");
3389
3390
  const fills = fillOf(ctx, slot);
3390
3391
  const fill = Array.isArray(fills) ? fills[0] : fills;
3391
3392
  const shape = style.geoShape;
3392
3393
  const customPath = typeof style.svgPath === "string" && style.svgPath !== "" && (shape === void 0 || shape === "custom");
3393
3394
  const colourless = slot.type === "geo" && (customPath || shape === "scribble") && !!fill && "kind" in fill && fill.kind === "color";
3394
3395
  if (fill && !colourless && admits(layer.type, "fills")) layer.fills = Array.isArray(fills) ? fills : [fill];
3396
+ else if (hollowText) layer.fills = [{
3397
+ kind: "color",
3398
+ value: "transparent"
3399
+ }];
3395
3400
  const strokeStyle = ctx.take(style, "strokeStyle");
3396
3401
  const dashed = strokeStyle === "dashed" || strokeStyle === "dotted" ? { style: strokeStyle } : {};
3397
3402
  const borderStyle = ctx.take(style, "borderStyle");
@@ -3859,10 +3864,40 @@ var CORNER_KEYS = [
3859
3864
  ["borderRadiusBR", "borderBottomRightRadius"],
3860
3865
  ["borderRadiusBL", "borderBottomLeftRadius"]
3861
3866
  ];
3867
+ var SHORTHAND = [
3868
+ [
3869
+ 0,
3870
+ 0,
3871
+ 0,
3872
+ 0
3873
+ ],
3874
+ [
3875
+ 0,
3876
+ 1,
3877
+ 0,
3878
+ 1
3879
+ ],
3880
+ [
3881
+ 0,
3882
+ 1,
3883
+ 2,
3884
+ 1
3885
+ ],
3886
+ [
3887
+ 0,
3888
+ 1,
3889
+ 2,
3890
+ 3
3891
+ ]
3892
+ ];
3862
3893
  function cornersOf(ctx, style) {
3863
- const all = toCanvasUnits(ctx.take(style, "borderRadius"), ctx.canvas.width) ?? 0;
3864
- const each = CORNER_KEYS.map((keys) => {
3865
- return keys.map((key) => toCanvasUnits(ctx.take(style, key), ctx.canvas.width)).find((v) => v !== void 0);
3894
+ const W = ctx.canvas.width;
3895
+ const raw = ctx.take(style, "borderRadius");
3896
+ const tokens = typeof raw === "string" ? raw.trim().split(/\s+/) : [];
3897
+ const shorthand = tokens.length > 1 && tokens.length <= 4 ? SHORTHAND[tokens.length - 1].map((i) => toCanvasUnits(tokens[i], W)) : [];
3898
+ const all = tokens.length > 1 ? 0 : toCanvasUnits(raw, W) ?? 0;
3899
+ const each = CORNER_KEYS.map((keys, corner) => {
3900
+ return keys.map((key) => toCanvasUnits(ctx.take(style, key), W)).find((v) => v !== void 0) ?? shorthand[corner];
3866
3901
  });
3867
3902
  if (each.some((v) => v !== void 0)) {
3868
3903
  const four = each.map((v) => Math.max(0, v ?? all));
@@ -9909,6 +9944,7 @@ var LegacyRenderer = class {
9909
9944
  width: v2Own.box.width || baseWidth,
9910
9945
  height: v2Own.box.height || baseHeight
9911
9946
  }) : {},
9947
+ ...imageSrcSafe && underFill?.kind === "color" && v2Literal(underFill.value) ? { backgroundColor: v2Literal(underFill.value) } : {},
9912
9948
  ...isVectorFill ? svgSilhouetteMaskCss(text) : shapeMaskCss(shapeOutline.round ? "circle" : shapeOutline.preset, shapeOutline.path ? {
9913
9949
  svgPath: shapeOutline.path.d,
9914
9950
  svgViewBox: shapeOutline.path.viewBox
@@ -45,7 +45,7 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
45
45
  @keyframes background-animation-zoom-out { 0%, 100% { background-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); -webkit-mask-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); mask-size: calc(var(--oim-bg-tile, 160px) * 1.15) calc(var(--oim-bg-tile, 160px) * 1.15); } 50% { background-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); -webkit-mask-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); mask-size: var(--oim-bg-tile, 160px) var(--oim-bg-tile, 160px); } }
46
46
  @keyframes background-animation-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
47
47
  @keyframes background-animation-none { }
48
- [data-slot-id="background-pattern-slot"] { width: 100% !important; height: 100% !important; display: block !important; }`}function ee(e){if(!e)return;let t=O();if(document.head&&!document.getElementById(`oim-player-styles`)){let e=document.createElement(`style`);e.id=`oim-player-styles`,e.textContent=t,document.head.appendChild(e)}if(e.getElementById&&!e.getElementById(`oim-player-styles`)){let n=document.createElement(`style`);n.id=`oim-player-styles`,n.textContent=t,e.appendChild(n)}}function k(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}var te="/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst e=10485760;async function t(t,r=e){let i=t.replace(/\\s+/g,``);try{let e=atob(i);if(e.trim().startsWith(`{`)){if(e.length>r)throw Error(`Metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let a=atob(i),o=new Uint8Array(a.length);for(let e=0;e<a.length;e++)o[e]=a.charCodeAt(e);try{return JSON.parse(await n(o,`deflate`,r))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await n(o,`deflate-raw`,r))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function n(t,n,r=e){let i=new DecompressionStream(n),a=i.writable.getWriter();a.write(t).catch(function(){}),a.close().catch(function(){});let o=i.readable.getReader(),s=[],c=0;try{for(;;){let{done:e,value:t}=await o.read();if(e)break;if(t){if(c+=t.byteLength,c>r)throw await o.cancel(),Error(`Decompressed metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);s.push(t)}}}finally{o.releaseLock()}let l=new Uint8Array(c),u=0;for(let e of s)l.set(e,u),u+=e.byteLength;return new TextDecoder().decode(l)}async function r(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function i(e){let i=await e.arrayBuffer(),a=new DataView(i),o=8,s=null,c=null,l=[new Uint8Array(i,0,8)];for(;o<i.byteLength;){let e=a.getUint32(o,!1),t=o+4,r=String.fromCharCode(a.getUint8(t),a.getUint8(t+1),a.getUint8(t+2),a.getUint8(t+3)),u=8+e+4;if(r===`tEXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r.slice(a+1),t=null;try{t=await n(e,`deflate`)}catch{try{t=await n(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{c=JSON.parse(t)}catch{}else s=new TextDecoder(`latin1`).decode(e);o+=u;continue}}}else if(r===`zTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r.slice(a+2);if(e===0)try{s=await n(t,`deflate`)}catch(e){try{s=await n(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(s){o+=u;continue}}}}else if(r===`iTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r[a+2],i=r.slice(a+3),c=i.indexOf(0);if(c!==-1){let r=i.slice(c+1),a=r.indexOf(0);if(a!==-1){let i=r.slice(a+1);if(e===1){if(t===0)try{s=await n(i,`deflate`)}catch(e){try{s=await n(i,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else s=new TextDecoder().decode(i);if(s){o+=u;continue}}}}}}l.push(new Uint8Array(i,o,u)),o+=u}let u=new Blob(l,{type:`image/png`}),d=null;return c?d=c:s&&(d=s.trimStart().startsWith(`{`)?JSON.parse(s):await t(s)),{image:u,metadata:d,imageHash:await r(i)}}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction a(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst o=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}];function s(e){for(let t=0;t<o.length;t++)if(o[t].kid===e)return o[t];return null}let c=null;function l(e){c=typeof e==`string`&&e?e:null}function u(){if(c)return c;let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||`https://api.oim.media/v1/media/keys`}function d(e,t){let n=s(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function f(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}function p(e,t,n=Date.now()){let r=s(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!s(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+6048e5}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst m=2**53-1;function h(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>m:typeof e==`object`&&e?Object.values(e).some(h):!1}const g=/* @__PURE__ */ new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function _(e){if(Array.isArray(e))return e.map(_);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=_(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function v(e){if(Array.isArray(e))return e.map(v);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=v(e[r]);return t}return e}function y(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))g.has(n)||(t[n]=e[n]);let n=v(_(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst b=/* @__PURE__ */ new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),x=/* @__PURE__ */ new Set([`public`,`author_only`,`sealed`]);function S(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?b.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&x.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst C=`author_only`,w=[`public`,`author_only`,`sealed`];function T(e){if(!e||typeof e!=`object`)return C;let t=S(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&w.includes(n)?n:C}function E(e){return e===`public`?`verified_authorless`:`verified`}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst D={};let O=null,k=!1,A=null;function j(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function M(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function N(e){let t=s(e);return t?t.jwk:(D[e]||!k&&(A||=j().then(e=>{e.forEach(e=>{D[e.kid]=e}),k=!0}),await A,D[e])||await P(),D[e])}function P(){return O||=(async function(){try{let e=u(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];D[t.kid]=t}await M(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),O}async function F(e){return await P(),D[e]||null}async function I(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await N(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(h(e))return!1;let n=y(e),r=atob(e.signature),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);let a=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,i,t)},o=await a(t,n);if(!o&&e.creator_user_id){let n={},r=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function i(e){if(Array.isArray(e))return e.map(i);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort();for(let r=0;r<n.length;r++)t[n[r]]=i(e[n[r]]);return t}return e}for(let t=0;t<r.length;t++)n[r[t]]=i(e[r[t]]);o=await a(t,new TextEncoder().encode(JSON.stringify(n)))}if(!o)try{let r=await F(e.key_version);r&&(r.x!==t.x||r.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),o=await a(r,n))}catch{}if(o){let n=d(e.key_version,t);if(!f({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return o||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),o}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function L(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:E(T(e.metadata)):`image_unsealed`}async function R(e,t=Date.now()){let n=e&&e.key_version;return n?s(n)?p(n,null,t):p(n,await F(n),t):!1}function z(e){return e===`image_mismatch`||e===`invalid_signature`}function B(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nself.onmessage=async function(e){let{id:t,blob:n,origin:r,keysUrl:o}=e.data;l(o);try{let e=await i(n);if(!e.metadata){self.postMessage({id:t,success:!0,metadata:{slots:[]},isSigValid:!1,security:`no_metadata`});return}let o=B(e.metadata);if(o.length>0)throw Error(`Corrupted or tampered OIM file: `+o[0]);let s=!!(e.metadata.signature&&e.metadata.key_version),c=await I(e.metadata,r),l=L({isSigned:s,isSigValid:c,keyExpired:s&&c?await R(e.metadata):!1,metadata:e.metadata,imageHash:e.imageHash});if(z(l)){self.postMessage({id:t,success:!1,refused:!0,security:l,error:`OIM_ALTERED: `+l});return}c?l===`unsigned`||l===`expired_key`?e.metadata={slots:[],elements:[],layers:[]}:a(e.metadata):e.metadata={slots:[]},self.postMessage({id:t,success:!0,metadata:e.metadata,isSigValid:c,security:l})}catch(e){self.postMessage({id:t,success:!1,error:e.message||String(e)})}};",A=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,te],{type:`text/javascript;charset=utf-8`});function ne(e){let t;try{if(t=A&&(self.URL||self.webkitURL).createObjectURL(A),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(te),{type:`module`,name:e?.name})}}var re=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}],ie=`https://api.oim.media/v1/media/keys`;function j(e){for(let t=0;t<re.length;t++)if(re[t].kid===e)return re[t];return null}function ae(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||ie}function M(e,t){let n=j(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function N(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}var P=6048e5;function F(e,t,n=Date.now()){let r=j(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!j(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+P}var oe=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function se(e){let t=null,n=null,r=1,i=new Map;function a(e){let t=[...i.values()];i.clear(),t.forEach(t=>t.reject(e))}function o(){if(t)return t;let n=e();return n.onmessage=e=>{let t=e.data,n=t&&typeof t.id==`number`?i.get(t.id):void 0;n&&(i.delete(t.id),n.resolve(t))},n.onerror=e=>{try{n.terminate()}catch{}t===n&&(t=null),a(e)},t=n,n}return{verify(e,t,a){if(n)return Promise.reject(new oe(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new oe(e))}let c=r++;return new Promise((n,r)=>{i.set(c,{resolve:n,reject:r}),s.postMessage({id:c,blob:e,hostname:t,origin:a,keysUrl:ae()})})},stats(){return{alive:t!==null,pending:i.size}}}}var ce=null;function le(e,t,n){return ce||=se(()=>new ne),ce.verify(e,t,n)}var I=10485760;async function ue(e,t=I){let n=e.replace(/\s+/g,``);try{let e=atob(n);if(e.trim().startsWith(`{`)){if(e.length>t)throw Error(`Metadata exceeds the limit of ${t/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);try{return JSON.parse(await L(i,`deflate`,t))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await L(i,`deflate-raw`,t))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function L(e,t,n=I){let r=new DecompressionStream(t),i=r.writable.getWriter();i.write(e).catch(function(){}),i.close().catch(function(){});let a=r.readable.getReader(),o=[],s=0;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;if(t){if(s+=t.byteLength,s>n)throw await a.cancel(),Error(`Decompressed metadata exceeds the limit of ${n/1048576}MB (zip bomb detected)`);o.push(t)}}}finally{a.releaseLock()}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;return new TextDecoder().decode(c)}async function de(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function fe(e){let t=await e.arrayBuffer(),n=new DataView(t),r=8,i=null,a=null,o=[new Uint8Array(t,0,8)];for(;r<t.byteLength;){let e=n.getUint32(r,!1),s=r+4,c=String.fromCharCode(n.getUint8(s),n.getUint8(s+1),n.getUint8(s+2),n.getUint8(s+3)),l=8+e+4;if(c===`tEXt`){let n=new Uint8Array(t,s+4,e),o=n.indexOf(0);if(o!==-1){let e=new TextDecoder().decode(n.slice(0,o));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n.slice(o+1),t=null;try{t=await L(e,`deflate`)}catch{try{t=await L(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{a=JSON.parse(t)}catch{}else i=new TextDecoder(`latin1`).decode(e);r+=l;continue}}}else if(c===`zTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n.slice(a+2);if(e===0)try{i=await L(t,`deflate`)}catch(e){try{i=await L(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(i){r+=l;continue}}}}else if(c===`iTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n[a+2],o=n.slice(a+3),s=o.indexOf(0);if(s!==-1){let n=o.slice(s+1),a=n.indexOf(0);if(a!==-1){let o=n.slice(a+1);if(e===1){if(t===0)try{i=await L(o,`deflate`)}catch(e){try{i=await L(o,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else i=new TextDecoder().decode(o);if(i){r+=l;continue}}}}}}o.push(new Uint8Array(t,r,l)),r+=l}let s=new Blob(o,{type:`image/png`}),c=null;return a?c=a:i&&(c=i.trimStart().startsWith(`{`)?JSON.parse(i):await ue(i)),{image:s,metadata:c,imageHash:await de(t)}}var pe=2**53-1;function R(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>pe:typeof e==`object`&&e?Object.values(e).some(R):!1}var me=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function he(e){if(Array.isArray(e))return e.map(he);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=he(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function ge(e){if(Array.isArray(e))return e.map(ge);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=ge(e[r]);return t}return e}function _e(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))me.has(n)||(t[n]=e[n]);let n=ge(he(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}var ve=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),ye=new Set([`public`,`author_only`,`sealed`]);function z(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?ve.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&ye.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}var B=`author_only`,V=[`public`,`author_only`,`sealed`];function be(e){if(!e||typeof e!=`object`)return B;let t=z(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&V.includes(n)?n:B}function xe(e){return e===`public`?`verified_authorless`:`verified`}function Se(e,t){let n=e||``,r=``;for(let e=0;e<n.length;e++)n.charCodeAt(e)>=32&&(r+=n.charAt(e));return r=r.trim(),r.charAt(0)===`#`?!0:t?!1:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r)||/^https?:/i.test(r)||/^data:image\//i.test(r)}function Ce(e){if(typeof DOMParser>`u`)return e;try{let t=new DOMParser().parseFromString(e,`text/html`),n=`svg.g.defs.symbol.use.title.desc.path.circle.rect.polygon.polyline.ellipse.line.lineargradient.radialgradient.stop.pattern.image.clippath.mask.filter.fegaussianblur.fecolormatrix.fecomponenttransfer.fefunca.fefuncr.fefuncg.fefuncb.feblend.feoffset.femerge.femergenode.feflood.fecomposite.text.tspan.span.div.br.p.a.b.i.strong.em.img`.split(`.`),r=`class.style.id.lang.aria-hidden.part.transform.d.cx.cy.r.rx.ry.x.y.dx.dy.x1.y1.x2.y2.fx.fy.width.height.points.viewbox.preserveaspectratio.vector-effect.fill.stroke.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.offset.stop-color.stop-opacity.gradientunits.gradienttransform.spreadmethod.patternunits.patterncontentunits.patterntransform.clip-path.clippathunits.mask.maskunits.maskcontentunits.filter.filterunits.primitiveunits.stddeviation.result.in.in2.mode.type.values.tablevalues.flood-color.flood-opacity.operator.font-family.font-size.font-weight.font-style.text-anchor.dominant-baseline.letter-spacing.word-spacing.href.src.target.rel.alt.data-slot-id.allow-lottie.show-controls.crossorigin`.split(`.`),i=t.body.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let t=i[e],a=t.tagName.toLowerCase();if(n.indexOf(a)===-1){t.parentNode?.removeChild(t);continue}let o=t.attributes;for(let e=o.length-1;e>=0;e--){let n=o[e],i=n.name.toLowerCase();if(i.indexOf(`on`)===0||r.indexOf(i)===-1)t.removeAttribute(n.name);else{if(i===`href`&&!Se(n.value,a===`use`||a===`image`)&&t.removeAttribute(n.name),i===`style`){let e=Te(n.value);e!==n.value&&t.setAttribute(n.name,e)}else if(i!==`href`&&i!==`src`&&Ee(n.value)){t.removeAttribute(n.name);continue}i===`src`&&(De(n.value.trim())||t.removeAttribute(n.name))}}}return t.body.innerHTML}catch(e){return console.warn(`[OimPlayer] HTML sanitization failed:`,e),``}}function we(e){let t=(e||``).trim().toLowerCase();return t.indexOf(`data:image/`)===0||t.indexOf(`blob:`)===0}function Te(e){return typeof e==`string`?e.indexOf(`\\`)!==-1||/@import|image-set\s*\(/i.test(e)?``:e.indexOf(`(`)===-1?e:e.replace(/url\(\s*(['"]?)(.*?)\1\s*\)/gi,function(e,t,n){let r=String(n).trim().toLowerCase();return r.indexOf(`#`)===0||r.indexOf(`data:`)===0?e:`none`}):e}function Ee(e){let t=typeof e==`string`?e:``;if(t.indexOf(`\\`)!==-1||/image-set\s*\(|@import/i.test(t))return!0;let n=/url\(\s*['"]?\s*([^'")\s]*)/gi,r;for(;(r=n.exec(t))!==null;){let e=r[1].trim().toLowerCase();if(e.indexOf(`#`)!==0&&e.indexOf(`data:`)!==0)return!0}return!1}function De(e){let t=(e||``).trim();if(t.indexOf(`data:image/`)!==0)return!1;let n=t.indexOf(`,`);if(n===-1)return!1;let r=t.substring(0,n).toLowerCase();if(r.indexOf(`;base64`)===-1)return!1;let i=r.substring(5,r.indexOf(`;`));return[`image/png`,`image/jpeg`,`image/jpg`,`image/webp`,`image/gif`].indexOf(i)!==-1}function Oe(e){return!e||typeof e!=`string`?`Inter, sans-serif`:e.replace(/[^a-zA-Z0-9 ,\-\.'\'"]/g,``).trim().slice(0,128)||`Inter, sans-serif`}var H={},ke=null,Ae=!1,U=null;function W(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function G(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function je(e){let t=j(e);return t?t.jwk:(H[e]||!Ae&&(U||=W().then(e=>{e.forEach(e=>{H[e.kid]=e}),Ae=!0}),await U,H[e])||await Me(),H[e])}function Me(){return ke||=(async function(){try{let e=ae(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];H[t.kid]=t}await G(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),ke}async function K(e){return await Me(),H[e]||null}async function Ne(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await je(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(R(e))return!1;let r=_e(e),i=atob(e.signature),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);let o=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,a,t)},s=await o(t,r);if(!s&&e.creator_user_id){let r={},i=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function n(e){if(Array.isArray(e))return e.map(n);if(typeof e==`object`&&e){let t={},r=Object.keys(e).sort();for(let i=0;i<r.length;i++)t[r[i]]=n(e[r[i]]);return t}return e}for(let t=0;t<i.length;t++)r[i[t]]=n(e[i[t]]);s=await o(t,new TextEncoder().encode(JSON.stringify(r)))}if(!s)try{let n=await K(e.key_version);n&&(n.x!==t.x||n.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),s=await o(n,r))}catch{}if(s){let n=M(e.key_version,t);if(!N({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return s||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),s}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function Pe(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:xe(be(e.metadata)):`image_unsealed`}async function Fe(e,t=Date.now()){let n=e&&e.key_version;return n?j(n)?F(n,null,t):F(n,await K(n),t):!1}function Ie(e){return e===`image_mismatch`||e===`invalid_signature`}var Le=`OIM_ALTERED`;function Re(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}var q=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],ze=new Set(q);function Be(e){return typeof e==`string`&&ze.has(e)}var Ve=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,He=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,Ue=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),We=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,Ge=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function Ke(e,t=0){if(typeof e!=`string`)return!1;let n=e.trim();if(!n||n.length>128||t>4||/[;{}<>"]/.test(n)||n.includes(`\\`)||/url\(|expression\(|\/\*/i.test(n))return!1;if(Ve.test(n)||Ue.has(n.toLowerCase())||He.test(n)||We.test(n))return!0;let r=Ge.exec(n);return r?Ke(r[2],t+1):!1}function qe(e,t={}){let n=e.palettes??{},r=Object.hasOwn(n,`dark`)&&Object.hasOwn(n,`light`)&&t.prefersDark!==void 0?t.prefersDark?`dark`:`light`:void 0,i=[t.requested,r,e.defaultPalette].find(e=>typeof e==`string`&&Object.hasOwn(n,e));if(i===void 0)return null;let a={};for(let e of q){let t=n[i][e];Ke(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function J(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&Ke(n)?n:void 0;if(Be(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}var Je=Math.log(1.05)/100,Ye=.01,Xe=16,Ze=800;function Qe(e,t,n,r){let i=n===1?t*Xe:n===2?t*Ze:t,a=e*Math.exp(-i*(r?Ye:Je));return Math.max(1,Math.min(4,a))}var $e=`1.27.10`,et=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function tt(e){if(typeof e!=`string`)return null;let t=/^(\d+)\.(\d+)\.(\d+)$/.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function nt(e,t){let n=tt(e),r=tt(t);if(!n||!r)return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}function rt(e,t){let n=e&&typeof e.min_player==`string`?e.min_player:null,r=(Array.isArray(e?.capabilities)?e.capabilities:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),i=(Array.isArray(e?.capabilities_required)?e.capabilities_required:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),a=nt(n,t.version),o=a||i.length>0,s=a||r.length>0||i.length>0;return{requiredVersion:n,versionTooOld:a,missingCapabilities:r,missingRequiredCapabilities:i,cannotRender:o,hasNotice:s,hayAlgoQueDecir:s}}function it(e){let t=[];return e.versionTooOld&&t.push(`the file requires format version ${e.requiredVersion}`),e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0&&t.push(`requires ${e.missingRequiredCapabilities.join(`, `)}`),e.missingCapabilities&&e.missingCapabilities.length>0&&t.push(`uses ${e.missingCapabilities.join(`, `)}`),t.length===0?``:`${e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0?`It cannot be fully rendered`:`Rendered what was possible`}: ${t.join(` and `)}.`}var at=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,ot=546136,st={woff:`wOFF`,woff2:`wOF2`};function ct(e,t){try{return atob(e.slice(0,8)).startsWith(st[t])}catch{return!1}}function lt(e){let t=e&&Array.isArray(e.fonts)?e.fonts:[],n=[];for(let e of t)e&&typeof e==`object`&&(e.format!==`woff`&&e.format!==`woff2`||typeof e.family!=`string`||typeof e.data!=`string`||typeof e.name!=`string`||!at.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>ot||!ct(e.data,e.format)||n.push({family:e.family,name:e.name,weight:e.weight,style:e.style,format:e.format,data:e.data}));return n}async function ut(e,t=document.fonts,n=(e,t,n)=>new FontFace(e,t,n)){let r=new Map;return await Promise.all(e.map(async e=>{try{let i=n(e.name,`url(data:font/${e.format};base64,${e.data})`,{weight:String(e.weight),style:e.style});await i.load(),t.add(i),r.set(e.family,e.name)}catch{}})),r}function dt(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var ft=/^\{(\/?)([a-z][a-z0-9-]{0,23})\}/;function pt(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`{`||r===`}`){if(e[n+1]===r){t.push({kind:`text`,s:r}),n+=2;continue}if(r===`{`){let r=ft.exec(e.slice(n));if(r){t.push({kind:r[1]?`close`:`open`,name:r[2],raw:r[0],at:n}),n+=r[0].length;continue}}t.push({kind:`stray`,raw:r,at:n}),n+=1;continue}let i=n;for(;i<e.length&&e[i]!==`{`&&e[i]!==`}`;)i++;t.push({kind:`text`,s:e.slice(n,i)}),n=i}return t}function mt(e,t){let n=[],r=[],i,a=null,o=(e,t)=>{i||={reason:e,at:t}},s=e=>{if(!e)return;let t=n[n.length-1];t&&t.mark===(a??void 0)?t.text+=e:n.push(a?{text:e,mark:a}:{text:e})};for(let n of pt(e))n.kind===`text`?s(n.s):n.kind===`stray`?(o(`stray brace`,n.at),s(n.raw)):t.includes(n.name)?n.kind===`open`?a?(o(`"${n.name}" inside "${a}"`,n.at),s(n.raw)):(a=n.name,r.push(n.name)):a===n.name?a=null:(o(`"${n.name}" closed without being open`,n.at),s(n.raw)):(o(`unknown mark "${n.name}"`,n.at),s(n.raw));return a&&o(`"${a}" is not closed`,e.length),{runs:n,sequence:r,error:i}}function ht(e,t){return mt(e,t).runs}function gt(e){return e.replace(/[{}]/g,e=>e+e)}function _t(e,t){return ht(e,t).map(e=>e.text).join(``)}function vt(e,t){let n=``,r=[];for(let i of ht(e,t))i.mark&&r.push({from:n.length,to:n.length+i.text.length,mark:i.mark}),n+=i.text;return{plain:n,ranges:r}}function yt(e,t){let n=``,r=0;for(let i of[...t].sort((e,t)=>e.from-t.from)){let t=Math.max(i.from,r),a=Math.min(i.to,e.length);a<=t||(n+=gt(e.slice(r,t))+`{${i.mark}}`+gt(e.slice(t,a))+`{/${i.mark}}`,r=a)}return n+gt(e.slice(r))}function bt(e){let t={underline:e.underline===!0},n=J(e.colorRole,e.color);if(n&&(t.color=n),e.bold&&(t.fontWeight=700),e.italic&&(t.fontStyle=`italic`),e.highlight){let n=e.highlight;t.highlight={style:n.style??`marker`,color:J(n.colorRole,n.color)||`rgba(245, 158, 11, 0.35)`,paddingX:n.paddingX??4,paddingY:n.paddingY??2,borderRadius:n.borderRadius??3}}return t}function xt(e,t){return _t(e,Object.keys(t??{}))}function St(e,t,n){e.textContent=``;for(let r of ht(t,Object.keys(n??{}))){let t=r.mark?n?.[r.mark]:void 0;if(!r.mark||!t){e.appendChild(document.createTextNode(r.text));continue}let i=document.createElement(`span`);i.dataset.mark=r.mark,i.textContent=r.text;let a=bt(t),o=i.style;a.color&&(o.color=a.color),a.fontWeight&&(o.fontWeight=String(a.fontWeight)),a.fontStyle&&(o.fontStyle=a.fontStyle),a.underline&&(o.textDecoration=`underline`);let s=a.highlight;s&&(s.style===`underline-thick`?o.boxShadow=`inset 0 -.4em 0 ${s.color}`:o.backgroundColor=s.color,o.borderRadius=s.style===`pill`?`9999px`:s.style===`box`?`0`:`${s.borderRadius}px`,o.padding=`${s.paddingY}px ${s.paddingX}px`,o.boxDecorationBreak=`clone`,o.webkitBoxDecorationBreak=`clone`),e.appendChild(i)}}function Ct(e){let t={scale:e.lines===3?3.2:2.2,lineHeight:.85,marginRight:e.marginRight??8,fontWeight:700};return e.color&&(t.color=e.color),e.fontFamily&&(t.fontFamily=e.fontFamily),t}function wt(e,t){let{plain:n,ranges:r}=vt(e,t);if(!n)return{letter:``,rest:``};let i=r.map(e=>({...e,from:Math.max(0,e.from-1),to:e.to-1}));return{letter:n[0],rest:yt(n.slice(1),i)}}var Tt=/^(data:image\/|blob:|https:\/\/)[^"'\\\n\r()]*$/;function Et(e){if(e.svg&&/<svg[\s>]/i.test(e.svg))return{image:`url("data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.svg)}")`,size:`100% 100%`};if(e.type===`image`&&e.image&&Tt.test(e.image)){let t=e.fit===`contain`?`contain`:e.fit===`fill`?`100% 100%`:`cover`;return{image:`url("${e.image}")`,size:t}}return null}var Dt=[`fade-chars`,`slide-up`,`bounce-chars`,`reveal-mask`,`scale-in`,`rise-words`],Ot=.35,kt=.05,At=[`slide-up`,`reveal-mask`,`rise-words`];function jt(e){return typeof e==`string`&&Dt.includes(e)}function Mt(e){return e===`reveal-mask`}function Nt(e,t){return At.includes(t)?e.match(/\S+|\s+/g)??[]:Array.from(e)}function Pt(e,t=kt,n=0){return n+e*t}function Ft(e,t){let n=Math.max(0,Math.min(1,t)),r=n*(2-n);if(e===`slide-up`)return{opacity:r,translateYEm:(1-r)*.6,scale:1,rotateDeg:0};if(e===`reveal-mask`)return{opacity:1,translateYEm:(1-r)*1.2,scale:1,rotateDeg:0};if(e===`scale-in`)return{opacity:r,translateYEm:0,scale:.6+.4*r,rotateDeg:0};if(e===`rise-words`)return{opacity:r,translateYEm:(1-r)*.8,scale:1,rotateDeg:(1-r)*8};if(e===`bounce-chars`){let e=r===0?0:r<.7?r/.7*1.15:1.15-(r-.7)/.3*.15;return{opacity:r,translateYEm:0,scale:Math.round(e*1e6)/1e6,rotateDeg:0}}return{opacity:r,translateYEm:0,scale:1,rotateDeg:0}}function It(e,t=10){return Array.from({length:t+1},(n,r)=>Ft(e,r/t))}var Lt=r({createExternalLottieLoader:()=>Bt,createExternalScriptLoader:()=>zt,default:()=>Ut,vendorUrl:()=>Rt});function Rt(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return Vt+n}function zt(e){let t=null;return function(){let n=e.read();if(n)return Promise.resolve(n);if(t)return t;let r=e.doc??document,i=Vt+e.file;if(e.scriptUrl)try{i=new URL(e.file,e.scriptUrl).href}catch{}return t=new Promise((t,n)=>{let a=r.createElement(`script`);a.src=i,a.async=!0,a.setAttribute(e.marker,``),a.onload=()=>{let r=e.read();r?t(r):n(Error(`Script loaded from ${i} but did not define what was expected`))},a.onerror=()=>{a.remove(),n(Error(`Could not load ${i}`))},(r.head||r.documentElement).appendChild(a)}),t.catch(()=>{t=null}),t}}function Bt(e){return zt({scriptUrl:e.scriptUrl,file:`vendor/lottie_light-${e.version}.js`,marker:`data-oim-lottie`,doc:e.doc,read:()=>{let e=globalThis.lottie;return e&&typeof e.loadAnimation==`function`?e:void 0}})}var Vt,Ht,Ut,Wt=n((()=>{Vt=`https://cdn.oim.media/player/v1/`,Ht=Bt({scriptUrl:i,version:`5.13.0`}),Ut={__oimExternal:!0,load:Ht}}));function Gt(){return Promise.resolve().then(()=>(Wt(),Lt)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}a(),Wt();var Kt=`__oimUpgrade`,qt=()=>globalThis[Kt],Jt=zt({scriptUrl:i,file:`vendor/oim-upgrade-c6a086756e48.js`,marker:`data-oim-upgrade`,read:()=>qt()}),Yt=e=>{let t=qt();if(!t)throw Error(`[OimPlayer] upgrade called before ensureUpgrade()`);return t(e)};function Xt(){return qt()?Promise.resolve():Jt().then(()=>void 0)}var Zt={triangle:{kind:`polygon`,points:[[50,5],[95,90],[5,90]]},star:{kind:`polygon`,points:[[50,2],[62,38],[100,38],[69,59],[80,95],[50,73],[20,95],[31,59],[0,38],[38,38]]},arrow:{kind:`polygon`,points:[[5,40],[60,40],[60,20],[95,50],[60,80],[60,60],[5,60]]},diamond:{kind:`polygon`,points:[[50,5],[95,50],[50,95],[5,50]]},hexagon:{kind:`polygon`,points:[[25,5],[75,5],[95,50],[75,95],[25,95],[5,50]]},circle:{kind:`path`,d:`M 50,5 A 45,45 0 1,1 49.999,5 Z`,fillable:!0},heart:{kind:`path`,d:`M 50,88 C 10,60 -5,30 15,12 C 30,-2 50,5 50,25 C 50,5 70,-2 85,12 C 105,30 90,60 50,88 Z`,fillable:!0},line:{kind:`path`,d:`M 5,50 L 95,50`,fillable:!1},blob:{kind:`path`,d:`M 50,10 C 75,10 92,25 90,50 C 88,75 75,90 50,90 C 25,90 10,75 10,50 C 10,25 25,10 50,10 Z`,fillable:!0},scribble:{kind:`path`,d:`M 5,80 Q 25,65 50,75 T 95,70 Q 75,85 50,82 T 5,88`,fillable:!1},pill:{kind:`path`,d:`M 30,25 L 70,25 C 83.8,25 95,36.2 95,50 C 95,63.8 83.8,75 70,75 L 30,75 C 16.2,75 5,63.8 5,50 C 5,36.2 16.2,25 30,25 Z`,fillable:!0},octagon:{kind:`polygon`,points:[[30,5],[70,5],[95,30],[95,70],[70,95],[30,95],[5,70],[5,30]]},pentagon:{kind:`polygon`,points:[[50,5],[94.7,37.5],[77.6,90],[22.4,90],[5.3,37.5]]},cross:{kind:`polygon`,points:[[35,5],[65,5],[65,35],[95,35],[95,65],[65,65],[65,95],[35,95],[35,65],[5,65],[5,35],[35,35]]},moon:{kind:`path`,d:`M 50,5 C 25.15,5 5,25.15 5,50 C 5,74.85 25.15,95 50,95 C 30,80 30,20 50,5 Z`,fillable:!0},cloud:{kind:`path`,d:`M 25,85 C 8,85 5,62 22,58 C 14,40 35,32 45,42 C 48,22 75,20 78,42 C 96,40 97,66 80,68 C 80,78 78,85 68,85 Z`,fillable:!0},drop:{kind:`path`,d:`M 50,5 C 62,25 80,45 80,65 C 80,81.5 66.5,95 50,95 C 33.5,95 20,81.5 20,65 C 20,45 38,25 50,5 Z`,fillable:!0},bolt:{kind:`polygon`,points:[[62,5],[18,58],[46,58],[34,95],[82,40],[55,40],[72,5]]},bubble:{kind:`path`,d:`M 20,5 L 80,5 C 88.3,5 95,11.7 95,20 L 95,57 C 95,65.3 88.3,72 80,72 L 42,72 L 22,93 L 28,72 L 20,72 C 11.7,72 5,65.3 5,57 L 5,20 C 5,11.7 11.7,5 20,5 Z`,fillable:!0},flower:{kind:`path`,d:`M 65.6,41.0 C 85.5,35.7 97.5,39.9 95.0,50.0 C 97.5,60.1 85.5,64.3 65.6,59.0 C 80.1,73.5 82.5,86.1 72.5,89.0 C 65.0,96.2 55.3,87.9 50.0,68.0 C 44.7,87.9 35.0,96.2 27.5,89.0 C 17.5,86.1 19.9,73.5 34.4,59.0 C 14.5,64.3 2.5,60.1 5.0,50.0 C 2.5,39.9 14.5,35.7 34.4,41.0 C 19.9,26.5 17.5,13.9 27.5,11.0 C 35.0,3.8 44.7,12.1 50.0,32.0 C 55.3,12.1 65.0,3.8 72.5,11.0 C 82.5,13.9 80.1,26.5 65.6,41.0 Z`,fillable:!0},burst:{kind:`polygon`,points:[[95,50],[82.8,58.8],[89,72.5],[74,74],[72.5,89],[58.8,82.8],[50,95],[41.2,82.8],[27.5,89],[26,74],[11,72.5],[17.2,58.8],[5,50],[17.2,41.2],[11,27.5],[26,26],[27.5,11],[41.2,17.2],[50,5],[58.8,17.2],[72.5,11],[74,26],[89,27.5],[82.8,41.2]]},arch:{kind:`path`,d:`M 5,95 L 5,50 C 5,25.15 25.15,5 50,5 C 74.85,5 95,25.15 95,50 L 95,95 Z`,fillable:!0}};[...Object.keys(Zt).filter(e=>e!==`line`&&e!==`scribble`)];function Qt(e){if(e&&e!==`rect`&&e!==`rectangle`)return Zt[e]}function $t(e){return e.map(([e,t])=>`${e},${t}`).join(` `)}var en=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,tn=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,nn=`0 0 100 100`,rn=e=>e&&e.length<=2e4&&en.test(e)?e:void 0,an=e=>e&&e.length<=64&&tn.test(e)?e:nn;function on(e){let t=Qt(e.geoShape),n=rn(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:nn}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&rn(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:nn}:n?{d:n,viewBox:an(e.svgViewBox)}:null}var sn={silhouette:null,fillable:!0,round:!1};function cn(e){if(!e||e.kind===`rect`)return sn;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=Qt(t);return n?{silhouette:on({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:sn}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=on({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:sn}return sn}function Y(e,t){if(!e||typeof e!=`object`)return;let n=(t||``).toLowerCase();if(e[n]!==void 0)return e[n];let r=Object.keys(e);for(let t=0;t<r.length;t++)if(r[t].toLowerCase()===n)return e[r[t]]}function ln(e,t){let n=e||{};if(n[`*`]!==void 0){let e=Y(n,t);return typeof e==`string`?e:String(n[`*`]??``)}function r(e){if(n[e]!==void 0&&n[e]!==``)return n[e];let t=e.toLowerCase(),r=e.toUpperCase();if(n[r]!==void 0&&n[r]!==``)return n[r];if(n[t]!==void 0&&n[t]!==``)return n[t];let i=Object.keys(n);for(let e=0;e<i.length;e++)if(i[e].toLowerCase()===t&&n[i[e]]!==``)return n[i[e]]}let i=r(t)||r(`en`)||r(`es`)||r(`default`)||``;if(!i){let e=Object.keys(n);e.length>0&&(i=n[e[0]]||``)}return i}function un(e,t){return e&&e.type===`image`?!0:t.indexOf(`data:image/`)===0}function dn(e){return!!e&&(e.is_background_pattern===!0||e.id===`background-pattern-slot`)}var fn=/^[\d.+-]+(cqw|cqh|cqi|cqb|rem|em|ex|ch|vw|vh|vmin|vmax|%|px|pt|pc|cm|mm|in|lh|rlh)$/i;function pn(e,t){let n=t==null?`16px`:t.toString(),r=(e==null?``:e.toString()).trim();if(!r||r===`undefined`||r===`null`)return n;if(fn.test(r))return r;let i=parseFloat(r);return isNaN(i)?n:i+`px`}function mn(e,t){let n=e&&e.style||{},r=ln(e&&e.content,t),i=un(e,r);return{content:r,size:pn(Y(n.fontSizes,t)||n.fontSize,n.fontSize||`16px`),maxWidthValue:dn(e)?`none`:Y(n.maxWidths,t)||(i||(e?.type??`text`)!==`text`?n.maxWidth||`none`:n.maxWidth||`80%`)}}function hn(e,t,n){let r=mn(e,t),i=mn(e,n);return r.content===i.content?r.size!==i.size||r.maxWidthValue!==i.maxWidthValue?`style-only`:`none`:`content`}var gn=new WeakMap;function _n(e){let t=gn.get(e);if(t)return t;t=new Map;let n=e=>{for(let r of e)t.set(r.id,r),n(r.children??[])};try{n(Yt(e).document.layers)}catch(e){console.warn(`[OimPlayer] 2.0 view unavailable:`,e)}return gn.set(e,t),t}function vn(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?J(e.var,e.fallback):typeof e==`string`?J(null,e):``)||void 0,literal:n=>(t(n)?qe(e)?.colors?.[n.var]??J(null,n.fallback):typeof n==`string`?J(null,n):``)||void 0}}function yn(e){let t=e.anchor??`top-left`;return[/left/.test(t)?`0%`:/right/.test(t)?`-100%`:`-50%`,/^top/.test(t)?`0%`:/^bottom/.test(t)?`-100%`:`-50%`]}function bn(e,t){if(typeof e==`number`)return e;if(e&&typeof e==`object`&&`value`in e){let{value:n,modes:r}=e,i=r?.[t];return typeof i==`number`?i:typeof n==`number`?n:void 0}}function xn(e,t){let n=e?.text;if(!n)return;let r={},i=bn(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=bn(n.maxWidth,t);return a!==void 0&&(r.maxWidth=`${+a.toFixed(4)}px`),n.font?.family&&(r.fontFamily=n.font.family),n.font?.weight!==void 0&&(r.fontWeight=String(n.font.weight)),n.font?.italic&&(r.fontStyle=`italic`),n.letterSpacing!==void 0&&(r.letterSpacing=`${n.letterSpacing}px`),n.transform&&(r.textTransform=n.transform),n.decoration&&(r.textDecoration=n.decoration),r}function Sn(e){let t=e??{},n=e=>typeof e==`number`?+(e*100).toFixed(6):void 0;return{filterPreset:t.preset,filterBlur:t.blur,filterBrightness:n(t.brightness),filterContrast:n(t.contrast),filterSaturate:n(t.saturate),filterHueRotate:t.hueRotate}}function Cn(e){let t=e.mask??{},n=e.geometry,r=n?.kind===`preset`?n.name:n?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[n?.kind??``],i=e=>typeof e==`string`?{role:void 0,literal:e}:e&&typeof e==`object`?{role:e.var,literal:e.fallback}:{role:void 0,literal:void 0},a=e.fills?.[0],o=i(a?.kind===`color`?a.value:void 0),s=e.strokes?.[0],c=i(s?.paint?.kind===`color`?s.paint.value:void 0);return{maskMode:t.mode===`cutout`?`cutout`:`window`,maskFeather:t.feather,maskCoverage:t.scope===`group`?`container`:`canvas`,maskShape:r,maskSvgPath:n?.kind===`paths`?n.paths?.map(e=>e.d).join(` `):void 0,geoShape:void 0,svgPath:void 0,maskBgColor:o.literal,maskBgColorRole:o.role,fillColorRole:void 0,maskStrokeColor:c.literal,maskStrokeColorRole:c.role,strokeColorRole:void 0,maskStrokeWidth:s?.width,cuts:e.extensions?.studio?.maskCuts}}function wn(e,t){let n=typeof e==`string`?e:Y(e.modes??{},t)??e.value;return n===`oim:base`?``:n}var Tn=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0;function En(e,t,n=!1){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`);i.setAttribute(`viewBox`,e.viewBox.join(` `)),i.setAttribute(`width`,n?String(e.viewBox[2]):`100%`),i.setAttribute(`height`,n?String(e.viewBox[3]):`100%`),n?i.setAttribute(`xmlns`,r):(i.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),i.style.setProperty(`display`,`block`));for(let a of e.paths){let e=document.createElementNS(r,`path`);e.setAttribute(`d`,a.d);let o=Tn(a.fill===`currentColor`?t.fill??`currentColor`:a.fill),s=Tn(a.stroke===`currentColor`?t.stroke??`currentColor`:a.stroke);n?(e.setAttribute(`fill`,o??`none`),s&&e.setAttribute(`stroke`,s)):(e.setAttribute(`fill`,`none`),o&&e.style.setProperty(`fill`,o),s&&e.style.setProperty(`stroke`,s)),a.strokeWidth!==void 0&&e.setAttribute(`stroke-width`,String(a.strokeWidth)),a.fillRule&&e.setAttribute(`fill-rule`,a.fillRule),a.cap&&e.setAttribute(`stroke-linecap`,a.cap),a.join&&e.setAttribute(`stroke-linejoin`,a.join),a.opacity!==void 0&&e.setAttribute(`opacity`,String(a.opacity)),a.transform&&e.setAttribute(`transform`,`matrix(${a.transform.join(` `)})`),i.appendChild(e)}return i.outerHTML}function Dn(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=n(e.strokes?.[0]?.paint);return{fill:r??i,stroke:i??r}}var On=[{id:`stacked-waves`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`wave`,boundary:`shared`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Frecuencia`,en:`Frequency`},min:2,max:12,step:1,default:4},{key:`amplitude`,kind:`range`,group:`SHAPE`,label:{es:`Amplitud`,en:`Amplitude`},min:0,max:1,step:.05,default:.5},{key:`balance`,kind:`range`,group:`SHAPE`,label:{es:`Balance`,en:`Balance`},min:0,max:1,step:.05,default:.5},{key:`anchor`,kind:`enum`,group:`DIRECTION`,label:{es:`Anclaje`,en:`Anchor`},options:[{value:`bottom`,label:{es:`Abajo`,en:`Bottom`}},{value:`top`,label:{es:`Arriba`,en:`Top`}},{value:`left`,label:{es:`Izquierda`,en:`Left`}},{value:`right`,label:{es:`Derecha`,en:`Right`}}],default:`bottom`}]},{id:`layered-waves`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`wave`,boundary:`independent`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Frecuencia`,en:`Frequency`},min:2,max:12,step:1,default:4},{key:`amplitude`,kind:`range`,group:`SHAPE`,label:{es:`Amplitud`,en:`Amplitude`},min:0,max:1,step:.05,default:.5},{key:`anchor`,kind:`enum`,group:`DIRECTION`,label:{es:`Anclaje`,en:`Anchor`},options:[{value:`bottom`,label:{es:`Abajo`,en:`Bottom`}},{value:`top`,label:{es:`Arriba`,en:`Top`}}],default:`bottom`}]},{id:`stacked-peaks`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`peak`,boundary:`shared`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Picos`,en:`Peaks`},min:2,max:12,step:1,default:4},{key:`amplitude`,kind:`range`,group:`SHAPE`,label:{es:`Altura`,en:`Height`},min:0,max:1,step:.05,default:.6}]},{id:`layered-peaks`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`peak`,boundary:`independent`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Picos`,en:`Peaks`},min:2,max:12,step:1,default:4}]},{id:`stacked-steps`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`step`,boundary:`shared`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Escalones`,en:`Steps`},min:2,max:12,step:1,default:5}]},{id:`layered-steps`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`step`,boundary:`independent`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5}]},{id:`zigzag-chevron`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`zigzag`,boundary:`independent`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Franjas`,en:`Bands`},min:1,max:12,step:1,default:6}]},{id:`circle-scatter`,layers:[{primitive:`scatter`,fixed:{element:`circle`}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Círculos`,en:`Circles`},min:1,max:40,step:1,default:3},{key:`sizeMin`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Mín`,en:`Min Size`},min:10,max:100,step:5,default:60},{key:`sizeMax`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Máx`,en:`Max Size`},min:60,max:300,step:10,default:180},{key:`minDistance`,kind:`range`,group:`SHAPE`,label:{es:`Distancia Mín`,en:`Min Distance`},min:0,max:100,step:5,default:40}]},{id:`rose-petals`,layers:[{primitive:`scatter`,fixed:{element:`petal`}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Pétalos`,en:`Petals`},min:1,max:40,step:1,default:12},{key:`sizeMin`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Mín`,en:`Min Size`},min:10,max:100,step:5,default:30}]},{id:`blob-scene`,layers:[{primitive:`blob`,fixed:{}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Blobs`,en:`Blobs`},min:1,max:6,step:1,default:2},{key:`points`,kind:`range`,group:`SHAPE`,label:{es:`Complejidad`,en:`Complexity`},min:5,max:14,step:1,default:8},{key:`irregularity`,kind:`range`,group:`SHAPE`,label:{es:`Deformación`,en:`Irregularity`},min:0,max:1,step:.05,default:.5},{key:`anchor`,kind:`enum`,group:`DIRECTION`,label:{es:`Anclaje`,en:`Anchor`},options:[{value:`center`,label:{es:`Centro`,en:`Center`}},{value:`corner-tl`,label:{es:`Esquina Sup-Izq`,en:`Top-Left`}},{value:`corner-tr`,label:{es:`Esquina Sup-Der`,en:`Top-Right`}},{value:`corner-bl`,label:{es:`Esquina Inf-Izq`,en:`Bottom-Left`}},{value:`corner-br`,label:{es:`Esquina Inf-Der`,en:`Bottom-Right`}}],default:`corner-tr`}]},{id:`low-poly-grid`,layers:[{primitive:`mesh`,fixed:{}}],schema:[{key:`resolution`,kind:`range`,group:`SHAPE`,label:{es:`Resolución`,en:`Resolution`},min:3,max:20,step:1,default:8},{key:`distortion`,kind:`range`,group:`SHAPE`,label:{es:`Distorsión`,en:`Distortion`},min:0,max:1,step:.05,default:.6},{key:`borderWidth`,kind:`range`,group:`SHAPE`,label:{es:`Borde`,en:`Border`},min:0,max:4,step:.5,default:.5}]},{id:`bullseye-gradient`,layers:[{primitive:`radial`,fixed:{kind:`rings`}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Anillos`,en:`Rings`},min:3,max:48,step:1,default:16}]},{id:`wintery-sunburst`,layers:[{primitive:`radial`,fixed:{kind:`rays`}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Rayos`,en:`Rays`},min:3,max:48,step:1,default:16}]},{id:`radiant-gradient`,layers:[{primitive:`gradient`,fixed:{kind:`radial`}}],schema:[{key:`softness`,kind:`range`,group:`SHAPE`,label:{es:`Suavidad`,en:`Softness`},min:0,max:1,step:.05,default:.8}]},{id:`blurry-gradient`,layers:[{primitive:`gradient`,fixed:{kind:`linear`}}],schema:[{key:`angle`,kind:`range`,group:`SHAPE`,label:{es:`Ángulo`,en:`Angle`},min:0,max:360,step:15,default:135}]},{id:`protruding-cubes`,layers:[{primitive:`iso-grid`,fixed:{hollow:!1}}],schema:[{key:`cols`,kind:`range`,group:`SHAPE`,label:{es:`Columnas`,en:`Columns`},min:4,max:20,step:1,default:8},{key:`extrude`,kind:`range`,group:`SHAPE`,label:{es:`Extrusión`,en:`Extrusion`},min:0,max:1,step:.05,default:.6}]},{id:`hollowed-boxes`,layers:[{primitive:`iso-grid`,fixed:{hollow:!0}}],schema:[{key:`cols`,kind:`range`,group:`SHAPE`,label:{es:`Columnas`,en:`Columns`},min:4,max:20,step:1,default:8}]},{id:`luz-difusa`,layers:[{primitive:`gradient`,fixed:{kind:`linear`}},{primitive:`radial`,fixed:{kind:`radial`},blend:`screen`,opacity:.8,blur:20}],grain:{intensity:.15},schema:[{key:`angle`,kind:`range`,group:`SHAPE`,label:{es:`Ángulo Base`,en:`Base Angle`},min:0,max:360,step:15,default:135},{key:`softness`,kind:`range`,group:`SHAPE`,label:{es:`Difusión`,en:`Diffusion`},min:.1,max:1,step:.05,default:.8}]},{id:`malla-suave`,layers:[{primitive:`mesh`,fixed:{borderWidth:0}},{primitive:`radial`,fixed:{kind:`radial`},blend:`soft-light`,opacity:.7}],schema:[{key:`resolution`,kind:`range`,group:`SHAPE`,label:{es:`Resolución Malla`,en:`Mesh Resolution`},min:3,max:12,step:1,default:6},{key:`distortion`,kind:`range`,group:`SHAPE`,label:{es:`Fluidez`,en:`Fluidity`},min:0,max:1,step:.05,default:.5},{key:`softness`,kind:`range`,group:`SHAPE`,label:{es:`Luz Radial`,en:`Radial Light`},min:.1,max:1,step:.05,default:.7}]},{id:`reticula`,layers:[{primitive:`gradient`,fixed:{kind:`linear`}},{primitive:`iso-grid`,fixed:{hollow:!0},blend:`screen`,opacity:.85}],grain:{intensity:.18},schema:[{key:`cols`,kind:`range`,group:`SHAPE`,label:{es:`Densidad Rejilla`,en:`Grid Density`},min:4,max:24,step:1,default:10},{key:`angle`,kind:`range`,group:`SHAPE`,label:{es:`Inclinación Luz`,en:`Light Angle`},min:0,max:360,step:15,default:120}]},{id:`polvo`,layers:[{primitive:`gradient`,fixed:{kind:`radial`}},{primitive:`scatter`,fixed:{element:`circle`},blend:`lighten`,opacity:.65}],grain:{intensity:.28},schema:[{key:`count`,kind:`range`,group:`VARIANTS`,label:{es:`Partículas`,en:`Particles`},min:10,max:80,step:5,default:35},{key:`sizeMin`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Mín`,en:`Min Size`},min:2,max:20,step:1,default:4},{key:`sizeMax`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Máx`,en:`Max Size`},min:10,max:50,step:2,default:20}]}];function kn(e){return On.find(t=>t.id===e)}var An=(e,t)=>{let n=e,r=Math.max(1,Math.min(12,Number(n.layers??5))),i=n.interpolation||`wave`,a=n.boundary||`shared`,o=Math.max(2,Math.min(12,Number(n.frequency??4))),s=Math.max(0,Math.min(1,Number(n.amplitude??.5))),c=Math.max(0,Math.min(1,Number(n.balance??.5))),l=n.anchor||`bottom`,u=t.width,d=t.height,f=t.bleed,p=l===`bottom`||l===`top`,m=p?d:u,h=p?u:d,g=m/(r+1),_=(c-.5)*h*.4,v=[];for(let e=0;e<r;e++){let n=(e+1)*g,r=[],i=h/o;for(let e=0;e<=o;e++){let a=e*i,c=(t.rng.next()-.5)*g*s*1.6,f=Math.max(10,Math.min(m-10,n+c));if(p){let t=a+(e>0&&e<o?_:0),n=l===`bottom`?d-f:f;r.push({x:t,y:n})}else{let t=a+(e>0&&e<o?_:0),n=l===`right`?u-f:f;r.push({x:n,y:t})}}v.push(r)}let y=``,b=a===`independent`?Array.from({length:r},(e,t)=>r-1-t):Array.from({length:r},(e,t)=>t);for(let e of b){let n=t.ramp(e,r),o=v[e],s=``;if(i===`step`){s=`M ${o[0].x} ${o[0].y}`;for(let e=0;e<o.length-1;e++){let t=o[e],n=o[e+1];s+=p?` L ${n.x} ${t.y} L ${n.x} ${n.y}`:` L ${t.x} ${n.y} L ${n.x} ${n.y}`}}else if(i===`peak`){s=`M ${o[0].x} ${o[0].y}`;for(let e=1;e<o.length;e++)s+=` L ${o[e].x} ${o[e].y}`}else if(i===`zigzag`||i===`chevron`){s=`M ${o[0].x} ${o[0].y}`;for(let t=0;t<o.length-1;t++){let n=o[t],r=o[t+1],i=(n.x+r.x)/2+(p?0:e%2==0?30:-30),a=(n.y+r.y)/2+(p?e%2==0?30:-30:0);s+=` L ${i} ${a} L ${r.x} ${r.y}`}}else{s=`M ${o[0].x} ${o[0].y}`;for(let e=0;e<o.length-1;e++){let t=o[e],n=o[e+1],r=t.x+(n.x-t.x)*.5,i=t.y,a=t.x+(n.x-t.x)*.5,c=n.y;s+=` C ${r} ${i}, ${a} ${c}, ${n.x} ${n.y}`}}if(a===`shared`&&e>0){let t=v[e-1],n=l===`bottom`?f:l===`top`?-f:0,r=l===`right`?f:l===`left`?-f:0;for(let e=t.length-1;e>=0;e--)s+=` L ${t[e].x+r} ${t[e].y+n}`}else s+=l===`bottom`?` L ${u} ${d+f} L 0 ${d+f}`:l===`top`?` L ${u} ${-f} L 0 ${-f}`:l===`right`?` L ${u+f} ${d} L ${u+f} 0`:` L ${-f} ${d} L ${-f} 0`;s+=` Z`,y+=`<path d="${s}" fill="${n}" stroke="${n}" stroke-width="0.5" stroke-linejoin="round" stroke-linecap="round" />`}return y},jn=(e,t)=>{let n=e,r=Math.max(1,Math.min(40,Number(n.count??3))),i=n.element||`circle`,a=Math.max(10,Number(n.sizeMin??60)),o=Math.max(a,Number(n.sizeMax??180)),s=Math.max(0,Number(n.minDistance??40)),c=n.distribution||`uniform`,l=t.width,u=t.height,d=[],f=r*50,p=0;for(;d.length<r&&p<f;){p++;let e=t.rng.next()*l,n=t.rng.next()*u;if(c===`center`){let r=l/2,i=u/2,a=t.rng.next()**.5,o=t.rng.next()*Math.PI*2;e=r+Math.cos(o)*(l*.35*a),n=i+Math.sin(o)*(u*.35*a)}else c===`edge`&&(t.rng.next()>.5?e=t.rng.next()>.5?t.rng.range(0,l*.25):t.rng.range(l*.75,l):n=t.rng.next()>.5?t.rng.range(0,u*.25):t.rng.range(u*.75,u));let r=t.rng.range(a,o),i=!0;for(let t of d)if(Math.hypot(e-t.x,n-t.y)<t.r+r+s){i=!1;break}i&&d.push({x:e,y:n,r})}let m=``;for(let e=0;e<d.length;e++){let n=d[e],r=t.ramp(e,Math.max(1,d.length));if(i===`petal`){let e=`M ${n.x} ${n.y} C ${n.x+n.r} ${n.y-n.r*1.5}, ${n.x+n.r*2} ${n.y}, ${n.x} ${n.y+n.r*2} Z`;m+=`<path d="${e}" fill="${r}" stroke="${r}" opacity="0.85" />`}else if(i===`blob`){let e=n.r*(.8+t.rng.next()*.4),i=n.r*(.8+t.rng.next()*.4),a=n.r*(.8+t.rng.next()*.4),o=n.r*(.8+t.rng.next()*.4),s=`M ${n.x} ${n.y-e} C ${n.x+i} ${n.y-e}, ${n.x+i} ${n.y+a}, ${n.x} ${n.y+a} C ${n.x-o} ${n.y+a}, ${n.x-o} ${n.y-e}, ${n.x} ${n.y-e} Z`;m+=`<path d="${s}" fill="${r}" opacity="0.85" />`}else m+=`<circle cx="${n.x}" cy="${n.y}" r="${n.r}" fill="${r}" opacity="0.85" />`}return m},Mn=(e,t)=>{let n=e,r=Math.max(1,Math.min(6,Number(n.count??1))),i=Math.max(5,Math.min(14,Number(n.points??8))),a=Math.max(0,Math.min(1,Number(n.irregularity??.5))),o=n.anchor||`center`,s=Math.max(100,Number(n.size??Math.min(t.width,t.height)*.45)),c=t.width,l=t.height,u=``;for(let e=0;e<r;e++){let n=t.ramp(e,r),d=s*(1-e*.15),f=c/2,p=l/2;o===`corner-tl`?(f=0,p=0):o===`corner-tr`?(f=c,p=0):o===`corner-bl`?(f=0,p=l):o===`corner-br`&&(f=c,p=l);let m=Math.PI*2/i,h=[];for(let e=0;e<i;e++){let n=e*m,r=(t.rng.next()-.5)*d*a,i=Math.max(20,d+r);h.push({x:Math.cos(n)*i,y:Math.sin(n)*i})}let g=`M ${h[0].x} ${h[0].y}`;for(let e=0;e<i;e++){let t=h[e],n=h[(e+1)%i],r=(t.x+n.x)/2,a=(t.y+n.y)/2;g+=` Q ${t.x} ${t.y}, ${r} ${a}`}g+=` Z`,u+=`
48
+ [data-slot-id="background-pattern-slot"] { width: 100% !important; height: 100% !important; display: block !important; }`}function ee(e){if(!e)return;let t=O();if(document.head&&!document.getElementById(`oim-player-styles`)){let e=document.createElement(`style`);e.id=`oim-player-styles`,e.textContent=t,document.head.appendChild(e)}if(e.getElementById&&!e.getElementById(`oim-player-styles`)){let n=document.createElement(`style`);n.id=`oim-player-styles`,n.textContent=t,e.appendChild(n)}}function k(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}var te="/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst e=10485760;async function t(t,r=e){let i=t.replace(/\\s+/g,``);try{let e=atob(i);if(e.trim().startsWith(`{`)){if(e.length>r)throw Error(`Metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let a=atob(i),o=new Uint8Array(a.length);for(let e=0;e<a.length;e++)o[e]=a.charCodeAt(e);try{return JSON.parse(await n(o,`deflate`,r))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await n(o,`deflate-raw`,r))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function n(t,n,r=e){let i=new DecompressionStream(n),a=i.writable.getWriter();a.write(t).catch(function(){}),a.close().catch(function(){});let o=i.readable.getReader(),s=[],c=0;try{for(;;){let{done:e,value:t}=await o.read();if(e)break;if(t){if(c+=t.byteLength,c>r)throw await o.cancel(),Error(`Decompressed metadata exceeds the limit of ${r/1048576}MB (zip bomb detected)`);s.push(t)}}}finally{o.releaseLock()}let l=new Uint8Array(c),u=0;for(let e of s)l.set(e,u),u+=e.byteLength;return new TextDecoder().decode(l)}async function r(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function i(e){let i=await e.arrayBuffer(),a=new DataView(i),o=8,s=null,c=null,l=[new Uint8Array(i,0,8)];for(;o<i.byteLength;){let e=a.getUint32(o,!1),t=o+4,r=String.fromCharCode(a.getUint8(t),a.getUint8(t+1),a.getUint8(t+2),a.getUint8(t+3)),u=8+e+4;if(r===`tEXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r.slice(a+1),t=null;try{t=await n(e,`deflate`)}catch{try{t=await n(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{c=JSON.parse(t)}catch{}else s=new TextDecoder(`latin1`).decode(e);o+=u;continue}}}else if(r===`zTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r.slice(a+2);if(e===0)try{s=await n(t,`deflate`)}catch(e){try{s=await n(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(s){o+=u;continue}}}}else if(r===`iTXt`){let r=new Uint8Array(i,t+4,e),a=r.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(r.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=r[a+1],t=r[a+2],i=r.slice(a+3),c=i.indexOf(0);if(c!==-1){let r=i.slice(c+1),a=r.indexOf(0);if(a!==-1){let i=r.slice(a+1);if(e===1){if(t===0)try{s=await n(i,`deflate`)}catch(e){try{s=await n(i,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else s=new TextDecoder().decode(i);if(s){o+=u;continue}}}}}}l.push(new Uint8Array(i,o,u)),o+=u}let u=new Blob(l,{type:`image/png`}),d=null;return c?d=c:s&&(d=s.trimStart().startsWith(`{`)?JSON.parse(s):await t(s)),{image:u,metadata:d,imageHash:await r(i)}}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nfunction a(e){let t=e.artboardWidth||e.canvasWidth||e.canvas_width||1080,n=e.artboardHeight||e.canvasHeight||e.canvas_height||1920;Array.isArray(e.slots_raw)&&!Array.isArray(e.slots)&&(e.slots=e.slots_raw.map(e=>{let r=e.x_px??e.x??0,i=e.y_px??e.y??0,a=e.width_px??e.width??0,o=e.height_px??e.height??0,s=e.align||`left`,c=r,l=i,u=t>0?c/t*100:0,d=n>0?l/n*100:0,f=e.style||{};return f.width=f.width||a+`px`,f.height=f.height||o+`px`,e.border_radius_px!==void 0&&f.borderRadius===void 0&&(f.borderRadius=e.border_radius_px+`px`),f.borderRadiusTL!==void 0&&(f.borderTopLeftRadius=f.borderRadiusTL+`px`,f.borderTopRightRadius=f.borderRadiusTR+`px`,f.borderBottomLeftRadius=f.borderRadiusBL+`px`,f.borderBottomRightRadius=f.borderRadiusBR+`px`),{...e,x:r,y:i,width:a,height:o,width_px:a,height_px:o,align:s,fontSize:e.fontSize??e.font_size_px??16,position:[u,d],style:f}})),Array.isArray(e.languages)&&!Array.isArray(e.lang)&&(e.lang=e.languages)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst o=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}];function s(e){for(let t=0;t<o.length;t++)if(o[t].kid===e)return o[t];return null}let c=null;function l(e){c=typeof e==`string`&&e?e:null}function u(){if(c)return c;let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||`https://api.oim.media/v1/media/keys`}function d(e,t){let n=s(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function f(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}function p(e,t,n=Date.now()){let r=s(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!s(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+6048e5}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst m=2**53-1;function h(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>m:typeof e==`object`&&e?Object.values(e).some(h):!1}const g=/* @__PURE__ */ new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function _(e){if(Array.isArray(e))return e.map(_);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=_(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function v(e){if(Array.isArray(e))return e.map(v);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=v(e[r]);return t}return e}function y(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))g.has(n)||(t[n]=e[n]);let n=v(_(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst b=/* @__PURE__ */ new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),x=/* @__PURE__ */ new Set([`public`,`author_only`,`sealed`]);function S(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?b.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&x.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst C=`author_only`,w=[`public`,`author_only`,`sealed`];function T(e){if(!e||typeof e!=`object`)return C;let t=S(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&w.includes(n)?n:C}function E(e){return e===`public`?`verified_authorless`:`verified`}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nconst D={};let O=null,k=!1,A=null;function j(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function M(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function N(e){let t=s(e);return t?t.jwk:(D[e]||!k&&(A||=j().then(e=>{e.forEach(e=>{D[e.kid]=e}),k=!0}),await A,D[e])||await P(),D[e])}function P(){return O||=(async function(){try{let e=u(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];D[t.kid]=t}await M(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),O}async function F(e){return await P(),D[e]||null}async function I(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await N(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(h(e))return!1;let n=y(e),r=atob(e.signature),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);let a=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,i,t)},o=await a(t,n);if(!o&&e.creator_user_id){let n={},r=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function i(e){if(Array.isArray(e))return e.map(i);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort();for(let r=0;r<n.length;r++)t[n[r]]=i(e[n[r]]);return t}return e}for(let t=0;t<r.length;t++)n[r[t]]=i(e[r[t]]);o=await a(t,new TextEncoder().encode(JSON.stringify(n)))}if(!o)try{let r=await F(e.key_version);r&&(r.x!==t.x||r.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),o=await a(r,n))}catch{}if(o){let n=d(e.key_version,t);if(!f({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return o||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),o}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function L(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:E(T(e.metadata)):`image_unsealed`}async function R(e,t=Date.now()){let n=e&&e.key_version;return n?s(n)?p(n,null,t):p(n,await F(n),t):!1}function z(e){return e===`image_mismatch`||e===`invalid_signature`}function B(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}\n/**\n* @license\n* Copyright (c) 2026 Xue Studios LLC\n* SPDX-License-Identifier: Apache-2.0\n*/\nself.onmessage=async function(e){let{id:t,blob:n,origin:r,keysUrl:o}=e.data;l(o);try{let e=await i(n);if(!e.metadata){self.postMessage({id:t,success:!0,metadata:{slots:[]},isSigValid:!1,security:`no_metadata`});return}let o=B(e.metadata);if(o.length>0)throw Error(`Corrupted or tampered OIM file: `+o[0]);let s=!!(e.metadata.signature&&e.metadata.key_version),c=await I(e.metadata,r),l=L({isSigned:s,isSigValid:c,keyExpired:s&&c?await R(e.metadata):!1,metadata:e.metadata,imageHash:e.imageHash});if(z(l)){self.postMessage({id:t,success:!1,refused:!0,security:l,error:`OIM_ALTERED: `+l});return}c?l===`unsigned`||l===`expired_key`?e.metadata={slots:[],elements:[],layers:[]}:a(e.metadata):e.metadata={slots:[]},self.postMessage({id:t,success:!0,metadata:e.metadata,isSigValid:c,security:l})}catch(e){self.postMessage({id:t,success:!1,error:e.message||String(e)})}};",A=typeof self<`u`&&self.Blob&&new Blob([`URL.revokeObjectURL(import.meta.url);`,te],{type:`text/javascript;charset=utf-8`});function ne(e){let t;try{if(t=A&&(self.URL||self.webkitURL).createObjectURL(A),!t)throw``;let n=new Worker(t,{type:`module`,name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(te),{type:`module`,name:e?.name})}}var re=[{kid:`v1`,jwk:{kty:`EC`,crv:`P-256`,x:`5Qavr4M_npVognquI5k5D9K8wcXBXM9Z0mZHjqyehAs`,y:`oh7rz5Q7SlZT_ms2buyOw0bPX77QsXimc0X92Ymj2_o`}},{kid:`v2`,jwk:{kty:`EC`,crv:`P-256`,x:`pRSLtFHe9p8sR8jyqP5eoaBGbHdJgjjrdClda2lNp4A`,y:`oopYYhgja8m2iAlSMPigeWw-F72KJLNCRFQzlyWdt2I`}}],ie=`https://api.oim.media/v1/media/keys`;function j(e){for(let t=0;t<re.length;t++)if(re[t].kid===e)return re[t];return null}function ae(){let e=globalThis.OIM_PLAYER_CONFIG;return(e&&typeof e.keysUrl==`string`?e.keysUrl:``)||ie}function M(e,t){let n=j(e)?.not_after,r=t&&typeof t.not_after==`string`?t.not_after:void 0;return n?r&&Date.parse(r)<Date.parse(n)?r:n:r}function N(e,t){if(!e.not_after||!t)return!0;let n=Date.parse(t),r=Date.parse(e.not_after);return isNaN(n)||isNaN(r)?!0:n<=r}var P=6048e5;function F(e,t,n=Date.now()){let r=j(e)?.verify_until,i=t&&typeof t.verify_until==`string`?t.verify_until:void 0;if(!j(e)&&!t)return!0;let a=[r,i].filter(e=>!!e&&!isNaN(Date.parse(e)));return a.length!==0&&n>Math.min(...a.map(e=>Date.parse(e)))+P}var oe=class extends Error{reason;constructor(e){super(`Web Worker unavailable`),this.reason=e,this.name=`WorkerUnavailableError`}};function se(e){let t=null,n=null,r=1,i=new Map;function a(e){let t=[...i.values()];i.clear(),t.forEach(t=>t.reject(e))}function o(){if(t)return t;let n=e();return n.onmessage=e=>{let t=e.data,n=t&&typeof t.id==`number`?i.get(t.id):void 0;n&&(i.delete(t.id),n.resolve(t))},n.onerror=e=>{try{n.terminate()}catch{}t===n&&(t=null),a(e)},t=n,n}return{verify(e,t,a){if(n)return Promise.reject(new oe(n));let s;try{s=o()}catch(e){return n=e||!0,Promise.reject(new oe(e))}let c=r++;return new Promise((n,r)=>{i.set(c,{resolve:n,reject:r}),s.postMessage({id:c,blob:e,hostname:t,origin:a,keysUrl:ae()})})},stats(){return{alive:t!==null,pending:i.size}}}}var ce=null;function le(e,t,n){return ce||=se(()=>new ne),ce.verify(e,t,n)}var I=10485760;async function ue(e,t=I){let n=e.replace(/\s+/g,``);try{let e=atob(n);if(e.trim().startsWith(`{`)){if(e.length>t)throw Error(`Metadata exceeds the limit of ${t/1048576}MB (zip bomb detected)`);return JSON.parse(e)}}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e}let r=atob(n),i=new Uint8Array(r.length);for(let e=0;e<r.length;e++)i[e]=r.charCodeAt(e);try{return JSON.parse(await L(i,`deflate`,t))}catch(e){if(e.message&&e.message.includes(`zip bomb detected`))throw e;try{return JSON.parse(await L(i,`deflate-raw`,t))}catch(t){throw t.message&&t.message.includes(`zip bomb detected`)||console.error(`[OIM Core] Decompression failed for both deflate and deflate-raw:`,e,t),t}}}async function L(e,t,n=I){let r=new DecompressionStream(t),i=r.writable.getWriter();i.write(e).catch(function(){}),i.close().catch(function(){});let a=r.readable.getReader(),o=[],s=0;try{for(;;){let{done:e,value:t}=await a.read();if(e)break;if(t){if(s+=t.byteLength,s>n)throw await a.cancel(),Error(`Decompressed metadata exceeds the limit of ${n/1048576}MB (zip bomb detected)`);o.push(t)}}}finally{a.releaseLock()}let c=new Uint8Array(s),l=0;for(let e of o)c.set(e,l),l+=e.byteLength;return new TextDecoder().decode(c)}async function de(e){let t=new DataView(e),n=[],r=0;for(let i=8;i+8<=e.byteLength;){let a=t.getUint32(i,!1);String.fromCharCode(t.getUint8(i+4),t.getUint8(i+5),t.getUint8(i+6),t.getUint8(i+7))===`IDAT`&&(n.push(new Uint8Array(e,i+8,a)),r+=a),i+=12+a}if(n.length===0)return null;let i=new Uint8Array(r),a=0;for(let e of n)i.set(e,a),a+=e.length;let o=await crypto.subtle.digest(`SHA-256`,i);return Array.from(new Uint8Array(o),e=>e.toString(16).padStart(2,`0`)).join(``)}async function fe(e){let t=await e.arrayBuffer(),n=new DataView(t),r=8,i=null,a=null,o=[new Uint8Array(t,0,8)];for(;r<t.byteLength;){let e=n.getUint32(r,!1),s=r+4,c=String.fromCharCode(n.getUint8(s),n.getUint8(s+1),n.getUint8(s+2),n.getUint8(s+3)),l=8+e+4;if(c===`tEXt`){let n=new Uint8Array(t,s+4,e),o=n.indexOf(0);if(o!==-1){let e=new TextDecoder().decode(n.slice(0,o));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n.slice(o+1),t=null;try{t=await L(e,`deflate`)}catch{try{t=await L(e,`deflate-raw`)}catch{}}if(t&&t.trim().startsWith(`{`))try{a=JSON.parse(t)}catch{}else i=new TextDecoder(`latin1`).decode(e);r+=l;continue}}}else if(c===`zTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n.slice(a+2);if(e===0)try{i=await L(t,`deflate`)}catch(e){try{i=await L(t,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress zTXt chunk:`,e,t)}}if(i){r+=l;continue}}}}else if(c===`iTXt`){let n=new Uint8Array(t,s+4,e),a=n.indexOf(0);if(a!==-1){let e=new TextDecoder().decode(n.slice(0,a));if(e===`OIM_Data`||e===`OIM_JSON_DATA`){let e=n[a+1],t=n[a+2],o=n.slice(a+3),s=o.indexOf(0);if(s!==-1){let n=o.slice(s+1),a=n.indexOf(0);if(a!==-1){let o=n.slice(a+1);if(e===1){if(t===0)try{i=await L(o,`deflate`)}catch(e){try{i=await L(o,`deflate-raw`)}catch(t){console.error(`[OimPlayer] Failed to decompress iTXt chunk:`,e,t)}}}else i=new TextDecoder().decode(o);if(i){r+=l;continue}}}}}}o.push(new Uint8Array(t,r,l)),r+=l}let s=new Blob(o,{type:`image/png`}),c=null;return a?c=a:i&&(c=i.trimStart().startsWith(`{`)?JSON.parse(i):await ue(i)),{image:s,metadata:c,imageHash:await de(t)}}var pe=2**53-1;function R(e){return typeof e==`number`?!Number.isFinite(e)||Math.abs(e)>pe:typeof e==`object`&&e?Object.values(e).some(R):!1}var me=new Set([`signature`,`key_version`,`timestamp`,`creator_user_id`]);function he(e){if(Array.isArray(e))return e.map(he);if(typeof e==`object`&&e){let t={};for(let n of Object.keys(e))t[n]=he(e[n]);return t}return typeof e==`number`&&Number.isFinite(e)&&!Number.isInteger(e)?Number(e.toFixed(6)):e}function ge(e){if(Array.isArray(e))return e.map(ge);if(typeof e==`object`&&e){let t={},n=Object.keys(e).sort((e,t)=>{let n=[...e],r=[...t],i=Math.min(n.length,r.length);for(let e=0;e<i;e++){let t=(n[e].codePointAt(0)??0)-(r[e].codePointAt(0)??0);if(t!==0)return t}return n.length-r.length});for(let r of n)t[r]=ge(e[r]);return t}return e}function _e(e){if(!e||typeof e!=`object`)return new TextEncoder().encode(`{}`);let t={};for(let n of Object.keys(e))me.has(n)||(t[n]=e[n]);let n=ge(he(t)),r=JSON.stringify(n);return new TextEncoder().encode(r)}var ve=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),ye=new Set([`public`,`author_only`,`sealed`]);function z(e){let t={...e};if(t.reedit===void 0&&`reedicion`in t){let e=t.reedicion;t.reedit=typeof e==`string`?ve.get(e)??`author_only`:`author_only`}return t.reedit!==void 0&&!(typeof t.reedit==`string`&&ye.has(t.reedit))&&(t.reedit=`author_only`),delete t.reedicion,t}var B=`author_only`,V=[`public`,`author_only`,`sealed`];function be(e){if(!e||typeof e!=`object`)return B;let t=z(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let n=t.reedit;return typeof n==`string`&&V.includes(n)?n:B}function xe(e){return e===`public`?`verified_authorless`:`verified`}function Se(e,t){let n=e||``,r=``;for(let e=0;e<n.length;e++)n.charCodeAt(e)>=32&&(r+=n.charAt(e));return r=r.trim(),r.charAt(0)===`#`?!0:t?!1:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(r)||/^https?:/i.test(r)||/^data:image\//i.test(r)}function Ce(e){if(typeof DOMParser>`u`)return e;try{let t=new DOMParser().parseFromString(e,`text/html`),n=`svg.g.defs.symbol.use.title.desc.path.circle.rect.polygon.polyline.ellipse.line.lineargradient.radialgradient.stop.pattern.image.clippath.mask.filter.fegaussianblur.fecolormatrix.fecomponenttransfer.fefunca.fefuncr.fefuncg.fefuncb.feblend.feoffset.femerge.femergenode.feflood.fecomposite.text.tspan.span.div.br.p.a.b.i.strong.em.img`.split(`.`),r=`class.style.id.lang.aria-hidden.part.transform.d.cx.cy.r.rx.ry.x.y.dx.dy.x1.y1.x2.y2.fx.fy.width.height.points.viewbox.preserveaspectratio.vector-effect.fill.stroke.fill-rule.clip-rule.opacity.fill-opacity.stroke-opacity.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.offset.stop-color.stop-opacity.gradientunits.gradienttransform.spreadmethod.patternunits.patterncontentunits.patterntransform.clip-path.clippathunits.mask.maskunits.maskcontentunits.filter.filterunits.primitiveunits.stddeviation.result.in.in2.mode.type.values.tablevalues.flood-color.flood-opacity.operator.font-family.font-size.font-weight.font-style.text-anchor.dominant-baseline.letter-spacing.word-spacing.href.src.target.rel.alt.data-slot-id.allow-lottie.show-controls.crossorigin`.split(`.`),i=t.body.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let t=i[e],a=t.tagName.toLowerCase();if(n.indexOf(a)===-1){t.parentNode?.removeChild(t);continue}let o=t.attributes;for(let e=o.length-1;e>=0;e--){let n=o[e],i=n.name.toLowerCase();if(i.indexOf(`on`)===0||r.indexOf(i)===-1)t.removeAttribute(n.name);else{if(i===`href`&&!Se(n.value,a===`use`||a===`image`)&&t.removeAttribute(n.name),i===`style`){let e=Te(n.value);e!==n.value&&t.setAttribute(n.name,e)}else if(i!==`href`&&i!==`src`&&Ee(n.value)){t.removeAttribute(n.name);continue}i===`src`&&(De(n.value.trim())||t.removeAttribute(n.name))}}}return t.body.innerHTML}catch(e){return console.warn(`[OimPlayer] HTML sanitization failed:`,e),``}}function we(e){let t=(e||``).trim().toLowerCase();return t.indexOf(`data:image/`)===0||t.indexOf(`blob:`)===0}function Te(e){return typeof e==`string`?e.indexOf(`\\`)!==-1||/@import|image-set\s*\(/i.test(e)?``:e.indexOf(`(`)===-1?e:e.replace(/url\(\s*(['"]?)(.*?)\1\s*\)/gi,function(e,t,n){let r=String(n).trim().toLowerCase();return r.indexOf(`#`)===0||r.indexOf(`data:`)===0?e:`none`}):e}function Ee(e){let t=typeof e==`string`?e:``;if(t.indexOf(`\\`)!==-1||/image-set\s*\(|@import/i.test(t))return!0;let n=/url\(\s*['"]?\s*([^'")\s]*)/gi,r;for(;(r=n.exec(t))!==null;){let e=r[1].trim().toLowerCase();if(e.indexOf(`#`)!==0&&e.indexOf(`data:`)!==0)return!0}return!1}function De(e){let t=(e||``).trim();if(t.indexOf(`data:image/`)!==0)return!1;let n=t.indexOf(`,`);if(n===-1)return!1;let r=t.substring(0,n).toLowerCase();if(r.indexOf(`;base64`)===-1)return!1;let i=r.substring(5,r.indexOf(`;`));return[`image/png`,`image/jpeg`,`image/jpg`,`image/webp`,`image/gif`].indexOf(i)!==-1}function Oe(e){return!e||typeof e!=`string`?`Inter, sans-serif`:e.replace(/[^a-zA-Z0-9 ,\-\.'\'"]/g,``).trim().slice(0,128)||`Inter, sans-serif`}var H={},ke=null,Ae=!1,U=null;function W(){return new Promise(e=>{if(typeof indexedDB>`u`)return e([]);try{let t=indexedDB.open(`oim-player-keys`,1);t.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},t.onsuccess=t=>{let n=t.target.result;if(!n.objectStoreNames.contains(`keys`)){e([]),n.close();return}let r=n.transaction(`keys`,`readonly`).objectStore(`keys`).getAll();r.onsuccess=()=>{e(r.result||[]),n.close()},r.onerror=()=>{e([]),n.close()}},t.onerror=()=>{e([])}}catch{e([])}})}function G(e){return new Promise(t=>{if(typeof indexedDB>`u`)return t();try{let n=indexedDB.open(`oim-player-keys`,1);n.onupgradeneeded=e=>{let t=e.target.result;t.objectStoreNames.contains(`keys`)||t.createObjectStore(`keys`,{keyPath:`kid`})},n.onsuccess=n=>{let r=n.target.result;if(!r.objectStoreNames.contains(`keys`)){t(),r.close();return}let i=r.transaction(`keys`,`readwrite`),a=i.objectStore(`keys`);e.forEach(e=>{a.put(e)}),i.oncomplete=()=>{t(),r.close()},i.onerror=()=>{t(),r.close()}},n.onerror=()=>{t()}}catch{t()}})}async function je(e){let t=j(e);return t?t.jwk:(H[e]||!Ae&&(U||=W().then(e=>{e.forEach(e=>{H[e.kid]=e}),Ae=!0}),await U,H[e])||await Me(),H[e])}function Me(){return ke||=(async function(){try{let e=ae(),t=await fetch(e).catch(()=>null),n=null;if(t&&t.ok&&(t.headers.get(`content-type`)||``).indexOf(`application/json`)!==-1)try{n=await t.json()}catch{}if(n&&Array.isArray(n.keys)){for(let e=0;e<n.keys.length;e++){let t=n.keys[e];H[t.kid]=t}await G(n.keys)}}catch(e){console.warn(`[OimPlayer::Security] Failed to fetch public keys from server:`,e)}})(),ke}async function K(e){return await Me(),H[e]||null}async function Ne(e,t){if(!e||typeof e!=`object`)return!1;if(!e.signature||!e.key_version)return console.warn(`[OimPlayer::Security] Metadata is not signed. Skipping signature verification (Legacy mode).`),!0;try{let t=await je(e.key_version);if(!t)return console.error(`[OimPlayer::Security] Public key not found for version:`,e.key_version),!1;if(R(e))return!1;let r=_e(e),i=atob(e.signature),a=new Uint8Array(i.length);for(let e=0;e<i.length;e++)a[e]=i.charCodeAt(e);let o=async(e,t)=>{let n=await crypto.subtle.importKey(`jwk`,e,{name:`ECDSA`,namedCurve:`P-256`},!0,[`verify`]);return crypto.subtle.verify({name:`ECDSA`,hash:{name:`SHA-256`}},n,a,t)},s=await o(t,r);if(!s&&e.creator_user_id){let r={},i=Object.keys(e).filter(function(e){return e!==`signature`&&e!==`key_version`&&e!==`timestamp`}).sort();function n(e){if(Array.isArray(e))return e.map(n);if(typeof e==`object`&&e){let t={},r=Object.keys(e).sort();for(let i=0;i<r.length;i++)t[r[i]]=n(e[r[i]]);return t}return e}for(let t=0;t<i.length;t++)r[i[t]]=n(e[i[t]]);s=await o(t,new TextEncoder().encode(JSON.stringify(r)))}if(!s)try{let n=await K(e.key_version);n&&(n.x!==t.x||n.y!==t.y)&&(console.warn(`[OimPlayer::Security] Pinned key failed; retrying with the key published by the server for kid:`,e.key_version),s=await o(n,r))}catch{}if(s){let n=M(e.key_version,t);if(!N({kid:e.key_version,jwk:t,not_after:n},e.signed_at))return console.error(`[OimPlayer::Security] Signature made after this key was retired.`),!1}return s||console.error(`[OimPlayer::Security] Cryptographic signature VERIFICATION FAILED. Metadata was tampered with!`),s}catch(e){return console.error(`[OimPlayer::Security] Error verifying signature:`,e),!1}}function Pe(e){if(!e.isSigned)return`unsigned`;if(!e.isSigValid)return`invalid_signature`;if(e.keyExpired)return`expired_key`;let t=e.metadata||{},n=t.image_hash_alg===`sha256-idat`&&typeof t.image_hash==`string`?t.image_hash:``;return n?!e.imageHash||n.toLowerCase()!==e.imageHash.toLowerCase()?`image_mismatch`:xe(be(e.metadata)):`image_unsealed`}async function Fe(e,t=Date.now()){let n=e&&e.key_version;return n?j(n)?F(n,null,t):F(n,await K(n),t):!1}function Ie(e){return e===`image_mismatch`||e===`invalid_signature`}var Le=`OIM_ALTERED`;function Re(e){let t=[];function n(e){t.push(e)}function r(e,t){return typeof e==`string`&&e.length<=(t||1e7)}function i(e){return typeof e==`number`&&isFinite(e)}if(typeof e!=`object`||!e)return n(`metadata must be object`),t;let a=e.slots||e.elements||[];if(!Array.isArray(a))return n(`slots must be array`),t;a.length>150&&n(`max 150 slots`);for(let e=0;e<a.length;e++){let t=a[e];if(typeof t!=`object`||!t){n(`slot[`+e+`] must be object`);continue}t.id!==void 0&&t.id!==null&&(typeof t.id!=`string`||t.id.length>128)&&n(`slot[`+e+`].id invalid`);let o=t.content;if(o!==void 0){if(typeof o!=`object`||!o)n(`slot[`+e+`].content must be object`);else{let t=Object.keys(o);for(let i=0;i<t.length;i++){let a=o[t[i]];if(typeof a==`string`)a.length>1e7&&n(`slot[`+e+`].content.`+t[i]+` too long`);else if(typeof a==`object`&&a&&!Array.isArray(a)){let o=Object.keys(a);for(let s=0;s<o.length;s++)r(a[o[s]])||n(`slot[`+e+`].content.`+t[i]+`.`+o[s]+` invalid`)}}}}t.style&&(typeof t.style==`object`?t.style.fillColor&&(typeof t.style.fillColor!=`string`||t.style.fillColor.length>64)&&n(`slot[`+e+`].style.fillColor invalid`):n(`slot[`+e+`].style must be object`)),t.position&&(!Array.isArray(t.position)||t.position.length<2||!i(t.position[0])||!i(t.position[1]))&&n(`slot[`+e+`].position invalid`)}return t}var q=[`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`],ze=new Set(q);function Be(e){return typeof e==`string`&&ze.has(e)}var Ve=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,He=/^(?:rgb|rgba|hsl|hsla)\(\s*[0-9a-zA-Z.,%/\s+-]*\)$/,Ue=new Set([`transparent`,`currentcolor`,`none`,`inherit`]),We=/^var\(\s*(--[A-Za-z0-9_-]+)\s*\)$/,Ge=/^var\(\s*(--[A-Za-z0-9_-]+)\s*,([\s\S]+)\)$/;function Ke(e,t=0){if(typeof e!=`string`)return!1;let n=e.trim();if(!n||n.length>128||t>4||/[;{}<>"]/.test(n)||n.includes(`\\`)||/url\(|expression\(|\/\*/i.test(n))return!1;if(Ve.test(n)||Ue.has(n.toLowerCase())||He.test(n)||We.test(n))return!0;let r=Ge.exec(n);return r?Ke(r[2],t+1):!1}function qe(e,t={}){let n=e.palettes??{},r=Object.hasOwn(n,`dark`)&&Object.hasOwn(n,`light`)&&t.prefersDark!==void 0?t.prefersDark?`dark`:`light`:void 0,i=[t.requested,r,e.defaultPalette].find(e=>typeof e==`string`&&Object.hasOwn(n,e));if(i===void 0)return null;let a={};for(let e of q){let t=n[i][e];Ke(t)&&(a[e]=String(t).trim())}return{name:i,colors:a}}function J(e,t){let n=t!=null&&t!==``?String(t).trim():void 0,r=n&&Ke(n)?n:void 0;if(Be(e)){let t=`var(--oim-palette-`+e+(r?`, `+r:``)+`)`;return`var(--oim-color-`+e+`, `+t+`)`}return r||``}var Je=Math.log(1.05)/100,Ye=.01,Xe=16,Ze=800;function Qe(e,t,n,r){let i=n===1?t*Xe:n===2?t*Ze:t,a=e*Math.exp(-i*(r?Ye:Je));return Math.max(1,Math.min(4,a))}var $e=`1.27.11`,et=[`vector_parallax`,`infinite_parallax`,`text_marks`,`image_fill`,`media_filters`,`frame_shapes`];function tt(e){if(typeof e!=`string`)return null;let t=/^(\d+)\.(\d+)\.(\d+)$/.exec(e.trim());return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}function nt(e,t){let n=tt(e),r=tt(t);if(!n||!r)return!1;for(let e=0;e<3;e++){if(n[e]>r[e])return!0;if(n[e]<r[e])return!1}return!1}function rt(e,t){let n=e&&typeof e.min_player==`string`?e.min_player:null,r=(Array.isArray(e?.capabilities)?e.capabilities:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),i=(Array.isArray(e?.capabilities_required)?e.capabilities_required:[]).filter(e=>typeof e==`string`&&e!==``).filter(e=>!t.capabilities.includes(e)).filter((e,t,n)=>n.indexOf(e)===t).sort(),a=nt(n,t.version),o=a||i.length>0,s=a||r.length>0||i.length>0;return{requiredVersion:n,versionTooOld:a,missingCapabilities:r,missingRequiredCapabilities:i,cannotRender:o,hasNotice:s,hayAlgoQueDecir:s}}function it(e){let t=[];return e.versionTooOld&&t.push(`the file requires format version ${e.requiredVersion}`),e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0&&t.push(`requires ${e.missingRequiredCapabilities.join(`, `)}`),e.missingCapabilities&&e.missingCapabilities.length>0&&t.push(`uses ${e.missingCapabilities.join(`, `)}`),t.length===0?``:`${e.missingRequiredCapabilities&&e.missingRequiredCapabilities.length>0?`It cannot be fully rendered`:`Rendered what was possible`}: ${t.join(` and `)}.`}var at=/^oim-[0-9a-f]{8}-[A-Za-z0-9 ]{1,64}$/,ot=546136,st={woff:`wOFF`,woff2:`wOF2`};function ct(e,t){try{return atob(e.slice(0,8)).startsWith(st[t])}catch{return!1}}function lt(e){let t=e&&Array.isArray(e.fonts)?e.fonts:[],n=[];for(let e of t)e&&typeof e==`object`&&(e.format!==`woff`&&e.format!==`woff2`||typeof e.family!=`string`||typeof e.data!=`string`||typeof e.name!=`string`||!at.test(e.name)||e.style!==`normal`&&e.style!==`italic`||typeof e.weight!=`number`||e.weight<100||e.weight>900||e.data.length>ot||!ct(e.data,e.format)||n.push({family:e.family,name:e.name,weight:e.weight,style:e.style,format:e.format,data:e.data}));return n}async function ut(e,t=document.fonts,n=(e,t,n)=>new FontFace(e,t,n)){let r=new Map;return await Promise.all(e.map(async e=>{try{let i=n(e.name,`url(data:font/${e.format};base64,${e.data})`,{weight:String(e.weight),style:e.style});await i.load(),t.add(i),r.set(e.family,e.name)}catch{}})),r}function dt(e,t){let n=t.get(e);return n?`'${n}', '${e}', sans-serif`:null}var ft=/^\{(\/?)([a-z][a-z0-9-]{0,23})\}/;function pt(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`{`||r===`}`){if(e[n+1]===r){t.push({kind:`text`,s:r}),n+=2;continue}if(r===`{`){let r=ft.exec(e.slice(n));if(r){t.push({kind:r[1]?`close`:`open`,name:r[2],raw:r[0],at:n}),n+=r[0].length;continue}}t.push({kind:`stray`,raw:r,at:n}),n+=1;continue}let i=n;for(;i<e.length&&e[i]!==`{`&&e[i]!==`}`;)i++;t.push({kind:`text`,s:e.slice(n,i)}),n=i}return t}function mt(e,t){let n=[],r=[],i,a=null,o=(e,t)=>{i||={reason:e,at:t}},s=e=>{if(!e)return;let t=n[n.length-1];t&&t.mark===(a??void 0)?t.text+=e:n.push(a?{text:e,mark:a}:{text:e})};for(let n of pt(e))n.kind===`text`?s(n.s):n.kind===`stray`?(o(`stray brace`,n.at),s(n.raw)):t.includes(n.name)?n.kind===`open`?a?(o(`"${n.name}" inside "${a}"`,n.at),s(n.raw)):(a=n.name,r.push(n.name)):a===n.name?a=null:(o(`"${n.name}" closed without being open`,n.at),s(n.raw)):(o(`unknown mark "${n.name}"`,n.at),s(n.raw));return a&&o(`"${a}" is not closed`,e.length),{runs:n,sequence:r,error:i}}function ht(e,t){return mt(e,t).runs}function gt(e){return e.replace(/[{}]/g,e=>e+e)}function _t(e,t){return ht(e,t).map(e=>e.text).join(``)}function vt(e,t){let n=``,r=[];for(let i of ht(e,t))i.mark&&r.push({from:n.length,to:n.length+i.text.length,mark:i.mark}),n+=i.text;return{plain:n,ranges:r}}function yt(e,t){let n=``,r=0;for(let i of[...t].sort((e,t)=>e.from-t.from)){let t=Math.max(i.from,r),a=Math.min(i.to,e.length);a<=t||(n+=gt(e.slice(r,t))+`{${i.mark}}`+gt(e.slice(t,a))+`{/${i.mark}}`,r=a)}return n+gt(e.slice(r))}function bt(e){let t={underline:e.underline===!0},n=J(e.colorRole,e.color);if(n&&(t.color=n),e.bold&&(t.fontWeight=700),e.italic&&(t.fontStyle=`italic`),e.highlight){let n=e.highlight;t.highlight={style:n.style??`marker`,color:J(n.colorRole,n.color)||`rgba(245, 158, 11, 0.35)`,paddingX:n.paddingX??4,paddingY:n.paddingY??2,borderRadius:n.borderRadius??3}}return t}function xt(e,t){return _t(e,Object.keys(t??{}))}function St(e,t,n){e.textContent=``;for(let r of ht(t,Object.keys(n??{}))){let t=r.mark?n?.[r.mark]:void 0;if(!r.mark||!t){e.appendChild(document.createTextNode(r.text));continue}let i=document.createElement(`span`);i.dataset.mark=r.mark,i.textContent=r.text;let a=bt(t),o=i.style;a.color&&(o.color=a.color),a.fontWeight&&(o.fontWeight=String(a.fontWeight)),a.fontStyle&&(o.fontStyle=a.fontStyle),a.underline&&(o.textDecoration=`underline`);let s=a.highlight;s&&(s.style===`underline-thick`?o.boxShadow=`inset 0 -.4em 0 ${s.color}`:o.backgroundColor=s.color,o.borderRadius=s.style===`pill`?`9999px`:s.style===`box`?`0`:`${s.borderRadius}px`,o.padding=`${s.paddingY}px ${s.paddingX}px`,o.boxDecorationBreak=`clone`,o.webkitBoxDecorationBreak=`clone`),e.appendChild(i)}}function Ct(e){let t={scale:e.lines===3?3.2:2.2,lineHeight:.85,marginRight:e.marginRight??8,fontWeight:700};return e.color&&(t.color=e.color),e.fontFamily&&(t.fontFamily=e.fontFamily),t}function wt(e,t){let{plain:n,ranges:r}=vt(e,t);if(!n)return{letter:``,rest:``};let i=r.map(e=>({...e,from:Math.max(0,e.from-1),to:e.to-1}));return{letter:n[0],rest:yt(n.slice(1),i)}}var Tt=/^(data:image\/|blob:|https:\/\/)[^"'\\\n\r()]*$/;function Et(e){if(e.svg&&/<svg[\s>]/i.test(e.svg))return{image:`url("data:image/svg+xml;charset=utf-8,${encodeURIComponent(e.svg)}")`,size:`100% 100%`};if(e.type===`image`&&e.image&&Tt.test(e.image)){let t=e.fit===`contain`?`contain`:e.fit===`fill`?`100% 100%`:`cover`;return{image:`url("${e.image}")`,size:t}}return null}var Dt=[`fade-chars`,`slide-up`,`bounce-chars`,`reveal-mask`,`scale-in`,`rise-words`],Ot=.35,kt=.05,At=[`slide-up`,`reveal-mask`,`rise-words`];function jt(e){return typeof e==`string`&&Dt.includes(e)}function Mt(e){return e===`reveal-mask`}function Nt(e,t){return At.includes(t)?e.match(/\S+|\s+/g)??[]:Array.from(e)}function Pt(e,t=kt,n=0){return n+e*t}function Ft(e,t){let n=Math.max(0,Math.min(1,t)),r=n*(2-n);if(e===`slide-up`)return{opacity:r,translateYEm:(1-r)*.6,scale:1,rotateDeg:0};if(e===`reveal-mask`)return{opacity:1,translateYEm:(1-r)*1.2,scale:1,rotateDeg:0};if(e===`scale-in`)return{opacity:r,translateYEm:0,scale:.6+.4*r,rotateDeg:0};if(e===`rise-words`)return{opacity:r,translateYEm:(1-r)*.8,scale:1,rotateDeg:(1-r)*8};if(e===`bounce-chars`){let e=r===0?0:r<.7?r/.7*1.15:1.15-(r-.7)/.3*.15;return{opacity:r,translateYEm:0,scale:Math.round(e*1e6)/1e6,rotateDeg:0}}return{opacity:r,translateYEm:0,scale:1,rotateDeg:0}}function It(e,t=10){return Array.from({length:t+1},(n,r)=>Ft(e,r/t))}var Lt=r({createExternalLottieLoader:()=>Bt,createExternalScriptLoader:()=>zt,default:()=>Ut,vendorUrl:()=>Rt});function Rt(e,t){let n=`vendor/lottie_light-${t}.js`;if(e)try{return new URL(n,e).href}catch{}return Vt+n}function zt(e){let t=null;return function(){let n=e.read();if(n)return Promise.resolve(n);if(t)return t;let r=e.doc??document,i=Vt+e.file;if(e.scriptUrl)try{i=new URL(e.file,e.scriptUrl).href}catch{}return t=new Promise((t,n)=>{let a=r.createElement(`script`);a.src=i,a.async=!0,a.setAttribute(e.marker,``),a.onload=()=>{let r=e.read();r?t(r):n(Error(`Script loaded from ${i} but did not define what was expected`))},a.onerror=()=>{a.remove(),n(Error(`Could not load ${i}`))},(r.head||r.documentElement).appendChild(a)}),t.catch(()=>{t=null}),t}}function Bt(e){return zt({scriptUrl:e.scriptUrl,file:`vendor/lottie_light-${e.version}.js`,marker:`data-oim-lottie`,doc:e.doc,read:()=>{let e=globalThis.lottie;return e&&typeof e.loadAnimation==`function`?e:void 0}})}var Vt,Ht,Ut,Wt=n((()=>{Vt=`https://cdn.oim.media/player/v1/`,Ht=Bt({scriptUrl:i,version:`5.13.0`}),Ut={__oimExternal:!0,load:Ht}}));function Gt(){return Promise.resolve().then(()=>(Wt(),Lt)).then(e=>{let t=e.default||e;return t&&t.__oimExternal?t.load():t})}a(),Wt();var Kt=`__oimUpgrade`,qt=()=>globalThis[Kt],Jt=zt({scriptUrl:i,file:`vendor/oim-upgrade-32b17a6f18bc.js`,marker:`data-oim-upgrade`,read:()=>qt()}),Yt=e=>{let t=qt();if(!t)throw Error(`[OimPlayer] upgrade called before ensureUpgrade()`);return t(e)};function Xt(){return qt()?Promise.resolve():Jt().then(()=>void 0)}var Zt={triangle:{kind:`polygon`,points:[[50,5],[95,90],[5,90]]},star:{kind:`polygon`,points:[[50,2],[62,38],[100,38],[69,59],[80,95],[50,73],[20,95],[31,59],[0,38],[38,38]]},arrow:{kind:`polygon`,points:[[5,40],[60,40],[60,20],[95,50],[60,80],[60,60],[5,60]]},diamond:{kind:`polygon`,points:[[50,5],[95,50],[50,95],[5,50]]},hexagon:{kind:`polygon`,points:[[25,5],[75,5],[95,50],[75,95],[25,95],[5,50]]},circle:{kind:`path`,d:`M 50,5 A 45,45 0 1,1 49.999,5 Z`,fillable:!0},heart:{kind:`path`,d:`M 50,88 C 10,60 -5,30 15,12 C 30,-2 50,5 50,25 C 50,5 70,-2 85,12 C 105,30 90,60 50,88 Z`,fillable:!0},line:{kind:`path`,d:`M 5,50 L 95,50`,fillable:!1},blob:{kind:`path`,d:`M 50,10 C 75,10 92,25 90,50 C 88,75 75,90 50,90 C 25,90 10,75 10,50 C 10,25 25,10 50,10 Z`,fillable:!0},scribble:{kind:`path`,d:`M 5,80 Q 25,65 50,75 T 95,70 Q 75,85 50,82 T 5,88`,fillable:!1},pill:{kind:`path`,d:`M 30,25 L 70,25 C 83.8,25 95,36.2 95,50 C 95,63.8 83.8,75 70,75 L 30,75 C 16.2,75 5,63.8 5,50 C 5,36.2 16.2,25 30,25 Z`,fillable:!0},octagon:{kind:`polygon`,points:[[30,5],[70,5],[95,30],[95,70],[70,95],[30,95],[5,70],[5,30]]},pentagon:{kind:`polygon`,points:[[50,5],[94.7,37.5],[77.6,90],[22.4,90],[5.3,37.5]]},cross:{kind:`polygon`,points:[[35,5],[65,5],[65,35],[95,35],[95,65],[65,65],[65,95],[35,95],[35,65],[5,65],[5,35],[35,35]]},moon:{kind:`path`,d:`M 50,5 C 25.15,5 5,25.15 5,50 C 5,74.85 25.15,95 50,95 C 30,80 30,20 50,5 Z`,fillable:!0},cloud:{kind:`path`,d:`M 25,85 C 8,85 5,62 22,58 C 14,40 35,32 45,42 C 48,22 75,20 78,42 C 96,40 97,66 80,68 C 80,78 78,85 68,85 Z`,fillable:!0},drop:{kind:`path`,d:`M 50,5 C 62,25 80,45 80,65 C 80,81.5 66.5,95 50,95 C 33.5,95 20,81.5 20,65 C 20,45 38,25 50,5 Z`,fillable:!0},bolt:{kind:`polygon`,points:[[62,5],[18,58],[46,58],[34,95],[82,40],[55,40],[72,5]]},bubble:{kind:`path`,d:`M 20,5 L 80,5 C 88.3,5 95,11.7 95,20 L 95,57 C 95,65.3 88.3,72 80,72 L 42,72 L 22,93 L 28,72 L 20,72 C 11.7,72 5,65.3 5,57 L 5,20 C 5,11.7 11.7,5 20,5 Z`,fillable:!0},flower:{kind:`path`,d:`M 65.6,41.0 C 85.5,35.7 97.5,39.9 95.0,50.0 C 97.5,60.1 85.5,64.3 65.6,59.0 C 80.1,73.5 82.5,86.1 72.5,89.0 C 65.0,96.2 55.3,87.9 50.0,68.0 C 44.7,87.9 35.0,96.2 27.5,89.0 C 17.5,86.1 19.9,73.5 34.4,59.0 C 14.5,64.3 2.5,60.1 5.0,50.0 C 2.5,39.9 14.5,35.7 34.4,41.0 C 19.9,26.5 17.5,13.9 27.5,11.0 C 35.0,3.8 44.7,12.1 50.0,32.0 C 55.3,12.1 65.0,3.8 72.5,11.0 C 82.5,13.9 80.1,26.5 65.6,41.0 Z`,fillable:!0},burst:{kind:`polygon`,points:[[95,50],[82.8,58.8],[89,72.5],[74,74],[72.5,89],[58.8,82.8],[50,95],[41.2,82.8],[27.5,89],[26,74],[11,72.5],[17.2,58.8],[5,50],[17.2,41.2],[11,27.5],[26,26],[27.5,11],[41.2,17.2],[50,5],[58.8,17.2],[72.5,11],[74,26],[89,27.5],[82.8,41.2]]},arch:{kind:`path`,d:`M 5,95 L 5,50 C 5,25.15 25.15,5 50,5 C 74.85,5 95,25.15 95,50 L 95,95 Z`,fillable:!0}};[...Object.keys(Zt).filter(e=>e!==`line`&&e!==`scribble`)];function Qt(e){if(e&&e!==`rect`&&e!==`rectangle`)return Zt[e]}function $t(e){return e.map(([e,t])=>`${e},${t}`).join(` `)}var en=/^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\s+-]*$/,tn=/^-?\d+(\.\d+)?([\s,]+-?\d+(\.\d+)?){3}$/,nn=`0 0 100 100`,rn=e=>e&&e.length<=2e4&&en.test(e)?e:void 0,an=e=>e&&e.length<=64&&tn.test(e)?e:nn;function on(e){let t=Qt(e.geoShape),n=rn(e.svgPath);return t?t.kind===`polygon`?{points:t.points.map(([e,t])=>`${e},${t}`).join(` `),viewBox:nn}:{d:(e.geoShape===`blob`||e.geoShape===`scribble`)&&rn(e.customBlobPath)||e.geoShape===`blob`&&n||t.d,viewBox:nn}:n?{d:n,viewBox:an(e.svgViewBox)}:null}var sn={silhouette:null,fillable:!0,round:!1};function cn(e){if(!e||e.kind===`rect`)return sn;if(e.kind===`line`||e.kind===`preset`||e.kind===`ellipse`){let t=e.kind===`line`?`line`:e.kind===`ellipse`?`circle`:e.name,n=Qt(t);return n?{silhouette:on({geoShape:t}),fillable:n.kind===`polygon`||!!n.fillable,round:e.kind===`ellipse`,preset:t}:sn}if(e.kind===`paths`&&e.paths.length===1&&!e.paths[0].fill&&!e.paths[0].stroke){let t=e.viewBox.join(` `),n=on({svgPath:e.paths[0].d,svgViewBox:t});return n?{silhouette:n,fillable:!0,round:!1,path:{d:n.d,viewBox:n.viewBox}}:sn}return sn}function Y(e,t){if(!e||typeof e!=`object`)return;let n=(t||``).toLowerCase();if(e[n]!==void 0)return e[n];let r=Object.keys(e);for(let t=0;t<r.length;t++)if(r[t].toLowerCase()===n)return e[r[t]]}function ln(e,t){let n=e||{};if(n[`*`]!==void 0){let e=Y(n,t);return typeof e==`string`?e:String(n[`*`]??``)}function r(e){if(n[e]!==void 0&&n[e]!==``)return n[e];let t=e.toLowerCase(),r=e.toUpperCase();if(n[r]!==void 0&&n[r]!==``)return n[r];if(n[t]!==void 0&&n[t]!==``)return n[t];let i=Object.keys(n);for(let e=0;e<i.length;e++)if(i[e].toLowerCase()===t&&n[i[e]]!==``)return n[i[e]]}let i=r(t)||r(`en`)||r(`es`)||r(`default`)||``;if(!i){let e=Object.keys(n);e.length>0&&(i=n[e[0]]||``)}return i}function un(e,t){return e&&e.type===`image`?!0:t.indexOf(`data:image/`)===0}function dn(e){return!!e&&(e.is_background_pattern===!0||e.id===`background-pattern-slot`)}var fn=/^[\d.+-]+(cqw|cqh|cqi|cqb|rem|em|ex|ch|vw|vh|vmin|vmax|%|px|pt|pc|cm|mm|in|lh|rlh)$/i;function pn(e,t){let n=t==null?`16px`:t.toString(),r=(e==null?``:e.toString()).trim();if(!r||r===`undefined`||r===`null`)return n;if(fn.test(r))return r;let i=parseFloat(r);return isNaN(i)?n:i+`px`}function mn(e,t){let n=e&&e.style||{},r=ln(e&&e.content,t),i=un(e,r);return{content:r,size:pn(Y(n.fontSizes,t)||n.fontSize,n.fontSize||`16px`),maxWidthValue:dn(e)?`none`:Y(n.maxWidths,t)||(i||(e?.type??`text`)!==`text`?n.maxWidth||`none`:n.maxWidth||`80%`)}}function hn(e,t,n){let r=mn(e,t),i=mn(e,n);return r.content===i.content?r.size!==i.size||r.maxWidthValue!==i.maxWidthValue?`style-only`:`none`:`content`}var gn=new WeakMap;function _n(e){let t=gn.get(e);if(t)return t;t=new Map;let n=e=>{for(let r of e)t.set(r.id,r),n(r.children??[])};try{n(Yt(e).document.layers)}catch(e){console.warn(`[OimPlayer] 2.0 view unavailable:`,e)}return gn.set(e,t),t}function vn(e){let t=e=>!!e&&typeof e==`object`&&typeof e.var==`string`;return{css:e=>(t(e)?J(e.var,e.fallback):typeof e==`string`?J(null,e):``)||void 0,literal:n=>(t(n)?qe(e)?.colors?.[n.var]??J(null,n.fallback):typeof n==`string`?J(null,n):``)||void 0}}function yn(e){let t=e.anchor??`top-left`;return[/left/.test(t)?`0%`:/right/.test(t)?`-100%`:`-50%`,/^top/.test(t)?`0%`:/^bottom/.test(t)?`-100%`:`-50%`]}function bn(e,t){if(typeof e==`number`)return e;if(e&&typeof e==`object`&&`value`in e){let{value:n,modes:r}=e,i=r?.[t];return typeof i==`number`?i:typeof n==`number`?n:void 0}}function xn(e,t){let n=e?.text;if(!n)return;let r={},i=bn(n.font?.size,t);i!==void 0&&(r.fontSize=`${+i.toFixed(4)}px`);let a=bn(n.maxWidth,t);return a!==void 0&&(r.maxWidth=`${+a.toFixed(4)}px`),n.font?.family&&(r.fontFamily=n.font.family),n.font?.weight!==void 0&&(r.fontWeight=String(n.font.weight)),n.font?.italic&&(r.fontStyle=`italic`),n.letterSpacing!==void 0&&(r.letterSpacing=`${n.letterSpacing}px`),n.transform&&(r.textTransform=n.transform),n.decoration&&(r.textDecoration=n.decoration),r}function Sn(e){let t=e??{},n=e=>typeof e==`number`?+(e*100).toFixed(6):void 0;return{filterPreset:t.preset,filterBlur:t.blur,filterBrightness:n(t.brightness),filterContrast:n(t.contrast),filterSaturate:n(t.saturate),filterHueRotate:t.hueRotate}}function Cn(e){let t=e.mask??{},n=e.geometry,r=n?.kind===`preset`?n.name:n?.kind===`paths`?`custom`:{rect:`rectangle`,ellipse:`circle`,line:`line`}[n?.kind??``],i=e=>typeof e==`string`?{role:void 0,literal:e}:e&&typeof e==`object`?{role:e.var,literal:e.fallback}:{role:void 0,literal:void 0},a=e.fills?.[0],o=i(a?.kind===`color`?a.value:void 0),s=e.strokes?.[0],c=i(s?.paint?.kind===`color`?s.paint.value:void 0);return{maskMode:t.mode===`cutout`?`cutout`:`window`,maskFeather:t.feather,maskCoverage:t.scope===`group`?`container`:`canvas`,maskShape:r,maskSvgPath:n?.kind===`paths`?n.paths?.map(e=>e.d).join(` `):void 0,geoShape:void 0,svgPath:void 0,maskBgColor:o.literal,maskBgColorRole:o.role,fillColorRole:void 0,maskStrokeColor:c.literal,maskStrokeColorRole:c.role,strokeColorRole:void 0,maskStrokeWidth:s?.width,cuts:e.extensions?.studio?.maskCuts}}function wn(e,t){let n=typeof e==`string`?e:Y(e.modes??{},t)??e.value;return n===`oim:base`?``:n}var Tn=e=>e&&!/[;{}<>"]|url\(|expression\(/i.test(e)?e:void 0;function En(e,t,n=!1){let r=`http://www.w3.org/2000/svg`,i=document.createElementNS(r,`svg`);i.setAttribute(`viewBox`,e.viewBox.join(` `)),i.setAttribute(`width`,n?String(e.viewBox[2]):`100%`),i.setAttribute(`height`,n?String(e.viewBox[3]):`100%`),n?i.setAttribute(`xmlns`,r):(i.setAttribute(`preserveAspectRatio`,`xMidYMid meet`),i.style.setProperty(`display`,`block`));for(let a of e.paths){let e=document.createElementNS(r,`path`);e.setAttribute(`d`,a.d);let o=Tn(a.fill===`currentColor`?t.fill??`currentColor`:a.fill),s=Tn(a.stroke===`currentColor`?t.stroke??`currentColor`:a.stroke);n?(e.setAttribute(`fill`,o??`none`),s&&e.setAttribute(`stroke`,s)):(e.setAttribute(`fill`,`none`),o&&e.style.setProperty(`fill`,o),s&&e.style.setProperty(`stroke`,s)),a.strokeWidth!==void 0&&e.setAttribute(`stroke-width`,String(a.strokeWidth)),a.fillRule&&e.setAttribute(`fill-rule`,a.fillRule),a.cap&&e.setAttribute(`stroke-linecap`,a.cap),a.join&&e.setAttribute(`stroke-linejoin`,a.join),a.opacity!==void 0&&e.setAttribute(`opacity`,String(a.opacity)),a.transform&&e.setAttribute(`transform`,`matrix(${a.transform.join(` `)})`),i.appendChild(e)}return i.outerHTML}function Dn(e,t){let n=e=>e&&typeof e==`object`&&e.kind===`color`?t(e.value):void 0,r=n(e.fills?.[0]),i=n(e.strokes?.[0]?.paint);return{fill:r??i,stroke:i??r}}var On=[{id:`stacked-waves`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`wave`,boundary:`shared`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Frecuencia`,en:`Frequency`},min:2,max:12,step:1,default:4},{key:`amplitude`,kind:`range`,group:`SHAPE`,label:{es:`Amplitud`,en:`Amplitude`},min:0,max:1,step:.05,default:.5},{key:`balance`,kind:`range`,group:`SHAPE`,label:{es:`Balance`,en:`Balance`},min:0,max:1,step:.05,default:.5},{key:`anchor`,kind:`enum`,group:`DIRECTION`,label:{es:`Anclaje`,en:`Anchor`},options:[{value:`bottom`,label:{es:`Abajo`,en:`Bottom`}},{value:`top`,label:{es:`Arriba`,en:`Top`}},{value:`left`,label:{es:`Izquierda`,en:`Left`}},{value:`right`,label:{es:`Derecha`,en:`Right`}}],default:`bottom`}]},{id:`layered-waves`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`wave`,boundary:`independent`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Frecuencia`,en:`Frequency`},min:2,max:12,step:1,default:4},{key:`amplitude`,kind:`range`,group:`SHAPE`,label:{es:`Amplitud`,en:`Amplitude`},min:0,max:1,step:.05,default:.5},{key:`anchor`,kind:`enum`,group:`DIRECTION`,label:{es:`Anclaje`,en:`Anchor`},options:[{value:`bottom`,label:{es:`Abajo`,en:`Bottom`}},{value:`top`,label:{es:`Arriba`,en:`Top`}}],default:`bottom`}]},{id:`stacked-peaks`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`peak`,boundary:`shared`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Picos`,en:`Peaks`},min:2,max:12,step:1,default:4},{key:`amplitude`,kind:`range`,group:`SHAPE`,label:{es:`Altura`,en:`Height`},min:0,max:1,step:.05,default:.6}]},{id:`layered-peaks`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`peak`,boundary:`independent`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Picos`,en:`Peaks`},min:2,max:12,step:1,default:4}]},{id:`stacked-steps`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`step`,boundary:`shared`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5},{key:`frequency`,kind:`range`,group:`SHAPE`,label:{es:`Escalones`,en:`Steps`},min:2,max:12,step:1,default:5}]},{id:`layered-steps`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`step`,boundary:`independent`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Capas`,en:`Layers`},min:1,max:12,step:1,default:5}]},{id:`zigzag-chevron`,layers:[{primitive:`layer-stack`,fixed:{interpolation:`zigzag`,boundary:`independent`}}],schema:[{key:`layers`,kind:`range`,group:`SHAPE`,label:{es:`Franjas`,en:`Bands`},min:1,max:12,step:1,default:6}]},{id:`circle-scatter`,layers:[{primitive:`scatter`,fixed:{element:`circle`}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Círculos`,en:`Circles`},min:1,max:40,step:1,default:3},{key:`sizeMin`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Mín`,en:`Min Size`},min:10,max:100,step:5,default:60},{key:`sizeMax`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Máx`,en:`Max Size`},min:60,max:300,step:10,default:180},{key:`minDistance`,kind:`range`,group:`SHAPE`,label:{es:`Distancia Mín`,en:`Min Distance`},min:0,max:100,step:5,default:40}]},{id:`rose-petals`,layers:[{primitive:`scatter`,fixed:{element:`petal`}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Pétalos`,en:`Petals`},min:1,max:40,step:1,default:12},{key:`sizeMin`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Mín`,en:`Min Size`},min:10,max:100,step:5,default:30}]},{id:`blob-scene`,layers:[{primitive:`blob`,fixed:{}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Blobs`,en:`Blobs`},min:1,max:6,step:1,default:2},{key:`points`,kind:`range`,group:`SHAPE`,label:{es:`Complejidad`,en:`Complexity`},min:5,max:14,step:1,default:8},{key:`irregularity`,kind:`range`,group:`SHAPE`,label:{es:`Deformación`,en:`Irregularity`},min:0,max:1,step:.05,default:.5},{key:`anchor`,kind:`enum`,group:`DIRECTION`,label:{es:`Anclaje`,en:`Anchor`},options:[{value:`center`,label:{es:`Centro`,en:`Center`}},{value:`corner-tl`,label:{es:`Esquina Sup-Izq`,en:`Top-Left`}},{value:`corner-tr`,label:{es:`Esquina Sup-Der`,en:`Top-Right`}},{value:`corner-bl`,label:{es:`Esquina Inf-Izq`,en:`Bottom-Left`}},{value:`corner-br`,label:{es:`Esquina Inf-Der`,en:`Bottom-Right`}}],default:`corner-tr`}]},{id:`low-poly-grid`,layers:[{primitive:`mesh`,fixed:{}}],schema:[{key:`resolution`,kind:`range`,group:`SHAPE`,label:{es:`Resolución`,en:`Resolution`},min:3,max:20,step:1,default:8},{key:`distortion`,kind:`range`,group:`SHAPE`,label:{es:`Distorsión`,en:`Distortion`},min:0,max:1,step:.05,default:.6},{key:`borderWidth`,kind:`range`,group:`SHAPE`,label:{es:`Borde`,en:`Border`},min:0,max:4,step:.5,default:.5}]},{id:`bullseye-gradient`,layers:[{primitive:`radial`,fixed:{kind:`rings`}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Anillos`,en:`Rings`},min:3,max:48,step:1,default:16}]},{id:`wintery-sunburst`,layers:[{primitive:`radial`,fixed:{kind:`rays`}}],schema:[{key:`count`,kind:`range`,group:`SHAPE`,label:{es:`Rayos`,en:`Rays`},min:3,max:48,step:1,default:16}]},{id:`radiant-gradient`,layers:[{primitive:`gradient`,fixed:{kind:`radial`}}],schema:[{key:`softness`,kind:`range`,group:`SHAPE`,label:{es:`Suavidad`,en:`Softness`},min:0,max:1,step:.05,default:.8}]},{id:`blurry-gradient`,layers:[{primitive:`gradient`,fixed:{kind:`linear`}}],schema:[{key:`angle`,kind:`range`,group:`SHAPE`,label:{es:`Ángulo`,en:`Angle`},min:0,max:360,step:15,default:135}]},{id:`protruding-cubes`,layers:[{primitive:`iso-grid`,fixed:{hollow:!1}}],schema:[{key:`cols`,kind:`range`,group:`SHAPE`,label:{es:`Columnas`,en:`Columns`},min:4,max:20,step:1,default:8},{key:`extrude`,kind:`range`,group:`SHAPE`,label:{es:`Extrusión`,en:`Extrusion`},min:0,max:1,step:.05,default:.6}]},{id:`hollowed-boxes`,layers:[{primitive:`iso-grid`,fixed:{hollow:!0}}],schema:[{key:`cols`,kind:`range`,group:`SHAPE`,label:{es:`Columnas`,en:`Columns`},min:4,max:20,step:1,default:8}]},{id:`luz-difusa`,layers:[{primitive:`gradient`,fixed:{kind:`linear`}},{primitive:`radial`,fixed:{kind:`radial`},blend:`screen`,opacity:.8,blur:20}],grain:{intensity:.15},schema:[{key:`angle`,kind:`range`,group:`SHAPE`,label:{es:`Ángulo Base`,en:`Base Angle`},min:0,max:360,step:15,default:135},{key:`softness`,kind:`range`,group:`SHAPE`,label:{es:`Difusión`,en:`Diffusion`},min:.1,max:1,step:.05,default:.8}]},{id:`malla-suave`,layers:[{primitive:`mesh`,fixed:{borderWidth:0}},{primitive:`radial`,fixed:{kind:`radial`},blend:`soft-light`,opacity:.7}],schema:[{key:`resolution`,kind:`range`,group:`SHAPE`,label:{es:`Resolución Malla`,en:`Mesh Resolution`},min:3,max:12,step:1,default:6},{key:`distortion`,kind:`range`,group:`SHAPE`,label:{es:`Fluidez`,en:`Fluidity`},min:0,max:1,step:.05,default:.5},{key:`softness`,kind:`range`,group:`SHAPE`,label:{es:`Luz Radial`,en:`Radial Light`},min:.1,max:1,step:.05,default:.7}]},{id:`reticula`,layers:[{primitive:`gradient`,fixed:{kind:`linear`}},{primitive:`iso-grid`,fixed:{hollow:!0},blend:`screen`,opacity:.85}],grain:{intensity:.18},schema:[{key:`cols`,kind:`range`,group:`SHAPE`,label:{es:`Densidad Rejilla`,en:`Grid Density`},min:4,max:24,step:1,default:10},{key:`angle`,kind:`range`,group:`SHAPE`,label:{es:`Inclinación Luz`,en:`Light Angle`},min:0,max:360,step:15,default:120}]},{id:`polvo`,layers:[{primitive:`gradient`,fixed:{kind:`radial`}},{primitive:`scatter`,fixed:{element:`circle`},blend:`lighten`,opacity:.65}],grain:{intensity:.28},schema:[{key:`count`,kind:`range`,group:`VARIANTS`,label:{es:`Partículas`,en:`Particles`},min:10,max:80,step:5,default:35},{key:`sizeMin`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Mín`,en:`Min Size`},min:2,max:20,step:1,default:4},{key:`sizeMax`,kind:`range`,group:`SHAPE`,label:{es:`Tamaño Máx`,en:`Max Size`},min:10,max:50,step:2,default:20}]}];function kn(e){return On.find(t=>t.id===e)}var An=(e,t)=>{let n=e,r=Math.max(1,Math.min(12,Number(n.layers??5))),i=n.interpolation||`wave`,a=n.boundary||`shared`,o=Math.max(2,Math.min(12,Number(n.frequency??4))),s=Math.max(0,Math.min(1,Number(n.amplitude??.5))),c=Math.max(0,Math.min(1,Number(n.balance??.5))),l=n.anchor||`bottom`,u=t.width,d=t.height,f=t.bleed,p=l===`bottom`||l===`top`,m=p?d:u,h=p?u:d,g=m/(r+1),_=(c-.5)*h*.4,v=[];for(let e=0;e<r;e++){let n=(e+1)*g,r=[],i=h/o;for(let e=0;e<=o;e++){let a=e*i,c=(t.rng.next()-.5)*g*s*1.6,f=Math.max(10,Math.min(m-10,n+c));if(p){let t=a+(e>0&&e<o?_:0),n=l===`bottom`?d-f:f;r.push({x:t,y:n})}else{let t=a+(e>0&&e<o?_:0),n=l===`right`?u-f:f;r.push({x:n,y:t})}}v.push(r)}let y=``,b=a===`independent`?Array.from({length:r},(e,t)=>r-1-t):Array.from({length:r},(e,t)=>t);for(let e of b){let n=t.ramp(e,r),o=v[e],s=``;if(i===`step`){s=`M ${o[0].x} ${o[0].y}`;for(let e=0;e<o.length-1;e++){let t=o[e],n=o[e+1];s+=p?` L ${n.x} ${t.y} L ${n.x} ${n.y}`:` L ${t.x} ${n.y} L ${n.x} ${n.y}`}}else if(i===`peak`){s=`M ${o[0].x} ${o[0].y}`;for(let e=1;e<o.length;e++)s+=` L ${o[e].x} ${o[e].y}`}else if(i===`zigzag`||i===`chevron`){s=`M ${o[0].x} ${o[0].y}`;for(let t=0;t<o.length-1;t++){let n=o[t],r=o[t+1],i=(n.x+r.x)/2+(p?0:e%2==0?30:-30),a=(n.y+r.y)/2+(p?e%2==0?30:-30:0);s+=` L ${i} ${a} L ${r.x} ${r.y}`}}else{s=`M ${o[0].x} ${o[0].y}`;for(let e=0;e<o.length-1;e++){let t=o[e],n=o[e+1],r=t.x+(n.x-t.x)*.5,i=t.y,a=t.x+(n.x-t.x)*.5,c=n.y;s+=` C ${r} ${i}, ${a} ${c}, ${n.x} ${n.y}`}}if(a===`shared`&&e>0){let t=v[e-1],n=l===`bottom`?f:l===`top`?-f:0,r=l===`right`?f:l===`left`?-f:0;for(let e=t.length-1;e>=0;e--)s+=` L ${t[e].x+r} ${t[e].y+n}`}else s+=l===`bottom`?` L ${u} ${d+f} L 0 ${d+f}`:l===`top`?` L ${u} ${-f} L 0 ${-f}`:l===`right`?` L ${u+f} ${d} L ${u+f} 0`:` L ${-f} ${d} L ${-f} 0`;s+=` Z`,y+=`<path d="${s}" fill="${n}" stroke="${n}" stroke-width="0.5" stroke-linejoin="round" stroke-linecap="round" />`}return y},jn=(e,t)=>{let n=e,r=Math.max(1,Math.min(40,Number(n.count??3))),i=n.element||`circle`,a=Math.max(10,Number(n.sizeMin??60)),o=Math.max(a,Number(n.sizeMax??180)),s=Math.max(0,Number(n.minDistance??40)),c=n.distribution||`uniform`,l=t.width,u=t.height,d=[],f=r*50,p=0;for(;d.length<r&&p<f;){p++;let e=t.rng.next()*l,n=t.rng.next()*u;if(c===`center`){let r=l/2,i=u/2,a=t.rng.next()**.5,o=t.rng.next()*Math.PI*2;e=r+Math.cos(o)*(l*.35*a),n=i+Math.sin(o)*(u*.35*a)}else c===`edge`&&(t.rng.next()>.5?e=t.rng.next()>.5?t.rng.range(0,l*.25):t.rng.range(l*.75,l):n=t.rng.next()>.5?t.rng.range(0,u*.25):t.rng.range(u*.75,u));let r=t.rng.range(a,o),i=!0;for(let t of d)if(Math.hypot(e-t.x,n-t.y)<t.r+r+s){i=!1;break}i&&d.push({x:e,y:n,r})}let m=``;for(let e=0;e<d.length;e++){let n=d[e],r=t.ramp(e,Math.max(1,d.length));if(i===`petal`){let e=`M ${n.x} ${n.y} C ${n.x+n.r} ${n.y-n.r*1.5}, ${n.x+n.r*2} ${n.y}, ${n.x} ${n.y+n.r*2} Z`;m+=`<path d="${e}" fill="${r}" stroke="${r}" opacity="0.85" />`}else if(i===`blob`){let e=n.r*(.8+t.rng.next()*.4),i=n.r*(.8+t.rng.next()*.4),a=n.r*(.8+t.rng.next()*.4),o=n.r*(.8+t.rng.next()*.4),s=`M ${n.x} ${n.y-e} C ${n.x+i} ${n.y-e}, ${n.x+i} ${n.y+a}, ${n.x} ${n.y+a} C ${n.x-o} ${n.y+a}, ${n.x-o} ${n.y-e}, ${n.x} ${n.y-e} Z`;m+=`<path d="${s}" fill="${r}" opacity="0.85" />`}else m+=`<circle cx="${n.x}" cy="${n.y}" r="${n.r}" fill="${r}" opacity="0.85" />`}return m},Mn=(e,t)=>{let n=e,r=Math.max(1,Math.min(6,Number(n.count??1))),i=Math.max(5,Math.min(14,Number(n.points??8))),a=Math.max(0,Math.min(1,Number(n.irregularity??.5))),o=n.anchor||`center`,s=Math.max(100,Number(n.size??Math.min(t.width,t.height)*.45)),c=t.width,l=t.height,u=``;for(let e=0;e<r;e++){let n=t.ramp(e,r),d=s*(1-e*.15),f=c/2,p=l/2;o===`corner-tl`?(f=0,p=0):o===`corner-tr`?(f=c,p=0):o===`corner-bl`?(f=0,p=l):o===`corner-br`&&(f=c,p=l);let m=Math.PI*2/i,h=[];for(let e=0;e<i;e++){let n=e*m,r=(t.rng.next()-.5)*d*a,i=Math.max(20,d+r);h.push({x:Math.cos(n)*i,y:Math.sin(n)*i})}let g=`M ${h[0].x} ${h[0].y}`;for(let e=0;e<i;e++){let t=h[e],n=h[(e+1)%i],r=(t.x+n.x)/2,a=(t.y+n.y)/2;g+=` Q ${t.x} ${t.y}, ${r} ${a}`}g+=` Z`,u+=`
49
49
  <g transform="translate(${f}, ${p})">
50
50
  <path d="${g}" fill="${n}" opacity="${.9-e*.1}" />
51
51
  </g>
@@ -110,4 +110,4 @@ var OimPlayer=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Sym
110
110
  </g>
111
111
  </svg>`}function fa(e,t,n,r){e.textContent=``;let i=Array.from(t);for(let t=0;t<i.length;t++){let a=i[t];if(a===`
112
112
  `){e.appendChild(document.createElement(`br`));continue}let o=document.createElement(`span`);o.textContent=a===` `?`\xA0`:a,o.style.display=`inline-block`,o.style.animationName=Kr,o.style.animationDuration=Gr+`s`,o.style.animationTimingFunction=`linear`,o.style.animationIterationCount=`infinite`,o.style.animationDelay=Jr(t,n,r)+`s`,e.appendChild(o)}}function pa(e,t,n,r,i){e.textContent=``,Nt(t,n).forEach((t,a)=>{if(/^\s+$/.test(t)){e.appendChild(document.createTextNode(t));return}let o=document.createElement(`span`);o.textContent=t,o.className=`oim-entrance`;let s=o.style;if(s.display=`inline-block`,s.animation=`oim-entrance-${n} ${Ot}s linear ${Pt(a,r,i)}s both`,!Mt(n)){e.appendChild(o);return}let c=document.createElement(`span`);c.className=`oim-entrance-clip`,c.style.display=`inline-block`,c.style.overflow=`hidden`,c.style.verticalAlign=`top`,c.appendChild(o),e.appendChild(c)})}function ma(e,t){if(!e)return;let n=`oim-entrance-`+t;if(e.getElementById(n))return;let r=It(t),i=r.some(e=>e.rotateDeg!==0),a=r.map((e,t)=>`${t*100/(r.length-1)}%{opacity:${e.opacity};transform:translateY(${e.translateYEm}em) scale(${e.scale})${i?` rotate(${e.rotateDeg}deg)`:``}}`).join(``),o=document.createElement(`style`);o.id=n,o.textContent=`@keyframes ${n}{${a}}@media (prefers-reduced-motion: reduce){.oim-entrance{animation:none!important}}`,e.appendChild(o)}function ha(e){if(!e)return;let t=`oim-wave-keyframes`;if(e.getElementById(t))return;let n=document.createElement(`style`);n.id=t,n.textContent=qr(),e.appendChild(n)}function ga(e,t,n){let r=0,i=performance.now(),a=null,o=()=>r+(a===null?0:performance.now()-i),s=()=>t(o()/1e3),c=()=>{a===null&&(i=performance.now(),a=setInterval(s,e))},l=()=>{a!==null&&(r=o(),clearInterval(a),a=null)};return c(),{pause:l,play:c,stop:()=>{l(),n?.()}}}function _a(e,t,n=20,r=0,i=!0){let a=a=>{let o=ai(t,a,n,r,i,!1);e.textContent=o.visibleText+(o.showCursor?`|`:``)};return a(0),ga(40,a)}function va(e,t,n,r=1,i=0,a=50){e.textContent=``,e.style.display=`inline-block`,e.style.position=`relative`;let o=()=>{let e=document.createElement(`span`);return e.textContent=t,e},s=$r(n,Qr(0)).copies.map(e=>{let t=o();t.setAttribute(`aria-hidden`,`true`);let n=t.style;return n.position=`absolute`,n.left=`0`,n.top=`0`,n.width=`100%`,n.height=`100%`,n.pointerEvents=`none`,n.opacity=`0`,e.color&&(n.color=e.color),t}),c=o();c.style.position=`relative`,n===`glitch-slice`?e.append(c,...s):e.append(...s,c);let l=t=>{let o=$r(n,Qr(t,r,i,a));e.style.transform=o.skewX?`skewX(${o.skewX}deg)`:`none`,o.copies.forEach((e,t)=>{let n=s[t].style;n.opacity=String(e.opacity),n.transform=`translate(${e.dx}px, ${e.dy}px)`,e.clip&&(n.clipPath=`inset(${e.clip.top}% 0 ${100-e.clip.bottom}% 0)`)})};return ga(33,l,()=>l(0))}function ya(e,t){if(!t?.enabled)return;let n=t.color||`rgba(245,158,11,.35)`,r=t.style===`underline-thick`,i=e.style;i.backgroundColor=r?`transparent`:n,r&&(i.boxShadow=`inset 0 -.4em 0 ${n}`),i.borderRadius=t.style===`pill`?`9999px`:t.style===`box`?`0`:`${t.borderRadius??3}px`,i.padding=`${t.paddingY??2}px ${t.paddingX??4}px`,i.boxDecorationBreak=i.webkitBoxDecorationBreak=`clone`}function ba(e,t,n,r){if(!n?.enabled||!t)return!1;let{letter:i,rest:a}=wt(t,Object.keys(r??{}));if(!i)return!1;let o=document.createElement(`span`),s=o.style,c=Ct(n);return o.textContent=i,s.float=`left`,s.fontSize=`${c.scale}em`,s.lineHeight=String(c.lineHeight),s.marginRight=`${c.marginRight}px`,c.fontFamily&&(s.fontFamily=c.fontFamily),c.color&&(s.color=c.color),s.fontWeight=String(c.fontWeight),s.userSelect=`none`,St(e,a,r),e.prepend(o),!0}function xa(e){if(e.length<2)return 0;let t=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+n*n)}function Sa(e,t){let n=(e||``).replace(`#`,``),r=parseInt(n.substring(t*2,t*2+2),16)||0;return Math.round(r/255*1e3)/1e3}function Ca(e,t){let n=`http://www.w3.org/2000/svg`,r=e.style||{},i=t.width,a=t.height,o=Array.isArray(e.position)?e.position:[0,0],s=typeof e.x==`number`?e.x:Number(o[0])/100*i,c=typeof e.y==`number`?e.y:Number(o[1])/100*a,l=document.createElementNS(n,`svg`);l.setAttribute(`viewBox`,`0 0 `+i+` `+a),l.setAttribute(`preserveAspectRatio`,`none`),l.style.position=`absolute`,l.style.left=-s+`px`,l.style.top=-c+`px`,l.style.width=i+`px`,l.style.height=a+`px`,l.style.flex=`none`,l.style.overflow=`visible`,l.style.display=`block`,l.style.pointerEvents=`none`;let u=document.createElementNS(n,`path`);u.setAttribute(`d`,Pr(e,t)),u.setAttribute(`fill`,J(r.maskBgColorRole||r.fillColorRole,r.maskBgColor||`#38BDF8`)),u.setAttribute(`fill-rule`,`evenodd`),l.appendChild(u);let d=r.maskStrokeWidth??0;if(d>0){let i=document.createElementNS(n,`path`);i.setAttribute(`d`,Fr(e,t)),i.setAttribute(`fill`,`none`),i.setAttribute(`stroke`,J(r.maskStrokeColorRole||r.strokeColorRole,r.maskStrokeColor||`#FFFFFF`)),i.setAttribute(`stroke-width`,String(d)),i.setAttribute(`stroke-linejoin`,`round`),l.appendChild(i)}return l}function wa(e,t){let n=`http://www.w3.org/2000/svg`,r=document.createElementNS(n,`svg`);r.setAttribute(`width`,`0`),r.setAttribute(`height`,`0`),r.setAttribute(`style`,`position:absolute`),r.setAttribute(`aria-hidden`,`true`);let i=document.createElementNS(n,`defs`);return r.appendChild(i),e.forEach(function(e){let r=e.style||{};if(e.type===`mask`&&r.maskMode===`cutout`){let a=r.maskFeather,o=Br(e,t);if(a&&a>0){let r=Rr(e)+`-blur`,s=document.createElementNS(n,`filter`);s.setAttribute(`id`,r),s.setAttribute(`filterUnits`,`userSpaceOnUse`),s.setAttribute(`x`,`0`),s.setAttribute(`y`,`0`),s.setAttribute(`width`,String(t.width)),s.setAttribute(`height`,String(t.height));let c=document.createElementNS(n,`feGaussianBlur`);c.setAttribute(`stdDeviation`,String(a)),s.appendChild(c),i.appendChild(s);let l=document.createElementNS(n,`mask`);l.setAttribute(`id`,Rr(e)),l.setAttribute(`maskUnits`,`userSpaceOnUse`);let u=document.createElementNS(n,`rect`);u.setAttribute(`x`,`0`),u.setAttribute(`y`,`0`),u.setAttribute(`width`,String(t.width)),u.setAttribute(`height`,String(t.height)),u.setAttribute(`fill`,`black`),l.appendChild(u);let d=document.createElementNS(n,`g`);d.setAttribute(`filter`,`url(#`+r+`)`);let f=document.createElementNS(n,`path`);f.setAttribute(`d`,o),f.setAttribute(`fill`,`white`),f.setAttribute(`clip-rule`,`evenodd`),f.setAttribute(`fill-rule`,`evenodd`),d.appendChild(f),l.appendChild(d),i.appendChild(l)}else{let t=document.createElementNS(n,`clipPath`);t.setAttribute(`id`,Mr(e)),t.setAttribute(`clipPathUnits`,`userSpaceOnUse`);let r=document.createElementNS(n,`path`);r.setAttribute(`d`,o),r.setAttribute(`clip-rule`,`evenodd`),t.appendChild(r),i.appendChild(t)}}if(e.type===`filter`&&e.duotone){let t=document.createElementNS(n,`filter`);t.setAttribute(`id`,Lr(e));let r=document.createElementNS(n,`feColorMatrix`);r.setAttribute(`type`,`matrix`),r.setAttribute(`values`,`0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0.33 0.33 0.33 0 0 0 0 0 1 0`),t.appendChild(r);let a=document.createElementNS(n,`feComponentTransfer`);[`R`,`G`,`B`].forEach(function(e,t){let r=document.createElementNS(n,`feFunc`+e);r.setAttribute(`type`,`table`);let i=t;r.setAttribute(`tableValues`,Sa(Ir.shadows,i)+` `+Sa(Ir.lights,i)),a.appendChild(r)}),t.appendChild(a),i.appendChild(t)}}),r}function Ta(e,t,n){let r=n.get(e.shape.id);r&&(e.clipPath&&(r.style.clipPath=e.clipPath),e.maskStyle&&(r.style.mask=e.maskStyle),t.appendChild(r))}var Ea=1200,Da=class{updateScale(){}updateViewportSize(){}host;metadata=null;securityStatus=`unsigned`;embeddedFontFamilies=new Map;imageUrl=null;lang;showControls;activeSlotId=null;zoom=1;panX=0;panY=0;_stage=null;_viewport=null;_baseImg=null;_overlay=null;_lottieInstances=[];_onDragMove=null;_onDragEnd=null;_animations=[];_textAnimations=[];_paused=!1;_revealAnims=new Map;_timelines=new Map;_warnedPlay=new Set;_heldTimelines=new Set;_isStill(){let e=this.host;if(!this.disableAnimations||!e||typeof e.getAttribute!=`function`)return!1;let t=e.getAttribute(`disable-animations`);return t!==null&&t!==`false`||e.getAttribute(`mode`)===`image`}_resizeObserver=null;_onFullscreenChange=null;_retryViewportSize=!1;allowZoom;showLanguageSelector;showSlots;allowLottie;allowDynamicColors=!0;disableAnimations;disableActions;dropdownBlur;fit;align;_deviceProfile;applyPalette(){let e=this._viewport;if(!e)return;let t=typeof matchMedia==`function`&&matchMedia(`(prefers-color-scheme: dark)`).matches,n=this.allowDynamicColors?qe(this.metadata??{},{requested:this.host.getAttribute(`palette`),prefersDark:t}):null;for(let t of q){let r=n?.colors[t];r?e.style.setProperty(`--oim-palette-`+t,r):e.style.removeProperty(`--oim-palette-`+t)}}async renderSlots(e){if(!this.metadata||!this.host)return;let t=(this.metadata.slots||this.metadata.elements||[]).some(function(e){return e.type===`mask`||e.type===`filter`}),n=e&&e.onlyIds&&e.onlyIds.size>0&&!t?e.onlyIds:null;if(this._viewport&&!this._revealed&&this._viewport.classList.remove(`oim-viewport--ready`),!this.showSlots){this._overlay&&(this._overlay.innerHTML=``),this._viewport&&this._viewport.classList.add(`oim-viewport--ready`);return}n?this._destroyLottiesIn(n):this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]);let r=this._overlay;if(!r)return;let i=this._viewport?this._viewport.querySelector(`.oim-noise-overlay`):null,a=Array.isArray(this.metadata?.effects)?this.metadata.effects.find(e=>e&&e.type===`texture`&&e.enabled!==!1):null;if(a){let e=Di[a.preset];if(e){let t=i||document.createElement(`div`);t.className=`oim-noise-overlay`,t.style.position=`absolute`,t.style.inset=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.pointerEvents=`none`,t.style.mixBlendMode=a.blend||e.defaultBlend||`overlay`;let n=(a.intensity===void 0?e.defaultIntensity:a.intensity)/100;t.style.opacity=n.toFixed(2),t.style.zIndex=`999`;let r=a.scale||1,o=e.tileWidth*r,s=e.tileHeight*r;t.style.backgroundImage=`url("${e.getDataUri(a.color)}")`,t.style.backgroundRepeat=`repeat`,t.style.backgroundSize=`${o}px ${s}px`,!i&&this._viewport&&this._viewport.appendChild(t)}}else if(this.metadata&&this.metadata.grain&&this.metadata.grain.enabled){let e=this.metadata.grain,t=e.intensity??15,n=e.blendMode??`overlay`,r=e.baseFrequency??.8,a=i||document.createElement(`div`);a.className=`oim-noise-overlay`,a.style.position=`absolute`,a.style.inset=`0`,a.style.width=`100%`,a.style.height=`100%`,a.style.pointerEvents=`none`,a.style.mixBlendMode=n,a.style.opacity=(t/100).toFixed(2),a.style.zIndex=`999`;let o=`oim-global-noise-filter`,s=pi(o,{intensity:t,baseFrequency:r,color:e.color}),c=`data:image/svg+xml;utf8,`+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%"><defs>${s}</defs><rect width="100%" height="100%" filter="url(#${o})"/></svg>`);a.style.backgroundImage=`url("${c}")`,!i&&this._viewport&&this._viewport.appendChild(a)}else i&&i.remove();let o=this,s=this.metadata.slots||this.metadata.elements||[];try{await Xt()}catch(e){console.warn(`[OimPlayer] Could not load upgrade:`,e)}let l=_n(o.metadata);s.forEach(function(e){let t=e&&e.type===`mask`?l.get(String(e.id)):void 0;if(t){e.style={...e.style,...Cn(t)};let{x:n,y:r,width:i,height:a}=t.box;Object.assign(e,{x:n,y:r,width:i??0,height:a??0})}});let u=[],d=o.metadata&&(o.metadata.artboardWidth||o.metadata.canvasWidth||o.metadata.canvas_width)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_width||o.metadata.canvas.width:0)||(o._baseImg&&o._baseImg.naturalWidth>0?o._baseImg.naturalWidth:1080),f=o.metadata&&(o.metadata.artboardHeight||o.metadata.canvasHeight||o.metadata.canvas_height)||(o.metadata&&o.metadata.canvas?o.metadata.canvas.natural_height||o.metadata.canvas.height:0)||(o._baseImg&&o._baseImg.naturalHeight>0?Math.round(d*(o._baseImg.naturalHeight/o._baseImg.naturalWidth)):1920);r.style.setProperty(`--oim-overlay-w`,d+`px`),r.style.setProperty(`--oim-overlay-h`,f+`px`);let p=document.createDocumentFragment(),m={},h=new Map,g=_n(o.metadata);(this.metadata.zones||[]).forEach(e=>{let t=g.get(String(e?.id));if(!t||t.type!==`group`)return;let n=document.createElement(`div`);n.className=`oim-zone`,n.id=`oim-zone-`+t.id,n.style.position=`absolute`,n.style.inset=`0`;let r=t.children?.find(e=>e.id===t.id+`__background`),i=r?.fills?.[0],a=t.effects?.find(e=>e.kind===`backdrop`)?.blur;if(r||a){let e=t.box,s=document.createElement(`div`);s.className=`oim-zone-box`,s.style.position=`absolute`,s.style.left=e.x+`px`,s.style.top=e.y+`px`,s.style.width=(e.width??0)+`px`,s.style.height=(e.height??0)+`px`,i&&`kind`in i&&i.kind===`color`&&(s.style.background=vn(o.metadata).css(i.value)||``),typeof r?.corners==`number`&&(s.style.borderRadius=r.corners+`px`),a&&(s.style.backdropFilter=`blur(`+a+`px)`,s.style.webkitBackdropFilter=s.style.backdropFilter),n.appendChild(s)}p.appendChild(n),m[t.id]=n;for(let e of t.children??[])h.set(e.id,t.id)});let _=qi(s),v=_n(o.metadata),y=vn(o.metadata),b=e=>e&&typeof e==`object`&&typeof e.fallback==`string`?y.literal(e.fallback):y.literal(e),x=s.map(async e=>{let t=e.type,r=v.get(String(e.id));if(n&&!n.has(String(e.id)))return null;let i=e.style||{};if(e.tracking_data,t===`mask`&&i.maskMode===`cutout`){let t=h.get(String(e.id));return t&&m[t]&&console.warn(`[OimPlayer] Slot "`+e.id+`" is a mask layer inside zone "`+t+`". Mask layers are only supported in the top-level slot stack, so this one will neither render nor clip anything. Move it out of the zone.`),null}if(!r)return console.warn(`[OimPlayer] Slot "`+e.id+`" has no 2.0 layer; it is not painted.`),null;let a=r.box,s=mn(e,o.lang),l=r.type===`text`?r.text?.content:void 0,u=t===`image`?r.image:void 0,p=r.type===`shape`&&r.geometry?.kind===`paths`&&!cn(r.geometry).path?r.geometry:void 0,g=l?ln(l,o.lang):u?wn(u.src,o.lang):p&&!dn(e)?En(p,Dn(r,y.css)):r.type===`lottie`?r.lottie?.src??``:s.content,x=!o.disableActions&&(!!r.interactions?.length||!!r.animations?.some(e=>e.on===`hover`||e.on===`press`)),S=t===`mask`&&i.maskMode!==`cutout`,C=t===`artistic-text`,w=t===`geo`||t===`shape`||t===`draw`||t===`filter`||t===`container`||S||x||C,T=e.is_background_pattern===!0||e.id===`background-pattern-slot`;if(!(t===`group`&&_.has(String(e.id)))&&!(t===`pattern`||T)&&!g&&!(w&&(r.fills?.length||a.width!==void 0||t===`filter`||t===`container`||S||x||C)))return null;let E=un(e,g),D=g,O=!1;E||(/&lt;svg|&lt;span|&lt;div|&lt;a|&lt;img/i.test(D)&&(D=D.replace(/&lt;/g,`<`).replace(/&gt;/g,`>`).replace(/&amp;/g,`&`).replace(/&quot;/g,`"`).replace(/&#39;/g,`'`)),O=!!p&&!dn(e));let ee=!E&&(O||/<svg|<span|<div|<a|<img/i.test(D));D=D.replace(/\\n/g,`
113
- `);let k=r.type===`text`?r.text?.align??`left`:`left`,te=`center`;k===`left`?te=`flex-start`:k===`right`&&(te=`flex-end`);let A=document.createElement(`div`);A.className=`oim-slot`,A.setAttribute(`part`,`slot`),A.setAttribute(`data-slot-id`,e.id),r.languages&&!r.languages.includes(o.lang)&&(A.style.display=`none`),A.style.zIndex=T?`0`:`1`;let ne=r.animations?.find(e=>e.on===`enter`&&e.preset);A._oimReveal=ne?{effect:ne.preset,duration:ne.duration,easing:ne.easing}:void 0;let re=!!r.interactions?.length;x||re&&!o.disableActions||A.setAttribute(`data-oim-passthrough`,``);let ie=r.fills?.[0],j=ie?.kind===`pattern`?ie.pattern:void 0,ae=j?xr(j,y):{};if(T){A.style.pointerEvents=`none`;let e=p?En(p,Dn(r,y.literal),!0):``;if(e||j){if(oi(A,ae,e),(j?.fit===`cover`?`cover`:`tile`)==`cover`)A.style.backgroundSize=`cover`,A.style.backgroundRepeat=`no-repeat`,A.style.backgroundPosition=`center`,A.style.setProperty(`--oim-pat-size`,`cover`),A.style.setProperty(`--oim-pat-repeat`,`no-repeat`),A.style.setProperty(`--oim-pat-pos`,`center`);else{let e=160*(j?.scale||1)/d*100;A.style.backgroundSize=e.toFixed(4)+`cqw `+e.toFixed(4)+`cqw`,A.style.backgroundRepeat=`repeat`,A.style.setProperty(`--oim-bg-tile`,e.toFixed(4)+`cqw`)}let t=j?.motion,n=t?`background-animation-${t.direction} ${t.period||8}s linear infinite`:void 0;!o.disableAnimations&&typeof n==`string`&&n.indexOf(`background-animation-`)===0&&(A.style.animation=n),D=``,O=!1}}if(t===`pattern`){let e=cn(r.type===`shape`?r.geometry:void 0),t=vr({...ae,geoShape:e.round?`circle`:e.preset});for(let[e,n]of Object.entries(t))e.startsWith(`--`)?A.style.setProperty(e,n):A.style[e]=n;(ae.fillPatternColorRole||ae.fillPatternBgColorRole)&&oi(A,ae,``)}let M=document.createElement(`div`);M.className=`oim-slot-loop-wrap`;let N=document.createElement(`div`);N.className=`oim-slot-hover-wrap`,(O||E||t===`lottie`||C)&&(M.style.height=`100%`,N.style.height=`100%`);let P=null,F=t===`text`?r.fills?.[0]:void 0;if(F){let e=Er(F,{colors:y,isText:!0,width:r.box.width||d,height:r.box.height||f});P=Object.keys(e).length>0?e:null}let oe=P!==null&&(P.backgroundClip===`text`||P.webkitBackgroundClip===`text`),se=r.box.width!==void 0&&r.box.height!==void 0,ce=oe&&se;if(E){let t=D.trim();if(t.startsWith(`<`)){let e=t.match(/src=["']([^"']+)["']/);e&&e[1]&&(t=e[1])}let n=we(t),i=document.createElement(`img`);n?i.src=t:(console.warn(`[OimPlayer] Image not embedded in the file (network URLs are not loaded), slot:`,e.id),i.src=``),i.alt=``,i.draggable=!1,i.style.width=`100%`,i.style.height=`100%`;let a=u?.fit,o=u?.crop;if(i.style.objectFit=a||`cover`,o){let e=Bi(o);i.style.objectFit=e.objectFit,i.style.objectPosition=e.objectPosition,i.style.transform=e.transform,i.style.transformOrigin=e.transformOrigin,N.style.overflow=`hidden`}i.style.display=`block`,i.style.pointerEvents=`none`,i.style.filter=e.type===`image`?Ar(Sn(r.image?.filters))??``:``,M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,i.onerror=function(t){console.error(`[OimPlayer] Image slot failed to load for slot:`,e.id,`error:`,t),i.style.display=`none`},N.appendChild(i)}else if(t===`lottie`){let t=document.createElement(`div`);t.className=`oim-lottie-container`,t.style.width=`100%`,t.style.height=`100%`,N.appendChild(t),o.allowLottie?Gt().then(function(n){let r=typeof D==`string`&&(D.startsWith(`http`)||D.endsWith(`.json`)||D.trim().indexOf(`{`)!==0);if(r){console.warn(`[OimPlayer] Lottie animation must be a valid JSON string. External URLs are not supported.`);return}let i=n.loadAnimation({container:t,renderer:`svg`,loop:!o.disableAnimations,autoplay:!o.disableAnimations&&!o._paused,path:r?D.trim():void 0,animationData:r?void 0:JSON.parse(D)});o.disableAnimations&&i.goToAndStop(0,!0),o._lottieInstances.push({slotId:String(e.id),inst:i})}).catch(function(e){console.error(`[OIM Player] Error loading local Lottie bundle. Hiding dynamic element:`,e),A.style.display=`none`}):(console.warn(`[OIM Player] Lottie animation slot ${e.id} detected but allowLottie option is false. Hiding dynamic element.`),A.style.display=`none`)}else if(C){M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,N.style.display=`flex`,N.style.alignItems=`center`,N.style.justifyContent=`center`,N.style.pointerEvents=`none`;let t=ua(r,o.lang,b),n=dt(t.fontFamily,o.embeddedFontFamilies);n&&(t.fontFamily=n.replace(/, sans-serif$/,``));let i=da(t,String(e.id));if(typeof DOMParser<`u`){let e=new DOMParser().parseFromString(i,`image/svg+xml`).documentElement;e&&N.appendChild(e)}else N.innerHTML=i}else if(ee){let e=N;if(ce){let t=document.createElement(`div`);t.className=`oim-slot-text`,N.appendChild(t),e=t}let t=Ce(D);if(typeof DOMParser<`u`){let n=new DOMParser().parseFromString(t,`text/html`);for(;n.body.firstChild;)e.appendChild(n.body.firstChild)}else{let n=document.createElement(`div`);for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild)}}else{let e=N;if(ce){let t=document.createElement(`div`);t.className=`oim-slot-text`,N.appendChild(t),e=t}let n=r.animations?.find(e=>e.on===`load`&&e.preset),i=n?.params??{},a={type:n?.preset,speed:i.speed,delay:n?.delay?+(n.delay/1e3).toFixed(6):void 0,cursor:i.cursor,intensity:i.intensity},s=a.type,c=(t===`text`?r.text:void 0)??{};ya(e,c.highlight);let l=c.marks,u=xt(D,l);s===`wave-chars`&&!o.disableAnimations?(ha(o.host.shadowRoot),fa(e,u,typeof a.speed==`number`?a.speed:.05,typeof a.delay==`number`?a.delay:0)):jt(s)&&!o.disableAnimations?(ma(o.host.shadowRoot,s),pa(e,u,s,a.speed,a.delay)):s===`typewriter`&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,_a(e,u,a.speed,a.delay,a.cursor)):s?.startsWith(`glitch-`)&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,va(e,u,s,a.speed,a.delay,a.intensity)):ba(e,D,c.dropCap,l)||St(e,D,l)}M.appendChild(N);let le=r.motion?.loop,I=le?{enabled:!0,speedPxSec:le.speedPxSec,direction:le.direction,mirror:le.mirror??!0,pauseOnHover:!!le.pauseOnHover}:void 0,ue=!1;if(I&&I.enabled){let e=I.infinite||{},t=e.enabled===!1||o._isStill()?0:I.speedPxSec===void 0?e.speedPxSec===void 0?e.speed_px_sec===void 0?I.mode===`infinite_horizontal`?I.speed===void 0?20:I.speed:0:e.speed_px_sec:e.speedPxSec:I.speedPxSec,n=I.direction||e.direction||`right_to_left`,i=I.mirror===void 0?I.seamlessTile===void 0?e.mirror===void 0?e.seamlessTile===void 0?e.seamless_tile===void 0||!!e.seamless_tile:!!e.seamlessTile:!!e.mirror:!!I.seamlessTile:!!I.mirror,a=I.pauseOnHover===void 0?e.pauseOnHover===void 0?!!e.pause_on_hover:!!e.pauseOnHover:!!I.pauseOnHover,s=Mi({speedPxSec:Number(t)||0,direction:n,mirror:i,pauseOnHover:a},r.box.width||d||d,d);if(s.duplicate){ue=!0,Ni(o.host.shadowRoot);let e=document.createElement(`div`);e.className=`${Oi} ${ki}`;for(let[t,n]of Object.entries(s.container))e.style.setProperty(t,n);for(let t=0;t<s.copies;t++){let n=t===0?M:M.cloneNode(!0);for(let[e,t]of Object.entries(s.copy))n.style.setProperty(e,t);if(t%2==1)for(let[e,t]of Object.entries(s.secondCopy))n.style.setProperty(e,t);e.appendChild(n)}A.appendChild(e)}}ue||A.appendChild(M);let L=r.geometry?.trim,de=r.animations?.find(e=>e.on===`load`&&e.tracks?.some(e=>e.property===`trimEnd`)),fe=e=>+(e*100).toFixed(6),pe=L||de?{strokeWidth:1,trimStart:fe(L?.start??0),trimEnd:fe(L?.end??1),trimDuration:de?+(de.duration/1e3).toFixed(6):0}:void 0;ee&&pe&&(pe.trimDuration&&ui(o.host.shadowRoot),di(N,pe));let R=xn(r,o.lang),me={lineHeight:r.text?.lineHeight},he=R?.fontSize??`16px`,ge=R?.fontFamily,_e=T?`none`:R?.maxWidth??(r.type===`text`&&!E?`80%`:`none`),ve=C||!E&&!O&&t!==`lottie`&&D.trim()!==``;if(ge&&ve){let e=Oe(ge),t=dt(e,o.embeddedFontFamilies);A.style.setProperty(`font-family`,t||e)}if(te=ue||k===`left`?`flex-start`:k===`right`?`flex-end`:`center`,A.style.maxWidth=_e,A.style.fontSize=he,A.style.lineHeight=String(Zi(me)),R)for(let e of[`fontWeight`,`fontStyle`,`letterSpacing`,`textTransform`,`textDecoration`])R[e]&&(A.style[e]=R[e]);if(t===`text`&&F){let e=`kind`in F&&F.kind===`color`?y.css(F.value):``;e&&A.style.setProperty(`color`,e)}if(P){if(ce){M.style.position=`absolute`,M.style.top=`0`,M.style.left=`0`,M.style.right=`0`,M.style.bottom=`0`,M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,N.style.boxSizing=`border-box`,N.style.setProperty(`padding-right`,`0.25em`,`important`),N.style.display=`flex`,N.style.flexDirection=`column`,N.style.justifyContent=`center`,N.style.alignItems=te,Object.assign(N.style,P);let e=$i(Zi(me));e>0&&(A.style.setProperty(`padding-top`,e+`em`,`important`),A.style.setProperty(`padding-bottom`,e+`em`,`important`))}else if(Object.assign(A.style,P),oe){let e=$i(Zi(me));e>0&&(A.style.setProperty(`padding-top`,e+`em`,`important`),A.style.setProperty(`padding-bottom`,e+`em`,`important`))}}A.style.textAlign=k,A.style.display=`flex`,A.style.flexDirection=`column`,A.style.justifyContent=`center`,A.style.alignItems=te,A.style.opacity=`0`,A.style.transition=`opacity 0.3s ease`,A.style.whiteSpace=`pre-line`,A.style.overflow=ea({isText:t===`text`,isParallaxGroup:!!r.motion?.loop||!!_.get(e.id)?.some(e=>v.get(String(e))?.motion?.loop),hasFilterOrShadow:!1,hasKeyframes:!!r.animations?.some(Oa)});let ye=o.metadata?.canvas_width||o.metadata?.canvasWidth||(o.metadata?.canvas?o.metadata.canvas.natural_width:800);x&&ta(A),a.width!==void 0&&a.height!==void 0?(A.style.width=(a.width/ye*100).toFixed(4)+`cqw`,A.style.height=(a.height/ye*100).toFixed(4)+`cqw`):(A.style.width=`max-content`,A.style.height=`auto`);let z=r.fills?.[0],B=z&&`kind`in z?z.kind:void 0,V=cn(r.type===`shape`?r.geometry:void 0),be=(t===`svg`||O)&&!S&&(B===`pattern`||B===`generative`),xe=w&&!S&&B===`image`?String(z.src||``).trim():``,Se=!!xe&&we(xe),Te=be||(t===`geo`||t===`shape`)&&!S&&(Se||B===`gradient`||B===`generative`||B===`pattern`&&!T),Ee=r.fills?.[1],De=B===`image`&&Ee?.kind===`color`?y.css(Ee.value):void 0,H=B===`color`?y.css(z.value):Se?void 0:De;H&&w&&!S&&t!==`text`&&!C&&!Te&&A.style.setProperty(`background-color`,H);let ke=t===`svg`||O||r.geometry?.kind===`paths`||w&&!!V.silhouette,Ae=v.get(String(e.id)),U=Ae?.strokes?.find(e=>!e.align&&`kind`in e.paint&&e.paint.kind===`color`&&typeof e.width==`number`),W=Ae?.type===`text`?{color:``,width:0,style:void 0}:U?{color:y.css(U.paint.value)||``,width:U.width,style:U.style}:{color:``,width:0,style:void 0};W.color&&W.width&&!S&&!ke&&A.style.setProperty(`border`,`${W.width}px ${W.style||`solid`} ${W.color}`),xe&&!Se&&console.warn(`[OimPlayer] Fill image not embedded in the file (network URLs are not loaded), slot:`,e.id);let G=w&&!S?V.silhouette:null;if(G){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`viewBox`,G.viewBox),t.setAttribute(`preserveAspectRatio`,`none`),t.style.position=`absolute`,t.style.left=`0`,t.style.top=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.display=`block`,t.style.overflow=`visible`;let n=document.createElementNS(e,G.points?`polygon`:`path`);G.points?n.setAttribute(`points`,G.points):n.setAttribute(`d`,G.d);let r=V.fillable,i=r&&Se;n.setAttribute(`fill`,r&&H&&!Te&&!i?H:`none`);let a=U?W.width:0,o=U?W.color:``;a&&o&&(n.setAttribute(`stroke`,o),n.setAttribute(`stroke-width`,String(a)),n.setAttribute(`vector-effect`,`non-scaling-stroke`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`stroke-linecap`,`round`),W.style===`dashed`?n.setAttribute(`stroke-dasharray`,`6,4`):W.style===`dotted`&&n.setAttribute(`stroke-dasharray`,`2,3`)),t.appendChild(n),A.appendChild(t),i&&Wi(A,z,{d:G.d??`M `+G.points.split(` `).join(` L `)+` Z`,viewBox:G.viewBox},xe,De),A.style.backgroundColor=`transparent`,A.style.padding=`0`,A.style.overflow=`visible`}else w&&!S&&V.round&&(A.style.borderRadius=`50%`);if(Se&&!G){let e=typeof r.corners==`number`?r.corners:0,t=r.box.width||d,n=r.box.height||f;Wi(A,z,{d:``,viewBox:`0 0 1 1`,rect:{rx:Math.min(Math.max(e/t,0),.5),ry:Math.min(Math.max(e/n,0),.5)}},xe,De)}if(Te){let e=document.createElement(`div`);e.className=`oim-fill-layer`,e.style.position=`absolute`,e.style.left=`0`,e.style.top=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`none`,e.style.borderRadius=`inherit`;let t={...z?Er(z,{colors:y,width:r.box.width||d,height:r.box.height||f}):{},...be?_r(D):hr(V.round?`circle`:V.preset,V.path?{svgPath:V.path.d,svgViewBox:V.path.viewBox}:void 0)};be&&!M.style.position&&(M.style.position=`relative`);for(let[n,r]of Object.entries(t))n.startsWith(`--`)?e.style.setProperty(n,r):e.style[n]=r;A.insertBefore(e,A.firstChild)}S&&(A.style.overflow=`visible`,A.style.display=`block`,A.style.setProperty(`padding`,`0`,`important`),A.appendChild(Ca(e,{width:d,height:f}))),(!ve&&!S||ue)&&A.style.setProperty(`padding`,`0`,`important`);let je=h.get(String(e.id)),Me=null;{let e=a;A.style.position=`absolute`;let t,n=`-50%`;if(e.width!==void 0&&e.height!==void 0){t=ue||k===`left`?`0%`:k===`right`?`-100%`:`-50%`;let n=t===`0%`?0:t===`-100%`?1:.5;A.style.left=(e.x+e.width*n).toFixed(2)+`px`,A.style.top=(e.y+e.height/2).toFixed(2)+`px`}else[t,n]=yn(e),ue&&(t=`0%`),A.style.left=e.x.toFixed(2)+`px`,A.style.top=e.y.toFixed(2)+`px`;A.style.setProperty(`--oim-tx`,t),A.style.setProperty(`--oim-ty`,n),A.style.setProperty(`--oim-rot`,(e.rotation||0)+`deg`),Me={x:e.x,y:e.y,width:e.width??0,height:e.height??0}}let K=Gi(e)&&!T&&Me?Ji(Me,{width:d,height:f}):null;T&&(A.style.left=`0`,A.style.top=`0`,A.style.width=`100%`,A.style.height=`100%`,A.style.maxWidth=`none`,A.style.maxHeight=`none`,A.style.padding=`0`,A.style.boxSizing=`border-box`,A.style.setProperty(`--oim-tx`,`0%`),A.style.setProperty(`--oim-ty`,`0%`),A.style.setProperty(`--oim-rot`,`0deg`));let Ne=v.get(String(e.id))?.type===`text`?(()=>{let t=v.get(String(e.id))?.strokes?.[0];return t&&`kind`in t.paint&&t.paint.kind===`color`&&typeof t.width==`number`?{width:t.width,color:y.css(t.paint.value)||``}:void 0})():void 0;Ne&&(A.style.setProperty(`-webkit-text-stroke`,Ne.width+`px `+Ne.color),A.style.setProperty(`paint-order`,`stroke fill`));let Pe=e=>{let n=Di[e.preset];if(n){if(t===`text`||t===`artistic-text`){let t=e.scale||1,i=n.tileWidth*t,a=n.tileHeight*t,o=r.fills?.[0],s=o?.kind===`color`&&y.css(o.value)||`#18181b`,c=o?.kind===`gradient`?Er(o,{colors:y}).backgroundImage:void 0,l=e.blend||n.defaultBlend||`overlay`;c?(A.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), `+c,A.style.backgroundRepeat=`repeat, no-repeat`,A.style.backgroundSize=i+`px `+a+`px, 100% 100%`,A.style.backgroundBlendMode=l+`, normal`):(A.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), linear-gradient(`+s+`, `+s+`)`,A.style.backgroundRepeat=`repeat, no-repeat`,A.style.backgroundSize=i+`px `+a+`px, 100% 100%`,A.style.backgroundBlendMode=l),A.style.webkitBackgroundClip=`text`,A.style.backgroundClip=`text`,A.style.webkitTextFillColor=`transparent`,A.style.color=`transparent`;let u=$i(Zi(me));u>0&&(A.style.setProperty(`padding-top`,u+`em`,`important`),A.style.setProperty(`padding-bottom`,u+`em`,`important`))}else{let r=document.createElement(`div`);r.className=`oim-effect-texture`,r.style.position=`absolute`,r.style.inset=`0`,r.style.pointerEvents=`none`,r.style.borderRadius=`inherit`,r.style.mixBlendMode=e.blend||n.defaultBlend||`overlay`;let i=(e.intensity===void 0?n.defaultIntensity:e.intensity)/100;r.style.opacity=String(i);let a=e.scale||1,o=n.tileWidth*a,s=n.tileHeight*a;r.style.backgroundImage=`url("${n.getDataUri(e.color,e.intensity)}")`,r.style.backgroundRepeat=`repeat`,r.style.backgroundSize=`${o}px ${s}px`,r.style.zIndex=`1`;let c=Et({type:t,svg:O?D:void 0,image:E?D.trim():void 0,fit:u?.fit});if(c){let e=r.style;e.maskImage=e.webkitMaskImage=c.image,e.maskSize=e.webkitMaskSize=c.size,e.maskRepeat=e.webkitMaskRepeat=`no-repeat`,e.maskPosition=e.webkitMaskPosition=`center`}A.appendChild(r)}}},Fe=e=>{A.style.filter=(A.style.filter?A.style.filter+` `:``)+e},Ie=e=>{A.style.textShadow=A.style.textShadow?A.style.textShadow+`, `+e:e},Le=r.effects;for(let n of Le??[])if(n.kind===`blur`)Fe(`blur(`+n.radius+`px)`);else if(n.kind===`glow`){let e=y.css(n.color)||`#f59e0b`,r=n.radius;t===`text`?Ie(`0px 0px `+r*.4+`px `+e+`, 0px 0px `+r+`px `+e):Fe(`drop-shadow(0px 0px `+r*.4+`px `+e+`) drop-shadow(0px 0px `+r+`px `+e+`)`)}else if(n.kind===`shadow`){let e=n.color&&typeof n.color==`object`?n.color:void 0,r=n.opacity===void 0?y.css(n.color??`#000000`)||`#000000`:zi({shadowColor:e?e.fallback:n.color,shadowOpacity:n.opacity*100,shadowColorRole:e?.var}),i=(n.x||0)+`px `+(n.y||0)+`px `+(n.blur||0)+`px `+r;t===`text`?Ie(i):Fe(`drop-shadow(`+i+`)`)}else if(n.kind===`grain`){if(!hi.includes(t))continue;let r=`oim-grain-`+String(e.id).replace(/[^A-Za-z0-9_-]/g,`_`);o._defineLayerGrain(r,n),Fe(`url(#`+r+`)`)}else n.kind===`texture`&&Pe({...n,color:n.color===void 0?void 0:b(n.color)});let Re=r.opacity??1;if(A.dataset.oimOpacity=String(Re),A.style.setProperty(`--oim-target-opacity`,String(Re)),r.visible===!1&&(A.style.display=`none`,A.style.opacity=`0`,A.style.pointerEvents=`none`),t===`filter`){let t=r.effects?.find(e=>e.kind===`backdrop`),n=Ar(Sn(t)),i=t?.preset===`duotone`?`url(#`+Lr(e)+`)`:n;i&&(A.style.backdropFilter=i,A.style.webkitBackdropFilter=i)}if(t===`container`){let e=r.box.width||300,t=r.box.height||200,n=r.fills?.[0],i=n?Er(n,{colors:y,width:e,height:t}):{};Object.assign(A.style,i)}let q=r.corners;if(q!==void 0&&!V.round&&(A.style.borderRadius=(Array.isArray(q)?q:[q]).map(e=>e+`px`).join(` `)),K){A.style.left=K.left,A.style.top=K.top,A.style.width=K.width,A.style.height=K.height,A.style.maxWidth=`none`,A.style.maxHeight=`none`,A.style.setProperty(`padding`,`0`,`important`),A.style.transformOrigin=K.transformOrigin,A.style.pointerEvents=K.pointerEvents,A.style.setProperty(`--oim-tx`,`0%`),A.style.setProperty(`--oim-ty`,`0%`),A.style.setProperty(`--oim-scale`,`1`);let t=!!_.get(e.id)?.some(e=>v.get(String(e))?.motion?.loop);A.style.overflow=t?`hidden`:`visible`,c(M,`data-oim-group`,`data-oim-grupo`,String(e.id)),M.style.transformOrigin=K.transformOrigin,M.style.height=`100%`,M.style.overflow=`visible`}let ze=r.animations?.find(Oa),Be=r.animations?.find(e=>e.on===`loop`&&e.preset),Ve=r.animations?.find(e=>e.on===`hover`&&e.preset),He=e=>e?+(e/1e3).toFixed(6):0,Ue=ze||Be||Ve?{frames:ze?Ma(ze.tracks):void 0,duration:ze?He(ze.duration):0,trigger:ze?.on===`action`?`action`:void 0,loop:Be?.preset,loopDuration:He(Be?.duration),loopDelay:He(Be?.delay),hover:Ve?.preset}:void 0;if(Ue&&!o.disableAnimations){let t=Ue;if(t.frames&&typeof M.animate==`function`){let n=t.duration;{let r=t.frames,i=t.trigger===`action`,a=M.animate(r,{duration:n*1e3,iterations:i?1:1/0,easing:`linear`,...i?{fill:`both`}:{}});i?(a.pause(),a.currentTime=0):(o._paused&&a.pause(),o._animations.push(a)),o._timelines.set(String(e.id),a)}}t.loop&&t.loop!==`none`&&t.loop!==`custom`&&(M.classList.add(`oim-loop-`+t.loop),t.loopDuration&&M.style.setProperty(`--oim-loop-duration`,t.loopDuration+`s`),t.loopDelay&&M.style.setProperty(`--oim-loop-delay`,t.loopDelay+`s`)),t.hover&&t.hover!==`none`&&t.hover!==`custom`&&N.classList.add(`oim-hover-`+t.hover)}let We=r.animations?.find(e=>e.on===`hover`&&e.tracks),Ge=e=>{let t=We?.tracks?.find(t=>t.property===e)?.keyframes;return t?t[t.length-1].v:void 0},Ke=e=>(r.interactions??[]).filter(t=>t.on===e).flatMap(e=>e.actions),qe={hover:{scale:Ge(`scale`),rotation:Ge(`rotation`),opacity:Ge(`opacity`)===void 0?void 0:+(Ge(`opacity`)*100).toFixed(6),transitionDuration:We&&We.duration>0?+(We.duration/1e3).toFixed(6):void 0,actions:Ke(`hover`)},active:{actions:Ke(`press`)}};if(!o.disableActions&&(We||r.interactions?.length)){let t={},n={},r=new Set;na(A,qe,function(e,t){o.queueUpdate(e,t)},{run:function(i,a){let s=o.host.shadowRoot;if(!s)return;let c=new CustomEvent(`oim:action`,{cancelable:!0,detail:{slot:e.id,name:e.name,trigger:a||`unknown`,targets:i.map(function(e){return e.target}),types:i.map(function(e){return e.type})}});if(o.host.dispatchEvent(c),c.defaultPrevented)return;i.forEach(function(e){e.type===`play`&&e.target&&o._playTimeline(String(e.target))});let l={};i.forEach(function(i){if(!i.target||i.type===`play`)return;let a=s.querySelector(`[data-slot-id="`+i.target+`"]`);!a&&!r.has(i.target)&&(r.add(i.target),console.warn(`[OimPlayer] The slot "`+e.id+`" has an action "`+i.type+`" aimed at "`+i.target+`", which does not exist in this file. It does nothing.`));let o=!a||a.style.display!==`none`&&a.style.opacity!==`0`;if(l[i.target]=o,t[i.target]===void 0&&(t[i.target]=o),i.type===`setText`&&n[i.target]===void 0){let e=a?a.querySelector(`.oim-slot-hover-wrap`):null;n[i.target]=e?e.textContent||``:a&&a.textContent||``}});let u=aa(i,l);for(let[e,t]of Object.entries(u.visibility)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);n&&(t?o._showSlotElement(n):o._hideSlotElement(n))}for(let[e,t]of Object.entries(u.texts)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);if(!n)continue;let r=n.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:n.textContent=t}},revert:function(e){let r=o.host.shadowRoot;r&&e.forEach(function(e){if(!e.target||e.type===`play`)return;let i=r.querySelector(`[data-slot-id="`+e.target+`"]`);if(i){if(t[e.target]!==void 0){let n=t[e.target];delete t[e.target],n?o._showSlotElement(i):o._hideSlotElement(i)}if(n[e.target]!==void 0){let t=n[e.target];delete n[e.target];let r=i.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:i.textContent=t}}})}},function(e,t){o._activeTouchSlot&&o._activeTouchSlot.el!==e&&o._activeTouchSlot.leave(),o._activeTouchSlot={el:e,leave:t}})}C&&(A.style.backgroundColor=`transparent`,A.style.overflow=`visible`,A.style.setProperty(`padding`,`0`,`important`));let J=Vi(a.flipX,a.flipY);if(J){let e=document.createElement(`div`);for(e.setAttribute(`data-oim-flip`,``),e.style.width=`100%`,e.style.height=`100%`,e.style.transformOrigin=`50% 50%`,e.style.transform=`scale(`+J[0]+`, `+J[1]+`)`;A.firstChild;)e.appendChild(A.firstChild);A.appendChild(e)}return{slotEl:A,zoneId:je,slot:e}}),S=await Promise.all(x),C=[],w=new Set;s.forEach(function(e,t){let n=e&&e.id!==void 0&&e.id!==null&&e.id!==``?String(e.id):``,r;n?w.has(n)?(console.warn(`[OimPlayer] Duplicate slot id "`+n+`" at index `+t+`; rendering it unkeyed and in stack order.`),r=`__oim-dup-`+n+`-`+t):r=n:(console.warn(`[OimPlayer] Slot #`+t+` has no id; rendering it unkeyed and in stack order.`,e),r=`__oim-unkeyed-`+t),w.add(r),C.push(r)});let T=new Map;S.forEach(function(e,t){if(!e)return;let n=e.slotEl,r=e.zoneId;r&&m[r]?m[r].appendChild(n):T.set(C[t],n)});let E=[];s.forEach(function(e,t){let n=h.get(String(e.id));n&&m[n]||E.push({id:C[t],type:e.type,style:e.style||{},duotone:e.type===`filter`&&v.get(String(e.id))?.effects?.some(e=>e.kind===`backdrop`&&e.preset===`duotone`),position:e.position,width_px:e.width_px,height_px:e.height_px})});let D=Vr(E),O=E.some(function(e){return e.type===`mask`}),ee=E.some(function(e){return!!e.duotone});if((O||ee)&&p.appendChild(wa(E,{width:d,height:f})),D.forEach(function(e){Ta(e,p,T)}),n?S.forEach(function(e){if(!e)return;let t=e.slotEl.getAttribute(`data-slot-id`)||``,n=r.querySelector(`[data-slot-id="`+t+`"]`);if(n&&n.parentNode){let t=n.querySelectorAll(`[data-oim-group] > [data-slot-id], :scope > [data-slot-id]`);for(let n=0;n<t.length;n++)e.slotEl.appendChild(t[n]);n.parentNode.replaceChild(e.slotEl,n)}}):(r.innerHTML=``,r.appendChild(p)),_.size>0){let e=function(e){for(let t in m)if(m[t]&&m[t].contains(e))return!0;return!1};_.forEach(function(t,n){let i=r.querySelector(`[data-slot-id="`+n+`"]`);if(!i||e(i))return;let a=i.querySelector(`[data-oim-group="`+n+`"]`)||i;t.forEach(function(t){let n=r.querySelector(`[data-slot-id="`+t+`"]`);n&&!e(n)&&a.appendChild(n)})})}try{await Promise.all(u)}catch(e){console.warn(`[OIM Player] Font load fallback activado.`,e)}r.querySelectorAll(`.oim-slot`).forEach(function(e){e.style.opacity=e.dataset.oimOpacity===void 0?`1`:e.dataset.oimOpacity}),await o._mediaSettled(r),o._buildA11y(),o.updateViewportSize(),o.updateScale(),o._viewport&&(o._viewport.classList.add(`oim-viewport--ready`),o._revealed=!0)}_defineLayerGrain(e,t){let n=this._viewport||this._overlay;if(!n||typeof DOMParser>`u`)return;let r=n.querySelector(`:scope > svg.oim-grain-defs > defs`);if(!r){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`class`,`oim-grain-defs`),t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`style`,`position:absolute;pointer-events:none`),r=document.createElementNS(e,`defs`),t.appendChild(r),n.appendChild(t)}let i=r.querySelector(`#`+e);i&&i.remove();let a=vi(e,{intensity:t.intensity,size:t.size,blend:t.blend}),o=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg"><defs>`+a+`</defs></svg>`,`image/svg+xml`).querySelector(`filter`);o&&r.appendChild(document.importNode(o,!0))}_revealed=!1;_mediaSettled(e){let t=[];e.querySelectorAll(`img`).forEach(function(e){typeof e.decode==`function`&&e.getAttribute(`src`)&&t.push(e.decode().catch(function(){}))}),(this._lottieInstances||[]).forEach(function(e){let n=e.inst;n&&!n.isLoaded&&typeof n.addEventListener==`function`&&t.push(new Promise(function(e){n.addEventListener(`DOMLoaded`,e),n.addEventListener(`data_failed`,e)}))});let n=new Promise(function(e){setTimeout(e,Ea)});return Promise.race([Promise.all(t),n]).then(()=>new Promise(function(e){typeof requestAnimationFrame==`function`?requestAnimationFrame(function(){requestAnimationFrame(function(){e()})}):e()}))}_pendingDOMUpdates=new Map;_isUpdateScheduled=!1;_updateCallbacks=[];queueUpdate(e,t,n){let r={};for(let[e,n]of Object.entries(t))(typeof n==`string`||n===void 0)&&(r[e]=n);this._pendingDOMUpdates.set(e,{...this._pendingDOMUpdates.get(e)||{},...r}),n&&this._updateCallbacks.push(n),this._isUpdateScheduled||(this._isUpdateScheduled=!0,requestAnimationFrame(()=>this._flushDOMUpdates()))}_flushDOMUpdates(){this._pendingDOMUpdates.forEach((e,t)=>{for(let[n,r]of Object.entries(e))n.startsWith(`--`)?r===``||r==null?t.style.removeProperty(n):t.style.setProperty(n,String(r)):t.style[n]=r}),this._pendingDOMUpdates.clear(),this._isUpdateScheduled=!1;let e=this._updateCallbacks;this._updateCallbacks=[],e.forEach(e=>{try{e()}catch(e){console.error(e)}})}_hideSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`none`,opacity:`0`,pointerEvents:`none`}):this.queueUpdate(e,{pointerEvents:`none`},()=>{this._runReveal(e,!1,()=>this.queueUpdate(e,{display:`none`}))})}_showSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`flex`,opacity:`1`,pointerEvents:`auto`}):this.queueUpdate(e,{display:`flex`,pointerEvents:`auto`},()=>this._runReveal(e,!0))}_playTimeline(e){let t=this._timelines.get(e);t?(t.currentTime=0,this._paused||t.play()):!this.disableAnimations&&!this._warnedPlay.has(e)&&(this._warnedPlay.add(e),console.warn(`[OimPlayer] play: no animation`,e))}_runReveal(e,t,n){let r=this._revealAnims.get(e),i=r?getComputedStyle(e):void 0;r&&(r.cancel(),this._revealAnims.delete(e)),e.style.opacity=t?`1`:`0`;let a=ii(e._oimReveal,t);if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||a.duration===0||typeof e.animate!=`function`){n?.();return}let o=ri(a.effect,t);if(i)for(let e of[`opacity`,`translate`,`scale`]){let t=i[e];t&&t!==`none`&&(o[0][e]=t)}let s=e.animate(o,{duration:a.duration,easing:a.easing,fill:`both`});this._paused&&s.pause(),this._revealAnims.set(e,s),s.onfinish=()=>{this._revealAnims.delete(e),s.cancel(),n?.()}}_buildA11y(){let e=this._viewport;if(!e||!this.metadata)return;let t=this.metadata,n=t.lang&&t.lang[0]||t.languages&&t.languages[0]||this.lang,r=this._a11yHidden,i=this._a11yShown,a=Li((t.slots||t.elements||[]).filter(function(e){return!r.has(String(e&&e.id))}).map(function(e){return i.has(String(e&&e.id))?Object.assign({},e,{style:Object.assign({},e.style,{isVisible:!0})}):e}),this.lang,n,!this.disableActions);this._overlay&&this._overlay.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`figure`),e.setAttribute(`aria-label`,Ri(t,a,this.lang,n));let o=e.querySelector(`.oim-a11y`);o||(o=document.createElement(`div`),o.className=`oim-a11y`,o.style.cssText=`position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap`,e.appendChild(o)),o.textContent=``;let s=this;a.forEach(function(e){let t;if(e.type===`text`)t=document.createElement(`p`),t.setAttribute(`lang`,e.lang),t.textContent=e.text;else if(e.type===`image`)t=document.createElement(`span`),t.setAttribute(`role`,`img`),t.setAttribute(`aria-label`,e.label);else{t=document.createElement(`button`),t.setAttribute(`type`,`button`),t.textContent=e.label;let n=function(){let t=s._overlay&&s._overlay.querySelector(`[data-slot-id="`+CSS.escape(e.slotId)+`"]`);t&&t.click()};t.addEventListener(`click`,n),t.addEventListener(`keydown`,function(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())})}o.appendChild(t)})}_a11yHidden=new Set;_a11yShown=new Set;executeToggleState(e){if(!e)return;let t=this.host.shadowRoot;if(!t)return;let n=this,r=e.hide_slots||[];r.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._hideSlotElement(r)});let i=e.show_slots||[];i.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._showSlotElement(r)}),r.forEach(function(e){n._a11yHidden.add(String(e)),n._a11yShown.delete(String(e))}),i.forEach(function(e){n._a11yShown.add(String(e)),n._a11yHidden.delete(String(e))}),this._buildA11y()}_activeTouchSlot=null;clearSlots(){this._activeTouchSlot&&=null;let e=this._overlay;e&&(e.replaceChildren?e.replaceChildren():e.innerHTML=``)}setLang(e){if(this.lang===e)return;let t=this.lang;this.lang=e,this.host.setAttribute(`lang`,e),this._buildA11y();let n=this._classifyLangChange(t,e);(n.styleOnly.size>0||n.content.size>0)&&(this._prefersLessMotion()||this._isLowTierOrMobile()?this._switchWithFade(n):this._switchWithBlur(n)),this.host.dispatchEvent(new CustomEvent(`oim:langchange`,{detail:{lang:e}}))}_isLowTierOrMobile(){let e=this.host;if(e&&typeof e.getAttribute==`function`){let t=e.getAttribute(`tier`)||e.getAttribute(`quality`);if(t===`low`)return!0;if(t===`high`)return!1}return this._deviceProfile.isMobile||this._deviceProfile.tier===`low`}_prefersLessMotion(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}_switchWithBlur(e){let t=this._viewport,n=this;t?(t.style.transition=`filter 0.18s ease-out`,t.style.filter=`blur(14px)`,setTimeout(function(){let r=n._applyLangChange(e),i=new Promise(function(e){setTimeout(e,600)});Promise.race([r||Promise.resolve(),i]).then(function(){t.style.transition=`filter 0.32s ease-in-out`,t.style.filter=`none`})},180)):this._applyLangChange(e)}_switchWithFade(e){let t=this.host.shadowRoot,n=this,r=new Set([...e.styleOnly,...e.content]),i=[];t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&!/opacity/i.test(n.style.animationName||``)&&i.push(n)}),i.forEach(function(e){e.style.transition=`opacity 0.12s linear`,e.style.opacity=`0`}),setTimeout(function(){n._applyLangChange(e),t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&(n.style.opacity=n.dataset.oimOpacity===void 0?`1`:n.dataset.oimOpacity)})},120)}_classifyLangChange(e,t){let n=new Set,r=new Set;return this.metadata&&(this.metadata.slots||this.metadata.elements||[]).forEach(function(i){if(!i||i.id===void 0||i.id===null)return;let a=hn(i,e,t);a===`content`?r.add(String(i.id)):a===`style-only`&&n.add(String(i.id)),Array.isArray(i.languages)&&!i.languages.includes(`*`)&&i.languages.includes(e)!==i.languages.includes(t)&&n.add(String(i.id))}),{styleOnly:n,content:r}}_applyLangChange(e){let t=this.host.shadowRoot;if(t&&e.styleOnly.size>0&&this.metadata){let n=this.metadata.slots||this.metadata.elements||[],r=this;n.forEach(function(n){if(!n||!e.styleOnly.has(String(n.id)))return;let i=t.querySelector(`[data-slot-id="`+n.id+`"]`);if(!i)return;Array.isArray(n.languages)&&!n.languages.includes(`*`)&&(i.style.display=n.languages.includes(r.lang)?``:`none`);let a=mn(n,r.lang),o=n.type===`text`?xn(_n(r.metadata).get(String(n.id)),r.lang):void 0;i.style.fontSize=o?.fontSize??a.size,i.style.maxWidth=o?.maxWidth??a.maxWidthValue})}return e.content.size>0?this.renderSlots({onlyIds:e.content}):null}play(){this._paused=!1,this._isStill()||(this._animations.forEach(function(e){try{e.play()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.play()}catch{}}),this._textAnimations.forEach(function(e){e.play()}),this._revealAnims.forEach(function(e){e.play()}),this._heldTimelines.forEach(function(e){e.play()}),this._heldTimelines.clear())}pause(){this._paused=!0,this._textAnimations.forEach(function(e){e.pause()}),this._revealAnims.forEach(function(e){e.pause()});let e=this._heldTimelines;this._timelines.forEach(function(t){t.playState===`running`&&t.effect?.getTiming().iterations!==1/0&&(t.pause(),e.add(t))}),this._animations.forEach(function(e){try{e.pause()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.pause()}catch{}})}_bornPausedIfNeeded(e,t){this._paused&&t.pause(),e.push(t)}_destroyLottiesIn(e){if(!this._lottieInstances)return;let t=[];this._lottieInstances.forEach(function(n){if(e.has(n.slotId))try{n.inst.destroy()}catch{}else t.push(n)}),this._lottieInstances=t}};function Oa(e){return(e.on===`loop`||e.on===`action`)&&!!e.tracks&&e.tracks.some(e=>ka[e.property]!==void 0)}var ka={x:0,y:0,rotation:0,scale:1,opacity:1,blur:0},Aa=[`x`,`y`,`rotation`,`scale`];function ja(e,t,n){if(!e)return n;let r=e.keyframes,i=r.find(e=>e.t===t);if(i)return i.v;let a=r.findIndex(e=>e.t>t);if(a<=0)return a===0?r[0].v:r[r.length-1].v;let o=r[a-1],s=r[a];return o.v+(s.v-o.v)*(t-o.t)/(s.t-o.t)}function Ma(e){let t=t=>e.find(e=>e.property===t),n=Aa.some(e=>t(e)),r=new Map;for(let t of e)if(ka[t.property]!==void 0)for(let e of t.keyframes){let n=r.get(e.t);n||r.set(e.t,n={offset:e.t}),e.e!==void 0&&(n.easing=ti(e.e,`linear`)),t.property===`opacity`?n.opacity=e.v:t.property===`blur`?n.filter=e.v>0?`blur(`+e.v+`px)`:`none`:n.moves=!0}return[...r.values()].sort((e,t)=>e.offset-t.offset).map(function(e){let{moves:r,...i}=e;if(n&&r){let n=n=>ja(t(n),e.offset,ka[n]);i.transform=`translate(`+n(`x`)+`px, `+n(`y`)+`px) rotate(`+n(`rotation`)+`deg) scale(`+n(`scale`)+`)`}return i})}var Na=class extends Da{constructor(e,t){super();let n=t||{};this.host=e,this.lang=e.getAttribute(`lang`)||`en`,this.showControls=e.getAttribute(`show-controls`)!==`false`,this._deviceProfile=m(),this.allowZoom=n.allowZoom===!0,this.showLanguageSelector=n.showLanguageSelector!==!1,this.showSlots=n.showSlots!==!1,this.allowLottie=n.allowLottie!==!1&&e.getAttribute(`allow-lottie`)!==`false`,this.allowDynamicColors=n.allowDynamicColors!==!1&&e.getAttribute(`allow-dynamic-colors`)!==`false`;let r=o(e,n,typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);this.disableAnimations=r.disableAnimations,this.disableActions=r.disableActions,this.dropdownBlur=n.dropdownBlur!==!1&&e.getAttribute(`dropdown-blur`)!==`false`,this.fit=n.fit||`contain`,this.align=n.align||`center`}destroy(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._onFullscreenChange&&(document.removeEventListener(`fullscreenchange`,this._onFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`MSFullscreenChange`,this._onFullscreenChange)),this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]),this._animations.forEach(function(e){try{e.cancel()}catch{}}),this._animations=[],this._timelines.clear(),this._revealAnims.clear(),this._heldTimelines.clear(),this._textAnimations.forEach(function(e){try{e.stop()}catch{}}),this._textAnimations=[],this._onDragMove&&=(window.removeEventListener(`mousemove`,this._onDragMove),null),this._onDragEnd&&=(window.removeEventListener(`mouseup`,this._onDragEnd),null)}async load(e){let t=this.host,n=t.shadowRoot||t.attachShadow({mode:`open`});try{if(typeof e==`string`?this.imageUrl=e:(this.imageUrl&&this.imageUrl.startsWith(`blob:`)&&URL.revokeObjectURL(this.imageUrl),this.imageUrl=URL.createObjectURL(e)),t.classList.add(`oim-player-host`),t.classList.add(`oim-align-`+this.align),t.classList.add(`oim-tier-`+this._deviceProfile.tier),this._deviceProfile.isMobile&&t.classList.add(`oim-mobile`),n.innerHTML=`<div class="oim-player-viewport oim-fit-`+this.fit+`" part="viewport"><img class="oim-player-base" crossorigin="anonymous" src="`+this.imageUrl+`" alt="" aria-hidden="true" part="base" /><div class="oim-layer-overlay" aria-hidden="true" part="overlay"></div></div>`,ee(n),this._viewport=n.querySelector(`.oim-player-viewport`),this._baseImg=n.querySelector(`.oim-player-base`),this._overlay=n.querySelector(`.oim-layer-overlay`),this._stage=this.host,!this.allowDynamicColors&&this._viewport)for(let e of q)this._viewport.style.setProperty(`--oim-color-`+e,`initial`);this.applyPalette(),(this._prefersLessMotion()||this._isLowTierOrMobile())&&this._viewport&&(this._viewport.style.filter=`none`);let r=this,i=null,a=()=>{i||=requestAnimationFrame(()=>{r.updateViewportSize(),r.updateScale(),i=null})};typeof ResizeObserver<`u`&&this._viewport&&(this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(a),this._resizeObserver.observe(this.host)),this._onFullscreenChange=a,document.addEventListener(`fullscreenchange`,this._onFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.addEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.addEventListener(`MSFullscreenChange`,this._onFullscreenChange);let o=this._baseImg,c=this._viewport;function l(){c&&o&&o.naturalWidth>0&&(c.style.setProperty(`--oim-ar`,o.naturalWidth+` / `+o.naturalHeight),r._baseImg=o,r.updateViewportSize(),r.updateScale(),r.metadata&&r.renderSlots())}return o&&o.complete&&o.naturalWidth>0?l():o&&(o.onload=l),this.updateViewportSize(),this.updateScale(),this._bindViewportEvents(),D.getBlob(e).then(t=>new Promise((n,i)=>{s.requestRender(r,t,e,n,i)})).catch(e=>{if(console.error(`[OimPlayer::ImageEngine::load]`,e),String(e&&e.message).indexOf(`OIM_ALTERED`)===0){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,ee(n);let e=n.querySelector(`.oim-player-error`);e&&(e.textContent=u(`tampered`,r.lang))}throw t.dispatchEvent(new CustomEvent(`error`,{detail:e})),e})}catch(e){console.error(`[OimPlayer::ImageEngine]`,e),n.innerHTML=`<div class="oim-player-error" part="error"></div>`;let r=n.querySelector(`.oim-player-error`);return r&&(r.textContent=u(`loadError`,this.lang)+e.message),t.dispatchEvent(new CustomEvent(`error`,{detail:e})),!1}}async _verifyMainThread(e){let t=await fe(e);if(!t.metadata)return{metadata:{slots:[]},security:`no_metadata`,announce:!1};let n=Re(t.metadata);if(n.length>0)return{refused:!0,security:`corrupt`,error:`Corrupted or tampered OIM file: `+n[0]};let r=!!(t.metadata.signature&&t.metadata.key_version),i=await Ne(t.metadata),a=Pe({isSigned:r,isSigValid:i,keyExpired:r&&i?await Fe(t.metadata):!1,metadata:t.metadata,imageHash:t.imageHash});if(Ie(a))return{refused:!0,security:a,error:Le+`: `+a};let o,s=!1;return i?a===`unsigned`||a===`expired_key`?o={slots:[],elements:[],layers:[]}:(s=!0,k(t.metadata),o=t.metadata):o={slots:[]},{metadata:o,security:a,announce:s}}async _verifyWithWorker(e){let t=typeof window<`u`?window.location.hostname:``,n=typeof window<`u`?window.location.origin:``,r;try{r=await le(e,t,n)}catch(t){return console.warn(`[OimPlayer] Web Worker unavailable or crashed (possibly blocked by CSP). Falling back to main-thread execution.`,t),this._verifyMainThread(e)}return r.success?{metadata:r.metadata,security:r.security||`unsigned`,announce:!0}:r.refused?{refused:!0,security:r.security,error:r.error}:(console.warn(`[OimPlayer] Web Worker reported execution failure. Falling back to main-thread execution.`,r.error),this._verifyMainThread(e))}async _verify(e){return typeof Worker>`u`?this._verifyMainThread(e):this._verifyWithWorker(e)}async _applyVerified(e){let t=this;if(this.metadata=structuredClone(e.metadata),this.applyPalette(),this.securityStatus=e.security,this.securityStatus===`unsigned`){try{c(this.host,`data-oim-unsigned`,`data-oim-sin-firma`)}catch{}console.warn(`[OimPlayer] Unsigned file: painting the base image only. Interactive layers need a signature.`)}if(this.securityStatus===`expired_key`){try{c(this.host,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}console.warn(`[OimPlayer] This work was signed with a retired key. Ask the author to export it again.`)}return e.announce&&t._announceUnsupported(this.metadata),this.embeddedFontFamilies=await ut(lt(this.metadata)),this.updateViewportSize(),this.updateScale(),await this.renderSlots(),typeof document<`u`&&document.fonts&&document.fonts.ready.then(()=>{t.host&&t._overlay&&(t.updateViewportSize(),t.updateScale(),t._overlay.querySelectorAll(`.oim-slot`).forEach(e=>{let t=e.style.transition;e.style.setProperty(`transition`,`none`,`important`),e.offsetWidth,e.style.transition=t}))}),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.metadata,security:this.securityStatus}})),!0}async _executeLoad(e,t){try{let n=await D.getVerified(t??e,e=>this._verify(e));if(n.refused)throw this.securityStatus=n.security,Error(n.error);return this._applyVerified(n)}catch(e){throw console.error(`[OimPlayer::ImageEngine::_executeLoad]`,e),e}}_announceUnsupported(e){let t;try{t=rt(e,{version:$e,capabilities:et})}catch{return}if(!t.hasNotice)return;let n=it(t);try{console.warn(`[OimPlayer] `+n)}catch{}try{t.missingCapabilities&&t.missingCapabilities.length>0&&c(this.host,`data-oim-unsupported`,`data-oim-sin-soporte`,t.missingCapabilities.join(` `)),t.missingRequiredCapabilities&&t.missingRequiredCapabilities.length>0&&c(this.host,`data-oim-missing-required`,`data-oim-requeridas-faltantes`,t.missingRequiredCapabilities.join(` `)),t.versionTooOld&&t.requiredVersion&&c(this.host,`data-oim-required-version`,`data-oim-version-exigida`,t.requiredVersion),this.host.dispatchEvent(new CustomEvent(`oim:incomplete`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}})),t.cannotRender&&this.host.dispatchEvent(new CustomEvent(`oim:unsupported`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}}))}catch{}}updateScale(){if(!this._viewport)return;let e=this._viewport.offsetWidth,t=this.metadata&&this.metadata.canvas?this.metadata.canvas.natural_width||this.metadata.canvas.width:0,n=e/(this.metadata&&(this.metadata.artboardWidth||this.metadata.canvasWidth||this.metadata.canvas_width)||t||this._baseImg&&this._baseImg.naturalWidth||1080);this._viewport.style.setProperty(`--oim-fit`,n.toFixed(6))}updateViewportSize(){if(!this._viewport)return;let e=this._baseImg?this._baseImg.naturalWidth:0,t=this._baseImg?this._baseImg.naturalHeight:0;if(e===0&&this.metadata&&this.metadata.canvas&&(e=this.metadata.canvas.natural_width||this.metadata.canvas.width||1080,t=this.metadata.canvas.natural_height||this.metadata.canvas.height||1920),e===0)return;let n=this.host.offsetWidth,r=this.host.offsetHeight;if(n===0||r===0){if(!this._retryViewportSize){this._retryViewportSize=!0;let e=this;setTimeout(()=>{e._retryViewportSize=!1,e.updateViewportSize(),e.updateScale()},100)}return}let i=e/t,a=n/r,o,s;this.fit===`cover`?a>i?(o=n,s=n/i):(s=r,o=r*i):a>i?(s=r,o=r*i):(o=n,s=n/i),this._viewport.style.width=Math.round(o)+`px`,this._viewport.style.height=Math.round(s)+`px`}_bindViewportEvents(){let e=this,t=this._stage;if(!t)return;t.addEventListener(`pointerdown`,function(t){if(t.pointerType!==`mouse`&&e._activeTouchSlot&&(typeof t.composedPath==`function`?t.composedPath():[]).indexOf(e._activeTouchSlot.el)===-1){let t=e._activeTouchSlot;e._activeTouchSlot=null,t.leave()}});let n=!1,r=0,i=0,a=0,o=0;t.addEventListener(`mousedown`,function(s){e.allowZoom&&(e.zoom<=1||s.target.closest(`.oim-slot`)||(n=!0,e._viewport&&(e._viewport.style.transition=`none`),t.style.cursor=`grabbing`,r=s.clientX,i=s.clientY,a=e.panX,o=e.panY,s.preventDefault()))}),this._onDragMove=function(t){if(!n)return;let s=t.clientX-r,c=t.clientY-i;e.panX=a+s,e.panY=o+c,e._constrainPan(),e._applyViewportTransform()},window.addEventListener(`mousemove`,this._onDragMove),this._onDragEnd=function(){n&&(n=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`),t.style.cursor=e.zoom>1?`grab`:`default`)},window.addEventListener(`mouseup`,this._onDragEnd);let s=null,c=1,l=!1,u=0,d=0,f=0,p=0;t.addEventListener(`touchstart`,function(t){if(e.allowZoom){if(t.touches.length===2)s=xa(t.touches),c=e.zoom,l=!1,e._viewport&&(e._viewport.style.transition=`none`);else if(t.touches.length===1&&e.zoom>1){if(t.target.closest(`.oim-slot`))return;l=!0,u=t.touches[0].clientX,d=t.touches[0].clientY,f=e.panX,p=e.panY,e._viewport&&(e._viewport.style.transition=`none`)}}},{passive:!0}),t.addEventListener(`touchmove`,function(t){if(e.allowZoom){if(t.touches.length===2&&s!==null){let n=xa(t.touches);if(s>0){let t=n/s;e.setZoom(c*t)}}else if(t.touches.length===1&&l){let n=t.touches[0].clientX-u,r=t.touches[0].clientY-d;e.panX=f+n,e.panY=p+r,e._constrainPan(),e._applyViewportTransform()}}},{passive:!0}),t.addEventListener(`touchend`,function(){s=null,l=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`)},{passive:!0}),e.allowZoom&&t.addEventListener(`wheel`,function(t){t.preventDefault(),e.setZoom(Qe(e.zoom,t.deltaY,t.deltaMode,t.ctrlKey))},{passive:!1})}_constrainPan(){let e=this.host;if(!e)return;let t=e.clientWidth,n=e.clientHeight,r=this.zoom,i=Math.max(0,t*(r-1)/2),a=Math.max(0,n*(r-1)/2);this.panX=Math.max(-i,Math.min(i,this.panX)),this.panY=Math.max(-a,Math.min(a,this.panY))}_applyViewportTransform(){this._viewport&&(this._viewport.style.transform=`translate3d(`+this.panX+`px, `+this.panY+`px, 0) scale(`+this.zoom+`)`)}setZoom(e){this.zoom=Math.max(1,Math.min(4,e)),this.zoom<=1&&(this.panX=0,this.panY=0),this._constrainPan(),this._applyViewportTransform();let t=this._stage;t&&(t.style.cursor=this.zoom>1?`grab`:`default`)}};function Pa(e,t){let n=``;if(typeof e==`string`){let t=e.indexOf(`#`),r=e.indexOf(`?`),i=t===-1?r===-1?e.length:r:t,a=e.lastIndexOf(`.`,i);a!==-1&&(n=e.substring(a+1,i).toLowerCase())}else if(e&&e.name){let t=e.name,r=t.lastIndexOf(`.`);r!==-1&&(n=t.substring(r+1).toLowerCase())}if(n===`oim`||n===`png`)return`image`;if(n===`ovm`||n===`webm`||n===`mp4`||n===`mkv`)return`video`;if(t){let e=String.fromCharCode(t[0],t[1],t[2],t[3]);if(e===`‰PNG`)return`image`;if(e===`OVM\0`||e===`Eߣ`)return`video`}return`image`}function Fa(e){if(!e)return null;let t=e.trim();if(/^data:image\//i.test(t))return t;try{let e=new URL(t,document.baseURI);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`blob:`?e.href:null}catch{return null}}var Q=Object.create(HTMLElement.prototype);function Ia(){if(typeof document>`u`||document.getElementById(`oim-player-gap`))return;let e=document.createElement(`style`);e.id=`oim-player-gap`,e.textContent=`:where(oim-player){display:block}:where(oim-player:not([data-oim-loaded])){min-height:200px}`,(document.head||document.documentElement).appendChild(e)}Q.connectedCallback=function(){Ia(),this.classList.add(`oim-player-host`),this._engine=null,this._src=this.getAttribute(`src`),this._oimOptions||={},this.hasAttribute(`fit`)&&(this._oimOptions.fit=this.getAttribute(`fit`)),this.hasAttribute(`align`)&&(this._oimOptions.align=this.getAttribute(`align`)),this.hasAttribute(`dropdown-blur`)&&(this._oimOptions.dropdownBlur=this.getAttribute(`dropdown-blur`)!==`false`),this.hasAttribute(`allow-lottie`)&&(this._oimOptions.allowLottie=this.getAttribute(`allow-lottie`)!==`false`),this.hasAttribute(`allow-dynamic-colors`)&&(this._oimOptions.allowDynamicColors=this.getAttribute(`allow-dynamic-colors`)!==`false`),this.hasAttribute(`placeholder`)&&(this._oimOptions.placeholder=this.getAttribute(`placeholder`)),this.hasAttribute(`allow-zoom`)&&(this._oimOptions.allowZoom=this.getAttribute(`allow-zoom`)===`true`),this._syncPlaceholder(),this._mqOscuro=typeof matchMedia==`function`?matchMedia(`(prefers-color-scheme: dark)`):null,this._onEsquema=()=>this._engine&&this._engine.applyPalette(),this._mqOscuro&&this._mqOscuro.addEventListener(`change`,this._onEsquema),this._replantearActividad()},Q._replantearActividad=function(){if(this._src&&this.isConnected){if(!this._observers){if(!(`IntersectionObserver`in window)){this._moveTo(`active`);return}let e=this,t=()=>e._scheduleDecision();this._observers=[new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isNear=r.isIntersecting),t()},{rootMargin:`200px`}),new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isVisible=r.isIntersecting),t()},{threshold:[0,.01]})],this._observers.forEach(e=>e.observe(this)),this._onTabChange=t,document.addEventListener(`visibilitychange`,this._onTabChange),this.getAttribute(`activate-on`)===`hover`&&(this._onPointerEnter=()=>{e._hasPointer=!0,t()},this._onPointerLeave=()=>{e._hasPointer=!1,t()},this.addEventListener(`mouseenter`,this._onPointerEnter),this.addEventListener(`mouseleave`,this._onPointerLeave))}this._scheduleDecision()}},Q._scheduleDecision=function(){if(this._activityFrame)return;let e=this;this._activityFrame=requestAnimationFrame(function(){e._activityFrame=null,e._decide()})},Q._decide=function(){if(!this._src||!this.isConnected)return;let e=typeof document<`u`&&document.visibilityState===`hidden`,t,n;if(typeof this._isNear==`boolean`||typeof this._isVisible==`boolean`){t=this._isNear??!1;let r=this._isVisible??!1;n=(t||r)&&r&&!e,t||=r}else{let r=this.getBoundingClientRect(),i=window.innerHeight||0;t=r.bottom>-200&&r.top<i+200,n=t&&!e&&r.bottom>0&&r.top<i}this.getAttribute(`activate-on`)===`hover`&&typeof matchMedia==`function`&&matchMedia(`(hover: hover)`).matches&&(n&&=!!this._hasPointer),this.getAttribute(`activate-on`)===`manual`&&(n=!1),this._moveTo(n?`active`:t?`ready`:`dormant`)},Q._moveTo=function(e){this._activityState!==e&&(this._activityState=e,e!==`dormant`&&(this._engine||this._initPlayer(),e===`active`?this.play():this.pause()))},Q._startAutoRotateLang=function(){this._stopAutoRotateLang();let e=this.getAttribute(`auto-rotate-lang`);if(!e||e===`false`||this.classList.contains(`oim-player-paused`))return;let t=parseInt(e,10);(isNaN(t)||t<=0)&&(t=3e3);let n=this;this._autoRotateIntervalId=setInterval(()=>{let e=n.getMetadata();if(!e)return;let t=e.slots||e.elements||[],r={};for(let e=0;e<t.length;e++){let n=t[e].content||{};Object.keys(n).forEach(e=>{r[e.toLowerCase()]=!0})}let i=Object.keys(r).sort();if(i.length<=1)return;let a=(n.getAttribute(`lang`)||n._engine&&n._engine.lang||`en`).toLowerCase(),o=i[(i.indexOf(a)+1)%i.length];n.setAttribute(`lang`,o)},t)},Q._stopAutoRotateLang=function(){this._autoRotateIntervalId&&=(clearInterval(this._autoRotateIntervalId),null)},Q.disconnectedCallback=function(){this._mqOscuro&&=(this._mqOscuro.removeEventListener(`change`,this._onEsquema),null),this._stopAutoRotateLang(),this._observers&&=(this._observers.forEach(e=>e.disconnect()),null),this._onTabChange&&=(document.removeEventListener(`visibilitychange`,this._onTabChange),null),this._onPointerEnter&&(this.removeEventListener(`mouseenter`,this._onPointerEnter),this.removeEventListener(`mouseleave`,this._onPointerLeave),this._onPointerEnter=null,this._onPointerLeave=null),this._activityFrame&&=(cancelAnimationFrame(this._activityFrame),null),this._isNear=null,this._isVisible=null,this._activityState=`dormant`,this._engine&&this._engine.destroy&&this._engine.destroy()},Q.attributeChangedCallback=function(e,t,n){if(e===`placeholder`&&t!==n)this._oimOptions||={},this._oimOptions.placeholder=n,this._syncPlaceholder();else if(e===`palette`&&t!==n)this._engine&&this._engine.applyPalette();else if(e===`src`&&t!==n)this._src=n,this._engine?this._initPlayer():this._replantearActividad();else if(e===`activate-on`&&t!==n)this._replantearActividad();else if(e===`lang`&&t!==n)this._engine&&this._engine.setLang&&this._engine.setLang(n);else if((e===`fit`||e===`align`)&&t!==n)this._oimOptions||={},this._oimOptions[e]=n,this._syncPlaceholder(),this._initPlayer();else if(e===`dropdown-blur`&&t!==n)this._oimOptions||={},this._oimOptions.dropdownBlur=n!==`false`,this._engine&&(this._engine.dropdownBlur=n!==`false`);else if(e===`allow-lottie`&&t!==n)this._oimOptions||={},this._oimOptions.allowLottie=n!==`false`,this._engine&&(this._engine.allowLottie=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots());else if(e===`auto-rotate-lang`&&t!==n)this._startAutoRotateLang();else if((e===`mode`||e===`disable-animations`||e===`disable-actions`)&&t!==n){if(this._engine){let e=typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,t=o(this,this._oimOptions||{},!!e);this._engine.disableAnimations=t.disableAnimations,this._engine.disableActions=t.disableActions,this._engine.renderSlots&&this._engine.renderSlots()}}else e===`show-slots`&&t!==n&&(this._oimOptions||={},this._oimOptions.showSlots=n!==`false`,this._engine&&(this._engine.showSlots=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots()))},Q._syncPlaceholder=function(){let e=this._engine||this._placeholderSettled?null:Fa(this._oimOptions&&this._oimOptions.placeholder);if(!e){this._removePlaceholder();return}let t=this.shadowRoot||this.attachShadow({mode:`open`});if(!t.querySelector(`img.oim-placeholder`)){let e=document.createElement(`style`);e.className=`oim-placeholder-style`,e.textContent=`:host{position:relative}`;let n=document.createElement(`img`);n.className=`oim-placeholder`,n.alt=``,n.decoding=`async`,n.addEventListener(`error`,()=>this._removePlaceholder()),t.append(e,n)}let n=t.querySelector(`img.oim-placeholder`),r=this._oimOptions&&this._oimOptions.fit===`cover`?`cover`:`contain`,i=this._oimOptions&&this._oimOptions.align,a=i===`top`?`center top`:i===`bottom`?`center bottom`:`center center`;n.setAttribute(`style`,`position:absolute;inset:0;width:100%;height:100%;object-fit:${r};object-position:${a}`),n.getAttribute(`src`)!==e&&n.setAttribute(`src`,e)},Q._removePlaceholder=function(){this.shadowRoot&&this.shadowRoot.querySelectorAll(`.oim-placeholder, .oim-placeholder-style`).forEach(e=>e.remove())},Q._initPlayer=function(){if(!this._src)return;this._loading=!0;let e=this,t=this._src;e._oimOptions||={},e.hasAttribute(`fit`)&&(e._oimOptions.fit=e.getAttribute(`fit`)),e.hasAttribute(`align`)&&(e._oimOptions.align=e.getAttribute(`align`)),e.hasAttribute(`dropdown-blur`)&&(e._oimOptions.dropdownBlur=e.getAttribute(`dropdown-blur`)!==`false`),e.hasAttribute(`placeholder`)&&(e._oimOptions.placeholder=e.getAttribute(`placeholder`)),e.hasAttribute(`allow-lottie`)&&(e._oimOptions.allowLottie=e.getAttribute(`allow-lottie`)!==`false`),e.hasAttribute(`allow-zoom`)&&(e._oimOptions.allowZoom=e.getAttribute(`allow-zoom`)===`true`);let n;n=t instanceof Blob?t.slice(0,16).arrayBuffer().then(e=>new Uint8Array(e)).catch(()=>null):D.sniff(t),n.then(n=>{if(!e.isConnected)return;let r=Pa(t,n);e._engine&&e._engine.destroy&&e._engine.destroy(),r===`video`&&console.warn(`[OimPlayer] Video media detected. Video support has been migrated to <ovm-player> from @oim-media/player-ovm. Falling back to ImageEngine.`),e._engine=new Na(e,e._oimOptions),e._loading=!1,e.classList.contains(`oim-player-paused`)&&e._engine.pause(),c(e,`data-oim-loaded`,`data-oim-cargado`);let i=()=>{e._placeholderSettled=!0,e._syncPlaceholder()};e._engine.load(t).then(()=>{i(),e._startAutoRotateLang()}).catch(e=>{i(),console.warn(`[OimPlayer] Engine load error during auto-rotate initialization:`,e)})})},Q._wake=function(){this._engine||this._loading||!this._src||this._initPlayer()},Q.getMetadata=function(){return this._wake(),this._engine?this._engine.metadata:null},Q.getSecurityStatus=function(){return this._wake(),this._engine?this._engine.securityStatus||`unsigned`:null},Q.setLang=function(e){this._wake(),this._engine&&this._engine.setLang&&this._engine.setLang(e)},Q.setZoom=function(e){this._engine&&this._engine.setZoom&&this._engine.setZoom(e)},Q.play=function(){this._wake(),this.classList.remove(`oim-player-paused`),this._engine&&this._engine.play&&this._engine.play(),this._startAutoRotateLang()},Q.pause=function(){this.classList.add(`oim-player-paused`),this._engine&&this._engine.pause&&this._engine.pause(),this._stopAutoRotateLang()},Q.seek=function(e){this._engine&&this._engine.seek&&this._engine.seek(e)},Q.getEngine=function(){return this._engine},Q.destroy=function(){this._engine&&this._engine.destroy&&(this._engine.destroy(),this._engine=null),this.parentNode&&this.parentNode.removeChild(this)};var La=[`src`,`placeholder`,`lang`,`activate-on`,`fit`,`align`,`dropdown-blur`,`allow-lottie`,`palette`,`auto-rotate-lang`,`disable-animations`,`disable-actions`,`mode`,`show-slots`],$;typeof customElements<`u`&&!customElements.get(`oim-player`)&&($=class extends HTMLElement{_engine=null;_src=null},$.prototype.connectedCallback=Q.connectedCallback,$.prototype.disconnectedCallback=Q.disconnectedCallback,$.prototype.attributeChangedCallback=Q.attributeChangedCallback,$.prototype.getMetadata=Q.getMetadata,$.prototype.getSecurityStatus=Q.getSecurityStatus,$.prototype.setLang=Q.setLang,$.prototype.setZoom=Q.setZoom,$.prototype.play=Q.play,$.prototype.pause=Q.pause,$.prototype.seek=Q.seek,$.prototype.getEngine=Q.getEngine,$.prototype._initPlayer=Q._initPlayer,$.prototype._syncPlaceholder=Q._syncPlaceholder,$.prototype._removePlaceholder=Q._removePlaceholder,$.prototype._replantearActividad=Q._replantearActividad,$.prototype._decide=Q._decide,$.prototype._scheduleDecision=Q._scheduleDecision,$.prototype._moveTo=Q._moveTo,$.prototype._wake=Q._wake,$.prototype._startAutoRotateLang=Q._startAutoRotateLang,$.prototype._stopAutoRotateLang=Q._stopAutoRotateLang,$.prototype.destroy=Q.destroy,$.observedAttributes=La,Object.defineProperty($.prototype,"src",{get:function(){return this._src},set:function(e){this._src=e,typeof e==`string`?this.setAttribute(`src`,e):this._initPlayer()}}),Object.defineProperty($.prototype,"languages",{get:function(){if(!this._engine||!this._engine.metadata)return[];let e=this._engine.metadata.slots||this._engine.metadata.elements||[],t={};for(let n=0;n<e.length;n++){let r=e[n].content||{};Object.keys(r).forEach(e=>{t[e.toLowerCase()]=!0})}return Object.keys(t).sort()}}),Object.defineProperty($.prototype,"currentLang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`}}),Object.defineProperty($.prototype,"lang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`},set:function(e){this.setAttribute(`lang`,e)}}),customElements.define(`oim-player`,$)),window.OimPlayerElement=Q;var Ra={mount:function(e,t,n){let r=typeof e==`string`?document.getElementById(e):e;if(!r)return console.error(`[OimPlayer.mount] Container not found:`,e),null;let i=document.createElement(`oim-player`);return i._oimOptions=n||{},i.src=t,i.setAttribute(`show-controls`,n&&n.showLanguageSelector===!1?`false`:`true`),n&&n.allowLottie===!1&&i.setAttribute(`allow-lottie`,`false`),r.replaceChildren?r.replaceChildren(i):(r.innerHTML=``,r.appendChild(i)),i}},za=Ra.mount;return window.OimPlayer=Ra,e.OimPlayer=Ra,e.default=Ra,e.OimPlayerElement=Q,e.mount=za,e})({});
113
+ `);let k=r.type===`text`?r.text?.align??`left`:`left`,te=`center`;k===`left`?te=`flex-start`:k===`right`&&(te=`flex-end`);let A=document.createElement(`div`);A.className=`oim-slot`,A.setAttribute(`part`,`slot`),A.setAttribute(`data-slot-id`,e.id),r.languages&&!r.languages.includes(o.lang)&&(A.style.display=`none`),A.style.zIndex=T?`0`:`1`;let ne=r.animations?.find(e=>e.on===`enter`&&e.preset);A._oimReveal=ne?{effect:ne.preset,duration:ne.duration,easing:ne.easing}:void 0;let re=!!r.interactions?.length;x||re&&!o.disableActions||A.setAttribute(`data-oim-passthrough`,``);let ie=r.fills?.[0],j=ie?.kind===`pattern`?ie.pattern:void 0,ae=j?xr(j,y):{};if(T){A.style.pointerEvents=`none`;let e=p?En(p,Dn(r,y.literal),!0):``;if(e||j){if(oi(A,ae,e),(j?.fit===`cover`?`cover`:`tile`)==`cover`)A.style.backgroundSize=`cover`,A.style.backgroundRepeat=`no-repeat`,A.style.backgroundPosition=`center`,A.style.setProperty(`--oim-pat-size`,`cover`),A.style.setProperty(`--oim-pat-repeat`,`no-repeat`),A.style.setProperty(`--oim-pat-pos`,`center`);else{let e=160*(j?.scale||1)/d*100;A.style.backgroundSize=e.toFixed(4)+`cqw `+e.toFixed(4)+`cqw`,A.style.backgroundRepeat=`repeat`,A.style.setProperty(`--oim-bg-tile`,e.toFixed(4)+`cqw`)}let t=j?.motion,n=t?`background-animation-${t.direction} ${t.period||8}s linear infinite`:void 0;!o.disableAnimations&&typeof n==`string`&&n.indexOf(`background-animation-`)===0&&(A.style.animation=n),D=``,O=!1}}if(t===`pattern`){let e=cn(r.type===`shape`?r.geometry:void 0),t=vr({...ae,geoShape:e.round?`circle`:e.preset});for(let[e,n]of Object.entries(t))e.startsWith(`--`)?A.style.setProperty(e,n):A.style[e]=n;(ae.fillPatternColorRole||ae.fillPatternBgColorRole)&&oi(A,ae,``)}let M=document.createElement(`div`);M.className=`oim-slot-loop-wrap`;let N=document.createElement(`div`);N.className=`oim-slot-hover-wrap`,(O||E||t===`lottie`||C)&&(M.style.height=`100%`,N.style.height=`100%`);let P=null,F=t===`text`?r.fills?.[0]:void 0;if(F){let e=Er(F,{colors:y,isText:!0,width:r.box.width||d,height:r.box.height||f});P=Object.keys(e).length>0?e:null}let oe=P!==null&&(P.backgroundClip===`text`||P.webkitBackgroundClip===`text`),se=r.box.width!==void 0&&r.box.height!==void 0,ce=oe&&se;if(E){let t=D.trim();if(t.startsWith(`<`)){let e=t.match(/src=["']([^"']+)["']/);e&&e[1]&&(t=e[1])}let n=we(t),i=document.createElement(`img`);n?i.src=t:(console.warn(`[OimPlayer] Image not embedded in the file (network URLs are not loaded), slot:`,e.id),i.src=``),i.alt=``,i.draggable=!1,i.style.width=`100%`,i.style.height=`100%`;let a=u?.fit,o=u?.crop;if(i.style.objectFit=a||`cover`,o){let e=Bi(o);i.style.objectFit=e.objectFit,i.style.objectPosition=e.objectPosition,i.style.transform=e.transform,i.style.transformOrigin=e.transformOrigin,N.style.overflow=`hidden`}i.style.display=`block`,i.style.pointerEvents=`none`,i.style.filter=e.type===`image`?Ar(Sn(r.image?.filters))??``:``,M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,i.onerror=function(t){console.error(`[OimPlayer] Image slot failed to load for slot:`,e.id,`error:`,t),i.style.display=`none`},N.appendChild(i)}else if(t===`lottie`){let t=document.createElement(`div`);t.className=`oim-lottie-container`,t.style.width=`100%`,t.style.height=`100%`,N.appendChild(t),o.allowLottie?Gt().then(function(n){let r=typeof D==`string`&&(D.startsWith(`http`)||D.endsWith(`.json`)||D.trim().indexOf(`{`)!==0);if(r){console.warn(`[OimPlayer] Lottie animation must be a valid JSON string. External URLs are not supported.`);return}let i=n.loadAnimation({container:t,renderer:`svg`,loop:!o.disableAnimations,autoplay:!o.disableAnimations&&!o._paused,path:r?D.trim():void 0,animationData:r?void 0:JSON.parse(D)});o.disableAnimations&&i.goToAndStop(0,!0),o._lottieInstances.push({slotId:String(e.id),inst:i})}).catch(function(e){console.error(`[OIM Player] Error loading local Lottie bundle. Hiding dynamic element:`,e),A.style.display=`none`}):(console.warn(`[OIM Player] Lottie animation slot ${e.id} detected but allowLottie option is false. Hiding dynamic element.`),A.style.display=`none`)}else if(C){M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,N.style.display=`flex`,N.style.alignItems=`center`,N.style.justifyContent=`center`,N.style.pointerEvents=`none`;let t=ua(r,o.lang,b),n=dt(t.fontFamily,o.embeddedFontFamilies);n&&(t.fontFamily=n.replace(/, sans-serif$/,``));let i=da(t,String(e.id));if(typeof DOMParser<`u`){let e=new DOMParser().parseFromString(i,`image/svg+xml`).documentElement;e&&N.appendChild(e)}else N.innerHTML=i}else if(ee){let e=N;if(ce){let t=document.createElement(`div`);t.className=`oim-slot-text`,N.appendChild(t),e=t}let t=Ce(D);if(typeof DOMParser<`u`){let n=new DOMParser().parseFromString(t,`text/html`);for(;n.body.firstChild;)e.appendChild(n.body.firstChild)}else{let n=document.createElement(`div`);for(n.innerHTML=t;n.firstChild;)e.appendChild(n.firstChild)}}else{let e=N;if(ce){let t=document.createElement(`div`);t.className=`oim-slot-text`,N.appendChild(t),e=t}let n=r.animations?.find(e=>e.on===`load`&&e.preset),i=n?.params??{},a={type:n?.preset,speed:i.speed,delay:n?.delay?+(n.delay/1e3).toFixed(6):void 0,cursor:i.cursor,intensity:i.intensity},s=a.type,c=(t===`text`?r.text:void 0)??{};ya(e,c.highlight);let l=c.marks,u=xt(D,l);s===`wave-chars`&&!o.disableAnimations?(ha(o.host.shadowRoot),fa(e,u,typeof a.speed==`number`?a.speed:.05,typeof a.delay==`number`?a.delay:0)):jt(s)&&!o.disableAnimations?(ma(o.host.shadowRoot,s),pa(e,u,s,a.speed,a.delay)):s===`typewriter`&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,_a(e,u,a.speed,a.delay,a.cursor)):s?.startsWith(`glitch-`)&&!o.disableAnimations?o._bornPausedIfNeeded(o._textAnimations,va(e,u,s,a.speed,a.delay,a.intensity)):ba(e,D,c.dropCap,l)||St(e,D,l)}M.appendChild(N);let le=r.motion?.loop,I=le?{enabled:!0,speedPxSec:le.speedPxSec,direction:le.direction,mirror:le.mirror??!0,pauseOnHover:!!le.pauseOnHover}:void 0,ue=!1;if(I&&I.enabled){let e=I.infinite||{},t=e.enabled===!1||o._isStill()?0:I.speedPxSec===void 0?e.speedPxSec===void 0?e.speed_px_sec===void 0?I.mode===`infinite_horizontal`?I.speed===void 0?20:I.speed:0:e.speed_px_sec:e.speedPxSec:I.speedPxSec,n=I.direction||e.direction||`right_to_left`,i=I.mirror===void 0?I.seamlessTile===void 0?e.mirror===void 0?e.seamlessTile===void 0?e.seamless_tile===void 0||!!e.seamless_tile:!!e.seamlessTile:!!e.mirror:!!I.seamlessTile:!!I.mirror,a=I.pauseOnHover===void 0?e.pauseOnHover===void 0?!!e.pause_on_hover:!!e.pauseOnHover:!!I.pauseOnHover,s=Mi({speedPxSec:Number(t)||0,direction:n,mirror:i,pauseOnHover:a},r.box.width||d||d,d);if(s.duplicate){ue=!0,Ni(o.host.shadowRoot);let e=document.createElement(`div`);e.className=`${Oi} ${ki}`;for(let[t,n]of Object.entries(s.container))e.style.setProperty(t,n);for(let t=0;t<s.copies;t++){let n=t===0?M:M.cloneNode(!0);for(let[e,t]of Object.entries(s.copy))n.style.setProperty(e,t);if(t%2==1)for(let[e,t]of Object.entries(s.secondCopy))n.style.setProperty(e,t);e.appendChild(n)}A.appendChild(e)}}ue||A.appendChild(M);let L=r.geometry?.trim,de=r.animations?.find(e=>e.on===`load`&&e.tracks?.some(e=>e.property===`trimEnd`)),fe=e=>+(e*100).toFixed(6),pe=L||de?{strokeWidth:1,trimStart:fe(L?.start??0),trimEnd:fe(L?.end??1),trimDuration:de?+(de.duration/1e3).toFixed(6):0}:void 0;ee&&pe&&(pe.trimDuration&&ui(o.host.shadowRoot),di(N,pe));let R=xn(r,o.lang),me={lineHeight:r.text?.lineHeight},he=R?.fontSize??`16px`,ge=R?.fontFamily,_e=T?`none`:R?.maxWidth??(r.type===`text`&&!E?`80%`:`none`),ve=C||!E&&!O&&t!==`lottie`&&D.trim()!==``;if(ge&&ve){let e=Oe(ge),t=dt(e,o.embeddedFontFamilies);A.style.setProperty(`font-family`,t||e)}if(te=ue||k===`left`?`flex-start`:k===`right`?`flex-end`:`center`,A.style.maxWidth=_e,A.style.fontSize=he,A.style.lineHeight=String(Zi(me)),R)for(let e of[`fontWeight`,`fontStyle`,`letterSpacing`,`textTransform`,`textDecoration`])R[e]&&(A.style[e]=R[e]);if(t===`text`&&F){let e=`kind`in F&&F.kind===`color`?y.css(F.value):``;e&&A.style.setProperty(`color`,e)}if(P){if(ce){M.style.position=`absolute`,M.style.top=`0`,M.style.left=`0`,M.style.right=`0`,M.style.bottom=`0`,M.style.width=`100%`,M.style.height=`100%`,N.style.width=`100%`,N.style.height=`100%`,N.style.boxSizing=`border-box`,N.style.setProperty(`padding-right`,`0.25em`,`important`),N.style.display=`flex`,N.style.flexDirection=`column`,N.style.justifyContent=`center`,N.style.alignItems=te,Object.assign(N.style,P);let e=$i(Zi(me));e>0&&(A.style.setProperty(`padding-top`,e+`em`,`important`),A.style.setProperty(`padding-bottom`,e+`em`,`important`))}else if(Object.assign(A.style,P),oe){let e=$i(Zi(me));e>0&&(A.style.setProperty(`padding-top`,e+`em`,`important`),A.style.setProperty(`padding-bottom`,e+`em`,`important`))}}A.style.textAlign=k,A.style.display=`flex`,A.style.flexDirection=`column`,A.style.justifyContent=`center`,A.style.alignItems=te,A.style.opacity=`0`,A.style.transition=`opacity 0.3s ease`,A.style.whiteSpace=`pre-line`,A.style.overflow=ea({isText:t===`text`,isParallaxGroup:!!r.motion?.loop||!!_.get(e.id)?.some(e=>v.get(String(e))?.motion?.loop),hasFilterOrShadow:!1,hasKeyframes:!!r.animations?.some(Oa)});let ye=o.metadata?.canvas_width||o.metadata?.canvasWidth||(o.metadata?.canvas?o.metadata.canvas.natural_width:800);x&&ta(A),a.width!==void 0&&a.height!==void 0?(A.style.width=(a.width/ye*100).toFixed(4)+`cqw`,A.style.height=(a.height/ye*100).toFixed(4)+`cqw`):(A.style.width=`max-content`,A.style.height=`auto`);let z=r.fills?.[0],B=z&&`kind`in z?z.kind:void 0,V=cn(r.type===`shape`?r.geometry:void 0),be=(t===`svg`||O)&&!S&&(B===`pattern`||B===`generative`),xe=w&&!S&&B===`image`?String(z.src||``).trim():``,Se=!!xe&&we(xe),Te=be||(t===`geo`||t===`shape`)&&!S&&(Se||B===`gradient`||B===`generative`||B===`pattern`&&!T),Ee=r.fills?.[1],De=B===`image`&&Ee?.kind===`color`?y.css(Ee.value):void 0,H=B===`color`?y.css(z.value):Se?void 0:De;H&&w&&!S&&t!==`text`&&!C&&!Te&&A.style.setProperty(`background-color`,H);let ke=t===`svg`||O||r.geometry?.kind===`paths`||w&&!!V.silhouette,Ae=v.get(String(e.id)),U=Ae?.strokes?.find(e=>!e.align&&`kind`in e.paint&&e.paint.kind===`color`&&typeof e.width==`number`),W=Ae?.type===`text`?{color:``,width:0,style:void 0}:U?{color:y.css(U.paint.value)||``,width:U.width,style:U.style}:{color:``,width:0,style:void 0};W.color&&W.width&&!S&&!ke&&A.style.setProperty(`border`,`${W.width}px ${W.style||`solid`} ${W.color}`),xe&&!Se&&console.warn(`[OimPlayer] Fill image not embedded in the file (network URLs are not loaded), slot:`,e.id);let G=w&&!S?V.silhouette:null;if(G){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`viewBox`,G.viewBox),t.setAttribute(`preserveAspectRatio`,`none`),t.style.position=`absolute`,t.style.left=`0`,t.style.top=`0`,t.style.width=`100%`,t.style.height=`100%`,t.style.display=`block`,t.style.overflow=`visible`;let n=document.createElementNS(e,G.points?`polygon`:`path`);G.points?n.setAttribute(`points`,G.points):n.setAttribute(`d`,G.d);let r=V.fillable,i=r&&Se;n.setAttribute(`fill`,r&&H&&!Te&&!i?H:`none`);let a=U?W.width:0,o=U?W.color:``;a&&o&&(n.setAttribute(`stroke`,o),n.setAttribute(`stroke-width`,String(a)),n.setAttribute(`vector-effect`,`non-scaling-stroke`),n.setAttribute(`stroke-linejoin`,`round`),n.setAttribute(`stroke-linecap`,`round`),W.style===`dashed`?n.setAttribute(`stroke-dasharray`,`6,4`):W.style===`dotted`&&n.setAttribute(`stroke-dasharray`,`2,3`)),t.appendChild(n),A.appendChild(t),i&&Wi(A,z,{d:G.d??`M `+G.points.split(` `).join(` L `)+` Z`,viewBox:G.viewBox},xe,De),A.style.backgroundColor=`transparent`,A.style.padding=`0`,A.style.overflow=`visible`}else w&&!S&&V.round&&(A.style.borderRadius=`50%`);if(Se&&!G){let e=typeof r.corners==`number`?r.corners:0,t=r.box.width||d,n=r.box.height||f;Wi(A,z,{d:``,viewBox:`0 0 1 1`,rect:{rx:Math.min(Math.max(e/t,0),.5),ry:Math.min(Math.max(e/n,0),.5)}},xe,De)}if(Te){let e=document.createElement(`div`);e.className=`oim-fill-layer`,e.style.position=`absolute`,e.style.left=`0`,e.style.top=`0`,e.style.width=`100%`,e.style.height=`100%`,e.style.pointerEvents=`none`,e.style.borderRadius=`inherit`;let t={...z?Er(z,{colors:y,width:r.box.width||d,height:r.box.height||f}):{},...Se&&Ee?.kind===`color`&&b(Ee.value)?{backgroundColor:b(Ee.value)}:{},...be?_r(D):hr(V.round?`circle`:V.preset,V.path?{svgPath:V.path.d,svgViewBox:V.path.viewBox}:void 0)};be&&!M.style.position&&(M.style.position=`relative`);for(let[n,r]of Object.entries(t))n.startsWith(`--`)?e.style.setProperty(n,r):e.style[n]=r;A.insertBefore(e,A.firstChild)}S&&(A.style.overflow=`visible`,A.style.display=`block`,A.style.setProperty(`padding`,`0`,`important`),A.appendChild(Ca(e,{width:d,height:f}))),(!ve&&!S||ue)&&A.style.setProperty(`padding`,`0`,`important`);let je=h.get(String(e.id)),Me=null;{let e=a;A.style.position=`absolute`;let t,n=`-50%`;if(e.width!==void 0&&e.height!==void 0){t=ue||k===`left`?`0%`:k===`right`?`-100%`:`-50%`;let n=t===`0%`?0:t===`-100%`?1:.5;A.style.left=(e.x+e.width*n).toFixed(2)+`px`,A.style.top=(e.y+e.height/2).toFixed(2)+`px`}else[t,n]=yn(e),ue&&(t=`0%`),A.style.left=e.x.toFixed(2)+`px`,A.style.top=e.y.toFixed(2)+`px`;A.style.setProperty(`--oim-tx`,t),A.style.setProperty(`--oim-ty`,n),A.style.setProperty(`--oim-rot`,(e.rotation||0)+`deg`),Me={x:e.x,y:e.y,width:e.width??0,height:e.height??0}}let K=Gi(e)&&!T&&Me?Ji(Me,{width:d,height:f}):null;T&&(A.style.left=`0`,A.style.top=`0`,A.style.width=`100%`,A.style.height=`100%`,A.style.maxWidth=`none`,A.style.maxHeight=`none`,A.style.padding=`0`,A.style.boxSizing=`border-box`,A.style.setProperty(`--oim-tx`,`0%`),A.style.setProperty(`--oim-ty`,`0%`),A.style.setProperty(`--oim-rot`,`0deg`));let Ne=v.get(String(e.id))?.type===`text`?(()=>{let t=v.get(String(e.id))?.strokes?.[0];return t&&`kind`in t.paint&&t.paint.kind===`color`&&typeof t.width==`number`?{width:t.width,color:y.css(t.paint.value)||``}:void 0})():void 0;Ne&&(A.style.setProperty(`-webkit-text-stroke`,Ne.width+`px `+Ne.color),A.style.setProperty(`paint-order`,`stroke fill`));let Pe=e=>{let n=Di[e.preset];if(n){if(t===`text`||t===`artistic-text`){let t=e.scale||1,i=n.tileWidth*t,a=n.tileHeight*t,o=r.fills?.[0],s=o?.kind===`color`&&y.css(o.value)||`#18181b`,c=o?.kind===`gradient`?Er(o,{colors:y}).backgroundImage:void 0,l=e.blend||n.defaultBlend||`overlay`;c?(A.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), `+c,A.style.backgroundRepeat=`repeat, no-repeat`,A.style.backgroundSize=i+`px `+a+`px, 100% 100%`,A.style.backgroundBlendMode=l+`, normal`):(A.style.backgroundImage=`url("`+n.getDataUri(e.color,e.intensity)+`"), linear-gradient(`+s+`, `+s+`)`,A.style.backgroundRepeat=`repeat, no-repeat`,A.style.backgroundSize=i+`px `+a+`px, 100% 100%`,A.style.backgroundBlendMode=l),A.style.webkitBackgroundClip=`text`,A.style.backgroundClip=`text`,A.style.webkitTextFillColor=`transparent`,A.style.color=`transparent`;let u=$i(Zi(me));u>0&&(A.style.setProperty(`padding-top`,u+`em`,`important`),A.style.setProperty(`padding-bottom`,u+`em`,`important`))}else{let r=document.createElement(`div`);r.className=`oim-effect-texture`,r.style.position=`absolute`,r.style.inset=`0`,r.style.pointerEvents=`none`,r.style.borderRadius=`inherit`,r.style.mixBlendMode=e.blend||n.defaultBlend||`overlay`;let i=(e.intensity===void 0?n.defaultIntensity:e.intensity)/100;r.style.opacity=String(i);let a=e.scale||1,o=n.tileWidth*a,s=n.tileHeight*a;r.style.backgroundImage=`url("${n.getDataUri(e.color,e.intensity)}")`,r.style.backgroundRepeat=`repeat`,r.style.backgroundSize=`${o}px ${s}px`,r.style.zIndex=`1`;let c=Et({type:t,svg:O?D:void 0,image:E?D.trim():void 0,fit:u?.fit});if(c){let e=r.style;e.maskImage=e.webkitMaskImage=c.image,e.maskSize=e.webkitMaskSize=c.size,e.maskRepeat=e.webkitMaskRepeat=`no-repeat`,e.maskPosition=e.webkitMaskPosition=`center`}A.appendChild(r)}}},Fe=e=>{A.style.filter=(A.style.filter?A.style.filter+` `:``)+e},Ie=e=>{A.style.textShadow=A.style.textShadow?A.style.textShadow+`, `+e:e},Le=r.effects;for(let n of Le??[])if(n.kind===`blur`)Fe(`blur(`+n.radius+`px)`);else if(n.kind===`glow`){let e=y.css(n.color)||`#f59e0b`,r=n.radius;t===`text`?Ie(`0px 0px `+r*.4+`px `+e+`, 0px 0px `+r+`px `+e):Fe(`drop-shadow(0px 0px `+r*.4+`px `+e+`) drop-shadow(0px 0px `+r+`px `+e+`)`)}else if(n.kind===`shadow`){let e=n.color&&typeof n.color==`object`?n.color:void 0,r=n.opacity===void 0?y.css(n.color??`#000000`)||`#000000`:zi({shadowColor:e?e.fallback:n.color,shadowOpacity:n.opacity*100,shadowColorRole:e?.var}),i=(n.x||0)+`px `+(n.y||0)+`px `+(n.blur||0)+`px `+r;t===`text`?Ie(i):Fe(`drop-shadow(`+i+`)`)}else if(n.kind===`grain`){if(!hi.includes(t))continue;let r=`oim-grain-`+String(e.id).replace(/[^A-Za-z0-9_-]/g,`_`);o._defineLayerGrain(r,n),Fe(`url(#`+r+`)`)}else n.kind===`texture`&&Pe({...n,color:n.color===void 0?void 0:b(n.color)});let Re=r.opacity??1;if(A.dataset.oimOpacity=String(Re),A.style.setProperty(`--oim-target-opacity`,String(Re)),r.visible===!1&&(A.style.display=`none`,A.style.opacity=`0`,A.style.pointerEvents=`none`),t===`filter`){let t=r.effects?.find(e=>e.kind===`backdrop`),n=Ar(Sn(t)),i=t?.preset===`duotone`?`url(#`+Lr(e)+`)`:n;i&&(A.style.backdropFilter=i,A.style.webkitBackdropFilter=i)}if(t===`container`){let e=r.box.width||300,t=r.box.height||200,n=r.fills?.[0],i=n?Er(n,{colors:y,width:e,height:t}):{};Object.assign(A.style,i)}let q=r.corners;if(q!==void 0&&!V.round&&(A.style.borderRadius=(Array.isArray(q)?q:[q]).map(e=>e+`px`).join(` `)),K){A.style.left=K.left,A.style.top=K.top,A.style.width=K.width,A.style.height=K.height,A.style.maxWidth=`none`,A.style.maxHeight=`none`,A.style.setProperty(`padding`,`0`,`important`),A.style.transformOrigin=K.transformOrigin,A.style.pointerEvents=K.pointerEvents,A.style.setProperty(`--oim-tx`,`0%`),A.style.setProperty(`--oim-ty`,`0%`),A.style.setProperty(`--oim-scale`,`1`);let t=!!_.get(e.id)?.some(e=>v.get(String(e))?.motion?.loop);A.style.overflow=t?`hidden`:`visible`,c(M,`data-oim-group`,`data-oim-grupo`,String(e.id)),M.style.transformOrigin=K.transformOrigin,M.style.height=`100%`,M.style.overflow=`visible`}let ze=r.animations?.find(Oa),Be=r.animations?.find(e=>e.on===`loop`&&e.preset),Ve=r.animations?.find(e=>e.on===`hover`&&e.preset),He=e=>e?+(e/1e3).toFixed(6):0,Ue=ze||Be||Ve?{frames:ze?Ma(ze.tracks):void 0,duration:ze?He(ze.duration):0,trigger:ze?.on===`action`?`action`:void 0,loop:Be?.preset,loopDuration:He(Be?.duration),loopDelay:He(Be?.delay),hover:Ve?.preset}:void 0;if(Ue&&!o.disableAnimations){let t=Ue;if(t.frames&&typeof M.animate==`function`){let n=t.duration;{let r=t.frames,i=t.trigger===`action`,a=M.animate(r,{duration:n*1e3,iterations:i?1:1/0,easing:`linear`,...i?{fill:`both`}:{}});i?(a.pause(),a.currentTime=0):(o._paused&&a.pause(),o._animations.push(a)),o._timelines.set(String(e.id),a)}}t.loop&&t.loop!==`none`&&t.loop!==`custom`&&(M.classList.add(`oim-loop-`+t.loop),t.loopDuration&&M.style.setProperty(`--oim-loop-duration`,t.loopDuration+`s`),t.loopDelay&&M.style.setProperty(`--oim-loop-delay`,t.loopDelay+`s`)),t.hover&&t.hover!==`none`&&t.hover!==`custom`&&N.classList.add(`oim-hover-`+t.hover)}let We=r.animations?.find(e=>e.on===`hover`&&e.tracks),Ge=e=>{let t=We?.tracks?.find(t=>t.property===e)?.keyframes;return t?t[t.length-1].v:void 0},Ke=e=>(r.interactions??[]).filter(t=>t.on===e).flatMap(e=>e.actions),qe={hover:{scale:Ge(`scale`),rotation:Ge(`rotation`),opacity:Ge(`opacity`)===void 0?void 0:+(Ge(`opacity`)*100).toFixed(6),transitionDuration:We&&We.duration>0?+(We.duration/1e3).toFixed(6):void 0,actions:Ke(`hover`)},active:{actions:Ke(`press`)}};if(!o.disableActions&&(We||r.interactions?.length)){let t={},n={},r=new Set;na(A,qe,function(e,t){o.queueUpdate(e,t)},{run:function(i,a){let s=o.host.shadowRoot;if(!s)return;let c=new CustomEvent(`oim:action`,{cancelable:!0,detail:{slot:e.id,name:e.name,trigger:a||`unknown`,targets:i.map(function(e){return e.target}),types:i.map(function(e){return e.type})}});if(o.host.dispatchEvent(c),c.defaultPrevented)return;i.forEach(function(e){e.type===`play`&&e.target&&o._playTimeline(String(e.target))});let l={};i.forEach(function(i){if(!i.target||i.type===`play`)return;let a=s.querySelector(`[data-slot-id="`+i.target+`"]`);!a&&!r.has(i.target)&&(r.add(i.target),console.warn(`[OimPlayer] The slot "`+e.id+`" has an action "`+i.type+`" aimed at "`+i.target+`", which does not exist in this file. It does nothing.`));let o=!a||a.style.display!==`none`&&a.style.opacity!==`0`;if(l[i.target]=o,t[i.target]===void 0&&(t[i.target]=o),i.type===`setText`&&n[i.target]===void 0){let e=a?a.querySelector(`.oim-slot-hover-wrap`):null;n[i.target]=e?e.textContent||``:a&&a.textContent||``}});let u=aa(i,l);for(let[e,t]of Object.entries(u.visibility)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);n&&(t?o._showSlotElement(n):o._hideSlotElement(n))}for(let[e,t]of Object.entries(u.texts)){let n=s.querySelector(`[data-slot-id="`+e+`"]`);if(!n)continue;let r=n.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:n.textContent=t}},revert:function(e){let r=o.host.shadowRoot;r&&e.forEach(function(e){if(!e.target||e.type===`play`)return;let i=r.querySelector(`[data-slot-id="`+e.target+`"]`);if(i){if(t[e.target]!==void 0){let n=t[e.target];delete t[e.target],n?o._showSlotElement(i):o._hideSlotElement(i)}if(n[e.target]!==void 0){let t=n[e.target];delete n[e.target];let r=i.querySelector(`.oim-slot-hover-wrap`);r?r.textContent=t:i.textContent=t}}})}},function(e,t){o._activeTouchSlot&&o._activeTouchSlot.el!==e&&o._activeTouchSlot.leave(),o._activeTouchSlot={el:e,leave:t}})}C&&(A.style.backgroundColor=`transparent`,A.style.overflow=`visible`,A.style.setProperty(`padding`,`0`,`important`));let J=Vi(a.flipX,a.flipY);if(J){let e=document.createElement(`div`);for(e.setAttribute(`data-oim-flip`,``),e.style.width=`100%`,e.style.height=`100%`,e.style.transformOrigin=`50% 50%`,e.style.transform=`scale(`+J[0]+`, `+J[1]+`)`;A.firstChild;)e.appendChild(A.firstChild);A.appendChild(e)}return{slotEl:A,zoneId:je,slot:e}}),S=await Promise.all(x),C=[],w=new Set;s.forEach(function(e,t){let n=e&&e.id!==void 0&&e.id!==null&&e.id!==``?String(e.id):``,r;n?w.has(n)?(console.warn(`[OimPlayer] Duplicate slot id "`+n+`" at index `+t+`; rendering it unkeyed and in stack order.`),r=`__oim-dup-`+n+`-`+t):r=n:(console.warn(`[OimPlayer] Slot #`+t+` has no id; rendering it unkeyed and in stack order.`,e),r=`__oim-unkeyed-`+t),w.add(r),C.push(r)});let T=new Map;S.forEach(function(e,t){if(!e)return;let n=e.slotEl,r=e.zoneId;r&&m[r]?m[r].appendChild(n):T.set(C[t],n)});let E=[];s.forEach(function(e,t){let n=h.get(String(e.id));n&&m[n]||E.push({id:C[t],type:e.type,style:e.style||{},duotone:e.type===`filter`&&v.get(String(e.id))?.effects?.some(e=>e.kind===`backdrop`&&e.preset===`duotone`),position:e.position,width_px:e.width_px,height_px:e.height_px})});let D=Vr(E),O=E.some(function(e){return e.type===`mask`}),ee=E.some(function(e){return!!e.duotone});if((O||ee)&&p.appendChild(wa(E,{width:d,height:f})),D.forEach(function(e){Ta(e,p,T)}),n?S.forEach(function(e){if(!e)return;let t=e.slotEl.getAttribute(`data-slot-id`)||``,n=r.querySelector(`[data-slot-id="`+t+`"]`);if(n&&n.parentNode){let t=n.querySelectorAll(`[data-oim-group] > [data-slot-id], :scope > [data-slot-id]`);for(let n=0;n<t.length;n++)e.slotEl.appendChild(t[n]);n.parentNode.replaceChild(e.slotEl,n)}}):(r.innerHTML=``,r.appendChild(p)),_.size>0){let e=function(e){for(let t in m)if(m[t]&&m[t].contains(e))return!0;return!1};_.forEach(function(t,n){let i=r.querySelector(`[data-slot-id="`+n+`"]`);if(!i||e(i))return;let a=i.querySelector(`[data-oim-group="`+n+`"]`)||i;t.forEach(function(t){let n=r.querySelector(`[data-slot-id="`+t+`"]`);n&&!e(n)&&a.appendChild(n)})})}try{await Promise.all(u)}catch(e){console.warn(`[OIM Player] Font load fallback activado.`,e)}r.querySelectorAll(`.oim-slot`).forEach(function(e){e.style.opacity=e.dataset.oimOpacity===void 0?`1`:e.dataset.oimOpacity}),await o._mediaSettled(r),o._buildA11y(),o.updateViewportSize(),o.updateScale(),o._viewport&&(o._viewport.classList.add(`oim-viewport--ready`),o._revealed=!0)}_defineLayerGrain(e,t){let n=this._viewport||this._overlay;if(!n||typeof DOMParser>`u`)return;let r=n.querySelector(`:scope > svg.oim-grain-defs > defs`);if(!r){let e=`http://www.w3.org/2000/svg`,t=document.createElementNS(e,`svg`);t.setAttribute(`class`,`oim-grain-defs`),t.setAttribute(`width`,`0`),t.setAttribute(`height`,`0`),t.setAttribute(`aria-hidden`,`true`),t.setAttribute(`style`,`position:absolute;pointer-events:none`),r=document.createElementNS(e,`defs`),t.appendChild(r),n.appendChild(t)}let i=r.querySelector(`#`+e);i&&i.remove();let a=vi(e,{intensity:t.intensity,size:t.size,blend:t.blend}),o=new DOMParser().parseFromString(`<svg xmlns="http://www.w3.org/2000/svg"><defs>`+a+`</defs></svg>`,`image/svg+xml`).querySelector(`filter`);o&&r.appendChild(document.importNode(o,!0))}_revealed=!1;_mediaSettled(e){let t=[];e.querySelectorAll(`img`).forEach(function(e){typeof e.decode==`function`&&e.getAttribute(`src`)&&t.push(e.decode().catch(function(){}))}),(this._lottieInstances||[]).forEach(function(e){let n=e.inst;n&&!n.isLoaded&&typeof n.addEventListener==`function`&&t.push(new Promise(function(e){n.addEventListener(`DOMLoaded`,e),n.addEventListener(`data_failed`,e)}))});let n=new Promise(function(e){setTimeout(e,Ea)});return Promise.race([Promise.all(t),n]).then(()=>new Promise(function(e){typeof requestAnimationFrame==`function`?requestAnimationFrame(function(){requestAnimationFrame(function(){e()})}):e()}))}_pendingDOMUpdates=new Map;_isUpdateScheduled=!1;_updateCallbacks=[];queueUpdate(e,t,n){let r={};for(let[e,n]of Object.entries(t))(typeof n==`string`||n===void 0)&&(r[e]=n);this._pendingDOMUpdates.set(e,{...this._pendingDOMUpdates.get(e)||{},...r}),n&&this._updateCallbacks.push(n),this._isUpdateScheduled||(this._isUpdateScheduled=!0,requestAnimationFrame(()=>this._flushDOMUpdates()))}_flushDOMUpdates(){this._pendingDOMUpdates.forEach((e,t)=>{for(let[n,r]of Object.entries(e))n.startsWith(`--`)?r===``||r==null?t.style.removeProperty(n):t.style.setProperty(n,String(r)):t.style[n]=r}),this._pendingDOMUpdates.clear(),this._isUpdateScheduled=!1;let e=this._updateCallbacks;this._updateCallbacks=[],e.forEach(e=>{try{e()}catch(e){console.error(e)}})}_hideSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`none`,opacity:`0`,pointerEvents:`none`}):this.queueUpdate(e,{pointerEvents:`none`},()=>{this._runReveal(e,!1,()=>this.queueUpdate(e,{display:`none`}))})}_showSlotElement(e){this.disableAnimations?this.queueUpdate(e,{display:`flex`,opacity:`1`,pointerEvents:`auto`}):this.queueUpdate(e,{display:`flex`,pointerEvents:`auto`},()=>this._runReveal(e,!0))}_playTimeline(e){let t=this._timelines.get(e);t?(t.currentTime=0,this._paused||t.play()):!this.disableAnimations&&!this._warnedPlay.has(e)&&(this._warnedPlay.add(e),console.warn(`[OimPlayer] play: no animation`,e))}_runReveal(e,t,n){let r=this._revealAnims.get(e),i=r?getComputedStyle(e):void 0;r&&(r.cancel(),this._revealAnims.delete(e)),e.style.opacity=t?`1`:`0`;let a=ii(e._oimReveal,t);if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches||a.duration===0||typeof e.animate!=`function`){n?.();return}let o=ri(a.effect,t);if(i)for(let e of[`opacity`,`translate`,`scale`]){let t=i[e];t&&t!==`none`&&(o[0][e]=t)}let s=e.animate(o,{duration:a.duration,easing:a.easing,fill:`both`});this._paused&&s.pause(),this._revealAnims.set(e,s),s.onfinish=()=>{this._revealAnims.delete(e),s.cancel(),n?.()}}_buildA11y(){let e=this._viewport;if(!e||!this.metadata)return;let t=this.metadata,n=t.lang&&t.lang[0]||t.languages&&t.languages[0]||this.lang,r=this._a11yHidden,i=this._a11yShown,a=Li((t.slots||t.elements||[]).filter(function(e){return!r.has(String(e&&e.id))}).map(function(e){return i.has(String(e&&e.id))?Object.assign({},e,{style:Object.assign({},e.style,{isVisible:!0})}):e}),this.lang,n,!this.disableActions);this._overlay&&this._overlay.setAttribute(`aria-hidden`,`true`),e.setAttribute(`role`,`figure`),e.setAttribute(`aria-label`,Ri(t,a,this.lang,n));let o=e.querySelector(`.oim-a11y`);o||(o=document.createElement(`div`),o.className=`oim-a11y`,o.style.cssText=`position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap`,e.appendChild(o)),o.textContent=``;let s=this;a.forEach(function(e){let t;if(e.type===`text`)t=document.createElement(`p`),t.setAttribute(`lang`,e.lang),t.textContent=e.text;else if(e.type===`image`)t=document.createElement(`span`),t.setAttribute(`role`,`img`),t.setAttribute(`aria-label`,e.label);else{t=document.createElement(`button`),t.setAttribute(`type`,`button`),t.textContent=e.label;let n=function(){let t=s._overlay&&s._overlay.querySelector(`[data-slot-id="`+CSS.escape(e.slotId)+`"]`);t&&t.click()};t.addEventListener(`click`,n),t.addEventListener(`keydown`,function(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())})}o.appendChild(t)})}_a11yHidden=new Set;_a11yShown=new Set;executeToggleState(e){if(!e)return;let t=this.host.shadowRoot;if(!t)return;let n=this,r=e.hide_slots||[];r.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._hideSlotElement(r)});let i=e.show_slots||[];i.forEach(function(e){let r=t.querySelector(`[data-slot-id="`+e+`"]`);r&&n._showSlotElement(r)}),r.forEach(function(e){n._a11yHidden.add(String(e)),n._a11yShown.delete(String(e))}),i.forEach(function(e){n._a11yShown.add(String(e)),n._a11yHidden.delete(String(e))}),this._buildA11y()}_activeTouchSlot=null;clearSlots(){this._activeTouchSlot&&=null;let e=this._overlay;e&&(e.replaceChildren?e.replaceChildren():e.innerHTML=``)}setLang(e){if(this.lang===e)return;let t=this.lang;this.lang=e,this.host.setAttribute(`lang`,e),this._buildA11y();let n=this._classifyLangChange(t,e);(n.styleOnly.size>0||n.content.size>0)&&(this._prefersLessMotion()||this._isLowTierOrMobile()?this._switchWithFade(n):this._switchWithBlur(n)),this.host.dispatchEvent(new CustomEvent(`oim:langchange`,{detail:{lang:e}}))}_isLowTierOrMobile(){let e=this.host;if(e&&typeof e.getAttribute==`function`){let t=e.getAttribute(`tier`)||e.getAttribute(`quality`);if(t===`low`)return!0;if(t===`high`)return!1}return this._deviceProfile.isMobile||this._deviceProfile.tier===`low`}_prefersLessMotion(){try{return typeof window<`u`&&typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}catch{return!1}}_switchWithBlur(e){let t=this._viewport,n=this;t?(t.style.transition=`filter 0.18s ease-out`,t.style.filter=`blur(14px)`,setTimeout(function(){let r=n._applyLangChange(e),i=new Promise(function(e){setTimeout(e,600)});Promise.race([r||Promise.resolve(),i]).then(function(){t.style.transition=`filter 0.32s ease-in-out`,t.style.filter=`none`})},180)):this._applyLangChange(e)}_switchWithFade(e){let t=this.host.shadowRoot,n=this,r=new Set([...e.styleOnly,...e.content]),i=[];t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&!/opacity/i.test(n.style.animationName||``)&&i.push(n)}),i.forEach(function(e){e.style.transition=`opacity 0.12s linear`,e.style.opacity=`0`}),setTimeout(function(){n._applyLangChange(e),t&&r.forEach(function(e){let n=t.querySelector(`[data-slot-id="`+e+`"]`);n&&(n.style.opacity=n.dataset.oimOpacity===void 0?`1`:n.dataset.oimOpacity)})},120)}_classifyLangChange(e,t){let n=new Set,r=new Set;return this.metadata&&(this.metadata.slots||this.metadata.elements||[]).forEach(function(i){if(!i||i.id===void 0||i.id===null)return;let a=hn(i,e,t);a===`content`?r.add(String(i.id)):a===`style-only`&&n.add(String(i.id)),Array.isArray(i.languages)&&!i.languages.includes(`*`)&&i.languages.includes(e)!==i.languages.includes(t)&&n.add(String(i.id))}),{styleOnly:n,content:r}}_applyLangChange(e){let t=this.host.shadowRoot;if(t&&e.styleOnly.size>0&&this.metadata){let n=this.metadata.slots||this.metadata.elements||[],r=this;n.forEach(function(n){if(!n||!e.styleOnly.has(String(n.id)))return;let i=t.querySelector(`[data-slot-id="`+n.id+`"]`);if(!i)return;Array.isArray(n.languages)&&!n.languages.includes(`*`)&&(i.style.display=n.languages.includes(r.lang)?``:`none`);let a=mn(n,r.lang),o=n.type===`text`?xn(_n(r.metadata).get(String(n.id)),r.lang):void 0;i.style.fontSize=o?.fontSize??a.size,i.style.maxWidth=o?.maxWidth??a.maxWidthValue})}return e.content.size>0?this.renderSlots({onlyIds:e.content}):null}play(){this._paused=!1,this._isStill()||(this._animations.forEach(function(e){try{e.play()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.play()}catch{}}),this._textAnimations.forEach(function(e){e.play()}),this._revealAnims.forEach(function(e){e.play()}),this._heldTimelines.forEach(function(e){e.play()}),this._heldTimelines.clear())}pause(){this._paused=!0,this._textAnimations.forEach(function(e){e.pause()}),this._revealAnims.forEach(function(e){e.pause()});let e=this._heldTimelines;this._timelines.forEach(function(t){t.playState===`running`&&t.effect?.getTiming().iterations!==1/0&&(t.pause(),e.add(t))}),this._animations.forEach(function(e){try{e.pause()}catch{}}),this._lottieInstances&&this._lottieInstances.forEach(function(e){try{e.inst.pause()}catch{}})}_bornPausedIfNeeded(e,t){this._paused&&t.pause(),e.push(t)}_destroyLottiesIn(e){if(!this._lottieInstances)return;let t=[];this._lottieInstances.forEach(function(n){if(e.has(n.slotId))try{n.inst.destroy()}catch{}else t.push(n)}),this._lottieInstances=t}};function Oa(e){return(e.on===`loop`||e.on===`action`)&&!!e.tracks&&e.tracks.some(e=>ka[e.property]!==void 0)}var ka={x:0,y:0,rotation:0,scale:1,opacity:1,blur:0},Aa=[`x`,`y`,`rotation`,`scale`];function ja(e,t,n){if(!e)return n;let r=e.keyframes,i=r.find(e=>e.t===t);if(i)return i.v;let a=r.findIndex(e=>e.t>t);if(a<=0)return a===0?r[0].v:r[r.length-1].v;let o=r[a-1],s=r[a];return o.v+(s.v-o.v)*(t-o.t)/(s.t-o.t)}function Ma(e){let t=t=>e.find(e=>e.property===t),n=Aa.some(e=>t(e)),r=new Map;for(let t of e)if(ka[t.property]!==void 0)for(let e of t.keyframes){let n=r.get(e.t);n||r.set(e.t,n={offset:e.t}),e.e!==void 0&&(n.easing=ti(e.e,`linear`)),t.property===`opacity`?n.opacity=e.v:t.property===`blur`?n.filter=e.v>0?`blur(`+e.v+`px)`:`none`:n.moves=!0}return[...r.values()].sort((e,t)=>e.offset-t.offset).map(function(e){let{moves:r,...i}=e;if(n&&r){let n=n=>ja(t(n),e.offset,ka[n]);i.transform=`translate(`+n(`x`)+`px, `+n(`y`)+`px) rotate(`+n(`rotation`)+`deg) scale(`+n(`scale`)+`)`}return i})}var Na=class extends Da{constructor(e,t){super();let n=t||{};this.host=e,this.lang=e.getAttribute(`lang`)||`en`,this.showControls=e.getAttribute(`show-controls`)!==`false`,this._deviceProfile=m(),this.allowZoom=n.allowZoom===!0,this.showLanguageSelector=n.showLanguageSelector!==!1,this.showSlots=n.showSlots!==!1,this.allowLottie=n.allowLottie!==!1&&e.getAttribute(`allow-lottie`)!==`false`,this.allowDynamicColors=n.allowDynamicColors!==!1&&e.getAttribute(`allow-dynamic-colors`)!==`false`;let r=o(e,n,typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches);this.disableAnimations=r.disableAnimations,this.disableActions=r.disableActions,this.dropdownBlur=n.dropdownBlur!==!1&&e.getAttribute(`dropdown-blur`)!==`false`,this.fit=n.fit||`contain`,this.align=n.align||`center`}destroy(){this.imageUrl&&URL.revokeObjectURL(this.imageUrl),this._resizeObserver&&=(this._resizeObserver.disconnect(),null),this._onFullscreenChange&&(document.removeEventListener(`fullscreenchange`,this._onFullscreenChange),document.removeEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.removeEventListener(`MSFullscreenChange`,this._onFullscreenChange)),this._lottieInstances&&=(this._lottieInstances.forEach(function(e){try{e.inst.destroy()}catch{}}),[]),this._animations.forEach(function(e){try{e.cancel()}catch{}}),this._animations=[],this._timelines.clear(),this._revealAnims.clear(),this._heldTimelines.clear(),this._textAnimations.forEach(function(e){try{e.stop()}catch{}}),this._textAnimations=[],this._onDragMove&&=(window.removeEventListener(`mousemove`,this._onDragMove),null),this._onDragEnd&&=(window.removeEventListener(`mouseup`,this._onDragEnd),null)}async load(e){let t=this.host,n=t.shadowRoot||t.attachShadow({mode:`open`});try{if(typeof e==`string`?this.imageUrl=e:(this.imageUrl&&this.imageUrl.startsWith(`blob:`)&&URL.revokeObjectURL(this.imageUrl),this.imageUrl=URL.createObjectURL(e)),t.classList.add(`oim-player-host`),t.classList.add(`oim-align-`+this.align),t.classList.add(`oim-tier-`+this._deviceProfile.tier),this._deviceProfile.isMobile&&t.classList.add(`oim-mobile`),n.innerHTML=`<div class="oim-player-viewport oim-fit-`+this.fit+`" part="viewport"><img class="oim-player-base" crossorigin="anonymous" src="`+this.imageUrl+`" alt="" aria-hidden="true" part="base" /><div class="oim-layer-overlay" aria-hidden="true" part="overlay"></div></div>`,ee(n),this._viewport=n.querySelector(`.oim-player-viewport`),this._baseImg=n.querySelector(`.oim-player-base`),this._overlay=n.querySelector(`.oim-layer-overlay`),this._stage=this.host,!this.allowDynamicColors&&this._viewport)for(let e of q)this._viewport.style.setProperty(`--oim-color-`+e,`initial`);this.applyPalette(),(this._prefersLessMotion()||this._isLowTierOrMobile())&&this._viewport&&(this._viewport.style.filter=`none`);let r=this,i=null,a=()=>{i||=requestAnimationFrame(()=>{r.updateViewportSize(),r.updateScale(),i=null})};typeof ResizeObserver<`u`&&this._viewport&&(this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeObserver=new ResizeObserver(a),this._resizeObserver.observe(this.host)),this._onFullscreenChange=a,document.addEventListener(`fullscreenchange`,this._onFullscreenChange),document.addEventListener(`webkitfullscreenchange`,this._onFullscreenChange),document.addEventListener(`mozfullscreenchange`,this._onFullscreenChange),document.addEventListener(`MSFullscreenChange`,this._onFullscreenChange);let o=this._baseImg,c=this._viewport;function l(){c&&o&&o.naturalWidth>0&&(c.style.setProperty(`--oim-ar`,o.naturalWidth+` / `+o.naturalHeight),r._baseImg=o,r.updateViewportSize(),r.updateScale(),r.metadata&&r.renderSlots())}return o&&o.complete&&o.naturalWidth>0?l():o&&(o.onload=l),this.updateViewportSize(),this.updateScale(),this._bindViewportEvents(),D.getBlob(e).then(t=>new Promise((n,i)=>{s.requestRender(r,t,e,n,i)})).catch(e=>{if(console.error(`[OimPlayer::ImageEngine::load]`,e),String(e&&e.message).indexOf(`OIM_ALTERED`)===0){n.innerHTML=`<div class="oim-player-error oim-player-refused" part="error"></div>`,ee(n);let e=n.querySelector(`.oim-player-error`);e&&(e.textContent=u(`tampered`,r.lang))}throw t.dispatchEvent(new CustomEvent(`error`,{detail:e})),e})}catch(e){console.error(`[OimPlayer::ImageEngine]`,e),n.innerHTML=`<div class="oim-player-error" part="error"></div>`;let r=n.querySelector(`.oim-player-error`);return r&&(r.textContent=u(`loadError`,this.lang)+e.message),t.dispatchEvent(new CustomEvent(`error`,{detail:e})),!1}}async _verifyMainThread(e){let t=await fe(e);if(!t.metadata)return{metadata:{slots:[]},security:`no_metadata`,announce:!1};let n=Re(t.metadata);if(n.length>0)return{refused:!0,security:`corrupt`,error:`Corrupted or tampered OIM file: `+n[0]};let r=!!(t.metadata.signature&&t.metadata.key_version),i=await Ne(t.metadata),a=Pe({isSigned:r,isSigValid:i,keyExpired:r&&i?await Fe(t.metadata):!1,metadata:t.metadata,imageHash:t.imageHash});if(Ie(a))return{refused:!0,security:a,error:Le+`: `+a};let o,s=!1;return i?a===`unsigned`||a===`expired_key`?o={slots:[],elements:[],layers:[]}:(s=!0,k(t.metadata),o=t.metadata):o={slots:[]},{metadata:o,security:a,announce:s}}async _verifyWithWorker(e){let t=typeof window<`u`?window.location.hostname:``,n=typeof window<`u`?window.location.origin:``,r;try{r=await le(e,t,n)}catch(t){return console.warn(`[OimPlayer] Web Worker unavailable or crashed (possibly blocked by CSP). Falling back to main-thread execution.`,t),this._verifyMainThread(e)}return r.success?{metadata:r.metadata,security:r.security||`unsigned`,announce:!0}:r.refused?{refused:!0,security:r.security,error:r.error}:(console.warn(`[OimPlayer] Web Worker reported execution failure. Falling back to main-thread execution.`,r.error),this._verifyMainThread(e))}async _verify(e){return typeof Worker>`u`?this._verifyMainThread(e):this._verifyWithWorker(e)}async _applyVerified(e){let t=this;if(this.metadata=structuredClone(e.metadata),this.applyPalette(),this.securityStatus=e.security,this.securityStatus===`unsigned`){try{c(this.host,`data-oim-unsigned`,`data-oim-sin-firma`)}catch{}console.warn(`[OimPlayer] Unsigned file: painting the base image only. Interactive layers need a signature.`)}if(this.securityStatus===`expired_key`){try{c(this.host,`data-oim-key-retired`,`data-oim-clave-retirada`)}catch{}console.warn(`[OimPlayer] This work was signed with a retired key. Ask the author to export it again.`)}return e.announce&&t._announceUnsupported(this.metadata),this.embeddedFontFamilies=await ut(lt(this.metadata)),this.updateViewportSize(),this.updateScale(),await this.renderSlots(),typeof document<`u`&&document.fonts&&document.fonts.ready.then(()=>{t.host&&t._overlay&&(t.updateViewportSize(),t.updateScale(),t._overlay.querySelectorAll(`.oim-slot`).forEach(e=>{let t=e.style.transition;e.style.setProperty(`transition`,`none`,`important`),e.offsetWidth,e.style.transition=t}))}),this.host.dispatchEvent(new CustomEvent(`oim:loaded`,{detail:{type:`image`,metadata:this.metadata,security:this.securityStatus}})),!0}async _executeLoad(e,t){try{let n=await D.getVerified(t??e,e=>this._verify(e));if(n.refused)throw this.securityStatus=n.security,Error(n.error);return this._applyVerified(n)}catch(e){throw console.error(`[OimPlayer::ImageEngine::_executeLoad]`,e),e}}_announceUnsupported(e){let t;try{t=rt(e,{version:$e,capabilities:et})}catch{return}if(!t.hasNotice)return;let n=it(t);try{console.warn(`[OimPlayer] `+n)}catch{}try{t.missingCapabilities&&t.missingCapabilities.length>0&&c(this.host,`data-oim-unsupported`,`data-oim-sin-soporte`,t.missingCapabilities.join(` `)),t.missingRequiredCapabilities&&t.missingRequiredCapabilities.length>0&&c(this.host,`data-oim-missing-required`,`data-oim-requeridas-faltantes`,t.missingRequiredCapabilities.join(` `)),t.versionTooOld&&t.requiredVersion&&c(this.host,`data-oim-required-version`,`data-oim-version-exigida`,t.requiredVersion),this.host.dispatchEvent(new CustomEvent(`oim:incomplete`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}})),t.cannotRender&&this.host.dispatchEvent(new CustomEvent(`oim:unsupported`,{bubbles:!0,composed:!0,detail:{message:n,mensaje:n,...t}}))}catch{}}updateScale(){if(!this._viewport)return;let e=this._viewport.offsetWidth,t=this.metadata&&this.metadata.canvas?this.metadata.canvas.natural_width||this.metadata.canvas.width:0,n=e/(this.metadata&&(this.metadata.artboardWidth||this.metadata.canvasWidth||this.metadata.canvas_width)||t||this._baseImg&&this._baseImg.naturalWidth||1080);this._viewport.style.setProperty(`--oim-fit`,n.toFixed(6))}updateViewportSize(){if(!this._viewport)return;let e=this._baseImg?this._baseImg.naturalWidth:0,t=this._baseImg?this._baseImg.naturalHeight:0;if(e===0&&this.metadata&&this.metadata.canvas&&(e=this.metadata.canvas.natural_width||this.metadata.canvas.width||1080,t=this.metadata.canvas.natural_height||this.metadata.canvas.height||1920),e===0)return;let n=this.host.offsetWidth,r=this.host.offsetHeight;if(n===0||r===0){if(!this._retryViewportSize){this._retryViewportSize=!0;let e=this;setTimeout(()=>{e._retryViewportSize=!1,e.updateViewportSize(),e.updateScale()},100)}return}let i=e/t,a=n/r,o,s;this.fit===`cover`?a>i?(o=n,s=n/i):(s=r,o=r*i):a>i?(s=r,o=r*i):(o=n,s=n/i),this._viewport.style.width=Math.round(o)+`px`,this._viewport.style.height=Math.round(s)+`px`}_bindViewportEvents(){let e=this,t=this._stage;if(!t)return;t.addEventListener(`pointerdown`,function(t){if(t.pointerType!==`mouse`&&e._activeTouchSlot&&(typeof t.composedPath==`function`?t.composedPath():[]).indexOf(e._activeTouchSlot.el)===-1){let t=e._activeTouchSlot;e._activeTouchSlot=null,t.leave()}});let n=!1,r=0,i=0,a=0,o=0;t.addEventListener(`mousedown`,function(s){e.allowZoom&&(e.zoom<=1||s.target.closest(`.oim-slot`)||(n=!0,e._viewport&&(e._viewport.style.transition=`none`),t.style.cursor=`grabbing`,r=s.clientX,i=s.clientY,a=e.panX,o=e.panY,s.preventDefault()))}),this._onDragMove=function(t){if(!n)return;let s=t.clientX-r,c=t.clientY-i;e.panX=a+s,e.panY=o+c,e._constrainPan(),e._applyViewportTransform()},window.addEventListener(`mousemove`,this._onDragMove),this._onDragEnd=function(){n&&(n=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`),t.style.cursor=e.zoom>1?`grab`:`default`)},window.addEventListener(`mouseup`,this._onDragEnd);let s=null,c=1,l=!1,u=0,d=0,f=0,p=0;t.addEventListener(`touchstart`,function(t){if(e.allowZoom){if(t.touches.length===2)s=xa(t.touches),c=e.zoom,l=!1,e._viewport&&(e._viewport.style.transition=`none`);else if(t.touches.length===1&&e.zoom>1){if(t.target.closest(`.oim-slot`))return;l=!0,u=t.touches[0].clientX,d=t.touches[0].clientY,f=e.panX,p=e.panY,e._viewport&&(e._viewport.style.transition=`none`)}}},{passive:!0}),t.addEventListener(`touchmove`,function(t){if(e.allowZoom){if(t.touches.length===2&&s!==null){let n=xa(t.touches);if(s>0){let t=n/s;e.setZoom(c*t)}}else if(t.touches.length===1&&l){let n=t.touches[0].clientX-u,r=t.touches[0].clientY-d;e.panX=f+n,e.panY=p+r,e._constrainPan(),e._applyViewportTransform()}}},{passive:!0}),t.addEventListener(`touchend`,function(){s=null,l=!1,e._viewport&&(e._viewport.style.transition=`transform 0.1s linear`)},{passive:!0}),e.allowZoom&&t.addEventListener(`wheel`,function(t){t.preventDefault(),e.setZoom(Qe(e.zoom,t.deltaY,t.deltaMode,t.ctrlKey))},{passive:!1})}_constrainPan(){let e=this.host;if(!e)return;let t=e.clientWidth,n=e.clientHeight,r=this.zoom,i=Math.max(0,t*(r-1)/2),a=Math.max(0,n*(r-1)/2);this.panX=Math.max(-i,Math.min(i,this.panX)),this.panY=Math.max(-a,Math.min(a,this.panY))}_applyViewportTransform(){this._viewport&&(this._viewport.style.transform=`translate3d(`+this.panX+`px, `+this.panY+`px, 0) scale(`+this.zoom+`)`)}setZoom(e){this.zoom=Math.max(1,Math.min(4,e)),this.zoom<=1&&(this.panX=0,this.panY=0),this._constrainPan(),this._applyViewportTransform();let t=this._stage;t&&(t.style.cursor=this.zoom>1?`grab`:`default`)}};function Pa(e,t){let n=``;if(typeof e==`string`){let t=e.indexOf(`#`),r=e.indexOf(`?`),i=t===-1?r===-1?e.length:r:t,a=e.lastIndexOf(`.`,i);a!==-1&&(n=e.substring(a+1,i).toLowerCase())}else if(e&&e.name){let t=e.name,r=t.lastIndexOf(`.`);r!==-1&&(n=t.substring(r+1).toLowerCase())}if(n===`oim`||n===`png`)return`image`;if(n===`ovm`||n===`webm`||n===`mp4`||n===`mkv`)return`video`;if(t){let e=String.fromCharCode(t[0],t[1],t[2],t[3]);if(e===`‰PNG`)return`image`;if(e===`OVM\0`||e===`Eߣ`)return`video`}return`image`}function Fa(e){if(!e)return null;let t=e.trim();if(/^data:image\//i.test(t))return t;try{let e=new URL(t,document.baseURI);return e.protocol===`http:`||e.protocol===`https:`||e.protocol===`blob:`?e.href:null}catch{return null}}var Q=Object.create(HTMLElement.prototype);function Ia(){if(typeof document>`u`||document.getElementById(`oim-player-gap`))return;let e=document.createElement(`style`);e.id=`oim-player-gap`,e.textContent=`:where(oim-player){display:block}:where(oim-player:not([data-oim-loaded])){min-height:200px}`,(document.head||document.documentElement).appendChild(e)}Q.connectedCallback=function(){Ia(),this.classList.add(`oim-player-host`),this._engine=null,this._src=this.getAttribute(`src`),this._oimOptions||={},this.hasAttribute(`fit`)&&(this._oimOptions.fit=this.getAttribute(`fit`)),this.hasAttribute(`align`)&&(this._oimOptions.align=this.getAttribute(`align`)),this.hasAttribute(`dropdown-blur`)&&(this._oimOptions.dropdownBlur=this.getAttribute(`dropdown-blur`)!==`false`),this.hasAttribute(`allow-lottie`)&&(this._oimOptions.allowLottie=this.getAttribute(`allow-lottie`)!==`false`),this.hasAttribute(`allow-dynamic-colors`)&&(this._oimOptions.allowDynamicColors=this.getAttribute(`allow-dynamic-colors`)!==`false`),this.hasAttribute(`placeholder`)&&(this._oimOptions.placeholder=this.getAttribute(`placeholder`)),this.hasAttribute(`allow-zoom`)&&(this._oimOptions.allowZoom=this.getAttribute(`allow-zoom`)===`true`),this._syncPlaceholder(),this._mqOscuro=typeof matchMedia==`function`?matchMedia(`(prefers-color-scheme: dark)`):null,this._onEsquema=()=>this._engine&&this._engine.applyPalette(),this._mqOscuro&&this._mqOscuro.addEventListener(`change`,this._onEsquema),this._replantearActividad()},Q._replantearActividad=function(){if(this._src&&this.isConnected){if(!this._observers){if(!(`IntersectionObserver`in window)){this._moveTo(`active`);return}let e=this,t=()=>e._scheduleDecision();this._observers=[new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isNear=r.isIntersecting),t()},{rootMargin:`200px`}),new IntersectionObserver(n=>{let r=n[0];r&&typeof r.isIntersecting==`boolean`&&(e._isVisible=r.isIntersecting),t()},{threshold:[0,.01]})],this._observers.forEach(e=>e.observe(this)),this._onTabChange=t,document.addEventListener(`visibilitychange`,this._onTabChange),this.getAttribute(`activate-on`)===`hover`&&(this._onPointerEnter=()=>{e._hasPointer=!0,t()},this._onPointerLeave=()=>{e._hasPointer=!1,t()},this.addEventListener(`mouseenter`,this._onPointerEnter),this.addEventListener(`mouseleave`,this._onPointerLeave))}this._scheduleDecision()}},Q._scheduleDecision=function(){if(this._activityFrame)return;let e=this;this._activityFrame=requestAnimationFrame(function(){e._activityFrame=null,e._decide()})},Q._decide=function(){if(!this._src||!this.isConnected)return;let e=typeof document<`u`&&document.visibilityState===`hidden`,t,n;if(typeof this._isNear==`boolean`||typeof this._isVisible==`boolean`){t=this._isNear??!1;let r=this._isVisible??!1;n=(t||r)&&r&&!e,t||=r}else{let r=this.getBoundingClientRect(),i=window.innerHeight||0;t=r.bottom>-200&&r.top<i+200,n=t&&!e&&r.bottom>0&&r.top<i}this.getAttribute(`activate-on`)===`hover`&&typeof matchMedia==`function`&&matchMedia(`(hover: hover)`).matches&&(n&&=!!this._hasPointer),this.getAttribute(`activate-on`)===`manual`&&(n=!1),this._moveTo(n?`active`:t?`ready`:`dormant`)},Q._moveTo=function(e){this._activityState!==e&&(this._activityState=e,e!==`dormant`&&(this._engine||this._initPlayer(),e===`active`?this.play():this.pause()))},Q._startAutoRotateLang=function(){this._stopAutoRotateLang();let e=this.getAttribute(`auto-rotate-lang`);if(!e||e===`false`||this.classList.contains(`oim-player-paused`))return;let t=parseInt(e,10);(isNaN(t)||t<=0)&&(t=3e3);let n=this;this._autoRotateIntervalId=setInterval(()=>{let e=n.getMetadata();if(!e)return;let t=e.slots||e.elements||[],r={};for(let e=0;e<t.length;e++){let n=t[e].content||{};Object.keys(n).forEach(e=>{r[e.toLowerCase()]=!0})}let i=Object.keys(r).sort();if(i.length<=1)return;let a=(n.getAttribute(`lang`)||n._engine&&n._engine.lang||`en`).toLowerCase(),o=i[(i.indexOf(a)+1)%i.length];n.setAttribute(`lang`,o)},t)},Q._stopAutoRotateLang=function(){this._autoRotateIntervalId&&=(clearInterval(this._autoRotateIntervalId),null)},Q.disconnectedCallback=function(){this._mqOscuro&&=(this._mqOscuro.removeEventListener(`change`,this._onEsquema),null),this._stopAutoRotateLang(),this._observers&&=(this._observers.forEach(e=>e.disconnect()),null),this._onTabChange&&=(document.removeEventListener(`visibilitychange`,this._onTabChange),null),this._onPointerEnter&&(this.removeEventListener(`mouseenter`,this._onPointerEnter),this.removeEventListener(`mouseleave`,this._onPointerLeave),this._onPointerEnter=null,this._onPointerLeave=null),this._activityFrame&&=(cancelAnimationFrame(this._activityFrame),null),this._isNear=null,this._isVisible=null,this._activityState=`dormant`,this._engine&&this._engine.destroy&&this._engine.destroy()},Q.attributeChangedCallback=function(e,t,n){if(e===`placeholder`&&t!==n)this._oimOptions||={},this._oimOptions.placeholder=n,this._syncPlaceholder();else if(e===`palette`&&t!==n)this._engine&&this._engine.applyPalette();else if(e===`src`&&t!==n)this._src=n,this._engine?this._initPlayer():this._replantearActividad();else if(e===`activate-on`&&t!==n)this._replantearActividad();else if(e===`lang`&&t!==n)this._engine&&this._engine.setLang&&this._engine.setLang(n);else if((e===`fit`||e===`align`)&&t!==n)this._oimOptions||={},this._oimOptions[e]=n,this._syncPlaceholder(),this._initPlayer();else if(e===`dropdown-blur`&&t!==n)this._oimOptions||={},this._oimOptions.dropdownBlur=n!==`false`,this._engine&&(this._engine.dropdownBlur=n!==`false`);else if(e===`allow-lottie`&&t!==n)this._oimOptions||={},this._oimOptions.allowLottie=n!==`false`,this._engine&&(this._engine.allowLottie=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots());else if(e===`auto-rotate-lang`&&t!==n)this._startAutoRotateLang();else if((e===`mode`||e===`disable-animations`||e===`disable-actions`)&&t!==n){if(this._engine){let e=typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches,t=o(this,this._oimOptions||{},!!e);this._engine.disableAnimations=t.disableAnimations,this._engine.disableActions=t.disableActions,this._engine.renderSlots&&this._engine.renderSlots()}}else e===`show-slots`&&t!==n&&(this._oimOptions||={},this._oimOptions.showSlots=n!==`false`,this._engine&&(this._engine.showSlots=n!==`false`,this._engine.renderSlots&&this._engine.renderSlots()))},Q._syncPlaceholder=function(){let e=this._engine||this._placeholderSettled?null:Fa(this._oimOptions&&this._oimOptions.placeholder);if(!e){this._removePlaceholder();return}let t=this.shadowRoot||this.attachShadow({mode:`open`});if(!t.querySelector(`img.oim-placeholder`)){let e=document.createElement(`style`);e.className=`oim-placeholder-style`,e.textContent=`:host{position:relative}`;let n=document.createElement(`img`);n.className=`oim-placeholder`,n.alt=``,n.decoding=`async`,n.addEventListener(`error`,()=>this._removePlaceholder()),t.append(e,n)}let n=t.querySelector(`img.oim-placeholder`),r=this._oimOptions&&this._oimOptions.fit===`cover`?`cover`:`contain`,i=this._oimOptions&&this._oimOptions.align,a=i===`top`?`center top`:i===`bottom`?`center bottom`:`center center`;n.setAttribute(`style`,`position:absolute;inset:0;width:100%;height:100%;object-fit:${r};object-position:${a}`),n.getAttribute(`src`)!==e&&n.setAttribute(`src`,e)},Q._removePlaceholder=function(){this.shadowRoot&&this.shadowRoot.querySelectorAll(`.oim-placeholder, .oim-placeholder-style`).forEach(e=>e.remove())},Q._initPlayer=function(){if(!this._src)return;this._loading=!0;let e=this,t=this._src;e._oimOptions||={},e.hasAttribute(`fit`)&&(e._oimOptions.fit=e.getAttribute(`fit`)),e.hasAttribute(`align`)&&(e._oimOptions.align=e.getAttribute(`align`)),e.hasAttribute(`dropdown-blur`)&&(e._oimOptions.dropdownBlur=e.getAttribute(`dropdown-blur`)!==`false`),e.hasAttribute(`placeholder`)&&(e._oimOptions.placeholder=e.getAttribute(`placeholder`)),e.hasAttribute(`allow-lottie`)&&(e._oimOptions.allowLottie=e.getAttribute(`allow-lottie`)!==`false`),e.hasAttribute(`allow-zoom`)&&(e._oimOptions.allowZoom=e.getAttribute(`allow-zoom`)===`true`);let n;n=t instanceof Blob?t.slice(0,16).arrayBuffer().then(e=>new Uint8Array(e)).catch(()=>null):D.sniff(t),n.then(n=>{if(!e.isConnected)return;let r=Pa(t,n);e._engine&&e._engine.destroy&&e._engine.destroy(),r===`video`&&console.warn(`[OimPlayer] Video media detected. Video support has been migrated to <ovm-player> from @oim-media/player-ovm. Falling back to ImageEngine.`),e._engine=new Na(e,e._oimOptions),e._loading=!1,e.classList.contains(`oim-player-paused`)&&e._engine.pause(),c(e,`data-oim-loaded`,`data-oim-cargado`);let i=()=>{e._placeholderSettled=!0,e._syncPlaceholder()};e._engine.load(t).then(()=>{i(),e._startAutoRotateLang()}).catch(e=>{i(),console.warn(`[OimPlayer] Engine load error during auto-rotate initialization:`,e)})})},Q._wake=function(){this._engine||this._loading||!this._src||this._initPlayer()},Q.getMetadata=function(){return this._wake(),this._engine?this._engine.metadata:null},Q.getSecurityStatus=function(){return this._wake(),this._engine?this._engine.securityStatus||`unsigned`:null},Q.setLang=function(e){this._wake(),this._engine&&this._engine.setLang&&this._engine.setLang(e)},Q.setZoom=function(e){this._engine&&this._engine.setZoom&&this._engine.setZoom(e)},Q.play=function(){this._wake(),this.classList.remove(`oim-player-paused`),this._engine&&this._engine.play&&this._engine.play(),this._startAutoRotateLang()},Q.pause=function(){this.classList.add(`oim-player-paused`),this._engine&&this._engine.pause&&this._engine.pause(),this._stopAutoRotateLang()},Q.seek=function(e){this._engine&&this._engine.seek&&this._engine.seek(e)},Q.getEngine=function(){return this._engine},Q.destroy=function(){this._engine&&this._engine.destroy&&(this._engine.destroy(),this._engine=null),this.parentNode&&this.parentNode.removeChild(this)};var La=[`src`,`placeholder`,`lang`,`activate-on`,`fit`,`align`,`dropdown-blur`,`allow-lottie`,`palette`,`auto-rotate-lang`,`disable-animations`,`disable-actions`,`mode`,`show-slots`],$;typeof customElements<`u`&&!customElements.get(`oim-player`)&&($=class extends HTMLElement{_engine=null;_src=null},$.prototype.connectedCallback=Q.connectedCallback,$.prototype.disconnectedCallback=Q.disconnectedCallback,$.prototype.attributeChangedCallback=Q.attributeChangedCallback,$.prototype.getMetadata=Q.getMetadata,$.prototype.getSecurityStatus=Q.getSecurityStatus,$.prototype.setLang=Q.setLang,$.prototype.setZoom=Q.setZoom,$.prototype.play=Q.play,$.prototype.pause=Q.pause,$.prototype.seek=Q.seek,$.prototype.getEngine=Q.getEngine,$.prototype._initPlayer=Q._initPlayer,$.prototype._syncPlaceholder=Q._syncPlaceholder,$.prototype._removePlaceholder=Q._removePlaceholder,$.prototype._replantearActividad=Q._replantearActividad,$.prototype._decide=Q._decide,$.prototype._scheduleDecision=Q._scheduleDecision,$.prototype._moveTo=Q._moveTo,$.prototype._wake=Q._wake,$.prototype._startAutoRotateLang=Q._startAutoRotateLang,$.prototype._stopAutoRotateLang=Q._stopAutoRotateLang,$.prototype.destroy=Q.destroy,$.observedAttributes=La,Object.defineProperty($.prototype,"src",{get:function(){return this._src},set:function(e){this._src=e,typeof e==`string`?this.setAttribute(`src`,e):this._initPlayer()}}),Object.defineProperty($.prototype,"languages",{get:function(){if(!this._engine||!this._engine.metadata)return[];let e=this._engine.metadata.slots||this._engine.metadata.elements||[],t={};for(let n=0;n<e.length;n++){let r=e[n].content||{};Object.keys(r).forEach(e=>{t[e.toLowerCase()]=!0})}return Object.keys(t).sort()}}),Object.defineProperty($.prototype,"currentLang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`}}),Object.defineProperty($.prototype,"lang",{get:function(){return this._engine?this._engine.lang:this.getAttribute(`lang`)||`en`},set:function(e){this.setAttribute(`lang`,e)}}),customElements.define(`oim-player`,$)),window.OimPlayerElement=Q;var Ra={mount:function(e,t,n){let r=typeof e==`string`?document.getElementById(e):e;if(!r)return console.error(`[OimPlayer.mount] Container not found:`,e),null;let i=document.createElement(`oim-player`);return i._oimOptions=n||{},i.src=t,i.setAttribute(`show-controls`,n&&n.showLanguageSelector===!1?`false`:`true`),n&&n.allowLottie===!1&&i.setAttribute(`allow-lottie`,`false`),r.replaceChildren?r.replaceChildren(i):(r.innerHTML=``,r.appendChild(i)),i}},za=Ra.mount;return window.OimPlayer=Ra,e.OimPlayer=Ra,e.default=Ra,e.OimPlayerElement=Q,e.mount=za,e})({});
@@ -0,0 +1 @@
1
+ (function(){var e=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),t=new Set([`public`,`author_only`,`sealed`]);function n(n){let r={...n};if(r.reedit===void 0&&`reedicion`in r){let t=r.reedicion;r.reedit=typeof t==`string`?e.get(t)??`author_only`:`author_only`}return r.reedit!==void 0&&!(typeof r.reedit==`string`&&t.has(r.reedit))&&(r.reedit=`author_only`),delete r.reedicion,r}var r={text:[`fills`,`strokes`,`effects`,`animations`,`motion`,`mask`,`text`,`interactions`],shape:[`fills`,`strokes`,`effects`,`animations`,`motion`,`mask`,`geometry`,`corners`,`a11y`,`interactions`],image:[`strokes`,`effects`,`animations`,`motion`,`mask`,`corners`,`image`,`a11y`,`interactions`],lottie:[`effects`,`animations`,`motion`],group:[`effects`,`animations`,`motion`,`interactions`,`children`]};function i(e,t){return r[e].includes(t)}var a=new Set([`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`]);function o(e){return typeof e==`string`&&a.has(e)}function s(e,t,n=new Set){let r=new Map,i=new Map,a=new Set,s=new Set,c=(e,t)=>{let n=i.get(e);n||i.set(e,n=new Set),n.add(t)};return{canvas:e,language:t,hasRole:e=>n.has(e)||o(e),register(e,t){r.set(e,t)},take(e,t){return c(e,t),e[t]},retire(e,t){c(e,t),e[t]!==void 0&&a.add(`${r.get(e)??`?`}.${t}`)},note(e){s.add(e)},finish(){let e=new Set(s);for(let[t,n]of r){let r=i.get(t);for(let i of Object.keys(t))t[i]!==void 0&&!r?.has(i)&&e.add(`${n}.${i}`)}return{retired:[...a].sort(),unhandled:[...e].sort()}}}}function c(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var l=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,u=[[`o`,`opacity`,1],[`s`,`scale`,1],[`r`,`rotation`,0],[`x`,`x`,0],[`y`,`y`,0],[`b`,`blur`,0]],d=new Set([`x`,`y`,`scale`,`rotation`]);function f(e,t){let n=e.map(c).filter(e=>!!e&&l(e.t)!==void 0);if(n.length<2)return[];let r=[];for(let[e,i,a]of u){let o=n.filter(t=>l(t[e])!==void 0);if(!o.some(t=>t[e]!==a))continue;let s=(d.has(i)?n:o).map(n=>{let r={t:Math.min(1,Math.max(0,n.t/t)),v:l(n[e])??a};return n.e!==void 0&&(r.e=n.e),r});if(s.length===1){let e=s[0].t;e>0&&s.unshift({t:0,v:a}),e<1&&s.push({t:1,v:a})}r.push({property:i,keyframes:s})}return r}var p={"rise-words":`words`,"reveal-mask":`lines`};function m(e,t,n){let r=[],i=(e,t,n)=>{n!==t&&r.push({property:e,keyframes:[{t:0,v:t},{t:1,v:n}]})},a=l(t.scale);a!==void 0&&i(`scale`,1,a>10?a/100:a);let o=l(t.rotation);o!==void 0&&i(`rotation`,n.box.rotation??0,o);let s=l(t.opacity);if(s!==void 0&&i(`opacity`,n.opacity??1,s/100),t.color&&e.note(`style.states.hover.color: a hover colour is not carried to 2.0`),r.length!==0)return{on:`hover`,tracks:r,duration:Math.max(0,l(t.transitionDuration)??0)}}var h=new Set([`show`,`hide`,`toggle`,`setText`,`play`]);function g(e,t){let n=(Array.isArray(e.actions)?e.actions:[]).map(c).filter(e=>!!e&&typeof e.target==`string`&&typeof e.type==`string`&&h.has(e.type)).map(e=>({type:e.type,target:e.target,...typeof e.value==`string`?{value:e.value}:{}}));return n.length>0?{on:t,actions:n}:void 0}function _(e,t,n){let{raw:r,style:a}=t,o=[],s=[],u=c(e.take(a,`animation`));if(u){let t=l(u.duration),n=l(u.delay),r=t||8,i=Array.isArray(u.keyframes)&&r>0?f(u.keyframes,r):[];i.length>0&&o.push({on:u.trigger===`action`?`action`:`loop`,tracks:i,duration:r*1e3}),typeof u.loop==`string`&&u.loop!==`none`&&u.loop!==`custom`&&o.push({on:`loop`,preset:u.loop,duration:t&&t>0?t*1e3:0,...n&&n>0?{delay:n*1e3}:{}}),typeof u.hover==`string`&&u.hover!==`none`&&u.hover!==`custom`&&o.push({on:`hover`,preset:u.hover,duration:200});for(let t of[`custom_loop_css`,`custom_keyframes`,`custom_hover_css`])u[t]&&e.note(`style.animation.${t}: raw CSS is not carried to 2.0`)}let d=e.take(a,`textAnimationType`),h=l(e.take(a,`textAnimationSpeed`)),_=l(e.take(a,`textAnimationDelay`)),v=l(e.take(a,`textAnimationIntensity`)),y=e.take(a,`typewriterCursor`);if(n.type===`text`&&typeof d==`string`&&d&&d!==`none`){let e={};h!==void 0&&(e.speed=h),v!==void 0&&(e.intensity=v),typeof y==`boolean`&&(e.cursor=y),o.push({on:`load`,target:p[d]??`chars`,preset:d,...Object.keys(e).length>0?{params:e}:{},duration:0,..._?{delay:_*1e3}:{}})}let b=c(e.take(a,`reveal`));b&&typeof b.effect==`string`&&o.push({on:`enter`,preset:b.effect,duration:l(b.duration)??300,...b.easing===void 0?{}:{easing:b.easing}});let x=l(e.take(a,`trimStart`)),S=l(e.take(a,`trimEnd`)),C=l(e.take(a,`trimDuration`)),w=e=>Math.min(1,Math.max(0,e/100)),T=w(x??0),E=w(S??100),D=Math.max(0,C??0),O=r.content,k=typeof O==`string`?[O]:Object.values(c(O)??{}),A=t.type!==`image`&&k.some(e=>typeof e==`string`&&/(<|&lt;)svg|<span|<div|<a|<img/i.test(e));n.type===`shape`&&n.geometry&&A&&a.strokeWidth&&((T>0||E<1)&&(n.geometry.trim={...T>0?{start:T}:{},...E<1?{end:E}:{}}),D>0&&o.push({on:`load`,duration:D*1e3,tracks:[{property:`trimEnd`,keyframes:[{t:0,v:T},{t:1,v:E}]}]}));let j=c(e.take(r,`states`))??c(e.take(a,`states`))??{},M=r.isInteractive===!0||a.isInteractive===!0;e.take(r,`isInteractive`);for(let[t,r]of[[`hover`,`hover`],[`active`,`press`]]){let i=c(j[t]);if(!i)continue;let a=M&&r===`hover`?m(e,i,n):void 0;a&&o.push(a);let l=M?g(i,r):void 0;l&&s.push(l)}let N=c(e.take(r,`interaction`)),P=c(N?.target);if(N?.action_type===`toggle_elements`&&P){let e=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],t=[...e(P.show_slots).map(e=>({type:`show`,target:e})),...e(P.hide_slots).map(e=>({type:`hide`,target:e}))];t.length>0&&s.push({on:`press`,actions:t})}e.take(a,`isInteractive`);let F=c(e.take(r,`parallax`))??c(e.take(a,`parallax`));if(e.take(a,`parallax`),F&&F.enabled!==!1){let t=c(F.infinite)??{},i=t.enabled===!1?0:l(F.speedPxSec)??l(t.speedPxSec)??l(t.speed_px_sec)??(F.mode===`infinite_horizontal`?l(F.speed)??20:0),o=(...e)=>e.find(e=>e!==void 0),s=o(F.direction,t.direction),u=o(F.mirror,F.seamlessTile,t.mirror,t.seamlessTile,t.seamless_tile),d=o(F.pauseOnHover,t.pauseOnHover,t.pause_on_hover);i===0?F.mode!==`infinite_horizontal`&&e.retire(r.parallax===void 0?a:r,`parallax`):n.motion={loop:{speedPxSec:Math.min(500,Math.max(-500,i)),...s===`left_to_right`||s===`right_to_left`?{direction:s}:{},...u===void 0?{}:{mirror:!!u},...d===void 0?{}:{pauseOnHover:!!d}}}}e.retire(a,`sceneLoop`),e.retire(r,`isParallaxGroup`),e.retire(a,`isParallaxGroup`),e.retire(r,`is_parallax_group`),e.retire(a,`loopDepth`),e.retire(r,`tracking_data`);let I=e.take(a,`cssAnimation`);typeof I==`string`&&I&&!/^background-animation-/.test(I)&&e.note(`style.cssAnimation: raw CSS is not carried to 2.0`),o.length>0&&(n.animations=o),s.length>0&&i(n.type,`interactions`)&&(n.interactions=s)}function v(e,t=800){if(e==null||e===``)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;let n=String(e).trim();if(n.endsWith(`cqw`)||n.endsWith(`%`)){let e=parseFloat(n);return Number.isFinite(e)?e/100*t:null}if(n.endsWith(`px`)){let e=parseFloat(n);return Number.isFinite(e)?e:null}let r=parseFloat(n);return Number.isFinite(r)?r:null}var y=new Set([`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`difference`]);function b(e,t){if(typeof e!=`number`&&typeof e!=`string`)return;let n=v(e,t);return n!==null&&Number.isFinite(n)?n:void 0}var x=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,S=new Set([`geo`,`shape`,`draw`,`filter`,`container`,`mask`,`artistic-text`]),C=.1;function w(e,t,n){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&t>0?e/t*n:void 0;let r=String(e).trim(),i=parseFloat(r);if(Number.isFinite(i))return r.endsWith(`cqw`)?i/100*n:r.endsWith(`%`)?i/100*t:r.endsWith(`px`)?i:/^-?[\d.]+$/.test(r)&&t>0?i/t*n:void 0}var T=e=>typeof e==`string`?e!==``:!!e&&typeof e==`object`&&Object.values(e).some(e=>typeof e==`string`&&e!==``);function E(e,t,n){let{raw:r,style:i}=t,{width:a,height:o}=e.canvas,s=e.take(r,`position`),[c,l]=Array.isArray(s)?s:[],u=x(c)??0,d=x(l)??0;(u>1||d>1)&&(u/=100,d/=100);let f=x(e.take(r,`width_px`)),p=x(e.take(r,`height_px`)),m=x(e.take(r,`widthPercent`)),h=x(e.take(r,`heightPercent`)),g=e.take(i,`width`),_=e.take(i,`height`),v=(e,t,n,r)=>e??(t===void 0?b(n,r)??0:t/100*r),E=v(f,m,g,a),D=v(p,h,_,o),O=String(r.type??`text`),k=S.has(O)&&(O!==`mask`||i.maskMode!==`cutout`),A=r.is_background_pattern===!0||r.id===`background-pattern-slot`,j=T(r.content),M=[w(g,a,a),w(_,o,a)],N=[f??(m===void 0?void 0:m/100*a),p===void 0?h===void 0?void 0:h/100*a:p/a*a],P;P=M[0]!==void 0&&M[1]!==void 0?M:N[0]!==void 0&&N[1]!==void 0&&(k||O===`image`||!j)?N:O===`image`||k&&!j||A||O===`pattern`?[0,1].map(e=>N[e]??M[e]??C*a):[void 0,void 0];let F=i.textAlign??r.align??`left`,I=e=>F===`center`?e/2:F===`right`?e:0,L=u*a+I(E),R=d*o+D/2,[z,B]=P;z===void 0||B===void 0?O!==`text`&&!j?n.box={x:u*a,y:d*o,width:Math.max(0,E),height:Math.max(0,D)}:(n.box={x:L,y:R,anchor:F===`center`?`center`:F===`right`?`right`:`left`},E>0&&(n.box.width=E)):n.box={x:L-I(z),y:R-B/2,width:Math.max(0,z),height:Math.max(0,B)};let V=x(e.take(i,`rotation`));V&&(n.box.rotation=V);let H=x(e.take(i,`opacity`));H!==void 0&&H<100&&(n.opacity=Math.max(0,H)/100);let U=e.take(r,`isVisible`)===!1;(e.take(i,`isVisible`)===!1||U)&&(n.visible=!1);let W=e.take(i,`blendMode`);typeof W==`string`&&y.has(W)&&(n.blend=W)}var D={"to top":0,"to right":90,"to bottom":180,"to left":270,"to top right":45,"to bottom right":135,"to bottom left":225,"to top left":315},O=/^(#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla)\([^()]*\)|[a-z]+)$/i;function k(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}function A(e){let t=/^(.*?)(?:\s+(-?[\d.]+)%)?$/.exec(e);if(!t)return null;let n=t[1].trim();if(!O.test(n))return null;if(t[2]===void 0)return{color:n};let r=Number(t[2])/100;return Number.isFinite(r)?{color:n,at:Math.min(1,Math.max(0,r))}:null}function j(e){if(typeof e!=`string`)return null;let t=/^\s*(linear|radial|conic)-gradient\((.*)\)\s*$/is.exec(e);if(!t)return null;let n=t[1].toLowerCase(),r=k(t[2]);if(!r||r.some(e=>e===``))return null;let i,a=r[0].toLowerCase(),o=/^(?:from\s+)?(-?[\d.]+)deg$/.exec(a);o?(i=Number(o[1]),r.shift()):a in D?(i=D[a],r.shift()):n===`radial`&&/^(circle|ellipse)\b/.test(a)&&r.shift();let s=r.map(A);if(s.length<2||s.some(e=>e===null))return null;let c={type:n,stops:s};return i!==void 0&&Number.isFinite(i)&&(c.angle=i),c}var M=[1,0,0,1,0,0],N=new Set([`path`,`rect`,`circle`,`ellipse`,`line`,`polyline`,`polygon`]),P=new Set([`svg`,`g`]),F=new Set([`title`,`desc`,`metadata`]);function I(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}var L=e=>(e.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi)??[]).map(Number);function R(e){let t=M,n=[...e.matchAll(/([a-zA-Z]+)\s*\(([^)]*)\)/g)];if(n.length===0&&e.trim()!==``)return null;for(let[,e,r]of n){let n=L(r),i;if(e===`matrix`&&n.length===6)i=n;else if(e===`translate`&&n.length>=1)i=[1,0,0,1,n[0],n[1]??0];else if(e===`scale`&&n.length>=1)i=[n[0],0,0,n[1]??n[0],0,0];else if(e===`rotate`&&n.length>=1){let e=n[0]*Math.PI/180,t=[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0];i=n.length>=3?I(I([1,0,0,1,n[1],n[2]],t),[1,0,0,1,-n[1],-n[2]]):t}else if(e===`skewX`&&n.length===1)i=[1,0,Math.tan(n[0]*Math.PI/180),1,0,0];else if(e===`skewY`&&n.length===1)i=[1,Math.tan(n[0]*Math.PI/180),0,1,0,0];else return null;t=I(t,i)}return t}function z(e){let t={};for(let[,n,,r,i]of e.matchAll(/([a-zA-Z_:][\w:.-]*)\s*=\s*("([^"]*)"|'([^']*)')/g))t[n]=r??i??``;return t}var B=new Set([`x`,`width`,`cx`,`rx`,`x1`,`x2`]),V=new Set([`y`,`height`,`cy`,`ry`,`y1`,`y2`]),H=(e,t,n)=>{let r=e[t]??`0`,i=Number.parseFloat(r);if(!Number.isFinite(i))return 0;if(!r.trim().endsWith(`%`)||!n)return i;let[a,o]=[n[2],n[3]],s=B.has(t)?a:V.has(t)?o:Math.sqrt((a*a+o*o)/2);return i/100*s};function U(e){if(e.type===`svg`)return!0;let t=e.raw.content;return(typeof t==`string`?[t]:t&&typeof t==`object`?Object.values(t):[]).some(e=>typeof e==`string`&&/<svg/i.test(e))}function W(e,t,n){let r=(e,t)=>H(e,t,n);if(e===`path`)return t.d?.trim()||null;if(e===`rect`){let[e,n,i,a]=[r(t,`x`),r(t,`y`),r(t,`width`),r(t,`height`)];if(!(i>0)||!(a>0))return null;let o=t.rx===void 0?t.ry===void 0?0:r(t,`ry`):r(t,`rx`),s=t.ry===void 0?o:r(t,`ry`);return o=Math.min(o,i/2),s=Math.min(s,a/2),!(o>0)||!(s>0)?`M${e} ${n}H${e+i}V${n+a}H${e}Z`:`M${e+o} ${n}H${e+i-o}A${o} ${s} 0 0 1 ${e+i} ${n+s}V${n+a-s}A${o} ${s} 0 0 1 ${e+i-o} ${n+a}H${e+o}A${o} ${s} 0 0 1 ${e} ${n+a-s}V${n+s}A${o} ${s} 0 0 1 ${e+o} ${n}Z`}if(e===`circle`||e===`ellipse`){let[n,i]=[r(t,`cx`),r(t,`cy`)],a=e===`circle`?r(t,`r`):r(t,`rx`),o=e===`circle`?a:r(t,`ry`);return!(a>0)||!(o>0)?null:`M${n-a} ${i}A${a} ${o} 0 1 0 ${n+a} ${i}A${a} ${o} 0 1 0 ${n-a} ${i}Z`}if(e===`line`)return`M${r(t,`x1`)} ${r(t,`y1`)}L${r(t,`x2`)} ${r(t,`y2`)}`;let i=L(t.points??``);if(i.length<4||i.length%2!=0)return null;let a=`M${i[0]} ${i[1]}`;for(let e=2;e<i.length;e+=2)a+=`L${i[e]} ${i[e+1]}`;return e===`polygon`?`${a}Z`:a}var ee=[`fill`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`,`fill-rule`];function te(e,t){for(let n of Object.keys(t)){let t=n.toLowerCase();if(t===`style`)return`<${e}> carries a style attribute`;if(t.startsWith(`on`))return`<${e}> carries an event handler (${n})`;if(t===`href`||t.endsWith(`:href`))return`<${e}> carries a reference (${n})`}for(let n of[`fill`,`stroke`])if(/url\s*\(/i.test(t[n]??``))return`<${e}> paints with a reference (${n})`;return null}function ne(e){if(typeof e!=`string`||e.trim()===``)return{ok:!1,reason:`not an SVG string`};let t=e.replace(/<!--[\s\S]*?-->/g,``).replace(/<\?[\s\S]*?\?>/g,``).replace(/<!DOCTYPE[^>]*>/gi,``),n=[],r=[],i,a=0,o=!1;for(let[,e,s,c,l]of t.matchAll(/<(\/?)([a-zA-Z][\w:-]*)([^>]*?)(\/?)>/g)){if(F.has(s)){e?a--:l||a++;continue}if(a>0)continue;if(e){r.pop();continue}if(!P.has(s)&&!N.has(s))return{ok:!1,reason:`<${s}> is outside the static profile`};let t=z(c),u=te(s,t);if(u)return{ok:!1,reason:u};let d=r[r.length-1],f=t.transform===void 0?M:R(t.transform);if(!f)return{ok:!1,reason:`<${s}> has a transform that cannot be read`};let p=d?I(d.matrix,f):f,m={...d?.attrs??{}};for(let e of ee)t[e]!==void 0&&(m[e]=t[e]);if(s===`svg`&&!o){o=!0;let e=L(t.viewBox??``),[n,r]=[Number.parseFloat(t.width??``),Number.parseFloat(t.height??``)];e.length===4?i=e:n>0&&r>0&&!/%/.test(`${t.width}${t.height}`)&&(i=[0,0,n,r])}if(N.has(s)){let e=W(s,t,i);if(!e)continue;let r={d:e},a=m.fill??`black`;a!==`none`&&(r.fill=a);let o=m.stroke;if(o&&o!==`none`){r.stroke=o;let e=Number.parseFloat(m[`stroke-width`]??`1`);r.strokeWidth=Number.isFinite(e)?e:1;let t=m[`stroke-linecap`],n=m[`stroke-linejoin`];(t===`round`||t===`square`)&&(r.cap=t),(n===`round`||n===`bevel`)&&(r.join=n)}m[`fill-rule`]===`evenodd`&&(r.fillRule=`evenodd`);let c=Number.parseFloat(t.opacity??``);Number.isFinite(c)&&c<1&&(r.opacity=Math.max(0,c)),p.some((e,t)=>Math.abs(e-M[t])>1e-9)&&(r.transform=p.map(e=>Number(e.toFixed(6)))),n.push(r)}P.has(s)&&!l&&r.push({name:s,matrix:p,attrs:m})}return o?i?n.length===0?{ok:!1,reason:`nothing to draw`}:{ok:!0,value:{viewBox:i,paths:n}}:{ok:!1,reason:`the <svg> declares no viewBox nor a size in units`}:{ok:!1,reason:`no <svg> element`}}var G=e=>typeof e==`string`&&e!==``&&e!==`transparent`&&e!==`none`;function K(e,t,n,r){let i=e.take(t,n),a=r?e.take(t,r):void 0;return typeof a==`string`&&e.hasRole(a)?G(i)?{var:a,fallback:i}:{var:a}:G(i)?i:void 0}var q=e=>Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`number`)?e:void 0;function J(e,t,n,r,i=!1){let a=e.take(t,`${n}Type`),o=K(e,t,`${n}Color`,`${n}ColorRole`),s=K(e,t,`${n}BgColor`,`${n}BgColorRole`),c=e.take(t,`${n}Colors`),l=e.take(t,`${n}Scale`),u=e.take(t,`${n}Speed`),d=e.take(t,`${n}Direction`),f=e.take(t,`${n}Svgs`),p=q(e.take(t,`${n}Sizes`)),m=q(e.take(t,`${n}Counts`))??q(e.take(t,`${n}Count`)),h=q(e.take(t,`${n}Dispersions`))??q(e.take(t,`${n}Dispersion`)),g=Array.isArray(c)?c.filter(G):[],_=i&&n===`backgroundPattern`&&typeof t.svgRawXml==`string`&&t.svgRawXml!==``;if((typeof a!=`string`||!a)&&!_&&o===void 0&&s===void 0&&g.length===0)return;let v=typeof a==`string`&&a?{preset:a}:{};g.length>0&&o!==void 0&&typeof o==`object`&&(g[0]=o),g.length>0?v.colors=g:o!==void 0&&(v.colors=[o]),s!==void 0&&(v.bg=s),typeof l==`number`&&l!==1&&(v.scale=l),p&&(v.sizes=p),m&&(v.counts=m),h&&(v.dispersions=h),Array.isArray(f)&&f.length>0&&(v.svgs=f.filter(e=>typeof e==`string`));let y=typeof r==`string`?/^background-animation-([a-z-]+)\s+([\d.]+)s\b/.exec(r):null,b=typeof d==`string`&&d!==`none`?d:y?.[1],x=typeof u==`number`&&u>0?u:y?Number(y[2]):n===`backgroundPattern`&&b?8:void 0;return b&&re.has(b)&&x&&(v.motion={direction:b,period:x}),{kind:`pattern`,pattern:v}}var re=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function Y(e,t,n,r){let i=e.take(t,n);if(i==null||i===``)return;let a=j(i);if(!a)e.note(`${r}.${n}: gradient not understood`);else return{kind:`gradient`,gradient:a}}function ie(e,t){let n=e.take(t,`fillImage`),r=c(e.take(t,`fillImageCrop`)),i=e.take(t,`fillImageFlipX`),a=e.take(t,`fillImageFlipY`);if(typeof n!=`string`||!n)return;let o={kind:`image`,src:n};return r&&(o.crop=r),i===!0&&(o.flipX=!0),a===!0&&(o.flipY=!0),o}var ae=new Set([`metallic-chrome`,`sunset-gold`,`neon-glow`,`linear`]);function oe(e,t){let{style:n}=t,r=e.take(n,`fillType`),i=e.take(n,`backgroundType`),a=K(e,n,`fillColor`,typeof n.fillColorRole==`string`&&n.fillColorRole?`fillColorRole`:`colorRole`);e.take(n,`fillColorRole`),e.take(n,`colorRole`),e.take(n,`color`);let o=Y(e,n,`fillGradient`,`style`),s=ie(e,n),l=n.cssAnimation,u=J(e,n,`fillPattern`,l),d=J(e,n,`backgroundPattern`,l,t.raw.is_background_pattern===!0||t.raw.id===`background-pattern-slot`),f=c(e.take(n,`fillGenerative`))??c(e.take(n,`backgroundGenerative`)),p=e.take(n,`backgroundFit`),m=e.take(n,`textGradientType`);d&&p===`cover`&&`pattern`in d&&(d.pattern.fit=`cover`);let h=u??d;h&&typeof l==`string`&&/^background-animation-/.test(l)&&e.take(n,`cssAnimation`);let g=()=>a===void 0?void 0:{kind:`color`,value:a},_=typeof r==`string`?r:typeof i==`string`?i:t.type===`pattern`||d?`pattern`:`color`;if(_!==`none`&&_!==`transparent`)return _===`gradient`?o??g():_===`image`?s?a===void 0?s:[s,g()]:g():_===`pattern`?h??g():_===`generative`?f?{kind:`generative`,generative:f}:g():(t.type===`text`||t.type===`artistic-text`)&&typeof m==`string`&&ae.has(m)&&m!==`linear`?{kind:`gradient`,preset:m}:g()}function X(e,t,n,r,i={},a){let o=K(e,t,n,a),s=e.take(t,r);if(typeof s==`number`&&s>0&&o!==void 0)return{paint:{kind:`color`,value:o},width:s,...i}}function se(e,t){let n=typeof t.textStrokeColorRole==`string`&&t.textStrokeColorRole?`textStrokeColorRole`:`strokeColorRole`,r=t.textStrokeWidth,i=K(e,t,`textStrokeColor`,n);if(e.take(t,`textStrokeColorRole`),e.take(t,`textStrokeWidth`),typeof r==`number`&&r>0)return{paint:{kind:`color`,value:i??`#000000`},width:r}}function ce(e,t,n){let{style:r}=t,a=n.type===`text`&&r.fillColor===`transparent`&&(r.fillType===void 0||r.fillType===`solid`||r.fillType===`color`),o=oe(e,t),s=Array.isArray(o)?o[0]:o,c=r.geoShape,l=typeof r.svgPath==`string`&&r.svgPath!==``&&(c===void 0||c===`custom`),u=t.type===`geo`&&(l||c===`scribble`)&&!!s&&`kind`in s&&s.kind===`color`;s&&!u&&i(n.type,`fills`)?n.fills=Array.isArray(o)?o:[s]:a&&(n.fills=[{kind:`color`,value:`transparent`}]);let d=e.take(r,`strokeStyle`),f=d===`dashed`||d===`dotted`?{style:d}:{},p=e.take(r,`borderStyle`),m=X(e,r,`borderColor`,`borderWidth`,p===`dashed`||p===`dotted`?{style:p}:{}),h=U(t),g=h?K(e,r,`strokeColor`,`strokeColorRole`):void 0;h&&e.take(r,`strokeWidth`);let _=g===void 0?X(e,r,`strokeColor`,`strokeWidth`,f,`strokeColorRole`):{paint:{kind:`color`,value:g},width:0};if(!_&&r.geoShape===`scribble`){let t=typeof r.strokeWidth==`number`&&r.strokeWidth>0?r.strokeWidth:2;_={paint:{kind:`color`,value:K(e,r,`strokeColor`,`strokeColorRole`)??K(e,r,`fillColor`,`fillColorRole`)??`#2563EB`},width:t,...f}}let v=se(e,r),y=X(e,r,`outerStrokeColor`,`outerStrokeWidth`,{align:`outside`}),b=X(e,r,`innerStrokeColor`,`innerStrokeWidth`,{align:`inside`}),x=(n.type===`text`?[v,y,b]:[_,p===`solid`||p===`dashed`||p===`dotted`?m:void 0,v,y,b]).filter(e=>e!==void 0);x.length>0&&i(n.type,`strokes`)&&(n.strokes=x)}var le=[[`tipo`,`type`],[`color`,`color`],[`angulo`,`angle`],[`cruzada`,`crossed`],[`grosor`,`thickness`],[`tamano`,`size`]];function ue(e,t){let n=e.take(t,`backgroundType`),r=K(e,t,`backgroundColor`),i=Y(e,t,`backgroundGradient`,`root`);for(let n of[`backgroundGradientAngle`,`backgroundGradientStart`,`backgroundGradientEnd`,`backgroundGradientType`])e.take(t,n);let a=J(e,t,`backgroundPattern`),o=c(e.take(t,`backgroundGenerative`)),s=c(e.take(t,`backgroundTexture`)),l=[],u=r===void 0?void 0:{kind:`color`,value:r};if(n===`gradient`?l.push(...[i??u].filter(e=>!!e)):n===`pattern`?l.push(...[a??u].filter(e=>!!e)):n===`generative`&&o?l.push({kind:`generative`,generative:o}):n!==`transparent`&&u&&l.push(u),s&&typeof s.tipo==`string`){let e={};for(let[t,n]of le)s[t]!==void 0&&(e[n]=s[t]);let t={kind:`texture`,texture:e};typeof s.opacidad==`number`&&(t.opacity=Math.min(1,Math.max(0,s.opacidad))),l.push(t)}return l}var de={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`},Z=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0;function fe(e,t,n=!1){let r=e.take(t,`filterPreset`),i=e.take(t,`fp`),a=n?r||i:r,o=Z(e.take(t,`filterBlur`)),s=Z(e.take(t,`filterBrightness`)),c=Z(e.take(t,`filterContrast`)),l=Z(e.take(t,`filterSaturate`)),u=Z(e.take(t,`filterHueRotate`)),d={};return typeof a==`string`&&(Object.hasOwn(de,a)||n&&a===`duotone`)&&(d.preset=a),o&&(d.blur=o),s!==void 0&&s!==100&&(d.brightness=s/100),c!==void 0&&c!==100&&(d.contrast=c/100),l!==void 0&&l!==100&&(d.saturate=l/100),u&&(d.hueRotate=u),Object.keys(d).length>0?d:void 0}function pe(e,t,n={}){let r=c(t);if(!r||r.enabled===!1)return;let i=(t,n)=>{let i=r.colorRole||n,a=typeof r.color==`string`&&r.color?r.color:t,o=typeof i==`string`&&e.hasRole(i)?a?{var:i,fallback:a}:{var:i}:a;return o===void 0?{}:{color:o}},a=i(void 0,void 0);switch(r.type){case`drop-shadow`:{if(n.glyphsInSvg)return;let e={kind:`shadow`,y:4,blur:12,...i(`rgba(0, 0, 0, 0.35)`,n.shadowRole)};for(let t of[`x`,`y`,`blur`,`spread`]){let n=Z(r[t]);n!==void 0&&(e[t]=t===`blur`?Math.max(0,n):n)}return e.x||delete e.x,e}case`glow`:{if(n.glyphsInSvg)return;let e={kind:`glow`,radius:Z(r.radius)||16,...i(`#f59e0b`,n.glowRole)},t=Z(r.intensity);return t!==void 0&&(e.intensity=t),e}case`blur`:return{kind:`blur`,radius:Z(r.radius)??8};case`color-grade`:{if(typeof r.preset!=`string`)return;let e=Z(r.intensity);return{kind:`color-grade`,preset:r.preset,...e===void 0?{}:{intensity:e}}}case`texture`:{if(typeof r.preset!=`string`)return;let e={kind:`texture`,preset:r.preset,...a},t=Z(r.intensity),n=Z(r.scale);return t!==void 0&&(e.intensity=t),typeof r.blend==`string`&&(e.blend=r.blend),n!==void 0&&n!==1&&(e.scale=n),e}default:e.note(`style.effects: unknown effect type "${String(r.type)}"`);return}}function Q(e,t,n){return Array.isArray(t)?t.map(t=>pe(e,t,n)).filter(e=>!!e):[]}function me(e,t,n){let{style:r}=t,i=[],a=e.take(r,`effect`),o=K(e,r,`effectColor`,`effectColorRole`),s=Z(e.take(r,`effectRadius`));a===`neon`&&i.push({kind:`glow`,radius:s??16,color:o??`#f59e0b`});let c=e.take(r,`effects`),l=Array.isArray(c)&&c.length>0,u=e.take(r,`shadowEnabled`)===!0&&!l,d,f=K(e,r,`shadowColor`,`shadowColorRole`),p=Z(e.take(r,`shadowBlur`)),m=Z(e.take(r,`shadowOffsetX`)),h=Z(e.take(r,`shadowOffsetY`)),g=Z(e.take(r,`shadowOpacity`));if(u){let e={kind:`shadow`};m&&(e.x=m),h&&(e.y=h),p&&(e.blur=p),f!==void 0&&(e.color=f),g!==void 0&&g<100&&(e.opacity=Math.max(0,g)/100),d=e}let _=Z(e.take(r,`layerBlur`))??Z(e.take(r,`blur`));e.take(r,`blur`),l?i.push(...Q(e,c,{shadowRole:r.shadowColorRole,glowRole:r.effectColorRole,glyphsInSvg:t.type===`artistic-text`})):_&&_>0&&i.push({kind:`blur`,radius:_});let v=fe(e,r,t.type===`filter`);if(t.type===`filter`)i.push({kind:`backdrop`,...v});else if(v){let e=n.fills?.find(e=>`kind`in e&&e.kind===`image`);n.image?n.image.filters=v:e&&`kind`in e&&e.kind===`image`&&(e.filters=v)}let y=e.take(r,`grain`)===!0,b=Z(e.take(r,`grainIntensity`)),x=Z(e.take(r,`grainSize`)),S=e.take(r,`grainBlend`);if(y&&!l){let e={kind:`grain`};b!==void 0&&(e.intensity=b),x!==void 0&&(e.size=x),typeof S==`string`&&(e.blend=S),i.push(e)}d&&i.push(d),i.length>0&&(n.effects=i)}function he(e,t){let n=Q(e,e.take(t,`effects`)),r=c(e.take(t,`grain`));if(r&&r.enabled!==!1){let e={kind:`grain`},t=Z(r.intensity),i=Z(r.baseFrequency);t!==void 0&&(e.intensity=t),i!==void 0&&(e.size=i),typeof r.blendMode==`string`&&(e.blend=r.blendMode),typeof r.color==`string`&&(e.color=r.color),n.push(e)}return n}var ge={rectangle:{kind:`rect`},circle:{kind:`ellipse`},line:{kind:`line`}},_e=e=>{let t=typeof e==`string`?e.trim().split(/[\s,]+/).map(Number):[];return t.length===4&&t.every(Number.isFinite)?t:[0,0,24,24]};function ve(e,t){let n=e.take(t.raw,`content`);if(typeof n==`string`)return n||void 0;let r=c(n)??{},i=r[`*`]??r[e.language]??Object.values(r).find(e=>typeof e==`string`&&e!==``);return typeof i==`string`&&i!==``?i:void 0}function ye(e,t){let n=c(e.raw.content);if(!n||typeof n[`*`]!=`string`||t===`oim:base`)return t;let r={};for(let[e,i]of Object.entries(n))e!==`*`&&typeof i==`string`&&i!==t&&(r[e]=i);return Object.keys(r).length>0?{value:t,modes:r}:t}function be(e,t,n){let r=[];for(let n of t){let t=c(n);if(!t||typeof t.d!=`string`||!t.d)continue;let i={d:t.d};typeof t.fill==`string`&&t.fill!==`none`&&(i.fill=t.fill),typeof t.stroke==`string`&&t.stroke!==`none`&&(i.stroke=t.stroke,i.strokeWidth=typeof t.strokeWidth==`number`?t.strokeWidth:1),typeof t.animationType==`string`&&t.animationType!==`none`&&e.note(`style.svgLayers: per-path animation "${t.animationType}"`),r.push(i)}return r.length>0?{kind:`paths`,viewBox:n,paths:r}:void 0}function xe(e,t,n){let{style:r}=t,i=e.take(r,`geoShape`);e.take(r,`geoType`);let a=e.take(r,`svgPath`),o=e.take(r,`customBlobPath`),s=_e(e.take(r,`svgViewBox`)),c=e.take(r,`svgRawXml`),l=e.take(r,`svgLayers`);if(Array.isArray(l)&&l.length>0){let t=be(e,l,s);if(t)return t}let u=typeof c==`string`&&c?c:U(t)?n:void 0;if(u){let t=ne(u);return t.ok?{kind:`paths`,...t.value}:(e.note(`style.svgRawXml: ${t.reason}`),{kind:`rect`})}let d=typeof a==`string`&&a?a:typeof o==`string`&&o?o:void 0;return i===`scribble`&&typeof o==`string`&&o||i===`blob`&&typeof o==`string`&&o?{kind:`paths`,viewBox:[0,0,100,100],paths:[{d:o}]}:d&&(i===void 0||i===`custom`||i===`blob`)?{kind:`paths`,viewBox:i===`blob`?[0,0,100,100]:s,paths:[{d}]}:typeof i==`string`&&i?ge[i]??{kind:`preset`,name:i}:{kind:`rect`}}var Se=[[`borderRadiusTL`,`borderTopLeftRadius`],[`borderRadiusTR`,`borderTopRightRadius`],[`borderRadiusBR`,`borderBottomRightRadius`],[`borderRadiusBL`,`borderBottomLeftRadius`]],Ce=[[0,0,0,0],[0,1,0,1],[0,1,2,1],[0,1,2,3]];function we(e,t){let n=e.canvas.width,r=e.take(t,`borderRadius`),i=typeof r==`string`?r.trim().split(/\s+/):[],a=i.length>1&&i.length<=4?Ce[i.length-1].map(e=>b(i[e],n)):[],o=i.length>1?0:b(r,n)??0,s=Se.map((r,i)=>r.map(r=>b(e.take(t,r),n)).find(e=>e!==void 0)??a[i]);if(s.some(e=>e!==void 0)){let e=s.map(e=>Math.max(0,e??o));return e.every(t=>t===e[0])?e[0]||void 0:e}return o>0?o:void 0}function Te(e,t,n){let{style:r}=t,a=n.type===`text`?void 0:ve(e,t);n.type===`shape`&&(n.geometry=xe(e,t,a));let o=n.fills?.[0];if(U(t)&&n.geometry?.kind===`paths`&&o&&`kind`in o&&o.kind===`color`)for(let e of n.geometry.paths)e.fill=`currentColor`;else for(let t of[`geoShape`,`geoType`,`svgPath`,`customBlobPath`,`svgViewBox`,`svgRawXml`,`svgLayers`])e.take(r,t);let s=we(e,r);s!==void 0&&i(n.type,`corners`)&&(n.corners=s);let l=e.take(r,`objectFit`),u=c(e.take(r,`imageCrop`));n.type===`image`&&(n.image={src:ye(t,a??`oim:base`)},typeof l==`string`&&l!==`cover`&&(n.image.fit=l),u&&(n.image.crop=u)),n.type===`lottie`&&a&&(n.lottie={src:a}),e.take(r,`flipX`)===!0&&(n.box.flipX=!0),e.take(r,`flipY`)===!0&&(n.box.flipY=!0);let d=c(e.take(r,`alt`)),f=e.take(r,`decorative`)===!0;i(n.type,`a11y`)&&(d&&Object.keys(d).length>0||f)&&(n.a11y={},d&&Object.keys(d).length>0&&(n.a11y.alt=d),f&&(n.a11y.decorative=!0))}var Ee=[`shader_fx`,`outline`,`verticalAlign`],De={rectangle:{kind:`rect`},circle:{kind:`ellipse`},line:{kind:`line`}};function Oe(e,t,n){let{style:r}=t,i=e.take(r,`maskMode`),a=e.take(r,`maskFeather`),o=e.take(r,`maskCoverage`),s=e.take(r,`maskShape`),l=e.take(r,`maskSvgPath`),u=e.take(r,`cuts`),d=e.take(r,`maskBgColor`),f=e.take(r,`maskBgColorRole`),p=e.take(r,`maskStrokeColor`),m=e.take(r,`maskStrokeColorRole`),h=e.take(r,`maskStrokeWidth`);if(e.take(r,`maskInvert`),t.type!==`mask`)return;let g={},_=i===`cutout`;_&&(g.mode=`cutout`),typeof a==`number`&&a>0&&(g.feather=a),o===`container`&&(g.scope=`group`),n.mask=g;let v=typeof s==`string`&&s?s:typeof r.geoShape==`string`?r.geoShape:void 0,y=typeof l==`string`&&l?l:typeof r.svgPath==`string`&&r.svgPath?r.svgPath:void 0;if(n.geometry=y&&(!v||v===`custom`)?{kind:`paths`,viewBox:[0,0,100,100],paths:[{d:y}]}:v&&v!==`custom`?De[v]??{kind:`preset`,name:v}:{kind:`ellipse`},Array.isArray(u)&&u.length>0&&(n.extensions={...n.extensions,studio:{...c(n.extensions?.studio),maskCuts:u}}),_)return;let b=(t,n,r)=>{let i=G(n)?n:r;return typeof t==`string`&&e.hasRole(t)?{var:t,fallback:i}:i};n.fills=[{kind:`color`,value:b(f||r.fillColorRole,d,`#38BDF8`)}],delete n.strokes,typeof h==`number`&&h>0&&(n.strokes=[{paint:{kind:`color`,value:b(m||r.strokeColorRole,p,`#FFFFFF`)},width:h}])}var ke=`author_only`,Ae=[`public`,`author_only`,`sealed`];function je(e){if(!e||typeof e!=`object`)return ke;let t=n(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let r=t.reedit;return typeof r==`string`&&Ae.includes(r)?r:ke}var Me=`2.0.0-draft.1`,Ne=800,Pe=[`signature`,`key_version`,`signed_at`,`timestamp`,`image_hash`,`image_hash_alg`],Fe=[`version`,`min_player`,`image`,`media_type`,`allowed_domains`,`terms_accepted`,`redirect_membership_verified`,`capabilities`,`capabilities_required`];function Ie(e){let t=c(e.canvas)??{},n=e=>typeof e==`number`&&e>0?e:void 0,r=n(e.artboardWidth)??n(e.canvasWidth)??n(e.canvas_width)??n(t.natural_width)??n(t.width)??Ne;return{width:r,height:n(e.artboardHeight)??n(e.canvasHeight)??n(e.canvas_height)??n(t.natural_height)??n(t.height)??r}}function Le(e){for(let t of[`languages`,`lang`]){let n=e[t];if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&e.length>0);if(e.length>0)return[...new Set(e)]}}return[`es`]}function Re(e){let t=new Set;for(let n of Object.values(c(e.palettes)??{}))for(let e of Object.keys(c(n)??{}))t.add(e);return t}function ze(e,t){let n={oim:Me,canvas:e.canvas,languages:Le(t),layers:[]};for(let n of[`oim`,`canvas`,`languages`,`lang`])e.take(t,n);let r=e.take(t,`oim_id`);typeof r==`string`&&r&&(n.id=r);let i=e.take(t,`name`);typeof i==`string`&&i&&(n.name=i),(t.reedit!==void 0||t.immutable_lock!==void 0)&&(n.reedit=je(t)),e.take(t,`reedit`),e.take(t,`immutable_lock`);let a=c(e.take(t,`description`));a&&Object.keys(a).length>0&&(n.description=a);let o=e.take(t,`fonts`);Array.isArray(o)&&o.length>0&&(n.fonts=o);for(let n of Pe)e.retire(t,n);for(let n of Fe)e.retire(t,n);let s=[];for(let n of[`slots`,`elements`,`layers`]){let r=e.take(t,n);s.length===0&&Array.isArray(r)&&(s=r)}return{document:n,slots:s}}function Be(e,t,n,r){let i=e.canvas.width,a=b(e.take(t,n),i),o=c(e.take(t,r))??{},s=b(o[e.language],i)??a;if(s===void 0)return;let l={};for(let[t,n]of Object.entries(o)){let r=b(n,i);t!==e.language&&r!==void 0&&r!==s&&(l[t]=r)}return Object.keys(l).length>0?{value:s,modes:l}:s}var Ve=`fontFamily.fontSize.fontSizes.fontWeight.fontStyle.bold.italic.underline.textAlign.lineHeight.letterSpacing.textTransform.textDecoration.maxWidth.maxWidths.marks.textRuns.textHighlight.dropCap.artisticPreset.curveType.curveAmount.extrusionDepth.extrusionAngle.extrusionColor.extrusionShading`.split(`.`);function He(e,t,n){let{raw:r,style:i}=t,a=e.take(i,`textAlign`)??e.take(r,`align`);if(e.take(r,`align`),n.type!==`text`){for(let t of Ve)e.take(i,t);return}let o=e.take(r,`content`),s={content:{}};if(typeof o==`string`)s.content[e.language]=o;else for(let[e,t]of Object.entries(c(o)??{}))typeof t==`string`&&(s.content[e]=t);let l={},u=e.take(i,`fontFamily`);typeof u==`string`&&u&&(l.family=u);let d=Be(e,i,`fontSize`,`fontSizes`);d!==void 0&&(l.size=d);let f=e.take(i,`fontWeight`);e.take(i,`bold`),(typeof f==`number`||typeof f==`string`&&f)&&Number(f)!==400&&(l.weight=Number.isFinite(Number(f))?Number(f):f);let p=e.take(i,`fontStyle`);(p===`italic`||p===`oblique`)&&(l.italic=!0),e.take(i,`italic`),Object.keys(l).length>0&&(s.font=l),(a===`center`||a===`right`||a===`justify`)&&(s.align=a);let m=e.take(i,`lineHeight`);(typeof m==`number`||typeof m==`string`&&m)&&(s.lineHeight=m);let h=e.take(i,`letterSpacing`),g=typeof h==`string`?b(h,e.canvas.width):typeof h==`number`&&t.type===`artistic-text`?h:void 0;g!==void 0&&g!==0&&(s.letterSpacing=g);let _=e.take(i,`textTransform`);(_===`uppercase`||_===`lowercase`||_===`capitalize`)&&(s.transform=_);let v=e.take(i,`textDecoration`);e.take(i,`underline`),typeof v==`string`&&v&&v!==`none`&&(s.decoration=v);let y=Be(e,i,`maxWidth`,`maxWidths`);y!==void 0&&(s.maxWidth=y);let x=c(e.take(i,`marks`));x&&Object.keys(x).length>0&&(s.marks=x);let S=c(e.take(i,`textRuns`));S&&Object.keys(S).length>0&&(s.runs=S);let C=c(e.take(i,`textHighlight`));C&&C.enabled!==!1&&(s.highlight=C);let w=c(e.take(i,`dropCap`));w&&w.enabled!==!1&&(s.dropCap=w);let T={},E=e.take(i,`artisticPreset`);typeof E==`string`&&E&&(T.preset=E);let D=e.take(i,`curveType`),O=e.take(i,`curveAmount`),k=D??`arc`;(k===`arc`||k===`wave`||k===`arch`)&&typeof O==`number`&&O!==0&&(T.curve={type:k,amount:O});let A=e.take(i,`extrusionDepth`),j=e.take(i,`extrusionAngle`),M=e.take(i,`extrusionColor`),N=e.take(i,`extrusionShading`);typeof A==`number`&&A>0&&(T.extrusion={depth:A},typeof j==`number`&&(T.extrusion.angle=j),typeof M==`string`&&M&&(T.extrusion.color=M),typeof N==`boolean`&&(T.extrusion.shading=N)),(t.type===`artistic-text`||Object.keys(T).length>0)&&(s.artistic=T),n.text=s}function Ue(e){return!!e&&e.type===`group`}function We(e){let t=(e&&e.style||{}).groupId;return typeof t==`string`&&t?t:null}function Ge(e){let t=new Set;for(let n of e||[])Ue(n)&&n.id&&t.add(String(n.id));let n=new Map;for(let r of e||[]){if(!r||!r.id||Ue(r))continue;let e=We(r);if(!e||!t.has(e))continue;let i=n.get(e);i?i.push(String(r.id)):n.set(e,[String(r.id)])}return n}var Ke={text:`text`,"artistic-text":`text`,geo:`shape`,shape:`shape`,draw:`shape`,svg:`shape`,pattern:`shape`,container:`shape`,filter:`shape`,mask:`shape`,image:`image`,lottie:`lottie`,group:`group`,component:`group`,zone:`group`};function qe(e,t,n){let r=Ge(t.map(e=>({...e.raw,style:e.style}))),i=new Map;for(let[e,t]of r)for(let n of t)i.set(n,e);let a=new Map(n.map(e=>[e.id,e])),o=[];return t.forEach((t,r)=>{e.take(t.style,`groupId`),e.take(t.style,`childIds`);let s=n[r],c=a.get(i.get(s.id)??``);c&&c!==s&&c.type===`group`?(c.children??=[]).push(s):o.push(s)}),o}var Je=[`display`,`flexDirection`,`justifyContent`,`alignItems`,`gap`,`padding`],$=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e/100*t:0;function Ye(e,t,n){let r={...c(t)??{}},i={...c(r.style)??{}};e.register(r,`zones[${n}]`),e.register(i,`zones[${n}].style`),e.take(r,`style`);let a=String(e.take(r,`id`)??`zone-${n+1}`),o=Array.isArray(r.position)?r.position:[0,0],s=Array.isArray(r.size)?r.size:[100,100];e.take(r,`position`),e.take(r,`size`);for(let t of Je)e.retire(i,t);let{width:l,height:u}=e.canvas,d={x:$(o[0],l),y:$(o[1],u),width:$(s[0],l),height:$(s[1],u)},f={id:a,type:`group`,box:d,children:[]},p=/^blur\((\d+(?:\.\d+)?)px\)$/.exec(String(e.take(i,`backdropFilter`)??``).trim());p&&(f.effects=[{kind:`backdrop`,blur:Number(p[1])}]);let m=e.take(i,`background`),h=b(e.take(i,`borderRadius`),l);if(G(m)){let e={id:`${a}__background`,type:`shape`,box:{...d},geometry:{kind:`rect`},fills:[{kind:`color`,value:m}]};h&&(e.corners=h),f.children.push(e)}return f}function Xe(e,t,n,r){let i=e.take(t,`zones`);if(!Array.isArray(i)||i.length===0)return n;let a=i.map((t,n)=>Ye(e,t,n)),o=new Map(a.map(e=>[e.id,e])),s=n.filter(e=>{let t=o.get(r.get(e)??``);return t&&t.children.push(e),!t});return[...a,...s]}function Ze(e,t,n){let r=c(e.take(t,`palettes`))??{},i=e.take(t,`defaultPalette`),a=Object.keys(r).filter(e=>c(r[e]));if(a.length===0)return;let o={};for(let e of a)for(let[t,n]of Object.entries(c(r[e])??{}))typeof n==`string`&&n&&((o[t]??={})[e]=n);let s={modes:{palette:a,language:n},values:o};return typeof i==`string`&&a.includes(i)&&(s.defaults={palette:i}),s}var Qe=[E,He,ce,Te,me,_,Oe];function $e(e){let t=c(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var et=[`p`,`st`,`c`,`t`];function tt(e,t,n){let r={...c(t)??{}},i={...c(r.style)??{}};e.register(r,`slot`);for(let t of et)t in r&&e.retire(r,t);e.register(i,`style`),e.take(r,`style`),e.retire(r,`s`);for(let t of Ee)e.retire(i,t);return r.id===void 0&&(r.id=`layer-${n+1}`),{raw:r,style:i,type:typeof r.type==`string`?r.type:`text`}}function nt(e,t){let{raw:n}=t,r={id:String(e.take(n,`id`)),type:Ke[t.type]??`shape`,box:{x:0,y:0,width:0,height:0}};e.take(n,`type`),t.type in Ke||e.note(`slot.type: unknown layer type "${t.type}"`);let i=e.take(n,`name`);typeof i==`string`&&i&&(r.name=i);let a=e.take(n,`languages`);if(Array.isArray(a)&&!a.includes(`*`)){let e=a.filter(e=>typeof e==`string`&&e.length>0);e.length>0?r.languages=[...new Set(e)]:r.visible=!1}let o=e.take(n,`pendingTranslation`);return Array.isArray(o)&&o.length>0&&(r.extensions={...r.extensions,studio:{pendingTranslation:o}}),r}function rt(e){e.type===`shape`&&(e.geometry??={kind:`rect`}),e.type===`text`&&(e.text??={content:{}}),e.type===`image`&&(e.image??={src:`oim:base`}),e.type===`group`&&(e.children??=[]),e.children?.forEach(rt)}function it(e){if($e(e))return{document:e,retired:[],unhandled:[]};let t=n(c(e)??{}),r=s(Ie(t),Le(t)[0],Re(t));r.register(t,`root`);let{document:i,slots:a}=ze(r,t),o=a.map((e,t)=>tt(r,e,t)),l=o.map(e=>{let t=nt(r,e);for(let n of Qe)n(r,e,t);return t}),u=new Map;o.forEach((e,t)=>{let n=r.take(e.raw,`zone_id`);typeof n==`string`&&n&&u.set(l[t],n)}),i.layers=Xe(r,t,qe(r,o,l),u);let d=Ze(r,t,i.languages);d&&(i.variables=d);let f=ue(r,t);f.length>0&&(i.canvas={...i.canvas,fills:f});let p=he(r,t);return p.length>0&&i.layers.push({id:`__canvas-effects`,type:`shape`,box:{x:0,y:0,width:r.canvas.width,height:r.canvas.height},geometry:{kind:`rect`},effects:p}),i.layers.forEach(rt),{document:i,...r.finish()}}globalThis.__oimUpgrade=it})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oim-media/player-oim",
3
- "version": "1.27.10",
3
+ "version": "1.27.11",
4
4
  "description": "Web player for OIM interactive images: a framework-free <oim-player> element that verifies the signature and composes each layer.",
5
5
  "keywords": [
6
6
  "oim",
@@ -16,7 +16,7 @@
16
16
  "main": "./dist/esm/index.js",
17
17
  "types": "./src/index.d.ts",
18
18
  "dependencies": {
19
- "@oim-media/core": "1.27.10",
19
+ "@oim-media/core": "1.27.11",
20
20
  "lottie-web": "^5.12.2"
21
21
  },
22
22
  "devDependencies": {
@@ -1 +0,0 @@
1
- (function(){var e=new Map([[`publico`,`public`],[`solo_autor`,`author_only`],[`sellado`,`sealed`]]),t=new Set([`public`,`author_only`,`sealed`]);function n(n){let r={...n};if(r.reedit===void 0&&`reedicion`in r){let t=r.reedicion;r.reedit=typeof t==`string`?e.get(t)??`author_only`:`author_only`}return r.reedit!==void 0&&!(typeof r.reedit==`string`&&t.has(r.reedit))&&(r.reedit=`author_only`),delete r.reedicion,r}var r={text:[`fills`,`strokes`,`effects`,`animations`,`motion`,`mask`,`text`,`interactions`],shape:[`fills`,`strokes`,`effects`,`animations`,`motion`,`mask`,`geometry`,`corners`,`a11y`,`interactions`],image:[`strokes`,`effects`,`animations`,`motion`,`mask`,`corners`,`image`,`a11y`,`interactions`],lottie:[`effects`,`animations`,`motion`],group:[`effects`,`animations`,`motion`,`interactions`,`children`]};function i(e,t){return r[e].includes(t)}var a=new Set([`primary`,`on-primary`,`secondary`,`on-secondary`,`surface`,`on-surface`,`outline`,`accent`,`text-primary`,`text-secondary`,`text-muted`,`text-on-accent`]);function o(e){return typeof e==`string`&&a.has(e)}function s(e,t,n=new Set){let r=new Map,i=new Map,a=new Set,s=new Set,c=(e,t)=>{let n=i.get(e);n||i.set(e,n=new Set),n.add(t)};return{canvas:e,language:t,hasRole:e=>n.has(e)||o(e),register(e,t){r.set(e,t)},take(e,t){return c(e,t),e[t]},retire(e,t){c(e,t),e[t]!==void 0&&a.add(`${r.get(e)??`?`}.${t}`)},note(e){s.add(e)},finish(){let e=new Set(s);for(let[t,n]of r){let r=i.get(t);for(let i of Object.keys(t))t[i]!==void 0&&!r?.has(i)&&e.add(`${n}.${i}`)}return{retired:[...a].sort(),unhandled:[...e].sort()}}}}function c(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var l=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,u=[[`o`,`opacity`,1],[`s`,`scale`,1],[`r`,`rotation`,0],[`x`,`x`,0],[`y`,`y`,0],[`b`,`blur`,0]],d=new Set([`x`,`y`,`scale`,`rotation`]);function f(e,t){let n=e.map(c).filter(e=>!!e&&l(e.t)!==void 0);if(n.length<2)return[];let r=[];for(let[e,i,a]of u){let o=n.filter(t=>l(t[e])!==void 0);if(!o.some(t=>t[e]!==a))continue;let s=(d.has(i)?n:o).map(n=>{let r={t:Math.min(1,Math.max(0,n.t/t)),v:l(n[e])??a};return n.e!==void 0&&(r.e=n.e),r});if(s.length===1){let e=s[0].t;e>0&&s.unshift({t:0,v:a}),e<1&&s.push({t:1,v:a})}r.push({property:i,keyframes:s})}return r}var p={"rise-words":`words`,"reveal-mask":`lines`};function m(e,t,n){let r=[],i=(e,t,n)=>{n!==t&&r.push({property:e,keyframes:[{t:0,v:t},{t:1,v:n}]})},a=l(t.scale);a!==void 0&&i(`scale`,1,a>10?a/100:a);let o=l(t.rotation);o!==void 0&&i(`rotation`,n.box.rotation??0,o);let s=l(t.opacity);if(s!==void 0&&i(`opacity`,n.opacity??1,s/100),t.color&&e.note(`style.states.hover.color: a hover colour is not carried to 2.0`),r.length!==0)return{on:`hover`,tracks:r,duration:Math.max(0,l(t.transitionDuration)??0)}}var h=new Set([`show`,`hide`,`toggle`,`setText`,`play`]);function g(e,t){let n=(Array.isArray(e.actions)?e.actions:[]).map(c).filter(e=>!!e&&typeof e.target==`string`&&typeof e.type==`string`&&h.has(e.type)).map(e=>({type:e.type,target:e.target,...typeof e.value==`string`?{value:e.value}:{}}));return n.length>0?{on:t,actions:n}:void 0}function _(e,t,n){let{raw:r,style:a}=t,o=[],s=[],u=c(e.take(a,`animation`));if(u){let t=l(u.duration),n=l(u.delay),r=t||8,i=Array.isArray(u.keyframes)&&r>0?f(u.keyframes,r):[];i.length>0&&o.push({on:u.trigger===`action`?`action`:`loop`,tracks:i,duration:r*1e3}),typeof u.loop==`string`&&u.loop!==`none`&&u.loop!==`custom`&&o.push({on:`loop`,preset:u.loop,duration:t&&t>0?t*1e3:0,...n&&n>0?{delay:n*1e3}:{}}),typeof u.hover==`string`&&u.hover!==`none`&&u.hover!==`custom`&&o.push({on:`hover`,preset:u.hover,duration:200});for(let t of[`custom_loop_css`,`custom_keyframes`,`custom_hover_css`])u[t]&&e.note(`style.animation.${t}: raw CSS is not carried to 2.0`)}let d=e.take(a,`textAnimationType`),h=l(e.take(a,`textAnimationSpeed`)),_=l(e.take(a,`textAnimationDelay`)),v=l(e.take(a,`textAnimationIntensity`)),y=e.take(a,`typewriterCursor`);if(n.type===`text`&&typeof d==`string`&&d&&d!==`none`){let e={};h!==void 0&&(e.speed=h),v!==void 0&&(e.intensity=v),typeof y==`boolean`&&(e.cursor=y),o.push({on:`load`,target:p[d]??`chars`,preset:d,...Object.keys(e).length>0?{params:e}:{},duration:0,..._?{delay:_*1e3}:{}})}let b=c(e.take(a,`reveal`));b&&typeof b.effect==`string`&&o.push({on:`enter`,preset:b.effect,duration:l(b.duration)??300,...b.easing===void 0?{}:{easing:b.easing}});let x=l(e.take(a,`trimStart`)),S=l(e.take(a,`trimEnd`)),C=l(e.take(a,`trimDuration`)),w=e=>Math.min(1,Math.max(0,e/100)),T=w(x??0),E=w(S??100),D=Math.max(0,C??0),O=r.content,k=typeof O==`string`?[O]:Object.values(c(O)??{}),A=t.type!==`image`&&k.some(e=>typeof e==`string`&&/(<|&lt;)svg|<span|<div|<a|<img/i.test(e));n.type===`shape`&&n.geometry&&A&&a.strokeWidth&&((T>0||E<1)&&(n.geometry.trim={...T>0?{start:T}:{},...E<1?{end:E}:{}}),D>0&&o.push({on:`load`,duration:D*1e3,tracks:[{property:`trimEnd`,keyframes:[{t:0,v:T},{t:1,v:E}]}]}));let j=c(e.take(r,`states`))??c(e.take(a,`states`))??{},M=r.isInteractive===!0||a.isInteractive===!0;e.take(r,`isInteractive`);for(let[t,r]of[[`hover`,`hover`],[`active`,`press`]]){let i=c(j[t]);if(!i)continue;let a=M&&r===`hover`?m(e,i,n):void 0;a&&o.push(a);let l=M?g(i,r):void 0;l&&s.push(l)}let N=c(e.take(r,`interaction`)),P=c(N?.target);if(N?.action_type===`toggle_elements`&&P){let e=e=>Array.isArray(e)?e.filter(e=>typeof e==`string`):[],t=[...e(P.show_slots).map(e=>({type:`show`,target:e})),...e(P.hide_slots).map(e=>({type:`hide`,target:e}))];t.length>0&&s.push({on:`press`,actions:t})}e.take(a,`isInteractive`);let F=c(e.take(r,`parallax`))??c(e.take(a,`parallax`));if(e.take(a,`parallax`),F&&F.enabled!==!1){let t=c(F.infinite)??{},i=t.enabled===!1?0:l(F.speedPxSec)??l(t.speedPxSec)??l(t.speed_px_sec)??(F.mode===`infinite_horizontal`?l(F.speed)??20:0),o=(...e)=>e.find(e=>e!==void 0),s=o(F.direction,t.direction),u=o(F.mirror,F.seamlessTile,t.mirror,t.seamlessTile,t.seamless_tile),d=o(F.pauseOnHover,t.pauseOnHover,t.pause_on_hover);i===0?F.mode!==`infinite_horizontal`&&e.retire(r.parallax===void 0?a:r,`parallax`):n.motion={loop:{speedPxSec:Math.min(500,Math.max(-500,i)),...s===`left_to_right`||s===`right_to_left`?{direction:s}:{},...u===void 0?{}:{mirror:!!u},...d===void 0?{}:{pauseOnHover:!!d}}}}e.retire(a,`sceneLoop`),e.retire(r,`isParallaxGroup`),e.retire(a,`isParallaxGroup`),e.retire(r,`is_parallax_group`),e.retire(a,`loopDepth`),e.retire(r,`tracking_data`);let I=e.take(a,`cssAnimation`);typeof I==`string`&&I&&!/^background-animation-/.test(I)&&e.note(`style.cssAnimation: raw CSS is not carried to 2.0`),o.length>0&&(n.animations=o),s.length>0&&i(n.type,`interactions`)&&(n.interactions=s)}function v(e,t=800){if(e==null||e===``)return null;if(typeof e==`number`)return Number.isFinite(e)?e:null;let n=String(e).trim();if(n.endsWith(`cqw`)||n.endsWith(`%`)){let e=parseFloat(n);return Number.isFinite(e)?e/100*t:null}if(n.endsWith(`px`)){let e=parseFloat(n);return Number.isFinite(e)?e:null}let r=parseFloat(n);return Number.isFinite(r)?r:null}var y=new Set([`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`difference`]);function b(e,t){if(typeof e!=`number`&&typeof e!=`string`)return;let n=v(e,t);return n!==null&&Number.isFinite(n)?n:void 0}var x=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,S=new Set([`geo`,`shape`,`draw`,`filter`,`container`,`mask`,`artistic-text`]),C=.1;function w(e,t,n){if(e==null||e===``)return;if(typeof e==`number`)return Number.isFinite(e)&&t>0?e/t*n:void 0;let r=String(e).trim(),i=parseFloat(r);if(Number.isFinite(i))return r.endsWith(`cqw`)?i/100*n:r.endsWith(`%`)?i/100*t:r.endsWith(`px`)?i:/^-?[\d.]+$/.test(r)&&t>0?i/t*n:void 0}var T=e=>typeof e==`string`?e!==``:!!e&&typeof e==`object`&&Object.values(e).some(e=>typeof e==`string`&&e!==``);function E(e,t,n){let{raw:r,style:i}=t,{width:a,height:o}=e.canvas,s=e.take(r,`position`),[c,l]=Array.isArray(s)?s:[],u=x(c)??0,d=x(l)??0;(u>1||d>1)&&(u/=100,d/=100);let f=x(e.take(r,`width_px`)),p=x(e.take(r,`height_px`)),m=x(e.take(r,`widthPercent`)),h=x(e.take(r,`heightPercent`)),g=e.take(i,`width`),_=e.take(i,`height`),v=(e,t,n,r)=>e??(t===void 0?b(n,r)??0:t/100*r),E=v(f,m,g,a),D=v(p,h,_,o),O=String(r.type??`text`),k=S.has(O)&&(O!==`mask`||i.maskMode!==`cutout`),A=r.is_background_pattern===!0||r.id===`background-pattern-slot`,j=T(r.content),M=[w(g,a,a),w(_,o,a)],N=[f??(m===void 0?void 0:m/100*a),p===void 0?h===void 0?void 0:h/100*a:p/a*a],P;P=M[0]!==void 0&&M[1]!==void 0?M:N[0]!==void 0&&N[1]!==void 0&&(k||O===`image`||!j)?N:O===`image`||k&&!j||A||O===`pattern`?[0,1].map(e=>N[e]??M[e]??C*a):[void 0,void 0];let F=i.textAlign??r.align??`left`,I=e=>F===`center`?e/2:F===`right`?e:0,L=u*a+I(E),R=d*o+D/2,[z,B]=P;z===void 0||B===void 0?O!==`text`&&!j?n.box={x:u*a,y:d*o,width:Math.max(0,E),height:Math.max(0,D)}:(n.box={x:L,y:R,anchor:F===`center`?`center`:F===`right`?`right`:`left`},E>0&&(n.box.width=E)):n.box={x:L-I(z),y:R-B/2,width:Math.max(0,z),height:Math.max(0,B)};let V=x(e.take(i,`rotation`));V&&(n.box.rotation=V);let H=x(e.take(i,`opacity`));H!==void 0&&H<100&&(n.opacity=Math.max(0,H)/100);let U=e.take(r,`isVisible`)===!1;(e.take(i,`isVisible`)===!1||U)&&(n.visible=!1);let W=e.take(i,`blendMode`);typeof W==`string`&&y.has(W)&&(n.blend=W)}var D={"to top":0,"to right":90,"to bottom":180,"to left":270,"to top right":45,"to bottom right":135,"to bottom left":225,"to top left":315},O=/^(#[0-9a-f]{3,8}|(?:rgb|rgba|hsl|hsla)\([^()]*\)|[a-z]+)$/i;function k(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n--:a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}function A(e){let t=/^(.*?)(?:\s+(-?[\d.]+)%)?$/.exec(e);if(!t)return null;let n=t[1].trim();if(!O.test(n))return null;if(t[2]===void 0)return{color:n};let r=Number(t[2])/100;return Number.isFinite(r)?{color:n,at:Math.min(1,Math.max(0,r))}:null}function j(e){if(typeof e!=`string`)return null;let t=/^\s*(linear|radial|conic)-gradient\((.*)\)\s*$/is.exec(e);if(!t)return null;let n=t[1].toLowerCase(),r=k(t[2]);if(!r||r.some(e=>e===``))return null;let i,a=r[0].toLowerCase(),o=/^(?:from\s+)?(-?[\d.]+)deg$/.exec(a);o?(i=Number(o[1]),r.shift()):a in D?(i=D[a],r.shift()):n===`radial`&&/^(circle|ellipse)\b/.test(a)&&r.shift();let s=r.map(A);if(s.length<2||s.some(e=>e===null))return null;let c={type:n,stops:s};return i!==void 0&&Number.isFinite(i)&&(c.angle=i),c}var M=[1,0,0,1,0,0],N=new Set([`path`,`rect`,`circle`,`ellipse`,`line`,`polyline`,`polygon`]),P=new Set([`svg`,`g`]),F=new Set([`title`,`desc`,`metadata`]);function I(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}var L=e=>(e.match(/-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?/gi)??[]).map(Number);function R(e){let t=M,n=[...e.matchAll(/([a-zA-Z]+)\s*\(([^)]*)\)/g)];if(n.length===0&&e.trim()!==``)return null;for(let[,e,r]of n){let n=L(r),i;if(e===`matrix`&&n.length===6)i=n;else if(e===`translate`&&n.length>=1)i=[1,0,0,1,n[0],n[1]??0];else if(e===`scale`&&n.length>=1)i=[n[0],0,0,n[1]??n[0],0,0];else if(e===`rotate`&&n.length>=1){let e=n[0]*Math.PI/180,t=[Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0];i=n.length>=3?I(I([1,0,0,1,n[1],n[2]],t),[1,0,0,1,-n[1],-n[2]]):t}else if(e===`skewX`&&n.length===1)i=[1,0,Math.tan(n[0]*Math.PI/180),1,0,0];else if(e===`skewY`&&n.length===1)i=[1,Math.tan(n[0]*Math.PI/180),0,1,0,0];else return null;t=I(t,i)}return t}function z(e){let t={};for(let[,n,,r,i]of e.matchAll(/([a-zA-Z_:][\w:.-]*)\s*=\s*("([^"]*)"|'([^']*)')/g))t[n]=r??i??``;return t}var B=new Set([`x`,`width`,`cx`,`rx`,`x1`,`x2`]),V=new Set([`y`,`height`,`cy`,`ry`,`y1`,`y2`]),H=(e,t,n)=>{let r=e[t]??`0`,i=Number.parseFloat(r);if(!Number.isFinite(i))return 0;if(!r.trim().endsWith(`%`)||!n)return i;let[a,o]=[n[2],n[3]],s=B.has(t)?a:V.has(t)?o:Math.sqrt((a*a+o*o)/2);return i/100*s};function U(e){if(e.type===`svg`)return!0;let t=e.raw.content;return(typeof t==`string`?[t]:t&&typeof t==`object`?Object.values(t):[]).some(e=>typeof e==`string`&&/<svg/i.test(e))}function W(e,t,n){let r=(e,t)=>H(e,t,n);if(e===`path`)return t.d?.trim()||null;if(e===`rect`){let[e,n,i,a]=[r(t,`x`),r(t,`y`),r(t,`width`),r(t,`height`)];if(!(i>0)||!(a>0))return null;let o=t.rx===void 0?t.ry===void 0?0:r(t,`ry`):r(t,`rx`),s=t.ry===void 0?o:r(t,`ry`);return o=Math.min(o,i/2),s=Math.min(s,a/2),!(o>0)||!(s>0)?`M${e} ${n}H${e+i}V${n+a}H${e}Z`:`M${e+o} ${n}H${e+i-o}A${o} ${s} 0 0 1 ${e+i} ${n+s}V${n+a-s}A${o} ${s} 0 0 1 ${e+i-o} ${n+a}H${e+o}A${o} ${s} 0 0 1 ${e} ${n+a-s}V${n+s}A${o} ${s} 0 0 1 ${e+o} ${n}Z`}if(e===`circle`||e===`ellipse`){let[n,i]=[r(t,`cx`),r(t,`cy`)],a=e===`circle`?r(t,`r`):r(t,`rx`),o=e===`circle`?a:r(t,`ry`);return!(a>0)||!(o>0)?null:`M${n-a} ${i}A${a} ${o} 0 1 0 ${n+a} ${i}A${a} ${o} 0 1 0 ${n-a} ${i}Z`}if(e===`line`)return`M${r(t,`x1`)} ${r(t,`y1`)}L${r(t,`x2`)} ${r(t,`y2`)}`;let i=L(t.points??``);if(i.length<4||i.length%2!=0)return null;let a=`M${i[0]} ${i[1]}`;for(let e=2;e<i.length;e+=2)a+=`L${i[e]} ${i[e+1]}`;return e===`polygon`?`${a}Z`:a}var ee=[`fill`,`stroke`,`stroke-width`,`stroke-linecap`,`stroke-linejoin`,`fill-rule`];function te(e,t){for(let n of Object.keys(t)){let t=n.toLowerCase();if(t===`style`)return`<${e}> carries a style attribute`;if(t.startsWith(`on`))return`<${e}> carries an event handler (${n})`;if(t===`href`||t.endsWith(`:href`))return`<${e}> carries a reference (${n})`}for(let n of[`fill`,`stroke`])if(/url\s*\(/i.test(t[n]??``))return`<${e}> paints with a reference (${n})`;return null}function ne(e){if(typeof e!=`string`||e.trim()===``)return{ok:!1,reason:`not an SVG string`};let t=e.replace(/<!--[\s\S]*?-->/g,``).replace(/<\?[\s\S]*?\?>/g,``).replace(/<!DOCTYPE[^>]*>/gi,``),n=[],r=[],i,a=0,o=!1;for(let[,e,s,c,l]of t.matchAll(/<(\/?)([a-zA-Z][\w:-]*)([^>]*?)(\/?)>/g)){if(F.has(s)){e?a--:l||a++;continue}if(a>0)continue;if(e){r.pop();continue}if(!P.has(s)&&!N.has(s))return{ok:!1,reason:`<${s}> is outside the static profile`};let t=z(c),u=te(s,t);if(u)return{ok:!1,reason:u};let d=r[r.length-1],f=t.transform===void 0?M:R(t.transform);if(!f)return{ok:!1,reason:`<${s}> has a transform that cannot be read`};let p=d?I(d.matrix,f):f,m={...d?.attrs??{}};for(let e of ee)t[e]!==void 0&&(m[e]=t[e]);if(s===`svg`&&!o){o=!0;let e=L(t.viewBox??``),[n,r]=[Number.parseFloat(t.width??``),Number.parseFloat(t.height??``)];e.length===4?i=e:n>0&&r>0&&!/%/.test(`${t.width}${t.height}`)&&(i=[0,0,n,r])}if(N.has(s)){let e=W(s,t,i);if(!e)continue;let r={d:e},a=m.fill??`black`;a!==`none`&&(r.fill=a);let o=m.stroke;if(o&&o!==`none`){r.stroke=o;let e=Number.parseFloat(m[`stroke-width`]??`1`);r.strokeWidth=Number.isFinite(e)?e:1;let t=m[`stroke-linecap`],n=m[`stroke-linejoin`];(t===`round`||t===`square`)&&(r.cap=t),(n===`round`||n===`bevel`)&&(r.join=n)}m[`fill-rule`]===`evenodd`&&(r.fillRule=`evenodd`);let c=Number.parseFloat(t.opacity??``);Number.isFinite(c)&&c<1&&(r.opacity=Math.max(0,c)),p.some((e,t)=>Math.abs(e-M[t])>1e-9)&&(r.transform=p.map(e=>Number(e.toFixed(6)))),n.push(r)}P.has(s)&&!l&&r.push({name:s,matrix:p,attrs:m})}return o?i?n.length===0?{ok:!1,reason:`nothing to draw`}:{ok:!0,value:{viewBox:i,paths:n}}:{ok:!1,reason:`the <svg> declares no viewBox nor a size in units`}:{ok:!1,reason:`no <svg> element`}}var G=e=>typeof e==`string`&&e!==``&&e!==`transparent`&&e!==`none`;function K(e,t,n,r){let i=e.take(t,n),a=r?e.take(t,r):void 0;return typeof a==`string`&&e.hasRole(a)?G(i)?{var:a,fallback:i}:{var:a}:G(i)?i:void 0}var q=e=>Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`number`)?e:void 0;function J(e,t,n,r){let i=e.take(t,`${n}Type`),a=K(e,t,`${n}Color`,`${n}ColorRole`),o=K(e,t,`${n}BgColor`,`${n}BgColorRole`),s=e.take(t,`${n}Colors`),c=e.take(t,`${n}Scale`),l=e.take(t,`${n}Speed`),u=e.take(t,`${n}Direction`),d=e.take(t,`${n}Svgs`),f=q(e.take(t,`${n}Sizes`)),p=q(e.take(t,`${n}Counts`))??q(e.take(t,`${n}Count`)),m=q(e.take(t,`${n}Dispersions`))??q(e.take(t,`${n}Dispersion`)),h=Array.isArray(s)?s.filter(G):[],g=n===`backgroundPattern`&&typeof t.svgRawXml==`string`&&t.svgRawXml!==``;if((typeof i!=`string`||!i)&&!g&&a===void 0&&o===void 0&&h.length===0)return;let _=typeof i==`string`&&i?{preset:i}:{};h.length>0&&a!==void 0&&typeof a==`object`&&(h[0]=a),h.length>0?_.colors=h:a!==void 0&&(_.colors=[a]),o!==void 0&&(_.bg=o),typeof c==`number`&&c!==1&&(_.scale=c),f&&(_.sizes=f),p&&(_.counts=p),m&&(_.dispersions=m),Array.isArray(d)&&d.length>0&&(_.svgs=d.filter(e=>typeof e==`string`));let v=typeof r==`string`?/^background-animation-([a-z-]+)\s+([\d.]+)s\b/.exec(r):null,y=typeof u==`string`&&u!==`none`?u:v?.[1],b=typeof l==`number`&&l>0?l:v?Number(v[2]):n===`backgroundPattern`&&y?8:void 0;return y&&re.has(y)&&b&&(_.motion={direction:y,period:b}),{kind:`pattern`,pattern:_}}var re=new Set([`right`,`left`,`up`,`down`,`zoom-in`,`zoom-out`,`pulse`]);function Y(e,t,n,r){let i=e.take(t,n);if(i==null||i===``)return;let a=j(i);if(!a)e.note(`${r}.${n}: gradient not understood`);else return{kind:`gradient`,gradient:a}}function ie(e,t){let n=e.take(t,`fillImage`),r=c(e.take(t,`fillImageCrop`)),i=e.take(t,`fillImageFlipX`),a=e.take(t,`fillImageFlipY`);if(typeof n!=`string`||!n)return;let o={kind:`image`,src:n};return r&&(o.crop=r),i===!0&&(o.flipX=!0),a===!0&&(o.flipY=!0),o}var ae=new Set([`metallic-chrome`,`sunset-gold`,`neon-glow`,`linear`]);function oe(e,t){let{style:n}=t,r=e.take(n,`fillType`),i=e.take(n,`backgroundType`),a=K(e,n,`fillColor`,typeof n.fillColorRole==`string`&&n.fillColorRole?`fillColorRole`:`colorRole`);e.take(n,`fillColorRole`),e.take(n,`colorRole`),e.take(n,`color`);let o=Y(e,n,`fillGradient`,`style`),s=ie(e,n),l=n.cssAnimation,u=J(e,n,`fillPattern`,l),d=J(e,n,`backgroundPattern`,l),f=c(e.take(n,`fillGenerative`))??c(e.take(n,`backgroundGenerative`)),p=e.take(n,`backgroundFit`),m=e.take(n,`textGradientType`);d&&p===`cover`&&`pattern`in d&&(d.pattern.fit=`cover`);let h=u??d;h&&typeof l==`string`&&/^background-animation-/.test(l)&&e.take(n,`cssAnimation`);let g=()=>a===void 0?void 0:{kind:`color`,value:a},_=typeof r==`string`?r:typeof i==`string`?i:t.type===`pattern`||d?`pattern`:`color`;if(_!==`none`&&_!==`transparent`)return _===`gradient`?o??g():_===`image`?s?a===void 0?s:[s,g()]:g():_===`pattern`?h??g():_===`generative`?f?{kind:`generative`,generative:f}:g():(t.type===`text`||t.type===`artistic-text`)&&typeof m==`string`&&ae.has(m)&&m!==`linear`?{kind:`gradient`,preset:m}:g()}function X(e,t,n,r,i={},a){let o=K(e,t,n,a),s=e.take(t,r);if(typeof s==`number`&&s>0&&o!==void 0)return{paint:{kind:`color`,value:o},width:s,...i}}function se(e,t){let n=typeof t.textStrokeColorRole==`string`&&t.textStrokeColorRole?`textStrokeColorRole`:`strokeColorRole`,r=t.textStrokeWidth,i=K(e,t,`textStrokeColor`,n);if(e.take(t,`textStrokeColorRole`),e.take(t,`textStrokeWidth`),typeof r==`number`&&r>0)return{paint:{kind:`color`,value:i??`#000000`},width:r}}function ce(e,t,n){let{style:r}=t,a=oe(e,t),o=Array.isArray(a)?a[0]:a,s=r.geoShape,c=typeof r.svgPath==`string`&&r.svgPath!==``&&(s===void 0||s===`custom`),l=t.type===`geo`&&(c||s===`scribble`)&&!!o&&`kind`in o&&o.kind===`color`;o&&!l&&i(n.type,`fills`)&&(n.fills=Array.isArray(a)?a:[o]);let u=e.take(r,`strokeStyle`),d=u===`dashed`||u===`dotted`?{style:u}:{},f=e.take(r,`borderStyle`),p=X(e,r,`borderColor`,`borderWidth`,f===`dashed`||f===`dotted`?{style:f}:{}),m=U(t),h=m?K(e,r,`strokeColor`,`strokeColorRole`):void 0;m&&e.take(r,`strokeWidth`);let g=h===void 0?X(e,r,`strokeColor`,`strokeWidth`,d,`strokeColorRole`):{paint:{kind:`color`,value:h},width:0};if(!g&&r.geoShape===`scribble`){let t=typeof r.strokeWidth==`number`&&r.strokeWidth>0?r.strokeWidth:2;g={paint:{kind:`color`,value:K(e,r,`strokeColor`,`strokeColorRole`)??K(e,r,`fillColor`,`fillColorRole`)??`#2563EB`},width:t,...d}}let _=se(e,r),v=X(e,r,`outerStrokeColor`,`outerStrokeWidth`,{align:`outside`}),y=X(e,r,`innerStrokeColor`,`innerStrokeWidth`,{align:`inside`}),b=(n.type===`text`?[_,v,y]:[g,f===`solid`||f===`dashed`||f===`dotted`?p:void 0,_,v,y]).filter(e=>e!==void 0);b.length>0&&i(n.type,`strokes`)&&(n.strokes=b)}var le=[[`tipo`,`type`],[`color`,`color`],[`angulo`,`angle`],[`cruzada`,`crossed`],[`grosor`,`thickness`],[`tamano`,`size`]];function ue(e,t){let n=e.take(t,`backgroundType`),r=K(e,t,`backgroundColor`),i=Y(e,t,`backgroundGradient`,`root`);for(let n of[`backgroundGradientAngle`,`backgroundGradientStart`,`backgroundGradientEnd`,`backgroundGradientType`])e.take(t,n);let a=J(e,t,`backgroundPattern`),o=c(e.take(t,`backgroundGenerative`)),s=c(e.take(t,`backgroundTexture`)),l=[],u=r===void 0?void 0:{kind:`color`,value:r};if(n===`gradient`?l.push(...[i??u].filter(e=>!!e)):n===`pattern`?l.push(...[a??u].filter(e=>!!e)):n===`generative`&&o?l.push({kind:`generative`,generative:o}):n!==`transparent`&&u&&l.push(u),s&&typeof s.tipo==`string`){let e={};for(let[t,n]of le)s[t]!==void 0&&(e[n]=s[t]);let t={kind:`texture`,texture:e};typeof s.opacidad==`number`&&(t.opacity=Math.min(1,Math.max(0,s.opacidad))),l.push(t)}return l}var de={grayscale:`grayscale(1)`,sepia:`sepia(0.8)`,"high-contrast":`contrast(1.5) saturate(1.2)`,vintage:`sepia(0.35) contrast(1.1) saturate(0.85) brightness(1.05)`,cool:`saturate(1.1) hue-rotate(15deg) brightness(1.02)`,warm:`saturate(1.15) hue-rotate(-12deg) brightness(1.03)`,faded:`contrast(0.85) brightness(1.1) saturate(0.8)`,cinema:`contrast(1.25) saturate(1.1) hue-rotate(-8deg) brightness(0.95)`,nordic:`saturate(0.7) hue-rotate(20deg) brightness(1.05) contrast(1.1)`,sunset:`sepia(0.4) saturate(1.4) hue-rotate(-20deg) brightness(1.05)`,noir:`grayscale(1) contrast(1.6) brightness(0.9)`,dramatic:`contrast(1.6) saturate(1.3) brightness(0.95)`,cyberpunk:`contrast(1.3) saturate(1.8) hue-rotate(140deg)`,pastel:`brightness(1.15) saturate(1.3) contrast(0.9) hue-rotate(-5deg)`,vhs:`sepia(0.2) contrast(1.2) saturate(1.5) hue-rotate(30deg) brightness(1.05)`},Z=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0;function fe(e,t,n=!1){let r=e.take(t,`filterPreset`),i=e.take(t,`fp`),a=n?r||i:r,o=Z(e.take(t,`filterBlur`)),s=Z(e.take(t,`filterBrightness`)),c=Z(e.take(t,`filterContrast`)),l=Z(e.take(t,`filterSaturate`)),u=Z(e.take(t,`filterHueRotate`)),d={};return typeof a==`string`&&(Object.hasOwn(de,a)||n&&a===`duotone`)&&(d.preset=a),o&&(d.blur=o),s!==void 0&&s!==100&&(d.brightness=s/100),c!==void 0&&c!==100&&(d.contrast=c/100),l!==void 0&&l!==100&&(d.saturate=l/100),u&&(d.hueRotate=u),Object.keys(d).length>0?d:void 0}function pe(e,t,n={}){let r=c(t);if(!r||r.enabled===!1)return;let i=(t,n)=>{let i=r.colorRole||n,a=typeof r.color==`string`&&r.color?r.color:t,o=typeof i==`string`&&e.hasRole(i)?a?{var:i,fallback:a}:{var:i}:a;return o===void 0?{}:{color:o}},a=i(void 0,void 0);switch(r.type){case`drop-shadow`:{if(n.glyphsInSvg)return;let e={kind:`shadow`,y:4,blur:12,...i(`rgba(0, 0, 0, 0.35)`,n.shadowRole)};for(let t of[`x`,`y`,`blur`,`spread`]){let n=Z(r[t]);n!==void 0&&(e[t]=t===`blur`?Math.max(0,n):n)}return e.x||delete e.x,e}case`glow`:{if(n.glyphsInSvg)return;let e={kind:`glow`,radius:Z(r.radius)||16,...i(`#f59e0b`,n.glowRole)},t=Z(r.intensity);return t!==void 0&&(e.intensity=t),e}case`blur`:return{kind:`blur`,radius:Z(r.radius)??8};case`color-grade`:{if(typeof r.preset!=`string`)return;let e=Z(r.intensity);return{kind:`color-grade`,preset:r.preset,...e===void 0?{}:{intensity:e}}}case`texture`:{if(typeof r.preset!=`string`)return;let e={kind:`texture`,preset:r.preset,...a},t=Z(r.intensity),n=Z(r.scale);return t!==void 0&&(e.intensity=t),typeof r.blend==`string`&&(e.blend=r.blend),n!==void 0&&n!==1&&(e.scale=n),e}default:e.note(`style.effects: unknown effect type "${String(r.type)}"`);return}}function Q(e,t,n){return Array.isArray(t)?t.map(t=>pe(e,t,n)).filter(e=>!!e):[]}function me(e,t,n){let{style:r}=t,i=[],a=e.take(r,`effect`),o=K(e,r,`effectColor`,`effectColorRole`),s=Z(e.take(r,`effectRadius`));a===`neon`&&i.push({kind:`glow`,radius:s??16,color:o??`#f59e0b`});let c=e.take(r,`effects`),l=Array.isArray(c)&&c.length>0,u=e.take(r,`shadowEnabled`)===!0&&!l,d,f=K(e,r,`shadowColor`,`shadowColorRole`),p=Z(e.take(r,`shadowBlur`)),m=Z(e.take(r,`shadowOffsetX`)),h=Z(e.take(r,`shadowOffsetY`)),g=Z(e.take(r,`shadowOpacity`));if(u){let e={kind:`shadow`};m&&(e.x=m),h&&(e.y=h),p&&(e.blur=p),f!==void 0&&(e.color=f),g!==void 0&&g<100&&(e.opacity=Math.max(0,g)/100),d=e}let _=Z(e.take(r,`layerBlur`))??Z(e.take(r,`blur`));e.take(r,`blur`),l?i.push(...Q(e,c,{shadowRole:r.shadowColorRole,glowRole:r.effectColorRole,glyphsInSvg:t.type===`artistic-text`})):_&&_>0&&i.push({kind:`blur`,radius:_});let v=fe(e,r,t.type===`filter`);if(t.type===`filter`)i.push({kind:`backdrop`,...v});else if(v){let e=n.fills?.find(e=>`kind`in e&&e.kind===`image`);n.image?n.image.filters=v:e&&`kind`in e&&e.kind===`image`&&(e.filters=v)}let y=e.take(r,`grain`)===!0,b=Z(e.take(r,`grainIntensity`)),x=Z(e.take(r,`grainSize`)),S=e.take(r,`grainBlend`);if(y&&!l){let e={kind:`grain`};b!==void 0&&(e.intensity=b),x!==void 0&&(e.size=x),typeof S==`string`&&(e.blend=S),i.push(e)}d&&i.push(d),i.length>0&&(n.effects=i)}function he(e,t){let n=Q(e,e.take(t,`effects`)),r=c(e.take(t,`grain`));if(r&&r.enabled!==!1){let e={kind:`grain`},t=Z(r.intensity),i=Z(r.baseFrequency);t!==void 0&&(e.intensity=t),i!==void 0&&(e.size=i),typeof r.blendMode==`string`&&(e.blend=r.blendMode),typeof r.color==`string`&&(e.color=r.color),n.push(e)}return n}var ge={rectangle:{kind:`rect`},circle:{kind:`ellipse`},line:{kind:`line`}},_e=e=>{let t=typeof e==`string`?e.trim().split(/[\s,]+/).map(Number):[];return t.length===4&&t.every(Number.isFinite)?t:[0,0,24,24]};function ve(e,t){let n=e.take(t.raw,`content`);if(typeof n==`string`)return n||void 0;let r=c(n)??{},i=r[`*`]??r[e.language]??Object.values(r).find(e=>typeof e==`string`&&e!==``);return typeof i==`string`&&i!==``?i:void 0}function ye(e,t){let n=c(e.raw.content);if(!n||typeof n[`*`]!=`string`||t===`oim:base`)return t;let r={};for(let[e,i]of Object.entries(n))e!==`*`&&typeof i==`string`&&i!==t&&(r[e]=i);return Object.keys(r).length>0?{value:t,modes:r}:t}function be(e,t,n){let r=[];for(let n of t){let t=c(n);if(!t||typeof t.d!=`string`||!t.d)continue;let i={d:t.d};typeof t.fill==`string`&&t.fill!==`none`&&(i.fill=t.fill),typeof t.stroke==`string`&&t.stroke!==`none`&&(i.stroke=t.stroke,i.strokeWidth=typeof t.strokeWidth==`number`?t.strokeWidth:1),typeof t.animationType==`string`&&t.animationType!==`none`&&e.note(`style.svgLayers: per-path animation "${t.animationType}"`),r.push(i)}return r.length>0?{kind:`paths`,viewBox:n,paths:r}:void 0}function xe(e,t,n){let{style:r}=t,i=e.take(r,`geoShape`);e.take(r,`geoType`);let a=e.take(r,`svgPath`),o=e.take(r,`customBlobPath`),s=_e(e.take(r,`svgViewBox`)),c=e.take(r,`svgRawXml`),l=e.take(r,`svgLayers`);if(Array.isArray(l)&&l.length>0){let t=be(e,l,s);if(t)return t}let u=typeof c==`string`&&c?c:U(t)?n:void 0;if(u){let t=ne(u);return t.ok?{kind:`paths`,...t.value}:(e.note(`style.svgRawXml: ${t.reason}`),{kind:`rect`})}let d=typeof a==`string`&&a?a:typeof o==`string`&&o?o:void 0;return i===`scribble`&&typeof o==`string`&&o||i===`blob`&&typeof o==`string`&&o?{kind:`paths`,viewBox:[0,0,100,100],paths:[{d:o}]}:d&&(i===void 0||i===`custom`||i===`blob`)?{kind:`paths`,viewBox:i===`blob`?[0,0,100,100]:s,paths:[{d}]}:typeof i==`string`&&i?ge[i]??{kind:`preset`,name:i}:{kind:`rect`}}var Se=[[`borderRadiusTL`,`borderTopLeftRadius`],[`borderRadiusTR`,`borderTopRightRadius`],[`borderRadiusBR`,`borderBottomRightRadius`],[`borderRadiusBL`,`borderBottomLeftRadius`]];function Ce(e,t){let n=b(e.take(t,`borderRadius`),e.canvas.width)??0,r=Se.map(n=>n.map(n=>b(e.take(t,n),e.canvas.width)).find(e=>e!==void 0));if(r.some(e=>e!==void 0)){let e=r.map(e=>Math.max(0,e??n));return e.every(t=>t===e[0])?e[0]||void 0:e}return n>0?n:void 0}function we(e,t,n){let{style:r}=t,a=n.type===`text`?void 0:ve(e,t);n.type===`shape`&&(n.geometry=xe(e,t,a));let o=n.fills?.[0];if(U(t)&&n.geometry?.kind===`paths`&&o&&`kind`in o&&o.kind===`color`)for(let e of n.geometry.paths)e.fill=`currentColor`;else for(let t of[`geoShape`,`geoType`,`svgPath`,`customBlobPath`,`svgViewBox`,`svgRawXml`,`svgLayers`])e.take(r,t);let s=Ce(e,r);s!==void 0&&i(n.type,`corners`)&&(n.corners=s);let l=e.take(r,`objectFit`),u=c(e.take(r,`imageCrop`));n.type===`image`&&(n.image={src:ye(t,a??`oim:base`)},typeof l==`string`&&l!==`cover`&&(n.image.fit=l),u&&(n.image.crop=u)),n.type===`lottie`&&a&&(n.lottie={src:a}),e.take(r,`flipX`)===!0&&(n.box.flipX=!0),e.take(r,`flipY`)===!0&&(n.box.flipY=!0);let d=c(e.take(r,`alt`)),f=e.take(r,`decorative`)===!0;i(n.type,`a11y`)&&(d&&Object.keys(d).length>0||f)&&(n.a11y={},d&&Object.keys(d).length>0&&(n.a11y.alt=d),f&&(n.a11y.decorative=!0))}var Te=[`shader_fx`,`outline`,`verticalAlign`],Ee={rectangle:{kind:`rect`},circle:{kind:`ellipse`},line:{kind:`line`}};function De(e,t,n){let{style:r}=t,i=e.take(r,`maskMode`),a=e.take(r,`maskFeather`),o=e.take(r,`maskCoverage`),s=e.take(r,`maskShape`),l=e.take(r,`maskSvgPath`),u=e.take(r,`cuts`),d=e.take(r,`maskBgColor`),f=e.take(r,`maskBgColorRole`),p=e.take(r,`maskStrokeColor`),m=e.take(r,`maskStrokeColorRole`),h=e.take(r,`maskStrokeWidth`);if(e.take(r,`maskInvert`),t.type!==`mask`)return;let g={},_=i===`cutout`;_&&(g.mode=`cutout`),typeof a==`number`&&a>0&&(g.feather=a),o===`container`&&(g.scope=`group`),n.mask=g;let v=typeof s==`string`&&s?s:typeof r.geoShape==`string`?r.geoShape:void 0,y=typeof l==`string`&&l?l:typeof r.svgPath==`string`&&r.svgPath?r.svgPath:void 0;if(n.geometry=y&&(!v||v===`custom`)?{kind:`paths`,viewBox:[0,0,100,100],paths:[{d:y}]}:v&&v!==`custom`?Ee[v]??{kind:`preset`,name:v}:{kind:`ellipse`},Array.isArray(u)&&u.length>0&&(n.extensions={...n.extensions,studio:{...c(n.extensions?.studio),maskCuts:u}}),_)return;let b=(t,n,r)=>{let i=G(n)?n:r;return typeof t==`string`&&e.hasRole(t)?{var:t,fallback:i}:i};n.fills=[{kind:`color`,value:b(f||r.fillColorRole,d,`#38BDF8`)}],delete n.strokes,typeof h==`number`&&h>0&&(n.strokes=[{paint:{kind:`color`,value:b(m||r.strokeColorRole,p,`#FFFFFF`)},width:h}])}var Oe=`author_only`,ke=[`public`,`author_only`,`sealed`];function Ae(e){if(!e||typeof e!=`object`)return Oe;let t=n(e);if(t.immutable_lock===!0||t.immutable===!0)return`sealed`;let r=t.reedit;return typeof r==`string`&&ke.includes(r)?r:Oe}var je=`2.0.0-draft.1`,Me=800,Ne=[`signature`,`key_version`,`signed_at`,`timestamp`,`image_hash`,`image_hash_alg`],Pe=[`version`,`min_player`,`image`,`media_type`,`allowed_domains`,`terms_accepted`,`redirect_membership_verified`,`capabilities`,`capabilities_required`];function Fe(e){let t=c(e.canvas)??{},n=e=>typeof e==`number`&&e>0?e:void 0,r=n(e.artboardWidth)??n(e.canvasWidth)??n(e.canvas_width)??n(t.natural_width)??n(t.width)??Me;return{width:r,height:n(e.artboardHeight)??n(e.canvasHeight)??n(e.canvas_height)??n(t.natural_height)??n(t.height)??r}}function Ie(e){for(let t of[`languages`,`lang`]){let n=e[t];if(Array.isArray(n)){let e=n.filter(e=>typeof e==`string`&&e.length>0);if(e.length>0)return[...new Set(e)]}}return[`es`]}function Le(e){let t=new Set;for(let n of Object.values(c(e.palettes)??{}))for(let e of Object.keys(c(n)??{}))t.add(e);return t}function Re(e,t){let n={oim:je,canvas:e.canvas,languages:Ie(t),layers:[]};for(let n of[`oim`,`canvas`,`languages`,`lang`])e.take(t,n);let r=e.take(t,`oim_id`);typeof r==`string`&&r&&(n.id=r);let i=e.take(t,`name`);typeof i==`string`&&i&&(n.name=i),(t.reedit!==void 0||t.immutable_lock!==void 0)&&(n.reedit=Ae(t)),e.take(t,`reedit`),e.take(t,`immutable_lock`);let a=c(e.take(t,`description`));a&&Object.keys(a).length>0&&(n.description=a);let o=e.take(t,`fonts`);Array.isArray(o)&&o.length>0&&(n.fonts=o);for(let n of Ne)e.retire(t,n);for(let n of Pe)e.retire(t,n);let s=[];for(let n of[`slots`,`elements`,`layers`]){let r=e.take(t,n);s.length===0&&Array.isArray(r)&&(s=r)}return{document:n,slots:s}}function ze(e,t,n,r){let i=e.canvas.width,a=b(e.take(t,n),i),o=c(e.take(t,r))??{},s=b(o[e.language],i)??a;if(s===void 0)return;let l={};for(let[t,n]of Object.entries(o)){let r=b(n,i);t!==e.language&&r!==void 0&&r!==s&&(l[t]=r)}return Object.keys(l).length>0?{value:s,modes:l}:s}var Be=`fontFamily.fontSize.fontSizes.fontWeight.fontStyle.bold.italic.underline.textAlign.lineHeight.letterSpacing.textTransform.textDecoration.maxWidth.maxWidths.marks.textRuns.textHighlight.dropCap.artisticPreset.curveType.curveAmount.extrusionDepth.extrusionAngle.extrusionColor.extrusionShading`.split(`.`);function Ve(e,t,n){let{raw:r,style:i}=t,a=e.take(i,`textAlign`)??e.take(r,`align`);if(e.take(r,`align`),n.type!==`text`){for(let t of Be)e.take(i,t);return}let o=e.take(r,`content`),s={content:{}};if(typeof o==`string`)s.content[e.language]=o;else for(let[e,t]of Object.entries(c(o)??{}))typeof t==`string`&&(s.content[e]=t);let l={},u=e.take(i,`fontFamily`);typeof u==`string`&&u&&(l.family=u);let d=ze(e,i,`fontSize`,`fontSizes`);d!==void 0&&(l.size=d);let f=e.take(i,`fontWeight`);e.take(i,`bold`),(typeof f==`number`||typeof f==`string`&&f)&&Number(f)!==400&&(l.weight=Number.isFinite(Number(f))?Number(f):f);let p=e.take(i,`fontStyle`);(p===`italic`||p===`oblique`)&&(l.italic=!0),e.take(i,`italic`),Object.keys(l).length>0&&(s.font=l),(a===`center`||a===`right`||a===`justify`)&&(s.align=a);let m=e.take(i,`lineHeight`);(typeof m==`number`||typeof m==`string`&&m)&&(s.lineHeight=m);let h=e.take(i,`letterSpacing`),g=typeof h==`string`?b(h,e.canvas.width):typeof h==`number`&&t.type===`artistic-text`?h:void 0;g!==void 0&&g!==0&&(s.letterSpacing=g);let _=e.take(i,`textTransform`);(_===`uppercase`||_===`lowercase`||_===`capitalize`)&&(s.transform=_);let v=e.take(i,`textDecoration`);e.take(i,`underline`),typeof v==`string`&&v&&v!==`none`&&(s.decoration=v);let y=ze(e,i,`maxWidth`,`maxWidths`);y!==void 0&&(s.maxWidth=y);let x=c(e.take(i,`marks`));x&&Object.keys(x).length>0&&(s.marks=x);let S=c(e.take(i,`textRuns`));S&&Object.keys(S).length>0&&(s.runs=S);let C=c(e.take(i,`textHighlight`));C&&C.enabled!==!1&&(s.highlight=C);let w=c(e.take(i,`dropCap`));w&&w.enabled!==!1&&(s.dropCap=w);let T={},E=e.take(i,`artisticPreset`);typeof E==`string`&&E&&(T.preset=E);let D=e.take(i,`curveType`),O=e.take(i,`curveAmount`),k=D??`arc`;(k===`arc`||k===`wave`||k===`arch`)&&typeof O==`number`&&O!==0&&(T.curve={type:k,amount:O});let A=e.take(i,`extrusionDepth`),j=e.take(i,`extrusionAngle`),M=e.take(i,`extrusionColor`),N=e.take(i,`extrusionShading`);typeof A==`number`&&A>0&&(T.extrusion={depth:A},typeof j==`number`&&(T.extrusion.angle=j),typeof M==`string`&&M&&(T.extrusion.color=M),typeof N==`boolean`&&(T.extrusion.shading=N)),(t.type===`artistic-text`||Object.keys(T).length>0)&&(s.artistic=T),n.text=s}function He(e){return!!e&&e.type===`group`}function Ue(e){let t=(e&&e.style||{}).groupId;return typeof t==`string`&&t?t:null}function We(e){let t=new Set;for(let n of e||[])He(n)&&n.id&&t.add(String(n.id));let n=new Map;for(let r of e||[]){if(!r||!r.id||He(r))continue;let e=Ue(r);if(!e||!t.has(e))continue;let i=n.get(e);i?i.push(String(r.id)):n.set(e,[String(r.id)])}return n}var Ge={text:`text`,"artistic-text":`text`,geo:`shape`,shape:`shape`,draw:`shape`,svg:`shape`,pattern:`shape`,container:`shape`,filter:`shape`,mask:`shape`,image:`image`,lottie:`lottie`,group:`group`,component:`group`,zone:`group`};function Ke(e,t,n){let r=We(t.map(e=>({...e.raw,style:e.style}))),i=new Map;for(let[e,t]of r)for(let n of t)i.set(n,e);let a=new Map(n.map(e=>[e.id,e])),o=[];return t.forEach((t,r)=>{e.take(t.style,`groupId`),e.take(t.style,`childIds`);let s=n[r],c=a.get(i.get(s.id)??``);c&&c!==s&&c.type===`group`?(c.children??=[]).push(s):o.push(s)}),o}var qe=[`display`,`flexDirection`,`justifyContent`,`alignItems`,`gap`,`padding`],$=(e,t)=>typeof e==`number`&&Number.isFinite(e)?e/100*t:0;function Je(e,t,n){let r={...c(t)??{}},i={...c(r.style)??{}};e.register(r,`zones[${n}]`),e.register(i,`zones[${n}].style`),e.take(r,`style`);let a=String(e.take(r,`id`)??`zone-${n+1}`),o=Array.isArray(r.position)?r.position:[0,0],s=Array.isArray(r.size)?r.size:[100,100];e.take(r,`position`),e.take(r,`size`);for(let t of qe)e.retire(i,t);let{width:l,height:u}=e.canvas,d={x:$(o[0],l),y:$(o[1],u),width:$(s[0],l),height:$(s[1],u)},f={id:a,type:`group`,box:d,children:[]},p=/^blur\((\d+(?:\.\d+)?)px\)$/.exec(String(e.take(i,`backdropFilter`)??``).trim());p&&(f.effects=[{kind:`backdrop`,blur:Number(p[1])}]);let m=e.take(i,`background`),h=b(e.take(i,`borderRadius`),l);if(G(m)){let e={id:`${a}__background`,type:`shape`,box:{...d},geometry:{kind:`rect`},fills:[{kind:`color`,value:m}]};h&&(e.corners=h),f.children.push(e)}return f}function Ye(e,t,n,r){let i=e.take(t,`zones`);if(!Array.isArray(i)||i.length===0)return n;let a=i.map((t,n)=>Je(e,t,n)),o=new Map(a.map(e=>[e.id,e])),s=n.filter(e=>{let t=o.get(r.get(e)??``);return t&&t.children.push(e),!t});return[...a,...s]}function Xe(e,t,n){let r=c(e.take(t,`palettes`))??{},i=e.take(t,`defaultPalette`),a=Object.keys(r).filter(e=>c(r[e]));if(a.length===0)return;let o={};for(let e of a)for(let[t,n]of Object.entries(c(r[e])??{}))typeof n==`string`&&n&&((o[t]??={})[e]=n);let s={modes:{palette:a,language:n},values:o};return typeof i==`string`&&a.includes(i)&&(s.defaults={palette:i}),s}var Ze=[E,Ve,ce,we,me,_,De];function Qe(e){let t=c(e)?.oim;return typeof t==`string`&&/^2\./.test(t)}var $e=[`p`,`st`,`c`,`t`];function et(e,t,n){let r={...c(t)??{}},i={...c(r.style)??{}};e.register(r,`slot`);for(let t of $e)t in r&&e.retire(r,t);e.register(i,`style`),e.take(r,`style`),e.retire(r,`s`);for(let t of Te)e.retire(i,t);return r.id===void 0&&(r.id=`layer-${n+1}`),{raw:r,style:i,type:typeof r.type==`string`?r.type:`text`}}function tt(e,t){let{raw:n}=t,r={id:String(e.take(n,`id`)),type:Ge[t.type]??`shape`,box:{x:0,y:0,width:0,height:0}};e.take(n,`type`),t.type in Ge||e.note(`slot.type: unknown layer type "${t.type}"`);let i=e.take(n,`name`);typeof i==`string`&&i&&(r.name=i);let a=e.take(n,`languages`);if(Array.isArray(a)&&!a.includes(`*`)){let e=a.filter(e=>typeof e==`string`&&e.length>0);e.length>0?r.languages=[...new Set(e)]:r.visible=!1}let o=e.take(n,`pendingTranslation`);return Array.isArray(o)&&o.length>0&&(r.extensions={...r.extensions,studio:{pendingTranslation:o}}),r}function nt(e){e.type===`shape`&&(e.geometry??={kind:`rect`}),e.type===`text`&&(e.text??={content:{}}),e.type===`image`&&(e.image??={src:`oim:base`}),e.type===`group`&&(e.children??=[]),e.children?.forEach(nt)}function rt(e){if(Qe(e))return{document:e,retired:[],unhandled:[]};let t=n(c(e)??{}),r=s(Fe(t),Ie(t)[0],Le(t));r.register(t,`root`);let{document:i,slots:a}=Re(r,t),o=a.map((e,t)=>et(r,e,t)),l=o.map(e=>{let t=tt(r,e);for(let n of Ze)n(r,e,t);return t}),u=new Map;o.forEach((e,t)=>{let n=r.take(e.raw,`zone_id`);typeof n==`string`&&n&&u.set(l[t],n)}),i.layers=Ye(r,t,Ke(r,o,l),u);let d=Xe(r,t,i.languages);d&&(i.variables=d);let f=ue(r,t);f.length>0&&(i.canvas={...i.canvas,fills:f});let p=he(r,t);return p.length>0&&i.layers.push({id:`__canvas-effects`,type:`shape`,box:{x:0,y:0,width:r.canvas.width,height:r.canvas.height},geometry:{kind:`rect`},effects:p}),i.layers.forEach(nt),{document:i,...r.finish()}}globalThis.__oimUpgrade=rt})();