{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/zIrRZoIgteGH4KvNSVbF/0fq7lD8yeBknaxdZUvlU/Rive_v5.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useMemo,useRef}from\"react\";import Rive,{useRive,useStateMachineInput}from\"@rive-app/react-canvas\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";// Mapping for fit options to Fit enum\nconst getFitValue=fit=>{switch(fit){case\"layout\":return Rive.Fit.Layout;case\"contain\":return Rive.Fit.Contain;case\"cover\":return Rive.Fit.Cover;case\"fill\":return Rive.Fit.Fill;case\"fitWidth\":return Rive.Fit.FitWidth;case\"fitHeight\":return Rive.Fit.FitHeight;case\"none\":return Rive.Fit.None;case\"scaleDown\":return Rive.Fit.ScaleDown;default:return Rive.Fit.Contain;}};// Mapping for alignment options to Alignment enum\nconst getAlignmentValue=alignment=>{switch(alignment){case\"center\":return Rive.Alignment.Center;case\"topLeft\":return Rive.Alignment.TopLeft;case\"topCenter\":return Rive.Alignment.TopCenter;case\"topRight\":return Rive.Alignment.TopRight;case\"centerLeft\":return Rive.Alignment.CenterLeft;case\"centerRight\":return Rive.Alignment.CenterRight;case\"bottomLeft\":return Rive.Alignment.BottomLeft;case\"bottomCenter\":return Rive.Alignment.BottomCenter;case\"bottomRight\":return Rive.Alignment.BottomRight;default:return Rive.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 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_v5(props){const{src,artboard,stateMachines,autoplay,fit,alignment,play,playOnCanvas,onEventTriggered,inputsJSON,isTouchScrollEnabled,layoutScaleFactor}=props;const layout=useMemo(()=>new Rive.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);if(onEventTriggered){onEventTriggered(event.data);console.log(\"Event data:\",event.data);}};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_v5,{src:{title:\"Source\",type:ControlType.String},artboard:{title:\"Artboard\",type:ControlType.String},stateMachines:{title:\"State Machines\",type:ControlType.String},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_v5.defaultProps={src:\"https://public.rive.app/hosted/63978/135405/cRjq3a7l40ScM-l2peKfBQ.riv\",artboard:\"AB_BG\",stateMachines:\"SM_BG\",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_v5\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Rive_v5.map"],
  "mappings": "0IACA,IAAMA,EAAYC,GAAK,CAAC,OAAOA,EAAI,CAAC,IAAI,SAAS,OAAOC,EAAK,IAAI,OAAO,IAAI,UAAU,OAAOA,EAAK,IAAI,QAAQ,IAAI,Q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E,aAAa,QAAQ,EAAE,KAAK,CAAC,MAAM,YAAY,KAAKA,EAAY,OAAO,EAAE,aAAa,CAAC,MAAM,iBAAiB,KAAKA,EAAY,OAAO,EAAE,iBAAiB,CAAC,KAAKA,EAAY,YAAY,EAAE,WAAW,CAAC,MAAM,cAAc,KAAKA,EAAY,OAAO,OAAO,IAAI,EAAI,CAAC,CAAC,EAClyCzB,EAAc,aAAa,CAAC,IAAI,yEAAyE,SAAS,QAAQ,cAAc,QAAQ,SAAS,GAAK,IAAI,UAAU,UAAU,SAAS,KAAK,GAAK,aAAa,GAAK,iBAAiB0B,GAAW,KAAK,WAAW,KAAK,qBAAqB,GAAM,kBAAkB,CAAC",
  "names": ["getFitValue", "fit", "v", "getAlignmentValue", "alignment", "useRiveInputs", "rive", "stateMachines", "inputsJSON", "se", "error", "config", "handler", "D", "RivePlayer_v5", "props", "src", "artboard", "autoplay", "play", "playOnCanvas", "onEventTriggered", "isTouchScrollEnabled", "layoutScaleFactor", "layout", "RiveComponent", "H", "inputs", "prevInputsRef", "pe", "ue", "input", "index", "prevInput", "handleEvent", "event", "RenderTarget", "p", "addPropertyControls", "ControlType", "eventData"]
}
