@fluid-topics/ft-search-selected-facets 1.1.32 → 1.1.34
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.
|
@@ -11,7 +11,7 @@
|
|
|
11
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 p,f,h,d,u,g,y,b,m,v,x,O,w,S,N,$,C,k;!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 p(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=p(e);return e.readAsArrayBuffer(t),o}function h(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=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=h(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=p(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"}(p||(p={})),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"}(h||(h={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(d||(d={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(u||(u={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(g||(g={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(y||(y={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(b||(b={})),function(t){t.ASC="ASC",t.DESC="DESC"}(m||(m={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(v||(v={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(x||(x={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(O||(O={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(w||(w={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(S||(S={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(N||(N={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}($||($={})),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.GENERATIVE_AI_USER="GENERATIVE_AI_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"}(C||(C={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(k||(k={})),C.PERSONAL_BOOK_SHARE_USER,C.PERSONAL_BOOK_USER,C.HTML_EXPORT_USER,C.PERSONAL_BOOK_USER,C.PDF_EXPORT_USER,C.PERSONAL_BOOK_USER,C.KHUB_ADMIN,C.CONTENT_PUBLISHER,C.ADMIN,C.KHUB_ADMIN,C.USERS_ADMIN,C.PORTAL_ADMIN,C.DEVELOPER,C.BETA_USER,C.DEBUG_USER;const I=o.css`
|
|
12
12
|
`,E=e.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0}});class R{static build(t){const{baseUrl:e,apiIntegrationIdentifier:o}=E.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?R.build(t):null!==(e=R.API)&&void 0!==e?e:R.API=R.build()}static await(t){return new Promise((e=>{let o=R.get(t);if(o)e(o);else{const i=E.subscribe((()=>{o=R.get(t),o&&(i(),e(o))}))}}))}}var U;const L=Symbol("clearAfterUnitTest");class W{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={},this.currentUiLocale="",this[U]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=E.getState().uiLocale,E.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=E.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)))))}}U=L,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new W((async(t,e)=>(await R.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new W((async(t,e)=>(await R.await()).getCustomMessageContext(t,e))));const z=window.FluidTopicsI18nService,D=window.FluidTopicsCustomI18nService;var A=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 K extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>R.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
|
|
13
13
|
<slot></slot>
|
|
14
|
-
`}update(t){super.update(t),t.has("baseUrl")&&(E.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&E.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&E.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&E.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&E.actions.noCustom(this.noCustom),t.has("editorMode")&&E.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&E.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&E.actions.session(this.session),t.has("availableUiLocales")&&E.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>z.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}K.elementDefinitions={},K.styles=I,A([r.property()],K.prototype,"baseUrl",void 0),A([r.property()],K.prototype,"apiIntegrationIdentifier",void 0),A([r.property()],K.prototype,"uiLocale",void 0),A([e.jsonProperty(null)],K.prototype,"availableUiLocales",void 0),A([e.jsonProperty(null)],K.prototype,"metadataConfiguration",void 0),A([r.property({type:Boolean})],K.prototype,"editorMode",void 0),A([r.property({type:Boolean})],K.prototype,"noCustom",void 0),A([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],K.prototype,"noCustomComponent",void 0),A([r.property({type:Boolean})],K.prototype,"withManualResources",void 0),A([e.jsonProperty([])],K.prototype,"messageContexts",void 0),A([e.jsonProperty(void 0)],K.prototype,"session",void 0),A([r.property({type:Object})],K.prototype,"apiProvider",void 0);class B{async listMySearches(){var t;return(null===(t=E.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await R.await()).listMySearches(E.getState().session.profile.userId):[]}}const Z=new e.CacheRegistry;class F{async listMyBookmarks(){return Z.get("bookmarks",(async()=>(await R.await()).listMyBookmarks(E.getState().session.profile.userId)))}clearCache(){Z.clear("bookmarks")}}const T=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const H=new class{constructor(){this.currentSession=E.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new F,E.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=E.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(){T.actions.savedSearches(void 0)}clearMyBookmarks(){T.actions.bookmarks(void 0)}async reloadMySearches(){const t=new B,e=await t.listMySearches();T.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;T.actions.bookmarks(e)}}};e.customElement("ft-app-context")(K);class P{static async build(){return new P(await R.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 j=t=>t.request.virtualField===x.TITLE_ONLY&&t.request.scope===$.DOCUMENTS;class M extends Event{constructor(){super(M.eventName)}}M.eventName="search-context-clear-all-filters";class _{static build(t){return new _((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"),P.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(){return e.waitFor((()=>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(x.TITLE_ONLY),this.store.actions.setRequestScope($.DOCUMENTS)):(this.store.actions.setRequestVirtualField(x.EVERYWHERE),this.store.actions.setRequestScope($.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return j(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new M)}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 G=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 V extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const q=Symbol("registerInterval");class Y 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[q]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[q]):this.dispatchEvent(new V)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=q,G([r.state()],o.prototype,"stateManager",void 0),o}(e.FtLitElementRedux)){}const Q=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorContent),X={color:Q,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color","",Q),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")},J=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorPrimary),tt=J,et=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",J),ot=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorSecondary),it=ot,rt=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",ot),nt=o.css`
|
|
14
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(E.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&E.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&E.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&E.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&E.actions.noCustom(this.noCustom),t.has("editorMode")&&E.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&E.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&E.actions.session(this.session),t.has("availableUiLocales")&&E.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>z.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}K.elementDefinitions={},K.styles=I,A([r.property()],K.prototype,"baseUrl",void 0),A([r.property()],K.prototype,"apiIntegrationIdentifier",void 0),A([r.property()],K.prototype,"uiLocale",void 0),A([e.jsonProperty(null)],K.prototype,"availableUiLocales",void 0),A([e.jsonProperty(null)],K.prototype,"metadataConfiguration",void 0),A([r.property({type:Boolean})],K.prototype,"editorMode",void 0),A([r.property({type:Boolean})],K.prototype,"noCustom",void 0),A([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],K.prototype,"noCustomComponent",void 0),A([r.property({type:Boolean})],K.prototype,"withManualResources",void 0),A([e.jsonProperty([])],K.prototype,"messageContexts",void 0),A([e.jsonProperty(void 0)],K.prototype,"session",void 0),A([r.property({type:Object})],K.prototype,"apiProvider",void 0);class B{async listMySearches(){var t;return(null===(t=E.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await R.await()).listMySearches(E.getState().session.profile.userId):[]}}const Z=new e.CacheRegistry;class F{async listMyBookmarks(){return Z.get("bookmarks",(async()=>(await R.await()).listMyBookmarks(E.getState().session.profile.userId)))}clearCache(){Z.clear("bookmarks")}}const T=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const H=new class{constructor(){this.currentSession=E.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new F,E.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=E.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(){T.actions.savedSearches(void 0)}clearMyBookmarks(){T.actions.bookmarks(void 0)}async reloadMySearches(){const t=new B,e=await t.listMySearches();T.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;T.actions.bookmarks(e)}}};e.customElement("ft-app-context")(K);class P{static async build(){return new P(await R.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 j=t=>t.request.virtualField===x.TITLE_ONLY&&t.request.scope===$.DOCUMENTS;class M extends Event{constructor(){super(M.eventName)}}M.eventName="search-context-clear-all-filters";class _{static build(t){return new _((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"),P.build)}constructor(t,o){this.store=t,this.serviceProvider=o,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!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(){return e.waitFor((()=>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(x.TITLE_ONLY),this.store.actions.setRequestScope($.DOCUMENTS)):(this.store.actions.setRequestVirtualField(x.EVERYWHERE),this.store.actions.setRequestScope($.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return j(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new M)}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()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}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 G=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 V extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const q=Symbol("registerInterval");class Y 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[q]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[q]):this.dispatchEvent(new V)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=q,G([r.state()],o.prototype,"stateManager",void 0),o}(e.FtLitElementRedux)){}const Q=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorContent),X={color:Q,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color","",Q),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")},J=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorPrimary),tt=J,et=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",J),ot=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorSecondary),it=ot,rt=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",ot),nt=o.css`
|
|
15
15
|
:host {
|
|
16
16
|
display: contents;
|
|
17
17
|
}
|
|
@@ -972,23 +972,23 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
972
972
|
<ft-icon .variant=${this.iconVariant} .value="${this.internalIcon}"></ft-icon>
|
|
973
973
|
</div>
|
|
974
974
|
`}onKeyUp(t){this.interactionsOnChip&&["Enter"," "].includes(t.key)&&t.target.click()}onIconKeyUp(t){this.interactionsOnIcon&&["Enter"," "].includes(t.key)&&(t.stopPropagation(),this.dispatchEvent(new ar))}onIconClick(t){this.interactionsOnIcon&&(t.stopPropagation(),this.dispatchEvent(new ar))}getLabel(){return this.label||this.textContent}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}get internalIcon(){return this.icon||(this.removable?"close":void 0)}}sr.elementDefinitions={"ft-ripple":st,"ft-typography":bo,"ft-icon":wo,"ft-button":Vi},sr.styles=rr,nr([r.property({type:Boolean})],sr.prototype,"highlighted",void 0),nr([r.property({type:Boolean})],sr.prototype,"removable",void 0),nr([r.property({type:Boolean})],sr.prototype,"disabled",void 0),nr([r.property({type:Boolean})],sr.prototype,"clickable",void 0),nr([r.property({type:Boolean})],sr.prototype,"iconClickable",void 0),nr([r.property({type:Boolean})],sr.prototype,"dense",void 0),nr([r.property({type:Boolean})],sr.prototype,"multiLine",void 0),nr([r.property()],sr.prototype,"label",void 0),nr([r.property()],sr.prototype,"iconLabel",void 0),nr([r.property()],sr.prototype,"icon",void 0),nr([r.property()],sr.prototype,"iconVariant",void 0),nr([r.property({type:Boolean})],sr.prototype,"trailingIcon",void 0),nr([r.query("ft-typography slot")],sr.prototype,"slottedContent",void 0),e.customElement("ft-chip")(sr);const lr=o.css`
|
|
975
|
-
`;var cr=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};const pr=Symbol("
|
|
975
|
+
`;var cr=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};const pr=Symbol("i18nAttributes"),fr=Symbol("i18nProperties"),hr=Symbol("i18nUnsubs");function dr(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?D:z}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[pr])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[fr])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[pr])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[fr])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[fr])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[pr])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[hr].has(t)||this[hr].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[hr].forEach((t=>t())),this[hr].clear()}}return e=hr,cr([r.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class ur extends(dr(e.FtLitElement)){}class gr extends(dr(e.FtLitElementRedux)){}var yr=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 br extends gr{constructor(){super(),this.editorMode=!1,this.addStore(E)}render(){return this.key&&this.context?o.html`
|
|
976
976
|
<span class="ft-i18n">
|
|
977
977
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
978
978
|
</span>
|
|
979
|
-
`:this.editorMode?"Select a context and a label key.":o.nothing}update(t){var e;super.update(t),this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}
|
|
980
|
-
`;var
|
|
979
|
+
`:this.editorMode?"Select a context and a label key.":o.nothing}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}br.elementDefinitions={},br.styles=lr,yr([e.redux()],br.prototype,"editorMode",void 0),yr([r.property()],br.prototype,"context",void 0),yr([r.property()],br.prototype,"key",void 0),yr([e.jsonProperty([])],br.prototype,"args",void 0),yr([r.property()],br.prototype,"defaultMessage",void 0);class mr{static build(t){return new mr(t)}static fromGwt(t){return new mr(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const o=e;return t=>({context:this.name,key:o,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>z.resolveMessage(this.name,e,...t)})}}e.customElement("ft-i18n")(br);const vr=o.css`
|
|
980
|
+
`;var xr=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 Or extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class wr extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class Sr extends CustomEvent{constructor(t,e,o){super("ft-search-results-change",{detail:{request:t,paging:e,spellcheck:o}})}}class Nr extends e.FtLitElementRedux{get stateManager(){return null==this._stateManager&&(this._stateManager=_.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(E)}render(){return o.html`
|
|
981
981
|
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
982
|
-
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new
|
|
983
|
-
|
|
982
|
+
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new wr(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new Sr(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new Or(t))}reloadSavedSearches(){H.clearMySearches()}clear(){this.stateManager.clear()}}Nr.elementDefinitions={},Nr.styles=vr,xr([r.property()],Nr.prototype,"query",void 0),xr([r.property()],Nr.prototype,"contentLocale",void 0),xr([r.property({type:Number})],Nr.prototype,"pageSize",void 0),xr([r.property({type:Boolean})],Nr.prototype,"searchInDocumentTitlesOnly",void 0),xr([r.property()],Nr.prototype,"scope",void 0),xr([r.property({type:Boolean})],Nr.prototype,"ignoreEmptyQuery",void 0),xr([r.property({type:Boolean})],Nr.prototype,"openExternalDocumentInNewTab",void 0),xr([e.jsonProperty([])],Nr.prototype,"filters",void 0),xr([e.jsonProperty([])],Nr.prototype,"sort",void 0),xr([e.redux({store:"search"})],Nr.prototype,"request",void 0),xr([e.redux({store:"search"})],Nr.prototype,"paging",void 0),xr([e.redux({store:"search",selector:t=>t.spellcheck})],Nr.prototype,"autocorrect",void 0),xr([e.redux({store:E.name})],Nr.prototype,"session",void 0),e.customElement("ft-search-context")(Nr);const $r=o.css`
|
|
983
|
+
`,Cr=e.FtCssVariableFactory.extend("--ft-checkbox-text-color","",e.designSystemVariables.colorOnSurfaceHigh),kr=e.FtCssVariableFactory.extend("--ft-checkbox-font-size","",re.fontSize),Ir=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Er=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),Rr=e.FtCssVariableFactory.extend("--ft-checkbox-border-color","",e.designSystemVariables.colorOnSurfaceMedium),Ur=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),Lr=o.css`
|
|
984
984
|
* {
|
|
985
985
|
box-sizing: border-box;
|
|
986
986
|
}
|
|
987
987
|
|
|
988
988
|
.ft-checkbox {
|
|
989
989
|
box-sizing: border-box;
|
|
990
|
-
color: ${
|
|
991
|
-
font-size: ${
|
|
990
|
+
color: ${Cr};
|
|
991
|
+
font-size: ${kr};
|
|
992
992
|
|
|
993
993
|
display: inline-flex;
|
|
994
994
|
align-items: center;
|
|
@@ -996,7 +996,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
996
996
|
}
|
|
997
997
|
|
|
998
998
|
.ft-checkbox--disabled {
|
|
999
|
-
color: ${
|
|
999
|
+
color: ${Ur};
|
|
1000
1000
|
}
|
|
1001
1001
|
|
|
1002
1002
|
input {
|
|
@@ -1020,26 +1020,26 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1020
1020
|
|
|
1021
1021
|
.ft-checkbox--box {
|
|
1022
1022
|
display: flex;
|
|
1023
|
-
border: 2px solid ${
|
|
1023
|
+
border: 2px solid ${Rr};
|
|
1024
1024
|
border-radius: 2px;
|
|
1025
1025
|
|
|
1026
1026
|
width: 18px;
|
|
1027
1027
|
height: 18px;
|
|
1028
1028
|
|
|
1029
|
-
color: ${
|
|
1029
|
+
color: ${Er};
|
|
1030
1030
|
}
|
|
1031
1031
|
|
|
1032
1032
|
|
|
1033
1033
|
.ft-checkbox--checked .ft-checkbox--box,
|
|
1034
1034
|
.ft-checkbox--indeterminate .ft-checkbox--box {
|
|
1035
|
-
border-color: ${
|
|
1036
|
-
background-color: ${
|
|
1035
|
+
border-color: ${Ir};
|
|
1036
|
+
background-color: ${Ir};
|
|
1037
1037
|
}
|
|
1038
1038
|
|
|
1039
1039
|
.ft-checkbox--disabled .ft-checkbox--box {
|
|
1040
|
-
border-color: ${
|
|
1040
|
+
border-color: ${Ur};
|
|
1041
1041
|
background-color: transparent;
|
|
1042
|
-
color: ${
|
|
1042
|
+
color: ${Ur};
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
1045
|
.ft-checkbox--checkmark {
|
|
@@ -1058,7 +1058,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1058
1058
|
.ft-checkbox--indeterminate .ft-checkbox--checkmark {
|
|
1059
1059
|
opacity: 1;
|
|
1060
1060
|
}
|
|
1061
|
-
`;var
|
|
1061
|
+
`;var Wr=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 zr extends e.FtLitElement{constructor(){super(...arguments),this.name="",this.checked=!1,this.indeterminate=!1,this.disabled=!1}render(){const t={"ft-checkbox":!0,"ft-checkbox--checked":this.checked,"ft-checkbox--indeterminate":this.indeterminate,"ft-checkbox--disabled":this.disabled};return o.html`
|
|
1062
1062
|
<label class="${n.classMap(t)}" for="checkbox-input">
|
|
1063
1063
|
<div class="ft-checkbox--box-container">
|
|
1064
1064
|
<ft-ripple
|
|
@@ -1084,14 +1084,14 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1084
1084
|
<slot></slot>
|
|
1085
1085
|
</ft-typography>
|
|
1086
1086
|
</label>
|
|
1087
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}
|
|
1087
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.indeterminate=!1,this.dispatchEvent(new CustomEvent("change",{detail:this.checked}))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}}zr.elementDefinitions={"ft-ripple":st,"ft-typography":bo},zr.styles=Lr,Wr([r.property()],zr.prototype,"name",void 0),Wr([r.property({type:Boolean,reflect:!0})],zr.prototype,"checked",void 0),Wr([r.property({type:Boolean})],zr.prototype,"indeterminate",void 0),Wr([r.property({type:Boolean})],zr.prototype,"disabled",void 0),Wr([r.query(".ft-checkbox")],zr.prototype,"container",void 0),Wr([r.query("ft-ripple")],zr.prototype,"ripple",void 0),e.customElement("ft-checkbox")(zr);const Dr=e.FtCssVariableFactory.extend("--ft-radio-text-color","",e.designSystemVariables.colorOnSurfaceHigh),Ar=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),Kr=(e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),e.FtCssVariableFactory.extend("--ft-radio-border-color","",e.designSystemVariables.colorOnSurfaceMedium)),Br=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),Zr=o.css`
|
|
1088
1088
|
* {
|
|
1089
1089
|
box-sizing: border-box;
|
|
1090
1090
|
}
|
|
1091
1091
|
|
|
1092
1092
|
.ft-radio {
|
|
1093
1093
|
box-sizing: border-box;
|
|
1094
|
-
color: ${
|
|
1094
|
+
color: ${Dr};
|
|
1095
1095
|
|
|
1096
1096
|
display: inline-flex;
|
|
1097
1097
|
align-items: center;
|
|
@@ -1099,7 +1099,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1099
1099
|
}
|
|
1100
1100
|
|
|
1101
1101
|
.ft-radio--disabled {
|
|
1102
|
-
color: ${
|
|
1102
|
+
color: ${Br};
|
|
1103
1103
|
}
|
|
1104
1104
|
|
|
1105
1105
|
input {
|
|
@@ -1122,7 +1122,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1122
1122
|
}
|
|
1123
1123
|
|
|
1124
1124
|
.ft-radio--box {
|
|
1125
|
-
border: 2px solid ${
|
|
1125
|
+
border: 2px solid ${Kr};
|
|
1126
1126
|
border-radius: 50%;
|
|
1127
1127
|
|
|
1128
1128
|
display: flex;
|
|
@@ -1135,7 +1135,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1135
1135
|
|
|
1136
1136
|
.ft-radio--box:after {
|
|
1137
1137
|
content: " ";
|
|
1138
|
-
background-color: ${
|
|
1138
|
+
background-color: ${Ar};
|
|
1139
1139
|
|
|
1140
1140
|
border-radius: 50%;
|
|
1141
1141
|
|
|
@@ -1147,7 +1147,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1147
1147
|
}
|
|
1148
1148
|
|
|
1149
1149
|
.ft-radio--checked .ft-radio--box {
|
|
1150
|
-
border-color: ${
|
|
1150
|
+
border-color: ${Ar};
|
|
1151
1151
|
}
|
|
1152
1152
|
|
|
1153
1153
|
|
|
@@ -1156,14 +1156,14 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1156
1156
|
}
|
|
1157
1157
|
|
|
1158
1158
|
.ft-radio--disabled .ft-radio--box {
|
|
1159
|
-
border-color: ${
|
|
1159
|
+
border-color: ${Br};
|
|
1160
1160
|
background-color: transparent;
|
|
1161
1161
|
}
|
|
1162
1162
|
|
|
1163
1163
|
.ft-radio--disabled .ft-radio--box:after {
|
|
1164
|
-
background-color: ${
|
|
1164
|
+
background-color: ${Br};
|
|
1165
1165
|
}
|
|
1166
|
-
`;var
|
|
1166
|
+
`;var Fr=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 Tr extends CustomEvent{constructor(t,e){super("change",{detail:{value:t,checked:e},bubbles:!0,composed:!0})}}class Hr extends e.FtLitElement{constructor(){super(...arguments),this.value="",this.name="",this.checked=!1,this.disabled=!1}render(){const t={"ft-radio":!0,"ft-radio--checked":this.checked,"ft-radio--disabled":this.disabled};return o.html`
|
|
1167
1167
|
<div class="${n.classMap(t)}">
|
|
1168
1168
|
<div class="ft-radio--box-container">
|
|
1169
1169
|
<ft-ripple
|
|
@@ -1188,16 +1188,16 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1188
1188
|
</ft-typography>
|
|
1189
1189
|
</label>
|
|
1190
1190
|
</div>
|
|
1191
|
-
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new
|
|
1191
|
+
`}onChange(t){t.stopPropagation(),this.checked=t.target.checked,this.dispatchEvent(new Tr(this.value,this.checked))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),null===(e=this.ripple)||void 0===e||e.setupFor(this.container)}select(){this.checked=!0,this.dispatchEvent(new Tr(this.value,this.checked)),this.focus()}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}}Hr.elementDefinitions={"ft-ripple":st,"ft-typography":bo},Hr.styles=Zr,Fr([r.property()],Hr.prototype,"value",void 0),Fr([r.property()],Hr.prototype,"name",void 0),Fr([r.property({type:Boolean,reflect:!0})],Hr.prototype,"checked",void 0),Fr([r.property({type:Boolean})],Hr.prototype,"disabled",void 0),Fr([r.query(".ft-radio")],Hr.prototype,"container",void 0),Fr([r.query("ft-ripple")],Hr.prototype,"ripple",void 0),Fr([r.query("input")],Hr.prototype,"input",void 0);const Pr=o.css`
|
|
1192
1192
|
:host {
|
|
1193
1193
|
display: contents;
|
|
1194
1194
|
}
|
|
1195
|
-
`;var
|
|
1195
|
+
`;var jr=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 Mr extends e.FtLitElement{constructor(){super(...arguments),this.name=""}render(){return o.html`
|
|
1196
1196
|
<slot @slotchange=${this.onSlotChange}
|
|
1197
1197
|
@change=${this.onChange}
|
|
1198
1198
|
@keydown=${this.onKeyDown}
|
|
1199
1199
|
></slot>
|
|
1200
|
-
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((e=>e.checked=t.detail.value===e.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let e=this.findFtRadio(t),o=this.radioButtons.indexOf(e)-1;this.radioButtons[o<0?this.radioButtons.length-1:o].select();break}case"ArrowDown":case"ArrowRight":{let e=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[e>this.radioButtons.length-1?0:e].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}
|
|
1200
|
+
`}onSlotChange(){this.radioButtons.forEach((t=>t.name=this.name))}onChange(t){t.stopPropagation(),this.radioButtons.forEach((e=>e.checked=t.detail.value===e.value)),this.dispatchEvent(new CustomEvent("change",{detail:t.detail.value})),this.focusCurrentValue()}onKeyDown(t){switch(t.key){case"ArrowUp":case"ArrowLeft":{let e=this.findFtRadio(t),o=this.radioButtons.indexOf(e)-1;this.radioButtons[o<0?this.radioButtons.length-1:o].select();break}case"ArrowDown":case"ArrowRight":{let e=this.radioButtons.indexOf(this.findFtRadio(t))+1;this.radioButtons[e>this.radioButtons.length-1?0:e].select();break}}}findFtRadio(t){return t.composedPath().find((t=>"FT-RADIO"===t.tagName))}focusCurrentValue(){setTimeout((()=>{var t;return null===(t=this.radioButtons.find((t=>t.checked)))||void 0===t?void 0:t.focus()}),10)}}Mr.elementDefinitions={},Mr.styles=Pr,jr([r.property()],Mr.prototype,"name",void 0),jr([r.queryAssignedElements()],Mr.prototype,"radioButtons",void 0),e.customElement("ft-radio")(Hr),e.customElement("ft-radio-group")(Mr);const _r={borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnPrimary,"Design system"),fontFamily:e.FtCssVariableFactory.external(De.fontFamily,"Body2 typography"),fontSize:e.FtCssVariableFactory.external(De.fontSize,"Body2 typography"),fontWeight:e.FtCssVariableFactory.external(De.fontWeight,"Body2 typography"),letterSpacing:e.FtCssVariableFactory.external(De.letterSpacing,"Body2 typography"),lineHeight:e.FtCssVariableFactory.external(De.lineHeight,"Body2 typography"),textTransform:e.FtCssVariableFactory.external(De.textTransform,"Body2 typography")},Gr=o.css`
|
|
1201
1201
|
.ft-filter-level--container {
|
|
1202
1202
|
display: flex;
|
|
1203
1203
|
flex-direction: column;
|
|
@@ -1211,14 +1211,14 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1211
1211
|
flex-shrink: 0;
|
|
1212
1212
|
text-decoration: none;
|
|
1213
1213
|
position: relative;
|
|
1214
|
-
border-radius: ${
|
|
1214
|
+
border-radius: ${_r.borderRadiusM};
|
|
1215
1215
|
overflow: hidden;
|
|
1216
1216
|
display: flex;
|
|
1217
1217
|
align-items: center;
|
|
1218
1218
|
padding: 4px 4px;
|
|
1219
1219
|
gap: 4px;
|
|
1220
1220
|
cursor: pointer;
|
|
1221
|
-
color: ${
|
|
1221
|
+
color: ${_r.colorOnSurface};
|
|
1222
1222
|
}
|
|
1223
1223
|
|
|
1224
1224
|
.ft-filter-level--go-back:focus {
|
|
@@ -1247,7 +1247,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1247
1247
|
}
|
|
1248
1248
|
|
|
1249
1249
|
ft-button {
|
|
1250
|
-
${e.setVariable(Co.color,
|
|
1250
|
+
${e.setVariable(Co.color,_r.colorOnSurface)};
|
|
1251
1251
|
}
|
|
1252
1252
|
|
|
1253
1253
|
ft-radio, ft-checkbox {
|
|
@@ -1261,9 +1261,9 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1261
1261
|
|
|
1262
1262
|
.ft-filter-level--no-values {
|
|
1263
1263
|
margin: 10px 0;
|
|
1264
|
-
color: ${
|
|
1264
|
+
color: ${_r.colorOnSurfaceMedium};
|
|
1265
1265
|
}
|
|
1266
|
-
`;var
|
|
1266
|
+
`;var Vr=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 qr extends e.FtLitElement{constructor(){super(...arguments),this.filterId="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=[...this.options];this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return o.html`
|
|
1267
1267
|
<div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
|
|
1268
1268
|
${null==this.parent?null:o.html`
|
|
1269
1269
|
<div tabindex="0"
|
|
@@ -1327,7 +1327,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1327
1327
|
@change=${t=>t.stopPropagation()}>
|
|
1328
1328
|
${t.renderOption?t.renderOption:t.label}
|
|
1329
1329
|
</ft-radio>
|
|
1330
|
-
`}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}
|
|
1330
|
+
`}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}qr.elementDefinitions={"ft-button":Vi,"ft-ripple":st,"ft-typography":bo,"ft-checkbox":zr,"ft-icon":wo,"ft-radio":Hr},qr.styles=Gr,Vr([r.property({type:String})],qr.prototype,"filterId",void 0),Vr([r.property({type:Object})],qr.prototype,"parent",void 0),Vr([r.property({type:Array})],qr.prototype,"options",void 0),Vr([r.property({type:Boolean})],qr.prototype,"multivalued",void 0),Vr([r.property({type:Boolean})],qr.prototype,"disabled",void 0),Vr([r.property({type:Boolean})],qr.prototype,"hideSelectedOptions",void 0),Vr([r.property({type:Boolean})],qr.prototype,"preventNavigation",void 0),Vr([r.property({type:String})],qr.prototype,"filter",void 0),Vr([r.property({type:String})],qr.prototype,"moreValuesButtonLabel",void 0),Vr([r.property({type:String})],qr.prototype,"noValuesLabel",void 0),Vr([r.property({type:Number})],qr.prototype,"displayedValuesLimit",void 0),Vr([r.query(".ft-filter-level--container")],qr.prototype,"container",void 0),Vr([r.state()],qr.prototype,"displayedPages",void 0);const Yr={buttonsColor:e.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color","",e.designSystemVariables.colorPrimary),buttonsZIndex:e.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","","COLOR","1"),gap:e.FtCssVariableFactory.create("--ft-snap-scroll-gap","","SIZE","0"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system")},Qr=o.css`
|
|
1331
1331
|
.ft-snap-scroll {
|
|
1332
1332
|
box-sizing: border-box;
|
|
1333
1333
|
position: relative;
|
|
@@ -1362,7 +1362,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1362
1362
|
flex-wrap: nowrap;
|
|
1363
1363
|
align-items: flex-start;
|
|
1364
1364
|
justify-content: flex-start;
|
|
1365
|
-
gap: ${
|
|
1365
|
+
gap: ${Yr.gap};
|
|
1366
1366
|
}
|
|
1367
1367
|
|
|
1368
1368
|
.ft-snap-scroll--hide-scrollbar .ft-snap-scroll--content::-webkit-scrollbar {
|
|
@@ -1405,11 +1405,11 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1405
1405
|
.ft-snap-scroll--next {
|
|
1406
1406
|
position: absolute;
|
|
1407
1407
|
display: flex;
|
|
1408
|
-
z-index: ${
|
|
1408
|
+
z-index: ${Yr.buttonsZIndex};
|
|
1409
1409
|
opacity: 1;
|
|
1410
1410
|
transition: background-color .5s ease-in-out, opacity .5s ease-in-out, z-index .5s ease-in-out;
|
|
1411
1411
|
${e.setVariable(Co.backgroundColor,"transparent")};
|
|
1412
|
-
${e.setVariable(Co.color,
|
|
1412
|
+
${e.setVariable(Co.color,Yr.buttonsColor)};
|
|
1413
1413
|
}
|
|
1414
1414
|
|
|
1415
1415
|
.ft-snap-scroll--previous[hidden],
|
|
@@ -1422,37 +1422,37 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1422
1422
|
top: 0;
|
|
1423
1423
|
left: -1px;
|
|
1424
1424
|
bottom: 0;
|
|
1425
|
-
background: linear-gradient(to right, ${
|
|
1425
|
+
background: linear-gradient(to right, ${Yr.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1426
1426
|
}
|
|
1427
1427
|
|
|
1428
1428
|
.ft-snap-scroll--vertical .ft-snap-scroll--previous {
|
|
1429
1429
|
top: -1px;
|
|
1430
1430
|
left: 0;
|
|
1431
1431
|
right: 0;
|
|
1432
|
-
background: linear-gradient(to bottom, ${
|
|
1432
|
+
background: linear-gradient(to bottom, ${Yr.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1433
1433
|
}
|
|
1434
1434
|
|
|
1435
1435
|
.ft-snap-scroll--horizontal .ft-snap-scroll--next {
|
|
1436
1436
|
top: 0;
|
|
1437
1437
|
right: -1px;
|
|
1438
1438
|
bottom: 0;
|
|
1439
|
-
background: linear-gradient(to left, ${
|
|
1439
|
+
background: linear-gradient(to left, ${Yr.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1440
1440
|
}
|
|
1441
1441
|
|
|
1442
1442
|
.ft-snap-scroll--vertical .ft-snap-scroll--next {
|
|
1443
1443
|
left: 0;
|
|
1444
1444
|
right: 0;
|
|
1445
1445
|
bottom: -1px;
|
|
1446
|
-
background: linear-gradient(to top, ${
|
|
1446
|
+
background: linear-gradient(to top, ${Yr.colorSurface} 50%, var(--ft-snap-scroll-transparent-color));
|
|
1447
1447
|
}
|
|
1448
1448
|
|
|
1449
1449
|
.ft-snap-scroll--horizontal .ft-snap-scroll--previous:hover,
|
|
1450
1450
|
.ft-snap-scroll--horizontal .ft-snap-scroll--next:hover,
|
|
1451
1451
|
.ft-snap-scroll--vertical .ft-snap-scroll--previous:hover,
|
|
1452
1452
|
.ft-snap-scroll--vertical .ft-snap-scroll--next:hover {
|
|
1453
|
-
background-color: ${
|
|
1453
|
+
background-color: ${Yr.colorSurface};
|
|
1454
1454
|
}
|
|
1455
|
-
`;var
|
|
1455
|
+
`;var Xr=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 Jr extends CustomEvent{constructor(t,e){super("current-element-change",{detail:{index:t,element:e}})}}class tn extends e.FtLitElement{constructor(){super(...arguments),this.horizontal=!1,this.hideScrollbar=!1,this.controls=!1,this.limitSize=!1,this.elements=[],this.currentElement=0,this.withScroll=!1,this.startReached=!0,this.endReached=!0,this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight",this.updateScrollCallback=()=>this.onScroll(),this.resizeObserver=new ResizeObserver((()=>this.scheduleUpdateScroll())),this.scrollDebouncer=new e.Debouncer(200),this.updateScrollDebouncer=new e.Debouncer(100)}scrollToIndex(t){this.scrollToElement(this.elements[t])}scrollIndexIntoView(t){let e=this.elements[t];if(e){const t=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.nextSize,o=this.contentSlot[this.scrollAttribute]+this.prevSize;(e[this.offsetAttribute]<o||e[this.offsetAttribute]+e[this.sizeAttribute]>t)&&this.scrollToElement(e)}}previous(){this.scrollToElement(this.elements[Math.max(0,this.closestIndexFromStart()-1)])}next(){this.scrollToElement(this.elements[Math.min(this.closestIndexFromStart()+1,this.elements.length-1)])}render(){const t=n.classMap({"ft-snap-scroll":!0,"ft-snap-scroll--horizontal":this.horizontal,"ft-snap-scroll--vertical":!this.horizontal,"ft-snap-scroll--hide-scrollbar":this.hideScrollbar,"ft-snap-scroll--limit-size":this.limitSize,"ft-snap-scroll--safari-fix":e.isSafari}),i=this.controls&&this.withScroll;return o.html`
|
|
1456
1456
|
<div part="container" class="${t}">
|
|
1457
1457
|
<ft-button
|
|
1458
1458
|
class="ft-snap-scroll--previous"
|
|
@@ -1476,7 +1476,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1476
1476
|
@click=${this.next}
|
|
1477
1477
|
></ft-button>
|
|
1478
1478
|
</div>
|
|
1479
|
-
`}update(t){super.update(t),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new
|
|
1479
|
+
`}update(t){super.update(t),t.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),t.has("currentElement")&&this.dispatchEvent(new Jr(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,o;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(o=this.contentSlot)||void 0===o||o.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let t=this.elements[0];return t?t[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}tn.elementDefinitions={"ft-button":Vi},tn.styles=Qr,Xr([r.property({type:Boolean})],tn.prototype,"horizontal",void 0),Xr([r.property({type:Boolean})],tn.prototype,"hideScrollbar",void 0),Xr([r.property({type:Boolean})],tn.prototype,"controls",void 0),Xr([r.property({type:Boolean})],tn.prototype,"limitSize",void 0),Xr([r.state()],tn.prototype,"elements",void 0),Xr([r.state()],tn.prototype,"currentElement",void 0),Xr([r.state()],tn.prototype,"withScroll",void 0),Xr([r.state()],tn.prototype,"startReached",void 0),Xr([r.state()],tn.prototype,"endReached",void 0),Xr([r.query(".ft-snap-scroll--content")],tn.prototype,"contentSlot",void 0),e.customElement("ft-snap-scroll")(tn);const en=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),on=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),rn=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),nn=e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),an=e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),sn=e.FtCssVariableFactory.external(e.designSystemVariables.transitionDuration,"Design system"),ln=e.FtCssVariableFactory.external(e.designSystemVariables.transitionTimingFunction,"Design system"),cn=e.FtCssVariableFactory.extend("--ft-filter-label-color","",e.designSystemVariables.colorOnSurface),pn=e.FtCssVariableFactory.extend("--ft-filter-label-font-size","",re.fontSize,"16px"),fn=[so,o.css`
|
|
1480
1480
|
:host {
|
|
1481
1481
|
display: flex;
|
|
1482
1482
|
max-height: 100%;
|
|
@@ -1511,8 +1511,8 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1511
1511
|
flex-shrink: 1;
|
|
1512
1512
|
flex-grow: 1;
|
|
1513
1513
|
word-break: break-word;
|
|
1514
|
-
color: ${
|
|
1515
|
-
font-size: ${
|
|
1514
|
+
color: ${cn};
|
|
1515
|
+
font-size: ${pn};
|
|
1516
1516
|
${e.setVariable(re.lineHeight,"22px")};
|
|
1517
1517
|
${e.setVariable(re.fontWeight,"bold")};
|
|
1518
1518
|
}
|
|
@@ -1525,8 +1525,8 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1525
1525
|
padding: 0 10px;
|
|
1526
1526
|
overflow: hidden;
|
|
1527
1527
|
height: 32px;
|
|
1528
|
-
transition: height ${
|
|
1529
|
-
margin ${
|
|
1528
|
+
transition: height ${sn} ${ln},
|
|
1529
|
+
margin ${sn} ${ln};
|
|
1530
1530
|
transition-delay: 500ms;
|
|
1531
1531
|
}
|
|
1532
1532
|
|
|
@@ -1539,15 +1539,15 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1539
1539
|
display: block;
|
|
1540
1540
|
width: 100%;
|
|
1541
1541
|
border-radius: 4px;
|
|
1542
|
-
border: 1px solid ${
|
|
1542
|
+
border: 1px solid ${en};
|
|
1543
1543
|
padding: 4px;
|
|
1544
|
-
background-color: ${
|
|
1545
|
-
color: ${
|
|
1546
|
-
outline-color: ${
|
|
1544
|
+
background-color: ${an};
|
|
1545
|
+
color: ${on};
|
|
1546
|
+
outline-color: ${nn};
|
|
1547
1547
|
}
|
|
1548
1548
|
|
|
1549
1549
|
input::placeholder {
|
|
1550
|
-
color: ${
|
|
1550
|
+
color: ${rn};
|
|
1551
1551
|
}
|
|
1552
1552
|
|
|
1553
1553
|
input:placeholder-shown {
|
|
@@ -1563,7 +1563,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1563
1563
|
}
|
|
1564
1564
|
|
|
1565
1565
|
.ft-filter--separator {
|
|
1566
|
-
border-top: 1px solid ${
|
|
1566
|
+
border-top: 1px solid ${en};
|
|
1567
1567
|
margin: 4px 10px;
|
|
1568
1568
|
}
|
|
1569
1569
|
|
|
@@ -1588,7 +1588,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1588
1588
|
slot:not([name]) {
|
|
1589
1589
|
display: none;
|
|
1590
1590
|
}
|
|
1591
|
-
`];var
|
|
1591
|
+
`];var hn=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 dn extends CustomEvent{constructor(t){super("change",{detail:t})}}class un extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayedValuesLimit=0,this.hideClearButton=!1,this.lastLevelHasHiddenvalues=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new e.Debouncer(300),this.changeDebouncer=new e.Debouncer(10),this.lastDispatchedValues=[]}get flatOptions(){return e.flatDeep(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return e.flatDeep(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,i=this.filterPlaceHolder.replace("{0}",this.label);return o.html`
|
|
1592
1592
|
<div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
|
|
1593
1593
|
part="container">
|
|
1594
1594
|
${this.label||t?o.html`
|
|
@@ -1660,18 +1660,18 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1660
1660
|
.exportpartsPrefixes=${["values","available-values"]}
|
|
1661
1661
|
noValuesLabel="${this.noValuesLabel}"
|
|
1662
1662
|
></ft-filter-level>
|
|
1663
|
-
`}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;e.deepEqual(this.lastDispatchedValues,t)||(this.dispatchEvent(new
|
|
1663
|
+
`}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;e.deepEqual(this.lastDispatchedValues,t)||(this.dispatchEvent(new dn(t)),this.lastDispatchedValues=t)}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}un.elementDefinitions={"ft-button":Vi,"ft-filter-level":qr,"ft-snap-scroll":tn,"ft-typography":bo},un.styles=fn,hn([r.property({type:String})],un.prototype,"id",void 0),hn([r.property({type:String})],un.prototype,"label",void 0),hn([r.property({type:String})],un.prototype,"filterPlaceHolder",void 0),hn([r.property({type:String})],un.prototype,"clearButtonLabel",void 0),hn([r.property({type:String})],un.prototype,"moreValuesButtonLabel",void 0),hn([r.property({type:String})],un.prototype,"noValuesLabel",void 0),hn([e.jsonProperty([])],un.prototype,"options",void 0),hn([r.property({type:Boolean})],un.prototype,"multivalued",void 0),hn([r.property({type:Boolean})],un.prototype,"disabled",void 0),hn([r.property({type:Boolean})],un.prototype,"raiseSelectedOptions",void 0),hn([r.property({type:Number})],un.prototype,"displayedValuesLimit",void 0),hn([r.property({type:Boolean})],un.prototype,"hideClearButton",void 0),hn([r.query(".ft-filter--slot")],un.prototype,"slotElement",void 0),hn([r.query(".ft-filter--container")],un.prototype,"container",void 0),hn([r.query(".ft-filter--values")],un.prototype,"valuesContainer",void 0),hn([r.query(".ft-filter--levels")],un.prototype,"levelsContainer",void 0),hn([r.state()],un.prototype,"lastLevelHasHiddenvalues",void 0),hn([r.query(".ft-filter--filter input")],un.prototype,"filterInput",void 0),hn([r.queryAll(".ft-filter--levels ft-filter-level")],un.prototype,"levels",void 0),hn([r.state()],un.prototype,"withScroll",void 0),hn([r.state()],un.prototype,"filter",void 0),hn([r.state()],un.prototype,"slideIn",void 0),hn([r.state()],un.prototype,"slideOut",void 0);var gn=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 yn extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return o.html`
|
|
1664
1664
|
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1665
|
-
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}
|
|
1665
|
+
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}yn.elementDefinitions={},gn([r.property({type:String})],yn.prototype,"label",void 0),gn([r.property({type:Object,converter:t=>t})],yn.prototype,"value",void 0),gn([r.property({type:Boolean,reflect:!0})],yn.prototype,"selected",void 0),gn([r.property({type:Object})],yn.prototype,"subOptions",void 0),gn([e.jsonProperty({})],yn.prototype,"renderOption",void 0),gn([r.query(".ft-filter-option--slot")],yn.prototype,"slotElement",void 0),e.customElement("ft-filter")(un),e.customElement("ft-filter-option")(yn);const bn=mr.build("designedSearchType"),mn={label:"Search scope",documentTitlesOnly:"Search in document titles only"};var vn=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 xn extends(dr(Y)){constructor(){super(),this.addI18nContext(bn,mn)}render(){return o.html`
|
|
1666
1666
|
<ft-filter
|
|
1667
|
-
label=${
|
|
1668
|
-
.options=${[{label:
|
|
1667
|
+
label=${bn.messages.label()}
|
|
1668
|
+
.options=${[{label:bn.messages.documentTitlesOnly(),value:t=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setSearchInDocumentTitlesOnly(t)},selected:this.searchInDocumentTitlesOnly}]}
|
|
1669
1669
|
part="filter"
|
|
1670
1670
|
.exportpartsPrefixes=${["filter"]}
|
|
1671
1671
|
multivalued
|
|
1672
1672
|
@change=${this.onSelected}
|
|
1673
1673
|
></ft-filter>
|
|
1674
|
-
`}onSelected(t){var e;null===(e=this.filter)||void 0===e||e.options.forEach((t=>t.value(t.selected)))}}
|
|
1674
|
+
`}onSelected(t){var e;null===(e=this.filter)||void 0===e||e.options.forEach((t=>t.value(t.selected)))}}xn.elementDefinitions={"ft-filter":un},xn.styles=$r,vn([e.redux({selector:j})],xn.prototype,"searchInDocumentTitlesOnly",void 0),vn([r.query("ft-filter")],xn.prototype,"filter",void 0),e.customElement("ft-search-type")(xn);var On=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 wn extends(dr(Y)){get hasSomethingToDisplay(){var t;return this.searchInDocumentTitlesOnly||(null===(t=this.facets)||void 0===t?void 0:t.some((t=>this.getSelectedValues(t).length>0)))}constructor(){super(),this.addI18nContext(bn,mn)}render(){return this.hasSomethingToDisplay?o.html`
|
|
1675
1675
|
<div class="ft-search-selected-facets--container">
|
|
1676
1676
|
${i.repeat(this.facets||[],(t=>t.key),(t=>{const e=this.getSelectedValues(t);return i.repeat(e,(e=>t.key+"-"+e),(o=>this.renderFacet(t.key,t.label,e,o)))}))}
|
|
1677
1677
|
${this.renderSearchInDocumentTitlesOnly()}
|
|
@@ -1690,13 +1690,13 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
|
|
|
1690
1690
|
</ft-chip>
|
|
1691
1691
|
</ft-tooltip>
|
|
1692
1692
|
`}getSelectedValues(t){return e.flatDeep(t.rootNodes,(t=>t.selected?[]:t.childNodes)).filter((t=>t.selected)).map((t=>t.value))}getLabelFromValue(t){return this.unquote(t).split("|").pop()}getBreadcrumbFromValue(t){return this.unquote(t).split("|").join(" > ")}unquote(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}renderSearchInDocumentTitlesOnly(){return this.searchInDocumentTitlesOnly?o.html`
|
|
1693
|
-
<ft-tooltip inline text="${
|
|
1693
|
+
<ft-tooltip inline text="${bn.messages.documentTitlesOnly()}"
|
|
1694
1694
|
part="tooltips tooltip-search-in-document-titles-only">
|
|
1695
1695
|
<ft-chip
|
|
1696
1696
|
part="ft-search-selected-facets ft-search-selected-facet-search-in-document-titles-only"
|
|
1697
1697
|
removable
|
|
1698
1698
|
@icon-click=${()=>{var t;return null===(t=this.stateManager)||void 0===t?void 0:t.setSearchInDocumentTitlesOnly(!1)}}>
|
|
1699
|
-
${
|
|
1699
|
+
${bn.messages.documentTitlesOnly()}
|
|
1700
1700
|
</ft-chip>
|
|
1701
1701
|
</ft-tooltip>
|
|
1702
|
-
`:o.nothing}}
|
|
1702
|
+
`:o.nothing}}wn.elementDefinitions={"ft-chip":sr,"ft-tooltip":Pi},wn.styles=l,On([e.redux({store:"search"})],wn.prototype,"facets",void 0),On([e.redux({store:"search",selector:j})],wn.prototype,"searchInDocumentTitlesOnly",void 0),e.customElement("ft-search-selected-facets")(wn),t.FtSearchSelectedFacets=wn,t.FtSearchSelectedFacetsCssVariables=s,t.styles=l}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litRepeat,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
|