<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import{readHref}from"./XLink.js";import XML from"./XML.js";import{readDecimalString,readString,readNonNegativeInteger,readDecimal,readBooleanString,readNonNegativeIntegerString}from"./xsd.js";import{makeArrayPusher,makeObjectPropertyPusher,makeObjectPropertySetter,makeStructureNS,pushParseAndPop}from"../xml.js";const NAMESPACE_URIS=[null,"http://www.opengis.net/wms"],PARSERS=makeStructureNS(NAMESPACE_URIS,{Service:makeObjectPropertySetter(readService),Capability:makeObjectPropertySetter(readCapability)}),CAPABILITY_PARSERS=makeStructureNS(NAMESPACE_URIS,{Request:makeObjectPropertySetter(readRequest),Exception:makeObjectPropertySetter(readException),Layer:makeObjectPropertySetter(readCapabilityLayer)});class WMSCapabilities extends XML{constructor(){super(),this.version=void 0}readFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null}readFromNode(e){this.version=e.getAttribute("version").trim();e=pushParseAndPop({version:this.version},PARSERS,e,[]);return e||null}}const SERVICE_PARSERS=makeStructureNS(NAMESPACE_URIS,{Name:makeObjectPropertySetter(readString),Title:makeObjectPropertySetter(readString),Abstract:makeObjectPropertySetter(readString),KeywordList:makeObjectPropertySetter(readKeywordList),OnlineResource:makeObjectPropertySetter(readHref),ContactInformation:makeObjectPropertySetter(readContactInformation),Fees:makeObjectPropertySetter(readString),AccessConstraints:makeObjectPropertySetter(readString),LayerLimit:makeObjectPropertySetter(readNonNegativeInteger),MaxWidth:makeObjectPropertySetter(readNonNegativeInteger),MaxHeight:makeObjectPropertySetter(readNonNegativeInteger)}),CONTACT_INFORMATION_PARSERS=makeStructureNS(NAMESPACE_URIS,{ContactPersonPrimary:makeObjectPropertySetter(readContactPersonPrimary),ContactPosition:makeObjectPropertySetter(readString),ContactAddress:makeObjectPropertySetter(readContactAddress),ContactVoiceTelephone:makeObjectPropertySetter(readString),ContactFacsimileTelephone:makeObjectPropertySetter(readString),ContactElectronicMailAddress:makeObjectPropertySetter(readString)}),CONTACT_PERSON_PARSERS=makeStructureNS(NAMESPACE_URIS,{ContactPerson:makeObjectPropertySetter(readString),ContactOrganization:makeObjectPropertySetter(readString)}),CONTACT_ADDRESS_PARSERS=makeStructureNS(NAMESPACE_URIS,{AddressType:makeObjectPropertySetter(readString),Address:makeObjectPropertySetter(readString),City:makeObjectPropertySetter(readString),StateOrProvince:makeObjectPropertySetter(readString),PostCode:makeObjectPropertySetter(readString),Country:makeObjectPropertySetter(readString)}),EXCEPTION_PARSERS=makeStructureNS(NAMESPACE_URIS,{Format:makeArrayPusher(readString)}),LAYER_PARSERS=makeStructureNS(NAMESPACE_URIS,{Name:makeObjectPropertySetter(readString),Title:makeObjectPropertySetter(readString),Abstract:makeObjectPropertySetter(readString),KeywordList:makeObjectPropertySetter(readKeywordList),CRS:makeObjectPropertyPusher(readString),EX_GeographicBoundingBox:makeObjectPropertySetter(readEXGeographicBoundingBox),BoundingBox:makeObjectPropertyPusher(readBoundingBox),Dimension:makeObjectPropertyPusher(readDimension),Attribution:makeObjectPropertySetter(readAttribution),AuthorityURL:makeObjectPropertyPusher(readAuthorityURL),Identifier:makeObjectPropertyPusher(readString),MetadataURL:makeObjectPropertyPusher(readMetadataURL),DataURL:makeObjectPropertyPusher(readFormatOnlineresource),FeatureListURL:makeObjectPropertyPusher(readFormatOnlineresource),Style:makeObjectPropertyPusher(readStyle),MinScaleDenominator:makeObjectPropertySetter(readDecimal),MaxScaleDenominator:makeObjectPropertySetter(readDecimal),Layer:makeObjectPropertyPusher(readLayer)}),ATTRIBUTION_PARSERS=makeStructureNS(NAMESPACE_URIS,{Title:makeObjectPropertySetter(readString),OnlineResource:makeObjectPropertySetter(readHref),LogoURL:makeObjectPropertySetter(readSizedFormatOnlineresource)}),EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS=makeStructureNS(NAMESPACE_URIS,{westBoundLongitude:makeObjectPropertySetter(readDecimal),eastBoundLongitude:makeObjectPropertySetter(readDecimal),southBoundLatitude:makeObjectPropertySetter(readDecimal),northBoundLatitude:makeObjectPropertySetter(readDecimal)}),REQUEST_PARSERS=makeStructureNS(NAMESPACE_URIS,{GetCapabilities:makeObjectPropertySetter(readOperationType),GetMap:makeObjectPropertySetter(readOperationType),GetFeatureInfo:makeObjectPropertySetter(readOperationType)}),OPERATIONTYPE_PARSERS=makeStructureNS(NAMESPACE_URIS,{Format:makeObjectPropertyPusher(readString),DCPType:makeObjectPropertyPusher(readDCPType)}),DCPTYPE_PARSERS=makeStructureNS(NAMESPACE_URIS,{HTTP:makeObjectPropertySetter(readHTTP)}),HTTP_PARSERS=makeStructureNS(NAMESPACE_URIS,{Get:makeObjectPropertySetter(readFormatOnlineresource),Post:makeObjectPropertySetter(readFormatOnlineresource)}),STYLE_PARSERS=makeStructureNS(NAMESPACE_URIS,{Name:makeObjectPropertySetter(readString),Title:makeObjectPropertySetter(readString),Abstract:makeObjectPropertySetter(readString),LegendURL:makeObjectPropertyPusher(readSizedFormatOnlineresource),StyleSheetURL:makeObjectPropertySetter(readFormatOnlineresource),StyleURL:makeObjectPropertySetter(readFormatOnlineresource)}),FORMAT_ONLINERESOURCE_PARSERS=makeStructureNS(NAMESPACE_URIS,{Format:makeObjectPropertySetter(readString),OnlineResource:makeObjectPropertySetter(readHref)}),KEYWORDLIST_PARSERS=makeStructureNS(NAMESPACE_URIS,{Keyword:makeArrayPusher(readString)});function readAttribution(e,t){return pushParseAndPop({},ATTRIBUTION_PARSERS,e,t)}function readBoundingBox(e,t){var r=[readDecimalString(e.getAttribute("minx")),readDecimalString(e.getAttribute("miny")),readDecimalString(e.getAttribute("maxx")),readDecimalString(e.getAttribute("maxy"))],a=[readDecimalString(e.getAttribute("resx")),readDecimalString(e.getAttribute("resy"))];return{crs:e.getAttribute("CRS"),extent:r,res:a}}function readEXGeographicBoundingBox(e,t){e=pushParseAndPop({},EX_GEOGRAPHIC_BOUNDING_BOX_PARSERS,e,t);if(e){var t=e.westBoundLongitude,r=e.southBoundLatitude,a=e.eastBoundLongitude,e=e.northBoundLatitude;if(void 0!==t&amp;&amp;void 0!==r&amp;&amp;void 0!==a&amp;&amp;void 0!==e)return[t,r,a,e]}}function readCapability(e,t){return pushParseAndPop({},CAPABILITY_PARSERS,e,t)}function readService(e,t){return pushParseAndPop({},SERVICE_PARSERS,e,t)}function readContactInformation(e,t){return pushParseAndPop({},CONTACT_INFORMATION_PARSERS,e,t)}function readContactPersonPrimary(e,t){return pushParseAndPop({},CONTACT_PERSON_PARSERS,e,t)}function readContactAddress(e,t){return pushParseAndPop({},CONTACT_ADDRESS_PARSERS,e,t)}function readException(e,t){return pushParseAndPop([],EXCEPTION_PARSERS,e,t)}function readCapabilityLayer(e,t){return pushParseAndPop({},LAYER_PARSERS,e,t)}function readLayer(i,e){const S=e[e.length-1],d=pushParseAndPop({},LAYER_PARSERS,i,e);if(d){let e=readBooleanString(i.getAttribute("queryable")),t=(void 0===e&amp;&amp;(e=S.queryable),d.queryable=void 0!==e&amp;&amp;e,readNonNegativeIntegerString(i.getAttribute("cascaded"))),r=(void 0===t&amp;&amp;(t=S.cascaded),d.cascaded=t,readBooleanString(i.getAttribute("opaque"))),a=(void 0===r&amp;&amp;(r=S.opaque),d.opaque=void 0!==r&amp;&amp;r,readBooleanString(i.getAttribute("noSubsets"))),n=(void 0===a&amp;&amp;(a=S.noSubsets),d.noSubsets=void 0!==a&amp;&amp;a,readDecimalString(i.getAttribute("fixedWidth"))),o=(n=n||S.fixedWidth,d.fixedWidth=n,readDecimalString(i.getAttribute("fixedHeight")));o=o||S.fixedHeight,d.fixedHeight=o;["Style","CRS","AuthorityURL"].forEach(function(e){if(e in S){const t=d[e]||[];d[e]=t.concat(S[e])}});return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach(function(e){var t;e in d||(t=S[e],d[e]=t)}),d}}function readDimension(e,t){return{name:e.getAttribute("name"),units:e.getAttribute("units"),unitSymbol:e.getAttribute("unitSymbol"),default:e.getAttribute("default"),multipleValues:readBooleanString(e.getAttribute("multipleValues")),nearestValue:readBooleanString(e.getAttribute("nearestValue")),current:readBooleanString(e.getAttribute("current")),values:readString(e)}}function readFormatOnlineresource(e,t){return pushParseAndPop({},FORMAT_ONLINERESOURCE_PARSERS,e,t)}function readRequest(e,t){return pushParseAndPop({},REQUEST_PARSERS,e,t)}function readDCPType(e,t){return pushParseAndPop({},DCPTYPE_PARSERS,e,t)}function readHTTP(e,t){return pushParseAndPop({},HTTP_PARSERS,e,t)}function readOperationType(e,t){return pushParseAndPop({},OPERATIONTYPE_PARSERS,e,t)}function readSizedFormatOnlineresource(e,t){const r=readFormatOnlineresource(e,t);if(r)return t=[readNonNegativeIntegerString(e.getAttribute("width")),readNonNegativeIntegerString(e.getAttribute("height"))],r.size=t,r}function readAuthorityURL(e,t){const r=readFormatOnlineresource(e,t);if(r)return r.name=e.getAttribute("name"),r}function readMetadataURL(e,t){const r=readFormatOnlineresource(e,t);if(r)return r.type=e.getAttribute("type"),r}function readStyle(e,t){return pushParseAndPop({},STYLE_PARSERS,e,t)}function readKeywordList(e,t){return pushParseAndPop([],KEYWORDLIST_PARSERS,e,t)}export default WMSCapabilities;</pre></body></html>