190328214ff6032d71a39d2d716e7f4a.json 42.2 KB
{"ast":null,"code":"var _interopRequireDefault=require(\"@babel/runtime/helpers/interopRequireDefault\");Object.defineProperty(exports,\"__esModule\",{value:true});exports.default=void 0;var _react=_interopRequireDefault(require(\"react\"));var _View=_interopRequireDefault(require(\"../../../exports/View\"));var _VirtualizedList=_interopRequireDefault(require(\"../VirtualizedList\"));var _invariant=_interopRequireDefault(require(\"fbjs/lib/invariant\"));function _extends(){_extends=Object.assign||function(target){for(var i=1;i<arguments.length;i++){var source=arguments[i];for(var key in source){if(Object.prototype.hasOwnProperty.call(source,key)){target[key]=source[key];}}}return target;};return _extends.apply(this,arguments);}function _objectSpread(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};var ownKeys=Object.keys(source);if(typeof Object.getOwnPropertySymbols==='function'){ownKeys=ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym){return Object.getOwnPropertyDescriptor(source,sym).enumerable;}));}ownKeys.forEach(function(key){_defineProperty(target,key,source[key]);});}return target;}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _inheritsLoose(subClass,superClass){subClass.prototype=Object.create(superClass.prototype);subClass.prototype.constructor=subClass;subClass.__proto__=superClass;}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");}return self;}var VirtualizedSectionList=function(_React$PureComponent){_inheritsLoose(VirtualizedSectionList,_React$PureComponent);var _proto=VirtualizedSectionList.prototype;_proto.scrollToLocation=function scrollToLocation(params){var index=params.itemIndex+1;for(var ii=0;ii<params.sectionIndex;ii++){index+=this.props.sections[ii].data.length+2;}var toIndexParams=_objectSpread({},params,{index:index});this._listRef.scrollToIndex(toIndexParams);};_proto.getListRef=function getListRef(){return this._listRef;};_proto._subExtractor=function _subExtractor(index){var itemIndex=index;var defaultKeyExtractor=this.props.keyExtractor;for(var ii=0;ii<this.props.sections.length;ii++){var section=this.props.sections[ii];var key=section.key||String(ii);itemIndex-=1;if(itemIndex>=section.data.length+1){itemIndex-=section.data.length+1;}else if(itemIndex===-1){return{section:section,key:key+':header',index:null,header:true,trailingSection:this.props.sections[ii+1]};}else if(itemIndex===section.data.length){return{section:section,key:key+':footer',index:null,header:false,trailingSection:this.props.sections[ii+1]};}else{var keyExtractor=section.keyExtractor||defaultKeyExtractor;return{section:section,key:key+':'+keyExtractor(section.data[itemIndex],itemIndex),index:itemIndex,leadingItem:section.data[itemIndex-1],leadingSection:this.props.sections[ii-1],trailingItem:section.data[itemIndex+1],trailingSection:this.props.sections[ii+1]};}}};_proto._getSeparatorComponent=function _getSeparatorComponent(index,info){info=info||this._subExtractor(index);if(!info){return null;}var ItemSeparatorComponent=info.section.ItemSeparatorComponent||this.props.ItemSeparatorComponent;var SectionSeparatorComponent=this.props.SectionSeparatorComponent;var isLastItemInList=index===this.state.childProps.getItemCount()-1;var isLastItemInSection=info.index===info.section.data.length-1;if(SectionSeparatorComponent&&isLastItemInSection){return SectionSeparatorComponent;}if(ItemSeparatorComponent&&!isLastItemInSection&&!isLastItemInList){return ItemSeparatorComponent;}return null;};_proto._computeState=function _computeState(props){var offset=props.ListHeaderComponent?1:0;var stickyHeaderIndices=[];var itemCount=props.sections.reduce(function(v,section){stickyHeaderIndices.push(v+offset);return v+section.data.length+2;},0);return{childProps:_objectSpread({},props,{renderItem:this._renderItem,ItemSeparatorComponent:undefined,data:props.sections,getItemCount:function getItemCount(){return itemCount;},getItem:getItem,keyExtractor:this._keyExtractor,onViewableItemsChanged:props.onViewableItemsChanged?this._onViewableItemsChanged:undefined,stickyHeaderIndices:props.stickySectionHeadersEnabled?stickyHeaderIndices:undefined})};};function VirtualizedSectionList(props,context){var _this;_this=_React$PureComponent.call(this,props,context)||this;_this._keyExtractor=function(item,index){var info=_this._subExtractor(index);return info&&info.key||String(index);};_this._convertViewable=function(viewable){(0,_invariant.default)(viewable.index!=null,'Received a broken ViewToken');var info=_this._subExtractor(viewable.index);if(!info){return null;}var keyExtractor=info.section.keyExtractor||_this.props.keyExtractor;return _objectSpread({},viewable,{index:info.index,key:keyExtractor(viewable.item,info.index),section:info.section});};_this._onViewableItemsChanged=function(_ref){var viewableItems=_ref.viewableItems,changed=_ref.changed;if(_this.props.onViewableItemsChanged){_this.props.onViewableItemsChanged({viewableItems:viewableItems.map(_this._convertViewable,_assertThisInitialized(_assertThisInitialized(_this))).filter(Boolean),changed:changed.map(_this._convertViewable,_assertThisInitialized(_assertThisInitialized(_this))).filter(Boolean)});}};_this._renderItem=function(_ref2){var item=_ref2.item,index=_ref2.index;var info=_this._subExtractor(index);if(!info){return null;}var infoIndex=info.index;if(infoIndex==null){var section=info.section;if(info.header===true){var renderSectionHeader=_this.props.renderSectionHeader;return renderSectionHeader?renderSectionHeader({section:section}):null;}else{var renderSectionFooter=_this.props.renderSectionFooter;return renderSectionFooter?renderSectionFooter({section:section}):null;}}else{var renderItem=info.section.renderItem||_this.props.renderItem;var SeparatorComponent=_this._getSeparatorComponent(index,info);(0,_invariant.default)(renderItem,'no renderItem!');return _react.default.createElement(ItemWithSeparator,{SeparatorComponent:SeparatorComponent,LeadingSeparatorComponent:infoIndex===0?_this.props.SectionSeparatorComponent:undefined,cellKey:info.key,index:infoIndex,item:item,leadingItem:info.leadingItem,leadingSection:info.leadingSection,onUpdateSeparator:_this._onUpdateSeparator,prevCellKey:(_this._subExtractor(index-1)||{}).key,ref:function ref(_ref3){_this._cellRefs[info.key]=_ref3;},renderItem:renderItem,section:info.section,trailingItem:info.trailingItem,trailingSection:info.trailingSection});}};_this._onUpdateSeparator=function(key,newProps){var ref=_this._cellRefs[key];ref&&ref.updateSeparatorProps(newProps);};_this._cellRefs={};_this._captureRef=function(ref){_this._listRef=ref;};_this.state=_this._computeState(props);return _this;}_proto.UNSAFE_componentWillReceiveProps=function UNSAFE_componentWillReceiveProps(nextProps){this.setState(this._computeState(nextProps));};_proto.render=function render(){return _react.default.createElement(_VirtualizedList.default,_extends({},this.state.childProps,{ref:this._captureRef}));};return VirtualizedSectionList;}(_react.default.PureComponent);VirtualizedSectionList.defaultProps=_objectSpread({},_VirtualizedList.default.defaultProps,{data:[]});var ItemWithSeparator=function(_React$Component){_inheritsLoose(ItemWithSeparator,_React$Component);function ItemWithSeparator(){var _this2;for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}_this2=_React$Component.call.apply(_React$Component,[this].concat(args))||this;_this2.state={separatorProps:{highlighted:false,leadingItem:_this2.props.item,leadingSection:_this2.props.leadingSection,section:_this2.props.section,trailingItem:_this2.props.trailingItem,trailingSection:_this2.props.trailingSection},leadingSeparatorProps:{highlighted:false,leadingItem:_this2.props.leadingItem,leadingSection:_this2.props.leadingSection,section:_this2.props.section,trailingItem:_this2.props.item,trailingSection:_this2.props.trailingSection}};_this2._separators={highlight:function highlight(){['leading','trailing'].forEach(function(s){return _this2._separators.updateProps(s,{highlighted:true});});},unhighlight:function unhighlight(){['leading','trailing'].forEach(function(s){return _this2._separators.updateProps(s,{highlighted:false});});},updateProps:function updateProps(select,newProps){var _this2$props=_this2.props,LeadingSeparatorComponent=_this2$props.LeadingSeparatorComponent,cellKey=_this2$props.cellKey,prevCellKey=_this2$props.prevCellKey;if(select==='leading'&&LeadingSeparatorComponent){_this2.setState(function(state){return{leadingSeparatorProps:_objectSpread({},state.leadingSeparatorProps,newProps)};});}else{_this2.props.onUpdateSeparator(select==='leading'&&prevCellKey||cellKey,newProps);}}};return _this2;}var _proto2=ItemWithSeparator.prototype;_proto2.UNSAFE_componentWillReceiveProps=function UNSAFE_componentWillReceiveProps(props){var _this3=this;this.setState(function(state){return{separatorProps:_objectSpread({},_this3.state.separatorProps,{leadingItem:props.item,leadingSection:props.leadingSection,section:props.section,trailingItem:props.trailingItem,trailingSection:props.trailingSection}),leadingSeparatorProps:_objectSpread({},_this3.state.leadingSeparatorProps,{leadingItem:props.leadingItem,leadingSection:props.leadingSection,section:props.section,trailingItem:props.item,trailingSection:props.trailingSection})};});};_proto2.updateSeparatorProps=function updateSeparatorProps(newProps){this.setState(function(state){return{separatorProps:_objectSpread({},state.separatorProps,newProps)};});};_proto2.render=function render(){var _this$props=this.props,LeadingSeparatorComponent=_this$props.LeadingSeparatorComponent,SeparatorComponent=_this$props.SeparatorComponent,item=_this$props.item,index=_this$props.index,section=_this$props.section;var element=this.props.renderItem({item:item,index:index,section:section,separators:this._separators});var leadingSeparator=LeadingSeparatorComponent&&_react.default.createElement(LeadingSeparatorComponent,this.state.leadingSeparatorProps);var separator=SeparatorComponent&&_react.default.createElement(SeparatorComponent,this.state.separatorProps);return leadingSeparator||separator?_react.default.createElement(_View.default,null,leadingSeparator,element,separator):element;};return ItemWithSeparator;}(_react.default.Component);function getItem(sections,index){if(!sections){return null;}var itemIdx=index-1;for(var ii=0;ii<sections.length;ii++){if(itemIdx===-1||itemIdx===sections[ii].data.length){return sections[ii];}else if(itemIdx<sections[ii].data.length){return sections[ii].data[itemIdx];}else{itemIdx-=sections[ii].data.length+2;}}return null;}var _default=VirtualizedSectionList;exports.default=_default;","map":{"version":3,"sources":["C:/Users/bluej/Desktop/2_2/searchGuide/searchGuide/node_modules/react-native-web/dist/vendor/react-native/VirtualizedSectionList/index.js"],"names":["_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_objectSpread","ownKeys","keys","getOwnPropertySymbols","concat","filter","sym","getOwnPropertyDescriptor","enumerable","forEach","_defineProperty","obj","value","defineProperty","configurable","writable","_inheritsLoose","subClass","superClass","create","constructor","__proto__","_assertThisInitialized","self","ReferenceError","VirtualizedSectionList","_React$PureComponent","_proto","scrollToLocation","params","index","itemIndex","ii","sectionIndex","props","sections","data","toIndexParams","_listRef","scrollToIndex","getListRef","_subExtractor","defaultKeyExtractor","keyExtractor","section","String","header","trailingSection","leadingItem","leadingSection","trailingItem","_getSeparatorComponent","info","ItemSeparatorComponent","SectionSeparatorComponent","isLastItemInList","state","childProps","getItemCount","isLastItemInSection","_computeState","offset","ListHeaderComponent","stickyHeaderIndices","itemCount","reduce","v","push","renderItem","_renderItem","undefined","getItem","_keyExtractor","onViewableItemsChanged","_onViewableItemsChanged","stickySectionHeadersEnabled","context","_this","item","_convertViewable","viewable","_ref","viewableItems","changed","map","Boolean","_ref2","infoIndex","renderSectionHeader","renderSectionFooter","SeparatorComponent","React","createElement","ItemWithSeparator","LeadingSeparatorComponent","cellKey","onUpdateSeparator","_onUpdateSeparator","prevCellKey","ref","_ref3","_cellRefs","newProps","updateSeparatorProps","_captureRef","UNSAFE_componentWillReceiveProps","nextProps","setState","render","VirtualizedList","PureComponent","defaultProps","_React$Component","_this2","_len","args","Array","_key","separatorProps","highlighted","leadingSeparatorProps","_separators","highlight","s","updateProps","unhighlight","select","_this2$props","_proto2","_this3","_this$props","element","separators","leadingSeparator","separator","View","Component","itemIdx"],"mappings":"mKAmBA,oDACA,mEACA,2EACA,qEAtBA,QAASA,CAAAA,QAAT,EAAoB,CAAEA,QAAQ,CAAGC,MAAM,CAACC,MAAP,EAAiB,SAAUC,MAAV,CAAkB,CAAE,IAAK,GAAIC,CAAAA,CAAC,CAAG,CAAb,CAAgBA,CAAC,CAAGC,SAAS,CAACC,MAA9B,CAAsCF,CAAC,EAAvC,CAA2C,CAAE,GAAIG,CAAAA,MAAM,CAAGF,SAAS,CAACD,CAAD,CAAtB,CAA2B,IAAK,GAAII,CAAAA,GAAT,GAAgBD,CAAAA,MAAhB,CAAwB,CAAE,GAAIN,MAAM,CAACQ,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCJ,MAArC,CAA6CC,GAA7C,CAAJ,CAAuD,CAAEL,MAAM,CAACK,GAAD,CAAN,CAAcD,MAAM,CAACC,GAAD,CAApB,CAA4B,CAAE,CAAE,CAAC,MAAOL,CAAAA,MAAP,CAAgB,CAA5P,CAA8P,MAAOH,CAAAA,QAAQ,CAACY,KAAT,CAAe,IAAf,CAAqBP,SAArB,CAAP,CAAyC,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AzC,CAA6C,CAC3C,GAAIyG,OAAO,GAAK,CAAC,CAAb,EAAkBA,OAAO,GAAKtG,QAAQ,CAACH,EAAD,CAAR,CAAaI,IAAb,CAAkB3C,MAApD,CAA4D,CAI1D,MAAO0C,CAAAA,QAAQ,CAACH,EAAD,CAAf,CACD,CALD,IAKO,IAAIyG,OAAO,CAAGtG,QAAQ,CAACH,EAAD,CAAR,CAAaI,IAAb,CAAkB3C,MAAhC,CAAwC,CAE7C,MAAO0C,CAAAA,QAAQ,CAACH,EAAD,CAAR,CAAaI,IAAb,CAAkBqG,OAAlB,CAAP,CACD,CAHM,IAGA,CACLA,OAAO,EAAItG,QAAQ,CAACH,EAAD,CAAR,CAAaI,IAAb,CAAkB3C,MAAlB,CAA2B,CAAtC,CACD,CACF,CAED,MAAO,KAAP,CACD,C,aAEcgC,sB","sourcesContent":["function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\n/**\n * Copyright (c) 2015-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\nimport React from 'react';\nimport View from '../../../exports/View';\nimport VirtualizedList from '../VirtualizedList';\nimport invariant from 'fbjs/lib/invariant';\n\n/**\n * Right now this just flattens everything into one list and uses VirtualizedList under the\n * hood. The only operation that might not scale well is concatting the data arrays of all the\n * sections when new props are received, which should be plenty fast for up to ~10,000 items.\n */\nvar VirtualizedSectionList =\n/*#__PURE__*/\nfunction (_React$PureComponent) {\n  _inheritsLoose(VirtualizedSectionList, _React$PureComponent);\n\n  var _proto = VirtualizedSectionList.prototype;\n\n  _proto.scrollToLocation = function scrollToLocation(params) {\n    var index = params.itemIndex + 1;\n\n    for (var ii = 0; ii < params.sectionIndex; ii++) {\n      index += this.props.sections[ii].data.length + 2;\n    }\n\n    var toIndexParams = _objectSpread({}, params, {\n      index: index\n    });\n\n    this._listRef.scrollToIndex(toIndexParams);\n  };\n\n  _proto.getListRef = function getListRef() {\n    return this._listRef;\n  };\n\n  _proto._subExtractor = function _subExtractor(index) {\n    var itemIndex = index;\n    var defaultKeyExtractor = this.props.keyExtractor;\n\n    for (var ii = 0; ii < this.props.sections.length; ii++) {\n      var section = this.props.sections[ii];\n      var key = section.key || String(ii);\n      itemIndex -= 1; // The section adds an item for the header\n\n      if (itemIndex >= section.data.length + 1) {\n        itemIndex -= section.data.length + 1; // The section adds an item for the footer.\n      } else if (itemIndex === -1) {\n        return {\n          section: section,\n          key: key + ':header',\n          index: null,\n          header: true,\n          trailingSection: this.props.sections[ii + 1]\n        };\n      } else if (itemIndex === section.data.length) {\n        return {\n          section: section,\n          key: key + ':footer',\n          index: null,\n          header: false,\n          trailingSection: this.props.sections[ii + 1]\n        };\n      } else {\n        var keyExtractor = section.keyExtractor || defaultKeyExtractor;\n        return {\n          section: section,\n          key: key + ':' + keyExtractor(section.data[itemIndex], itemIndex),\n          index: itemIndex,\n          leadingItem: section.data[itemIndex - 1],\n          leadingSection: this.props.sections[ii - 1],\n          trailingItem: section.data[itemIndex + 1],\n          trailingSection: this.props.sections[ii + 1]\n        };\n      }\n    }\n  };\n\n  _proto._getSeparatorComponent = function _getSeparatorComponent(index, info) {\n    info = info || this._subExtractor(index);\n\n    if (!info) {\n      return null;\n    }\n\n    var ItemSeparatorComponent = info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent;\n    var SectionSeparatorComponent = this.props.SectionSeparatorComponent;\n    var isLastItemInList = index === this.state.childProps.getItemCount() - 1;\n    var isLastItemInSection = info.index === info.section.data.length - 1;\n\n    if (SectionSeparatorComponent && isLastItemInSection) {\n      return SectionSeparatorComponent;\n    }\n\n    if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) {\n      return ItemSeparatorComponent;\n    }\n\n    return null;\n  };\n\n  _proto._computeState = function _computeState(props) {\n    var offset = props.ListHeaderComponent ? 1 : 0;\n    var stickyHeaderIndices = [];\n    var itemCount = props.sections.reduce(function (v, section) {\n      stickyHeaderIndices.push(v + offset);\n      return v + section.data.length + 2; // Add two for the section header and footer.\n    }, 0);\n    return {\n      childProps: _objectSpread({}, props, {\n        renderItem: this._renderItem,\n        ItemSeparatorComponent: undefined,\n        // Rendered with renderItem\n        data: props.sections,\n        getItemCount: function getItemCount() {\n          return itemCount;\n        },\n        getItem: getItem,\n        keyExtractor: this._keyExtractor,\n        onViewableItemsChanged: props.onViewableItemsChanged ? this._onViewableItemsChanged : undefined,\n        stickyHeaderIndices: props.stickySectionHeadersEnabled ? stickyHeaderIndices : undefined\n      })\n    };\n  };\n\n  function VirtualizedSectionList(props, context) {\n    var _this;\n\n    _this = _React$PureComponent.call(this, props, context) || this;\n\n    _this._keyExtractor = function (item, index) {\n      var info = _this._subExtractor(index);\n\n      return info && info.key || String(index);\n    };\n\n    _this._convertViewable = function (viewable) {\n      invariant(viewable.index != null, 'Received a broken ViewToken');\n\n      var info = _this._subExtractor(viewable.index);\n\n      if (!info) {\n        return null;\n      }\n\n      var keyExtractor = info.section.keyExtractor || _this.props.keyExtractor;\n      return _objectSpread({}, viewable, {\n        index: info.index,\n\n        /* $FlowFixMe(>=0.63.0 site=react_native_fb) This comment suppresses an\n         * error found when Flow v0.63 was deployed. To see the error delete this\n         * comment and run Flow. */\n        key: keyExtractor(viewable.item, info.index),\n        section: info.section\n      });\n    };\n\n    _this._onViewableItemsChanged = function (_ref) {\n      var viewableItems = _ref.viewableItems,\n          changed = _ref.changed;\n\n      if (_this.props.onViewableItemsChanged) {\n        _this.props.onViewableItemsChanged({\n          viewableItems: viewableItems.map(_this._convertViewable, _assertThisInitialized(_assertThisInitialized(_this))).filter(Boolean),\n          changed: changed.map(_this._convertViewable, _assertThisInitialized(_assertThisInitialized(_this))).filter(Boolean)\n        });\n      }\n    };\n\n    _this._renderItem = function (_ref2) {\n      var item = _ref2.item,\n          index = _ref2.index;\n\n      var info = _this._subExtractor(index);\n\n      if (!info) {\n        return null;\n      }\n\n      var infoIndex = info.index;\n\n      if (infoIndex == null) {\n        var section = info.section;\n\n        if (info.header === true) {\n          var renderSectionHeader = _this.props.renderSectionHeader;\n          return renderSectionHeader ? renderSectionHeader({\n            section: section\n          }) : null;\n        } else {\n          var renderSectionFooter = _this.props.renderSectionFooter;\n          return renderSectionFooter ? renderSectionFooter({\n            section: section\n          }) : null;\n        }\n      } else {\n        var renderItem = info.section.renderItem || _this.props.renderItem;\n\n        var SeparatorComponent = _this._getSeparatorComponent(index, info);\n\n        invariant(renderItem, 'no renderItem!');\n        return React.createElement(ItemWithSeparator, {\n          SeparatorComponent: SeparatorComponent,\n          LeadingSeparatorComponent: infoIndex === 0 ? _this.props.SectionSeparatorComponent : undefined,\n          cellKey: info.key,\n          index: infoIndex,\n          item: item,\n          leadingItem: info.leadingItem,\n          leadingSection: info.leadingSection,\n          onUpdateSeparator: _this._onUpdateSeparator,\n          prevCellKey: (_this._subExtractor(index - 1) || {}).key,\n          ref: function ref(_ref3) {\n            _this._cellRefs[info.key] = _ref3;\n          },\n          renderItem: renderItem,\n          section: info.section,\n          trailingItem: info.trailingItem,\n          trailingSection: info.trailingSection\n        });\n      }\n    };\n\n    _this._onUpdateSeparator = function (key, newProps) {\n      var ref = _this._cellRefs[key];\n      ref && ref.updateSeparatorProps(newProps);\n    };\n\n    _this._cellRefs = {};\n\n    _this._captureRef = function (ref) {\n      /* $FlowFixMe(>=0.53.0 site=react_native_fb,react_native_oss) This comment\n       * suppresses an error when upgrading Flow's support for React. To see the\n       * error delete this comment and run Flow. */\n      _this._listRef = ref;\n    };\n\n    _this.state = _this._computeState(props);\n    return _this;\n  }\n\n  _proto.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(nextProps) {\n    this.setState(this._computeState(nextProps));\n  };\n\n  _proto.render = function render() {\n    return React.createElement(VirtualizedList, _extends({}, this.state.childProps, {\n      ref: this._captureRef\n    }));\n  };\n\n  return VirtualizedSectionList;\n}(React.PureComponent);\n\nVirtualizedSectionList.defaultProps = _objectSpread({}, VirtualizedList.defaultProps, {\n  data: []\n});\n\nvar ItemWithSeparator =\n/*#__PURE__*/\nfunction (_React$Component) {\n  _inheritsLoose(ItemWithSeparator, _React$Component);\n\n  function ItemWithSeparator() {\n    var _this2;\n\n    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n\n    _this2 = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;\n    _this2.state = {\n      separatorProps: {\n        highlighted: false,\n        leadingItem: _this2.props.item,\n        leadingSection: _this2.props.leadingSection,\n        section: _this2.props.section,\n        trailingItem: _this2.props.trailingItem,\n        trailingSection: _this2.props.trailingSection\n      },\n      leadingSeparatorProps: {\n        highlighted: false,\n        leadingItem: _this2.props.leadingItem,\n        leadingSection: _this2.props.leadingSection,\n        section: _this2.props.section,\n        trailingItem: _this2.props.item,\n        trailingSection: _this2.props.trailingSection\n      }\n    };\n    _this2._separators = {\n      highlight: function highlight() {\n        ['leading', 'trailing'].forEach(function (s) {\n          return _this2._separators.updateProps(s, {\n            highlighted: true\n          });\n        });\n      },\n      unhighlight: function unhighlight() {\n        ['leading', 'trailing'].forEach(function (s) {\n          return _this2._separators.updateProps(s, {\n            highlighted: false\n          });\n        });\n      },\n      updateProps: function updateProps(select, newProps) {\n        var _this2$props = _this2.props,\n            LeadingSeparatorComponent = _this2$props.LeadingSeparatorComponent,\n            cellKey = _this2$props.cellKey,\n            prevCellKey = _this2$props.prevCellKey;\n\n        if (select === 'leading' && LeadingSeparatorComponent) {\n          _this2.setState(function (state) {\n            return {\n              leadingSeparatorProps: _objectSpread({}, state.leadingSeparatorProps, newProps)\n            };\n          });\n        } else {\n          _this2.props.onUpdateSeparator(select === 'leading' && prevCellKey || cellKey, newProps);\n        }\n      }\n    };\n    return _this2;\n  }\n\n  var _proto2 = ItemWithSeparator.prototype;\n\n  _proto2.UNSAFE_componentWillReceiveProps = function UNSAFE_componentWillReceiveProps(props) {\n    var _this3 = this;\n\n    this.setState(function (state) {\n      return {\n        separatorProps: _objectSpread({}, _this3.state.separatorProps, {\n          leadingItem: props.item,\n          leadingSection: props.leadingSection,\n          section: props.section,\n          trailingItem: props.trailingItem,\n          trailingSection: props.trailingSection\n        }),\n        leadingSeparatorProps: _objectSpread({}, _this3.state.leadingSeparatorProps, {\n          leadingItem: props.leadingItem,\n          leadingSection: props.leadingSection,\n          section: props.section,\n          trailingItem: props.item,\n          trailingSection: props.trailingSection\n        })\n      };\n    });\n  };\n\n  _proto2.updateSeparatorProps = function updateSeparatorProps(newProps) {\n    this.setState(function (state) {\n      return {\n        separatorProps: _objectSpread({}, state.separatorProps, newProps)\n      };\n    });\n  };\n\n  _proto2.render = function render() {\n    var _this$props = this.props,\n        LeadingSeparatorComponent = _this$props.LeadingSeparatorComponent,\n        SeparatorComponent = _this$props.SeparatorComponent,\n        item = _this$props.item,\n        index = _this$props.index,\n        section = _this$props.section;\n    var element = this.props.renderItem({\n      item: item,\n      index: index,\n      section: section,\n      separators: this._separators\n    });\n    var leadingSeparator = LeadingSeparatorComponent && React.createElement(LeadingSeparatorComponent, this.state.leadingSeparatorProps);\n    var separator = SeparatorComponent && React.createElement(SeparatorComponent, this.state.separatorProps);\n    return leadingSeparator || separator ? React.createElement(View, null, leadingSeparator, element, separator) : element;\n  };\n\n  return ItemWithSeparator;\n}(React.Component);\n\nfunction getItem(sections, index) {\n  if (!sections) {\n    return null;\n  }\n\n  var itemIdx = index - 1;\n\n  for (var ii = 0; ii < sections.length; ii++) {\n    if (itemIdx === -1 || itemIdx === sections[ii].data.length) {\n      // We intend for there to be overflow by one on both ends of the list.\n      // This will be for headers and footers. When returning a header or footer\n      // item the section itself is the item.\n      return sections[ii];\n    } else if (itemIdx < sections[ii].data.length) {\n      // If we are in the bounds of the list's data then return the item.\n      return sections[ii].data[itemIdx];\n    } else {\n      itemIdx -= sections[ii].data.length + 2; // Add two for the header and footer\n    }\n  }\n\n  return null;\n}\n\nexport default VirtualizedSectionList;"]},"metadata":{},"sourceType":"script"}