"use strict";var stringUtil=require("./stringUtil-dea69be9.js"),React=require("react"),mobxReact=require("mobx-react"),classNames=require("classnames"),index=require("./index-1426f57c.js"),MapEditView=require("./MapEditView-95e9569e.js");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("@loadable/component"),require("@tanem/react-nprogress"),require("dayjs"),require("sql-formatter-fork"),require("axios"),require("superstruct"),require("lodash"),require("chroma-js"),require("localforage"),require("react-draggable"),require("react-rnd"),require("react-is"),require("react-dom"),require("react-virtualized"),require("ahooks"),require("rc-menu"),require("mobx"),require("react-beautiful-dnd"),require("ali-oss"),require("minio"),require("lz-string"),require("spark-md5"),require("js-cookie"),require("is-email"),require("is-uuid"),require("is-url"),require("@syncpoint/wkx"),require("buffer"),require("@turf/turf"),require("@mapbox/polylabel"),require("turf-multipolygon"),require("turf-polygon"),require("gcoord"),require("eventemitter2"),require("anymatch"),require("crypto"),require("uuid"),require("perfect-scrollbar"),require("react-contextmenu"),require("./isNil-cac51af7.js"),require("./orderBy-f3ba2335.js"),require("coordtransform"),require("./compact-e8934448.js"),require("react-use"),require("./useDataValue-9ef54772.js"),require("./trim-77ee23fd.js"),require("react-dnd-html5-backend"),require("./VirtualizedTable-cb04fd37.js"),require("ali-react-table-fork"),require("./Transfer-9303bbdf.js"),require("./useMount-1cf8cee2.js"),require("maptalks"),require("js-beautify"),require("jquery"),require("geobuf"),require("./index-5871dd9e.js"),require("./index-54965385.js"),require("./index-1e562c2a.js"),require("jszip"),require("file-saver"),require("screenfull"),require("array-move"),require("turf-multilinestring"),require("copy-to-clipboard"),require("maptalks.three"),require("ajv"),require("turf-point"),require("decamelize"),require("rbush"),require("qs"),require("maptalks.snap"),require("./index-debb7be7.js"),require("./index-e580d738.js"),require("./index-84574b4f.js"),require("./index-30d1ad06.js"),require("./index-74b25b71.js"),require("stream"),require("./ResizeObserver.es-1ce40604.js");var React__default=_interopDefaultLegacy(React),classNames__default=_interopDefaultLegacy(classNames),DataTableHeader=mobxReact.observer(function(e){var r=e.expand,a=e.expandRight,e=React__default.default.useContext(index.MyDataTableContext),i=e.store,u=e.delPackage,e=e.tabPopupConfirm||{},n=e.showPopup,t=e.tabIndex,d=e.message,o=stringUtil.__rest(e,["showPopup","tabIndex","message"]),l=i.packages,c=i.tableIndex,f=i.changeTab,s=i.showFullScreen,q=null!=t?t:c,e=React__default.default.useMemo(function(){return s&&React__default.default.createElement("div",{className:"".concat(index.prefixCls,"-header-expand")},React__default.default.createElement(stringUtil.IconButton,{icon:r.direction===MapEditView.ExpandDirect.Right&&r.expanded||r.direction===MapEditView.ExpandDirect.Left&&!r.expanded&&0<l.length?"minimize":"maximize",onClick:a,ghost:!0}))},[r.direction,r.expanded,a,l.length,s]);return React__default.default.createElement("div",{className:"".concat(index.prefixCls,"-header")},React__default.default.createElement("div",{className:"".concat(index.prefixCls,"-tabs")},l.map(function(a,e){var r=classNames__default.default("".concat(index.prefixCls,"-tab"),((r={})["".concat(index.prefixCls,"-tab-active")]=c===e,r)),i=React__default.default.createElement("div",{className:"".concat(index.prefixCls,"-tab-name")},a.name),t=null!==(t=stringUtil.GEO_TYPE_ICON_MAP[a.geometryType])&&void 0!==t?t:"file";return React__default.default.createElement("div",{className:r,onClick:function(){return f(e)},key:e},React__default.default.createElement(stringUtil.Tooltip,{title:a.name},React__default.default.createElement("div",{className:"".concat(index.prefixCls,"-tab-left")},React__default.default.createElement(stringUtil.Icon,{icon:t,className:"".concat(index.prefixCls,"-tab-icon-package")}),n&&q===e?React__default.default.createElement(stringUtil.Popconfirm,stringUtil.__assign({message:d,defaultVisible:!0},o),i):i)),React__default.default.createElement(stringUtil.IconButton,{type:"only-icon",icon:"close",onClick:function(e){e.stopPropagation();var r=a.packageUuid;u&&u(r,e)},className:"".concat(index.prefixCls,"-tab-icon-close")}))})),e)});exports.default=DataTableHeader;
