"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.PropertyDetails=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),styled_components_1=__importDefault(require("styled-components")),jotai_1=require("jotai"),Schema_1=require("../Schema"),FieldDetails_1=require("./FieldDetails"),LinkToField_1=require("../common/LinkToField"),app_1=require("../../jotai/app");function PropertyDetailsComponent({field:e,skipWriteOnly:i,skipReadOnly:r,level:t=1,showTitle:s,renderDiscriminatorSwitch:a,isFirst:o,fieldParentsName:n,disableDeepLinks:l,oneOfLevel:d,slug:p}){const m=(0,jotai_1.useAtomValue)(app_1.activeMimeNameAtom),c=l?void 0:(0,LinkToField_1.generateDeepLink)(e,m),_=p&&c?`${p}&${c.replace("#","")}`:c,u=!e.schema.isPrimitive&&!e.schema.isCircular;return(0,jsx_runtime_1.jsxs)(Wrapper,{isFist:o,expanded:u,className:"property",children:[(0,jsx_runtime_1.jsx)(FieldDetails_1.FieldDetails,{field:e,renderDiscriminatorSwitch:a,deepLink:_,fieldParentsName:n}),u&&(0,jsx_runtime_1.jsx)(Schema_1.Schema,{schema:e.schema,skipReadOnly:r,skipWriteOnly:i,showTitle:s,expandable:!0,level:t+1,fieldParentsName:[...n||[],e.name],deepLink:_,required:e.required,disableDeepLinks:l,oneOfLevel:d,slug:p})]})}exports.PropertyDetails=(0,react_1.memo)(PropertyDetailsComponent);const Wrapper=styled_components_1.default.div`
  width: 100%;
  padding: ${({isFist:e})=>`var(--schema-${e?"fist-":""}property-details-spacing)`} 0
    ${({expanded:e})=>e?0:"var(--schema-property-details-spacing)"};
  ${({expanded:e})=>!e&&"border-bottom: 1px solid var(--border-color-primary)"};

  // This styles needs to override the dividers when array closing label is present
  &:has(+ span.array-closing-label) {
    border-bottom: none;
    padding-bottom: calc(var(--schema-property-details-spacing) / 2);

    .view-nested-wrapper {
      border-bottom: none;
      padding-bottom: 0;
    }
  }
`;
//# sourceMappingURL=PropertyDetails.js.map