!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,n){"use strict";n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return i})),n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return u}));const r="files",i="files",o="file",u="esFixedSizeIndex"},function(e,t,n){"use strict";n.r(t),n.d(t,"id",(function(){return r})),n.d(t,"tag",(function(){return i})),n.d(t,"tags",(function(){return o})),n.d(t,"maxSize",(function(){return u})),n.d(t,"kind",(function(){return s}));const r="defaultImage",i="files:defaultImage",o=[`access:${i}`],u=10485760,s={id:r,allowedMimeTypes:["image/png","image/jpeg","image/webp","image/avif"]}},function(e,t,n){e.exports=n(3)(1465)},function(e,t){e.exports=__kbnSharedDeps_npm__},function(e,t,n){"use strict";(function(t){var r=n(9); /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */function i(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i=0;l--)if(c[l]!==f[l])return!1;for(l=c.length-1;l>=0;l--)if(!S(e[s=c[l]],t[s],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function E(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&b(i,n,"Missing expected exception"+r);var o="string"==typeof r,s=!e&&i&&!n;if((!e&&u.isError(i)&&o&&_(i,n)||s)&&b(i,n,"Got unwanted exception"+r),e&&i&&n&&!_(i,n)||!e&&i)throw i}d.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=y(h(this.actual),128)+" "+this.operator+" "+y(h(this.expected),128),this.generatedMessage=!0);var t=e.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=p(t),o=r.indexOf("\n"+i);if(o>=0){var u=r.indexOf("\n",o+1);r=r.substring(u+1)}this.stack=r}}},u.inherits(d.AssertionError,Error),d.fail=b,d.ok=m,d.equal=function(e,t,n){e!=t&&b(e,t,n,"==",d.equal)},d.notEqual=function(e,t,n){e==t&&b(e,t,n,"!=",d.notEqual)},d.deepEqual=function(e,t,n){S(e,t,!1)||b(e,t,n,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(e,t,n){S(e,t,!0)||b(e,t,n,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(e,t,n){S(e,t,!1)&&b(e,t,n,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function e(t,n,r){S(t,n,!0)&&b(t,n,r,"notDeepStrictEqual",e)},d.strictEqual=function(e,t,n){e!==t&&b(e,t,n,"===",d.strictEqual)},d.notStrictEqual=function(e,t,n){e===t&&b(e,t,n,"!==",d.notStrictEqual)},d.throws=function(e,t,n){k(!0,e,t,n)},d.doesNotThrow=function(e,t,n){k(!1,e,t,n)},d.ifError=function(e){if(e)throw e},d.strict=r((function e(t,n){t||b(t,!0,n,"==",e)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var v=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(8))},function(e,t,n){n.r(t);var r=__kbnBundles__.get("plugin/kibanaUtils/common");Object.defineProperties(t,Object.getOwnPropertyDescriptors(r))},function(e,t,n){n(7),__kbnBundles__.define("plugin/files/public",n,12),__kbnBundles__.define("plugin/files/common",n,11)},function(e,t,n){n.p=window.__kbnPublicPath__.files},function(e,t,n){e.exports=n(3)(190)},function(e,t,n){e.exports=n(3)(1157)},function(e,t,n){e.exports=n(3)(2948)},function(e,t,n){"use strict";n.r(t);var r=n(0);n.d(t,"FILE_SO_TYPE",(function(){return r.b})),n.d(t,"PLUGIN_ID",(function(){return r.c})),n.d(t,"PLUGIN_NAME",(function(){return r.d})),n.d(t,"ES_FIXED_SIZE_INDEX_BLOB_STORE",(function(){return r.a}));var i=n(1);n.d(t,"DefaultFileKind",(function(){return i}))},function(e,t,n){"use strict";n.r(t),n.d(t,"plugin",(function(){return m}));var r=n(2),i=n.n(r),o=n(4),u=n.n(o),s=n(5);class file_kinds_registry_FileKindsRegistryImpl{constructor(e){i()(this,"fileKinds",new Map),this.onRegister=e}register(e){var t;if(this.fileKinds.get(e.id))throw new Error(`File kind "${e.id}" already registered.`);if(e.id!==encodeURIComponent(e.id))throw new Error(`File kind id "${e.id}" is not a valid file kind ID. Choose an ID that does not need to be URI encoded.`);this.fileKinds.set(e.id,e),null===(t=this.onRegister)||void 0===t||t.call(this,e)}get(e){const t=this.fileKinds.get(e);return u()(t,`File kind with id "${e}" not found.`),t}getAll(){return Array.from(this.fileKinds.values())}}const[a,l]=Object(s.createGetterSetter)("fileKindsRegistry"),c=`/api/${n(0).c}`,f=`${c}/files`,d=`${c}/shares`,g=`${c}/public`,p={getCreateFileRoute:e=>`${f}/${e}`,getUploadRoute:(e,t)=>`${f}/${e}/${t}/blob`,getDownloadRoute:(e,t,n)=>`${f}/${e}/${t}/blob${n?"/"+n:""}`,getUpdateRoute:(e,t)=>`${f}/${e}/${t}`,getDeleteRoute:(e,t)=>`${f}/${e}/${t}`,getListRoute:e=>`${f}/${e}/list`,getByIdRoute:(e,t)=>`${f}/${e}/${t}`,getShareRoute:(e,t)=>`${d}/${e}/${t}`,getListSharesRoute:e=>`${d}/${e}`,getPublicDownloadRoute:e=>`${g}/blob${e?"/"+e:""}`,getFindRoute:()=>`${c}/find`,getMetricsRoute:()=>`${c}/metrics`,getBulkDeleteRoute:()=>`${c}/blobs`},y={headers:{"content-type":"application/json"}};function h({registry:e,http:t,fileKind:n}){return{bulkDelete:e=>t.delete(p.getBulkDeleteRoute(),{headers:y,body:JSON.stringify(e)}),create:({kind:e,...r})=>t.post(p.getCreateFileRoute(null!=n?n:e),{headers:y,body:JSON.stringify(r)}),delete:({kind:e,...r})=>t.delete(p.getDeleteRoute(null!=n?n:e,r.id)),download:({kind:e,...r})=>t.get(p.getDownloadRoute(null!=n?n:e,r.id,r.fileName),{headers:{Accept:"*/*"}}),getById:({kind:e,...r})=>t.get(p.getByIdRoute(null!=n?n:e,r.id)),list:({kind:e,page:r,perPage:i,abortSignal:o,...u}={kind:""})=>t.post(p.getListRoute(null!=n?n:e),{headers:y,query:{page:r,perPage:i},body:JSON.stringify(u),signal:o}),update:({kind:e,id:r,...i})=>t.patch(p.getUpdateRoute(null!=n?n:e,r),{headers:y,body:JSON.stringify(i)}),upload:({kind:e,abortSignal:r,contentType:i,selfDestructOnAbort:o,...u})=>t.put(p.getUploadRoute(null!=n?n:e,u.id),{query:{selfDestructOnAbort:o},headers:{"Content-Type":null!=i?i:"application/octet-stream"},signal:r,body:u.body}),getDownloadHref:({fileKind:e,id:r})=>`${t.basePath.prepend(p.getDownloadRoute(null!=n?n:e,r))}`,share:({kind:e,fileId:r,name:i,validUntil:o})=>t.post(p.getShareRoute(null!=n?n:e,r),{headers:y,body:JSON.stringify({name:i,validUntil:o})}),unshare:({kind:e,id:r})=>t.delete(p.getShareRoute(null!=n?n:e,r)),getShare:({kind:e,id:r})=>t.get(p.getShareRoute(null!=n?n:e,r)),listShares:({kind:e,forFileId:r,page:i,perPage:o})=>t.get(p.getListSharesRoute(null!=n?n:e),{query:{page:i,perPage:o,forFileId:r}}),find:({page:e,perPage:n,...r})=>t.post(p.getFindRoute(),{query:{page:e,perPage:n},headers:y,body:JSON.stringify(r)}),getMetrics:()=>t.get(p.getMetricsRoute()),publicDownload:({token:e,fileName:n})=>t.get(p.getPublicDownloadRoute(n),{query:{token:e}}),getFileKind:t=>e.get(t)}}var b=n(1);class plugin_FilesPlugin{constructor(){i()(this,"registry",new file_kinds_registry_FileKindsRegistryImpl),i()(this,"filesClientFactory",void 0)}setup(e){return this.registry.register({...b.kind,maxSizeBytes:b.maxSize}),this.filesClientFactory={asScoped:t=>h({registry:this.registry,fileKind:t,http:e.http}),asUnscoped:()=>h({registry:this.registry,http:e.http})},{filesClientFactory:this.filesClientFactory,registerFileKind:e=>{this.registry.register(e)}}}start(e){return{filesClientFactory:this.filesClientFactory,getFileKindDefinition:e=>this.registry.get(e),getAllFindKindDefinitions:()=>this.registry.getAll()}}}function m(){return new plugin_FilesPlugin}}]);