{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/FYhRUfK47x1b4scDC0wi/DYdRhLFlH5joWztlcVvB/RivePlayer_vX.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,useMemo,useRef}from\"react\";import*as riveCanvas from\"@rive-app/react-canvas\";import*as riveWebGL from\"@rive-app/react-webgl2\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";var isRiveRenderer=false;var rivePackage=()=>{if(isRiveRenderer){return riveWebGL;}else{return riveCanvas;}};// Mapping for fit options to Fit enum\nconst getFitValue=fit=>{const Fit=rivePackage().default.Fit;switch(fit){case\"layout\":return Fit.Layout;case\"contain\":return Fit.Contain;case\"cover\":return Fit.Cover;case\"fill\":return Fit.Fill;case\"fitWidth\":return Fit.FitWidth;case\"fitHeight\":return Fit.FitHeight;case\"none\":return Fit.None;case\"scaleDown\":return Fit.ScaleDown;default:return Fit.Contain;}};// Mapping for alignment options to Alignment enum\nconst getAlignmentValue=alignment=>{const Alignment=rivePackage().default.Alignment;switch(alignment){case\"center\":return Alignment.Center;case\"topLeft\":return Alignment.TopLeft;case\"topCenter\":return Alignment.TopCenter;case\"topRight\":return Alignment.TopRight;case\"centerLeft\":return Alignment.CenterLeft;case\"centerRight\":return Alignment.CenterRight;case\"bottomLeft\":return Alignment.BottomLeft;case\"bottomCenter\":return Alignment.BottomCenter;case\"bottomRight\":return Alignment.BottomRight;default:return Alignment.Center;}};function useRiveInputs(rive,stateMachines,inputsJSON){const inputConfigs=useMemo(()=>{try{return JSON.parse(inputsJSON||\"[]\");}catch(error){console.error(\"Error parsing inputsJSON:\",error);return[];}},[inputsJSON]);return inputConfigs.map(config=>{const{useStateMachineInput}=rivePackage();const handler=useStateMachineInput(rive,stateMachines,config.name,config.type===\"Trigger\"?true:config.value);return{...config,handler};});}/**\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerDisableUnlink\n */export default function RivePlayer_vX(props){const{riveRenderer}=props;isRiveRenderer=riveRenderer;const[renderer,setRenderer]=useState(riveRenderer);useEffect(()=>{setRenderer(riveRenderer);},[riveRenderer]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(RivePlayerInternal,{...props,riveRenderer:renderer})},renderer?\"webgl\":\"canvas\");}function RivePlayerInternal(props){const{src,artboard,stateMachines,riveRenderer,autoplay,fit,alignment,play,playOnCanvas,onEventTriggered,inputsJSON,isTouchScrollEnabled,layoutScaleFactor}=props;const rivePackage=useMemo(()=>riveRenderer?riveWebGL:riveCanvas,[riveRenderer]);const{useRive}=rivePackage;const Layout=rivePackage.default.Layout;const layout=useMemo(()=>new Layout({fit:getFitValue(fit),alignment:getAlignmentValue(alignment),...fit===\"layout\"&&{layoutScaleFactor}}),[fit,alignment,layoutScaleFactor]);const{rive,RiveComponent}=useRive({src,artboard,stateMachines,autoplay,layout,isTouchScrollEnabled:isTouchScrollEnabled});const inputs=useRiveInputs(rive,stateMachines,inputsJSON);const prevInputsRef=useRef(inputs);useEffect(()=>{if(rive&&inputs.length){inputs.forEach((input,index)=>{if(input.handler){const prevInput=prevInputsRef.current[index];if(input.type===\"Trigger\"&&input.value&&(!prevInput||!prevInput.value)){input.handler.fire();}else if(input.type!==\"Trigger\"&&\"value\"in input){input.handler.value=input.value;}}});}prevInputsRef.current=inputs;},[rive,inputs]);useEffect(()=>{if(rive){const handleEvent=event=>{// console.log(\"Rive event triggered:\", event)\nif(onEventTriggered){onEventTriggered(event.data);// console.log(\"Event data:\", event.data)\n}};rive.on(\"riveevent\",handleEvent);return()=>{rive.off(\"riveevent\",handleEvent);};}},[rive,onEventTriggered]);useEffect(()=>{if(rive){const shouldPlay=RenderTarget.current()===RenderTarget.canvas?playOnCanvas:play;shouldPlay?rive.play():rive.pause();}},[rive,play,playOnCanvas]);useEffect(()=>{if(rive){rive.layout=layout;}},[rive,layout]);return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(RiveComponent,{style:{width:\"100%\",height:\"100%\"}})});}// Property controls\naddPropertyControls(RivePlayer_vX,{src:{title:\"Source\",type:ControlType.String},artboard:{title:\"Artboard\",type:ControlType.String},stateMachines:{title:\"State Machines\",type:ControlType.String},riveRenderer:{title:\"Rive Renderer\",type:ControlType.Boolean,hidden:()=>true},autoplay:{title:\"Autoplay\",type:ControlType.Boolean,hidden:()=>true},isTouchScrollEnabled:{title:\"Touch Screen Enabled\",type:ControlType.Boolean},fit:{title:\"Fit\",type:ControlType.Enum,options:[\"layout\",\"contain\",\"cover\",\"fill\",\"fitWidth\",\"fitHeight\",\"none\",\"scaleDown\"],optionTitles:[\"Layout\",\"Contain\",\"Cover\",\"Fill\",\"Fit Width\",\"Fit Height\",\"None\",\"Scale Down\"],defaultValue:\"contain\"},layoutScaleFactor:{title:\"Layout Scale Factor\",type:ControlType.Number,defaultValue:1,min:.25,max:10,displayStepper:true,step:.25,hidden:props=>props.fit!==\"layout\"},alignment:{title:\"Alignment\",type:ControlType.Enum,options:[\"center\",\"topLeft\",\"topCenter\",\"topRight\",\"centerLeft\",\"centerRight\",\"bottomLeft\",\"bottomCenter\",\"bottomRight\"],optionTitles:[\"Center\",\"Top Left\",\"Top Center\",\"Top Right\",\"Center Left\",\"Center Right\",\"Bottom Left\",\"Bottom Center\",\"Bottom Right\"],defaultValue:\"center\"},play:{title:\"Auto-Play\",type:ControlType.Boolean},playOnCanvas:{title:\"Play on Canvas\",type:ControlType.Boolean},onEventTriggered:{type:ControlType.EventHandler},inputsJSON:{title:\"Inputs JSON\",type:ControlType.String,hidden:()=>true}});// Default props\nRivePlayer_vX.defaultProps={src:\"https://public.rive.app/hosted/63978/135405/cRjq3a7l40ScM-l2peKfBQ.riv\",artboard:\"AB_BG\",stateMachines:\"SM_BG\",riveRenderer:false,autoplay:true,fit:\"contain\",alignment:\"center\",play:true,playOnCanvas:true,onEventTriggered:eventData=>null,inputsJSON:\"[]\",isTouchScrollEnabled:false,layoutScaleFactor:1};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RivePlayer_vX\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RivePlayer_vX.map"],
  "mappings": "0IAAoQ,IAAIA,EAAe,GAAUC,EAAY,IAAQD,EAAuBE,EAAuBA,EAC7VC,EAAYC,GAAK,CAAC,IAAMC,EAAIJ,EAAY,EAAE,QAAQ,IAAI,OAAOG,EAAI,CAAC,IAAI,SAAS,OAAOC,EAAI,OAAO,IAAI,UAAU,OAAOA,EAAI,QAAQ,IAAI,QAAQ,OAAOA,EAAI,MAAM,IAAI,OAAO,OAAOA,EAAI,KAAK,IAAI,WAAW,OAAOA,EAAI,SAAS,IAAI,YAAY,OAAOA,EAAI,UAAU,IAAI,OAAO,OAAOA,EAAI,KAAK,IAAI,YAAY,OAAOA,EAAI,UAAU,QAAQ,OAAOA,EAAI,OAAQ,CAAC,EAC9VC,EAAkBC,GAAW,CAAC,IAAMC,EAAUP,EAAY,EAAE,QAAQ,UAAU,OAAOM,EAAU,CAAC,IAAI,SAAS,OAAOC,EAAU,OAAO,IAAI,UAAU,OAAOA,EAAU,QAAQ,IAAI,YAAY,OAAOA,EAAU,UAAU,IAAI,WAAW,OAAOA,EAAU,SAAS,IAAI,aAAa,OAAOA,EAAU,WAAW,IAAI,cAAc,OAAOA,EAAU,YAAY,IAAI,aAAa,OAAOA,EAAU,WAAW,IAAI,eAAe,OAAOA,EAAU,aAAa,IAAI,cAAc,OAAOA,EAAU,YAAY,QAAQ,OAAOA,EAAU,MAAO,CAAC,EAAE,SAASC,EAAcC,EAAKC,EAAcC,EAAW,CAAkK,OAA9IC,EAA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AC,MAAM,cAAc,KAAKA,EAAY,OAAO,OAAO,IAAI,EAAI,CAAC,CAAC,EACh3C9B,EAAc,aAAa,CAAC,IAAI,yEAAyE,SAAS,QAAQ,cAAc,QAAQ,aAAa,GAAM,SAAS,GAAK,IAAI,UAAU,UAAU,SAAS,KAAK,GAAK,aAAa,GAAK,iBAAiB+B,GAAW,KAAK,WAAW,KAAK,qBAAqB,GAAM,kBAAkB,CAAC",
  "names": ["isRiveRenderer", "rivePackage", "dist_exports", "getFitValue", "fit", "Fit", "getAlignmentValue", "alignment", "Alignment", "useRiveInputs", "rive", "stateMachines", "inputsJSON", "se", "error", "config", "useStateMachineInput", "handler", "RivePlayer_vX", "props", "riveRenderer", "renderer", "setRenderer", "ye", "ue", "RivePlayerInternal", "src", "artboard", "autoplay", "play", "playOnCanvas", "onEventTriggered", "isTouchScrollEnabled", "layoutScaleFactor", "useRive", "Layout", "layout", "RiveComponent", "inputs", "prevInputsRef", "pe", "input", "index", "prevInput", "handleEvent", "event", "RenderTarget", "addPropertyControls", "ControlType", "eventData"]
}
