"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../../../ext-esm/tslib/tslib.es6.js'),t=require("react/jsx-runtime"),a=require("../../../../ErrorBoundary/ErrorBoundary.js");require("../../../../ErrorBoundary/DevCenterAppErrorView/DevCenterAppErrorView.js");var r=require("../../../../LoadingIndicator/LoadingIndicator.js"),s=require("../../../../../constants/segment.js"),i=require("../../../../EmptyState/EmptyState.js"),o=require("./components/ChooseAssetButton.js"),p=require("../AppInfoMessage/AppInfoMessage.js"),l="DevCenterAppView",n=function(e){return"".concat(e," has no active well")};function d(d){var u,c=d.AppComponent,S=d.app,E=d.appData,A=d.appProps,g=d.availability,P=d.isCLIApp,j=d.isLoading,f=d.isMultiRig,m=d.layoutEnvironment,b=d.openIntercom,M=d.segment,x=d.toggleAppSettingsDialog,v=null==A?void 0:A.appHeaderProps;if(!S.package)return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(i,{"data-testid":"".concat(l,"_EmptyState"),title:i.APP_MESSAGES.appPackageWasNotFound.title,subtitle:i.APP_MESSAGES.appPackageWasNotFound.subtitle,image:i.IMAGES.AppLoadingError})});if(j)return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(r,{})});if(!g.hasProductSubscription||!g.isAppSubscribedForAsset){var _=i.APP_MESSAGES,N=_.appNotSubscribed,y=_.appNotSubscribedForAsset,G=i.IMAGES.NoSubscription,I=g.hasProductSubscription?y:N,h=I.title,H=I.subtitle;return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(i,{"data-testid":"".concat(l,"_EmptyState"),title:h,subtitle:H,image:G})})}if(!c)return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(i,{"data-testid":"".concat(l,"_EmptyState"),title:i.APP_MESSAGES.appComponentWasNotFound.title,image:i.IMAGES.AppLoadingError})});if(!f){var F=P&&t.jsx(o.ChooseAssetButton,{toggleAppSettingsDialog:x});if(E.rig&&!E.well)return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(i,{"data-testid":"".concat(l,"_EmptyState"),title:n(E.rig.name),image:i.IMAGES.RigHasNoActiveWell,subtitle:F})});if("general"===(null==m?void 0:m.type)&&M===s.SEGMENTS.COMPLETION&&!E.fracFleet)return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(i,{"data-testid":"".concat(l,"_EmptyState"),title:i.APP_MESSAGES.fracFleetWasNotFound.title,image:i.IMAGES.FracFleetHasNoActivePad,subtitle:F})});if("general"===(null==m?void 0:m.type)&&M===s.SEGMENTS.COMPLETION&&!(null===(u=E.fracFleet)||void 0===u?void 0:u.current_pad_id)&&!S.settings.padId)return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(i,{"data-testid":"".concat(l,"_EmptyState"),image:i.IMAGES.FracFleetHasNoActivePad,subtitle:F,title:i.APP_MESSAGES.fracFleetHasNoPad.title})});if("general"===(null==m?void 0:m.type)&&M===s.SEGMENTS.COMPLETION&&(!E.wells||E.wells.length<1))return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(i,{"data-testid":"".concat(l,"_EmptyState"),image:i.IMAGES.NoWellsSelected,subtitle:F,title:i.APP_MESSAGES.padHasNoWells.title})});if(!(E.rig||E.well||E.settings||E.wells))return t.jsx(p.default,{appHeaderProps:v,children:t.jsx(i,{"data-testid":"".concat(l,"_EmptyState"),image:i.IMAGES.AssetHasNoData,subtitle:F,title:i.APP_MESSAGES.assetNotAvailable.title})})}return t.jsx(a,{appHeaderProps:v,openIntercom:b,children:t.jsx(c,e.__assign({app:S},S.settings,E,A))})}d.defaultProps={availability:{hasProductSubscription:!0,isAppSubscribedForAsset:!0}},exports.default=d,exports.getNoActiveWellMessage=n;
