{"version":3,"sources":["node_modules\\react-dom\\lib\\DOMPropertyOperations.js"],"names":["DOMProperty","require","ReactDOMComponentTree","ReactInstrumentation","quoteAttributeValueForBrowser","warning","VALID_ATTRIBUTE_NAME_REGEX","RegExp","ATTRIBUTE_NAME_START_CHAR","ATTRIBUTE_NAME_CHAR","illegalAttributeNameCache","validatedAttributeNameCache","isAttributeNameSafe","attributeName","hasOwnProperty","test","process","env","NODE_ENV","shouldIgnoreValue","propertyInfo","value","hasBooleanValue","hasNumericValue","isNaN","hasPositiveNumericValue","hasOverloadedBooleanValue","DOMPropertyOperations","createMarkupForID","id","ID_ATTRIBUTE_NAME","setAttributeForID","node","setAttribute","createMarkupForRoot","ROOT_ATTRIBUTE_NAME","setAttributeForRoot","createMarkupForProperty","name","properties","isCustomAttribute","createMarkupForCustomAttribute","setValueForProperty","mutationMethod","deleteValueForProperty","mustUseProperty","propertyName","namespace","attributeNamespace","setAttributeNS","setValueForAttribute","payload","debugTool","onHostOperation","instanceID","getInstanceFromNode","_debugID","type","removeAttribute","deleteValueForAttribute","undefined","propName","module","exports"],"mappings":";;;;;;;;;;AAUA;;AAEA,GAAIA,aAAcC,QAAQ,eAAR,CAAlB;AACA,GAAIC,uBAAwBD,QAAQ,yBAAR,CAA5B;AACA,GAAIE,sBAAuBF,QAAQ,wBAAR,CAA3B;;AAEA,GAAIG,+BAAgCH,QAAQ,iCAAR,CAApC;AACA,GAAII,SAAUJ,QAAQ,kBAAR,CAAd;;AAEA,GAAIK,4BAA6B,GAAIC,OAAJ,CAAW,KAAOP,YAAYQ,yBAAnB,CAA+C,IAA/C,CAAsDR,YAAYS,mBAAlE,CAAwF,KAAnG,CAAjC;AACA,GAAIC,2BAA4B,EAAhC;AACA,GAAIC,6BAA8B,EAAlC;;AAEA,QAASC,oBAAT,CAA6BC,aAA7B,CAA4C;AAC1C,GAAIF,4BAA4BG,cAA5B,CAA2CD,aAA3C,CAAJ,CAA+D;AAC7D,MAAO,KAAP;AACD;AACD,GAAIH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A5B;AACA,GAAI1B,aAAaE,eAAjB,CAAkC;AAChCU,KAAK6B,QAAL,EAAiB,KAAjB;AACD,CAFD,IAEO;AACL7B,KAAK6B,QAAL,EAAiB,EAAjB;AACD;AACF,CAPM,IAOA;AACL7B,KAAK0B,eAAL,CAAqBtC,aAAaP,aAAlC;AACD;AACF,CAdD,IAcO,IAAIb,YAAYwC,iBAAZ,CAA8BF,IAA9B,CAAJ,CAAyC;AAC9CN,KAAK0B,eAAL,CAAqBpB,IAArB;AACD;;AAED,GAAItB,QAAQC,GAAR,CAAYC,QAAZ,GAAyB,YAA7B,CAA2C;AACzCf,qBAAqBiD,SAArB,CAA+BC,eAA/B,CAA+C;AAC7CC,WAAYpD,sBAAsBqD,mBAAtB,CAA0CvB,IAA1C,EAAgDwB,QADf;AAE7CC,KAAM,kBAFuC;AAG7CN,QAASb,IAHoC,CAA/C;;AAKD;AACF,CAxLyB,CAA5B;;;AA2LAwB,OAAOC,OAAP,CAAiBpC,qBAAjB","file":"DOMPropertyOperations.js","sourceRoot":"d:/Work/Office/react-native-on-web/cli/tmpl/project","sourcesContent":["/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n */\n\n'use strict';\n\nvar DOMProperty = require('./DOMProperty');\nvar ReactDOMComponentTree = require('./ReactDOMComponentTree');\nvar ReactInstrumentation = require('./ReactInstrumentation');\n\nvar quoteAttributeValueForBrowser = require('./quoteAttributeValueForBrowser');\nvar warning = require('fbjs/lib/warning');\n\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + DOMProperty.ATTRIBUTE_NAME_START_CHAR + '][' + DOMProperty.ATTRIBUTE_NAME_CHAR + ']*$');\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\n\nfunction isAttributeNameSafe(attributeName) {\n  if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {\n    return true;\n  }\n  if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {\n    return false;\n  }\n  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n    validatedAttributeNameCache[attributeName] = true;\n    return true;\n  }\n  illegalAttributeNameCache[attributeName] = true;\n  process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid attribute name: `%s`', attributeName) : void 0;\n  return false;\n}\n\nfunction shouldIgnoreValue(propertyInfo, value) {\n  return value == null || propertyInfo.hasBooleanValue && !value || propertyInfo.hasNumericValue && isNaN(value) || propertyInfo.hasPositiveNumericValue && value < 1 || propertyInfo.hasOverloadedBooleanValue && value === false;\n}\n\n/**\n * Operations for dealing with DOM properties.\n */\nvar DOMPropertyOperations = {\n  /**\n   * Creates markup for the ID property.\n   *\n   * @param {string} id Unescaped ID.\n   * @return {string} Markup string.\n   */\n  createMarkupForID: function (id) {\n    return DOMProperty.ID_ATTRIBUTE_NAME + '=' + quoteAttributeValueForBrowser(id);\n  },\n\n  setAttributeForID: function (node, id) {\n    node.setAttribute(DOMProperty.ID_ATTRIBUTE_NAME, id);\n  },\n\n  createMarkupForRoot: function () {\n    return DOMProperty.ROOT_ATTRIBUTE_NAME + '=\"\"';\n  },\n\n  setAttributeForRoot: function (node) {\n    node.setAttribute(DOMProperty.ROOT_ATTRIBUTE_NAME, '');\n  },\n\n  /**\n   * Creates markup for a property.\n   *\n   * @param {string} name\n   * @param {*} value\n   * @return {?string} Markup string, or null if the property was invalid.\n   */\n  createMarkupForProperty: function (name, value) {\n    var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;\n    if (propertyInfo) {\n      if (shouldIgnoreValue(propertyInfo, value)) {\n        return '';\n      }\n      var attributeName = propertyInfo.attributeName;\n      if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {\n        return attributeName + '=\"\"';\n      }\n      return attributeName + '=' + quoteAttributeValueForBrowser(value);\n    } else if (DOMProperty.isCustomAttribute(name)) {\n      if (value == null) {\n        return '';\n      }\n      return name + '=' + quoteAttributeValueForBrowser(value);\n    }\n    return null;\n  },\n\n  /**\n   * Creates markup for a custom property.\n   *\n   * @param {string} name\n   * @param {*} value\n   * @return {string} Markup string, or empty string if the property was invalid.\n   */\n  createMarkupForCustomAttribute: function (name, value) {\n    if (!isAttributeNameSafe(name) || value == null) {\n      return '';\n    }\n    return name + '=' + quoteAttributeValueForBrowser(value);\n  },\n\n  /**\n   * Sets the value for a property on a node.\n   *\n   * @param {DOMElement} node\n   * @param {string} name\n   * @param {*} value\n   */\n  setValueForProperty: function (node, name, value) {\n    var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;\n    if (propertyInfo) {\n      var mutationMethod = propertyInfo.mutationMethod;\n      if (mutationMethod) {\n        mutationMethod(node, value);\n      } else if (shouldIgnoreValue(propertyInfo, value)) {\n        this.deleteValueForProperty(node, name);\n        return;\n      } else if (propertyInfo.mustUseProperty) {\n        // Contrary to `setAttribute`, object properties are properly\n        // `toString`ed by IE8/9.\n        node[propertyInfo.propertyName] = value;\n      } else {\n        var attributeName = propertyInfo.attributeName;\n        var namespace = propertyInfo.attributeNamespace;\n        // `setAttribute` with objects becomes only `[object]` in IE8/9,\n        // ('' + value) makes it output the correct toString()-value.\n        if (namespace) {\n          node.setAttributeNS(namespace, attributeName, '' + value);\n        } else if (propertyInfo.hasBooleanValue || propertyInfo.hasOverloadedBooleanValue && value === true) {\n          node.setAttribute(attributeName, '');\n        } else {\n          node.setAttribute(attributeName, '' + value);\n        }\n      }\n    } else if (DOMProperty.isCustomAttribute(name)) {\n      DOMPropertyOperations.setValueForAttribute(node, name, value);\n      return;\n    }\n\n    if (process.env.NODE_ENV !== 'production') {\n      var payload = {};\n      payload[name] = value;\n      ReactInstrumentation.debugTool.onHostOperation({\n        instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,\n        type: 'update attribute',\n        payload: payload\n      });\n    }\n  },\n\n  setValueForAttribute: function (node, name, value) {\n    if (!isAttributeNameSafe(name)) {\n      return;\n    }\n    if (value == null) {\n      node.removeAttribute(name);\n    } else {\n      node.setAttribute(name, '' + value);\n    }\n\n    if (process.env.NODE_ENV !== 'production') {\n      var payload = {};\n      payload[name] = value;\n      ReactInstrumentation.debugTool.onHostOperation({\n        instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,\n        type: 'update attribute',\n        payload: payload\n      });\n    }\n  },\n\n  /**\n   * Deletes an attributes from a node.\n   *\n   * @param {DOMElement} node\n   * @param {string} name\n   */\n  deleteValueForAttribute: function (node, name) {\n    node.removeAttribute(name);\n    if (process.env.NODE_ENV !== 'production') {\n      ReactInstrumentation.debugTool.onHostOperation({\n        instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,\n        type: 'remove attribute',\n        payload: name\n      });\n    }\n  },\n\n  /**\n   * Deletes the value for a property on a node.\n   *\n   * @param {DOMElement} node\n   * @param {string} name\n   */\n  deleteValueForProperty: function (node, name) {\n    var propertyInfo = DOMProperty.properties.hasOwnProperty(name) ? DOMProperty.properties[name] : null;\n    if (propertyInfo) {\n      var mutationMethod = propertyInfo.mutationMethod;\n      if (mutationMethod) {\n        mutationMethod(node, undefined);\n      } else if (propertyInfo.mustUseProperty) {\n        var propName = propertyInfo.propertyName;\n        if (propertyInfo.hasBooleanValue) {\n          node[propName] = false;\n        } else {\n          node[propName] = '';\n        }\n      } else {\n        node.removeAttribute(propertyInfo.attributeName);\n      }\n    } else if (DOMProperty.isCustomAttribute(name)) {\n      node.removeAttribute(name);\n    }\n\n    if (process.env.NODE_ENV !== 'production') {\n      ReactInstrumentation.debugTool.onHostOperation({\n        instanceID: ReactDOMComponentTree.getInstanceFromNode(node)._debugID,\n        type: 'remove attribute',\n        payload: name\n      });\n    }\n  }\n};\n\nmodule.exports = DOMPropertyOperations;"]}