!function(){var e,t,n,o,l,a={87:function(e){"use strict";e.exports=window.wp.element},422:function(e,t,n){"use strict";var o=n(723),l=n(997),a=n(715),r=n(87),i=n(427),s=n(942),u=n.n(s),d=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"blynex/lottie-animation","version":"1.0.0","title":"Lottie Animation","category":"blynex-blocks","icon":"format-video","description":"Display and customize Lottie (JSON-based SVG) animations with advanced playback controls.","keywords":["lottie","animation","json","vector","svg"],"example":{},"supports":{"html":false,"align":["wide","full","left","center","right"],"spacing":{"padding":true,"margin":true},"color":{"background":true}},"attributes":{"animationSource":{"type":"string","default":"upload"},"animationJSON":{"type":"object","default":null},"animationURL":{"type":"string","default":""},"mediaId":{"type":"number","default":0},"autoplay":{"type":"boolean","default":true},"loop":{"type":"boolean","default":true},"playOnHover":{"type":"boolean","default":false},"playOnScroll":{"type":"boolean","default":false},"scrollThreshold":{"type":"number","default":30},"speed":{"type":"number","default":1},"direction":{"type":"string","default":"normal"},"startFrame":{"type":"number","default":0},"endFrame":{"type":"number","default":0},"width":{"type":"string","default":"400px"},"height":{"type":"string","default":"400px"},"alignment":{"type":"string","default":"center"},"maintainAspectRatio":{"type":"boolean","default":true},"borderRadius":{"type":"string","default":"0px"},"backgroundColor":{"type":"string","default":""},"overlayColor":{"type":"string","default":""},"boxShadow":{"type":"boolean","default":false},"boxShadowValue":{"type":"string","default":"0 4px 6px rgba(0, 0, 0, 0.1)"},"linkUrl":{"type":"string","default":""},"linkNewTab":{"type":"boolean","default":false},"hoverEffect":{"type":"string","default":"none"},"altText":{"type":"string","default":""},"ariaLabel":{"type":"string","default":""},"role":{"type":"string","default":"img"},"showControls":{"type":"boolean","default":false},"lazyLoad":{"type":"boolean","default":true}},"textdomain":"blynex","editorScript":"file:./index.js","editorStyle":"file:./style.scss","style":"file:./style.scss","viewScript":"file:./view.js"}'),c=n(790),p=({attributes:e,setAttributes:t})=>{const{animationSource:n,animationURL:l,mediaId:r,autoplay:s,loop:u,playOnHover:d,playOnScroll:p,scrollThreshold:b,speed:y,direction:f,startFrame:h,endFrame:x,width:g,height:m,alignment:v,maintainAspectRatio:_,borderRadius:C,backgroundColor:w,overlayColor:j,boxShadow:S,boxShadowValue:k,linkUrl:O,linkNewTab:T,hoverEffect:L,altText:R,ariaLabel:N,role:P,showControls:A,lazyLoad:E}=e;return(0,c.jsxs)(a.InspectorControls,{children:[(0,c.jsxs)(i.PanelBody,{title:(0,o.__)("Animation Settings","blynex"),initialOpen:!0,children:[(0,c.jsx)(i.SelectControl,{label:(0,o.__)("Animation Source","blynex"),value:n,options:[{label:(0,o.__)("Upload JSON","blynex"),value:"upload"},{label:(0,o.__)("External URL","blynex"),value:"url"}],onChange:e=>t({animationSource:e})}),"upload"===n&&(0,c.jsx)(a.MediaUploadCheck,{children:(0,c.jsx)(a.MediaUpload,{onSelect:e=>{t({mediaId:e.id,animationURL:e.url})},allowedTypes:["application/json"],value:r,render:({open:e})=>(0,c.jsxs)("div",{children:[(0,c.jsx)(i.Button,{onClick:e,variant:"secondary",style:{marginBottom:"10px",width:"100%"},children:r>0?(0,o.__)("Change JSON File","blynex"):(0,o.__)("Upload JSON File","blynex")}),r>0&&(0,c.jsx)(i.Button,{onClick:()=>t({mediaId:0,animationURL:""}),variant:"tertiary",isDestructive:!0,style:{width:"100%"},children:(0,o.__)("Remove","blynex")})]})})}),"url"===n&&(0,c.jsx)(i.TextControl,{label:(0,o.__)("Animation JSON URL","blynex"),value:l,onChange:e=>t({animationURL:e}),placeholder:"https://example.com/animation.json",help:(0,o.__)("Enter the full URL to your Lottie JSON file","blynex")}),(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Lazy Load","blynex"),checked:E,onChange:e=>t({lazyLoad:e}),help:(0,o.__)("Load animation only when visible in viewport","blynex")})]}),(0,c.jsxs)(i.PanelBody,{title:(0,o.__)("Playback Options","blynex"),initialOpen:!1,children:[(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Autoplay","blynex"),checked:s,onChange:e=>t({autoplay:e})}),(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Loop","blynex"),checked:u,onChange:e=>t({loop:e})}),(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Play on Hover","blynex"),checked:d,onChange:e=>t({playOnHover:e}),help:(0,o.__)("Start animation when mouse hovers over it","blynex")}),(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Play on Scroll","blynex"),checked:p,onChange:e=>t({playOnScroll:e}),help:(0,o.__)("Start animation when scrolled into view","blynex")}),p&&(0,c.jsx)(i.RangeControl,{label:(0,o.__)("Scroll Threshold (%)","blynex"),value:b,onChange:e=>t({scrollThreshold:e}),min:0,max:100,step:5,help:(0,o.__)("How much of the element must be visible to trigger","blynex")}),(0,c.jsx)(i.RangeControl,{label:(0,o.__)("Speed","blynex"),value:y,onChange:e=>t({speed:e}),min:.1,max:3,step:.1}),(0,c.jsx)(i.SelectControl,{label:(0,o.__)("Direction","blynex"),value:f,options:[{label:(0,o.__)("Normal","blynex"),value:"normal"},{label:(0,o.__)("Reverse","blynex"),value:"reverse"}],onChange:e=>t({direction:e})}),(0,c.jsx)(i.BaseControl,{label:(0,o.__)("Frame Range (Optional)","blynex"),help:(0,o.__)("Leave at 0 to play full animation","blynex"),children:(0,c.jsxs)("div",{style:{display:"flex",gap:"10px"},children:[(0,c.jsx)(i.TextControl,{type:"number",label:(0,o.__)("Start Frame","blynex"),value:h,onChange:e=>t({startFrame:parseInt(e)||0}),min:0}),(0,c.jsx)(i.TextControl,{type:"number",label:(0,o.__)("End Frame","blynex"),value:x,onChange:e=>t({endFrame:parseInt(e)||0}),min:0})]})}),(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Show Play/Pause Controls","blynex"),checked:A,onChange:e=>t({showControls:e})})]}),(0,c.jsxs)(i.PanelBody,{title:(0,o.__)("Size & Layout","blynex"),initialOpen:!1,children:[(0,c.jsx)(i.TextControl,{label:(0,o.__)("Width","blynex"),value:g,onChange:e=>t({width:e}),placeholder:"400px",help:(0,o.__)("Use px, %, vw, or auto","blynex")}),(0,c.jsx)(i.TextControl,{label:(0,o.__)("Height","blynex"),value:m,onChange:e=>t({height:e}),placeholder:"400px",help:(0,o.__)("Use px, %, vh, or auto","blynex")}),(0,c.jsx)(i.SelectControl,{label:(0,o.__)("Alignment","blynex"),value:v,options:[{label:(0,o.__)("Left","blynex"),value:"left"},{label:(0,o.__)("Center","blynex"),value:"center"},{label:(0,o.__)("Right","blynex"),value:"right"}],onChange:e=>t({alignment:e})}),(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Maintain Aspect Ratio","blynex"),checked:_,onChange:e=>t({maintainAspectRatio:e})}),(0,c.jsx)(i.TextControl,{label:(0,o.__)("Border Radius","blynex"),value:C,onChange:e=>t({borderRadius:e}),placeholder:"0px"})]}),(0,c.jsxs)(i.PanelBody,{title:(0,o.__)("Color & Background","blynex"),initialOpen:!1,children:[(0,c.jsx)(i.BaseControl,{label:(0,o.__)("Background Color","blynex"),children:(0,c.jsx)(i.TextControl,{value:w,onChange:e=>t({backgroundColor:e}),placeholder:"#ffffff or rgba(255,255,255,0.5)"})}),(0,c.jsx)(i.BaseControl,{label:(0,o.__)("Overlay Color (Tint)","blynex"),children:(0,c.jsx)(i.TextControl,{value:j,onChange:e=>t({overlayColor:e}),placeholder:"rgba(0,0,0,0.2)",help:(0,o.__)("Add a color overlay on top of animation","blynex")})}),(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Box Shadow","blynex"),checked:S,onChange:e=>t({boxShadow:e})}),S&&(0,c.jsx)(i.TextControl,{label:(0,o.__)("Shadow Value","blynex"),value:k,onChange:e=>t({boxShadowValue:e}),placeholder:"0 4px 6px rgba(0, 0, 0, 0.1)"})]}),(0,c.jsxs)(i.PanelBody,{title:(0,o.__)("Interactivity","blynex"),initialOpen:!1,children:[(0,c.jsx)(i.TextControl,{label:(0,o.__)("Link URL","blynex"),value:O,onChange:e=>t({linkUrl:e}),placeholder:"https://",help:(0,o.__)("Make the animation clickable","blynex")}),O&&(0,c.jsx)(i.ToggleControl,{label:(0,o.__)("Open in New Tab","blynex"),checked:T,onChange:e=>t({linkNewTab:e})}),(0,c.jsx)(i.SelectControl,{label:(0,o.__)("Hover Effect","blynex"),value:L,options:[{label:(0,o.__)("None","blynex"),value:"none"},{label:(0,o.__)("Scale","blynex"),value:"scale"},{label:(0,o.__)("Pulse","blynex"),value:"pulse"},{label:(0,o.__)("Bounce","blynex"),value:"bounce"}],onChange:e=>t({hoverEffect:e}),help:(0,o.__)("Visual effect on mouse hover","blynex")})]}),(0,c.jsxs)(i.PanelBody,{title:(0,o.__)("Accessibility","blynex"),initialOpen:!1,children:[(0,c.jsx)(i.TextControl,{label:(0,o.__)("Alt Text","blynex"),value:R,onChange:e=>t({altText:e}),help:(0,o.__)("Describe the animation for screen readers","blynex")}),(0,c.jsx)(i.TextControl,{label:(0,o.__)("ARIA Label","blynex"),value:N,onChange:e=>t({ariaLabel:e})}),(0,c.jsx)(i.SelectControl,{label:(0,o.__)("Role","blynex"),value:P,options:[{label:(0,o.__)("Image","blynex"),value:"img"},{label:(0,o.__)("Presentation","blynex"),value:"presentation"}],onChange:e=>t({role:e})})]})]})};(0,l.registerBlockType)(d.name,{...d,attributes:{animationSource:{type:"string",default:"upload"},animationJSON:{type:"object",default:null},animationURL:{type:"string",default:""},mediaId:{type:"number",default:0},autoplay:{type:"boolean",default:!0},loop:{type:"boolean",default:!0},playOnHover:{type:"boolean",default:!1},playOnScroll:{type:"boolean",default:!1},scrollThreshold:{type:"number",default:30},speed:{type:"number",default:1},direction:{type:"string",default:"normal"},startFrame:{type:"number",default:0},endFrame:{type:"number",default:0},width:{type:"string",default:"400px"},height:{type:"string",default:"400px"},alignment:{type:"string",default:"center"},maintainAspectRatio:{type:"boolean",default:!0},borderRadius:{type:"string",default:"0px"},backgroundColor:{type:"string",default:""},overlayColor:{type:"string",default:""},boxShadow:{type:"boolean",default:!1},boxShadowValue:{type:"string",default:"0 4px 6px rgba(0, 0, 0, 0.1)"},linkUrl:{type:"string",default:""},linkNewTab:{type:"boolean",default:!1},hoverEffect:{type:"string",default:"none"},altText:{type:"string",default:""},ariaLabel:{type:"string",default:""},role:{type:"string",default:"img"},showControls:{type:"boolean",default:!1},lazyLoad:{type:"boolean",default:!0}},edit:function({attributes:e,setAttributes:t}){const{animationURL:l,autoplay:s,loop:d,speed:b,direction:y,width:f,height:h,alignment:x,maintainAspectRatio:g,borderRadius:m,backgroundColor:v,overlayColor:_,boxShadow:C,boxShadowValue:w,hoverEffect:j,showControls:S}=e,k=(0,r.useRef)(null),O=(0,r.useRef)(null),[T,L]=(0,r.useState)(s),[R,N]=(0,r.useState)(null),[P,A]=(0,r.useState)(!1),[E,U]=(0,r.useState)(null),B=(0,a.useBlockProps)({className:u()("wp-block-blynex-lottie-animation",`align-${x}`,{[`hover-effect-${j}`]:"none"!==j,"has-controls":S})});(0,r.useEffect)((()=>{l?(A(!0),U(null),fetch(l).then((e=>{if(!e.ok)throw new Error("Failed to load animation");return e.json()})).then((e=>{N(e),A(!1)})).catch((e=>{U(e.message),A(!1)}))):N(null)}),[l]),(0,r.useEffect)((()=>{if(R&&k.current)return n.e(891).then(n.t.bind(n,891,23)).then((e=>{O.current&&O.current.destroy(),O.current=e.default.loadAnimation({container:k.current,renderer:"svg",loop:d,autoplay:s,animationData:R}),O.current.setSpeed(b),"reverse"===y&&O.current.setDirection(-1),L(s)})).catch((e=>{console.error("Failed to load lottie-web:",e),U("Failed to load animation library")})),()=>{O.current&&O.current.destroy()}}),[R,d,s,b,y]);const F={width:f||"400px",height:g?"auto":h||"400px",backgroundColor:v||"transparent",borderRadius:m||"0px",boxShadow:C?w:"none",position:"relative",overflow:"hidden"};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(p,{attributes:e,setAttributes:t}),(0,c.jsxs)("div",{...B,children:[!l&&(0,c.jsx)(i.Placeholder,{icon:"format-video",label:(0,o.__)("Lottie Animation","blynex"),instructions:(0,o.__)("Upload a Lottie JSON file or provide a URL in the block settings to get started.","blynex")}),P&&(0,c.jsx)(i.Placeholder,{icon:"format-video",label:(0,o.__)("Loading Animation...","blynex"),children:(0,c.jsx)(i.Spinner,{})}),E&&(0,c.jsx)(i.Placeholder,{icon:"format-video",label:(0,o.__)("Error Loading Animation","blynex"),instructions:E}),l&&R&&!P&&!E&&(0,c.jsxs)("div",{className:"lottie-animation-wrapper",style:F,children:[(0,c.jsx)("div",{ref:k,className:"lottie-animation-container",style:{width:"100%",height:"100%"}}),_&&(0,c.jsx)("div",{className:"lottie-overlay",style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:_,pointerEvents:"none"}}),S&&(0,c.jsx)("div",{className:"lottie-controls",children:(0,c.jsx)(i.Button,{variant:"secondary",onClick:()=>{O.current&&(T?O.current.pause():O.current.play(),L(!T))},size:"small",children:T?(0,o.__)("Pause","blynex"):(0,o.__)("Play","blynex")})})]})]})]})},save:function({attributes:e}){const{animationURL:t,autoplay:n,loop:l,playOnHover:r,playOnScroll:i,scrollThreshold:s,speed:d,direction:p,startFrame:b,endFrame:y,width:f,height:h,alignment:x,maintainAspectRatio:g,borderRadius:m,backgroundColor:v,overlayColor:_,boxShadow:C,boxShadowValue:w,linkUrl:j,linkNewTab:S,hoverEffect:k,altText:O,ariaLabel:T,role:L,showControls:R,lazyLoad:N}=e;if(!t)return null;const P=a.useBlockProps.save({className:u()("wp-block-blynex-lottie-animation",`align-${x}`,{[`hover-effect-${k}`]:"none"!==k,"has-controls":R})}),A={width:f||"400px",height:g?"auto":h||"400px",backgroundColor:v||"transparent",borderRadius:m||"0px",boxShadow:C?w:"none",position:"relative",overflow:"hidden"},E={"data-animation-url":t,"data-autoplay":n?"true":"false","data-loop":l?"true":"false","data-play-on-hover":r?"true":"false","data-play-on-scroll":i?"true":"false","data-scroll-threshold":s,"data-speed":d,"data-direction":p,"data-start-frame":b,"data-end-frame":y,"data-show-controls":R?"true":"false","data-lazy-load":N?"true":"false"},U=(0,c.jsxs)("div",{className:"lottie-animation-wrapper",style:A,children:[(0,c.jsx)("div",{className:"lottie-animation-container",...E,role:L,"aria-label":T||O||(0,o.__)("Lottie Animation","blynex"),style:{width:"100%",height:"100%"}}),_&&(0,c.jsx)("div",{className:"lottie-overlay",style:{position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:_,pointerEvents:"none"}}),R&&(0,c.jsx)("div",{className:"lottie-controls",children:(0,c.jsxs)("button",{className:"lottie-play-pause","aria-label":(0,o.__)("Play/Pause","blynex"),children:[(0,c.jsx)("span",{className:"play-icon",children:"▶"}),(0,c.jsx)("span",{className:"pause-icon",children:"⏸"})]})})]});return j?(0,c.jsx)("div",{...P,children:(0,c.jsx)("a",{href:j,target:S?"_blank":void 0,rel:S?"noopener noreferrer":void 0,className:"lottie-link",children:U})}):(0,c.jsx)("div",{...P,children:U})}})},427:function(e){"use strict";e.exports=window.wp.components},715:function(e){"use strict";e.exports=window.wp.blockEditor},723:function(e){"use strict";e.exports=window.wp.i18n},790:function(e){"use strict";e.exports=window.ReactJSXRuntime},942:function(e,t){var n;!function(){"use strict";var o={}.hasOwnProperty;function l(){for(var e="",t=0;t=l)&&Object.keys(i.O).every((function(e){return i.O[e](n[s])}))?n.splice(s--,1):(r=!1,l0&&e[d-1][2]>l;d--)e[d]=e[d-1];e[d]=[n,o,l]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},i.t=function(e,o){if(1&o&&(e=this(e)),8&o)return e;if("object"==typeof e&&e){if(4&o&&e.__esModule)return e;if(16&o&&"function"==typeof e.then)return e}var l=Object.create(null);i.r(l);var a={};t=t||[null,n({}),n([]),n(n)];for(var r=2&o&&e;"object"==typeof r&&!~t.indexOf(r);r=n(r))Object.getOwnPropertyNames(r).forEach((function(t){a[t]=function(){return e[t]}}));return a.default=function(){return e},i.d(l,a),l},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.f={},i.e=function(e){return Promise.all(Object.keys(i.f).reduce((function(t,n){return i.f[n](e,t),t}),[]))},i.u=function(e){return e+".js?ver=2a4a0a0d0aa623e9bf64"},i.miniCssF=function(e){},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o={},l="blynex:",i.l=function(e,t,n,a){if(o[e])o[e].push(t);else{var r,s;if(void 0!==n)for(var u=document.getElementsByTagName("script"),d=0;d-1&&(!e||!/^http(s?):/.test(e));)e=n[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e+"../../"}(),function(){var e={216:0,350:0};i.f.j=function(t,n){var o=i.o(e,t)?e[t]:void 0;if(0!==o)if(o)n.push(o[2]);else if(350!=t){var l=new Promise((function(n,l){o=e[t]=[n,l]}));n.push(o[2]=l);var a=i.p+i.u(t),r=new Error;i.l(a,(function(n){if(i.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var l=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+l+": "+a+")",r.name="ChunkLoadError",r.type=l,r.request=a,o[1](r)}}),"chunk-"+t,t)}else e[t]=0},i.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,l,a=n[0],r=n[1],s=n[2],u=0;if(a.some((function(t){return 0!==e[t]}))){for(o in r)i.o(r,o)&&(i.m[o]=r[o]);if(s)var d=s(i)}for(t&&t(n);u