var __extends=this&&this.__extends||function(){var S=function(e,r){return(S=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t])})(e,r)};return function(e,r){function t(){this.constructor=e}S(e,r),e.prototype=null===r?Object.create(r):(t.prototype=r.prototype,new t)}}();import XML from"./XML.js";import{makeObjectPropertyPusher,makeObjectPropertySetter,makeStructureNS,pushParseAndPop}from"../xml.js";import{readHref}from"./XLink.js";import{readString}from"./xsd.js";var NAMESPACE_URIS=[null,"http://www.opengis.net/ows/1.1"],PARSERS=makeStructureNS(NAMESPACE_URIS,{ServiceIdentification:makeObjectPropertySetter(readServiceIdentification),ServiceProvider:makeObjectPropertySetter(readServiceProvider),OperationsMetadata:makeObjectPropertySetter(readOperationsMetadata)}),OWS=function(e){function r(){return e.call(this)||this}return __extends(r,e),r.prototype.readFromNode=function(e){e=pushParseAndPop({},PARSERS,e,[]);return e||null},r}(XML),ADDRESS_PARSERS=makeStructureNS(NAMESPACE_URIS,{DeliveryPoint:makeObjectPropertySetter(readString),City:makeObjectPropertySetter(readString),AdministrativeArea:makeObjectPropertySetter(readString),PostalCode:makeObjectPropertySetter(readString),Country:makeObjectPropertySetter(readString),ElectronicMailAddress:makeObjectPropertySetter(readString)}),ALLOWED_VALUES_PARSERS=makeStructureNS(NAMESPACE_URIS,{Value:makeObjectPropertyPusher(readValue)}),CONSTRAINT_PARSERS=makeStructureNS(NAMESPACE_URIS,{AllowedValues:makeObjectPropertySetter(readAllowedValues)}),CONTACT_INFO_PARSERS=makeStructureNS(NAMESPACE_URIS,{Phone:makeObjectPropertySetter(readPhone),Address:makeObjectPropertySetter(readAddress)}),DCP_PARSERS=makeStructureNS(NAMESPACE_URIS,{HTTP:makeObjectPropertySetter(readHttp)}),HTTP_PARSERS=makeStructureNS(NAMESPACE_URIS,{Get:makeObjectPropertyPusher(readGet),Post:void 0}),OPERATION_PARSERS=makeStructureNS(NAMESPACE_URIS,{DCP:makeObjectPropertySetter(readDcp)}),OPERATIONS_METADATA_PARSERS=makeStructureNS(NAMESPACE_URIS,{Operation:readOperation}),PHONE_PARSERS=makeStructureNS(NAMESPACE_URIS,{Voice:makeObjectPropertySetter(readString),Facsimile:makeObjectPropertySetter(readString)}),REQUEST_METHOD_PARSERS=makeStructureNS(NAMESPACE_URIS,{Constraint:makeObjectPropertyPusher(readConstraint)}),SERVICE_CONTACT_PARSERS=makeStructureNS(NAMESPACE_URIS,{IndividualName:makeObjectPropertySetter(readString),PositionName:makeObjectPropertySetter(readString),ContactInfo:makeObjectPropertySetter(readContactInfo)}),SERVICE_IDENTIFICATION_PARSERS=makeStructureNS(NAMESPACE_URIS,{Abstract:makeObjectPropertySetter(readString),AccessConstraints:makeObjectPropertySetter(readString),Fees:makeObjectPropertySetter(readString),Title:makeObjectPropertySetter(readString),ServiceTypeVersion:makeObjectPropertySetter(readString),ServiceType:makeObjectPropertySetter(readString)}),SERVICE_PROVIDER_PARSERS=makeStructureNS(NAMESPACE_URIS,{ProviderName:makeObjectPropertySetter(readString),ProviderSite:makeObjectPropertySetter(readHref),ServiceContact:makeObjectPropertySetter(readServiceContact)});function readAddress(e,r){return pushParseAndPop({},ADDRESS_PARSERS,e,r)}function readAllowedValues(e,r){return pushParseAndPop({},ALLOWED_VALUES_PARSERS,e,r)}function readConstraint(e,r){var t=e.getAttribute("name");if(t)return pushParseAndPop({name:t},CONSTRAINT_PARSERS,e,r)}function readContactInfo(e,r){return pushParseAndPop({},CONTACT_INFO_PARSERS,e,r)}function readDcp(e,r){return pushParseAndPop({},DCP_PARSERS,e,r)}function readGet(e,r){var t=readHref(e);if(t)return pushParseAndPop({href:t},REQUEST_METHOD_PARSERS,e,r)}function readHttp(e,r){return pushParseAndPop({},HTTP_PARSERS,e,r)}function readOperation(e,r){var t=e.getAttribute("name"),e=pushParseAndPop({},OPERATION_PARSERS,e,r);e&&(r[r.length-1][t]=e)}function readOperationsMetadata(e,r){return pushParseAndPop({},OPERATIONS_METADATA_PARSERS,e,r)}function readPhone(e,r){return pushParseAndPop({},PHONE_PARSERS,e,r)}function readServiceIdentification(e,r){return pushParseAndPop({},SERVICE_IDENTIFICATION_PARSERS,e,r)}function readServiceContact(e,r){return pushParseAndPop({},SERVICE_CONTACT_PARSERS,e,r)}function readServiceProvider(e,r){return pushParseAndPop({},SERVICE_PROVIDER_PARSERS,e,r)}function readValue(e,r){return readString(e)}export default OWS;