"use strict";var React=require("react"),mobxReact=require("mobx-react"),lodash=require("lodash"),stringUtil=require("./stringUtil-46bec29a.js"),ahooks=require("ahooks"),MapEditView=require("./MapEditView-ca0308a8.js"),$=require("jquery"),uuid=require("uuid");function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function _interopNamespace(i){if(i&&i.__esModule)return i;var a=Object.create(null);return i&&Object.keys(i).forEach(function(e){var r;"default"!==e&&(r=Object.getOwnPropertyDescriptor(i,e),Object.defineProperty(a,e,r.get?r:{enumerable:!0,get:function(){return i[e]}}))}),a.default=i,Object.freeze(a)}require("@loadable/component"),require("@tanem/react-nprogress"),require("dayjs"),require("sql-formatter-fork"),require("axios"),require("superstruct"),require("chroma-js"),require("localforage"),require("classnames"),require("react-draggable"),require("react-rnd"),require("react-is"),require("react-dom"),require("react-virtualized"),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("perfect-scrollbar"),require("maptalks"),require("js-beautify"),require("geobuf"),require("./index-3c074043.js"),require("./index-73206f55.js"),require("./index-43c122ad.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("react-use"),require("./index-72501f82.js"),require("./index-ddb7552a.js"),require("./index-7943ed4d.js"),require("./index-c8fa9450.js"),require("./index-2b0b7bb9.js"),require("stream"),require("./ResizeObserver.es-d2091bf3.js");var React__namespace=_interopNamespace(React),$__default=_interopDefaultLegacy($),i18n=MapEditView.i18n.mapEdit,prefixCls="map-data-model-list",DataModelList=mobxReact.observer(function(){var a=mobxReact.useLocalStore(function(){return{searchText:"",renderList:[]}}),e=(ahooks.useMount(function(){stringUtil.apiMediaFunc().getOmniMedia({pageSize:5e3}).then(function(e){var r,e=e.data.result;e&&(r=lodash.filter(e,function(e){return e.mediaType===stringUtil.OmniMediaViewGetMediaTypeEnum.Model}),Promise.all(r.map(function(e){return MapEditView.getSignatureUrl(null==e?void 0:e.preview)})).then(function(i){a.renderList=r.map(function(e,r){return e.displayUrl=i[r],e})}))})}),a.renderList),i=a.searchText;return React__namespace.createElement("div",{className:prefixCls},React__namespace.createElement("div",{className:"mb4"},i18n.modelList),React__namespace.createElement(stringUtil.Input,{className:prefixCls+"-input mb8",block:!0,placeholder:i18n.modelSearch,size:"compact",type:"assist-bg",value:i,onChange:function(e){e=e.target;a.searchText=e.value}}),React__namespace.createElement("div",{className:prefixCls+"-list-wrapper"},lodash.map(e,function(r){var e;return i&&-1===(null===(e=r.name)||void 0===e?void 0:e.indexOf(i))?null:React__namespace.createElement("div",{key:r.id,className:prefixCls+"-li mb8",draggable:!0,onDragStart:function(){console.log(r,"li");var e={name:r.name,id:uuid.v4(),url:lodash.get(r,"url")||lodash.get(r,"extra.url")},e=JSON.stringify(e);sessionStorage.setItem(MapEditView.MAP_DRAG_MODEL,e),$__default.default(".dm-map-models-config-li").addClass("can-dragover")},onDragEnd:function(){$__default.default(".dm-map-models-config-li").removeClass("can-dragover"),$__default.default(".dm-map-models-config-li").removeClass("can-dragover")}},React__namespace.createElement("img",{src:MapEditView.getOssUrl(r.displayUrl),alt:r.name}),r.name)})))}),DataModelList$1=DataModelList;exports.default=DataModelList$1;
