2093-2093.js 214 KB

12
  1. (self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[2093],{17816:function(e){e.exports=function(){"use strict";function e(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}var t=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(t,r){var i;i=function(){return function t(r,i,n){function s(o,l){if(!i[o]){if(!r[o]){if(!l&&e)return e();if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var h=i[o]={exports:{}};r[o][0].call(h.exports,(function(e){return s(r[o][1][e]||e)}),h,h.exports,t,r,i,n)}return i[o].exports}for(var a=e,o=0;o<n.length;o++)s(n[o]);return s}({1:[function(e,t,r){t.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},{}],2:[function(e,t,r){var i=e("./utils").getSymbolSize;r.getRowColCoords=function(e){if(1===e)return[];for(var t=Math.floor(e/7)+2,r=i(e),n=145===r?26:2*Math.ceil((r-13)/(2*t-2)),s=[r-7],a=1;a<t-1;a++)s[a]=s[a-1]-n;return s.push(6),s.reverse()},r.getPositions=function(e){for(var t=[],i=r.getRowColCoords(e),n=i.length,s=0;s<n;s++)for(var a=0;a<n;a++)0===s&&0===a||0===s&&a===n-1||s===n-1&&0===a||t.push([i[s],i[a]]);return t}},{"./utils":21}],3:[function(e,t,r){var i=e("./mode"),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function s(e){this.mode=i.ALPHANUMERIC,this.data=e}s.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){var t;for(t=0;t+2<=this.data.length;t+=2){var r=45*n.indexOf(this.data[t]);r+=n.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(n.indexOf(this.data[t]),6)},t.exports=s},{"./mode":14}],4:[function(e,t,r){function i(){this.buffer=[],this.length=0}i.prototype={get:function(e){var t=Math.floor(e/8);return 1==(this.buffer[t]>>>7-e%8&1)},put:function(e,t){for(var r=0;r<t;r++)this.putBit(1==(e>>>t-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=i},{}],5:[function(e,t,r){var i=e("../utils/buffer");function n(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=i.alloc(e*e),this.reservedBit=i.alloc(e*e)}n.prototype.set=function(e,t,r,i){var n=e*this.size+t;this.data[n]=r,i&&(this.reservedBit[n]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n},{"../utils/buffer":28}],6:[function(e,t,r){var i=e("../utils/buffer"),n=e("./mode");function s(e){this.mode=n.BYTE,this.data=i.from(e)}s.getBitsLength=function(e){return 8*e},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){for(var t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},t.exports=s},{"../utils/buffer":28,"./mode":14}],7:[function(e,t,r){var i=e("./error-correction-level"),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],s=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];r.getBlocksCount=function(e,t){switch(t){case i.L:return n[4*(e-1)+0];case i.M:return n[4*(e-1)+1];case i.Q:return n[4*(e-1)+2];case i.H:return n[4*(e-1)+3];default:return}},r.getTotalCodewordsCount=function(e,t){switch(t){case i.L:return s[4*(e-1)+0];case i.M:return s[4*(e-1)+1];case i.Q:return s[4*(e-1)+2];case i.H:return s[4*(e-1)+3];default:return}}},{"./error-correction-level":8}],8:[function(e,t,r){r.L={bit:1},r.M={bit:0},r.Q={bit:3},r.H={bit:2},r.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},r.from=function(e,t){if(r.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+e)}}(e)}catch(e){return t}}},{}],9:[function(e,t,r){var i=e("./utils").getSymbolSize;r.getPositions=function(e){var t=i(e);return[[0,0],[t-7,0],[0,t-7]]}},{"./utils":21}],10:[function(e,t,r){var i=e("./utils"),n=i.getBCHDigit(1335);r.getEncodedBits=function(e,t){for(var r=e.bit<<3|t,s=r<<10;i.getBCHDigit(s)-n>=0;)s^=1335<<i.getBCHDigit(s)-n;return 21522^(r<<10|s)}},{"./utils":21}],11:[function(e,t,r){var i=e("../utils/buffer"),n=i.alloc(512),s=i.alloc(256);!function(){for(var e=1,t=0;t<255;t++)n[t]=e,s[e]=t,256&(e<<=1)&&(e^=285);for(t=255;t<512;t++)n[t]=n[t-255]}(),r.log=function(e){if(e<1)throw new Error("log("+e+")");return s[e]},r.exp=function(e){return n[e]},r.mul=function(e,t){return 0===e||0===t?0:n[s[e]+s[t]]}},{"../utils/buffer":28}],12:[function(e,t,r){var i=e("./mode"),n=e("./utils");function s(e){this.mode=i.KANJI,this.data=e}s.getBitsLength=function(e){return 13*e},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){var t;for(t=0;t<this.data.length;t++){var r=n.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),e.put(r,13)}},t.exports=s},{"./mode":14,"./utils":21}],13:[function(e,t,r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var i=3,n=3,s=40,a=10;function o(e,t,i){switch(e){case r.Patterns.PATTERN000:return(t+i)%2==0;case r.Patterns.PATTERN001:return t%2==0;case r.Patterns.PATTERN010:return i%3==0;case r.Patterns.PATTERN011:return(t+i)%3==0;case r.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(i/3))%2==0;case r.Patterns.PATTERN101:return t*i%2+t*i%3==0;case r.Patterns.PATTERN110:return(t*i%2+t*i%3)%2==0;case r.Patterns.PATTERN111:return(t*i%3+(t+i)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}}r.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},r.from=function(e){return r.isValid(e)?parseInt(e,10):void 0},r.getPenaltyN1=function(e){for(var t=e.size,r=0,n=0,s=0,a=null,o=null,l=0;l<t;l++){n=s=0,a=o=null;for(var c=0;c<t;c++){var h=e.get(l,c);h===a?n++:(n>=5&&(r+=i+(n-5)),a=h,n=1),(h=e.get(c,l))===o?s++:(s>=5&&(r+=i+(s-5)),o=h,s=1)}n>=5&&(r+=i+(n-5)),s>=5&&(r+=i+(s-5))}return r},r.getPenaltyN2=function(e){for(var t=e.size,r=0,i=0;i<t-1;i++)for(var s=0;s<t-1;s++){var a=e.get(i,s)+e.get(i,s+1)+e.get(i+1,s)+e.get(i+1,s+1);4!==a&&0!==a||r++}return r*n},r.getPenaltyN3=function(e){for(var t=e.size,r=0,i=0,n=0,a=0;a<t;a++){i=n=0;for(var o=0;o<t;o++)i=i<<1&2047|e.get(a,o),o>=10&&(1488===i||93===i)&&r++,n=n<<1&2047|e.get(o,a),o>=10&&(1488===n||93===n)&&r++}return r*s},r.getPenaltyN4=function(e){for(var t=0,r=e.data.length,i=0;i<r;i++)t+=e.data[i];return Math.abs(Math.ceil(100*t/r/5)-10)*a},r.applyMask=function(e,t){for(var r=t.size,i=0;i<r;i++)for(var n=0;n<r;n++)t.isReserved(n,i)||t.xor(n,i,o(e,n,i))},r.getBestMask=function(e,t){for(var i=Object.keys(r.Patterns).length,n=0,s=1/0,a=0;a<i;a++){t(a),r.applyMask(a,e);var o=r.getPenaltyN1(e)+r.getPenaltyN2(e)+r.getPenaltyN3(e)+r.getPenaltyN4(e);r.applyMask(a,e),o<s&&(s=o,n=a)}return n}},{}],14:[function(e,t,r){var i=e("./version-check"),n=e("./regex");r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(e,t){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!i.isValid(t))throw new Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},r.getBestModeForData=function(e){return n.testNumeric(e)?r.NUMERIC:n.testAlphanumeric(e)?r.ALPHANUMERIC:n.testKanji(e)?r.KANJI:r.BYTE},r.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},r.isValid=function(e){return e&&e.bit&&e.ccBits},r.from=function(e,t){if(r.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw new Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+e)}}(e)}catch(e){return t}}},{"./regex":19,"./version-check":22}],15:[function(e,t,r){var i=e("./mode");function n(e){this.mode=i.NUMERIC,this.data=e.toString()}n.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(e){var t,r,i;for(t=0;t+3<=this.data.length;t+=3)r=this.data.substr(t,3),i=parseInt(r,10),e.put(i,10);var n=this.data.length-t;n>0&&(r=this.data.substr(t),i=parseInt(r,10),e.put(i,3*n+1))},t.exports=n},{"./mode":14}],16:[function(e,t,r){var i=e("../utils/buffer"),n=e("./galois-field");r.mul=function(e,t){for(var r=i.alloc(e.length+t.length-1),s=0;s<e.length;s++)for(var a=0;a<t.length;a++)r[s+a]^=n.mul(e[s],t[a]);return r},r.mod=function(e,t){for(var r=i.from(e);r.length-t.length>=0;){for(var s=r[0],a=0;a<t.length;a++)r[a]^=n.mul(t[a],s);for(var o=0;o<r.length&&0===r[o];)o++;r=r.slice(o)}return r},r.generateECPolynomial=function(e){for(var t=i.from([1]),s=0;s<e;s++)t=r.mul(t,[1,n.exp(s)]);return t}},{"../utils/buffer":28,"./galois-field":11}],17:[function(e,t,r){var i=e("../utils/buffer"),n=e("./utils"),s=e("./error-correction-level"),a=e("./bit-buffer"),o=e("./bit-matrix"),l=e("./alignment-pattern"),c=e("./finder-pattern"),h=e("./mask-pattern"),u=e("./error-correction-code"),d=e("./reed-solomon-encoder"),p=e("./version"),f=e("./format-info"),A=e("./mode"),g=e("./segments"),m=e("isarray");function E(e,t,r){var i,n,s=e.size,a=f.getEncodedBits(t,r);for(i=0;i<15;i++)n=1==(a>>i&1),i<6?e.set(i,8,n,!0):i<8?e.set(i+1,8,n,!0):e.set(s-15+i,8,n,!0),i<8?e.set(8,s-i-1,n,!0):i<9?e.set(8,15-i-1+1,n,!0):e.set(8,15-i-1,n,!0);e.set(s-8,8,1,!0)}function y(e,t,r){var s=new a;r.forEach((function(t){s.put(t.mode.bit,4),s.put(t.getLength(),A.getCharCountIndicator(t.mode,e)),t.write(s)}));var o=8*(n.getSymbolTotalCodewords(e)-u.getTotalCodewordsCount(e,t));for(s.getLengthInBits()+4<=o&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(0);for(var l=(o-s.getLengthInBits())/8,c=0;c<l;c++)s.put(c%2?17:236,8);return function(e,t,r){for(var s=n.getSymbolTotalCodewords(t),a=s-u.getTotalCodewordsCount(t,r),o=u.getBlocksCount(t,r),l=o-s%o,c=Math.floor(s/o),h=Math.floor(a/o),p=h+1,f=c-h,A=new d(f),g=0,m=new Array(o),E=new Array(o),y=0,v=i.from(e.buffer),_=0;_<o;_++){var w=_<l?h:p;m[_]=v.slice(g,g+w),E[_]=A.encode(m[_]),g+=w,y=Math.max(y,w)}var C,b,S=i.alloc(s),x=0;for(C=0;C<y;C++)for(b=0;b<o;b++)C<m[b].length&&(S[x++]=m[b][C]);for(C=0;C<f;C++)for(b=0;b<o;b++)S[x++]=E[b][C];return S}(s,e,t)}function v(e,t,r,i){var s;if(m(e))s=g.fromArray(e);else{if("string"!=typeof e)throw new Error("Invalid data");var a=t;if(!a){var u=g.rawSplit(e);a=p.getBestVersionForData(u,r)}s=g.fromString(e,a||40)}var d=p.getBestVersionForData(s,r);if(!d)throw new Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<d)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+d+".\n")}else t=d;var f=y(t,r,s),A=n.getSymbolSize(t),v=new o(A);return function(e,t){for(var r=e.size,i=c.getPositions(t),n=0;n<i.length;n++)for(var s=i[n][0],a=i[n][1],o=-1;o<=7;o++)if(!(s+o<=-1||r<=s+o))for(var l=-1;l<=7;l++)a+l<=-1||r<=a+l||(o>=0&&o<=6&&(0===l||6===l)||l>=0&&l<=6&&(0===o||6===o)||o>=2&&o<=4&&l>=2&&l<=4?e.set(s+o,a+l,!0,!0):e.set(s+o,a+l,!1,!0))}(v,t),function(e){for(var t=e.size,r=8;r<t-8;r++){var i=r%2==0;e.set(r,6,i,!0),e.set(6,r,i,!0)}}(v),function(e,t){for(var r=l.getPositions(t),i=0;i<r.length;i++)for(var n=r[i][0],s=r[i][1],a=-2;a<=2;a++)for(var o=-2;o<=2;o++)-2===a||2===a||-2===o||2===o||0===a&&0===o?e.set(n+a,s+o,!0,!0):e.set(n+a,s+o,!1,!0)}(v,t),E(v,r,0),t>=7&&function(e,t){for(var r,i,n,s=e.size,a=p.getEncodedBits(t),o=0;o<18;o++)r=Math.floor(o/3),i=o%3+s-8-3,n=1==(a>>o&1),e.set(r,i,n,!0),e.set(i,r,n,!0)}(v,t),function(e,t){for(var r=e.size,i=-1,n=r-1,s=7,a=0,o=r-1;o>0;o-=2)for(6===o&&o--;;){for(var l=0;l<2;l++)if(!e.isReserved(n,o-l)){var c=!1;a<t.length&&(c=1==(t[a]>>>s&1)),e.set(n,o-l,c),-1==--s&&(a++,s=7)}if((n+=i)<0||r<=n){n-=i,i=-i;break}}}(v,f),isNaN(i)&&(i=h.getBestMask(v,E.bind(null,v,r))),h.applyMask(i,v),E(v,r,i),{modules:v,version:t,errorCorrectionLevel:r,maskPattern:i,segments:s}}r.create=function(e,t){if(void 0===e||""===e)throw new Error("No input text");var r,i,a=s.M;return void 0!==t&&(a=s.from(t.errorCorrectionLevel,s.M),r=p.from(t.version),i=h.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),v(e,r,a,i)}},{"../utils/buffer":28,"./alignment-pattern":2,"./bit-buffer":4,"./bit-matrix":5,"./error-correction-code":7,"./error-correction-level":8,"./finder-pattern":9,"./format-info":10,"./mask-pattern":13,"./mode":14,"./reed-solomon-encoder":18,"./segments":20,"./utils":21,"./version":23,isarray:33}],18:[function(e,t,r){var i=e("../utils/buffer"),n=e("./polynomial"),s=e("buffer").Buffer;function a(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}a.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},a.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");var t=i.alloc(this.degree),r=s.concat([e,t],e.length+this.degree),a=n.mod(r,this.genPoly),o=this.degree-a.length;if(o>0){var l=i.alloc(this.degree);return a.copy(l,o),l}return a},t.exports=a},{"../utils/buffer":28,"./polynomial":16,buffer:30}],19:[function(e,t,r){var i="[0-9]+",n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",s="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(s,"g"),r.NUMERIC=new RegExp(i,"g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var a=new RegExp("^"+n+"$"),o=new RegExp("^"+i+"$"),l=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(e){return a.test(e)},r.testNumeric=function(e){return o.test(e)},r.testAlphanumeric=function(e){return l.test(e)}},{}],20:[function(e,t,r){var i=e("./mode"),n=e("./numeric-data"),s=e("./alphanumeric-data"),a=e("./byte-data"),o=e("./kanji-data"),l=e("./regex"),c=e("./utils"),h=e("dijkstrajs");function u(e){return unescape(encodeURIComponent(e)).length}function d(e,t,r){for(var i,n=[];null!==(i=e.exec(r));)n.push({data:i[0],index:i.index,mode:t,length:i[0].length});return n}function p(e){var t,r,n=d(l.NUMERIC,i.NUMERIC,e),s=d(l.ALPHANUMERIC,i.ALPHANUMERIC,e);return c.isKanjiModeEnabled()?(t=d(l.BYTE,i.BYTE,e),r=d(l.KANJI,i.KANJI,e)):(t=d(l.BYTE_KANJI,i.BYTE,e),r=[]),n.concat(s,t,r).sort((function(e,t){return e.index-t.index})).map((function(e){return{data:e.data,mode:e.mode,length:e.length}}))}function f(e,t){switch(t){case i.NUMERIC:return n.getBitsLength(e);case i.ALPHANUMERIC:return s.getBitsLength(e);case i.KANJI:return o.getBitsLength(e);case i.BYTE:return a.getBitsLength(e)}}function A(e,t){var r,l=i.getBestModeForData(e);if((r=i.from(t,l))!==i.BYTE&&r.bit<l.bit)throw new Error('"'+e+'" cannot be encoded with mode '+i.toString(r)+".\n Suggested mode is: "+i.toString(l));switch(r!==i.KANJI||c.isKanjiModeEnabled()||(r=i.BYTE),r){case i.NUMERIC:return new n(e);case i.ALPHANUMERIC:return new s(e);case i.KANJI:return new o(e);case i.BYTE:return new a(e)}}r.fromArray=function(e){return e.reduce((function(e,t){return"string"==typeof t?e.push(A(t,null)):t.data&&e.push(A(t.data,t.mode)),e}),[])},r.fromString=function(e,t){for(var n=function(e,t){for(var r={},n={start:{}},s=["start"],a=0;a<e.length;a++){for(var o=e[a],l=[],c=0;c<o.length;c++){var h=o[c],u=""+a+c;l.push(u),r[u]={node:h,lastCount:0},n[u]={};for(var d=0;d<s.length;d++){var p=s[d];r[p]&&r[p].node.mode===h.mode?(n[p][u]=f(r[p].lastCount+h.length,h.mode)-f(r[p].lastCount,h.mode),r[p].lastCount+=h.length):(r[p]&&(r[p].lastCount=h.length),n[p][u]=f(h.length,h.mode)+4+i.getCharCountIndicator(h.mode,t))}}s=l}for(d=0;d<s.length;d++)n[s[d]].end=0;return{map:n,table:r}}(function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];switch(n.mode){case i.NUMERIC:t.push([n,{data:n.data,mode:i.ALPHANUMERIC,length:n.length},{data:n.data,mode:i.BYTE,length:n.length}]);break;case i.ALPHANUMERIC:t.push([n,{data:n.data,mode:i.BYTE,length:n.length}]);break;case i.KANJI:t.push([n,{data:n.data,mode:i.BYTE,length:u(n.data)}]);break;case i.BYTE:t.push([{data:n.data,mode:i.BYTE,length:u(n.data)}])}}return t}(p(e,c.isKanjiModeEnabled())),t),s=h.find_path(n.map,"start","end"),a=[],o=1;o<s.length-1;o++)a.push(n.table[s[o]].node);return r.fromArray(a.reduce((function(e,t){var r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)}),[]))},r.rawSplit=function(e){return r.fromArray(p(e,c.isKanjiModeEnabled()))}},{"./alphanumeric-data":3,"./byte-data":6,"./kanji-data":12,"./mode":14,"./numeric-data":15,"./regex":19,"./utils":21,dijkstrajs:31}],21:[function(e,t,r){var i,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return 4*e+17},r.getSymbolTotalCodewords=function(e){return n[e]},r.getBCHDigit=function(e){for(var t=0;0!==e;)t++,e>>>=1;return t},r.setToSJISFunction=function(e){if("function"!=typeof e)throw new Error('"toSJISFunc" is not a valid function.');i=e},r.isKanjiModeEnabled=function(){return void 0!==i},r.toSJIS=function(e){return i(e)}},{}],22:[function(e,t,r){r.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},{}],23:[function(e,t,r){var i=e("./utils"),n=e("./error-correction-code"),s=e("./error-correction-level"),a=e("./mode"),o=e("./version-check"),l=e("isarray"),c=i.getBCHDigit(7973);function h(e,t){return a.getCharCountIndicator(e,t)+4}function u(e,t){var r=0;return e.forEach((function(e){var i=h(e.mode,t);r+=i+e.getBitsLength()})),r}r.from=function(e,t){return o.isValid(e)?parseInt(e,10):t},r.getCapacity=function(e,t,r){if(!o.isValid(e))throw new Error("Invalid QR Code version");void 0===r&&(r=a.BYTE);var s=8*(i.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,t));if(r===a.MIXED)return s;var l=s-h(r,e);switch(r){case a.NUMERIC:return Math.floor(l/10*3);case a.ALPHANUMERIC:return Math.floor(l/11*2);case a.KANJI:return Math.floor(l/13);case a.BYTE:default:return Math.floor(l/8)}},r.getBestVersionForData=function(e,t){var i,n=s.from(t,s.M);if(l(e)){if(e.length>1)return function(e,t){for(var i=1;i<=40;i++)if(u(e,i)<=r.getCapacity(i,t,a.MIXED))return i}(e,n);if(0===e.length)return 1;i=e[0]}else i=e;return function(e,t,i){for(var n=1;n<=40;n++)if(t<=r.getCapacity(n,i,e))return n}(i.mode,i.getLength(),n)},r.getEncodedBits=function(e){if(!o.isValid(e)||e<7)throw new Error("Invalid QR Code version");for(var t=e<<12;i.getBCHDigit(t)-c>=0;)t^=7973<<i.getBCHDigit(t)-c;return e<<12|t}},{"./error-correction-code":7,"./error-correction-level":8,"./mode":14,"./utils":21,"./version-check":22,isarray:33}],24:[function(e,t,r){var i=e("./can-promise"),n=e("./core/qrcode"),s=e("./renderer/canvas"),a=e("./renderer/svg-tag.js");function o(e,t,r,s,a){var o=[].slice.call(arguments,1),l=o.length,c="function"==typeof o[l-1];if(!c&&!i())throw new Error("Callback required as last argument");if(!c){if(l<1)throw new Error("Too few arguments provided");return 1===l?(r=t,t=s=void 0):2!==l||t.getContext||(s=r,r=t,t=void 0),new Promise((function(i,a){try{var o=n.create(r,s);i(e(o,t,s))}catch(e){a(e)}}))}if(l<2)throw new Error("Too few arguments provided");2===l?(a=r,r=t,t=s=void 0):3===l&&(t.getContext&&void 0===a?(a=s,s=void 0):(a=s,s=r,r=t,t=void 0));try{var h=n.create(r,s);a(null,e(h,t,s))}catch(e){a(e)}}r.create=n.create,r.toCanvas=o.bind(null,s.render),r.toDataURL=o.bind(null,s.renderToDataURL),r.toString=o.bind(null,(function(e,t,r){return a.render(e,r)}))},{"./can-promise":1,"./core/qrcode":17,"./renderer/canvas":25,"./renderer/svg-tag.js":26}],25:[function(e,t,r){var i=e("./utils");r.render=function(e,t,r){var n=r,s=t;void 0!==n||t&&t.getContext||(n=t,t=void 0),t||(s=function(){try{return document.createElement("canvas")}catch(e){throw new Error("You need to specify a canvas element")}}()),n=i.getOptions(n);var a=i.getImageWidth(e.modules.size,n),o=s.getContext("2d"),l=o.createImageData(a,a);return i.qrToImageData(l.data,e,n),function(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}(o,s,a),o.putImageData(l,0,0),s},r.renderToDataURL=function(e,t,i){var n=i;void 0!==n||t&&t.getContext||(n=t,t=void 0),n||(n={});var s=r.render(e,t,n),a=n.type||"image/png",o=n.rendererOpts||{};return s.toDataURL(a,o.quality)}},{"./utils":27}],26:[function(e,t,r){var i=e("./utils");function n(e,t){var r=e.a/255,i=t+'="'+e.hex+'"';return r<1?i+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function s(e,t,r){var i=e+t;return void 0!==r&&(i+=" "+r),i}r.render=function(e,t,r){var a=i.getOptions(t),o=e.modules.size,l=e.modules.data,c=o+2*a.margin,h=a.color.light.a?"<path "+n(a.color.light,"fill")+' d="M0 0h'+c+"v"+c+'H0z"/>':"",u="<path "+n(a.color.dark,"stroke")+' d="'+function(e,t,r){for(var i="",n=0,a=!1,o=0,l=0;l<e.length;l++){var c=Math.floor(l%t),h=Math.floor(l/t);c||a||(a=!0),e[l]?(o++,l>0&&c>0&&e[l-1]||(i+=a?s("M",c+r,.5+h+r):s("m",n,0),n=0,a=!1),c+1<t&&e[l+1]||(i+=s("h",o),o=0)):n++}return i}(l,o,a.margin)+'"/>',d='viewBox="0 0 '+c+" "+c+'"',p='<svg xmlns="http://www.w3.org/2000/svg" '+(a.width?'width="'+a.width+'" height="'+a.width+'" ':"")+d+' shape-rendering="crispEdges">'+h+u+"</svg>\n";return"function"==typeof r&&r(null,p),p}},{"./utils":27}],27:[function(e,t,r){function i(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw new Error("Color should be defined as hex string");var t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw new Error("Invalid hex color: "+e);3!==t.length&&4!==t.length||(t=Array.prototype.concat.apply([],t.map((function(e){return[e,e]})))),6===t.length&&t.push("F","F");var r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}r.getOptions=function(e){e||(e={}),e.color||(e.color={});var t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,n=e.scale||4;return{width:r,scale:r?4:n,margin:t,color:{dark:i(e.color.dark||"#000000ff"),light:i(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},r.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},r.getImageWidth=function(e,t){var i=r.getScale(e,t);return Math.floor((e+2*t.margin)*i)},r.qrToImageData=function(e,t,i){for(var n=t.modules.size,s=t.modules.data,a=r.getScale(n,i),o=Math.floor((n+2*i.margin)*a),l=i.margin*a,c=[i.color.light,i.color.dark],h=0;h<o;h++)for(var u=0;u<o;u++){var d=4*(h*o+u),p=i.color.light;h>=l&&u>=l&&h<o-l&&u<o-l&&(p=c[s[Math.floor((h-l)/a)*n+Math.floor((u-l)/a)]?1:0]),e[d++]=p.r,e[d++]=p.g,e[d++]=p.b,e[d]=p.a}}},{}],28:[function(e,t,r){var i=e("isarray");s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}();var n=s.TYPED_ARRAY_SUPPORT?2147483647:1073741823;function s(e,t,r){return s.TYPED_ARRAY_SUPPORT||this instanceof s?"number"==typeof e?l(this,e):function(e,t,r,i){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,i){if(r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(i||0))throw new RangeError("'length' is out of bounds");var n;return n=void 0===r&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,r):new Uint8Array(t,r,i),s.TYPED_ARRAY_SUPPORT?n.__proto__=s.prototype:n=c(e,n),n}(e,t,r,i):"string"==typeof t?function(e,t){var r=0|u(t),i=o(e,r),n=i.write(t);return n!==r&&(i=i.slice(0,n)),i}(e,t):function(e,t){if(s.isBuffer(t)){var r=0|a(t.length),i=o(e,r);return 0===i.length||t.copy(i,0,0,r),i}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?o(e,0):c(e,t);if("Buffer"===t.type&&Array.isArray(t.data))return c(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}(this,e,t,r):new s(e,t,r)}function a(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function o(e,t){var r;return s.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(t)).__proto__=s.prototype:(null===(r=e)&&(r=new s(t)),r.length=t),r}function l(e,t){var r=o(e,t<0?0:0|a(t));if(!s.TYPED_ARRAY_SUPPORT)for(var i=0;i<t;++i)r[i]=0;return r}function c(e,t){for(var r=t.length<0?0:0|a(t.length),i=o(e,r),n=0;n<r;n+=1)i[n]=255&t[n];return i}function h(e,t){var r;t=t||1/0;for(var i=e.length,n=null,s=[],a=0;a<i;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function u(e){return s.isBuffer(e)?e.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)?e.byteLength:("string"!=typeof e&&(e=""+e),0===e.length?0:h(e).length)}s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),s.prototype.write=function(e,t,r){void 0===t||void 0===r&&"string"==typeof t?(r=this.length,t=0):isFinite(t)&&(t|=0,isFinite(r)?r|=0:r=void 0);var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(e,t,r,i){return function(e,t,r,i){for(var n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}(h(t,e.length-r),e,r,i)}(this,e,t,r)},s.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e),s.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=s.prototype;else{var n=t-e;r=new s(n,void 0);for(var a=0;a<n;++a)r[a]=this[a+e]}return r},s.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var n,a=i-r;if(this===e&&r<t&&t<i)for(n=a-1;n>=0;--n)e[n+t]=this[n+r];else if(a<1e3||!s.TYPED_ARRAY_SUPPORT)for(n=0;n<a;++n)e[n+t]=this[n+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},s.prototype.fill=function(e,t,r){if("string"==typeof e){if("string"==typeof t?(t=0,r=this.length):"string"==typeof r&&(r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{var a=s.isBuffer(e)?e:new s(e),o=a.length;for(n=0;n<r-t;++n)this[n+t]=a[n%o]}return this},s.concat=function(e,t){if(!i(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o(null,0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=l(null,t),a=0;for(r=0;r<e.length;++r){var c=e[r];if(!s.isBuffer(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(n,a),a+=c.length}return n},s.byteLength=u,s.prototype._isBuffer=!0,s.isBuffer=function(e){return!(null==e||!e._isBuffer)},t.exports.alloc=function(e){var t=new s(e);return t.fill(0),t},t.exports.from=function(e){return new s(e)}},{isarray:33}],29:[function(e,t,r){r.byteLength=function(e){var t=l(e),r=t[0],i=t[1];return 3*(r+i)/4-i},r.toByteArray=function(e){var t,r,i=l(e),a=i[0],o=i[1],c=new s(function(e,t,r){return 3*(t+r)/4-r}(0,a,o)),h=0,u=o>0?a-4:a;for(r=0;r<u;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[h++]=t>>16&255,c[h++]=t>>8&255,c[h++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[h++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[h++]=t>>8&255,c[h++]=255&t),c},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,s=[],a=16383,o=0,l=r-n;o<l;o+=a)s.push(c(e,o,o+a>l?l:o+a));return 1===n?(t=e[r-1],s.push(i[t>>2]+i[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"=")),s.join("")};for(var i=[],n=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)i[o]=a[o],n[a.charCodeAt(o)]=o;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var n,s=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);var o;return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},{}],30:[function(e,t,r){var i=e("base64-js"),n=e("ieee754"),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=l,r.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},r.INSPECT_MAX_BYTES=50;var a=2147483647;function o(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|f(e,t),i=o(r),n=i.write(e,t);return n!==r&&(i=i.slice(0,n)),i}(e,t);if(ArrayBuffer.isView(e))return d(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,l.prototype),i}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return l.from(i,t,r);var n=function(e){if(l.isBuffer(e)){var t=0|p(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||F(e.length)?o(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return h(e),o(e<0?0:0|p(e))}function d(e){for(var t=e.length<0?0:0|p(e.length),r=o(t),i=0;i<t;i+=1)r[i]=255&e[i];return r}function p(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function f(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(n)return i?-1:H(e).length;t=(""+t).toLowerCase(),n=!0}}function A(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function g(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function m(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),F(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:E(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):E(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function E(e,t,r,i,n){var s,a=1,o=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,o/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var h=-1;for(s=r;s<o;s++)if(c(e,s)===c(t,-1===h?0:s-h)){if(-1===h&&(h=s),s-h+1===l)return h*a}else-1!==h&&(s-=s-h),h=-1}else for(r+l>o&&(r=o-l),s=r;s>=0;s--){for(var u=!0,d=0;d<l;d++)if(c(e,s+d)!==c(t,d)){u=!1;break}if(u)return s}return-1}function y(e,t,r,i){r=Number(r)||0;var n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;var s=t.length;i>s/2&&(i=s/2);for(var a=0;a<i;++a){var o=parseInt(t.substr(2*a,2),16);if(F(o))return a;e[r+a]=o}return a}function v(e,t,r,i){return Y(H(t,e.length-r),e,r,i)}function _(e,t,r,i){return Y(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function w(e,t,r,i){return _(e,t,r,i)}function C(e,t,r,i){return Y(U(t),e,r,i)}function b(e,t,r,i){return Y(function(e,t){for(var r,i,n,s=[],a=0;a<e.length&&!((t-=2)<0);++a)i=(r=e.charCodeAt(a))>>8,n=r%256,s.push(n),s.push(i);return s}(t,e.length-r),e,r,i)}function S(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var i=[],n=t;n<r;){var s,a,o,l,c=e[n],h=null,u=c>239?4:c>223?3:c>191?2:1;if(n+u<=r)switch(u){case 1:c<128&&(h=c);break;case 2:128==(192&(s=e[n+1]))&&(l=(31&c)<<6|63&s)>127&&(h=l);break;case 3:s=e[n+1],a=e[n+2],128==(192&s)&&128==(192&a)&&(l=(15&c)<<12|(63&s)<<6|63&a)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:s=e[n+1],a=e[n+2],o=e[n+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(l=(15&c)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&l<1114112&&(h=l)}null===h?(h=65533,u=1):h>65535&&(h-=65536,i.push(h>>>10&1023|55296),h=56320|1023&h),i.push(h),n+=u}return function(e){var t=e.length;if(t<=T)return String.fromCharCode.apply(String,e);for(var r="",i=0;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=T));return r}(i)}r.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},l.allocUnsafe=function(e){return u(e)},l.allocUnsafeSlow=function(e){return u(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,i=t.length,n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var i=l.allocUnsafe(t),n=0;for(r=0;r<e.length;++r){var s=e[r];if($(s,Uint8Array)&&(s=l.from(s)),!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(i,n),n+=s.length}return i},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?x(this,0,e):A.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(e,t,r,i,n){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),o=Math.min(s,a),c=this.slice(i,n),h=e.slice(t,r),u=0;u<o;++u)if(c[u]!==h[u]){s=c[u],a=h[u];break}return s<a?-1:a<s?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},l.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return w(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function P(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function R(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function I(e,t,r){var i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);for(var n="",s=t;s<r;++s)n+=V[e[s]];return n}function k(e,t,r){for(var i=e.slice(t,r),n="",s=0;s<i.length;s+=2)n+=String.fromCharCode(i[s]+256*i[s+1]);return n}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,i,n,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function L(e,t,r,i,n,s){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function B(e,t,r,i,s){return t=+t,r>>>=0,s||L(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function O(e,t,r,i,s){return t=+t,r>>>=0,s||L(e,0,r,8),n.write(e,t,r,i,52,8),r+8}l.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var i=this.subarray(e,t);return Object.setPrototypeOf(i,l.prototype),i},l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var i=this[e],n=1,s=0;++s<t&&(n*=256);)i+=this[e+s]*n;return i},l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var i=this[e+--t],n=1;t>0&&(n*=256);)i+=this[e+--t]*n;return i},l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var i=this[e],n=1,s=0;++s<t&&(n*=256);)i+=this[e+s]*n;return i>=(n*=128)&&(i-=Math.pow(2,8*t)),i},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);for(var i=t,n=1,s=this[e+--i];i>0&&(n*=256);)s+=this[e+--i]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),n.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||D(this,e,t,r,Math.pow(2,8*r)-1,0);var n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},l.prototype.writeUIntBE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||D(this,e,t,r,Math.pow(2,8*r)-1,0);var n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}var s=0,a=1,o=0;for(this[t]=255&e;++s<r&&(a*=256);)e<0&&0===o&&0!==this[t+s-1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},l.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}var s=r-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a|0)-o&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return B(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return B(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return O(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return O(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var n=i-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,i);else if(this===e&&r<t&&t<i)for(var s=n-1;s>=0;--s)e[s+t]=this[s+r];else Uint8Array.prototype.set.call(e,this.subarray(r,i),t);return n},l.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!l.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var n=e.charCodeAt(0);("utf8"===i&&n<128||"latin1"===i)&&(e=n)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var s;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s<r;++s)this[s]=e;else{var a=l.isBuffer(e)?e:l.from(e,i),o=a.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<r-t;++s)this[s+t]=a[s%o]}return this};var M=/[^+/0-9A-Za-z-_]/g;function H(e,t){var r;t=t||1/0;for(var i=e.length,n=null,s=[],a=0;a<i;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function U(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,r,i){for(var n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function F(e){return e!=e}var V=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,n=0;n<16;++n)t[i+n]=e[r]+e[n];return t}()},{"base64-js":29,ieee754:32}],31:[function(e,t,r){var i={single_source_shortest_paths:function(e,t,r){var n={},s={};s[t]=0;var a,o,l,c,h,u,d,p=i.PriorityQueue.make();for(p.push(t,0);!p.empty();)for(l in o=(a=p.pop()).value,c=a.cost,h=e[o]||{})h.hasOwnProperty(l)&&(u=c+h[l],d=s[l],(void 0===s[l]||d>u)&&(s[l]=u,p.push(l,u),n[l]=o));if(void 0!==r&&void 0===s[r]){var f=["Could not find a path from ",t," to ",r,"."].join("");throw new Error(f)}return n},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],i=t;i;)r.push(i),e[i],i=e[i];return r.reverse(),r},find_path:function(e,t,r){var n=i.single_source_shortest_paths(e,t,r);return i.extract_shortest_path_from_predecessor_list(n,r)},PriorityQueue:{make:function(e){var t,r=i.PriorityQueue,n={};for(t in e=e||{},r)r.hasOwnProperty(t)&&(n[t]=r[t]);return n.queue=[],n.sorter=e.sorter||r.default_sorter,n},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==t&&(t.exports=i)},{}],32:[function(e,t,r){r.read=function(e,t,r,i,n){var s,a,o=8*n-i-1,l=(1<<o)-1,c=l>>1,h=-7,u=r?n-1:0,d=r?-1:1,p=e[t+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=o;h>0;s=256*s+e[t+u],u+=d,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=i;h>0;a=256*a+e[t+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,i),s-=c}return(p?-1:1)*a*Math.pow(2,s-i)},r.write=function(e,t,r,i,n,s){var a,o,l,c=8*s-n-1,h=(1<<c)-1,u=h>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,f=i?1:-1,A=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=h):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=h?(o=0,a=h):a+u>=1?(o=(t*l-1)*Math.pow(2,n),a+=u):(o=t*Math.pow(2,u-1)*Math.pow(2,n),a=0));n>=8;e[r+p]=255&o,p+=f,o/=256,n-=8);for(a=a<<n|o,c+=n;c>0;e[r+p]=255&a,p+=f,a/=256,c-=8);e[r+p-f]|=128*A}},{}],33:[function(e,t,r){var i={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==i.call(e)}},{}]},{},[24])(24)},t.exports=i()}));return{name:"qrcode",props:{value:null,options:Object,tag:{type:String,default:"canvas"}},render:function(e){return e(this.tag,this.$slots.default)},watch:{$props:{deep:!0,immediate:!0,handler:function(){this.$el&&this.generate()}}},methods:{generate:function(){var e=this,r=this.options,i=this.tag,n=String(this.value);"canvas"===i?t.toCanvas(this.$el,n,r,(function(e){if(e)throw e})):"img"===i?t.toDataURL(n,r,(function(t,r){if(t)throw t;e.$el.src=r})):t.toString(n,r,(function(t,r){if(t)throw t;e.$el.innerHTML=r}))}},mounted:function(){this.generate()}}}()},97380:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".fade-enter-active[data-v-42733c12], .fade-leave-active[data-v-42733c12] {\n transition: opacity 0.3s ease;\n}\n.fade-enter[data-v-42733c12], .fade-leave-to[data-v-42733c12] {\n opacity: 0;\n}\n.linked-icons[data-v-42733c12] {\n display: flex;\n}\n.linked-icons img[data-v-42733c12] {\n padding: 12px;\n height: 44px;\n display: block;\n background-repeat: no-repeat;\n background-position: center;\n opacity: 0.7;\n}\n.linked-icons img[data-v-42733c12]:hover {\n opacity: 1;\n}\n.popovermenu[data-v-42733c12] {\n display: none;\n}\n.popovermenu.open[data-v-42733c12] {\n display: block;\n}\nli.collection-list-item[data-v-42733c12] {\n flex-wrap: wrap;\n height: auto;\n cursor: pointer;\n margin-bottom: 0 !important;\n}\nli.collection-list-item .collection-avatar[data-v-42733c12] {\n margin-top: 6px;\n}\nli.collection-list-item form[data-v-42733c12], li.collection-list-item .collection-item-name[data-v-42733c12] {\n flex-basis: 10%;\n flex-grow: 1;\n display: flex;\n}\nli.collection-list-item .collection-item-name[data-v-42733c12] {\n padding: 12px 9px;\n}\nli.collection-list-item input[data-v-42733c12] {\n margin-top: 4px;\n border-color: var(--color-border-maxcontrast);\n}\nli.collection-list-item input[type=text][data-v-42733c12] {\n flex-grow: 1;\n}\nli.collection-list-item .error[data-v-42733c12] {\n flex-basis: 100%;\n width: 100%;\n}\nli.collection-list-item .resource-list-details[data-v-42733c12] {\n flex-basis: 100%;\n width: 100%;\n}\nli.collection-list-item .resource-list-details li[data-v-42733c12] {\n display: flex;\n margin-left: 44px;\n border-radius: 3px;\n cursor: pointer;\n}\nli.collection-list-item .resource-list-details li[data-v-42733c12]:hover {\n background-color: var(--color-background-dark);\n}\nli.collection-list-item .resource-list-details li a[data-v-42733c12] {\n flex-grow: 1;\n padding: 3px;\n max-width: calc(100% - 30px);\n display: flex;\n}\nli.collection-list-item .resource-list-details span[data-v-42733c12] {\n display: inline-block;\n vertical-align: top;\n margin-right: 10px;\n}\nli.collection-list-item .resource-list-details span.resource-name[data-v-42733c12] {\n text-overflow: ellipsis;\n overflow: hidden;\n position: relative;\n vertical-align: top;\n white-space: nowrap;\n flex-grow: 1;\n padding: 4px;\n}\nli.collection-list-item .resource-list-details img[data-v-42733c12] {\n width: 24px;\n height: 24px;\n}\nli.collection-list-item .resource-list-details .icon-close[data-v-42733c12] {\n opacity: 0.7;\n}\nli.collection-list-item .resource-list-details .icon-close[data-v-42733c12]:hover, li.collection-list-item .resource-list-details .icon-close[data-v-42733c12]:focus {\n opacity: 1;\n}\n.shouldshake[data-v-42733c12] {\n animation: shake-42733c12 0.6s 1 linear;\n}\n@keyframes shake-42733c12 {\n0% {\n transform: translate(15px);\n}\n20% {\n transform: translate(-15px);\n}\n40% {\n transform: translate(7px);\n}\n60% {\n transform: translate(-7px);\n}\n80% {\n transform: translate(3px);\n}\n100% {\n transform: translate(0px);\n}\n}.collection-list *[data-v-8ebb2593] {\n box-sizing: border-box;\n}\n.collection-list > li[data-v-8ebb2593] {\n display: flex;\n align-items: start;\n gap: 12px;\n}\n.collection-list > li > .avatar[data-v-8ebb2593] {\n margin-top: auto;\n}\n#collection-select-container[data-v-8ebb2593] {\n display: flex;\n flex-direction: column;\n}\n.v-select span.avatar[data-v-8ebb2593] {\n display: block;\n padding: 16px;\n opacity: 0.7;\n background-repeat: no-repeat;\n background-position: center;\n}\n.v-select span.avatar[data-v-8ebb2593]:hover {\n opacity: 1;\n}\np.hint[data-v-8ebb2593] {\n z-index: 1;\n margin-top: -16px;\n padding: 8px 8px;\n color: var(--color-text-maxcontrast);\n line-height: normal;\n}\ndiv.avatar[data-v-8ebb2593] {\n width: 32px;\n height: 32px;\n margin: 0;\n padding: 8px;\n background-color: var(--color-background-dark);\n margin-top: 30px;\n}\n\n/** TODO provide white icon in core */\n.icon-projects[data-v-8ebb2593] {\n display: block;\n padding: 8px;\n background-repeat: no-repeat;\n background-position: center;\n}\n.option__wrapper[data-v-8ebb2593] {\n display: flex;\n}\n.option__wrapper .avatar[data-v-8ebb2593] {\n display: block;\n background-color: var(--color-background-darker) !important;\n}\n.option__wrapper .option__title[data-v-8ebb2593] {\n padding: 4px;\n}\n.fade-enter-active[data-v-8ebb2593], .fade-leave-active[data-v-8ebb2593] {\n transition: opacity 0.5s;\n}\n.fade-enter[data-v-8ebb2593], .fade-leave-to[data-v-8ebb2593] {\n opacity: 0;\n}","",{version:3,sources:["webpack://./node_modules/nextcloud-vue-collections/dist/assets/index-CJAYjuyf.css"],names:[],mappings:"AAAA;EACE,6BAA6B;AAC/B;AACA;EACE,UAAU;AACZ;AACA;EACE,aAAa;AACf;AACA;EACE,aAAa;EACb,YAAY;EACZ,cAAc;EACd,4BAA4B;EAC5B,2BAA2B;EAC3B,YAAY;AACd;AACA;EACE,UAAU;AACZ;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;AAChB;AACA;EACE,eAAe;EACf,YAAY;EACZ,eAAe;EACf,2BAA2B;AAC7B;AACA;EACE,eAAe;AACjB;AACA;EACE,eAAe;EACf,YAAY;EACZ,aAAa;AACf;AACA;EACE,iBAAiB;AACnB;AACA;EACE,eAAe;EACf,6CAA6C;AAC/C;AACA;EACE,YAAY;AACd;AACA;EACE,gBAAgB;EAChB,WAAW;AACb;AACA;EACE,gBAAgB;EAChB,WAAW;AACb;AACA;EACE,aAAa;EACb,iBAAiB;EACjB,kBAAkB;EAClB,eAAe;AACjB;AACA;EACE,8CAA8C;AAChD;AACA;EACE,YAAY;EACZ,YAAY;EACZ,4BAA4B;EAC5B,aAAa;AACf;AACA;EACE,qBAAqB;EACrB,mBAAmB;EACnB,kBAAkB;AACpB;AACA;EACE,uBAAuB;EACvB,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;EACnB,mBAAmB;EACnB,YAAY;EACZ,YAAY;AACd;AACA;EACE,WAAW;EACX,YAAY;AACd;AACA;EACE,YAAY;AACd;AACA;EACE,UAAU;AACZ;AACA;EACE,uCAAuC;AACzC;AACA;AACA;IACI,0BAA0B;AAC9B;AACA;IACI,2BAA2B;AAC/B;AACA;IACI,yBAAyB;AAC7B;AACA;IACI,0BAA0B;AAC9B;AACA;IACI,yBAAyB;AAC7B;AACA;IACI,yBAAyB;AAC7B;AACA,CAAC;EACC,sBAAsB;AACxB;AACA;EACE,aAAa;EACb,kBAAkB;EAClB,SAAS;AACX;AACA;EACE,gBAAgB;AAClB;AACA;EACE,aAAa;EACb,sBAAsB;AACxB;AACA;EACE,cAAc;EACd,aAAa;EACb,YAAY;EACZ,4BAA4B;EAC5B,2BAA2B;AAC7B;AACA;EACE,UAAU;AACZ;AACA;EACE,UAAU;EACV,iBAAiB;EACjB,gBAAgB;EAChB,oCAAoC;EACpC,mBAAmB;AACrB;AACA;EACE,WAAW;EACX,YAAY;EACZ,SAAS;EACT,YAAY;EACZ,8CAA8C;EAC9C,gBAAgB;AAClB;;AAEA,qCAAqC;AACrC;EACE,cAAc;EACd,YAAY;EACZ,4BAA4B;EAC5B,2BAA2B;AAC7B;AACA;EACE,aAAa;AACf;AACA;EACE,cAAc;EACd,2DAA2D;AAC7D;AACA;EACE,YAAY;AACd;AACA;EACE,wBAAwB;AAC1B;AACA;EACE,UAAU;AACZ",sourcesContent:[".fade-enter-active[data-v-42733c12], .fade-leave-active[data-v-42733c12] {\n transition: opacity 0.3s ease;\n}\n.fade-enter[data-v-42733c12], .fade-leave-to[data-v-42733c12] {\n opacity: 0;\n}\n.linked-icons[data-v-42733c12] {\n display: flex;\n}\n.linked-icons img[data-v-42733c12] {\n padding: 12px;\n height: 44px;\n display: block;\n background-repeat: no-repeat;\n background-position: center;\n opacity: 0.7;\n}\n.linked-icons img[data-v-42733c12]:hover {\n opacity: 1;\n}\n.popovermenu[data-v-42733c12] {\n display: none;\n}\n.popovermenu.open[data-v-42733c12] {\n display: block;\n}\nli.collection-list-item[data-v-42733c12] {\n flex-wrap: wrap;\n height: auto;\n cursor: pointer;\n margin-bottom: 0 !important;\n}\nli.collection-list-item .collection-avatar[data-v-42733c12] {\n margin-top: 6px;\n}\nli.collection-list-item form[data-v-42733c12], li.collection-list-item .collection-item-name[data-v-42733c12] {\n flex-basis: 10%;\n flex-grow: 1;\n display: flex;\n}\nli.collection-list-item .collection-item-name[data-v-42733c12] {\n padding: 12px 9px;\n}\nli.collection-list-item input[data-v-42733c12] {\n margin-top: 4px;\n border-color: var(--color-border-maxcontrast);\n}\nli.collection-list-item input[type=text][data-v-42733c12] {\n flex-grow: 1;\n}\nli.collection-list-item .error[data-v-42733c12] {\n flex-basis: 100%;\n width: 100%;\n}\nli.collection-list-item .resource-list-details[data-v-42733c12] {\n flex-basis: 100%;\n width: 100%;\n}\nli.collection-list-item .resource-list-details li[data-v-42733c12] {\n display: flex;\n margin-left: 44px;\n border-radius: 3px;\n cursor: pointer;\n}\nli.collection-list-item .resource-list-details li[data-v-42733c12]:hover {\n background-color: var(--color-background-dark);\n}\nli.collection-list-item .resource-list-details li a[data-v-42733c12] {\n flex-grow: 1;\n padding: 3px;\n max-width: calc(100% - 30px);\n display: flex;\n}\nli.collection-list-item .resource-list-details span[data-v-42733c12] {\n display: inline-block;\n vertical-align: top;\n margin-right: 10px;\n}\nli.collection-list-item .resource-list-details span.resource-name[data-v-42733c12] {\n text-overflow: ellipsis;\n overflow: hidden;\n position: relative;\n vertical-align: top;\n white-space: nowrap;\n flex-grow: 1;\n padding: 4px;\n}\nli.collection-list-item .resource-list-details img[data-v-42733c12] {\n width: 24px;\n height: 24px;\n}\nli.collection-list-item .resource-list-details .icon-close[data-v-42733c12] {\n opacity: 0.7;\n}\nli.collection-list-item .resource-list-details .icon-close[data-v-42733c12]:hover, li.collection-list-item .resource-list-details .icon-close[data-v-42733c12]:focus {\n opacity: 1;\n}\n.shouldshake[data-v-42733c12] {\n animation: shake-42733c12 0.6s 1 linear;\n}\n@keyframes shake-42733c12 {\n0% {\n transform: translate(15px);\n}\n20% {\n transform: translate(-15px);\n}\n40% {\n transform: translate(7px);\n}\n60% {\n transform: translate(-7px);\n}\n80% {\n transform: translate(3px);\n}\n100% {\n transform: translate(0px);\n}\n}.collection-list *[data-v-8ebb2593] {\n box-sizing: border-box;\n}\n.collection-list > li[data-v-8ebb2593] {\n display: flex;\n align-items: start;\n gap: 12px;\n}\n.collection-list > li > .avatar[data-v-8ebb2593] {\n margin-top: auto;\n}\n#collection-select-container[data-v-8ebb2593] {\n display: flex;\n flex-direction: column;\n}\n.v-select span.avatar[data-v-8ebb2593] {\n display: block;\n padding: 16px;\n opacity: 0.7;\n background-repeat: no-repeat;\n background-position: center;\n}\n.v-select span.avatar[data-v-8ebb2593]:hover {\n opacity: 1;\n}\np.hint[data-v-8ebb2593] {\n z-index: 1;\n margin-top: -16px;\n padding: 8px 8px;\n color: var(--color-text-maxcontrast);\n line-height: normal;\n}\ndiv.avatar[data-v-8ebb2593] {\n width: 32px;\n height: 32px;\n margin: 0;\n padding: 8px;\n background-color: var(--color-background-dark);\n margin-top: 30px;\n}\n\n/** TODO provide white icon in core */\n.icon-projects[data-v-8ebb2593] {\n display: block;\n padding: 8px;\n background-repeat: no-repeat;\n background-position: center;\n}\n.option__wrapper[data-v-8ebb2593] {\n display: flex;\n}\n.option__wrapper .avatar[data-v-8ebb2593] {\n display: block;\n background-color: var(--color-background-darker) !important;\n}\n.option__wrapper .option__title[data-v-8ebb2593] {\n padding: 4px;\n}\n.fade-enter-active[data-v-8ebb2593], .fade-leave-active[data-v-8ebb2593] {\n transition: opacity 0.5s;\n}\n.fade-enter[data-v-8ebb2593], .fade-leave-to[data-v-8ebb2593] {\n opacity: 0;\n}"],sourceRoot:""}]);const o=a},1709:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".sharing-entry[data-v-fd4f3ea8]{display:flex;align-items:center;height:44px}.sharing-entry__summary[data-v-fd4f3ea8]{padding:8px;padding-inline-start:10px;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex:1 0;min-width:0}.sharing-entry__summary__desc[data-v-fd4f3ea8]{display:inline-block;padding-bottom:0;line-height:1.2em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sharing-entry__summary__desc p[data-v-fd4f3ea8],.sharing-entry__summary__desc small[data-v-fd4f3ea8]{color:var(--color-text-maxcontrast)}.sharing-entry__summary__desc-unique[data-v-fd4f3ea8]{color:var(--color-text-maxcontrast)}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntry.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,WAAA,CACA,yCACC,WAAA,CACA,yBAAA,CACA,YAAA,CACA,qBAAA,CACA,sBAAA,CACA,sBAAA,CACA,QAAA,CACA,WAAA,CAEA,+CACC,oBAAA,CACA,gBAAA,CACA,iBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CAEA,sGAEC,mCAAA,CAGD,sDACC,mCAAA",sourceRoot:""}]);const o=a},88346:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".sharing-entry[data-v-32cb91ce]{display:flex;align-items:center;height:44px}.sharing-entry__desc[data-v-32cb91ce]{display:flex;flex-direction:column;justify-content:space-between;padding:8px;padding-inline-start:10px;line-height:1.2em}.sharing-entry__desc p[data-v-32cb91ce]{color:var(--color-text-maxcontrast)}.sharing-entry__actions[data-v-32cb91ce]{margin-inline-start:auto}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryInherited.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,WAAA,CACA,sCACC,YAAA,CACA,qBAAA,CACA,6BAAA,CACA,WAAA,CACA,yBAAA,CACA,iBAAA,CACA,wCACC,mCAAA,CAGF,yCACC,wBAAA",sourceRoot:""}]);const o=a},23815:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".sharing-entry__internal .avatar-external[data-v-1d9a7cfa]{width:32px;height:32px;line-height:32px;font-size:18px;background-color:var(--color-text-maxcontrast);border-radius:50%;flex-shrink:0}.sharing-entry__internal .icon-checkmark-color[data-v-1d9a7cfa]{opacity:1;color:var(--color-success)}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryInternal.vue"],names:[],mappings:"AAEC,2DACC,UAAA,CACA,WAAA,CACA,gBAAA,CACA,cAAA,CACA,8CAAA,CACA,iBAAA,CACA,aAAA,CAED,gEACC,SAAA,CACA,0BAAA",sourceRoot:""}]);const o=a},18658:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".sharing-entry[data-v-a1337124]{display:flex;align-items:center;min-height:44px}.sharing-entry__summary[data-v-a1337124]{padding:8px;padding-inline-start:10px;display:flex;justify-content:space-between;flex:1 0;min-width:0}.sharing-entry__desc[data-v-a1337124]{display:flex;flex-direction:column;line-height:1.2em}.sharing-entry__desc p[data-v-a1337124]{color:var(--color-text-maxcontrast)}.sharing-entry__desc__title[data-v-a1337124]{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.sharing-entry:not(.sharing-entry--share) .sharing-entry__actions .new-share-link[data-v-a1337124]{border-top:1px solid var(--color-border)}.sharing-entry[data-v-a1337124] .avatar-link-share{background-color:var(--color-primary-element)}.sharing-entry .sharing-entry__action--public-upload[data-v-a1337124]{border-bottom:1px solid var(--color-border)}.sharing-entry__loading[data-v-a1337124]{width:44px;height:44px;margin:0;padding:14px;margin-inline-start:auto}.sharing-entry .action-item~.action-item[data-v-a1337124],.sharing-entry .action-item~.sharing-entry__loading[data-v-a1337124]{margin-inline-start:0}.sharing-entry .icon-checkmark-color[data-v-a1337124]{opacity:1;color:var(--color-success)}.qr-code-dialog[data-v-a1337124]{display:flex;width:100%;justify-content:center}.qr-code-dialog__img[data-v-a1337124]{width:100%;height:auto}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryLink.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,eAAA,CAEA,yCACC,WAAA,CACA,yBAAA,CACA,YAAA,CACA,6BAAA,CACA,QAAA,CACA,WAAA,CAGA,sCACC,YAAA,CACA,qBAAA,CACA,iBAAA,CAEA,wCACC,mCAAA,CAGD,6CACC,sBAAA,CACA,eAAA,CACA,kBAAA,CAKF,mGACC,wCAAA,CAIF,mDACC,6CAAA,CAGD,sEACC,2CAAA,CAGD,yCACC,UAAA,CACA,WAAA,CACA,QAAA,CACA,YAAA,CACA,wBAAA,CAOA,+HAEC,qBAAA,CAIF,sDACC,SAAA,CACA,0BAAA,CAKF,iCACC,YAAA,CACA,UAAA,CACA,sBAAA,CAEA,sCACC,UAAA,CACA,WAAA",sourceRoot:""}]);const o=a},88809:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".share-select[data-v-60eea424]{display:block}.share-select[data-v-60eea424] .action-item__menutoggle{color:var(--color-primary-element) !important;font-size:12.5px !important;height:auto !important;min-height:auto !important}.share-select[data-v-60eea424] .action-item__menutoggle .button-vue__text{font-weight:normal !important}.share-select[data-v-60eea424] .action-item__menutoggle .button-vue__icon{height:24px !important;min-height:24px !important;width:24px !important;min-width:24px !important}.share-select[data-v-60eea424] .action-item__menutoggle .button-vue__wrapper{flex-direction:row-reverse !important}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntryQuickShareSelect.vue"],names:[],mappings:"AACA,+BACC,aAAA,CAIA,wDACC,6CAAA,CACA,2BAAA,CACA,sBAAA,CACA,0BAAA,CAEA,0EACC,6BAAA,CAGD,0EACC,sBAAA,CACA,0BAAA,CACA,qBAAA,CACA,yBAAA,CAGD,6EAEC,qCAAA",sourceRoot:""}]);const o=a},86495:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".sharing-entry[data-v-4c49edf4]{display:flex;align-items:center;min-height:44px}.sharing-entry__desc[data-v-4c49edf4]{padding:8px;padding-inline-start:10px;line-height:1.2em;position:relative;flex:1 1;min-width:0}.sharing-entry__desc p[data-v-4c49edf4]{color:var(--color-text-maxcontrast)}.sharing-entry__title[data-v-4c49edf4]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:inherit}.sharing-entry__actions[data-v-4c49edf4]{margin-inline-start:auto !important}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingEntrySimple.vue"],names:[],mappings:"AACA,gCACC,YAAA,CACA,kBAAA,CACA,eAAA,CACA,sCACC,WAAA,CACA,yBAAA,CACA,iBAAA,CACA,iBAAA,CACA,QAAA,CACA,WAAA,CACA,wCACC,mCAAA,CAGF,uCACC,kBAAA,CACA,sBAAA,CACA,eAAA,CACA,iBAAA,CAED,yCACC,mCAAA",sourceRoot:""}]);const o=a},2134:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".sharing-search{display:flex;flex-direction:column;margin-bottom:4px}.sharing-search label[for=sharing-search-input]{margin-bottom:2px}.sharing-search__input{width:100%;margin:10px 0}.vs__dropdown-menu span[lookup] .avatardiv{background-image:var(--icon-search-white);background-repeat:no-repeat;background-position:center;background-color:var(--color-text-maxcontrast) !important}.vs__dropdown-menu span[lookup] .avatardiv .avatardiv__initials-wrapper{display:none}","",{version:3,sources:["webpack://./apps/files_sharing/src/components/SharingInput.vue"],names:[],mappings:"AACA,gBACC,YAAA,CACA,qBAAA,CACA,iBAAA,CAEA,gDACC,iBAAA,CAGD,uBACC,UAAA,CACA,aAAA,CAOA,2CACC,yCAAA,CACA,2BAAA,CACA,0BAAA,CACA,yDAAA,CACA,wEACC,YAAA",sourceRoot:""}]);const o=a},93833:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".sharingTabDetailsView[data-v-239560e4]{display:flex;flex-direction:column;width:100%;margin:0 auto;position:relative;height:100%;overflow:hidden}.sharingTabDetailsView__header[data-v-239560e4]{display:flex;align-items:center;box-sizing:border-box;margin:.2em}.sharingTabDetailsView__header span[data-v-239560e4]{display:flex;align-items:center}.sharingTabDetailsView__header span h1[data-v-239560e4]{font-size:15px;padding-inline-start:.3em}.sharingTabDetailsView__wrapper[data-v-239560e4]{position:relative;overflow:scroll;flex-shrink:1;padding:4px;padding-inline-end:12px}.sharingTabDetailsView__quick-permissions[data-v-239560e4]{display:flex;justify-content:center;width:100%;margin:0 auto;border-radius:0}.sharingTabDetailsView__quick-permissions div[data-v-239560e4]{width:100%}.sharingTabDetailsView__quick-permissions div span[data-v-239560e4]{width:100%}.sharingTabDetailsView__quick-permissions div span span[data-v-239560e4]:nth-child(1){align-items:center;justify-content:center;padding:.1em}.sharingTabDetailsView__quick-permissions div span[data-v-239560e4] label span{display:flex;flex-direction:column}.sharingTabDetailsView__quick-permissions div span[data-v-239560e4] span.checkbox-content__text.checkbox-radio-switch__text{flex-wrap:wrap}.sharingTabDetailsView__quick-permissions div span[data-v-239560e4] span.checkbox-content__text.checkbox-radio-switch__text .subline{display:block;flex-basis:100%}.sharingTabDetailsView__advanced-control[data-v-239560e4]{width:100%}.sharingTabDetailsView__advanced-control button[data-v-239560e4]{margin-top:.5em}.sharingTabDetailsView__advanced[data-v-239560e4]{width:100%;margin-bottom:.5em;text-align:start;padding-inline-start:0}.sharingTabDetailsView__advanced section textarea[data-v-239560e4],.sharingTabDetailsView__advanced section div.mx-datepicker[data-v-239560e4]{width:100%}.sharingTabDetailsView__advanced section textarea[data-v-239560e4]{height:80px;margin:0}.sharingTabDetailsView__advanced section span[data-v-239560e4] label{padding-inline-start:0 !important;background-color:initial !important;border:none !important}.sharingTabDetailsView__advanced section section.custom-permissions-group[data-v-239560e4]{padding-inline-start:1.5em}.sharingTabDetailsView__delete>button[data-v-239560e4]:first-child{color:#df0707}.sharingTabDetailsView__footer[data-v-239560e4]{width:100%;display:flex;position:sticky;bottom:0;flex-direction:column;justify-content:space-between;align-items:flex-start;background:linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--color-main-background))}.sharingTabDetailsView__footer .button-group[data-v-239560e4]{display:flex;justify-content:space-between;width:100%;margin-top:16px}.sharingTabDetailsView__footer .button-group button[data-v-239560e4]{margin-inline-start:16px}.sharingTabDetailsView__footer .button-group button[data-v-239560e4]:first-child{margin-inline-start:0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingDetailsTab.vue"],names:[],mappings:"AACA,wCACC,YAAA,CACA,qBAAA,CACA,UAAA,CACA,aAAA,CACA,iBAAA,CACA,WAAA,CACA,eAAA,CAEA,gDACC,YAAA,CACA,kBAAA,CACA,qBAAA,CACA,WAAA,CAEA,qDACC,YAAA,CACA,kBAAA,CAEA,wDACC,cAAA,CACA,yBAAA,CAMH,iDACC,iBAAA,CACA,eAAA,CACA,aAAA,CACA,WAAA,CACA,uBAAA,CAGD,2DACC,YAAA,CACA,sBAAA,CACA,UAAA,CACA,aAAA,CACA,eAAA,CAEA,+DACC,UAAA,CAEA,oEACC,UAAA,CAEA,sFACC,kBAAA,CACA,sBAAA,CACA,YAAA,CAKA,+EACC,YAAA,CACA,qBAAA,CAKF,4HACC,cAAA,CAEA,qIACC,aAAA,CACA,eAAA,CAQL,0DACC,UAAA,CAEA,iEACC,eAAA,CAKF,kDACC,UAAA,CACA,kBAAA,CACA,gBAAA,CACA,sBAAA,CAIC,+IAEC,UAAA,CAGD,mEACC,WAAA,CACA,QAAA,CAaA,qEACC,iCAAA,CACA,mCAAA,CACA,sBAAA,CAIF,2FACC,0BAAA,CAMF,mEACC,aAAA,CAIF,gDACC,UAAA,CACA,YAAA,CACA,eAAA,CACA,QAAA,CACA,qBAAA,CACA,6BAAA,CACA,sBAAA,CACA,2FAAA,CAEA,8DACC,YAAA,CACA,6BAAA,CACA,UAAA,CACA,eAAA,CAEA,qEACC,wBAAA,CAEA,iFACC,qBAAA",sourceRoot:""}]);const o=a},44377:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".sharing-entry__inherited .avatar-shared[data-v-33849ae4]{width:32px;height:32px;line-height:32px;font-size:18px;background-color:var(--color-text-maxcontrast);border-radius:50%;flex-shrink:0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingInherited.vue"],names:[],mappings:"AAEC,0DACC,UAAA,CACA,WAAA,CACA,gBAAA,CACA,cAAA,CACA,8CAAA,CACA,iBAAA,CACA,aAAA",sourceRoot:""}]);const o=a},71028:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var i=r(71354),n=r.n(i),s=r(76314),a=r.n(s)()(n());a.push([e.id,".emptyContentWithSections[data-v-7c6dc4a7]{margin:1rem auto}.sharingTab[data-v-7c6dc4a7]{position:relative;height:100%}.sharingTab__content[data-v-7c6dc4a7]{padding:0 6px}.sharingTab__additionalContent[data-v-7c6dc4a7]{margin:44px 0}","",{version:3,sources:["webpack://./apps/files_sharing/src/views/SharingTab.vue"],names:[],mappings:"AACA,2CACC,gBAAA,CAGD,6BACC,iBAAA,CACA,WAAA,CAEA,sCACC,aAAA,CAGD,gDACC,aAAA",sourceRoot:""}]);const o=a},48318:function(e,t,r){!function(e){"use strict";var t,r=function(){try{if(e.URLSearchParams&&"bar"===new e.URLSearchParams("foo=bar").get("foo"))return e.URLSearchParams}catch(e){}return null}(),i=r&&"a=1"===new r({a:1}).toString(),n=r&&"+"===new r("s=%2B").get("s"),s=r&&"size"in r.prototype,a="__URLSearchParams__",o=!r||((t=new r).append("s"," &"),"s=+%26"===t.toString()),l=p.prototype,c=!(!e.Symbol||!e.Symbol.iterator);if(!(r&&i&&n&&o&&s)){l.append=function(e,t){E(this[a],e,t)},l.delete=function(e){delete this[a][e]},l.get=function(e){var t=this[a];return this.has(e)?t[e][0]:null},l.getAll=function(e){var t=this[a];return this.has(e)?t[e].slice(0):[]},l.has=function(e){return v(this[a],e)},l.set=function(e,t){this[a][e]=[""+t]},l.toString=function(){var e,t,r,i,n=this[a],s=[];for(t in n)for(r=f(t),e=0,i=n[t];e<i.length;e++)s.push(r+"="+f(i[e]));return s.join("&")};var h,u=e.Proxy&&r&&(!n||!o||!i||!s);u?(h=new Proxy(r,{construct:function(e,t){return new e(new p(t[0]).toString())}})).toString=Function.prototype.toString.bind(p):h=p,Object.defineProperty(e,"URLSearchParams",{value:h});var d=e.URLSearchParams.prototype;d.polyfill=!0,!u&&e.Symbol&&(d[e.Symbol.toStringTag]="URLSearchParams"),"forEach"in d||(d.forEach=function(e,t){var r=m(this.toString());Object.getOwnPropertyNames(r).forEach((function(i){r[i].forEach((function(r){e.call(t,r,i,this)}),this)}),this)}),"sort"in d||(d.sort=function(){var e,t,r,i=m(this.toString()),n=[];for(e in i)n.push(e);for(n.sort(),t=0;t<n.length;t++)this.delete(n[t]);for(t=0;t<n.length;t++){var s=n[t],a=i[s];for(r=0;r<a.length;r++)this.append(s,a[r])}}),"keys"in d||(d.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),g(e)}),"values"in d||(d.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),g(e)}),"entries"in d||(d.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),g(e)}),c&&(d[e.Symbol.iterator]=d[e.Symbol.iterator]||d.entries),"size"in d||Object.defineProperty(d,"size",{get:function(){var e=m(this.toString());if(d===this)throw new TypeError("Illegal invocation at URLSearchParams.invokeGetter");return Object.keys(e).reduce((function(t,r){return t+e[r].length}),0)}})}function p(e){((e=e||"")instanceof URLSearchParams||e instanceof p)&&(e=e.toString()),this[a]=m(e)}function f(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'\(\)~]|%20|%00/g,(function(e){return t[e]}))}function A(e){return e.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,(function(e){return decodeURIComponent(e)}))}function g(t){var r={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return c&&(r[e.Symbol.iterator]=function(){return r}),r}function m(e){var t={};if("object"==typeof e)if(y(e))for(var r=0;r<e.length;r++){var i=e[r];if(!y(i)||2!==i.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");E(t,i[0],i[1])}else for(var n in e)e.hasOwnProperty(n)&&E(t,n,e[n]);else{0===e.indexOf("?")&&(e=e.slice(1));for(var s=e.split("&"),a=0;a<s.length;a++){var o=s[a],l=o.indexOf("=");-1<l?E(t,A(o.slice(0,l)),A(o.slice(l+1))):o&&E(t,A(o),"")}}return t}function E(e,t,r){var i="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);v(e,t)?e[t].push(i):e[t]=[i]}function y(e){return!!e&&"[object Array]"===Object.prototype.toString.call(e)}function v(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(void 0!==r.g?r.g:"undefined"!=typeof window?window:this)},10339:(e,r,i)=>{"use strict";i.r(r),i.d(r,{default:()=>Cr});var n=i(21777),s=i(35810),a=i(32981),o=i(63814),l=i(85072),c=i.n(l),h=i(97825),u=i.n(h),d=i(77659),p=i.n(d),f=i(55056),A=i.n(f),g=i(10540),m=i.n(g),E=i(41113),y=i.n(E),v=i(97380),_={};_.styleTagTransform=y(),_.setAttributes=A(),_.insert=p().bind(null,"head"),_.domAPI=u(),_.insertStyleElement=m(),c()(v.A,_),v.A&&v.A.locals&&v.A.locals;var w=i(53334),C=i(41944),b=i(67607);const S=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},x="object"==typeof global&&global&&global.Object===Object&&global;var T="object"==typeof self&&self&&self.Object===Object&&self;const P=x||T||Function("return this")(),R=function(){return P.Date.now()};var I=/\s/;var k=/^\s+/;const N=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&I.test(e.charAt(t)););return t}(e)+1).replace(k,""):e},D=P.Symbol;var L=Object.prototype,B=L.hasOwnProperty,O=L.toString,M=D?D.toStringTag:void 0;var H=Object.prototype.toString;var U=D?D.toStringTag:void 0;const Y=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":U&&U in Object(e)?function(e){var t=B.call(e,M),r=e[M];try{e[M]=void 0;var i=!0}catch(e){}var n=O.call(e);return i&&(t?e[M]=r:delete e[M]),n}(e):function(e){return H.call(e)}(e)};var $=/^[-+]0x[0-9a-f]+$/i,F=/^0b[01]+$/i,V=/^0o[0-7]+$/i,j=parseInt;const q=function(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==Y(e)}(e))return NaN;if(S(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=S(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=N(e);var r=F.test(e);return r||V.test(e)?j(e.slice(2),r?2:8):$.test(e)?NaN:+e};var z=Math.max,W=Math.min;var G=i(24764),K=i(89257),X=i(85471),Q=i(65043);const Z=new class{constructor(){this.http=Q.Ay}listCollection(e){return this.http.get((0,o.KT)("collaboration/resources/collections/{collectionId}",{collectionId:e}))}renameCollection(e,t){return this.http.put((0,o.KT)("collaboration/resources/collections/{collectionId}",{collectionId:e}),{collectionName:t}).then((e=>e.data.ocs.data))}getCollectionsByResource(e,t){return this.http.get((0,o.KT)("collaboration/resources/{resourceType}/{resourceId}",{resourceType:e,resourceId:t})).then((e=>e.data.ocs.data))}createCollection(e,t,r){return this.http.post((0,o.KT)("collaboration/resources/{resourceType}/{resourceId}",{resourceType:e,resourceId:t}),{name:r}).then((e=>e.data.ocs.data))}addResource(e,t,r){return r=""+r,this.http.post((0,o.KT)("collaboration/resources/collections/{collectionId}",{collectionId:e}),{resourceType:t,resourceId:r}).then((e=>e.data.ocs.data))}removeResource(e,t,r){return this.http.delete((0,o.KT)("collaboration/resources/collections/{collectionId}",{collectionId:e}),{params:{resourceType:t,resourceId:r}}).then((e=>e.data.ocs.data))}search(e){return this.http.get((0,o.KT)("collaboration/resources/collections/search/{query}",{query:e})).then((e=>e.data.ocs.data))}},J=(0,X.Kh)({collections:[]}),ee={addCollections(e){(0,X.hZ)(J,"collections",e)},addCollection(e){J.collections.push(e)},removeCollection(e){(0,X.hZ)(J,"collections",J.collections.filter((t=>t.id!==e)))},updateCollection(e){const t=J.collections.findIndex((t=>t.id===e.id));-1!==t?(0,X.hZ)(J.collections,t,e):J.collections.push(e)}},te={fetchCollectionsByResource:({resourceType:e,resourceId:t})=>Z.getCollectionsByResource(e,t).then((e=>(ee.addCollections(e),e))),createCollection:({baseResourceType:e,baseResourceId:t,resourceType:r,resourceId:i,name:n})=>Z.createCollection(e,t,n).then((e=>{ee.addCollection(e),te.addResourceToCollection({collectionId:e.id,resourceType:r,resourceId:i})})),renameCollection:({collectionId:e,name:t})=>Z.renameCollection(e,t).then((e=>(ee.updateCollection(e),e))),addResourceToCollection:({collectionId:e,resourceType:t,resourceId:r})=>Z.addResource(e,t,r).then((e=>(ee.updateCollection(e),e))),removeResource:({collectionId:e,resourceType:t,resourceId:r})=>Z.removeResource(e,t,r).then((e=>{e.resources.length>0?ee.updateCollection(e):ee.removeCollection(e)})),search:e=>Z.search(e)};function re(e,t,r,i,n,s,a,o){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=r,c._compiled=!0),i&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),a?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):n&&(l=o?function(){n.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:n),l)if(c.functional){c._injectStyles=l;var h=c.render;c.render=function(e,t){return l.call(t),h(e,t)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:c}}const ie=re({name:"CollectionListItem",components:{NcAvatar:C.A,NcActions:G.A,NcActionButton:K.A},props:{collection:{type:Object,default:null}},data:()=>({detailsOpen:!1,newName:null,error:{}}),computed:{getIcon:()=>e=>[e.iconClass],typeClass:()=>e=>"resource-type-"+e.type,limitedResources:()=>e=>e.resources?e.resources.slice(0,2):[],iconUrl:()=>e=>e.mimetype?OC.MimeType.getIconUrl(e.mimetype):e.iconUrl?e.iconUrl:""},methods:{t:w.t,toggleDetails(){this.detailsOpen=!this.detailsOpen},showDetails(){this.detailsOpen=!0},hideDetails(){this.detailsOpen=!1},removeResource(e,t){te.removeResource({collectionId:e.id,resourceType:t.type,resourceId:t.id})},openRename(){this.newName=this.collection.name},renameCollection(){""!==this.newName?te.renameCollection({collectionId:this.collection.id,name:this.newName}).then((e=>{this.newName=null})).catch((e=>{this.$set(this.error,"rename",(0,w.t)("core","Failed to rename the project")),console.error(e),setTimeout((()=>{(0,X.hZ)(this.error,"rename",null)}),3e3)})):this.newName=null}}},(function(){var e=this,t=e._self._c;return t("li",{staticClass:"collection-list-item"},[t("NcAvatar",{staticClass:"collection-avatar",attrs:{"display-name":e.collection.name,"allow-placeholder":""}}),null===e.newName?t("span",{staticClass:"collection-item-name",attrs:{title:""},on:{click:e.showDetails}},[e._v(e._s(e.collection.name))]):t("form",{class:{shouldshake:e.error.rename},on:{submit:function(t){return t.preventDefault(),e.renameCollection.apply(null,arguments)}}},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.newName,expression:"newName"}],attrs:{type:"text",autocomplete:"off",autocapitalize:"off"},domProps:{value:e.newName},on:{input:function(t){t.target.composing||(e.newName=t.target.value)}}}),t("input",{staticClass:"icon-confirm",attrs:{type:"submit",value:""}})]),e.detailsOpen||null!==e.newName?e._e():t("div",{staticClass:"linked-icons"},e._l(e.limitedResources(e.collection),(function(r){return t("a",{key:r.type+"|"+r.id,class:e.typeClass(r),attrs:{title:r.name,href:r.link}},[t("img",{attrs:{src:e.iconUrl(r)}})])})),0),null===e.newName?t("span",{staticClass:"sharingOptionsGroup"},[t("NcActions",[t("NcActionButton",{attrs:{icon:"icon-info"},on:{click:function(t){return t.preventDefault(),e.toggleDetails.apply(null,arguments)}}},[e._v(" "+e._s(e.detailsOpen?e.t("core","Hide details"):e.t("core","Show details"))+" ")]),t("NcActionButton",{attrs:{icon:"icon-rename"},on:{click:function(t){return t.preventDefault(),e.openRename.apply(null,arguments)}}},[e._v(" "+e._s(e.t("core","Rename project"))+" ")])],1)],1):e._e(),t("transition",{attrs:{name:"fade"}},[e.error.rename?t("div",{staticClass:"error"},[e._v(" "+e._s(e.error.rename)+" ")]):e._e()]),t("transition",{attrs:{name:"fade"}},[e.detailsOpen?t("ul",{staticClass:"resource-list-details"},e._l(e.collection.resources,(function(r){return t("li",{key:r.type+"|"+r.id,class:e.typeClass(r)},[t("a",{attrs:{href:r.link}},[t("img",{attrs:{src:e.iconUrl(r)}}),t("span",{staticClass:"resource-name"},[e._v(e._s(r.name||""))])]),t("span",{staticClass:"icon-close",on:{click:function(t){return e.removeResource(e.collection,r)}}})])})),0):e._e()])],1)}),[],!1,null,"42733c12",null,null).exports,ne=function(e,t,r){var i,n,s,a,o,l,c=0,h=!1,u=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var r=i,s=n;return i=n=void 0,c=t,a=e.apply(s,r)}function f(e){var r=e-l;return void 0===l||r>=t||r<0||u&&e-c>=s}function A(){var e=R();if(f(e))return g(e);o=setTimeout(A,function(e){var r=t-(e-l);return u?W(r,s-(e-c)):r}(e))}function g(e){return o=void 0,d&&i?p(e):(i=n=void 0,a)}function m(){var e=R(),r=f(e);if(i=arguments,n=this,l=e,r){if(void 0===o)return function(e){return c=e,o=setTimeout(A,t),h?p(e):a}(l);if(u)return clearTimeout(o),o=setTimeout(A,t),p(l)}return void 0===o&&(o=setTimeout(A,t)),a}return t=q(t)||0,S(r)&&(h=!!r.leading,s=(u="maxWait"in r)?z(q(r.maxWait)||0,t):s,d="trailing"in r?!!r.trailing:d),m.cancel=function(){void 0!==o&&clearTimeout(o),c=0,i=l=n=o=void 0},m.flush=function(){return void 0===o?a:g(R())},m}((function(e,t){""!==e&&(t(!0),te.search(e).then((e=>{this.searchCollections=e})).catch((e=>{console.error("Failed to search for collections",e)})).finally((()=>{t(!1)})))}),500,{}),se={name:"CollectionList",components:{CollectionListItem:ie,NcAvatar:C.A,NcSelect:b.A},props:{type:{type:String,default:null},id:{type:String,default:null},name:{type:String,default:""},isActive:{type:Boolean,default:!0}},setup:()=>({state:J}),data:()=>({selectIsOpen:!1,generatingCodes:!1,codes:void 0,value:null,model:{},searchCollections:[],error:null,isSelectOpen:!1}),computed:{collections(){return this.state.collections.filter((e=>void 0!==e.resources.find((e=>e&&e.id===""+this.id&&e.type===this.type))))},placeholder(){return this.isSelectOpen?(0,w.t)("core","Type to search for existing projects"):(0,w.t)("core","Add to a project")},options(){const e=[];window.OCP.Collaboration.getTypes().sort().forEach((t=>{e.push({method:0,type:t,title:window.OCP.Collaboration.getLabel(t),class:window.OCP.Collaboration.getIcon(t),action:()=>window.OCP.Collaboration.trigger(t)})}));for(const t in this.searchCollections)-1===this.collections.findIndex((e=>e.id===this.searchCollections[t].id))&&e.push({method:1,title:this.searchCollections[t].name,collectionId:this.searchCollections[t].id});return e}},watch:{type(){this.isActive&&te.fetchCollectionsByResource({resourceType:this.type,resourceId:this.id})},id(){this.isActive&&te.fetchCollectionsByResource({resourceType:this.type,resourceId:this.id})},isActive(e){e&&te.fetchCollectionsByResource({resourceType:this.type,resourceId:this.id})}},mounted(){te.fetchCollectionsByResource({resourceType:this.type,resourceId:this.id})},methods:{t:w.t,select(e,t){0===e.method&&e.action().then((t=>{te.createCollection({baseResourceType:this.type,baseResourceId:this.id,resourceType:e.type,resourceId:t,name:this.name}).catch((e=>{this.setError((0,w.t)("core","Failed to create a project"),e)}))})).catch((e=>{console.error("No resource selected",e)})),1===e.method&&te.addResourceToCollection({collectionId:e.collectionId,resourceType:this.type,resourceId:this.id}).catch((e=>{this.setError((0,w.t)("core","Failed to add the item to the project"),e)}))},search(e,t){ne.bind(this)(e,t)},showSelect(){this.selectIsOpen=!0,this.$refs.select.$el.focus()},hideSelect(){this.selectIsOpen=!1},isVueComponent:e=>e._isVue,setError(e,t){console.error(e,t),this.error=e,setTimeout((()=>{this.error=null}),5e3)}}},ae=re(se,(function(){var e=this,t=e._self._c;return e.collections&&e.type&&e.id?t("ul",{staticClass:"collection-list",attrs:{id:"collection-list"}},[t("li",{on:{click:e.showSelect}},[e._m(0),t("div",{attrs:{id:"collection-select-container"}},[t("NcSelect",{ref:"select",attrs:{"aria-label-combobox":e.t("core","Add to a project"),options:e.options,placeholder:e.placeholder,label:"title",limit:5},on:{close:function(t){e.isSelectOpen=!1},open:function(t){e.isSelectOpen=!0},"option:selected":e.select,search:e.search},scopedSlots:e._u([{key:"selected-option",fn:function(r){return[t("span",{staticClass:"option__desc"},[t("span",{staticClass:"option__title"},[e._v(e._s(r.title))])])]}},{key:"option",fn:function(r){return[t("span",{staticClass:"option__wrapper"},[r.class?t("span",{staticClass:"avatar",class:r.class}):2!==r.method?t("NcAvatar",{attrs:{"allow-placeholder":"","display-name":r.title}}):e._e(),t("span",{staticClass:"option__title"},[e._v(e._s(r.title))])],1)]}}],null,!1,2397208459),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[t("p",{staticClass:"hint"},[e._v(" "+e._s(e.t("core","Connect items to a project to make them easier to find"))+" ")])])],1)]),t("transition",{attrs:{name:"fade"}},[e.error?t("li",{staticClass:"error"},[e._v(" "+e._s(e.error)+" ")]):e._e()]),e._l(e.collections,(function(e){return t("CollectionListItem",{key:e.id,attrs:{collection:e}})}))],2):e._e()}),[function(){var e=this._self._c;return e("div",{staticClass:"avatar"},[e("span",{staticClass:"icon-projects"})])}],!1,null,"8ebb2593",null,null).exports;var oe=i(19231),le=i(77905),ce=i(87485);class he{constructor(){(function(e,t,r){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})(this,"_capabilities",void 0),this._capabilities=(0,ce.F)()}get defaultPermissions(){return this._capabilities.files_sharing?.default_permissions}get isPublicUploadEnabled(){return!0===this._capabilities.files_sharing?.public?.upload}get federatedShareDocLink(){return window.OC.appConfig.core.federatedCloudShareDoc}get defaultExpirationDate(){return this.isDefaultExpireDateEnabled&&null!==this.defaultExpireDate?new Date((new Date).setDate((new Date).getDate()+this.defaultExpireDate)):null}get defaultInternalExpirationDate(){return this.isDefaultInternalExpireDateEnabled&&null!==this.defaultInternalExpireDate?new Date((new Date).setDate((new Date).getDate()+this.defaultInternalExpireDate)):null}get defaultRemoteExpirationDateString(){return this.isDefaultRemoteExpireDateEnabled&&null!==this.defaultRemoteExpireDate?new Date((new Date).setDate((new Date).getDate()+this.defaultRemoteExpireDate)):null}get enforcePasswordForPublicLink(){return!0===window.OC.appConfig.core.enforcePasswordForPublicLink}get enableLinkPasswordByDefault(){return!0===window.OC.appConfig.core.enableLinkPasswordByDefault}get isDefaultExpireDateEnforced(){return!0===window.OC.appConfig.core.defaultExpireDateEnforced}get isDefaultExpireDateEnabled(){return!0===window.OC.appConfig.core.defaultExpireDateEnabled}get isDefaultInternalExpireDateEnforced(){return!0===window.OC.appConfig.core.defaultInternalExpireDateEnforced}get isDefaultInternalExpireDateEnabled(){return!0===window.OC.appConfig.core.defaultInternalExpireDateEnabled}get isDefaultRemoteExpireDateEnforced(){return!0===window.OC.appConfig.core.defaultRemoteExpireDateEnforced}get isDefaultRemoteExpireDateEnabled(){return!0===window.OC.appConfig.core.defaultRemoteExpireDateEnabled}get isRemoteShareAllowed(){return!0===window.OC.appConfig.core.remoteShareAllowed}get isPublicShareAllowed(){return!0===this._capabilities?.files_sharing?.public?.enabled}get isMailShareAllowed(){return!0===this._capabilities?.files_sharing?.sharebymail?.enabled&&!0===this.isPublicShareAllowed}get defaultExpireDate(){return window.OC.appConfig.core.defaultExpireDate}get defaultInternalExpireDate(){return window.OC.appConfig.core.defaultInternalExpireDate}get defaultRemoteExpireDate(){return window.OC.appConfig.core.defaultRemoteExpireDate}get isResharingAllowed(){return!0===window.OC.appConfig.core.resharingAllowed}get isPasswordForMailSharesRequired(){return!0===this._capabilities.files_sharing?.sharebymail?.password?.enforced}get shouldAlwaysShowUnique(){return!0===this._capabilities.files_sharing?.sharee?.always_show_unique}get allowGroupSharing(){return!0===window.OC.appConfig.core.allowGroupSharing}get maxAutocompleteResults(){return parseInt(window.OC.config["sharing.maxAutocompleteResults"],10)||25}get minSearchStringLength(){return parseInt(window.OC.config["sharing.minSearchStringLength"],10)||0}get passwordPolicy(){return this._capabilities?.password_policy||{}}}var ue=i(35947);const de=(0,ue.YK)().setApp("files_sharing").detectUser().build();class pe{constructor(e){if(function(e,t,r){(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(this,"_share",void 0),e.ocs&&e.ocs.data&&e.ocs.data[0]&&(e=e.ocs.data[0]),e.hide_download=!!e.hide_download,e.mail_send=!!e.mail_send,e.attributes&&"string"==typeof e.attributes)try{e.attributes=JSON.parse(e.attributes)}catch(t){console.warn("Could not parse share attributes returned by server",e.attributes)}e.attributes=e.attributes??[],this._share=e}get state(){return this._share}get id(){return this._share.id}get type(){return this._share.share_type}get permissions(){return this._share.permissions}get attributes(){return this._share.attributes}set permissions(e){this._share.permissions=e}get owner(){return this._share.uid_owner}get ownerDisplayName(){return this._share.displayname_owner}get shareWith(){return this._share.share_with}get shareWithDisplayName(){return this._share.share_with_displayname||this._share.share_with}get shareWithDisplayNameUnique(){return this._share.share_with_displayname_unique||this._share.share_with}get shareWithLink(){return this._share.share_with_link}get shareWithAvatar(){return this._share.share_with_avatar}get uidFileOwner(){return this._share.uid_file_owner}get displaynameFileOwner(){return this._share.displayname_file_owner||this._share.uid_file_owner}get createdTime(){return this._share.stime}get expireDate(){return this._share.expiration}set expireDate(e){this._share.expiration=e}get token(){return this._share.token}get note(){return this._share.note}set note(e){this._share.note=e}get label(){return this._share.label??""}set label(e){this._share.label=e}get mailSend(){return!0===this._share.mail_send}get hideDownload(){return!0===this._share.hide_download}set hideDownload(e){this._share.hide_download=!0===e}get password(){return this._share.password}set password(e){this._share.password=e}get passwordExpirationTime(){return this._share.password_expiration_time}set passwordExpirationTime(e){this._share.password_expiration_time=e}get sendPasswordByTalk(){return this._share.send_password_by_talk}set sendPasswordByTalk(e){this._share.send_password_by_talk=e}get path(){return this._share.path}get itemType(){return this._share.item_type}get mimetype(){return this._share.mimetype}get fileSource(){return this._share.file_source}get fileTarget(){return this._share.file_target}get fileParent(){return this._share.file_parent}get hasReadPermission(){return!!(this.permissions&window.OC.PERMISSION_READ)}get hasCreatePermission(){return!!(this.permissions&window.OC.PERMISSION_CREATE)}get hasDeletePermission(){return!!(this.permissions&window.OC.PERMISSION_DELETE)}get hasUpdatePermission(){return!!(this.permissions&window.OC.PERMISSION_UPDATE)}get hasSharePermission(){return!!(this.permissions&window.OC.PERMISSION_SHARE)}get hasDownloadPermission(){return this.attributes.some((e=>"permissions"===e.scope&&"download"===e.key&&!1===e.value))}get isFileRequest(){return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"[]";const t=e=>"fileRequest"===e.scope&&"enabled"===e.key&&!0===e.value;try{return JSON.parse(e).some(t)}catch(e){return de.error("Error while parsing share attributes",{error:e}),!1}}(JSON.stringify(this.attributes))}set hasDownloadPermission(e){this.setAttribute("permissions","download",!!e)}setAttribute(e,t,r){const i={scope:e,key:t,value:r};for(const e in this._share.attributes){const t=this._share.attributes[e];if(t.scope===i.scope&&t.key===i.key)return void this._share.attributes.splice(e,1,i)}this._share.attributes.push(i)}get canEdit(){return!0===this._share.can_edit}get canDelete(){return!0===this._share.can_delete}get viaFileid(){return this._share.via_fileid}get viaPath(){return this._share.via_path}get parent(){return this._share.parent}get storageId(){return this._share.storage_id}get storage(){return this._share.storage}get itemSource(){return this._share.item_source}get status(){return this._share.status}}const fe={data:()=>({SHARE_TYPES:le.Z})};var Ae=i(85168),ge=i(85338),me=i(35111);const Ee={name:"SharingEntrySimple",components:{NcActions:G.A},props:{title:{type:String,default:"",required:!0},subtitle:{type:String,default:""},isUnique:{type:Boolean,default:!0},ariaExpanded:{type:Boolean,default:null}},computed:{ariaExpandedValue(){return null===this.ariaExpanded?this.ariaExpanded:this.ariaExpanded?"true":"false"}}};var ye=i(86495),ve={};ve.styleTagTransform=y(),ve.setAttributes=A(),ve.insert=p().bind(null,"head"),ve.domAPI=u(),ve.insertStyleElement=m(),c()(ye.A,ve),ye.A&&ye.A.locals&&ye.A.locals;var _e=i(14486);const we=(0,_e.A)(Ee,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[e._t("avatar"),e._v(" "),t("div",{staticClass:"sharing-entry__desc"},[t("span",{staticClass:"sharing-entry__title"},[e._v(e._s(e.title))]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t"+e._s(e.subtitle)+"\n\t\t")]):e._e()]),e._v(" "),e.$slots.default?t("NcActions",{ref:"actionsComponent",staticClass:"sharing-entry__actions",attrs:{"menu-align":"right","aria-expanded":e.ariaExpandedValue}},[e._t("default")],2):e._e()],2)}),[],!1,null,"4c49edf4",null).exports,Ce={name:"SharingEntryInternal",components:{NcActionButton:K.A,SharingEntrySimple:we,CheckIcon:ge.A,ClipboardIcon:me.A},props:{fileInfo:{type:Object,default:()=>{},required:!0}},data:()=>({copied:!1,copySuccess:!1}),computed:{internalLink(){return window.location.protocol+"//"+window.location.host+(0,o.Jv)("/f/")+this.fileInfo.id},copyLinkTooltip(){return this.copied?this.copySuccess?"":t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing","Copy internal link to clipboard")},internalLinkSubtitle(){return"dir"===this.fileInfo.type?t("files_sharing","Only works for people with access to this folder"):t("files_sharing","Only works for people with access to this file")}},methods:{async copyLink(){try{await navigator.clipboard.writeText(this.internalLink),(0,Ae.Te)(t("files_sharing","Link copied")),this.$refs.shareEntrySimple.$refs.actionsComponent.$el.focus(),this.copySuccess=!0,this.copied=!0}catch(e){this.copySuccess=!1,this.copied=!0,console.error(e)}finally{setTimeout((()=>{this.copySuccess=!1,this.copied=!1}),4e3)}}}};var be=i(23815),Se={};Se.styleTagTransform=y(),Se.setAttributes=A(),Se.insert=p().bind(null,"head"),Se.domAPI=u(),Se.insertStyleElement=m(),c()(be.A,Se),be.A&&be.A.locals&&be.A.locals;const xe=(0,_e.A)(Ce,(function(){var e=this,t=e._self._c;return t("ul",[t("SharingEntrySimple",{ref:"shareEntrySimple",staticClass:"sharing-entry__internal",attrs:{title:e.t("files_sharing","Internal link"),subtitle:e.internalLinkSubtitle},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("div",{staticClass:"avatar-external icon-external-white"})]},proxy:!0}])},[e._v(" "),t("NcActionButton",{attrs:{title:e.copyLinkTooltip,"aria-label":e.copyLinkTooltip},on:{click:e.copyLink},scopedSlots:e._u([{key:"icon",fn:function(){return[e.copied&&e.copySuccess?t("CheckIcon",{staticClass:"icon-checkmark-color",attrs:{size:20}}):t("ClipboardIcon",{attrs:{size:20}})]},proxy:!0}])})],1)],1)}),[],!1,null,"1d9a7cfa",null).exports;var Te=i(17334),Pe=i.n(Te),Re=(i(48318),i(61338));const Ie=(0,o.KT)("apps/files_sharing/api/v1/shares"),ke={methods:{async createShare(e){let{path:r,permissions:i,shareType:n,shareWith:s,publicUpload:a,password:o,sendPasswordByTalk:l,expireDate:c,label:h,note:u,attributes:d}=e;try{const e=await Q.Ay.post(Ie,{path:r,permissions:i,shareType:n,shareWith:s,publicUpload:a,password:o,sendPasswordByTalk:l,expireDate:c,label:h,note:u,attributes:d});if(!e?.data?.ocs)throw e;const t=new pe(e.data.ocs.data);return(0,Re.Ic)("files_sharing:share:created",{share:t}),t}catch(e){console.error("Error while creating share",e);const r=e?.response?.data?.ocs?.meta?.message;throw OC.Notification.showTemporary(r?t("files_sharing","Error creating the share: {errorMessage}",{errorMessage:r}):t("files_sharing","Error creating the share"),{type:"error"}),e}},async deleteShare(e){try{const t=await Q.Ay.delete(Ie+`/${e}`);if(!t?.data?.ocs)throw t;return(0,Re.Ic)("files_sharing:share:deleted",{id:e}),!0}catch(e){console.error("Error while deleting share",e);const r=e?.response?.data?.ocs?.meta?.message;throw OC.Notification.showTemporary(r?t("files_sharing","Error deleting the share: {errorMessage}",{errorMessage:r}):t("files_sharing","Error deleting the share"),{type:"error"}),e}},async updateShare(e,r){try{const t=await Q.Ay.put(Ie+`/${e}`,r);if((0,Re.Ic)("files_sharing:share:updated",{id:e}),t?.data?.ocs)return t.data.ocs.data;throw t}catch(e){if(console.error("Error while updating share",e),400!==e.response.status){const r=e?.response?.data?.ocs?.meta?.message;OC.Notification.showTemporary(r?t("files_sharing","Error updating the share: {errorMessage}",{errorMessage:r}):t("files_sharing","Error updating the share"),{type:"error"})}const r=e.response.data.ocs.meta.message;throw new Error(r)}}}},Ne={methods:{async openSharingDetails(e){let t={};if(e.handler){const r={};this.suggestions&&(r.suggestions=this.suggestions,r.fileInfo=this.fileInfo,r.query=this.query);const i=await e.handler(r);t=this.mapShareRequestToShareObject(i)}else t=this.mapShareRequestToShareObject(e);const r={fileInfo:this.fileInfo,share:t};this.$emit("open-sharing-details",r)},openShareDetailsForCustomSettings(e){e.setCustomPermissions=!0,this.openSharingDetails(e)},mapShareRequestToShareObject(e){if(e.id)return e;const t={attributes:[{value:!0,key:"download",scope:"permissions"}],share_type:e.shareType,share_with:e.shareWith,is_no_user:e.isNoUser,user:e.shareWith,share_with_displayname:e.displayName,subtitle:e.subtitle,permissions:e.permissions??(new he).defaultPermissions,expiration:""};return new pe(t)}}},De={name:"SharingInput",components:{NcSelect:b.A},mixins:[fe,ke,Ne],props:{shares:{type:Array,default:()=>[],required:!0},linkShares:{type:Array,default:()=>[],required:!0},fileInfo:{type:Object,default:()=>{},required:!0},reshare:{type:pe,default:null},canReshare:{type:Boolean,required:!0}},data:()=>({config:new he,loading:!1,query:"",recommendations:[],ShareSearch:OCA.Sharing.ShareSearch.state,suggestions:[],value:null}),computed:{externalResults(){return this.ShareSearch.results},inputPlaceholder(){const e=this.config.isRemoteShareAllowed;return this.canReshare?e?t("files_sharing","Name, email, or Federated Cloud ID …"):t("files_sharing","Name or email …"):t("files_sharing","Resharing is not allowed")},isValidQuery(){return this.query&&""!==this.query.trim()&&this.query.length>this.config.minSearchStringLength},options(){return this.isValidQuery?this.suggestions:this.recommendations},noResultText(){return this.loading?t("files_sharing","Searching …"):t("files_sharing","No elements found.")}},mounted(){this.getRecommendations()},methods:{onSelected(e){this.value=null,this.openSharingDetails(e)},async asyncFind(e){this.query=e.trim(),this.isValidQuery&&(this.loading=!0,await this.debounceGetSuggestions(e))},async getSuggestions(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.loading=!0,!0===(0,ce.F)().files_sharing.sharee.query_lookup_default&&(r=!0);const i=[this.SHARE_TYPES.SHARE_TYPE_USER,this.SHARE_TYPES.SHARE_TYPE_GROUP,this.SHARE_TYPES.SHARE_TYPE_REMOTE,this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP,this.SHARE_TYPES.SHARE_TYPE_CIRCLE,this.SHARE_TYPES.SHARE_TYPE_ROOM,this.SHARE_TYPES.SHARE_TYPE_GUEST,this.SHARE_TYPES.SHARE_TYPE_DECK,this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH];!0===(0,ce.F)().files_sharing.public.enabled&&i.push(this.SHARE_TYPES.SHARE_TYPE_EMAIL);let n=null;try{n=await Q.Ay.get((0,o.KT)("apps/files_sharing/api/v1/sharees"),{params:{format:"json",itemType:"dir"===this.fileInfo.type?"folder":"file",search:e,lookup:r,perPage:this.config.maxAutocompleteResults,shareType:i}})}catch(e){return void console.error("Error fetching suggestions",e)}const s=n.data.ocs.data,a=n.data.ocs.data.exact;s.exact=[];const l=Object.values(a).reduce(((e,t)=>e.concat(t)),[]),c=Object.values(s).reduce(((e,t)=>e.concat(t)),[]),h=this.filterOutExistingShares(l).map((e=>this.formatForMultiselect(e))).sort(((e,t)=>e.shareType-t.shareType)),u=this.filterOutExistingShares(c).map((e=>this.formatForMultiselect(e))).sort(((e,t)=>e.shareType-t.shareType)),d=[];s.lookupEnabled&&!r&&d.push({id:"global-lookup",isNoUser:!0,displayName:t("files_sharing","Search globally"),lookup:!0});const p=this.externalResults.filter((e=>!e.condition||e.condition(this))),f=h.concat(u).concat(p).concat(d),A=f.reduce(((e,t)=>t.displayName?(e[t.displayName]||(e[t.displayName]=0),e[t.displayName]++,e):e),{});this.suggestions=f.map((e=>A[e.displayName]>1&&!e.desc?{...e,desc:e.shareWithDisplayNameUnique}:e)),this.loading=!1,console.info("suggestions",this.suggestions)},debounceGetSuggestions:Pe()((function(){this.getSuggestions(...arguments)}),300),async getRecommendations(){this.loading=!0;let e=null;try{e=await Q.Ay.get((0,o.KT)("apps/files_sharing/api/v1/sharees_recommended"),{params:{format:"json",itemType:this.fileInfo.type}})}catch(e){return void console.error("Error fetching recommendations",e)}const t=this.externalResults.filter((e=>!e.condition||e.condition(this))),r=Object.values(e.data.ocs.data.exact).reduce(((e,t)=>e.concat(t)),[]);this.recommendations=this.filterOutExistingShares(r).map((e=>this.formatForMultiselect(e))).concat(t),this.loading=!1,console.info("recommendations",this.recommendations)},filterOutExistingShares(e){return e.reduce(((e,t)=>{if("object"!=typeof t)return e;try{if(t.value.shareType===this.SHARE_TYPES.SHARE_TYPE_USER){if(t.value.shareWith===(0,n.HW)().uid)return e;if(this.reshare&&t.value.shareWith===this.reshare.owner)return e}if(t.value.shareType===this.SHARE_TYPES.SHARE_TYPE_EMAIL){if(-1!==this.linkShares.map((e=>e.shareWith)).indexOf(t.value.shareWith.trim()))return e}else{const r=this.shares.reduce(((e,t)=>(e[t.shareWith]=t.type,e)),{}),i=t.value.shareWith.trim();if(i in r&&r[i]===t.value.shareType)return e}e.push(t)}catch{return e}return e}),[])},shareTypeToIcon(e){switch(e){case this.SHARE_TYPES.SHARE_TYPE_GUEST:return{icon:"icon-user",iconTitle:t("files_sharing","Guest")};case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:case this.SHARE_TYPES.SHARE_TYPE_GROUP:return{icon:"icon-group",iconTitle:t("files_sharing","Group")};case this.SHARE_TYPES.SHARE_TYPE_EMAIL:return{icon:"icon-mail",iconTitle:t("files_sharing","Email")};case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:return{icon:"icon-teams",iconTitle:t("files_sharing","Team")};case this.SHARE_TYPES.SHARE_TYPE_ROOM:return{icon:"icon-room",iconTitle:t("files_sharing","Talk conversation")};case this.SHARE_TYPES.SHARE_TYPE_DECK:return{icon:"icon-deck",iconTitle:t("files_sharing","Deck board")};case this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH:return{icon:"icon-sciencemesh",iconTitle:t("files_sharing","ScienceMesh")};default:return{}}},formatForMultiselect(e){let r;return r=e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_USER&&this.config.shouldAlwaysShowUnique?e.shareWithDisplayNameUnique??"":e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE&&e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP||!e.value.server?e.value.shareType===this.SHARE_TYPES.SHARE_TYPE_EMAIL?e.value.shareWith:e.shareWithDescription??"":t("files_sharing","on {server}",{server:e.value.server}),{shareWith:e.value.shareWith,shareType:e.value.shareType,user:e.uuid||e.value.shareWith,isNoUser:e.value.shareType!==this.SHARE_TYPES.SHARE_TYPE_USER,displayName:e.name||e.label,subname:r,shareWithDisplayNameUnique:e.shareWithDisplayNameUnique||"",...this.shareTypeToIcon(e.value.shareType)}}}};var Le=i(2134),Be={};Be.styleTagTransform=y(),Be.setAttributes=A(),Be.insert=p().bind(null,"head"),Be.domAPI=u(),Be.insertStyleElement=m(),c()(Le.A,Be),Le.A&&Le.A.locals&&Le.A.locals;const Oe=(0,_e.A)(De,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"sharing-search"},[t("label",{attrs:{for:"sharing-search-input"}},[e._v(e._s(e.t("files_sharing","Search for share recipients")))]),e._v(" "),t("NcSelect",{ref:"select",staticClass:"sharing-search__input",attrs:{"input-id":"sharing-search-input",disabled:!e.canReshare,loading:e.loading,filterable:!1,placeholder:e.inputPlaceholder,"clear-search-on-blur":()=>!1,"user-select":!0,options:e.options,"label-outside":!0},on:{search:e.asyncFind,"option:selected":e.onSelected},scopedSlots:e._u([{key:"no-options",fn:function(t){let{search:r}=t;return[e._v("\n\t\t\t"+e._s(r?e.noResultText:e.t("files_sharing","No recommendations. Start typing."))+"\n\t\t")]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})],1)}),[],!1,null,null,null).exports;var Me=i(71225),He=i(73267),Ue=i(32831);const Ye=(0,s.H4)();var $e=i(49264);const Fe={NONE:0,READ:1,UPDATE:2,CREATE:4,DELETE:8,SHARE:16},Ve={READ_ONLY:Fe.READ,UPLOAD_AND_UPDATE:Fe.READ|Fe.UPDATE|Fe.CREATE|Fe.DELETE,FILE_DROP:Fe.CREATE,ALL:Fe.UPDATE|Fe.CREATE|Fe.READ|Fe.DELETE|Fe.SHARE,ALL_FILE:Fe.UPDATE|Fe.READ|Fe.SHARE};const je={mixins:[ke,fe],props:{fileInfo:{type:Object,default:()=>{},required:!0},share:{type:pe,default:null},isUnique:{type:Boolean,default:!0}},data(){return{config:new he,node:null,errors:{},loading:!1,saving:!1,open:!1,updateQueue:new $e.A({concurrency:1}),reactiveState:this.share?.state}},computed:{path(){return(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/")},hasNote:{get(){return""!==this.share.note},set(e){this.share.note=e?null:""}},dateTomorrow:()=>new Date((new Date).setDate((new Date).getDate()+1)),lang(){const e=window.dayNamesShort?window.dayNamesShort:["Sun.","Mon.","Tue.","Wed.","Thu.","Fri.","Sat."],t=window.monthNamesShort?window.monthNamesShort:["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct.","Nov.","Dec."];return{formatLocale:{firstDayOfWeek:window.firstDay?window.firstDay:0,monthsShort:t,weekdaysMin:e,weekdaysShort:e},monthFormat:"MMM"}},isFolder(){return"dir"===this.fileInfo.type},isPublicShare(){const e=this.share.shareType??this.share.type;return[this.SHARE_TYPES.SHARE_TYPE_LINK,this.SHARE_TYPES.SHARE_TYPE_EMAIL].includes(e)},isRemoteShare(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP||this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE},isShareOwner(){return this.share&&this.share.owner===(0,n.HW)().uid},isExpiryDateEnforced(){return this.isPublicShare?this.config.isDefaultExpireDateEnforced:this.isRemoteShare?this.config.isDefaultRemoteExpireDateEnforced:this.config.isDefaultInternalExpireDateEnforced},hasCustomPermissions(){return![Ve.ALL,Ve.READ_ONLY,Ve.FILE_DROP].includes(this.share.permissions)},maxExpirationDateEnforced(){return this.isExpiryDateEnforced?this.isPublicShare?this.config.defaultExpirationDate:this.isRemoteShare?this.config.defaultRemoteExpirationDateString:this.config.defaultInternalExpirationDate:null}},methods:{async getNode(){const e={path:this.path};try{this.node=await(async e=>{const t=(0,s.VL)(),r=await Ye.stat(`${s.lJ}${e.path}`,{details:!0,data:t});return(0,s.Al)(r.data)})(e),de.info("Fetched node:",{node:this.node})}catch(e){de.error("Error:",e)}},checkShare:e=>(!e.password||"string"==typeof e.password&&""!==e.password.trim())&&!(e.expirationDate&&!e.expirationDate.isValid()),formatDateToString:e=>new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())).toISOString().split("T")[0],onExpirationChange:Pe()((function(e){this.share.expireDate=this.formatDateToString(new Date(e))}),500),onExpirationDisable(){this.share.expireDate=""},onNoteChange(e){this.$set(this.share,"newNote",e.trim())},onNoteSubmit(){this.share.newNote&&(this.share.note=this.share.newNote,this.$delete(this.share,"newNote"),this.queueUpdate("note"))},async onDelete(){try{this.loading=!0,this.open=!1,await this.deleteShare(this.share.id),console.debug("Share deleted",this.share.id);const e="file"===this.share.itemType?t("files_sharing",'File "{path}" has been unshared',{path:this.share.path}):t("files_sharing",'Folder "{path}" has been unshared',{path:this.share.path});(0,Ae.Te)(e),this.$emit("remove:share",this.share),await this.getNode(),(0,Re.Ic)("files:node:updated",this.node)}catch(e){this.open=!0}finally{this.loading=!1}},queueUpdate(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];if(0!==r.length){if(this.share.id){const e={};return r.forEach((t=>{"object"==typeof this.share[t]?e[t]=JSON.stringify(this.share[t]):e[t]=this.share[t].toString()})),void this.updateQueue.add((async()=>{this.saving=!0,this.errors={};try{const t=await this.updateShare(this.share.id,e);r.indexOf("password")>=0&&(this.$delete(this.share,"newPassword"),this.share.passwordExpirationTime=t.password_expiration_time),this.$delete(this.errors,r[0]),(0,Ae.Te)(this.updateSuccessMessage(r))}catch(e){de.error("Could not update share",{error:e,share:this.share,propertyNames:r});const{message:i}=e;i&&""!==i?(this.onSyncError(r[0],i),(0,Ae.Qg)(i)):(0,Ae.Qg)(t("files_sharing","Could not update share"))}finally{this.saving=!1}}))}console.debug("Updated local share",this.share)}},updateSuccessMessage(e){if(1!==e.length)return t("files_sharing","Share saved");switch(e[0]){case"expireDate":return t("files_sharing","Share expiry date saved");case"hideDownload":return t("files_sharing","Share hide-download state saved");case"label":return t("files_sharing","Share label saved");case"note":return t("files_sharing","Share note for recipient saved");case"password":return t("files_sharing","Share password saved");case"permissions":return t("files_sharing","Share permissions saved");default:return t("files_sharing","Share saved")}},onSyncError(e,t){switch(this.open=!0,e){case"password":case"pending":case"expireDate":case"label":case"note":{this.$set(this.errors,e,t);let r=this.$refs[e];if(r){r.$el&&(r=r.$el);const e=r.querySelector(".focusable");e&&e.focus()}break}case"sendPasswordByTalk":this.$set(this.errors,e,t),this.share.sendPasswordByTalk=!this.share.sendPasswordByTalk}},debounceQueueUpdate:Pe()((function(e){this.queueUpdate(e)}),500)}},qe={name:"SharingEntryInherited",components:{NcActionButton:K.A,NcActionLink:He.A,NcActionText:Ue.A,NcAvatar:C.A,SharingEntrySimple:we},mixins:[je],props:{share:{type:pe,required:!0}},computed:{viaFileTargetUrl(){return(0,o.Jv)("/f/{fileid}",{fileid:this.share.viaFileid})},viaFolderName(){return(0,Me.P8)(this.share.viaPath)}}};var ze=i(88346),We={};We.styleTagTransform=y(),We.setAttributes=A(),We.insert=p().bind(null,"head"),We.domAPI=u(),We.insertStyleElement=m(),c()(ze.A,We),ze.A&&ze.A.locals&&ze.A.locals;const Ge=(0,_e.A)(qe,(function(){var e=this,t=e._self._c;return t("SharingEntrySimple",{key:e.share.id,staticClass:"sharing-entry__inherited",attrs:{title:e.share.shareWithDisplayName},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.share.shareWith,"display-name":e.share.shareWithDisplayName}})]},proxy:!0}])},[e._v(" "),t("NcActionText",{attrs:{icon:"icon-user"}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Added by {initiator}",{initiator:e.share.ownerDisplayName}))+"\n\t")]),e._v(" "),e.share.viaPath&&e.share.viaFileid?t("NcActionLink",{attrs:{icon:"icon-folder",href:e.viaFileTargetUrl}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Via “{folder}”",{folder:e.viaFolderName}))+"\n\t")]):e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{icon:"icon-close"},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}}},[e._v("\n\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t")]):e._e()],1)}),[],!1,null,"32cb91ce",null).exports,Ke={name:"SharingInherited",components:{NcActionButton:K.A,SharingEntryInherited:Ge,SharingEntrySimple:we},props:{fileInfo:{type:Object,default:()=>{},required:!0}},data:()=>({loaded:!1,loading:!1,showInheritedShares:!1,shares:[]}),computed:{showInheritedSharesIcon(){return this.loading?"icon-loading-small":this.showInheritedShares?"icon-triangle-n":"icon-triangle-s"},mainTitle:()=>t("files_sharing","Others with access"),subTitle(){return this.showInheritedShares&&0===this.shares.length?t("files_sharing","No other accounts with access found"):""},toggleTooltip(){return"dir"===this.fileInfo.type?t("files_sharing","Toggle list of others with access to this directory"):t("files_sharing","Toggle list of others with access to this file")},fullPath(){return`${this.fileInfo.path}/${this.fileInfo.name}`.replace("//","/")}},watch:{fileInfo(){this.resetState()}},methods:{toggleInheritedShares(){this.showInheritedShares=!this.showInheritedShares,this.showInheritedShares?this.fetchInheritedShares():this.resetState()},async fetchInheritedShares(){this.loading=!0;try{const e=(0,o.KT)("apps/files_sharing/api/v1/shares/inherited?format=json&path={path}",{path:this.fullPath}),t=await Q.Ay.get(e);this.shares=t.data.ocs.data.map((e=>new pe(e))).sort(((e,t)=>t.createdTime-e.createdTime)),console.info(this.shares),this.loaded=!0}catch(e){OC.Notification.showTemporary(t("files_sharing","Unable to fetch inherited shares"),{type:"error"})}finally{this.loading=!1}},resetState(){this.loaded=!1,this.loading=!1,this.showInheritedShares=!1,this.shares=[]},removeShare(e){const t=this.shares.findIndex((t=>t===e));this.shares.splice(t,1)}}};var Xe=i(44377),Qe={};Qe.styleTagTransform=y(),Qe.setAttributes=A(),Qe.insert=p().bind(null,"head"),Qe.domAPI=u(),Qe.insertStyleElement=m(),c()(Xe.A,Qe),Xe.A&&Xe.A.locals&&Xe.A.locals;const Ze=(0,_e.A)(Ke,(function(){var e=this,t=e._self._c;return t("ul",{attrs:{id:"sharing-inherited-shares"}},[t("SharingEntrySimple",{staticClass:"sharing-entry__inherited",attrs:{title:e.mainTitle,subtitle:e.subTitle,"aria-expanded":e.showInheritedShares},scopedSlots:e._u([{key:"avatar",fn:function(){return[t("div",{staticClass:"avatar-shared icon-more-white"})]},proxy:!0}])},[e._v(" "),t("NcActionButton",{attrs:{icon:e.showInheritedSharesIcon,"aria-label":e.toggleTooltip,title:e.toggleTooltip},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.toggleInheritedShares.apply(null,arguments)}}})],1),e._v(" "),e._l(e.shares,(function(r){return t("SharingEntryInherited",{key:r.id,attrs:{"file-info":e.fileInfo,share:r},on:{"remove:share":e.removeShare}})}))],2)}),[],!1,null,"33849ae4",null).exports;var Je=i(17816),et=i.n(Je),tt=i(1790),rt=i(44131),it=i(80114),nt=i(94219);const st={name:"TuneIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},at=(0,_e.A)(st,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon tune-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M3,17V19H9V17H3M3,5V7H13V5H3M13,21V19H21V17H13V15H11V21H13M7,9V11H3V13H7V15H9V9H7M21,13V11H11V13H21M15,9H17V7H21V5H17V3H15V9Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,ot={name:"CalendarBlankIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},lt=(0,_e.A)(ot,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon calendar-blank-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,ct={name:"QrcodeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ht=(0,_e.A)(ct,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon qrcode-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M3,11H5V13H3V11M11,5H13V9H11V5M9,11H13V15H11V13H9V11M15,11H17V13H19V11H21V13H19V15H21V19H19V21H17V19H13V21H11V17H15V15H17V13H15V11M19,19V15H17V19H19M15,3H21V9H15V3M17,5V7H19V5H17M3,3H9V9H3V3M5,5V7H7V5H5M3,15H9V21H3V15M5,17V19H7V17H5Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,ut={name:"ExclamationIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},dt=(0,_e.A)(ut,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon exclamation-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M 11,4L 13,4L 13,15L 11,15L 11,4 Z M 13,18L 13,20L 11,20L 11,18L 13,18 Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,pt={name:"LockIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ft=(0,_e.A)(pt,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon lock-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M12,17A2,2 0 0,0 14,15C14,13.89 13.1,13 12,13A2,2 0 0,0 10,15A2,2 0 0,0 12,17M18,8A2,2 0 0,1 20,10V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V10C4,8.89 4.9,8 6,8H7V6A5,5 0 0,1 12,1A5,5 0 0,1 17,6V8H18M12,3A3,3 0 0,0 9,6V8H15V6A3,3 0 0,0 12,3Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,At={name:"CheckBoldIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},gt=(0,_e.A)(At,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon check-bold-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M9,20.42L2.79,14.21L5.62,11.38L9,14.77L18.88,4.88L21.71,7.71L9,20.42Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var mt=i(24325),Et=i(27577);const yt={name:"TriangleSmallDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},vt=(0,_e.A)(yt,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon triangle-small-down-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M8 9H16L12 16"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,_t={name:"EyeOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},wt=(0,_e.A)(_t,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon eye-outline-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var Ct=i(93919);const bt={name:"FileUploadIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},St=(0,_e.A)(bt,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon file-upload-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,xt={name:"SharingEntryQuickShareSelect",components:{DropdownIcon:vt,NcActions:G.A,NcActionButton:K.A},mixins:[je,Ne,fe],props:{share:{type:Object,required:!0}},emits:["open-sharing-details"],data:()=>({selectedOption:""}),computed:{ariaLabel(){return t("files_sharing",'Quick share options, the current selected is "{selectedOption}"',{selectedOption:this.selectedOption})},canViewText:()=>t("files_sharing","View only"),canEditText:()=>t("files_sharing","Can edit"),fileDropText:()=>t("files_sharing","File request"),customPermissionsText:()=>t("files_sharing","Custom permissions"),preSelectedOption(){return(this.share.permissions&~Fe.SHARE)===Ve.READ_ONLY?this.canViewText:this.share.permissions===Ve.ALL||this.share.permissions===Ve.ALL_FILE?this.canEditText:(this.share.permissions&~Fe.SHARE)===Ve.FILE_DROP?this.fileDropText:this.customPermissionsText},options(){const e=[{label:this.canViewText,icon:wt},{label:this.canEditText,icon:Ct.A}];return this.supportsFileDrop&&e.push({label:this.fileDropText,icon:St}),e.push({label:this.customPermissionsText,icon:at}),e},supportsFileDrop(){if(this.isFolder&&this.config.isPublicUploadEnabled){const e=this.share.type??this.share.shareType;return[this.SHARE_TYPES.SHARE_TYPE_LINK,this.SHARE_TYPES.SHARE_TYPE_EMAIL].includes(e)}return!1},dropDownPermissionValue(){switch(this.selectedOption){case this.canEditText:return this.isFolder?Ve.ALL:Ve.ALL_FILE;case this.fileDropText:return Ve.FILE_DROP;case this.customPermissionsText:return"custom";case this.canViewText:default:return Ve.READ_ONLY}}},created(){this.selectedOption=this.preSelectedOption},methods:{selectOption(e){this.selectedOption=e,e===this.customPermissionsText?this.$emit("open-sharing-details"):(this.share.permissions=this.dropDownPermissionValue,this.queueUpdate("permissions"),this.$refs.quickShareActions.$refs.menuButton.$el.focus())}}},Tt=xt;var Pt=i(88809),Rt={};Rt.styleTagTransform=y(),Rt.setAttributes=A(),Rt.insert=p().bind(null,"head"),Rt.domAPI=u(),Rt.insertStyleElement=m(),c()(Pt.A,Rt),Pt.A&&Pt.A.locals&&Pt.A.locals;const It=(0,_e.A)(Tt,(function(){var e=this,t=e._self._c;return t("NcActions",{ref:"quickShareActions",staticClass:"share-select",attrs:{"menu-name":e.selectedOption,"aria-label":e.ariaLabel,type:"tertiary-no-background","force-name":""},scopedSlots:e._u([{key:"icon",fn:function(){return[t("DropdownIcon",{attrs:{size:15}})]},proxy:!0}])},[e._v(" "),e._l(e.options,(function(r){return t("NcActionButton",{key:r.label,attrs:{type:"radio","model-value":r.label===e.selectedOption,"close-after-click":""},on:{click:function(t){return e.selectOption(r.label)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(r.icon,{tag:"component"})]},proxy:!0}],null,!0)},[e._v("\n\t\t"+e._s(r.label)+"\n\t")])}))],2)}),[],!1,null,"60eea424",null).exports,kt={name:"ExternalShareAction",props:{id:{type:String,required:!0},action:{type:Object,default:()=>({})},fileInfo:{type:Object,default:()=>{},required:!0},share:{type:pe,default:null}},computed:{data(){return this.action.data(this)}}},Nt=(0,_e.A)(kt,(function(){var e=this;return(0,e._self._c)(e.data.is,e._g(e._b({tag:"Component"},"Component",e.data,!1),e.action.handlers),[e._v("\n\t"+e._s(e.data.text)+"\n")])}),[],!1,null,null,null).exports,Dt=new he;async function Lt(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(Dt.passwordPolicy.api&&Dt.passwordPolicy.api.generate)try{const t=await Q.Ay.get(Dt.passwordPolicy.api.generate);if(t.data.ocs.data.password)return e&&(0,Ae.Te)((0,w.Tl)("files_sharing","Password created successfully")),t.data.ocs.data.password}catch(t){console.info("Error generating password from password_policy",t),e&&(0,Ae.Qg)((0,w.Tl)("files_sharing","Error generating password from password policy"))}const t=new Uint8Array(10),r=52/255;self.crypto.getRandomValues(t);let i="";for(let e=0;e<t.length;e++)i+="abcdefgijkmnopqrstwxyzABCDEFGHJKLMNPQRSTWXYZ23456789".charAt(t[e]*r);return i}const Bt={name:"SharingEntryLink",components:{ExternalShareAction:Nt,NcActions:G.A,NcActionButton:K.A,NcActionCheckbox:tt.A,NcActionInput:rt.A,NcActionLink:He.A,NcActionText:Ue.A,NcActionSeparator:it.A,NcAvatar:C.A,NcDialog:nt.A,VueQrcode:et(),Tune:at,IconCalendarBlank:lt,IconQr:ht,ErrorIcon:dt,LockIcon:ft,CheckIcon:gt,ClipboardIcon:me.A,CloseIcon:mt.A,PlusIcon:Et.A,SharingEntryQuickShareSelect:It},mixins:[je,Ne],props:{canReshare:{type:Boolean,default:!0},index:{type:Number,default:null}},data:()=>({shareCreationComplete:!1,copySuccess:!0,copied:!1,pending:!1,ExternalLegacyLinkActions:OCA.Sharing.ExternalLinkActions.state,ExternalShareActions:OCA.Sharing.ExternalShareActions.state,logger:(0,ue.YK)().setApp("files_sharing").detectUser().build(),showQRCode:!1}),computed:{title(){if(this.share&&this.share.id){if(!this.isShareOwner&&this.share.ownerDisplayName)return this.isEmailShareType?t("files_sharing","{shareWith} by {initiator}",{shareWith:this.share.shareWith,initiator:this.share.ownerDisplayName}):t("files_sharing","Shared via link by {initiator}",{initiator:this.share.ownerDisplayName});if(this.share.label&&""!==this.share.label.trim())return this.isEmailShareType?this.isFileRequest?t("files_sharing","File request ({label})",{label:this.share.label.trim()}):t("files_sharing","Mail share ({label})",{label:this.share.label.trim()}):t("files_sharing","Share link ({label})",{label:this.share.label.trim()});if(this.isEmailShareType)return this.share.shareWith&&""!==this.share.shareWith.trim()?this.share.shareWith:this.isFileRequest?t("files_sharing","File request"):t("files_sharing","Mail share")}return this.index>1?t("files_sharing","Share link ({index})",{index:this.index}):t("files_sharing","Share link")},subtitle(){return this.isEmailShareType&&this.title!==this.share.shareWith?this.share.shareWith:null},isPasswordProtected:{get(){return this.config.enforcePasswordForPublicLink||!!this.share.password},async set(e){X.Ay.set(this.share,"password",e?await Lt(!0):""),X.Ay.set(this.share,"newPassword",this.share.password)}},passwordExpirationTime(){if(null===this.share.passwordExpirationTime)return null;const e=(0,oe.A)(this.share.passwordExpirationTime);return!(e.diff((0,oe.A)())<0)&&e.fromNow()},isTalkEnabled:()=>void 0!==OC.appswebroots.spreed,isPasswordProtectedByTalkAvailable(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get(){return this.share.sendPasswordByTalk},async set(e){this.share.sendPasswordByTalk=e}},isEmailShareType(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},canTogglePasswordProtectedByTalkAvailable(){return!(!this.isPasswordProtected||this.isEmailShareType&&!this.hasUnsavedPassword)},pendingPassword(){return this.config.enableLinkPasswordByDefault&&this.share&&!this.share.id},pendingEnforcedPassword(){return this.config.enforcePasswordForPublicLink&&this.share&&!this.share.id},pendingExpirationDate(){return this.config.isDefaultExpireDateEnforced&&this.share&&!this.share.id},sharePolicyHasRequiredProperties(){return this.config.enforcePasswordForPublicLink||this.config.isDefaultExpireDateEnforced},requiredPropertiesMissing(){if(!this.sharePolicyHasRequiredProperties)return!1;if(!this.share)return!0;if(this.share.id)return!0;const e=this.config.enforcePasswordForPublicLink&&!this.share.password,t=this.config.isDefaultExpireDateEnforced&&!this.share.expireDate;return e||t},hasUnsavedPassword(){return void 0!==this.share.newPassword},shareLink(){return(0,o.Jv)("/s/{token}",{token:this.share.token},{baseURL:(0,o.$_)()})},actionsTooltip(){return t("files_sharing",'Actions for "{title}"',{title:this.title})},copyLinkTooltip(){return this.copied?this.copySuccess?"":t("files_sharing","Cannot copy, please copy the link manually"):t("files_sharing",'Copy public link of "{title}" to clipboard',{title:this.title})},externalLegacyLinkActions(){return this.ExternalLegacyLinkActions.actions},externalLinkActions(){return this.ExternalShareActions.actions.filter((e=>(e.shareType.includes(le.I.Link)||e.shareType.includes(le.I.Email))&&!e.advanced))},isPasswordPolicyEnabled(){return"object"==typeof this.config.passwordPolicy},canChangeHideDownload(){return this.fileInfo.shareAttributes.some((e=>"permissions"===e.scope&&"download"===e.key&&!1===e.value))},isFileRequest(){return this.share.isFileRequest}},methods:{async onNewLinkShare(){if(this.logger.debug("onNewLinkShare called (with this.share)",this.share),this.loading)return;const e={share_type:le.I.Link};if(this.config.isDefaultExpireDateEnforced&&(e.expiration=this.formatDateToString(this.config.defaultExpirationDate)),this.logger.debug("Missing required properties?",this.requiredPropertiesMissing),this.sharePolicyHasRequiredProperties&&this.requiredPropertiesMissing){this.pending=!0,this.shareCreationComplete=!1,this.logger.info("Share policy requires mandated properties (password)..."),(this.config.enableLinkPasswordByDefault||this.config.enforcePasswordForPublicLink)&&(e.password=await Lt(!0));const t=new pe(e),r=await new Promise((e=>{this.$emit("add:share",t,e)}));this.open=!1,this.pending=!1,r.open=!0}else{if(this.share&&!this.share.id){if(this.checkShare(this.share)){try{this.logger.info("Sending existing share to server",this.share),await this.pushNewLinkShare(this.share,!0),this.shareCreationComplete=!0,this.logger.info("Share created on server",this.share)}catch(e){return this.pending=!1,this.logger.error("Error creating share",e),!1}return!0}return this.open=!0,(0,Ae.Qg)(t("files_sharing","Error, please enter proper password and/or expiration date")),!1}const r=new pe(e);await this.pushNewLinkShare(r),this.shareCreationComplete=!0}},async pushNewLinkShare(e,r){try{if(this.loading)return!0;this.loading=!0,this.errors={};const i={path:(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/"),shareType:le.I.Link,password:e.password,expireDate:e.expireDate,attributes:JSON.stringify(this.fileInfo.shareAttributes)};console.debug("Creating link share with options",i);const n=await this.createShare(i);let s;this.open=!1,this.shareCreationComplete=!0,console.debug("Link share created",n),s=r?await new Promise((e=>{this.$emit("update:share",n,e)})):await new Promise((e=>{this.$emit("add:share",n,e)})),await this.getNode(),(0,Re.Ic)("files:node:updated",this.node),this.config.enforcePasswordForPublicLink||s.copyLink(),(0,Ae.Te)(t("files_sharing","Link share created"))}catch(e){const r=e?.response?.data?.ocs?.meta?.message;if(!r)return(0,Ae.Qg)(t("files_sharing","Error while creating the share")),void console.error(e);throw r.match(/password/i)?this.onSyncError("password",r):r.match(/date/i)?this.onSyncError("expireDate",r):this.onSyncError("pending",r),e}finally{this.loading=!1,this.shareCreationComplete=!0}},async copyLink(){try{await navigator.clipboard.writeText(this.shareLink),(0,Ae.Te)(t("files_sharing","Link copied")),this.$refs.copyButton.$el.focus(),this.copySuccess=!0,this.copied=!0}catch(e){this.copySuccess=!1,this.copied=!0,console.error(e)}finally{setTimeout((()=>{this.copySuccess=!1,this.copied=!1}),4e3)}},onPasswordChange(e){this.$set(this.share,"newPassword",e)},onPasswordDisable(){this.share.password="",this.$delete(this.share,"newPassword"),this.share.id&&this.queueUpdate("password")},onPasswordSubmit(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim(),this.queueUpdate("password"))},onPasswordProtectedByTalkChange(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim()),this.queueUpdate("sendPasswordByTalk","password")},onMenuClose(){this.onPasswordSubmit(),this.onNoteSubmit()},onCancel(){this.shareCreationComplete||this.$emit("remove:share",this.share)}}},Ot=Bt;var Mt=i(18658),Ht={};Ht.styleTagTransform=y(),Ht.setAttributes=A(),Ht.insert=p().bind(null,"head"),Ht.domAPI=u(),Ht.insertStyleElement=m(),c()(Mt.A,Ht),Mt.A&&Mt.A.locals&&Mt.A.locals;const Ut={name:"SharingLinkList",components:{SharingEntryLink:(0,_e.A)(Ot,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry sharing-entry__link",class:{"sharing-entry--share":e.share}},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":!0,"icon-class":e.isEmailShareType?"avatar-link-share icon-mail-white":"avatar-link-share icon-public-white"}}),e._v(" "),t("div",{staticClass:"sharing-entry__summary"},[t("div",{staticClass:"sharing-entry__desc"},[t("span",{staticClass:"sharing-entry__title",attrs:{title:e.title}},[e._v("\n\t\t\t\t"+e._s(e.title)+"\n\t\t\t")]),e._v(" "),e.subtitle?t("p",[e._v("\n\t\t\t\t"+e._s(e.subtitle)+"\n\t\t\t")]):e._e(),e._v(" "),e.share&&void 0!==e.share.permissions?t("SharingEntryQuickShareSelect",{attrs:{share:e.share,"file-info":e.fileInfo},on:{"open-sharing-details":function(t){return e.openShareDetailsForCustomSettings(e.share)}}}):e._e()],1),e._v(" "),e.share&&(!e.isEmailShareType||e.isFileRequest)&&e.share.token?t("NcActions",{ref:"copyButton",staticClass:"sharing-entry__copy"},[t("NcActionButton",{attrs:{"aria-label":e.copyLinkTooltip,title:e.copyLinkTooltip,href:e.shareLink},on:{click:function(t){return t.preventDefault(),e.copyLink.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[e.copied&&e.copySuccess?t("CheckIcon",{staticClass:"icon-checkmark-color",attrs:{size:20}}):t("ClipboardIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,4269614823)})],1):e._e()],1),e._v(" "),!e.pending&&(e.pendingPassword||e.pendingEnforcedPassword||e.pendingExpirationDate)?t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"aria-label":e.actionsTooltip,"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onCancel}},[e.errors.pending?t("NcActionText",{staticClass:"error",scopedSlots:e._u([{key:"icon",fn:function(){return[t("ErrorIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,1966124155)},[e._v("\n\t\t\t"+e._s(e.errors.pending)+"\n\t\t")]):t("NcActionText",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Please enter the following required information before creating the share"))+"\n\t\t")]),e._v(" "),e.pendingPassword?t("NcActionCheckbox",{staticClass:"share-link-password-checkbox",attrs:{checked:e.isPasswordProtected,disabled:e.config.enforcePasswordForPublicLink||e.saving},on:{"update:checked":function(t){e.isPasswordProtected=t},uncheck:e.onPasswordDisable}},[e._v("\n\t\t\t"+e._s(e.config.enforcePasswordForPublicLink?e.t("files_sharing","Password protection (enforced)"):e.t("files_sharing","Password protection"))+"\n\t\t")]):e._e(),e._v(" "),e.pendingEnforcedPassword||e.share.password?t("NcActionInput",{staticClass:"share-link-password",attrs:{label:e.t("files_sharing","Enter a password"),value:e.share.password,disabled:e.saving,required:e.config.enableLinkPasswordByDefault||e.config.enforcePasswordForPublicLink,minlength:e.isPasswordPolicyEnabled&&e.config.passwordPolicy.minLength,autocomplete:"new-password"},on:{"update:value":function(t){return e.$set(e.share,"password",t)},submit:e.onNewLinkShare},scopedSlots:e._u([{key:"icon",fn:function(){return[t("LockIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,2056568168)}):e._e(),e._v(" "),e.pendingExpirationDate?t("NcActionInput",{staticClass:"share-link-expire-date",attrs:{label:e.t("files_sharing","Expiration date (enforced)"),disabled:e.saving,"is-native-picker":!0,"hide-label":!0,value:new Date(e.share.expireDate),type:"date",min:e.dateTomorrow,max:e.maxExpirationDateEnforced},on:{input:function(t){e.onExpirationChange}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconCalendarBlank",{attrs:{size:20}})]},proxy:!0}],null,!1,3418578971)}):e._e(),e._v(" "),t("NcActionButton",{on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("CheckIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,2630571749)},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Create share"))+"\n\t\t")]),e._v(" "),t("NcActionButton",{on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onCancel.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("CloseIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,2428343285)},[e._v("\n\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t")])],1):e.loading?t("div",{staticClass:"icon-loading-small sharing-entry__loading"}):t("NcActions",{staticClass:"sharing-entry__actions",attrs:{"aria-label":e.actionsTooltip,"menu-align":"right",open:e.open},on:{"update:open":function(t){e.open=t},close:e.onMenuClose}},[e.share?[e.share.canEdit&&e.canReshare?[t("NcActionButton",{attrs:{disabled:e.saving,"close-after-click":!0},on:{click:function(t){return t.preventDefault(),e.openSharingDetails.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("Tune",{attrs:{size:20}})]},proxy:!0}],null,!1,1300586850)},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Customize link"))+"\n\t\t\t\t")])]:e._e(),e._v(" "),t("NcActionButton",{attrs:{"close-after-click":!0},on:{click:function(t){t.preventDefault(),e.showQRCode=!0}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("IconQr",{attrs:{size:20}})]},proxy:!0}],null,!1,1082198240)},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Generate QR code"))+"\n\t\t\t")]),e._v(" "),t("NcActionSeparator"),e._v(" "),e._l(e.externalLinkActions,(function(r){return t("ExternalShareAction",{key:r.id,attrs:{id:r.id,action:r,"file-info":e.fileInfo,share:e.share}})})),e._v(" "),e._l(e.externalLegacyLinkActions,(function(r,i){let{icon:n,url:s,name:a}=r;return t("NcActionLink",{key:i,attrs:{href:s(e.shareLink),icon:n,target:"_blank"}},[e._v("\n\t\t\t\t"+e._s(a)+"\n\t\t\t")])})),e._v(" "),!e.isEmailShareType&&e.canReshare?t("NcActionButton",{staticClass:"new-share-link",on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("PlusIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,2953566425)},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Add another link"))+"\n\t\t\t")]):e._e(),e._v(" "),e.share.canDelete?t("NcActionButton",{attrs:{disabled:e.saving},on:{click:function(t){return t.preventDefault(),e.onDelete.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("CloseIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,2428343285)},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Unshare"))+"\n\t\t\t")]):e._e()]:e.canReshare?t("NcActionButton",{staticClass:"new-share-link",attrs:{title:e.t("files_sharing","Create a new share link"),"aria-label":e.t("files_sharing","Create a new share link"),icon:e.loading?"icon-loading-small":"icon-add"},on:{click:function(t){return t.preventDefault(),t.stopPropagation(),e.onNewLinkShare.apply(null,arguments)}}}):e._e()],2),e._v(" "),e.showQRCode?t("NcDialog",{attrs:{size:"normal",open:e.showQRCode,name:e.title,"close-on-click-outside":!0},on:{"update:open":function(t){e.showQRCode=t},close:function(t){e.showQRCode=!1}}},[t("div",{staticClass:"qr-code-dialog"},[t("VueQrcode",{staticClass:"qr-code-dialog__img",attrs:{tag:"img",value:e.shareLink}})],1)]):e._e()],1)}),[],!1,null,"a1337124",null).exports},mixins:[fe,Ne],props:{fileInfo:{type:Object,default:()=>{},required:!0},shares:{type:Array,default:()=>[],required:!0},canReshare:{type:Boolean,required:!0}},data:()=>({canLinkShare:(0,ce.F)().files_sharing.public.enabled}),computed:{hasLinkShares(){return this.shares.filter((e=>e.type===this.SHARE_TYPES.SHARE_TYPE_LINK)).length>0},hasShares(){return this.shares.length>0}},methods:{t:w.t,addShare(e,t){this.shares.unshift(e),this.awaitForShare(e,t)},awaitForShare(e,t){this.$nextTick((()=>{const r=this.$children.find((t=>t.share===e));r&&t(r)}))},removeShare(e){const t=this.shares.findIndex((t=>t===e));this.shares.splice(t,1)}}},Yt=(0,_e.A)(Ut,(function(){var e=this,t=e._self._c;return e.canLinkShare?t("ul",{staticClass:"sharing-link-list",attrs:{"aria-label":e.t("files_sharing","Link shares")}},[!e.hasLinkShares&&e.canReshare?t("SharingEntryLink",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo},on:{"add:share":e.addShare}}):e._e(),e._v(" "),e.hasShares?e._l(e.shares,(function(r,i){return t("SharingEntryLink",{key:r.id,attrs:{index:e.shares.length>1?i+1:null,"can-reshare":e.canReshare,share:e.shares[i],"file-info":e.fileInfo},on:{"update:share":[function(t){return e.$set(e.shares,i,t)},function(t){return e.awaitForShare(...arguments)}],"add:share":function(t){return e.addShare(...arguments)},"remove:share":e.removeShare,"open-sharing-details":function(t){return e.openSharingDetails(r)}}})})):e._e()],2):e._e()}),[],!1,null,null,null).exports;var $t=i(18740),Ft=i(35559);const Vt={name:"SharingEntry",components:{NcButton:$t.A,NcAvatar:C.A,DotsHorizontalIcon:Ft.A,NcSelect:b.A,SharingEntryQuickShareSelect:It},mixins:[je,Ne],computed:{title(){let e=this.share.shareWithDisplayName;return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?e+=` (${t("files_sharing","group")})`:this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?e+=` (${t("files_sharing","conversation")})`:this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE?e+=` (${t("files_sharing","remote")})`:this.share.type===this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP?e+=` (${t("files_sharing","remote group")})`:this.share.type===this.SHARE_TYPES.SHARE_TYPE_GUEST&&(e+=` (${t("files_sharing","guest")})`),e},tooltip(){if(this.share.owner!==this.share.uidFileOwner){const e={user:this.share.shareWithDisplayName,owner:this.share.ownerDisplayName};return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP?t("files_sharing","Shared with the group {user} by {owner}",e):this.share.type===this.SHARE_TYPES.SHARE_TYPE_ROOM?t("files_sharing","Shared with the conversation {user} by {owner}",e):t("files_sharing","Shared with {user} by {owner}",e)}return null},hasStatus(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER&&"object"==typeof this.share.status&&!Array.isArray(this.share.status)}},methods:{onMenuClose(){this.onNoteSubmit()}}};var jt=i(1709),qt={};qt.styleTagTransform=y(),qt.setAttributes=A(),qt.insert=p().bind(null,"head"),qt.domAPI=u(),qt.insertStyleElement=m(),c()(jt.A,qt),jt.A&&jt.A.locals&&jt.A.locals;const zt={name:"SharingList",components:{SharingEntry:(0,_e.A)(Vt,(function(){var e=this,t=e._self._c;return t("li",{staticClass:"sharing-entry"},[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":e.share.type!==e.SHARE_TYPES.SHARE_TYPE_USER,user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"menu-position":"left",url:e.share.shareWithAvatar}}),e._v(" "),t("div",{staticClass:"sharing-entry__summary"},[t(e.share.shareWithLink?"a":"div",{tag:"component",staticClass:"sharing-entry__summary__desc",attrs:{title:e.tooltip,"aria-label":e.tooltip,href:e.share.shareWithLink}},[t("span",[e._v(e._s(e.title)+"\n\t\t\t\t"),e.isUnique?e._e():t("span",{staticClass:"sharing-entry__summary__desc-unique"},[e._v(" ("+e._s(e.share.shareWithDisplayNameUnique)+")")]),e._v(" "),e.hasStatus&&e.share.status.message?t("small",[e._v("("+e._s(e.share.status.message)+")")]):e._e()])]),e._v(" "),t("SharingEntryQuickShareSelect",{attrs:{share:e.share,"file-info":e.fileInfo},on:{"open-sharing-details":function(t){return e.openShareDetailsForCustomSettings(e.share)}}})],1),e._v(" "),t("NcButton",{staticClass:"sharing-entry__action",attrs:{"data-cy-files-sharing-share-actions":"","aria-label":e.t("files_sharing","Open Sharing Details"),type:"tertiary"},on:{click:function(t){return e.openSharingDetails(e.share)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("DotsHorizontalIcon",{attrs:{size:20}})]},proxy:!0}])})],1)}),[],!1,null,"fd4f3ea8",null).exports},mixins:[fe,Ne],props:{fileInfo:{type:Object,default:()=>{},required:!0},shares:{type:Array,default:()=>[],required:!0}},setup:()=>({t:w.t}),computed:{hasShares(){return 0===this.shares.length},isUnique(){return e=>[...this.shares].filter((t=>e.type===this.SHARE_TYPES.SHARE_TYPE_USER&&e.shareWithDisplayName===t.shareWithDisplayName)).length<=1}}},Wt=(0,_e.A)(zt,(function(){var e=this,t=e._self._c;return t("ul",{staticClass:"sharing-sharee-list",attrs:{"aria-label":e.t("files_sharing","Shares")}},e._l(e.shares,(function(r){return t("SharingEntry",{key:r.id,attrs:{"file-info":e.fileInfo,share:r,"is-unique":e.isUnique(r)},on:{"open-sharing-details":function(t){return e.openSharingDetails(r)}}})})),1)}),[],!1,null,null,null).exports;var Gt=i(32073),Kt=i(31126),Xt=i(63407),Qt=i(84237),Zt=i(16044),Jt=i(42740);const er={name:"CircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},tr=(0,_e.A)(er,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon circle-outline-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,rr={name:"EmailIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ir=(0,_e.A)(rr,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon email-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M20,8L12,13L4,8V6L12,11L20,6M20,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V6C22,4.89 21.1,4 20,4Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var nr=i(89979),sr=i(72755);const ar={name:"ShareCircleIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},or=(0,_e.A)(ar,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon share-circle-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M14 16V13C10.39 13 7.81 14.43 6 17C6.72 13.33 8.94 9.73 14 9V6L19 11L14 16Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,lr={name:"AccountCircleOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},cr=(0,_e.A)(lr,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon account-circle-outline-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7.07,18.28C7.5,17.38 10.12,16.5 12,16.5C13.88,16.5 16.5,17.38 16.93,18.28C15.57,19.36 13.86,20 12,20C10.14,20 8.43,19.36 7.07,18.28M18.36,16.83C16.93,15.09 13.46,14.5 12,14.5C10.54,14.5 7.07,15.09 5.64,16.83C4.62,15.5 4,13.82 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,13.82 19.38,15.5 18.36,16.83M12,6C10.06,6 8.5,7.56 8.5,9.5C8.5,11.44 10.06,13 12,13C13.94,13 15.5,11.44 15.5,9.5C15.5,7.56 13.94,6 12,6M12,11A1.5,1.5 0 0,1 10.5,9.5A1.5,1.5 0 0,1 12,8A1.5,1.5 0 0,1 13.5,9.5A1.5,1.5 0 0,1 12,11Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports,hr={name:"EyeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},ur=(0,_e.A)(hr,(function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon eye-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])}),[],!1,null,null,null).exports;var dr=i(45821),pr=i(1795),fr=i(33017);const Ar={name:"SharingDetailsTab",components:{NcAvatar:C.A,NcButton:$t.A,NcCheckboxRadioSwitch:Gt.A,NcDateTimePickerNative:Kt.A,NcInputField:Xt.A,NcLoadingIcon:Qt.A,NcPasswordField:Zt.A,NcTextArea:Jt.A,CloseIcon:mt.A,CircleIcon:tr,EditIcon:Ct.A,ExternalShareAction:Nt,LinkIcon:nr.A,GroupIcon:sr.A,ShareIcon:or,UserIcon:cr,UploadIcon:dr.A,ViewIcon:ur,MenuDownIcon:pr.A,MenuUpIcon:fr.A,DotsHorizontalIcon:Ft.A},mixins:[fe,ke,je],props:{shareRequestValue:{type:Object,required:!1},fileInfo:{type:Object,required:!0},share:{type:Object,required:!0}},data:()=>({writeNoteToRecipientIsChecked:!1,sharingPermission:Ve.ALL.toString(),revertSharingPermission:Ve.ALL.toString(),setCustomPermissions:!1,passwordError:!1,advancedSectionAccordionExpanded:!1,bundledPermissions:Ve,isFirstComponentLoad:!0,test:!1,creating:!1,ExternalShareActions:OCA.Sharing.ExternalShareActions.state}),computed:{title(){switch(this.share.type){case this.SHARE_TYPES.SHARE_TYPE_USER:return t("files_sharing","Share with {userName}",{userName:this.share.shareWithDisplayName});case this.SHARE_TYPES.SHARE_TYPE_EMAIL:return t("files_sharing","Share with email {email}",{email:this.share.shareWith});case this.SHARE_TYPES.SHARE_TYPE_LINK:return t("files_sharing","Share link");case this.SHARE_TYPES.SHARE_TYPE_GROUP:return t("files_sharing","Share with group");case this.SHARE_TYPES.SHARE_TYPE_ROOM:return t("files_sharing","Share in conversation");case this.SHARE_TYPES.SHARE_TYPE_REMOTE:{const[e,r]=this.share.shareWith.split("@");return t("files_sharing","Share with {user} on remote server {server}",{user:e,server:r})}case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:return t("files_sharing","Share with remote group");case this.SHARE_TYPES.SHARE_TYPE_GUEST:return t("files_sharing","Share with guest");default:return this.share.id?t("files_sharing","Update share"):t("files_sharing","Create share")}},canEdit:{get(){return this.share.hasUpdatePermission},set(e){this.updateAtomicPermissions({isEditChecked:e})}},canCreate:{get(){return this.share.hasCreatePermission},set(e){this.updateAtomicPermissions({isCreateChecked:e})}},canDelete:{get(){return this.share.hasDeletePermission},set(e){this.updateAtomicPermissions({isDeleteChecked:e})}},canReshare:{get(){return this.share.hasSharePermission},set(e){this.updateAtomicPermissions({isReshareChecked:e})}},canDownload:{get(){return this.share.attributes?.find((e=>"download"===e.key))?.value??!0},set(e){const t=this.share.attributes?.find((e=>"download"===e.key));t?t.value=e:(null===this.share.attributes&&this.$set(this.share,"attributes",[]),this.share.attributes.push({scope:"permissions",key:"download",value:e}))}},hasRead:{get(){return this.share.hasReadPermission},set(e){this.updateAtomicPermissions({isReadChecked:e})}},hasExpirationDate:{get(){return this.isValidShareAttribute(this.share.expireDate)},set(e){this.share.expireDate=e?this.formatDateToString(this.defaultExpiryDate):""}},isPasswordProtected:{get(){return this.config.enforcePasswordForPublicLink||!!this.share.password},async set(e){e?(this.share.password=await Lt(!0),this.$set(this.share,"newPassword",this.share.password)):(this.share.password="",this.$delete(this.share,"newPassword"))}},isFolder(){return"dir"===this.fileInfo.type},isSetDownloadButtonVisible(){return this.isFolder||["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation"].includes(this.fileInfo.mimetype)},isPasswordEnforced(){return this.isPublicShare&&this.config.enforcePasswordForPublicLink},defaultExpiryDate(){return(this.isGroupShare||this.isUserShare)&&this.config.isDefaultInternalExpireDateEnabled?new Date(this.config.defaultInternalExpirationDate):this.isRemoteShare&&this.config.isDefaultRemoteExpireDateEnabled?new Date(this.config.defaultRemoteExpireDateEnabled):this.isPublicShare&&this.config.isDefaultExpireDateEnabled?new Date(this.config.defaultExpirationDate):new Date((new Date).setDate((new Date).getDate()+1))},isUserShare(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_USER},isGroupShare(){return this.share.type===this.SHARE_TYPES.SHARE_TYPE_GROUP},isNewShare(){return!this.share.id},allowsFileDrop(){return!(!this.isFolder||!this.config.isPublicUploadEnabled||this.share.type!==this.SHARE_TYPES.SHARE_TYPE_LINK&&this.share.type!==this.SHARE_TYPES.SHARE_TYPE_EMAIL)},hasFileDropPermissions(){return this.share.permissions===this.bundledPermissions.FILE_DROP},shareButtonText(){return this.isNewShare?t("files_sharing","Save share"):t("files_sharing","Update share")},canSetEdit(){return this.fileInfo.sharePermissions&OC.PERMISSION_UPDATE||this.canEdit},canSetCreate(){return this.fileInfo.sharePermissions&OC.PERMISSION_CREATE||this.canCreate},canSetDelete(){return this.fileInfo.sharePermissions&OC.PERMISSION_DELETE||this.canDelete},canSetReshare(){return this.fileInfo.sharePermissions&OC.PERMISSION_SHARE||this.canReshare},canSetDownload(){return this.fileInfo.canDownload()||this.canDownload},canRemoveReadPermission(){return this.allowsFileDrop&&(this.share.type===this.SHARE_TYPES.SHARE_TYPE_LINK||this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL)},hasUnsavedPassword(){return void 0!==this.share.newPassword},passwordExpirationTime(){if(!this.isValidShareAttribute(this.share.passwordExpirationTime))return null;const e=(0,oe.A)(this.share.passwordExpirationTime);return!(e.diff((0,oe.A)())<0)&&e.fromNow()},isTalkEnabled:()=>void 0!==OC.appswebroots.spreed,isPasswordProtectedByTalkAvailable(){return this.isPasswordProtected&&this.isTalkEnabled},isPasswordProtectedByTalk:{get(){return this.share.sendPasswordByTalk},async set(e){this.share.sendPasswordByTalk=e}},isEmailShareType(){return!!this.share&&this.share.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL},canTogglePasswordProtectedByTalkAvailable(){return!(!this.isPublicShare||!this.isPasswordProtected||this.isEmailShareType&&!this.hasUnsavedPassword||void 0===OC.appswebroots.spreed)},canChangeHideDownload(){return this.fileInfo.shareAttributes.some((e=>"download"===e.key&&"permissions"===e.scope&&!1===e.value))},customPermissionsList(){const e={[Fe.READ]:this.t("files_sharing","Read"),[Fe.CREATE]:this.t("files_sharing","Create"),[Fe.UPDATE]:this.t("files_sharing","Edit"),[Fe.SHARE]:this.t("files_sharing","Share"),[Fe.DELETE]:this.t("files_sharing","Delete")};return[Fe.READ,Fe.CREATE,Fe.UPDATE,Fe.SHARE,Fe.DELETE].filter((e=>{return t=this.share.permissions,r=e,t!==Fe.NONE&&(t&r)===r;var t,r})).map(((t,r)=>0===r?e[t]:e[t].toLocaleLowerCase((0,w.Z0)()))).join(", ")},advancedControlExpandedValue(){return this.advancedSectionAccordionExpanded?"true":"false"},errorPasswordLabel(){if(this.passwordError)return t("files_sharing","Password field can't be empty")},externalLinkActions(){return this.ExternalShareActions.actions.filter((e=>(e.shareType.includes(le.I.Link)||e.shareType.includes(le.I.Email))&&e.advanced))}},watch:{setCustomPermissions(e){this.sharingPermission=e?"custom":this.revertSharingPermission}},beforeMount(){this.initializePermissions(),this.initializeAttributes(),de.debug("Share object received",{share:this.share}),de.debug("Configuration object received",{config:this.config})},mounted(){this.$refs.quickPermissions?.querySelector("input:checked")?.focus()},methods:{updateAtomicPermissions(){let{isReadChecked:e=this.hasRead,isEditChecked:t=this.canEdit,isCreateChecked:r=this.canCreate,isDeleteChecked:i=this.canDelete,isReshareChecked:n=this.canReshare}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s=(e?Fe.READ:0)|(r?Fe.CREATE:0)|(i?Fe.DELETE:0)|(t?Fe.UPDATE:0)|(n?Fe.SHARE:0);this.share.permissions=s},expandCustomPermissions(){this.advancedSectionAccordionExpanded||(this.advancedSectionAccordionExpanded=!0),this.toggleCustomPermissions()},toggleCustomPermissions(e){const t="custom"===this.sharingPermission;this.revertSharingPermission=t?"custom":e,this.setCustomPermissions=t},async initializeAttributes(){if(this.isNewShare)return this.isPasswordEnforced&&this.isPublicShare&&(this.$set(this.share,"newPassword",await Lt(!0)),this.advancedSectionAccordionExpanded=!0),this.isPublicShare&&this.config.isDefaultExpireDateEnabled?this.share.expireDate=this.config.defaultExpirationDate.toDateString():this.isRemoteShare&&this.config.isDefaultRemoteExpireDateEnabled?this.share.expireDate=this.config.defaultRemoteExpirationDateString.toDateString():this.config.isDefaultInternalExpireDateEnabled&&(this.share.expireDate=this.config.defaultInternalExpirationDate.toDateString()),void(this.isValidShareAttribute(this.share.expireDate)&&(this.advancedSectionAccordionExpanded=!0));!this.isValidShareAttribute(this.share.expireDate)&&this.isExpiryDateEnforced&&(this.hasExpirationDate=!0),(this.isValidShareAttribute(this.share.password)||this.isValidShareAttribute(this.share.expireDate)||this.isValidShareAttribute(this.share.label))&&(this.advancedSectionAccordionExpanded=!0),this.share.note&&(this.writeNoteToRecipientIsChecked=!0)},handleShareType(){"shareType"in this.share?this.share.type=this.share.shareType:this.share.share_type&&(this.share.type=this.share.share_type)},handleDefaultPermissions(){if(this.isNewShare){const e=this.config.defaultPermissions;e===Ve.READ_ONLY||e===Ve.ALL?this.sharingPermission=e.toString():(this.sharingPermission="custom",this.share.permissions=e,this.advancedSectionAccordionExpanded=!0,this.setCustomPermissions=!0)}this.canRemoveReadPermission||(this.hasRead=!0)},handleCustomPermissions(){this.isNewShare||!this.hasCustomPermissions&&!this.share.setCustomPermissions?this.share.permissions&&(this.sharingPermission=this.share.permissions.toString()):(this.sharingPermission="custom",this.advancedSectionAccordionExpanded=!0,this.setCustomPermissions=!0)},initializePermissions(){this.handleShareType(),this.handleDefaultPermissions(),this.handleCustomPermissions()},async saveShare(){const e=["permissions","attributes","note","expireDate"];this.isPublicShare&&e.push("label","password","hideDownload");const t=parseInt(this.sharingPermission);if(this.setCustomPermissions?this.updateAtomicPermissions():this.share.permissions=t,this.isFolder||this.share.permissions!==Ve.ALL||(this.share.permissions=Ve.ALL_FILE),this.writeNoteToRecipientIsChecked||(this.share.note=""),this.isPasswordProtected?this.hasUnsavedPassword&&this.isValidShareAttribute(this.share.newPassword)?(this.share.password=this.share.newPassword,this.$delete(this.share,"newPassword")):this.isPasswordEnforced&&!this.isValidShareAttribute(this.share.password)&&(this.passwordError=!0):this.share.password="",this.hasExpirationDate||(this.share.expireDate=""),this.isNewShare){const e={permissions:this.share.permissions,shareType:this.share.type,shareWith:this.share.shareWith,attributes:this.share.attributes,note:this.share.note,fileInfo:this.fileInfo};e.expireDate=this.hasExpirationDate?this.share.expireDate:"",this.isPasswordProtected&&(e.password=this.share.password),this.creating=!0;const t=await this.addShare(e);this.creating=!1,this.share=t,this.$emit("add:share",this.share)}else this.$emit("update:share",this.share),this.queueUpdate(...e);await this.getNode(),(0,Re.Ic)("files:node:updated",this.node),this.$refs.externalLinkActions?.length>0&&await Promise.allSettled(this.$refs.externalLinkActions.map((e=>"function"!=typeof e.$children.at(0)?.onSave?Promise.resolve():e.$children.at(0)?.onSave?.()))),this.$emit("close-sharing-details")},async addShare(e){de.debug("Adding a new share from the input for",{share:e});const t=this.path;try{return await this.createShare({path:t,shareType:e.shareType,shareWith:e.shareWith,permissions:e.permissions,expireDate:e.expireDate,attributes:JSON.stringify(e.attributes),...e.note?{note:e.note}:{},...e.password?{password:e.password}:{}})}catch(e){de.error("Error while adding new share",{error:e})}},async removeShare(){await this.onDelete(),await this.getNode(),(0,Re.Ic)("files:node:updated",this.node),this.$emit("close-sharing-details")},onPasswordChange(e){this.passwordError=!this.isValidShareAttribute(e),this.$set(this.share,"newPassword",e)},onPasswordProtectedByTalkChange(){this.hasUnsavedPassword&&(this.share.password=this.share.newPassword.trim()),this.queueUpdate("sendPasswordByTalk","password")},isValidShareAttribute:e=>![null,void 0].includes(e)&&e.trim().length>0,getShareTypeIcon(e){switch(e){case this.SHARE_TYPES.SHARE_TYPE_LINK:return nr.A;case this.SHARE_TYPES.SHARE_TYPE_GUEST:return cr;case this.SHARE_TYPES.SHARE_TYPE_REMOTE_GROUP:case this.SHARE_TYPES.SHARE_TYPE_GROUP:return sr.A;case this.SHARE_TYPES.SHARE_TYPE_EMAIL:return ir;case this.SHARE_TYPES.SHARE_TYPE_CIRCLE:return tr;case this.SHARE_TYPES.SHARE_TYPE_ROOM:case this.SHARE_TYPES.SHARE_TYPE_DECK:case this.SHARE_TYPES.SHARE_TYPE_SCIENCEMESH:return or;default:return null}}}};var gr=i(93833),mr={};mr.styleTagTransform=y(),mr.setAttributes=A(),mr.insert=p().bind(null,"head"),mr.domAPI=u(),mr.insertStyleElement=m(),c()(gr.A,mr),gr.A&&gr.A.locals&&gr.A.locals;const Er=(0,_e.A)(Ar,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"sharingTabDetailsView"},[t("div",{staticClass:"sharingTabDetailsView__header"},[t("span",[e.isUserShare?t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{"is-no-user":e.share.shareType!==e.SHARE_TYPES.SHARE_TYPE_USER,user:e.share.shareWith,"display-name":e.share.shareWithDisplayName,"menu-position":"left",url:e.share.shareWithAvatar}}):e._e(),e._v(" "),t(e.getShareTypeIcon(e.share.type),{tag:"component",attrs:{size:32}})],1),e._v(" "),t("span",[t("h1",[e._v(e._s(e.title))])])]),e._v(" "),t("div",{staticClass:"sharingTabDetailsView__wrapper"},[t("div",{ref:"quickPermissions",staticClass:"sharingTabDetailsView__quick-permissions"},[t("div",[t("NcCheckboxRadioSwitch",{attrs:{"button-variant":!0,"data-cy-files-sharing-share-permissions-bundle":"read-only",checked:e.sharingPermission,value:e.bundledPermissions.READ_ONLY.toString(),name:"sharing_permission_radio",type:"radio","button-variant-grouped":"vertical"},on:{"update:checked":[function(t){e.sharingPermission=t},e.toggleCustomPermissions]},scopedSlots:e._u([{key:"icon",fn:function(){return[t("ViewIcon",{attrs:{size:20}})]},proxy:!0}])},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","View only"))+"\n\t\t\t\t\t")]),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{"button-variant":!0,"data-cy-files-sharing-share-permissions-bundle":"upload-edit",checked:e.sharingPermission,value:e.bundledPermissions.ALL.toString(),name:"sharing_permission_radio",type:"radio","button-variant-grouped":"vertical"},on:{"update:checked":[function(t){e.sharingPermission=t},e.toggleCustomPermissions]},scopedSlots:e._u([{key:"icon",fn:function(){return[t("EditIcon",{attrs:{size:20}})]},proxy:!0}])},[e.allowsFileDrop?[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Allow upload and editing"))+"\n\t\t\t\t\t")]:[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Allow editing"))+"\n\t\t\t\t\t")]],2),e._v(" "),e.allowsFileDrop?t("NcCheckboxRadioSwitch",{attrs:{"data-cy-files-sharing-share-permissions-bundle":"file-drop","button-variant":!0,checked:e.sharingPermission,value:e.bundledPermissions.FILE_DROP.toString(),name:"sharing_permission_radio",type:"radio","button-variant-grouped":"vertical"},on:{"update:checked":[function(t){e.sharingPermission=t},e.toggleCustomPermissions]},scopedSlots:e._u([{key:"icon",fn:function(){return[t("UploadIcon",{attrs:{size:20}})]},proxy:!0}],null,!1,1083194048)},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","File request"))+"\n\t\t\t\t\t"),t("small",{staticClass:"subline"},[e._v(e._s(e.t("files_sharing","Upload only")))])]):e._e(),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{"button-variant":!0,"data-cy-files-sharing-share-permissions-bundle":"custom",checked:e.sharingPermission,value:"custom",name:"sharing_permission_radio",type:"radio","button-variant-grouped":"vertical"},on:{"update:checked":[function(t){e.sharingPermission=t},e.expandCustomPermissions]},scopedSlots:e._u([{key:"icon",fn:function(){return[t("DotsHorizontalIcon",{attrs:{size:20}})]},proxy:!0}])},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Custom permissions"))+"\n\t\t\t\t\t"),t("small",{staticClass:"subline"},[e._v(e._s(e.customPermissionsList))])])],1)]),e._v(" "),t("div",{staticClass:"sharingTabDetailsView__advanced-control"},[t("NcButton",{attrs:{id:"advancedSectionAccordionAdvancedControl",type:"tertiary",alignment:"end-reverse","aria-controls":"advancedSectionAccordionAdvanced","aria-expanded":e.advancedControlExpandedValue},on:{click:function(t){e.advancedSectionAccordionExpanded=!e.advancedSectionAccordionExpanded}},scopedSlots:e._u([{key:"icon",fn:function(){return[e.advancedSectionAccordionExpanded?t("MenuUpIcon"):t("MenuDownIcon")]},proxy:!0}])},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Advanced settings"))+"\n\t\t\t\t")])],1),e._v(" "),e.advancedSectionAccordionExpanded?t("div",{staticClass:"sharingTabDetailsView__advanced",attrs:{id:"advancedSectionAccordionAdvanced","aria-labelledby":"advancedSectionAccordionAdvancedControl",role:"region"}},[t("section",[e.isPublicShare?t("NcInputField",{attrs:{autocomplete:"off",label:e.t("files_sharing","Share label"),value:e.share.label},on:{"update:value":function(t){return e.$set(e.share,"label",t)}}}):e._e(),e._v(" "),e.isPublicShare?[t("NcCheckboxRadioSwitch",{attrs:{checked:e.isPasswordProtected,disabled:e.isPasswordEnforced},on:{"update:checked":function(t){e.isPasswordProtected=t}}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Set password"))+"\n\t\t\t\t\t")]),e._v(" "),e.isPasswordProtected?t("NcPasswordField",{attrs:{autocomplete:"new-password",value:e.hasUnsavedPassword?e.share.newPassword:"",error:e.passwordError,"helper-text":e.errorPasswordLabel,required:e.isPasswordEnforced,label:e.t("files_sharing","Password")},on:{"update:value":e.onPasswordChange}}):e._e(),e._v(" "),e.isEmailShareType&&e.passwordExpirationTime?t("span",{attrs:{icon:"icon-info"}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Password expires {passwordExpirationTime}",{passwordExpirationTime:e.passwordExpirationTime}))+"\n\t\t\t\t\t")]):e.isEmailShareType&&null!==e.passwordExpirationTime?t("span",{attrs:{icon:"icon-error"}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Password expired"))+"\n\t\t\t\t\t")]):e._e()]:e._e(),e._v(" "),e.canTogglePasswordProtectedByTalkAvailable?t("NcCheckboxRadioSwitch",{attrs:{checked:e.isPasswordProtectedByTalk},on:{"update:checked":[function(t){e.isPasswordProtectedByTalk=t},e.onPasswordProtectedByTalkChange]}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Video verification"))+"\n\t\t\t\t")]):e._e(),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{checked:e.hasExpirationDate,disabled:e.isExpiryDateEnforced},on:{"update:checked":function(t){e.hasExpirationDate=t}}},[e._v("\n\t\t\t\t\t"+e._s(e.isExpiryDateEnforced?e.t("files_sharing","Expiration date (enforced)"):e.t("files_sharing","Set expiration date"))+"\n\t\t\t\t")]),e._v(" "),e.hasExpirationDate?t("NcDateTimePickerNative",{attrs:{id:"share-date-picker",value:new Date(e.share.expireDate??e.dateTomorrow),min:e.dateTomorrow,max:e.maxExpirationDateEnforced,"hide-label":!0,placeholder:e.t("files_sharing","Expiration date"),type:"date"},on:{input:e.onExpirationChange}}):e._e(),e._v(" "),e.isPublicShare?t("NcCheckboxRadioSwitch",{attrs:{disabled:e.canChangeHideDownload,checked:e.share.hideDownload},on:{"update:checked":[function(t){return e.$set(e.share,"hideDownload",t)},function(t){return e.queueUpdate("hideDownload")}]}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Hide download"))+"\n\t\t\t\t")]):e._e(),e._v(" "),e.isPublicShare?e._e():t("NcCheckboxRadioSwitch",{attrs:{disabled:!e.canSetDownload,checked:e.canDownload,"data-cy-files-sharing-share-permissions-checkbox":"download"},on:{"update:checked":function(t){e.canDownload=t}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Allow download and sync"))+"\n\t\t\t\t")]),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{checked:e.writeNoteToRecipientIsChecked},on:{"update:checked":function(t){e.writeNoteToRecipientIsChecked=t}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Note to recipient"))+"\n\t\t\t\t")]),e._v(" "),e.writeNoteToRecipientIsChecked?[t("NcTextArea",{attrs:{label:e.t("files_sharing","Note to recipient"),placeholder:e.t("files_sharing","Enter a note for the share recipient"),value:e.share.note},on:{"update:value":function(t){return e.$set(e.share,"note",t)}}})]:e._e(),e._v(" "),e._l(e.externalLinkActions,(function(r){return t("ExternalShareAction",{key:r.id,ref:"externalLinkActions",refInFor:!0,attrs:{id:r.id,action:r,"file-info":e.fileInfo,share:e.share}})})),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{checked:e.setCustomPermissions},on:{"update:checked":function(t){e.setCustomPermissions=t}}},[e._v("\n\t\t\t\t\t"+e._s(e.t("files_sharing","Custom permissions"))+"\n\t\t\t\t")]),e._v(" "),e.setCustomPermissions?t("section",{staticClass:"custom-permissions-group"},[t("NcCheckboxRadioSwitch",{attrs:{disabled:!e.canRemoveReadPermission,checked:e.hasRead,"data-cy-files-sharing-share-permissions-checkbox":"read"},on:{"update:checked":function(t){e.hasRead=t}}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Read"))+"\n\t\t\t\t\t")]),e._v(" "),e.isFolder?t("NcCheckboxRadioSwitch",{attrs:{disabled:!e.canSetCreate,checked:e.canCreate,"data-cy-files-sharing-share-permissions-checkbox":"create"},on:{"update:checked":function(t){e.canCreate=t}}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Create"))+"\n\t\t\t\t\t")]):e._e(),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{disabled:!e.canSetEdit,checked:e.canEdit,"data-cy-files-sharing-share-permissions-checkbox":"update"},on:{"update:checked":function(t){e.canEdit=t}}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Edit"))+"\n\t\t\t\t\t")]),e._v(" "),e.config.isResharingAllowed&&e.share.type!==e.SHARE_TYPES.SHARE_TYPE_LINK?t("NcCheckboxRadioSwitch",{attrs:{disabled:!e.canSetReshare,checked:e.canReshare,"data-cy-files-sharing-share-permissions-checkbox":"share"},on:{"update:checked":function(t){e.canReshare=t}}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Share"))+"\n\t\t\t\t\t")]):e._e(),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{disabled:!e.canSetDelete,checked:e.canDelete,"data-cy-files-sharing-share-permissions-checkbox":"delete"},on:{"update:checked":function(t){e.canDelete=t}}},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Delete"))+"\n\t\t\t\t\t")])],1):e._e(),e._v(" "),t("div",{staticClass:"sharingTabDetailsView__delete"},[e.isNewShare?e._e():t("NcButton",{attrs:{"aria-label":e.t("files_sharing","Delete share"),disabled:!1,readonly:!1,type:"tertiary"},on:{click:function(t){return t.preventDefault(),e.removeShare.apply(null,arguments)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t("CloseIcon",{attrs:{size:16}})]},proxy:!0}],null,!1,2746485232)},[e._v("\n\t\t\t\t\t\t"+e._s(e.t("files_sharing","Delete share"))+"\n\t\t\t\t\t")])],1)],2)]):e._e()]),e._v(" "),t("div",{staticClass:"sharingTabDetailsView__footer"},[t("div",{staticClass:"button-group"},[t("NcButton",{attrs:{"data-cy-files-sharing-share-editor-action":"cancel"},on:{click:function(t){return e.$emit("close-sharing-details")}}},[e._v("\n\t\t\t\t"+e._s(e.t("files_sharing","Cancel"))+"\n\t\t\t")]),e._v(" "),t("NcButton",{attrs:{type:"primary","data-cy-files-sharing-share-editor-action":"save"},on:{click:e.saveShare},scopedSlots:e._u([e.creating?{key:"icon",fn:function(){return[t("NcLoadingIcon")]},proxy:!0}:null],null,!0)},[e._v("\n\t\t\t\t"+e._s(e.shareButtonText)+"\n\t\t\t\t")])],1)])])}),[],!1,null,"239560e4",null).exports,yr={name:"SharingTab",components:{NcAvatar:C.A,CollectionList:ae,SharingEntryInternal:xe,SharingEntrySimple:we,SharingInherited:Ze,SharingInput:Oe,SharingLinkList:Yt,SharingList:Wt,SharingDetailsTab:Er},mixins:[fe],data:()=>({config:new he,deleteEvent:null,error:"",expirationInterval:null,loading:!0,fileInfo:null,reshare:null,sharedWithMe:{},shares:[],linkShares:[],sections:OCA.Sharing.ShareTabSections.getSections(),projectsEnabled:(0,a.C)("core","projects_enabled",!1),showSharingDetailsView:!1,shareDetailsData:{},returnFocusElement:null}),computed:{isSharedWithMe(){return Object.keys(this.sharedWithMe).length>0},canReshare(){return!!(this.fileInfo.permissions&OC.PERMISSION_SHARE)||!!(this.reshare&&this.reshare.hasSharePermission&&this.config.isResharingAllowed)}},methods:{async update(e){this.fileInfo=e,this.resetState(),this.getShares()},async getShares(){try{this.loading=!0;const e=(0,o.KT)("apps/files_sharing/api/v1/shares"),t="json",r=(this.fileInfo.path+"/"+this.fileInfo.name).replace("//","/"),i=Q.Ay.get(e,{params:{format:t,path:r,reshares:!0}}),n=Q.Ay.get(e,{params:{format:t,path:r,shared_with_me:!0}}),[s,a]=await Promise.all([i,n]);this.loading=!1,this.processSharedWithMe(a),this.processShares(s)}catch(e){this.error=e?.response?.data?.ocs?.meta?.message?e.response.data.ocs.meta.message:t("files_sharing","Unable to load the shares list"),this.loading=!1,console.error("Error loading the shares list",e)}},resetState(){clearInterval(this.expirationInterval),this.loading=!0,this.error="",this.sharedWithMe={},this.shares=[],this.linkShares=[],this.showSharingDetailsView=!1,this.shareDetailsData={}},updateExpirationSubtitle(e){const r=(0,oe.A)(e.expireDate).unix();this.$set(this.sharedWithMe,"subtitle",t("files_sharing","Expires {relativetime}",{relativetime:(0,oe.A)(1e3*r).fromNow()})),(0,oe.A)().unix()>r&&(clearInterval(this.expirationInterval),this.$set(this.sharedWithMe,"subtitle",t("files_sharing","this share just expired.")))},processShares(e){let{data:t}=e;if(t.ocs&&t.ocs.data&&t.ocs.data.length>0){const e=(0,s.My)(t.ocs.data.map((e=>new pe(e))),[e=>e.shareWithDisplayName,e=>e.label,e=>e.createdTime]);this.linkShares=e.filter((e=>e.type===this.SHARE_TYPES.SHARE_TYPE_LINK||e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL)),this.shares=e.filter((e=>e.type!==this.SHARE_TYPES.SHARE_TYPE_LINK&&e.type!==this.SHARE_TYPES.SHARE_TYPE_EMAIL)),console.debug("Processed",this.linkShares.length,"link share(s)"),console.debug("Processed",this.shares.length,"share(s)")}},processSharedWithMe(e){let{data:r}=e;if(r.ocs&&r.ocs.data&&r.ocs.data[0]){const e=new pe(r),i=function(e){return e.type===le.Z.SHARE_TYPE_GROUP?t("files_sharing","Shared with you and the group {group} by {owner}",{group:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===le.Z.SHARE_TYPE_CIRCLE?t("files_sharing","Shared with you and {circle} by {owner}",{circle:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):e.type===le.Z.SHARE_TYPE_ROOM?e.shareWithDisplayName?t("files_sharing","Shared with you and the conversation {conversation} by {owner}",{conversation:e.shareWithDisplayName,owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you in a conversation by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1}):t("files_sharing","Shared with you by {owner}",{owner:e.ownerDisplayName},void 0,{escape:!1})}(e),n=e.ownerDisplayName,s=e.owner;this.sharedWithMe={displayName:n,title:i,user:s},this.reshare=e,e.expireDate&&(0,oe.A)(e.expireDate).unix()>(0,oe.A)().unix()&&(this.updateExpirationSubtitle(e),this.expirationInterval=setInterval(this.updateExpirationSubtitle,1e4,e))}else this.fileInfo&&void 0!==this.fileInfo.shareOwnerId&&this.fileInfo.shareOwnerId!==(0,n.HW)().uid&&(this.sharedWithMe={displayName:this.fileInfo.shareOwner,title:t("files_sharing","Shared with you by {owner}",{owner:this.fileInfo.shareOwner},void 0,{escape:!1}),user:this.fileInfo.shareOwnerId})},addShare(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>{};e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL?this.linkShares.unshift(e):this.shares.unshift(e),this.awaitForShare(e,t)},removeShare(e){const t=e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL||e.type===this.SHARE_TYPES.SHARE_TYPE_LINK?this.linkShares:this.shares,r=t.findIndex((t=>t.id===e.id));-1!==r&&t.splice(r,1)},awaitForShare(e,t){this.$nextTick((()=>{let r=this.$refs.shareList;e.type===this.SHARE_TYPES.SHARE_TYPE_EMAIL&&(r=this.$refs.linkShareList);const i=r.$children.find((t=>t.share===e));i&&t(i)}))},toggleShareDetailsView(e){if(!this.showSharingDetailsView)if(Array.from(document.activeElement.classList).some((e=>e.startsWith("action-")))){const e=document.activeElement.closest('[role="menu"]')?.id;this.returnFocusElement=document.querySelector(`[aria-controls="${e}"]`)}else this.returnFocusElement=document.activeElement;e&&(this.shareDetailsData=e),this.showSharingDetailsView=!this.showSharingDetailsView,this.showSharingDetailsView||this.$nextTick((()=>{this.returnFocusElement?.focus(),this.returnFocusElement=null}))}}},vr=yr;var _r=i(71028),wr={};wr.styleTagTransform=y(),wr.setAttributes=A(),wr.insert=p().bind(null,"head"),wr.domAPI=u(),wr.insertStyleElement=m(),c()(_r.A,wr),_r.A&&_r.A.locals&&_r.A.locals;const Cr=(0,_e.A)(vr,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"sharingTab",class:{"icon-loading":e.loading}},[e.error?t("div",{staticClass:"emptycontent",class:{emptyContentWithSections:e.sections.length>0}},[t("div",{staticClass:"icon icon-error"}),e._v(" "),t("h2",[e._v(e._s(e.error))])]):e._e(),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.showSharingDetailsView,expression:"!showSharingDetailsView"}],staticClass:"sharingTab__content"},[t("ul",[e.isSharedWithMe?t("SharingEntrySimple",e._b({staticClass:"sharing-entry__reshare",scopedSlots:e._u([{key:"avatar",fn:function(){return[t("NcAvatar",{staticClass:"sharing-entry__avatar",attrs:{user:e.sharedWithMe.user,"display-name":e.sharedWithMe.displayName}})]},proxy:!0}],null,!1,3197855346)},"SharingEntrySimple",e.sharedWithMe,!1)):e._e()],1),e._v(" "),e.loading?e._e():t("SharingInput",{attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,"link-shares":e.linkShares,reshare:e.reshare,shares:e.shares},on:{"open-sharing-details":e.toggleShareDetailsView}}),e._v(" "),e.loading?e._e():t("SharingLinkList",{ref:"linkShareList",attrs:{"can-reshare":e.canReshare,"file-info":e.fileInfo,shares:e.linkShares},on:{"open-sharing-details":e.toggleShareDetailsView}}),e._v(" "),e.loading?e._e():t("SharingList",{ref:"shareList",attrs:{shares:e.shares,"file-info":e.fileInfo},on:{"open-sharing-details":e.toggleShareDetailsView}}),e._v(" "),e.canReshare&&!e.loading?t("SharingInherited",{attrs:{"file-info":e.fileInfo}}):e._e(),e._v(" "),t("SharingEntryInternal",{attrs:{"file-info":e.fileInfo}}),e._v(" "),e.projectsEnabled&&e.fileInfo?t("CollectionList",{attrs:{id:`${e.fileInfo.id}`,type:"file",name:e.fileInfo.name}}):e._e()],1),e._v(" "),e._l(e.sections,(function(r,i){return t("div",{directives:[{name:"show",rawName:"v-show",value:!e.showSharingDetailsView,expression:"!showSharingDetailsView"}],key:i,ref:"section-"+i,refInFor:!0,staticClass:"sharingTab__additionalContent"},[t(r(e.$refs["section-"+i],e.fileInfo),{tag:"component",attrs:{"file-info":e.fileInfo}})],1)})),e._v(" "),e.showSharingDetailsView?t("SharingDetailsTab",{attrs:{"file-info":e.shareDetailsData.fileInfo,share:e.shareDetailsData.share},on:{"close-sharing-details":e.toggleShareDetailsView,"add:share":e.addShare,"remove:share":e.removeShare}}):e._e()],2)}),[],!1,null,"7c6dc4a7",null).exports},27518:e=>{"use strict";e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M15.4%2016.6L10.8%2012l4.6-4.6L14%206l-6%206%206%206%201.4-1.4z%27/%3e%3c/svg%3e"},27514:e=>{"use strict";e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M18.4%207.4L17%206l-6%206%206%206%201.4-1.4-4.6-4.6%204.6-4.6m-6%200L11%206l-6%206%206%206%201.4-1.4L7.8%2012l4.6-4.6z%27/%3e%3c/svg%3e"},79722:e=>{"use strict";e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M5.6%207.4L7%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6m6%200L13%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6z%27/%3e%3c/svg%3e"},86886:e=>{"use strict";e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M8.6%2016.6l4.6-4.6-4.6-4.6L10%206l6%206-6%206-1.4-1.4z%27/%3e%3c/svg%3e"},35810:(e,t,r)=>{"use strict";r.d(t,{Al:()=>D,H4:()=>k,My:()=>H,Q$:()=>N,R3:()=>_,VL:()=>v,lJ:()=>R,pt:()=>w,ur:()=>U,v7:()=>O});var i=r(35947),n=r(21777),s=r(43627),a=r(71225),o=r(63814),l=r(36117),c=r(44719),h=r(82680),u=r(53334),d=r(380),p=r(65606);const f=(0,i.YK)().setApp("@nextcloud/files").detectUser().build();var A=(e=>(e[e.NONE=0]="NONE",e[e.CREATE=4]="CREATE",e[e.READ=1]="READ",e[e.UPDATE=2]="UPDATE",e[e.DELETE=8]="DELETE",e[e.SHARE=16]="SHARE",e[e.ALL=31]="ALL",e))(A||{});const g=["d:getcontentlength","d:getcontenttype","d:getetag","d:getlastmodified","d:creationdate","d:displayname","d:quota-available-bytes","d:resourcetype","nc:has-preview","nc:is-encrypted","nc:mount-type","oc:comments-unread","oc:favorite","oc:fileid","oc:owner-display-name","oc:owner-id","oc:permissions","oc:size"],m={d:"DAV:",nc:"http://nextcloud.org/ns",oc:"http://owncloud.org/ns",ocs:"http://open-collaboration-services.org/ns"},E=function(){return void 0===window._nc_dav_properties&&(window._nc_dav_properties=[...g]),window._nc_dav_properties.map((e=>`<${e} />`)).join(" ")},y=function(){return void 0===window._nc_dav_namespaces&&(window._nc_dav_namespaces={...m}),Object.keys(window._nc_dav_namespaces).map((e=>`xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`)).join(" ")},v=function(){return`<?xml version="1.0"?>\n\t\t<d:propfind ${y()}>\n\t\t\t<d:prop>\n\t\t\t\t${E()}\n\t\t\t</d:prop>\n\t\t</d:propfind>`},_=function(e){return`<?xml version="1.0" encoding="UTF-8"?>\n<d:searchrequest ${y()}\n\txmlns:ns="https://github.com/icewind1991/SearchDAV/ns">\n\t<d:basicsearch>\n\t\t<d:select>\n\t\t\t<d:prop>\n\t\t\t\t${E()}\n\t\t\t</d:prop>\n\t\t</d:select>\n\t\t<d:from>\n\t\t\t<d:scope>\n\t\t\t\t<d:href>/files/${(0,n.HW)()?.uid}/</d:href>\n\t\t\t\t<d:depth>infinity</d:depth>\n\t\t\t</d:scope>\n\t\t</d:from>\n\t\t<d:where>\n\t\t\t<d:and>\n\t\t\t\t<d:or>\n\t\t\t\t\t<d:not>\n\t\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t\t<d:getcontenttype/>\n\t\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t\t<d:literal>httpd/unix-directory</d:literal>\n\t\t\t\t\t\t</d:eq>\n\t\t\t\t\t</d:not>\n\t\t\t\t\t<d:eq>\n\t\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t\t<oc:size/>\n\t\t\t\t\t\t</d:prop>\n\t\t\t\t\t\t<d:literal>0</d:literal>\n\t\t\t\t\t</d:eq>\n\t\t\t\t</d:or>\n\t\t\t\t<d:gt>\n\t\t\t\t\t<d:prop>\n\t\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t\t</d:prop>\n\t\t\t\t\t<d:literal>${e}</d:literal>\n\t\t\t\t</d:gt>\n\t\t\t</d:and>\n\t\t</d:where>\n\t\t<d:orderby>\n\t\t\t<d:order>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<d:getlastmodified/>\n\t\t\t\t</d:prop>\n\t\t\t\t<d:descending/>\n\t\t\t</d:order>\n\t\t</d:orderby>\n\t\t<d:limit>\n\t\t\t<d:nresults>100</d:nresults>\n\t\t\t<ns:firstresult>0</ns:firstresult>\n\t\t</d:limit>\n\t</d:basicsearch>\n</d:searchrequest>`};var w=(e=>(e.Folder="folder",e.File="file",e))(w||{});const C=function(e,t){return null!==e.match(t)},b=(e,t)=>{if(e.id&&"number"!=typeof e.id)throw new Error("Invalid id type of value");if(!e.source)throw new Error("Missing mandatory source");try{new URL(e.source)}catch(e){throw new Error("Invalid source format, source must be a valid URL")}if(!e.source.startsWith("http"))throw new Error("Invalid source format, only http(s) is supported");if(e.displayname&&"string"!=typeof e.displayname)throw new Error("Invalid displayname type");if(e.mtime&&!(e.mtime instanceof Date))throw new Error("Invalid mtime type");if(e.crtime&&!(e.crtime instanceof Date))throw new Error("Invalid crtime type");if(!e.mime||"string"!=typeof e.mime||!e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))throw new Error("Missing or invalid mandatory mime");if("size"in e&&"number"!=typeof e.size&&void 0!==e.size)throw new Error("Invalid size type");if("permissions"in e&&void 0!==e.permissions&&!("number"==typeof e.permissions&&e.permissions>=A.NONE&&e.permissions<=A.ALL))throw new Error("Invalid permissions");if(e.owner&&null!==e.owner&&"string"!=typeof e.owner)throw new Error("Invalid owner type");if(e.attributes&&"object"!=typeof e.attributes)throw new Error("Invalid attributes type");if(e.root&&"string"!=typeof e.root)throw new Error("Invalid root type");if(e.root&&!e.root.startsWith("/"))throw new Error("Root must start with a leading slash");if(e.root&&!e.source.includes(e.root))throw new Error("Root must be part of the source");if(e.root&&C(e.source,t)){const r=e.source.match(t)[0];if(!e.source.includes((0,s.join)(r,e.root)))throw new Error("The root must be relative to the service. e.g /files/emma")}if(e.status&&!Object.values(S).includes(e.status))throw new Error("Status must be a valid NodeStatus")};var S=(e=>(e.NEW="new",e.FAILED="failed",e.LOADING="loading",e.LOCKED="locked",e))(S||{});class x{_data;_attributes;_knownDavService=/(remote|public)\.php\/(web)?dav/i;readonlyAttributes=Object.entries(Object.getOwnPropertyDescriptors(x.prototype)).filter((e=>"function"==typeof e[1].get&&"__proto__"!==e[0])).map((e=>e[0]));handler={set:(e,t,r)=>!this.readonlyAttributes.includes(t)&&Reflect.set(e,t,r),deleteProperty:(e,t)=>!this.readonlyAttributes.includes(t)&&Reflect.deleteProperty(e,t),get:(e,t,r)=>this.readonlyAttributes.includes(t)?(f.warn(`Accessing "Node.attributes.${t}" is deprecated, access it directly on the Node instance.`),Reflect.get(this,t)):Reflect.get(e,t,r)};constructor(e,t){b(e,t||this._knownDavService),this._data={displayname:e.attributes?.displayname,...e,attributes:{}},this._attributes=new Proxy(this._data.attributes,this.handler),this.update(e.attributes??{}),t&&(this._knownDavService=t)}get source(){return this._data.source.replace(/\/$/i,"")}get encodedSource(){const{origin:e}=new URL(this.source);return e+(0,a.O0)(this.source.slice(e.length))}get basename(){return(0,s.basename)(this.source)}get displayname(){return this._data.displayname||this.basename}set displayname(e){this._data.displayname=e}get extension(){return(0,s.extname)(this.source)}get dirname(){if(this.root){let e=this.source;this.isDavRessource&&(e=e.split(this._knownDavService).pop());const t=e.indexOf(this.root),r=this.root.replace(/\/$/,"");return(0,s.dirname)(e.slice(t+r.length)||"/")}const e=new URL(this.source);return(0,s.dirname)(e.pathname)}get mime(){return this._data.mime}get mtime(){return this._data.mtime}set mtime(e){this._data.mtime=e}get crtime(){return this._data.crtime}get size(){return this._data.size}set size(e){this.updateMtime(),this._data.size=e}get attributes(){return this._attributes}get permissions(){return null!==this.owner||this.isDavRessource?void 0!==this._data.permissions?this._data.permissions:A.NONE:A.READ}set permissions(e){this.updateMtime(),this._data.permissions=e}get owner(){return this.isDavRessource?this._data.owner:null}get isDavRessource(){return C(this.source,this._knownDavService)}get root(){return this._data.root?this._data.root.replace(/^(.+)\/$/,"$1"):this.isDavRessource&&(0,s.dirname)(this.source).split(this._knownDavService).pop()||null}get path(){if(this.root){let e=this.source;this.isDavRessource&&(e=e.split(this._knownDavService).pop());const t=e.indexOf(this.root),r=this.root.replace(/\/$/,"");return e.slice(t+r.length)||"/"}return(this.dirname+"/"+this.basename).replace(/\/\//g,"/")}get fileid(){return this._data?.id}get status(){return this._data?.status}set status(e){this._data.status=e}move(e){b({...this._data,source:e},this._knownDavService);const t=this.basename;this._data.source=e,this.displayname===t&&this.basename!==t&&(this.displayname=this.basename),this.updateMtime()}rename(e){if(e.includes("/"))throw new Error("Invalid basename");this.move((0,s.dirname)(this.source)+"/"+e)}updateMtime(){this._data.mtime&&(this._data.mtime=new Date)}update(e){for(const[t,r]of Object.entries(e))try{void 0===r?delete this.attributes[t]:this.attributes[t]=r}catch(e){if(e instanceof TypeError)continue;throw e}}}class T extends x{get type(){return w.File}}class P extends x{constructor(e){super({...e,mime:"httpd/unix-directory"})}get type(){return w.Folder}get extension(){return null}get mime(){return"httpd/unix-directory"}}const R=(0,h.f)()?`/files/${(0,h.G)()}`:`/files/${(0,n.HW)()?.uid}`,I=function(){const e=(0,o.dC)("dav");return(0,h.f)()?e.replace("remote.php","public.php"):e}(),k=function(e=I,t={}){const r=(0,c.UU)(e,{headers:t});function i(e){r.setHeaders({...t,"X-Requested-With":"XMLHttpRequest",requesttoken:e??""})}return(0,n.zo)(i),i((0,n.do)()),(0,c.Gu)().patch("fetch",((e,t)=>{const r=t.headers;return r?.method&&(t.method=r.method,delete r.method),fetch(e,t)})),r},N=(e,t="/",r=R)=>{const i=new AbortController;return new l.CancelablePromise((async(n,s,a)=>{a((()=>i.abort()));try{n((await e.getDirectoryContents(`${r}${t}`,{signal:i.signal,details:!0,data:`<?xml version="1.0"?>\n\t\t<oc:filter-files ${y()}>\n\t\t\t<d:prop>\n\t\t\t\t${E()}\n\t\t\t</d:prop>\n\t\t\t<oc:filter-rules>\n\t\t\t\t<oc:favorite>1</oc:favorite>\n\t\t\t</oc:filter-rules>\n\t\t</oc:filter-files>`,headers:{method:"REPORT"},includeSelf:!0})).data.filter((e=>e.filename!==t)).map((e=>D(e,r))))}catch(e){s(e)}}))},D=function(e,t=R,r=I){let i=(0,n.HW)()?.uid;if((0,h.f)())i=i??"anonymous";else if(!i)throw new Error("No user id found");const s=e.props,a=function(e=""){let t=A.NONE;return e?((e.includes("C")||e.includes("K"))&&(t|=A.CREATE),e.includes("G")&&(t|=A.READ),(e.includes("W")||e.includes("N")||e.includes("V"))&&(t|=A.UPDATE),e.includes("D")&&(t|=A.DELETE),e.includes("R")&&(t|=A.SHARE),t):t}(s?.permissions),o=String(s?.["owner-id"]||i),l=s.fileid||0,c={id:l,source:`${r}${e.filename}`,mtime:new Date(Date.parse(e.lastmod)),mime:e.mime||"application/octet-stream",displayname:void 0!==s.displayname?String(s.displayname):void 0,size:s?.size||Number.parseInt(s.getcontentlength||"0"),status:l<0?S.FAILED:void 0,permissions:a,owner:o,root:t,attributes:{...e,...s,hasPreview:s?.["has-preview"]}};return delete c.attributes?.props,"file"===e.type?new T(c):new P(c)};Error;const L=["B","KB","MB","GB","TB","PB"],B=["B","KiB","MiB","GiB","TiB","PiB"];function O(e,t=!1,r=!1,i=!1){r=r&&!i,"string"==typeof e&&(e=Number(e));let n=e>0?Math.floor(Math.log(e)/Math.log(i?1e3:1024)):0;n=Math.min((r?B.length:L.length)-1,n);const s=r?B[n]:L[n];let a=(e/Math.pow(i?1e3:1024,n)).toFixed(1);return!0===t&&0===n?("0.0"!==a?"< 1 ":"0 ")+(r?B[1]:L[1]):(a=n<2?parseFloat(a).toFixed(0):parseFloat(a).toLocaleString((0,u.lO)()),a+" "+s)}function M(e){return e instanceof Date?e.toISOString():String(e)}function H(e,t,r){r=r??[];const i=(t=t??[e=>e]).map(((e,t)=>"asc"===(r[t]??"asc")?1:-1)),n=Intl.Collator([(0,u.Z0)(),(0,u.lO)()],{numeric:!0,usage:"sort"});return[...e].sort(((e,r)=>{for(const[s,a]of t.entries()){const t=n.compare(M(a(e)),M(a(r)));if(0!==t)return t*i[s]}return 0}))}function U(e,t={}){const r={sortingMode:"basename",sortingOrder:"asc",...t};return H(e,[...r.sortFavoritesFirst?[e=>1!==e.attributes?.favorite]:[],...r.sortFoldersFirst?[e=>"folder"!==e.type]:[],..."basename"!==r.sortingMode?[e=>e[r.sortingMode]]:[],e=>{return(t=e.attributes?.displayname||e.basename).lastIndexOf(".")>0?t.slice(0,t.lastIndexOf(".")):t;var t},e=>e.basename],[...r.sortFavoritesFirst?["asc"]:[],...r.sortFoldersFirst?["asc"]:[],..."mtime"===r.sortingMode?["asc"===r.sortingOrder?"desc":"asc"]:[],..."mtime"!==r.sortingMode&&"basename"!==r.sortingMode?[r.sortingOrder]:[],r.sortingOrder,r.sortingOrder])}var Y={};!function(e){const t=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",r="["+t+"]["+t+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*",i=new RegExp("^"+r+"$");e.isExist=function(e){return void 0!==e},e.isEmptyObject=function(e){return 0===Object.keys(e).length},e.merge=function(e,t,r){if(t){const i=Object.keys(t),n=i.length;for(let s=0;s<n;s++)e[i[s]]="strict"===r?[t[i[s]]]:t[i[s]]}},e.getValue=function(t){return e.isExist(t)?t:""},e.isName=function(e){return!(null==i.exec(e))},e.getAllMatches=function(e,t){const r=[];let i=t.exec(e);for(;i;){const n=[];n.startIndex=t.lastIndex-i[0].length;const s=i.length;for(let e=0;e<s;e++)n.push(i[e]);r.push(n),i=t.exec(e)}return r},e.nameRegexp=r}(Y);new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");var $={};const F={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e}};$.buildOptions=function(e){return Object.assign({},F,e)},$.defaultOptions=F,!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat),new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");var V={};function j(e,t,r){let i;const n={};for(let s=0;s<e.length;s++){const a=e[s],o=q(a);let l="";if(l=void 0===r?o:r+"."+o,o===t.textNodeName)void 0===i?i=a[o]:i+=""+a[o];else{if(void 0===o)continue;if(a[o]){let e=j(a[o],t,l);const r=W(e,t);a[":@"]?z(e,a[":@"],l,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==n[o]&&n.hasOwnProperty(o)?(Array.isArray(n[o])||(n[o]=[n[o]]),n[o].push(e)):t.isArray(o,l,r)?n[o]=[e]:n[o]=e}}}return"string"==typeof i?i.length>0&&(n[t.textNodeName]=i):void 0!==i&&(n[t.textNodeName]=i),n}function q(e){const t=Object.keys(e);for(let e=0;e<t.length;e++){const r=t[e];if(":@"!==r)return r}}function z(e,t,r,i){if(t){const n=Object.keys(t),s=n.length;for(let a=0;a<s;a++){const s=n[a];i.isArray(s,r+"."+s,!0,!0)?e[s]=[t[s]]:e[s]=t[s]}}}function W(e,t){const{textNodeName:r}=t,i=Object.keys(e).length;return 0===i||!(1!==i||!e[r]&&"boolean"!=typeof e[r]&&0!==e[r])}V.prettify=function(e,t){return j(e,t)};const{buildOptions:G}=$,{prettify:K}=V;function X(e,t,r,i){let n="",s=!1;for(let a=0;a<e.length;a++){const o=e[a],l=Q(o);if(void 0===l)continue;let c="";if(c=0===r.length?l:`${r}.${l}`,l===t.textNodeName){let e=o[l];J(c,t)||(e=t.tagValueProcessor(l,e),e=ee(e,t)),s&&(n+=i),n+=e,s=!1;continue}if(l===t.cdataPropName){s&&(n+=i),n+=`<![CDATA[${o[l][0][t.textNodeName]}]]>`,s=!1;continue}if(l===t.commentPropName){n+=i+`\x3c!--${o[l][0][t.textNodeName]}--\x3e`,s=!0;continue}if("?"===l[0]){const e=Z(o[":@"],t),r="?xml"===l?"":i;let a=o[l][0][t.textNodeName];a=0!==a.length?" "+a:"",n+=r+`<${l}${a}${e}?>`,s=!0;continue}let h=i;""!==h&&(h+=t.indentBy);const u=i+`<${l}${Z(o[":@"],t)}`,d=X(o[l],t,c,h);-1!==t.unpairedTags.indexOf(l)?t.suppressUnpairedNode?n+=u+">":n+=u+"/>":d&&0!==d.length||!t.suppressEmptyNode?d&&d.endsWith(">")?n+=u+`>${d}${i}</${l}>`:(n+=u+">",d&&""!==i&&(d.includes("/>")||d.includes("</"))?n+=i+t.indentBy+d+i:n+=d,n+=`</${l}>`):n+=u+"/>",s=!0}return n}function Q(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const i=t[r];if(e.hasOwnProperty(i)&&":@"!==i)return i}}function Z(e,t){let r="";if(e&&!t.ignoreAttributes)for(let i in e){if(!e.hasOwnProperty(i))continue;let n=t.attributeValueProcessor(i,e[i]);n=ee(n,t),!0===n&&t.suppressBooleanAttributes?r+=` ${i.substr(t.attributeNamePrefix.length)}`:r+=` ${i.substr(t.attributeNamePrefix.length)}="${n}"`}return r}function J(e,t){let r=(e=e.substr(0,e.length-t.textNodeName.length-1)).substr(e.lastIndexOf(".")+1);for(let i in t.stopNodes)if(t.stopNodes[i]===e||t.stopNodes[i]==="*."+r)return!0;return!1}function ee(e,t){if(e&&e.length>0&&t.processEntities)for(let r=0;r<t.entities.length;r++){const i=t.entities[r];e=e.replace(i.regex,i.val)}return e}const te=function(e,t){let r="";return t.format&&t.indentBy.length>0&&(r="\n"),X(e,t,"",r)},re={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ie(e){this.options=Object.assign({},re,e),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=ae),this.processTextOrObjNode=ne,this.options.format?(this.indentate=se,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ne(e,t,r){const i=this.j2x(e,r+1);return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,i.attrStr,r):this.buildObjectNode(i.val,t,i.attrStr,r)}function se(e){return this.options.indentBy.repeat(e)}function ae(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}ie.prototype.build=function(e){return this.options.preserveOrder?te(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0).val)},ie.prototype.j2x=function(e,t){let r="",i="";for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n))if(void 0===e[n])this.isAttribute(n)&&(i+="");else if(null===e[n])this.isAttribute(n)?i+="":"?"===n[0]?i+=this.indentate(t)+"<"+n+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+n+"/"+this.tagEndChar;else if(e[n]instanceof Date)i+=this.buildTextValNode(e[n],n,"",t);else if("object"!=typeof e[n]){const s=this.isAttribute(n);if(s)r+=this.buildAttrPairStr(s,""+e[n]);else if(n===this.options.textNodeName){let t=this.options.tagValueProcessor(n,""+e[n]);i+=this.replaceEntitiesValue(t)}else i+=this.buildTextValNode(e[n],n,"",t)}else if(Array.isArray(e[n])){const r=e[n].length;let s="",a="";for(let o=0;o<r;o++){const r=e[n][o];if(void 0===r);else if(null===r)"?"===n[0]?i+=this.indentate(t)+"<"+n+"?"+this.tagEndChar:i+=this.indentate(t)+"<"+n+"/"+this.tagEndChar;else if("object"==typeof r)if(this.options.oneListGroup){const e=this.j2x(r,t+1);s+=e.val,this.options.attributesGroupName&&r.hasOwnProperty(this.options.attributesGroupName)&&(a+=e.attrStr)}else s+=this.processTextOrObjNode(r,n,t);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(n,r);e=this.replaceEntitiesValue(e),s+=e}else s+=this.buildTextValNode(r,n,"",t)}this.options.oneListGroup&&(s=this.buildObjectNode(s,n,a,t)),i+=s}else if(this.options.attributesGroupName&&n===this.options.attributesGroupName){const t=Object.keys(e[n]),i=t.length;for(let s=0;s<i;s++)r+=this.buildAttrPairStr(t[s],""+e[n][t[s]])}else i+=this.processTextOrObjNode(e[n],n,t);return{attrStr:r,val:i}},ie.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},ie.prototype.buildObjectNode=function(e,t,r,i){if(""===e)return"?"===t[0]?this.indentate(i)+"<"+t+r+"?"+this.tagEndChar:this.indentate(i)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let n="</"+t+this.tagEndChar,s="";return"?"===t[0]&&(s="?",n=""),!r&&""!==r||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===s.length?this.indentate(i)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(i)+"<"+t+r+s+this.tagEndChar+e+this.indentate(i)+n:this.indentate(i)+"<"+t+r+s+">"+e+n}},ie.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":`></${e}`,t},ie.prototype.buildTextValNode=function(e,t,r,i){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(i)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(i)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(i)+"<"+t+r+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(t,e);return n=this.replaceEntitiesValue(n),""===n?this.indentate(i)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(i)+"<"+t+r+">"+n+"</"+t+this.tagEndChar}},ie.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e};var oe="object"==typeof p&&p.env&&p.env.NODE_DEBUG&&/\bsemver\b/i.test(p.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},le={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},ce={exports:{}};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:n}=le,s=oe,a=(t=e.exports={}).re=[],o=t.safeRe=[],l=t.src=[],c=t.t={};let h=0;const u="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",n],[u,i]],p=(e,t,r)=>{const i=(e=>{for(const[t,r]of d)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),n=h++;s(e,n,t),c[e]=n,l[n]=t,a[n]=new RegExp(t,r?"g":void 0),o[n]=new RegExp(i,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${u}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${u}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),p("COERCE",`${l[c.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",l[c.COERCEPLAIN]+`(?:${l[c.PRERELEASE]})?(?:${l[c.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("COERCERTLFULL",l[c.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(ce,ce.exports);var he=ce.exports;Object.freeze({loose:!0}),Object.freeze({});const ue=/^[0-9]+$/,de=(e,t)=>{const r=ue.test(e),i=ue.test(t);return r&&i&&(e=+e,t=+t),e===t?0:r&&!i?-1:i&&!r?1:e<t?-1:1};var pe={compareIdentifiers:de,rcompareIdentifiers:(e,t)=>de(t,e)};const{MAX_LENGTH:fe,MAX_SAFE_INTEGER:Ae}=le,{safeRe:ge,t:me}=he,{compareIdentifiers:Ee}=pe;d.m}}]);
  2. //# sourceMappingURL=2093-2093.js.map?v=6357ed6271dcddbec4c6