티스토리 수익 글 보기
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[[window.__cdn_packs_path__, “assets/cropper-CAo4KfeR.js”].join(”),[window.__cdn_packs_path__, “assets/GlobalSetup-M-1oWLNV.js”].join(”)])))=>i.map(i=>d[i]);
var j=Object.defineProperty,W=Object.defineProperties;var z=Object.getOwnPropertyDescriptors;var E=Object.getOwnPropertySymbols;var H=Object.prototype.hasOwnProperty,K=Object.prototype.propertyIsEnumerable;var F=(s,r,n)=>r in s?j(s,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):s[r]=n,$=(s,r)=>{for(var n in r||(r={}))H.call(r,n)&&F(s,n,r[n]);if(E)for(var n of E(r))K.call(r,n)&&F(s,n,r[n]);return s},A=(s,r)=>W(s,z(r));var w=(s,r,n)=>new Promise((a,h)=>{var c=o=>{try{p(n.next(o))}catch(f){h(f)}},u=o=>{try{p(n.throw(o))}catch(f){h(f)}},p=o=>o.done?a(o.value):Promise.resolve(o.value).then(c,u);p((n=n.apply(s,r)).next())});import{e as G,a as S,c as X,f as Y,D as J,i as Q}from”./sp-button-group-B-hQqj2b-Ds8Lc0Vu.js”;import{g as k,S as Z,v as ee,w as te,_ as re,u as I}from”./GlobalSetup-M-1oWLNV.js”;import{g as ie,a as ne}from”./post_login_action_creator_service-DR2eNAPj.js”;const oe=G`.browse-filter-title,.browse-filter-description{margin:4px 0}.browse-filter-image{aspect-ratio:4 / 3;width:100%}.browse-filter-link:focus-visible{outline:-webkit-focus-ring-color auto 3px;outline-offset:5px}`;var ae=Object.defineProperty,se=Object.getOwnPropertyDescriptor,v=(s,r,n,a)=>{for(var h,c=a>1?void 0:a?se(r,n):r,u=s.length-1;u>=0;u–)(h=s[u])&&(c=(a?h(r,n,c):h(c))||c);return a&&c&&ae(r,n,c),c};let _=class extends Y(J){static get styles(){return oe}connectedCallback(){super.connectedCallback(),this.enableClickTracking()}render(){if(this.src)return Q``}};v([S({type:String})],_.prototype,”description”,2),v([S({type:String})],_.prototype,”href”,2),v([S({type:String})],_.prototype,”src”,2),v([S({type:String})],_.prototype,”title”,2),_=v([X(“af-browse-filter-card”)],_);const ce=k(Z),le=k(ee);var b,D;function ve(){if(D)return b;D=1,c.$inject=[“$document”,”$scope”,”$window”,”DataService”,”FamilyAutocompleteSearchService”,”NewrelicService”,”NewrelicClickTrackerService”];const s=ce,r=le,n=te;var a=500,h=768;function c(u,p,o,f,i,e,t){if(this.$document=u,this.$window=o,this.DataService=f,this.FamilyAutocompleteSearchService=i,this.NewrelicService=e,this._preloadData(),o.addEventListener(“resize”,function(){p.$apply()}),!n.getData(“project_crossbar_data”)){t.init({page:”marketplace_homepage”});var l=this;o.addEventListener(“beforeunload”,function(){l.NewrelicService.addPageAction(“typekit.marketplace_homepage.page_exit”)})}o.addEventListener(r.EVENT_NAME,function(m){const{searchValue:g}=m.detail;g&&(window.location.href=`/search?query=${encodeURIComponent(g)}`)})}return c.prototype._webComponents_initSearchBar=function(){var u=this;const p=document.querySelector(“#homepage-searchbar”);p&&p.addEventListener(s.EVENT_NAME,function(f){u.FamilyAutocompleteSearchService.get(f.detail.searchParam).then(function(i){p.results=i.data})});const o=document.querySelector(“#hero-searchbar”);o&&o.addEventListener(s.EVENT_NAME,function(f){u.FamilyAutocompleteSearchService.get(f.detail.searchParam).then(function(i){o.results=i.data})})},c.prototype.getSmallScreenClass=function(){return this.$window.innerWidthw(this,null,function*(){const{default:a}=yield import(“./cropper-CAo4KfeR.js”).then(h=>h.c);return{default:a}}),__vite__mapDeps([0,1]),import.meta.url);return new Promise(a=>{const h=new n(s,A($({},r),{ready:()=>a(h)}))})})}const pe=Object.freeze(Object.defineProperty({__proto__:null,getCropper:ue},Symbol.toStringTag,{value:”Module”})),he=k(pe);var C,P;function ye(){if(P)return C;P=1,i.$inject=[“$document”,”$http”,”$q”,”$scope”,”$window”,”DataService”,”DialogService”,”FilterVariationsService”,”I18nService”,”NewrelicService”,”ScrollService”,”UserPrefsService”,”VisualSearchService”];var s=ne,{getCropper:r}=he,n=I;const a=ie.default;var h=13,c=”visual-searches–loading”,u=/(fonts\/vs\/[^\/]*)(\/)*(.*)*/,p=”text”,o=[“upload”,”select”,”confirm”,”results”],f=1e3;function i(e,t,l,m,g,y,N,q,O,U,B,L,M){var d=this;d.$document=e,d.$http=t,d.$q=l,d.$scope=m,d.$window=g,d.DataService=y,d.DialogService=N,d.FilterVariationsService=q,d.I18nService=O,d.NewrelicService=U,d.ScrollService=B,d.VisualSearchService=M,d.UserPrefsService=L,d.filterValues=[],d._init()}return i.prototype.filterFontsByRequiredActions=function(e){var t=this.FilterVariationsService.filterRequiredActionsByToggles(this.fonts,e);this.preferredAction=t.preferred,this.filteredFonts=this.FilterVariationsService.filterFontsByRequiredActions(this.fonts,t.filters)},i.prototype.showPaidFontsSelected=function(){return this.showPaidFonts},i.prototype.showTipsModal=function(){var e=this;e.DialogService.show(“/angular_templates/dialogs/visual_search_tips.html”,{closeOnDrag:!0}).then(function(){e.NewrelicService.addPageAction(“typekit.render.visual-search.search-tips-modal”)})},i.prototype.handleExampleTextKeyup=function(e){e.key===”Enter”||e.keyCode===h?this.handleNextButtonClick():(this._userEnteredText=e.target.value,this._updateExampleText(e.target.value))},i.prototype.handleNextButtonClick=function(){this.loadStep(this._getNextStep())},i.prototype.handleStartOverClick=function(){this._setCurrentStep(o[0],!0)},i.prototype.handlePreviousClick=function(){var e=o.indexOf(this._currentStep),t=o[e-1];this._setCurrentStep(t,!0)},i.prototype.fontVariationCardsClass=function(){return this.viewType===”grid”?”spectrum-grid-row font-variations-grid-view”:””},i.prototype.getExampleTextValue=function(){return this._userEnteredText||this.extractedText},i.prototype.loadStep=function(e){var t=this;t._currentStep!=e&&(t._currentStep==o[1]?t._updateResultsForCoordinates().then(function(){t._setCurrentStep(e,!0),t._updateExampleText(t._userEnteredText||t.extractedText),t._scrollToTop()}):(t._setCurrentStep(e,!0),t._scrollToTop()))},i.prototype.isCurrentStep=function(e){return this._currentStep==e},i.prototype.isConfirmationImageVisible=function(){switch(this._currentStep){case o[0]:return!1;case o[1]:return!1;default:return!0}},i.prototype.isFontListEmpty=function(){return this.fonts.length===0},i.prototype.isFilteredFontListEmpty=function(){return this.filteredFonts.length===0},i.prototype.getSimilarFontCountForDisplay=function(){return this.filteredFonts.length>1?this.I18nService.getMessage(this._i18n,”neue.visual_search.results_page.similar_fonts_plural”,{num_fonts:this.filteredFonts.length}):this.filteredFonts.length===1?this.I18nService.getMessage(this._i18n,”neue.visual_search.results_page.similar_font_singular”,{num_fonts:1}):this.I18nService.getMessage(this._i18n,”neue.visual_search.results_page.similar_fonts_plural”,{num_fonts:0})},i.prototype._getCropperCoordinates=function(){var e=this.cropper.getData();return{x_min:e.x,y_min:e.y,x_max:e.x+e.width,y_max:e.y+e.height}},i.prototype._getCropperData=function(e){if(e.coordinates&&Object.keys(e.coordinates).length!=0)return{x:e.coordinates.x_min,y:e.coordinates.y_min,width:e.coordinates.x_max-e.coordinates.x_min,height:e.coordinates.y_max-e.coordinates.y_min};if(e.detectedRegion&&Object.keys(e.detectedRegion).length!=0){var t=e.detectedRegion;return{x:t.x_min,y:t.y_min,width:t.x_max-t.x_min,height:t.y_max-t.y_min}}return{}},i.prototype._getNextStep=function(){var e=o.indexOf(this._currentStep);return e+1{t.cropper=l})},i.prototype._preloadImage=function(){var e=this;return e.$q(function(t){e.image=e.$document[0].getElementById(“visual-searches__image-cropper-image”),e.$http({method:”GET”,url:e.image.getAttribute(“data-src”),responseType:”blob”}).then(function(l){e.image.onload=t,e.image.src=e.$window.URL.createObjectURL(l.data)})})},i.prototype._scrollToTop=function(){var e=this.$document[0].querySelector(“#visual-search-heading”);this.ScrollService.scrollUpTo(e,f)},i.prototype._setMaxContainerDimensions=function(){var e=this,t=e.$document[0].getElementById(“visual-searches__image-cropper”);t.style.maxWidth=e.image.naturalWidth+”px”,t.style.maxHeight=e.image.naturalHeight+”px”},i.prototype._preloadData=function(){var e=this;return e.$q.all([e.UserPrefsService.getUserPrefs().then(function(t){e.showPaidFonts=!!t.showPaidFonts}),e.$q(function(t){e.DataService.get(“/neue/preloaded_variation_data”).then(function(l){e._currentStep=l.step,l.step!=o[0]&&(e.fonts=l.fonts,e.extractedText=l.detectedText,e.visualSearchOpaqueId=l.visualSearchOpaqueId,e.textSamples=l.textSampleData.textSamples,e.textSampleData=l.textSampleData),e.showUpgradeActionToggle=e.FilterVariationsService.hasUpgradeFilterOption(e.fonts),e.filterFontsByRequiredActions(),a.getSearchParam(p)&&(e._userEnteredText=decodeURIComponent(a.getSearchParam(p))),e._updateExampleText(e._userEnteredText||e.extractedText),t(l)}),e.DataService.get(“/visual_search/i18n”).then(function(l){e._i18n=l})})])},i.prototype._setCurrentStep=function(e,t){this._currentStep=e,this.NewrelicService.addPageAction(“typekit.render.visual-search.step”,{step:e}),t&&a.pushState(null,null,this._getUrlForStep(e)),e!=o[0]&&this._storeDataInUrl()},i.prototype._setLoadingState=function(){s.element(this.$document[0].body).addClass(c)},i.prototype._showCroppedImage=function(){var e=this.cropper.getCroppedCanvas();this._confirmationCanvas.parentNode.replaceChild(e,this._confirmationCanvas),this._confirmationCanvas=e},i.prototype._storeDataInUrl=function(){var e=this,t=e._getCropperCoordinates();this._userEnteredText&&(t[p]=encodeURIComponent(this._userEnteredText)),a.setSearchParams(t)},i.prototype._unsetLoadingState=function(){s.element(this.$document[0].body).removeClass(c)},i.prototype._updateExampleText=function(e){this.exampleText={size:50,value:e}},i.prototype._updateResultsForCoordinates=function(){var e=this;return e.$q(function(t){e._setLoadingState(),e.VisualSearchService.put(e.visualSearchOpaqueId,e._getCropperCoordinates()).then(function(l){e._showCroppedImage(),e.extractedText=l.data.text,e.fonts=l.data.fonts;var m={upgrade:e.showPaidFonts},g=e.FilterVariationsService.filterRequiredActionsByToggles(e.fonts,m);e.filteredFonts=e.FilterVariationsService.filterFontsByRequiredActions(e.fonts,g.filters);var y={fontCount:e.fonts.length};e.fonts.length>0&&(y.topResult=n.first(n.pluck(e.fonts,”name”))),e.NewrelicService.addPageAction(“typekit.render.visual-search”,y),t(),e._unsetLoadingState()})})},C=i,C}var x,V;function de(){if(V)return x;V=1,r.$inject=[“$scope”,”FeedbackService”,”NewrelicService”];var s=I;function r(n,a,h){var c=this;c.FeedbackService=a,c.NewrelicService=h,n.$watch(function(){return c.FeedbackService.getSubmittedFeedback(c._getID(),c.familySlug())},function(u){c.selectedFeedback=u})}return r.prototype.areThumbsUpDownVisible=function(){return!this.isSimilarityAndPairingVariant()},r.prototype.isCancelButtonVisible=function(){return this.isSimilarityAndPairingVariant()},r.prototype.isSimilarityAndPairingVariant=function(){return this._isFontSimilarityVariant()||this._isFontPairingVariant()},r.prototype.initSelectedFeedback=function(){return s.isEmpty(this.selectedFeedback)?”positive”:”negative”},r.prototype.toggleSelectedFeedback=function(){return this.selectedFeedback===”negative”?”positive”:”negative”},r.prototype.getClass=function(n,a){return this.selectedFeedback===n?[a,”on”].join(” “):a},r.prototype.getTooltipClass=function(){return this.isCancelButtonVisible()?this.selectedFeedback===”negative”?”spectrum-Tooltip–bottom flag-icon-tooltip on”:”spectrum-Tooltip–bottom flag-icon-tooltip”:”spectrum-Tooltip–top”},r.prototype.handleClick=function(n,a){n&&(n.preventDefault(),n.stopPropagation()),this.selectedFeedback=a,this.isSimilarityAndPairingVariant()?(this.NewrelicService.addPageAction(“typekit.browse.similarity_and_pairing.feedback”,this._getNewRelicAttributes(a)),this.FeedbackService.post(this.category(),this.subcategory(),this._getID(),a,this.familySlug(),this.variationOne().id,this.variationTwo().id)):(this.NewrelicService.addPageAction(“typekit.browse.click”,this._getNewRelicAttributes(a)),this.FeedbackService.post(this.category(),this.subcategory(),this._getID(),a,this.familySlug()))},r.prototype._getID=function(){if(this._isTagVariant())return this.FeedbackService.filtersModel.getSelectedTag();if(this._isRecommendationVariant())return this.user();if(this.isSimilarityAndPairingVariant())return this.variationOne().id+”-“+this.variationTwo().id;throw new Error(“Unrecognized feedback icon category: “+this.category())},r.prototype._isFontPairingVariant=function(){return this.category()===”pairing”},r.prototype._isFontSimilarityVariant=function(){return this.category()===”similarity”},r.prototype._isRecommendationVariant=function(){return this.category()===”recommendation”},r.prototype._isTagVariant=function(){return this.category()===”tag”},r.prototype._getNewRelicAttributes=function(n){if(this._isTagVariant())return{tagName:this.FeedbackService.filtersModel.getSelectedTag(),familySlug:this.familySlug(),feedback:n};if(this._isRecommendationVariant())return{familySlug:this.familySlug(),feedback:n,subcategory:this.subcategory(),user:this.user()};if(this.isSimilarityAndPairingVariant())return{category:this.category(),subcategory:this.subcategory(),feedback:n,variation_one:this.variationOne().name,variation_two:this.variationTwo().name};throw new Error(“Unrecognized feedback icon category: “+this.category())},x=r,x}var T,R;function Se(){if(R)return T;R=1;function s(){return{scope:{},bindToController:{category:”&”,familySlug:”&”,subcategory:”&”,tooltipText:”&”,user:”&”,variationOne:”&”,variationTwo:”&”,selectedFeedback:”=”},controller:de(),controllerAs:”feedbackIcons”,restrict:”E”,replace:!0,templateUrl:”/angular_templates/directives/feedback_icons.html”}}return T=s,T}export{ye as a,Se as b,ce as c,ve as r};
//# sourceMappingURL=directive-Ftjvw18z.js.map