{"version":3,"file":"shared-lib.FzZny2sB.mjs","names":["useRef","useState"],"sources":["https:/framerusercontent.com/modules/vbaJXlyVEeIvuEevvudG/dhte3xwYrttC73vPPL4r/UnicornStudioEmbed.js","https:/framerusercontent.com/modules/bzII7qhS1sTcalZxDtMf/uwrFGcG90g1uJv3EXehT/siteMetadata.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useRef,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";const VERSION=\"2.1.12\";/**\n * @framerSupportedLayoutWidth fixed\n * @framerSupportedLayoutHeight fixed\n * @framerIntrinsicHeight 400\n * @framerIntrinsicWidth 800\n */export default function UnicornStudioEmbed(props){const userSdkVersion=props.sdkVersion?.trim();const sdkVersion=userSdkVersion||VERSION;const elementRef=useRef(null);const sceneRef=useRef(null);const scriptId=useRef(`unicorn-project-${Math.random().toString(36).substr(2,9)}`);const[versionError,setVersionError]=useState(null);// simple semver check: 1.2.3\nconst isValidVersion=v=>/^\\d+\\.\\d+\\.\\d+(-[0-9A-Za-z.-]+)?$/.test(v.trim());useEffect(()=>{const isEditingOrPreviewing=[\"CANVAS\",\"PREVIEW\"].includes(RenderTarget.current());// validate version first\nif(!isValidVersion(sdkVersion)){console.error(`[UnicornStudioEmbed] Invalid SDK version \"${sdkVersion}\". Expected format: x.y.z (e.g. 1.5.3)`);setVersionError(`Invalid SDK version \"${sdkVersion}\". Use x.y.z (e.g. 1.5.3).`);return;}else{setVersionError(null);}if(RenderTarget.current()===\"CANVAS\"){return;}const initializeScript=callback=>{const cdnPrefix=\"https://cdn.jsdelivr.net/gh/hiunicornstudio/unicornstudio.js\";const scriptSrc=`${cdnPrefix}@v${sdkVersion}/dist/unicornStudio.umd.js`;// check if any unicornstudio.js script is already on the page\nconst existingScript=document.querySelector('script[src^=\"https://cdn.jsdelivr.net/gh/hiunicornstudio/unicornstudio.js\"]');// IMPORTANT:\n// If there is already a script but it's for a different version,\n// we might want to load the desired one anyway. For now, if it's\n// present AND window.UnicornStudio exists, we just use it.\nif(!existingScript){const script=document.createElement(\"script\");script.src=scriptSrc;script.onload=callback;script.onerror=()=>console.error(\"Failed to load UnicornStudio script at \"+scriptSrc);document.body.appendChild(script);}else{if(window.UnicornStudio){callback();}else{const waitForLoad=setInterval(()=>{if(window.UnicornStudio){clearInterval(waitForLoad);callback();}},100);}}};const initializeUnicornStudio=()=>{if(props.projectJSON){try{// Create script element for JSON data\nconst dataScript=document.createElement(\"script\");dataScript.id=scriptId.current;dataScript.type=\"application/json\";dataScript.textContent=props.projectJSON;document.body.appendChild(dataScript);elementRef.current?.setAttribute(\"data-us-project-src\",`${scriptId.current}`);}catch(e){console.error(\"Failed to parse project JSON:\",e);return;}}else if(props.projectId){const query=props.projectId.split(\"?\");const projectId=query[0];const production=query[1]&&query[1].includes(\"production\");const cacheBuster=isEditingOrPreviewing?\"?update=\"+Math.random():\"\";elementRef.current?.setAttribute(\"data-us-project\",projectId+cacheBuster);if(production){elementRef.current?.setAttribute(\"data-us-production\",\"1\");}}const US=window.UnicornStudio;if(!US||!elementRef.current)return;// 1) Clean up only our previous scene\nUS.scenes?.find(s=>s.element===elementRef.current)?.destroy();// 2) Prepare args\nconst args={element:elementRef.current,dpi:props.dpi,scale:props.scale,fps:props.fps,lazyLoad:!!props.lazyLoad,fixed:!!props.fixed,altText:props.altText,ariaLabel:props.ariaLabel};// If you passed JSON via a <script type=\"application/json\" id=...>\nif(props.projectJSON){// ensure script tag exists (your current code already does this)\nargs.filePath=scriptId.current;}else{args.projectId=props.projectId// your parsed id\n;}// 3) Create only this scene\nUS.addScene(args).then(scene=>{sceneRef.current=scene;});};if(props.projectId||props.projectJSON){initializeScript(initializeUnicornStudio);}return()=>{if(sceneRef.current){sceneRef.current.destroy();sceneRef.current=null;}// Clean up JSON script if it exists\nconst dataScript=document.getElementById(scriptId.current);if(dataScript){dataScript.remove();}};},[props.projectId,props.projectJSON,sdkVersion]);// CANVAS mode stays the same\nif(RenderTarget.current()===\"CANVAS\"){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",width:\"100%\",height:\"100%\",backgroundColor:\"rgba(0, 0, 0, 0.15)\",color:\"#4B5563\",fontWeight:500,textAlign:\"center\",padding:\"16px\"},children:[/*#__PURE__*/_jsx(\"p\",{style:{fontSize:\"1.25rem\",marginBottom:\"12px\"},children:\"Scene will render in Preview and on your published site.\"}),!props.projectId&&!props.projectJSON?/*#__PURE__*/_jsx(\"p\",{style:{fontSize:\"1rem\",color:\"#EF4444\"},children:\"No project ID, please export your scene and add its project ID in the detail panel.\"}):\" \"]});}// runtime render\nreturn /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",height:\"100%\",position:\"relative\"},children:[/*#__PURE__*/_jsx(\"div\",{ref:elementRef,\"data-us-dpi\":props.dpi,\"data-us-scale\":props.scale,\"data-us-fps\":props.fps,\"data-us-altText\":props.altText,\"data-us-ariaLabel\":props.ariaLabel,...props.lazyLoad?{\"data-us-lazyload\":\"true\"}:{},style:{width:\"100%\",height:\"100%\",...props.style},children:props.header&&/*#__PURE__*/_jsx(\"h1\",{style:{width:\"1px\",height:\"1px\",margin:\"-1px\",padding:\"0\",overflow:\"hidden\",clip:\"rect(0, 0, 0, 0)\",border:\"0\"},children:props.header})}),versionError?/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:8,background:\"rgba(239, 68, 68, 0.12)\",border:\"1px solid rgba(239, 68, 68, 0.5)\",borderRadius:6,padding:\"8px 10px\",fontSize:12,color:\"#991B1B\",pointerEvents:\"none\"},children:versionError}):null]});}UnicornStudioEmbed.displayName=\"Unicorn Studio Embed\";addPropertyControls(UnicornStudioEmbed,{projectId:{type:ControlType.String,title:\"Project ID\"},projectJSON:{type:ControlType.String,title:\"Project JSON\"},sdkVersion:{type:ControlType.String,title:\"SDK version\",defaultValue:VERSION,placeholder:VERSION},scale:{type:ControlType.Number,title:\"Scale\",defaultValue:1,min:.25,max:1,step:.01},dpi:{type:ControlType.Number,title:\"DPI\",defaultValue:1.5,min:.5,max:2,step:.1},fps:{type:ControlType.Number,title:\"FPS\",defaultValue:60,min:10,max:120,step:5},header:{type:ControlType.String,title:\"H1 text\"},altText:{type:ControlType.String,title:\"Alt text\"},ariaLabel:{type:ControlType.String,title:\"Aria label\"},lazyLoad:{type:ControlType.Boolean,title:\"Lazy Load\",defaultValue:false},fixed:{type:ControlType.Boolean,title:\"Fixed\",defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"UnicornStudioEmbed\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"400\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"fixed\",\"framerIntrinsicWidth\":\"800\",\"framerSupportedLayoutHeight\":\"fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./UnicornStudioEmbed.map","// Generated by Framer (4d43e7b)\nexport default function metadata(params,activeLocale){return{description:\"Klyro is an application onboarding platform for identity governance.Aggregation, transformation and correlation, on the IGA platform you already own.\",favicon:\"https://framerusercontent.com/assets/i5IkxtYoKPeZyJliPguYLZ7NxE.png\",robots:\"max-image-preview:large\",socialImage:\"https://framerusercontent.com/assets/UE7rq1FaprVeEfw5neaBAWY9KEI.jpg\",title:\"Klyro | Application Onboarding for Identity Governance\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"oNAKG,SAAwB,EAAmB,EAAM,CAA+C,IAAM,EAA/B,EAAM,YAAY,KAAK,GAAmC,EAAc,EAAWA,EAAO,IAAI,EAAQ,EAASA,EAAO,IAAI,EAAQ,EAASA,EAAO,mBAA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