import{jsxs as e,jsx as t,Fragment as a}from"react/jsx-runtime";import{useState as i,useEffect as o,useRef as n}from"react";import r from"classnames";import{makeStyles as s}from"@material-ui/core";import p from"../../DevCenter/AppHeader/AppHeader.js";var l=300,c=400,d={appNotSubscribed:{title:"No Subscription exists for this app.",subtitle:"Contact your Corva Account rep to get access to this app."},appNotSubscribedForAsset:{title:"No Subscription exists for this asset.",subtitle:"Contact your Corva Account rep to get access to this asset."},internalAppError:{title:"App Loading Error"},appPackageWasNotFound:{title:"App package was not found",subtitle:"Please choose another version in the app settings menu or delete and add app again on your dashboard"},fracFleetWasNotFound:{title:"Frac fleet was not found"},fracFleetHasNoPad:{title:"Frac fleet has no active pad"},padHasNoWells:{title:"This pad has no wells"},appComponentWasNotFound:{title:"App component was not found"},noAssetData:{title:"No asset data found"},assetNotAvailable:{title:"Asset unavailable"}},m={empty:"empty",error:"error",noData:"noData",noSubscription:"noSubscription"},u={empty:"/static/media/e607e3aa0a4603bb7ae7f83a2148511e.svg",error:"/static/media/9b185a425ea91b6c2beedfef39c06663.svg",noData:"/static/media/1bfc6e5d9cbb531a554ab8d025fa23e9.svg",noSubscription:"/static/media/76e3ee12638391cba164716321509ad7.svg"},f=s((function(e){var t=e.palette;return{wrapper:{display:"flex",flexDirection:"column",textAlign:"center",alignItems:"center",justifyContent:"center",height:"100%",padding:24,overflow:"auto"},title:{color:t.primary.text7,fontSize:32,lineHeight:"38px",marginBottom:8,"&.medium":{fontSize:24,lineHeight:"28px"},"&.small":{fontSize:24,lineHeight:"28px"},fontStyle:"italic"},subtitle:{color:t.primary.text6,fontSize:16,lineHeight:"22px",marginBottom:24,"&.medium":{fontSize:14,lineHeight:"20px"},"&.small":{fontSize:14,lineHeight:"20px"}},imageWrapper:{display:"flex",flexGrow:1,maxWidth:390,maxHeight:300,width:"100%","&.medium":{maxidth:260,maxHeight:200}},backgroundImage:{width:"100%",backgroundImage:function(e){return"url(".concat([u[e.state]],")")},backgroundRepeat:"no-repeat",backgroundPosition:"center",backgroundSize:"contain"},appHeader:{display:"flex",padding:"12px",flexWrap:"wrap",justifyContent:"space-between"},container:{height:"100%",flexDirection:"column",display:"flex"}}})),g=function(s){var l=s.title,c=s.subtitle,d=void 0===c?"":c,m=s.state,u=void 0===m?"empty":m,g=s.withAppHeader,b=void 0!==g&&g,h=s.app,v=s.actions,x=void 0===v?null:v,S=f({state:u}),A=i(!1),y=A[0],H=A[1];o((function(){H(!0)}),[]);var N=n(null),w=N.current,k=(null==w?void 0:w.offsetHeight)<300,C=(null==w?void 0:w.offsetHeight)<400;return e("div",{className:S.container,children:[b&&t(p,{app:h,classes:{appHeader:S.appHeader}}),t("div",{className:S.wrapper,ref:N,children:y&&e(a,{children:[t("div",{"data-testid":"".concat("EmptyAppView","_title"),className:r(S.title,C&&"medium",k&&"small"),children:l}),x,d&&t("div",{"data-testid":"".concat("EmptyAppView","_subtitle"),className:r(S.subtitle,C&&"medium",k&&"small"),children:d}),!k&&t("div",{className:r(S.imageWrapper,C&&"medium"),children:t("div",{className:S.backgroundImage})})]})})]})};g.APP_MESSAGES=d,g.EMPTY_STATES=m;export{d as APP_MESSAGES,m as EMPTY_STATES,c as HEIGHT_MEDIUM_BREAKPOINT,l as HEIGHT_SMALL_BREAKPOINT,g as default};
