@fluid-topics/ft-search-selected-facets 1.1.4 → 1.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
flex-wrap: wrap;
|
|
5
5
|
gap: ${s.spacing};
|
|
6
6
|
}
|
|
7
|
-
`,c={setRequest:(t,e)=>{t.request=e.payload},setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{t.request.paging.perPage=e.payload},setPageNumber:(t,e)=>{t.request.paging.page=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setRequestVirtualField:(t,e)=>{t.request.virtualField=e.payload},setRequestScope:(t,e)=>{t.request.scope=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setSpellcheck:(t,e)=>{t.spellcheck=e.payload},setLocales:(t,e)=>{t.locales=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload}};var h,f,p,d,u,g,y,b,m,v,x,O,w,S;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function h(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function f(t){var e=new FileReader,o=h(e);return e.readAsArrayBuffer(t),o}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,e,o,i=c(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,o=h(e),e.readAsText(t),o;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),i=0;i<e.length;i++)o[i]=String.fromCharCode(e[i]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=a(e)},l.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,e){var o,i,r=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(o=e.method||this.method||"GET",i=o.toUpperCase(),u.indexOf(i)>-1?i:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),i=o.shift().replace(/\+/g," "),r=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},d.call(g.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,i){return new Promise((function(r,n){var a=new g(t,i);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),i=o.shift().trim();if(i){var r=o.join(":").trim();e.append(i,r)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new b(i,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=l,t.Request=g,t.Response=b),e.Headers=l,e.Request=g,e.Response=b,e.fetch=v,Object.defineProperty(e,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(h||(h={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(f||(f={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(p||(p={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(d||(d={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(u||(u={})),function(t){t.ASC="ASC",t.DESC="DESC"}(g||(g={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(y||(y={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(b||(b={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(m||(m={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(v||(v={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(x||(x={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(O||(O={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS"}(w||(w={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(S||(S={})),S.PERSONAL_BOOK_SHARE_USER,S.PERSONAL_BOOK_USER,S.HTML_EXPORT_USER,S.PERSONAL_BOOK_USER,S.PDF_EXPORT_USER,S.PERSONAL_BOOK_USER,S.KHUB_ADMIN,S.CONTENT_PUBLISHER,S.ADMIN,S.KHUB_ADMIN,S.USERS_ADMIN,S.PORTAL_ADMIN,S.DEVELOPER,S.BETA_USER,S.DEBUG_USER;const N=o.css`
|
|
7
|
+
|
|
8
|
+
.ft-search-selected-facets--container > * {
|
|
9
|
+
min-width: 0;
|
|
10
|
+
}
|
|
11
|
+
`,c={setRequest:(t,e)=>{t.request=e.payload},setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{t.request.paging.perPage=e.payload},setPageNumber:(t,e)=>{t.request.paging.page=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setRequestVirtualField:(t,e)=>{t.request.virtualField=e.payload},setRequestScope:(t,e)=>{t.request.scope=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setSpellcheck:(t,e)=>{t.spellcheck=e.payload},setLocales:(t,e)=>{t.locales=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload}};var h,f,p,d,u,g,y,b,m,v,x,O,w,S;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function h(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function f(t){var e=new FileReader,o=h(e);return e.readAsArrayBuffer(t),o}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,e,o,i=c(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,o=h(e),e.readAsText(t),o;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),i=0;i<e.length;i++)o[i]=String.fromCharCode(e[i]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=a(e)},l.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,e){var o,i,r=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(o=e.method||this.method||"GET",i=o.toUpperCase(),u.indexOf(i)>-1?i:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function y(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),i=o.shift().replace(/\+/g," "),r=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},d.call(g.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,i){return new Promise((function(r,n){var a=new g(t,i);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),i=o.shift().trim();if(i){var r=o.join(":").trim();e.append(i,r)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new b(i,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=l,t.Request=g,t.Response=b),e.Headers=l,e.Request=g,e.Response=b,e.fetch=v,Object.defineProperty(e,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(h||(h={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(f||(f={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(p||(p={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(d||(d={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(u||(u={})),function(t){t.ASC="ASC",t.DESC="DESC"}(g||(g={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(y||(y={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(b||(b={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(m||(m={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(v||(v={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(x||(x={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(O||(O={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(w||(w={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(S||(S={})),S.PERSONAL_BOOK_SHARE_USER,S.PERSONAL_BOOK_USER,S.HTML_EXPORT_USER,S.PERSONAL_BOOK_USER,S.PDF_EXPORT_USER,S.PERSONAL_BOOK_USER,S.KHUB_ADMIN,S.CONTENT_PUBLISHER,S.ADMIN,S.KHUB_ADMIN,S.USERS_ADMIN,S.PORTAL_ADMIN,S.DEVELOPER,S.BETA_USER,S.DEBUG_USER;const N=o.css`
|
|
8
12
|
`,$=e.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class C{static build(t){const{baseUrl:e,apiIntegrationIdentifier:o}=$.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?C.build(t):null!==(e=C.API)&&void 0!==e?e:C.API=C.build()}static await(t){return new Promise((e=>{let o=C.get(t);if(o)e(o);else{const i=$.subscribe((()=>{o=C.get(t),o&&(i(),e(o))}))}}))}}var k;const I=Symbol("clearAfterUnitTest");class E{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={},this.currentUiLocale="",this[k]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=$.getState().uiLocale,$.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=$.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var i;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...o};e.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},s).resolve(o,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>e.delay(0).then((()=>t())).catch((()=>null)))))}}k=I,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new E((async(t,e)=>(await C.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new E((async(t,e)=>(await C.await()).getCustomMessageContext(t,e))));const R=window.FluidTopicsI18nService,U=window.FluidTopicsCustomI18nService;var L=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class W extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>C.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
|
|
9
13
|
<slot></slot>
|
|
10
14
|
`}update(t){super.update(t),t.has("baseUrl")&&$.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&$.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&$.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&$.actions.setNoCustom(this.noCustom),t.has("editorMode")&&$.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&$.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&$.actions.setSession(this.session),t.has("availableUiLocales")&&$.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>R.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}W.elementDefinitions={},W.styles=N,L([r.property()],W.prototype,"baseUrl",void 0),L([r.property()],W.prototype,"apiIntegrationIdentifier",void 0),L([r.property()],W.prototype,"uiLocale",void 0),L([e.jsonProperty([])],W.prototype,"availableUiLocales",void 0),L([r.property({type:Boolean})],W.prototype,"editorMode",void 0),L([r.property({type:Boolean})],W.prototype,"noCustom",void 0),L([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],W.prototype,"noCustomComponent",void 0),L([r.property({type:Boolean})],W.prototype,"withManualResources",void 0),L([e.jsonProperty([])],W.prototype,"messageContexts",void 0),L([e.jsonProperty(void 0)],W.prototype,"session",void 0),L([r.property({type:Object})],W.prototype,"apiProvider",void 0);class z{async listMySearches(){var t;return(null===(t=$.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await C.await()).listMySearches($.getState().session.profile.userId):[]}}const B=new e.CacheRegistry;class A{async listMyBookmarks(){return B.get("bookmarks",(async()=>(await C.await()).listMyBookmarks($.getState().session.profile.userId)))}clearCache(){B.clear("bookmarks")}}const D=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const K=new class{constructor(){this.currentSession=$.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new A,$.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=$.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){D.actions.savedSearches(void 0)}clearMyBookmarks(){D.actions.bookmarks(void 0)}async reloadMySearches(){const t=new z,e=await t.listMySearches();D.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;D.actions.bookmarks(e)}}};e.customElement("ft-app-context")(W);class F{static async build(){return new F(await C.await())}constructor(t){this.api=t,this.cache=new e.CacheRegistry,this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const Z=t=>t.request.virtualField===b.TITLE_ONLY&&t.request.scope===w.DOCUMENTS;class T extends Event{constructor(){super(T.eventName)}}T.eventName="search-context-clear-all-filters";class P{static build(t){return new P((t=>e.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:c}))(t.trim()||"context"),F.build)}constructor(t,o){this.store=t,this.serviceProvider=o,this.ignoreEmptyQuery=!1,this.searchDebouncer=new e.Debouncer(100),this.suggestDebouncer=new e.Debouncer(300)}async initService(){return this.service=await this.serviceProvider(),this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}async awaitService(){for(;null==this.service;)await e.delay(5);return this.service}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let e=this.store.getState().locales,o=this.store.getState().request.contentLocale;if(t!=o){if(e){const i=t=>e.some((e=>e.lang==t));i(t)||(t=i(o)?o:e[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const e=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(e),this.store.actions.setPageNumber(1),e.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(b.TITLE_ONLY),this.store.actions.setRequestScope(w.DOCUMENTS)):(this.store.actions.setRequestVirtualField(b.EVERYWHERE),this.store.actions.setRequestScope(w.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return Z(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new T)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,e){let o=this.facetIds.filter((e=>e!=t));e&&o.push(e),this.facetIds=o,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let e=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(e)}setFilter(t,e){let o=this.store.getState().request.filters,i={key:t,values:e,negative:!1},r=[...o.filter((e=>e.key!==t)),i];this.setFilters(r)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}async launchSearch(){return await this.awaitService(),this.searchDebouncer.run((()=>this.fetchSearchData()))}async launchSuggest(){await this.awaitService(),this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,o;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let i=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==i.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=e.cancelable(this.service.launchSearch(i));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let e=(null!==(o=this.store.getState().results)&&void 0!==o?o:[]).concat(t.results);this.store.actions.setResults(e)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof e.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const o=this.store.getState(),i=o.request,r={input:o.liveQuery,filters:i.filters,sort:i.sort,contentLocale:i.contentLocale,scope:i.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=e.cancelable(this.service.launchSuggest(r));let n=await this.cancelableSuggest;this.store.actions.setSuggestResults(n.suggestions)}catch(t){t instanceof e.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var H=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class j extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const M=Symbol("registerInterval");class _ extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[M]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[M]):this.dispatchEvent(new j)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=M,H([r.state()],o.prototype,"stateManager",void 0),o}(e.FtLitElementRedux)){}const G=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorContent),V={color:G,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color","",G),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:e.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},q=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorPrimary),Y=q,Q=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",q),X=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorSecondary),J=X,tt=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",X),et=o.css`
|
|
@@ -130,7 +134,7 @@
|
|
|
130
134
|
<div class="ft-ripple--background"></div>
|
|
131
135
|
<div class="ft-ripple--effect"></div>
|
|
132
136
|
</div>
|
|
133
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var e,o;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(o=this.target)||void 0===o||o.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const o=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;o&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:o)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},o=e("mouseup","contextmenu"),i=e("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)};t.addEventListener("mouseover",this.startHover),t.addEventListener("mousemove",this.moveRipple),t.addEventListener("mouseleave",this.endHover),t.addEventListener("mousedown",o),t.addEventListener("touchstart",i),t.addEventListener("touchmove",this.moveRipple),t.addEventListener("keydown",r),t.addEventListener("focus",this.startFocus),t.addEventListener("blur",this.endFocus),t.addEventListener("focusin",this.startFocus),t.addEventListener("focusout",this.endFocus),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover),t.removeEventListener("mousemove",this.moveRipple),t.removeEventListener("mouseleave",this.endHover),t.removeEventListener("mousedown",o),t.removeEventListener("touchstart",i),t.removeEventListener("touchmove",this.moveRipple),t.removeEventListener("keydown",r),t.removeEventListener("focus",this.startFocus),t.removeEventListener("blur",this.endFocus),t.removeEventListener("focusin",this.startFocus),t.removeEventListener("focusout",this.endFocus),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,o=t;let i,r;return null!=e.x?({x:i,y:r}=e):null!=o.touches&&(i=o.touches[0].clientX,r=o.touches[0].clientY),{x:i,y:r}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}it.elementDefinitions={},it.styles=et,ot([r.property({type:Boolean})],it.prototype,"primary",void 0),ot([r.property({type:Boolean})],it.prototype,"secondary",void 0),ot([r.property({type:Boolean})],it.prototype,"unbounded",void 0),ot([r.property({type:Boolean})],it.prototype,"activated",void 0),ot([r.property({type:Boolean})],it.prototype,"selected",void 0),ot([r.property({type:Boolean})],it.prototype,"disabled",void 0),ot([r.state()],it.prototype,"hovered",void 0),ot([r.state()],it.prototype,"focused",void 0),ot([r.state()],it.prototype,"pressed",void 0),ot([r.state()],it.prototype,"rippling",void 0),ot([r.state()],it.prototype,"originX",void 0),ot([r.state()],it.prototype,"originY",void 0),ot([r.query(".ft-ripple")],it.prototype,"ripple",void 0),ot([r.query(".ft-ripple--effect")],it.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(it);
|
|
137
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var e,o;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(o=this.target)||void 0===o||o.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const o=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;o&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:o)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},o=e("mouseup","contextmenu"),i=e("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)},n={passive:!0};t.addEventListener("mouseover",this.startHover,n),t.addEventListener("mousemove",this.moveRipple,n),t.addEventListener("mouseleave",this.endHover,n),t.addEventListener("mousedown",o,n),t.addEventListener("touchstart",i,n),t.addEventListener("touchmove",this.moveRipple,n),t.addEventListener("keydown",r,n),t.addEventListener("focus",this.startFocus,n),t.addEventListener("blur",this.endFocus,n),t.addEventListener("focusin",this.startFocus,n),t.addEventListener("focusout",this.endFocus,n),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,n),t.removeEventListener("mousemove",this.moveRipple,n),t.removeEventListener("mouseleave",this.endHover,n),t.removeEventListener("mousedown",o,n),t.removeEventListener("touchstart",i,n),t.removeEventListener("touchmove",this.moveRipple,n),t.removeEventListener("keydown",r,n),t.removeEventListener("focus",this.startFocus,n),t.removeEventListener("blur",this.endFocus,n),t.removeEventListener("focusin",this.startFocus,n),t.removeEventListener("focusout",this.endFocus,n),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,o=t;let i,r;return null!=e.x?({x:i,y:r}=e):null!=o.touches&&(i=o.touches[0].clientX,r=o.touches[0].clientY),{x:i,y:r}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}it.elementDefinitions={},it.styles=et,ot([r.property({type:Boolean})],it.prototype,"primary",void 0),ot([r.property({type:Boolean})],it.prototype,"secondary",void 0),ot([r.property({type:Boolean})],it.prototype,"unbounded",void 0),ot([r.property({type:Boolean})],it.prototype,"activated",void 0),ot([r.property({type:Boolean})],it.prototype,"selected",void 0),ot([r.property({type:Boolean})],it.prototype,"disabled",void 0),ot([r.state()],it.prototype,"hovered",void 0),ot([r.state()],it.prototype,"focused",void 0),ot([r.state()],it.prototype,"pressed",void 0),ot([r.state()],it.prototype,"rippling",void 0),ot([r.state()],it.prototype,"originX",void 0),ot([r.state()],it.prototype,"originY",void 0),ot([r.query(".ft-ripple")],it.prototype,"ripple",void 0),ot([r.query(".ft-ripple--effect")],it.prototype,"rippleEffect",void 0),e.customElement("ft-ripple")(it);
|
|
134
138
|
/**
|
|
135
139
|
* @license
|
|
136
140
|
* Copyright 2017 Google LLC
|
|
@@ -559,7 +563,7 @@ const Zt=Symbol.for(""),Tt=t=>{if(t?.r===Zt)return t?._$litStatic$},Pt=t=>({_$li
|
|
|
559
563
|
</div>
|
|
560
564
|
</div>
|
|
561
565
|
</div>
|
|
562
|
-
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((e=>t.has(e)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Bi(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:i,placement:r}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=_o(t,e),c={x:o,y:i},h=await oi(e,l),f=Qo(Go(r)),p=qo(f);let d=c[p],u=c[f];if(n){const t="y"===p?"bottom":"right";d=Mo(d+h["y"===p?"top":"left"],d,d-h[t])}if(a){const t="y"===f?"bottom":"right";u=Mo(u+h["y"===f?"top":"left"],u,u-h[t])}const g=s.fn({...e,[p]:d,[f]:u});return{...g,data:{x:g.x-o,y:g.y-i}}}}),ri({allowedPlacements:[this.position]})]}).then((({x:t,y:e})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${e}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}Di.elementDefinitions={"ft-typography":po},Di.styles=Ao,Ai([r.property()],Di.prototype,"text",void 0),Ai([r.property({type:Boolean})],Di.prototype,"manual",void 0),Ai([r.property({type:Boolean})],Di.prototype,"inline",void 0),Ai([r.property({type:Number})],Di.prototype,"delay",void 0),Ai([r.property()],Di.prototype,"position",void 0),Ai([r.queryAssignedNodes()],Di.prototype,"slotNodes",void 0),Ai([r.query(".ft-tooltip--container")],Di.prototype,"container",void 0),Ai([r.query(".ft-tooltip")],Di.prototype,"tooltip",void 0),Ai([r.query(".ft-tooltip--content")],Di.prototype,"tooltipContent",void 0),Ai([r.state()],Di.prototype,"visible",void 0),e.customElement("ft-tooltip")(Di);class Ki extends e.FtLitElement{render(){return o.html`
|
|
566
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((e=>t.has(e)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Bi(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:i,placement:r}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=_o(t,e),c={x:o,y:i},h=await oi(e,l),f=Qo(Go(r)),p=qo(f);let d=c[p],u=c[f];if(n){const t="y"===p?"bottom":"right";d=Mo(d+h["y"===p?"top":"left"],d,d-h[t])}if(a){const t="y"===f?"bottom":"right";u=Mo(u+h["y"===f?"top":"left"],u,u-h[t])}const g=s.fn({...e,[p]:d,[f]:u});return{...g,data:{x:g.x-o,y:g.y-i}}}}),ri({allowedPlacements:[this.position]})]}).then((({x:t,y:e})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${e}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}Di.elementDefinitions={"ft-typography":po},Di.styles=Ao,Ai([r.property()],Di.prototype,"text",void 0),Ai([r.property({type:Boolean})],Di.prototype,"manual",void 0),Ai([r.property({type:Boolean})],Di.prototype,"inline",void 0),Ai([r.property({type:Number})],Di.prototype,"delay",void 0),Ai([r.property()],Di.prototype,"position",void 0),Ai([r.queryAssignedNodes()],Di.prototype,"slotNodes",void 0),Ai([r.query(".ft-tooltip--container")],Di.prototype,"container",void 0),Ai([r.query(".ft-tooltip")],Di.prototype,"tooltip",void 0),Ai([r.query(".ft-tooltip--content")],Di.prototype,"tooltipContent",void 0),Ai([r.state()],Di.prototype,"visible",void 0),Ai([r.eventOptions({passive:!0})],Di.prototype,"onTouch",null),Ai([r.eventOptions({passive:!0})],Di.prototype,"onHover",null),Ai([r.eventOptions({passive:!0})],Di.prototype,"onOut",null),e.customElement("ft-tooltip")(Di);class Ki extends e.FtLitElement{render(){return o.html`
|
|
563
567
|
<div class="ft-loader">
|
|
564
568
|
<div></div>
|
|
565
569
|
<div></div>
|