parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"QdEO":[function(require,module,exports) {
module.exports={props:{name:{type:String,required:!0},value:{type:null,default:null},type:{type:String,required:!0},length:{type:[String,Number],default:null},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},newItem:{type:Boolean,default:!1},relation:{type:Object,default:null},fields:{type:Object,default:null},values:{type:Object,default:null}}};
},{}],"zF3H":[function(require,module,exports) {
"use strict";function e(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],B=t?1e3:1024;if(!1===Boolean(e))return"--";if(Math.abs(e)<B)return"".concat(e," B");var i=t?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],o=-1,n=e;do{n/=B,o+=1}while(Math.abs(n)>=B&&o<i.length-1);return"".concat(n.toFixed(1)," ").concat(i[o])}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],"vOEm":[function(require,module,exports) {
"use strict";function t(t){return"application/pdf"===t?"picture_as_pdf":t.startsWith("application")?"insert_drive_file":t.startsWith("image")?"crop_original":t.startsWith("video")?"videocam":t.startsWith("code")?"code":t.startsWith("audio")?"audiotrack":"save"}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;
},{}],"UUGf":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=n(require("../../../mixins/interface")),t=n(require("../file-size/format-size")),i=n(require("./get-icon")),r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e};function n(e){return e&&e.__esModule?e:{default:e}}function s(e){return a(e)||o(e)||u()}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function o(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function a(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}var l={mixins:[e.default],data:function(){return{newFile:!1,existing:!1,viewOptionsOverride:{},viewTypeOverride:null,viewQueryOverride:{},filtersOverride:[]}},computed:{subtitle:function(){return this.value?this.value.filename.split(".").pop()+" • "+this.$d(new Date(this.value.uploaded_on),"short"):""},subtitleExtra:function(){return this.value.type&&this.value.type.startsWith("image")?" • "+this.value.width+" x "+this.value.height+" ("+(0,t.default)(this.value.filesize)+")":null},src:function(){return this.value.type&&this.value.type.startsWith("image")?this.value.data.full_url:null},icon:function(){return this.value.type&&!this.value.type.startsWith("image")?(0,i.default)(this.value.type):null},href:function(){return this.value.type&&"application/pdf"===this.value.type?this.value.data.full_url:null},viewOptions:function(){var e=this.options.viewOptions;return r({},e,this.viewOptionsOverride)},viewType:function(){return this.viewTypeOverride?this.viewTypeOverride:this.options.viewType},viewQuery:function(){var e=this.options.viewQuery;return r({},e,this.viewQueryOverride)},filters:function(){return[].concat(s(this.options.filters),s(this.fileTypeFilters),s(this.filtersOverride))},fileTypeFilters:function(){return!this.options.accept||this.filtersOverride.length>0||this.options.filters.some(function(e){return"type"===e.field})?[]:[{field:"type",operator:"in",value:this.options.accept.trim().split(/,\s*/)}]}},methods:{saveUpload:function(e){this.$emit("input",e.data),this.newFile=!1},setViewOptions:function(e){this.viewOptionsOverride=r({},this.viewOptionsOverride,e)},setViewQuery:function(e){this.viewQueryOverride=r({},this.viewQueryOverride,e)},onSearchInput:function(e){this.setViewQuery({q:e})}},created:function(){this.onSearchInput=this.$lodash.debounce(this.onSearchInput,200)}};exports.default=l;
(function(){var t=exports.default||module.exports;"function"==typeof t&&(t=t.options),Object.assign(t,{render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"input-single-file"},[t.value?i("v-card",{staticClass:"card",attrs:{title:t.value.title,subtitle:t.subtitle+t.subtitleExtra,src:t.src,icon:t.icon,href:t.href,options:{remove:{text:t.$t("delete"),icon:"delete"}}},on:{remove:function(e){return t.$emit("input",null)}}}):i("v-upload",{staticClass:"dropzone",attrs:{small:"",disabled:t.readonly,accept:t.options.accept,multiple:!1},on:{upload:t.saveUpload}}),t._v(" "),i("v-button",{attrs:{type:"button",disabled:t.readonly},on:{click:function(e){t.newFile=!0}}},[i("i",{staticClass:"material-icons"},[t._v("add")]),t._v(t._s(t.$t("new_file"))+" ")]),i("v-button",{attrs:{type:"button",disabled:t.readonly},on:{click:function(e){t.existing=!0}}},[i("i",{staticClass:"material-icons"},[t._v("playlist_add")]),t._v(t._s(t.$t("existing"))+" ")]),t._v(" "),t.newFile?i("portal",{attrs:{to:"modal"}},[i("v-modal",{attrs:{title:t.$t("file_upload")},on:{close:function(e){t.newFile=!1}}},[i("div",{staticClass:"body"},[i("v-upload",{attrs:{accept:t.options.accept,multiple:!1},on:{upload:t.saveUpload}})],1)])],1):t._e(),t._v(" "),t.existing?i("portal",{attrs:{to:"modal"}},[i("v-modal",{attrs:{title:t.$t("choose_one"),buttons:{done:{text:t.$t("done")}},"action-required":""},on:{close:function(e){t.existing=!1},done:function(e){t.existing=!1}}},[i("div",{staticClass:"search"},[i("v-input",{staticClass:"search-input",attrs:{type:"search",placeholder:t.$t("search")},on:{input:t.onSearchInput}})],1),t._v(" "),i("v-items",{staticClass:"items",attrs:{collection:"directus_files","view-type":t.viewType,selection:t.value?[t.value]:[],filters:t.filters,"view-query":t.viewQuery,"view-options":t.viewOptions},on:{options:t.setViewOptions,query:t.setViewQuery,select:function(e){return t.$emit("input",e[e.length-1])}}})],1)],1):t._e()],1)},staticRenderFns:[],_compiled:!0,_scopeId:"data-v-cc053c",functional:void 0});})();
},{"../../../mixins/interface":"QdEO","../file-size/format-size":"zF3H","./get-icon":"vOEm"}]},{},["UUGf"], "__DirectusExtension__")